9remote 2.0.26 → 2.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/server.cjs CHANGED
@@ -1,38 +1,38 @@
1
1
  const __importMetaUrl = require('url').pathToFileURL(__filename).href;
2
- var TO=Object.create;var ka=Object.defineProperty;var CO=Object.getOwnPropertyDescriptor;var AO=Object.getOwnPropertyNames;var RO=Object.getPrototypeOf,kO=Object.prototype.hasOwnProperty;var Te=(r,e)=>()=>(r&&(e=r(r=0)),e);var O=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Xr=(r,e)=>{for(var t in e)ka(r,t,{get:e[t],enumerable:!0})},ov=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of AO(e))!kO.call(r,i)&&i!==t&&ka(r,i,{get:()=>e[i],enumerable:!(n=CO(e,i))||n.enumerable});return r};var X=(r,e,t)=>(t=r!=null?TO(RO(r)):{},ov(e||!r||!r.__esModule?ka(t,"default",{value:r,enumerable:!0}):t,r)),OO=r=>ov(ka({},"__esModule",{value:!0}),r);var ki={};Xr(ki,{createRouter:()=>vp,jsonErr:()=>he,jsonOk:()=>ee,parseJsonBody:()=>It});function GO(r){return new Promise(e=>{let t="";r.on("data",n=>t+=n),r.on("end",()=>e(t))})}function ee(r,e={ok:!0}){r.setHeader("Content-Type","application/json"),r.writeHead(200),r.end(JSON.stringify(e))}function he(r,e,t){r.setHeader("Content-Type","application/json"),r.writeHead(e),r.end(JSON.stringify({error:t}))}async function It(r,e){try{let t=await GO(r);return JSON.parse(t||"{}")}catch{return he(e,400,"Invalid JSON"),null}}function vp(r,{fallback:e}={}){let t=new Map,n=[];for(let a of r){let c=a.method==="*"?["GET","POST","PUT","DELETE"]:[a.method];for(let u of c)a.path.endsWith("/*")?n.push({...a,prefix:a.path.slice(0,-2),method:u}):t.set(`${u}:${a.path}`,a)}let i=new Set,s=[];for(let a of r)a.public&&(a.path.endsWith("/*")?s.push(a.path.slice(0,-2)):i.add(a.path));function o(a){return i.has(a)?!0:s.some(c=>a.startsWith(c))}return async(a,c)=>{let u=(0,yv.parse)(a.url,!0),{pathname:p,search:f}=u,m=!!a.headers["cf-connecting-ip"],y=a.socket.remoteAddress==="127.0.0.1"||a.socket.remoteAddress==="::1";if(!o(p)&&(m||!y)){he(c,403,"Forbidden");return}let _=`${a.method}:${p}`,S=t.get(_);if(S){try{await S.handler(a,c,{pathname:p,query:u.query,search:f})}catch(A){console.error("Error:",a.url,A),he(c,500,A.message)}return}for(let A of n)if(A.method===a.method&&p.startsWith(A.prefix)){try{await A.handler(a,c,{pathname:p,query:u.query,search:f})}catch(P){console.error("Error:",a.url,P),he(c,500,P.message)}return}if(e){try{await e(a,c,{pathname:p,search:f})}catch(A){console.error("Error:",a.url,A),he(c,500,A.message)}return}he(c,404,"Not found")}}var yv,Gt=Te(()=>{yv=require("url")});function eo(r,e={}){return fetch(r,{...e,headers:{...KO,...e.headers}})}var Na,Jr,bv,Cn,oe,wv,xp,zO,Ia,_v,La,Qs,yp,Oi,Sv,Ev,Tv,Zs,Cv,Av,KO,gt=Te(()=>{Na=X(require("dns"),1),Jr=X(require("path"),1),bv=X(require("os"),1),Cn=Jr.default.join(bv.default.homedir(),".9remote"),oe={ROOT:Cn,LOGS:Jr.default.join(Cn,"logs"),STATE:Jr.default.join(Cn,"state"),CONFIG:Jr.default.join(Cn,"config"),BIN:Jr.default.join(Cn,"bin"),PIDS:Jr.default.join(Cn,"pids"),BUFFERS:Jr.default.join(Cn,"buffers"),DAEMON:Jr.default.join(Cn,"daemon")},wv=new Na.default.promises.Resolver;wv.setServers(["1.1.1.1","1.0.0.1","8.8.8.8"]);xp=Na.default.lookup,zO=/^(\d{1,3}\.){3}\d{1,3}$|^::1$|^[0-9a-f:]+$/i;Na.default.lookup=(r,e,t)=>{if(typeof e=="function"&&(t=e,e={}),r==="localhost"||zO.test(r))return xp(r,e,t);wv.resolve4(r).then(n=>{if(!n?.length)return xp(r,e,t);e.all?t(null,n.map(i=>({address:i,family:4}))):t(null,n[0],4)}).catch(()=>xp(r,e,t))};Ia=2208,_v=5173,La=[`http://localhost:${Ia}`,`http://127.0.0.1:${Ia}`,`http://localhost:${_v}`,`http://127.0.0.1:${_v}`],Qs={fileName:"agent.log",rotatedName:"agent.log.1",maxBytes:2*1024*1024,cleanupAfterDays:7},yp=60,Oi={STOPPED:0,PREPARING:1,CONNECTING:2,TUNNELING:3,VERIFYING:4,READY:5},Sv=5e3,Ev=1e3,Tv=6e4,Zs={CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN:"1"},Cv=["claude","codex","gemini","opencode"],Av={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode"},KO={Accept:"application/json, text/plain, */*","Accept-Language":"en-US,en;q=0.9","Cache-Control":"no-cache",Pragma:"no-cache","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"}});function VO(){Ir.default.existsSync(Da)||Ir.default.mkdirSync(Da,{recursive:!0})}function YO(){try{if(Ir.default.statSync(Ba).size<Qs.maxBytes)return;try{Ir.default.rmSync(ja,{force:!0})}catch{}Ir.default.renameSync(Ba,ja)}catch{}}function XO(){try{let r=Ir.default.statSync(ja);Date.now()-r.mtimeMs>Qs.cleanupAfterDays*864e5&&Ir.default.rmSync(ja,{force:!0})}catch{}}function Sp(r){try{YO(),Ir.default.appendFileSync(Ba,r+`
3
- `)}catch{}}function _p(r){return r.map(e=>{if(e instanceof Error)return e.stack||e.message;if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)}).join(" ")}function kv(){let r=new Date,e=(t,n=2)=>String(t).padStart(n,"0");return`${e(r.getHours())}:${e(r.getMinutes())}:${e(r.getSeconds())}.${e(r.getMilliseconds(),3)}`}function ZO(r){return String(r).replace(JO,"").replace(QO,"").replace(/\s+$/g,"")}function to(r,e,t){let n=ZO(t);if(!n)return;let i=e==="info"?r:`${r}:${e}`,s=`${kv()} [${i}] ${n}`;if(Sp(s),bp)try{bp(s)}catch{}}function eP(){process.on("uncaughtException",r=>to("crash","error",`uncaughtException: ${r?.stack||r?.message||r}`)),process.on("unhandledRejection",r=>{let e=r instanceof Error?r.stack||r.message:String(r);to("crash","error",`unhandledRejection: ${e}`)}),process.on("exit",r=>Sp(`${kv()} [exit] code=${r} pid=${process.pid}`))}function Ov(){Rv||(Rv=!0,VO(),XO(),Sp(`
4
- === SESSION ${new Date().toISOString()} pid=${process.pid} argv=${process.argv.slice(2).join(" ")} ===`),eP())}function Pv(r){bp=r}function Mv(r=60){try{return Ir.default.readFileSync(Ba,"utf8").split(`
5
- `).filter(Boolean).slice(-r)}catch{return[]}}function An(r){return{info:(...e)=>to(r,"info",_p(e)),warn:(...e)=>to(r,"warn",_p(e)),error:(...e)=>to(r,"error",_p(e))}}var Ir,wp,Da,Ba,ja,Rv,bp,JO,QO,Pi=Te(()=>{Ir=X(require("fs"),1),wp=X(require("path"),1);gt();Da=oe.LOGS,Ba=wp.default.join(Da,Qs.fileName),ja=wp.default.join(Da,Qs.rotatedName),Rv=!1,bp=null;JO=/\x1b\[[0-9;]*m/g,QO=/https?:\/\/[^\s]+/g});var Dv=O((D4,Ep)=>{"use strict";Ep.exports=Lv;Ep.exports.preferredCharsets=Lv;var tP=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function rP(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var i=nP(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function nP(r,e){var t=tP.exec(r);if(!t)return null;var n=t[1],i=1;if(t[2])for(var s=t[2].split(";"),o=0;o<s.length;o++){var a=s[o].trim().split("=");if(a[0]==="q"){i=parseFloat(a[1]);break}}return{charset:n,q:i,i:e}}function iP(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=sP(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function sP(r,e,t){var n=0;if(e.charset.toLowerCase()===r.toLowerCase())n|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function Lv(r,e){var t=rP(r===void 0?"*":r||"");if(!e)return t.filter(Nv).sort(Iv).map(oP);var n=e.map(function(s,o){return iP(s,t,o)});return n.filter(Nv).sort(Iv).map(function(s){return e[n.indexOf(s)]})}function Iv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function oP(r){return r.charset}function Nv(r){return r.q>0}});var $v=O((B4,Tp)=>{"use strict";Tp.exports=Hv;Tp.exports.preferredEncodings=Hv;var aP=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function cP(r){for(var e=r.split(","),t=!1,n=1,i=0,s=0;i<e.length;i++){var o=lP(e[i].trim(),i);o&&(e[s++]=o,t=t||Fv("identity",o),n=Math.min(n,o.q||1))}return t||(e[s++]={encoding:"identity",q:n,i}),e.length=s,e}function lP(r,e){var t=aP.exec(r);if(!t)return null;var n=t[1],i=1;if(t[2])for(var s=t[2].split(";"),o=0;o<s.length;o++){var a=s[o].trim().split("=");if(a[0]==="q"){i=parseFloat(a[1]);break}}return{encoding:n,q:i,i:e}}function uP(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=Fv(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function Fv(r,e,t){var n=0;if(e.encoding.toLowerCase()===r.toLowerCase())n|=1;else if(e.encoding!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function Hv(r,e){var t=cP(r||"");if(!e)return t.filter(jv).sort(Bv).map(pP);var n=e.map(function(s,o){return uP(s,t,o)});return n.filter(jv).sort(Bv).map(function(s){return e[n.indexOf(s)]})}function Bv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function pP(r){return r.encoding}function jv(r){return r.q>0}});var zv=O((j4,Cp)=>{"use strict";Cp.exports=Gv;Cp.exports.preferredLanguages=Gv;var fP=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function dP(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var i=Wv(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function Wv(r,e){var t=fP.exec(r);if(!t)return null;var n=t[1],i=t[2],s=n;i&&(s+="-"+i);var o=1;if(t[3])for(var a=t[3].split(";"),c=0;c<a.length;c++){var u=a[c].split("=");u[0]==="q"&&(o=parseFloat(u[1]))}return{prefix:n,suffix:i,q:o,i:e,full:s}}function hP(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=mP(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function mP(r,e,t){var n=Wv(r);if(!n)return null;var i=0;if(e.full.toLowerCase()===n.full.toLowerCase())i|=4;else if(e.prefix.toLowerCase()===n.full.toLowerCase())i|=2;else if(e.full.toLowerCase()===n.prefix.toLowerCase())i|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s:i}}function Gv(r,e){var t=dP(r===void 0?"*":r||"");if(!e)return t.filter(Uv).sort(qv).map(gP);var n=e.map(function(s,o){return hP(s,t,o)});return n.filter(Uv).sort(qv).map(function(s){return e[n.indexOf(s)]})}function qv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function gP(r){return r.full}function Uv(r){return r.q>0}});var Qv=O((F4,Ap)=>{"use strict";Ap.exports=Xv;Ap.exports.preferredMediaTypes=Xv;var vP=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function xP(r){for(var e=SP(r),t=0,n=0;t<e.length;t++){var i=Yv(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function Yv(r,e){var t=vP.exec(r);if(!t)return null;var n=Object.create(null),i=1,s=t[2],o=t[1];if(t[3])for(var a=EP(t[3]).map(wP),c=0;c<a.length;c++){var u=a[c],p=u[0].toLowerCase(),f=u[1],m=f&&f[0]==='"'&&f[f.length-1]==='"'?f.substr(1,f.length-2):f;if(p==="q"){i=parseFloat(m);break}n[p]=m}return{type:o,subtype:s,params:n,q:i,i:e}}function yP(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=_P(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function _P(r,e,t){var n=Yv(r),i=0;if(!n)return null;if(e.type.toLowerCase()==n.type.toLowerCase())i|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==n.subtype.toLowerCase())i|=2;else if(e.subtype!="*")return null;var s=Object.keys(e.params);if(s.length>0)if(s.every(function(o){return e.params[o]=="*"||(e.params[o]||"").toLowerCase()==(n.params[o]||"").toLowerCase()}))i|=1;else return null;return{i:t,o:e.i,q:e.q,s:i}}function Xv(r,e){var t=xP(r===void 0?"*/*":r||"");if(!e)return t.filter(Vv).sort(Kv).map(bP);var n=e.map(function(s,o){return yP(s,t,o)});return n.filter(Vv).sort(Kv).map(function(s){return e[n.indexOf(s)]})}function Kv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function bP(r){return r.type+"/"+r.subtype}function Vv(r){return r.q>0}function Jv(r){for(var e=0,t=0;(t=r.indexOf('"',t))!==-1;)e++,t++;return e}function wP(r){var e=r.indexOf("="),t,n;return e===-1?t=r:(t=r.substr(0,e),n=r.substr(e+1)),[t,n]}function SP(r){for(var e=r.split(","),t=1,n=0;t<e.length;t++)Jv(e[n])%2==0?e[++n]=e[t]:e[n]+=","+e[t];return e.length=n+1,e}function EP(r){for(var e=r.split(";"),t=1,n=0;t<e.length;t++)Jv(e[n])%2==0?e[++n]=e[t]:e[n]+=";"+e[t];e.length=n+1;for(var t=0;t<e.length;t++)e[t]=e[t].trim();return e}});var Zv=O((H4,Rp)=>{"use strict";var TP=Dv(),CP=$v(),AP=zv(),RP=Qv();Rp.exports=le;Rp.exports.Negotiator=le;function le(r){if(!(this instanceof le))return new le(r);this.request=r}le.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]};le.prototype.charsets=function(e){return TP(this.request.headers["accept-charset"],e)};le.prototype.encoding=function(e){var t=this.encodings(e);return t&&t[0]};le.prototype.encodings=function(e){return CP(this.request.headers["accept-encoding"],e)};le.prototype.language=function(e){var t=this.languages(e);return t&&t[0]};le.prototype.languages=function(e){return AP(this.request.headers["accept-language"],e)};le.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]};le.prototype.mediaTypes=function(e){return RP(this.request.headers.accept,e)};le.prototype.preferredCharset=le.prototype.charset;le.prototype.preferredCharsets=le.prototype.charsets;le.prototype.preferredEncoding=le.prototype.encoding;le.prototype.preferredEncodings=le.prototype.encodings;le.prototype.preferredLanguage=le.prototype.language;le.prototype.preferredLanguages=le.prototype.languages;le.prototype.preferredMediaType=le.prototype.mediaType;le.prototype.preferredMediaTypes=le.prototype.mediaTypes});var ex=O(($4,kP)=>{kP.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var rx=O((q4,tx)=>{tx.exports=ex()});var sx=O(Nt=>{"use strict";var Fa=rx(),OP=require("path").extname,nx=/^\s*([^;\s]*)(?:;|\s|$)/,PP=/^text\//i;Nt.charset=ix;Nt.charsets={lookup:ix};Nt.contentType=MP;Nt.extension=IP;Nt.extensions=Object.create(null);Nt.lookup=NP;Nt.types=Object.create(null);LP(Nt.extensions,Nt.types);function ix(r){if(!r||typeof r!="string")return!1;var e=nx.exec(r),t=e&&Fa[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&PP.test(e[1])?"UTF-8":!1}function MP(r){if(!r||typeof r!="string")return!1;var e=r.indexOf("/")===-1?Nt.lookup(r):r;if(!e)return!1;if(e.indexOf("charset")===-1){var t=Nt.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function IP(r){if(!r||typeof r!="string")return!1;var e=nx.exec(r),t=e&&Nt.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function NP(r){if(!r||typeof r!="string")return!1;var e=OP("x."+r).toLowerCase().substr(1);return e&&Nt.types[e]||!1}function LP(r,e){var t=["nginx","apache",void 0,"iana"];Object.keys(Fa).forEach(function(i){var s=Fa[i],o=s.extensions;if(!(!o||!o.length)){r[i]=o;for(var a=0;a<o.length;a++){var c=o[a];if(e[c]){var u=t.indexOf(Fa[e[c]].source),p=t.indexOf(s.source);if(e[c]!=="application/octet-stream"&&(u>p||u===p&&e[c].substr(0,12)==="application/"))continue}e[c]=i}}})}});var Ha=O((W4,ox)=>{"use strict";var DP=Zv(),BP=sx();ox.exports=zt;function zt(r){if(!(this instanceof zt))return new zt(r);this.headers=r.headers,this.negotiator=new DP(r)}zt.prototype.type=zt.prototype.types=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}if(!e||e.length===0)return this.negotiator.mediaTypes();if(!this.headers.accept)return e[0];var n=e.map(jP),i=this.negotiator.mediaTypes(n.filter(FP)),s=i[0];return s?e[n.indexOf(s)]:!1};zt.prototype.encoding=zt.prototype.encodings=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}return!e||e.length===0?this.negotiator.encodings():this.negotiator.encodings(e)[0]||!1};zt.prototype.charset=zt.prototype.charsets=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}return!e||e.length===0?this.negotiator.charsets():this.negotiator.charsets(e)[0]||!1};zt.prototype.lang=zt.prototype.langs=zt.prototype.language=zt.prototype.languages=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}return!e||e.length===0?this.negotiator.languages():this.negotiator.languages(e)[0]||!1};function jP(r){return r.indexOf("/")===-1?BP.lookup(r):r}function FP(r){return typeof r=="string"}});var Op=O((ax,cx)=>{var ro=require("crypto"),kp=function(){};kp.prototype.getRandomBytes=function(r){var e=4096,t=this;if(r=r||12,r>e)return ro.randomBytes(r);var n=parseInt(e/r),i=parseInt(n*.85);if(!i||(this.bytesBufferIndex==null&&(this.bytesBufferIndex=-1),this.bytesBufferIndex==n&&(this.bytesBuffer=null,this.bytesBufferIndex=-1),(this.bytesBufferIndex==-1||this.bytesBufferIndex>i)&&(this.isGeneratingBytes||(this.isGeneratingBytes=!0,ro.randomBytes(e,function(o,a){t.bytesBuffer=a,t.bytesBufferIndex=0,t.isGeneratingBytes=!1})),this.bytesBufferIndex==-1)))return ro.randomBytes(r);var s=this.bytesBuffer.slice(r*this.bytesBufferIndex,r*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,s};kp.prototype.generateId=function(){var r=Buffer.alloc(15);return r.writeInt32BE?(this.sequenceNumber=this.sequenceNumber+1|0,r.writeInt32BE(this.sequenceNumber,11),ro.randomBytes?this.getRandomBytes(12).copy(r):[0,4,8].forEach(function(e){r.writeInt32BE(Math.random()*Math.pow(2,32)|0,e)}),r.toString("base64").replace(/\//g,"_").replace(/\+/g,"-")):Math.abs(Math.random()*Math.random()*Date.now()|0).toString()+Math.abs(Math.random()*Math.random()*Date.now()|0).toString()};ax=cx.exports=new kp});var $a=O(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.ERROR_PACKET=Rn.PACKET_TYPES_REVERSE=Rn.PACKET_TYPES=void 0;var Nr=Object.create(null);Rn.PACKET_TYPES=Nr;Nr.open="0";Nr.close="1";Nr.ping="2";Nr.pong="3";Nr.message="4";Nr.upgrade="5";Nr.noop="6";var lx=Object.create(null);Rn.PACKET_TYPES_REVERSE=lx;Object.keys(Nr).forEach(r=>{lx[Nr[r]]=r});var HP={type:"error",data:"parser error"};Rn.ERROR_PACKET=HP});var px=O(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.encodePacket=void 0;Mi.encodePacketToBinary=UP;var $P=$a(),qP=({type:r,data:e},t,n)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?n(t?e:"b"+ux(e,!0).toString("base64")):n($P.PACKET_TYPES[r]+(e||""));Mi.encodePacket=qP;var ux=(r,e)=>Buffer.isBuffer(r)||r instanceof Uint8Array&&!e?r:r instanceof ArrayBuffer?Buffer.from(r):Buffer.from(r.buffer,r.byteOffset,r.byteLength),Pp;function UP(r,e){if(r.data instanceof ArrayBuffer||ArrayBuffer.isView(r.data))return e(ux(r.data,!1));(0,Mi.encodePacket)(r,!0,t=>{Pp||(Pp=new TextEncoder),e(Pp.encode(t))})}});var dx=O(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.decodePacket=void 0;var qa=$a(),WP=(r,e)=>{if(typeof r!="string")return{type:"message",data:fx(r,e)};let t=r.charAt(0);if(t==="b"){let n=Buffer.from(r.substring(1),"base64");return{type:"message",data:fx(n,e)}}return qa.PACKET_TYPES_REVERSE[t]?r.length>1?{type:qa.PACKET_TYPES_REVERSE[t],data:r.substring(1)}:{type:qa.PACKET_TYPES_REVERSE[t]}:qa.ERROR_PACKET};Ua.decodePacket=WP;var fx=(r,e)=>e==="arraybuffer"?r instanceof ArrayBuffer?r:Buffer.isBuffer(r)?r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength):r.buffer:Buffer.isBuffer(r)?r:Buffer.from(r)});var no=O(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.decodePayload=Lt.decodePacket=Lt.encodePayload=Lt.encodePacket=Lt.protocol=void 0;Lt.createPacketEncoderStream=KP;Lt.createPacketDecoderStream=VP;var Ip=px();Object.defineProperty(Lt,"encodePacket",{enumerable:!0,get:function(){return Ip.encodePacket}});var Np=dx();Object.defineProperty(Lt,"decodePacket",{enumerable:!0,get:function(){return Np.decodePacket}});var hx=$a(),mx="",GP=(r,e)=>{let t=r.length,n=new Array(t),i=0;r.forEach((s,o)=>{(0,Ip.encodePacket)(s,!1,a=>{n[o]=a,++i===t&&e(n.join(mx))})})};Lt.encodePayload=GP;var zP=(r,e)=>{let t=r.split(mx),n=[];for(let i=0;i<t.length;i++){let s=(0,Np.decodePacket)(t[i],e);if(n.push(s),s.type==="error")break}return n};Lt.decodePayload=zP;function KP(){return new TransformStream({transform(r,e){(0,Ip.encodePacketToBinary)(r,t=>{let n=t.length,i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);let s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,n)}else{i=new Uint8Array(9);let s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(n))}r.data&&typeof r.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}var Mp;function Wa(r){return r.reduce((e,t)=>e+t.length,0)}function Ga(r,e){if(r[0].length===e)return r.shift();let t=new Uint8Array(e),n=0;for(let i=0;i<e;i++)t[i]=r[0][n++],n===r[0].length&&(r.shift(),n=0);return r.length&&n<r[0].length&&(r[0]=r[0].slice(n)),t}function VP(r,e){Mp||(Mp=new TextDecoder);let t=[],n=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(n===0){if(Wa(t)<1)break;let c=Ga(t,1);s=(c[0]&128)===128,i=c[0]&127,i<126?n=3:i===126?n=1:n=2}else if(n===1){if(Wa(t)<2)break;let c=Ga(t,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),n=3}else if(n===2){if(Wa(t)<8)break;let c=Ga(t,8),u=new DataView(c.buffer,c.byteOffset,c.length),p=u.getUint32(0);if(p>Math.pow(2,21)-1){a.enqueue(hx.ERROR_PACKET);break}i=p*Math.pow(2,32)+u.getUint32(4),n=3}else{if(Wa(t)<i)break;let c=Ga(t,i);a.enqueue((0,Np.decodePacket)(s?c:Mp.decode(c),e)),n=0}if(i===0||i>r){a.enqueue(hx.ERROR_PACKET);break}}}})}Lt.protocol=4});var yx=O((Y4,xx)=>{var kn=String.fromCharCode;function gx(r){for(var e=[],t=0,n=r.length,i,s;t<n;)i=r.charCodeAt(t++),i>=55296&&i<=56319&&t<n?(s=r.charCodeAt(t++),(s&64512)==56320?e.push(((i&1023)<<10)+(s&1023)+65536):(e.push(i),t--)):e.push(i);return e}function YP(r){for(var e=r.length,t=-1,n,i="";++t<e;)n=r[t],n>65535&&(n-=65536,i+=kn(n>>>10&1023|55296),n=56320|n&1023),i+=kn(n);return i}function vx(r,e){if(r>=55296&&r<=57343){if(e)throw Error("Lone surrogate U+"+r.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function Lp(r,e){return kn(r>>e&63|128)}function XP(r,e){if((r&4294967168)==0)return kn(r);var t="";return(r&4294965248)==0?t=kn(r>>6&31|192):(r&4294901760)==0?(vx(r,e)||(r=65533),t=kn(r>>12&15|224),t+=Lp(r,6)):(r&4292870144)==0&&(t=kn(r>>18&7|240),t+=Lp(r,12),t+=Lp(r,6)),t+=kn(r&63|128),t}function JP(r,e){e=e||{};for(var t=e.strict!==!1,n=gx(r),i=n.length,s=-1,o,a="";++s<i;)o=n[s],a+=XP(o,t);return a}function Ii(){if(On>=Ka)throw Error("Invalid byte index");var r=za[On]&255;if(On++,(r&192)==128)return r&63;throw Error("Invalid continuation byte")}function QP(r){var e,t,n,i,s;if(On>Ka)throw Error("Invalid byte index");if(On==Ka)return!1;if(e=za[On]&255,On++,(e&128)==0)return e;if((e&224)==192){if(t=Ii(),s=(e&31)<<6|t,s>=128)return s;throw Error("Invalid continuation byte")}if((e&240)==224){if(t=Ii(),n=Ii(),s=(e&15)<<12|t<<6|n,s>=2048)return vx(s,r)?s:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(t=Ii(),n=Ii(),i=Ii(),s=(e&7)<<18|t<<12|n<<6|i,s>=65536&&s<=1114111))return s;throw Error("Invalid UTF-8 detected")}var za,Ka,On;function ZP(r,e){e=e||{};var t=e.strict!==!1;za=gx(r),Ka=za.length,On=0;for(var n=[],i;(i=QP(t))!==!1;)n.push(i);return YP(n)}xx.exports={version:"2.1.2",encode:JP,decode:ZP}});var Ax=O(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.packets=ot.protocol=void 0;ot.encodePacket=Dp;ot.encodeBase64Packet=wx;ot.decodePacket=Bp;ot.decodeBase64Packet=Sx;ot.encodePayload=nM;ot.decodePayload=sM;ot.encodePayloadAsBinary=Tx;ot.decodePayloadAsBinary=Cx;var bx=yx();ot.protocol=3;var eM=r=>{for(let e of r)if(e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data))return!0;return!1};ot.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Ni=Object.keys(ot.packets),br={type:"error",data:"parser error"},tM=Buffer.concat([]);function Dp(r,e,t,n){if(typeof e=="function"&&(n=e,e=null),typeof t=="function"&&(n=t,t=null),Buffer.isBuffer(r.data))return _x(r,e,n);if(r.data&&(r.data.buffer||r.data)instanceof ArrayBuffer)return _x({type:r.type,data:jp(r.data)},e,n);var i=ot.packets[r.type];return r.data!==void 0&&(i+=t?bx.encode(String(r.data),{strict:!1}):String(r.data)),n(""+i)}function _x(r,e,t){if(!e)return wx(r,t);var n=r.data,i=Buffer.allocUnsafe(1);return i[0]=ot.packets[r.type],t(Buffer.concat([i,n]))}function wx(r,e){var t=Buffer.isBuffer(r.data)?r.data:jp(r.data),n="b"+ot.packets[r.type];return n+=t.toString("base64"),e(n)}function Bp(r,e,t){if(r===void 0)return br;let n;if(typeof r=="string")return n=r.charAt(0),n==="b"?Sx(r.slice(1),e):t&&(r=rM(r),r===!1)||Number(n)!=n||!Ni[n]?br:r.length>1?{type:Ni[n],data:r.slice(1)}:{type:Ni[n]};if(e==="arraybuffer"){var i=new Uint8Array(r);return n=i[0],{type:Ni[n],data:i.buffer.slice(1)}}return r instanceof ArrayBuffer&&(r=jp(r)),n=r[0],{type:Ni[n],data:r.slice(1)}}function rM(r){try{r=bx.decode(r,{strict:!1})}catch{return!1}return r}function Sx(r,e){var t=Ni[r.charAt(0)],n=Buffer.from(r.slice(1),"base64");if(e==="arraybuffer"){for(var i=new Uint8Array(n.length),s=0;s<i.length;s++)i[s]=n[s];n=i.buffer}return{type:t,data:n}}function nM(r,e,t){if(typeof e=="function"&&(t=e,e=null),e&&eM(r))return Tx(r,t);if(!r.length)return t("0:");function n(i,s){Dp(i,e,!1,function(o){s(null,iM(o))})}Ex(r,n,function(i,s){return t(s.join(""))})}function iM(r){return r.length+":"+r}function Ex(r,e,t){let n=new Array(r.length),i=0;for(let s=0;s<r.length;s++)e(r[s],(o,a)=>{n[s]=a,++i===r.length&&t(null,n)})}function sM(r,e,t){if(typeof r!="string")return Cx(r,e,t);if(typeof e=="function"&&(t=e,e=null),r==="")return t(br,0,1);for(var n="",i,s,o,a=0,c=r.length;a<c;a++){var u=r.charAt(a);if(u!==":"){n+=u;continue}if(n===""||n!=(i=Number(n))||(s=r.slice(a+1,a+1+i),n!=s.length))return t(br,0,1);if(s.length){if(o=Bp(s,e,!1),br.type===o.type&&br.data===o.data)return t(br,0,1);var p=t(o,a+i,c);if(p===!1)return}a+=i,n=""}if(n!=="")return t(br,0,1)}function oM(r){for(var e="",t=0,n=r.length;t<n;t++)e+=String.fromCharCode(r[t]);return e}function aM(r){for(var e=Buffer.allocUnsafe(r.length),t=0,n=r.length;t<n;t++)e.writeUInt8(r.charCodeAt(t),t);return e}function jp(r){var e=r.byteLength||r.length,t=r.byteOffset||0;return Buffer.from(r.buffer||r,t,e)}function Tx(r,e){if(!r.length)return e(tM);Ex(r,cM,function(t,n){return e(Buffer.concat(n))})}function cM(r,e){function t(n){var i=""+n.length,s;if(typeof n=="string"){s=Buffer.allocUnsafe(i.length+2),s[0]=0;for(var o=0;o<i.length;o++)s[o+1]=parseInt(i[o],10);return s[s.length-1]=255,e(null,Buffer.concat([s,aM(n)]))}s=Buffer.allocUnsafe(i.length+2),s[0]=1;for(var o=0;o<i.length;o++)s[o+1]=parseInt(i[o],10);s[s.length-1]=255,e(null,Buffer.concat([s,n]))}Dp(r,!0,!0,t)}function Cx(r,e,t){typeof e=="function"&&(t=e,e=null);for(var n=r,i=[],s;n.length>0;){var o="",a=n[0]===0;for(s=1;n[s]!==255;s++){if(o.length>310)return t(br,0,1);o+=""+n[s]}n=n.slice(o.length+1);var c=parseInt(o,10),u=n.slice(1,c+1);a&&(u=oM(u)),i.push(u),n=n.slice(c+1)}var p=i.length;for(s=0;s<p;s++){var f=i[s];t(Bp(f,e,!0),s,p)}}});var kx=O((J4,Rx)=>{var Li=1e3,Di=Li*60,Bi=Di*60,Vn=Bi*24,lM=Vn*7,uM=Vn*365.25;Rx.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return pM(r);if(t==="number"&&isFinite(r))return e.long?dM(r):fM(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function pM(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*uM;case"weeks":case"week":case"w":return t*lM;case"days":case"day":case"d":return t*Vn;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Bi;case"minutes":case"minute":case"mins":case"min":case"m":return t*Di;case"seconds":case"second":case"secs":case"sec":case"s":return t*Li;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function fM(r){var e=Math.abs(r);return e>=Vn?Math.round(r/Vn)+"d":e>=Bi?Math.round(r/Bi)+"h":e>=Di?Math.round(r/Di)+"m":e>=Li?Math.round(r/Li)+"s":r+"ms"}function dM(r){var e=Math.abs(r);return e>=Vn?Va(r,e,Vn,"day"):e>=Bi?Va(r,e,Bi,"hour"):e>=Di?Va(r,e,Di,"minute"):e>=Li?Va(r,e,Li,"second"):r+" ms"}function Va(r,e,t,n){var i=e>=t*1.5;return Math.round(r/t)+" "+n+(i?"s":"")}});var Fp=O((Q4,Ox)=>{function hM(r){t.debug=t,t.default=t,t.coerce=c,t.disable=o,t.enable=i,t.enabled=a,t.humanize=kx(),t.destroy=u,Object.keys(r).forEach(p=>{t[p]=r[p]}),t.names=[],t.skips=[],t.formatters={};function e(p){let f=0;for(let m=0;m<p.length;m++)f=(f<<5)-f+p.charCodeAt(m),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(p){let f,m=null,y,_;function S(...A){if(!S.enabled)return;let P=S,L=Number(new Date),N=L-(f||L);P.diff=N,P.prev=f,P.curr=L,f=L,A[0]=t.coerce(A[0]),typeof A[0]!="string"&&A.unshift("%O");let H=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(U,G)=>{if(U==="%%")return"%";H++;let M=t.formatters[G];if(typeof M=="function"){let F=A[H];U=M.call(P,F),A.splice(H,1),H--}return U}),t.formatArgs.call(P,A),(P.log||t.log).apply(P,A)}return S.namespace=p,S.useColors=t.useColors(),S.color=t.selectColor(p),S.extend=n,S.destroy=t.destroy,Object.defineProperty(S,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(y!==t.namespaces&&(y=t.namespaces,_=t.enabled(p)),_),set:A=>{m=A}}),typeof t.init=="function"&&t.init(S),S}function n(p,f){let m=t(this.namespace+(typeof f>"u"?":":f)+p);return m.log=this.log,m}function i(p){t.save(p),t.namespaces=p,t.names=[],t.skips=[];let f=(typeof p=="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of f)m[0]==="-"?t.skips.push(m.slice(1)):t.names.push(m)}function s(p,f){let m=0,y=0,_=-1,S=0;for(;m<p.length;)if(y<f.length&&(f[y]===p[m]||f[y]==="*"))f[y]==="*"?(_=y,S=m,y++):(m++,y++);else if(_!==-1)y=_+1,S++,m=S;else return!1;for(;y<f.length&&f[y]==="*";)y++;return y===f.length}function o(){let p=[...t.names,...t.skips.map(f=>"-"+f)].join(",");return t.enable(""),p}function a(p){for(let f of t.skips)if(s(p,f))return!1;for(let f of t.names)if(s(p,f))return!0;return!1}function c(p){return p instanceof Error?p.stack||p.message:p}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}Ox.exports=hM});var Px=O((Dt,Ya)=>{Dt.formatArgs=gM;Dt.save=vM;Dt.load=xM;Dt.useColors=mM;Dt.storage=yM();Dt.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Dt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function mM(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let r;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(r[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function gM(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+Ya.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,n=0;r[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(t++,i==="%c"&&(n=t))}),r.splice(n,0,e)}Dt.log=console.debug||console.log||(()=>{});function vM(r){try{r?Dt.storage.setItem("debug",r):Dt.storage.removeItem("debug")}catch{}}function xM(){let r;try{r=Dt.storage.getItem("debug")||Dt.storage.getItem("DEBUG")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function yM(){try{return localStorage}catch{}}Ya.exports=Fp()(Dt);var{formatters:_M}=Ya.exports;_M.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Ix=O((Z4,Mx)=>{"use strict";Mx.exports=(r,e=process.argv)=>{let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var Dx=O((e6,Lx)=>{"use strict";var bM=require("os"),Nx=require("tty"),nr=Ix(),{env:at}=process,Pn;nr("no-color")||nr("no-colors")||nr("color=false")||nr("color=never")?Pn=0:(nr("color")||nr("colors")||nr("color=true")||nr("color=always"))&&(Pn=1);"FORCE_COLOR"in at&&(at.FORCE_COLOR==="true"?Pn=1:at.FORCE_COLOR==="false"?Pn=0:Pn=at.FORCE_COLOR.length===0?1:Math.min(parseInt(at.FORCE_COLOR,10),3));function Hp(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function $p(r,e){if(Pn===0)return 0;if(nr("color=16m")||nr("color=full")||nr("color=truecolor"))return 3;if(nr("color=256"))return 2;if(r&&!e&&Pn===void 0)return 0;let t=Pn||0;if(at.TERM==="dumb")return t;if(process.platform==="win32"){let n=bM.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in at)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in at)||at.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in at)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(at.TEAMCITY_VERSION)?1:0;if(at.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in at){let n=parseInt((at.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(at.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(at.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(at.TERM)||"COLORTERM"in at?1:t}function wM(r){let e=$p(r,r&&r.isTTY);return Hp(e)}Lx.exports={supportsColor:wM,stdout:Hp($p(!0,Nx.isatty(1))),stderr:Hp($p(!0,Nx.isatty(2)))}});var jx=O((ct,Ja)=>{var SM=require("tty"),Xa=require("util");ct.init=OM;ct.log=AM;ct.formatArgs=TM;ct.save=RM;ct.load=kM;ct.useColors=EM;ct.destroy=Xa.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ct.colors=[6,2,3,4,5,1];try{let r=Dx();r&&(r.stderr||r).level>=2&&(ct.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}ct.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),r[t]=n,r},{});function EM(){return"colors"in ct.inspectOpts?!!ct.inspectOpts.colors:SM.isatty(process.stderr.fd)}function TM(r){let{namespace:e,useColors:t}=this;if(t){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${e} \x1B[0m`;r[0]=s+r[0].split(`
2
+ var kO=Object.create;var Oa=Object.defineProperty;var OO=Object.getOwnPropertyDescriptor;var PO=Object.getOwnPropertyNames;var MO=Object.getPrototypeOf,IO=Object.prototype.hasOwnProperty;var Ce=(r,e)=>()=>(r&&(e=r(r=0)),e);var O=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Xr=(r,e)=>{for(var t in e)Oa(r,t,{get:e[t],enumerable:!0})},cv=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of PO(e))!IO.call(r,i)&&i!==t&&Oa(r,i,{get:()=>e[i],enumerable:!(n=OO(e,i))||n.enumerable});return r};var X=(r,e,t)=>(t=r!=null?kO(MO(r)):{},cv(e||!r||!r.__esModule?Oa(t,"default",{value:r,enumerable:!0}):t,r)),NO=r=>cv(Oa({},"__esModule",{value:!0}),r);var Pi={};Xr(Pi,{createRouter:()=>xp,jsonErr:()=>he,jsonOk:()=>ee,parseJsonBody:()=>It});function YO(r){return new Promise(e=>{let t="";r.on("data",n=>t+=n),r.on("end",()=>e(t))})}function ee(r,e={ok:!0}){r.setHeader("Content-Type","application/json"),r.writeHead(200),r.end(JSON.stringify(e))}function he(r,e,t){r.setHeader("Content-Type","application/json"),r.writeHead(e),r.end(JSON.stringify({error:t}))}async function It(r,e){try{let t=await YO(r);return JSON.parse(t||"{}")}catch{return he(e,400,"Invalid JSON"),null}}function xp(r,{fallback:e}={}){let t=new Map,n=[];for(let a of r){let c=a.method==="*"?["GET","POST","PUT","DELETE"]:[a.method];for(let u of c)a.path.endsWith("/*")?n.push({...a,prefix:a.path.slice(0,-2),method:u}):t.set(`${u}:${a.path}`,a)}let i=new Set,s=[];for(let a of r)a.public&&(a.path.endsWith("/*")?s.push(a.path.slice(0,-2)):i.add(a.path));function o(a){return i.has(a)?!0:s.some(c=>a.startsWith(c))}return async(a,c)=>{let u=(0,bv.parse)(a.url,!0),{pathname:p,search:f}=u,m=!!a.headers["cf-connecting-ip"],y=a.socket.remoteAddress==="127.0.0.1"||a.socket.remoteAddress==="::1";if(!o(p)&&(m||!y)){he(c,403,"Forbidden");return}let _=`${a.method}:${p}`,S=t.get(_);if(S){try{await S.handler(a,c,{pathname:p,query:u.query,search:f})}catch(A){console.error("Error:",a.url,A),he(c,500,A.message)}return}for(let A of n)if(A.method===a.method&&p.startsWith(A.prefix)){try{await A.handler(a,c,{pathname:p,query:u.query,search:f})}catch(P){console.error("Error:",a.url,P),he(c,500,P.message)}return}if(e){try{await e(a,c,{pathname:p,search:f})}catch(A){console.error("Error:",a.url,A),he(c,500,A.message)}return}he(c,404,"Not found")}}var bv,Gt=Ce(()=>{bv=require("url")});function eo(r,e={}){return fetch(r,{...e,headers:{...JO,...e.headers}})}var La,Jr,Sv,An,oe,Ev,yp,XO,Na,wv,Da,Qs,_p,Yn,Tv,Cv,Av,Zs,Rv,kv,JO,vt=Ce(()=>{La=X(require("dns"),1),Jr=X(require("path"),1),Sv=X(require("os"),1),An=Jr.default.join(Sv.default.homedir(),".9remote"),oe={ROOT:An,LOGS:Jr.default.join(An,"logs"),STATE:Jr.default.join(An,"state"),CONFIG:Jr.default.join(An,"config"),BIN:Jr.default.join(An,"bin"),PIDS:Jr.default.join(An,"pids"),BUFFERS:Jr.default.join(An,"buffers"),DAEMON:Jr.default.join(An,"daemon")},Ev=new La.default.promises.Resolver;Ev.setServers(["1.1.1.1","1.0.0.1","8.8.8.8"]);yp=La.default.lookup,XO=/^(\d{1,3}\.){3}\d{1,3}$|^::1$|^[0-9a-f:]+$/i;La.default.lookup=(r,e,t)=>{if(typeof e=="function"&&(t=e,e={}),r==="localhost"||XO.test(r))return yp(r,e,t);Ev.resolve4(r).then(n=>{if(!n?.length)return yp(r,e,t);e.all?t(null,n.map(i=>({address:i,family:4}))):t(null,n[0],4)}).catch(()=>yp(r,e,t))};Na=2208,wv=5173,Da=[`http://localhost:${Na}`,`http://127.0.0.1:${Na}`,`http://localhost:${wv}`,`http://127.0.0.1:${wv}`],Qs={fileName:"agent.log",rotatedName:"agent.log.1",maxBytes:2*1024*1024,cleanupAfterDays:7},_p=60,Yn={STOPPED:0,PREPARING:1,CONNECTING:2,TUNNELING:3,VERIFYING:4,READY:5},Tv=5e3,Cv=1e3,Av=6e4,Zs={CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN:"1"},Rv=["claude","codex","gemini","opencode"],kv={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode"},JO={Accept:"application/json, text/plain, */*","Accept-Language":"en-US,en;q=0.9","Cache-Control":"no-cache",Pragma:"no-cache","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"}});function QO(){Ir.default.existsSync(Ba)||Ir.default.mkdirSync(Ba,{recursive:!0})}function ZO(){try{if(Ir.default.statSync(ja).size<Qs.maxBytes)return;try{Ir.default.rmSync(Fa,{force:!0})}catch{}Ir.default.renameSync(ja,Fa)}catch{}}function eP(){try{let r=Ir.default.statSync(Fa);Date.now()-r.mtimeMs>Qs.cleanupAfterDays*864e5&&Ir.default.rmSync(Fa,{force:!0})}catch{}}function Ep(r){try{ZO(),Ir.default.appendFileSync(ja,r+`
3
+ `)}catch{}}function bp(r){return r.map(e=>{if(e instanceof Error)return e.stack||e.message;if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)}).join(" ")}function Pv(){let r=new Date,e=(t,n=2)=>String(t).padStart(n,"0");return`${e(r.getHours())}:${e(r.getMinutes())}:${e(r.getSeconds())}.${e(r.getMilliseconds(),3)}`}function nP(r){return String(r).replace(tP,"").replace(rP,"").replace(/\s+$/g,"")}function to(r,e,t){let n=nP(t);if(!n)return;let i=e==="info"?r:`${r}:${e}`,s=`${Pv()} [${i}] ${n}`;if(Ep(s),wp)try{wp(s)}catch{}}function iP(){process.on("uncaughtException",r=>to("crash","error",`uncaughtException: ${r?.stack||r?.message||r}`)),process.on("unhandledRejection",r=>{let e=r instanceof Error?r.stack||r.message:String(r);to("crash","error",`unhandledRejection: ${e}`)}),process.on("exit",r=>Ep(`${Pv()} [exit] code=${r} pid=${process.pid}`))}function Mv(){Ov||(Ov=!0,QO(),eP(),Ep(`
4
+ === SESSION ${new Date().toISOString()} pid=${process.pid} argv=${process.argv.slice(2).join(" ")} ===`),iP())}function Iv(r){wp=r}function Nv(r=60){try{return Ir.default.readFileSync(ja,"utf8").split(`
5
+ `).filter(Boolean).slice(-r)}catch{return[]}}function Rn(r){return{info:(...e)=>to(r,"info",bp(e)),warn:(...e)=>to(r,"warn",bp(e)),error:(...e)=>to(r,"error",bp(e))}}var Ir,Sp,Ba,ja,Fa,Ov,wp,tP,rP,Mi=Ce(()=>{Ir=X(require("fs"),1),Sp=X(require("path"),1);vt();Ba=oe.LOGS,ja=Sp.default.join(Ba,Qs.fileName),Fa=Sp.default.join(Ba,Qs.rotatedName),Ov=!1,wp=null;tP=/\x1b\[[0-9;]*m/g,rP=/https?:\/\/[^\s]+/g});var jv=O((H4,Tp)=>{"use strict";Tp.exports=Bv;Tp.exports.preferredCharsets=Bv;var sP=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function oP(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var i=aP(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function aP(r,e){var t=sP.exec(r);if(!t)return null;var n=t[1],i=1;if(t[2])for(var s=t[2].split(";"),o=0;o<s.length;o++){var a=s[o].trim().split("=");if(a[0]==="q"){i=parseFloat(a[1]);break}}return{charset:n,q:i,i:e}}function cP(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=lP(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function lP(r,e,t){var n=0;if(e.charset.toLowerCase()===r.toLowerCase())n|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function Bv(r,e){var t=oP(r===void 0?"*":r||"");if(!e)return t.filter(Dv).sort(Lv).map(uP);var n=e.map(function(s,o){return cP(s,t,o)});return n.filter(Dv).sort(Lv).map(function(s){return e[n.indexOf(s)]})}function Lv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function uP(r){return r.charset}function Dv(r){return r.q>0}});var Uv=O(($4,Cp)=>{"use strict";Cp.exports=qv;Cp.exports.preferredEncodings=qv;var pP=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function fP(r){for(var e=r.split(","),t=!1,n=1,i=0,s=0;i<e.length;i++){var o=dP(e[i].trim(),i);o&&(e[s++]=o,t=t||$v("identity",o),n=Math.min(n,o.q||1))}return t||(e[s++]={encoding:"identity",q:n,i}),e.length=s,e}function dP(r,e){var t=pP.exec(r);if(!t)return null;var n=t[1],i=1;if(t[2])for(var s=t[2].split(";"),o=0;o<s.length;o++){var a=s[o].trim().split("=");if(a[0]==="q"){i=parseFloat(a[1]);break}}return{encoding:n,q:i,i:e}}function hP(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=$v(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function $v(r,e,t){var n=0;if(e.encoding.toLowerCase()===r.toLowerCase())n|=1;else if(e.encoding!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function qv(r,e){var t=fP(r||"");if(!e)return t.filter(Hv).sort(Fv).map(mP);var n=e.map(function(s,o){return hP(s,t,o)});return n.filter(Hv).sort(Fv).map(function(s){return e[n.indexOf(s)]})}function Fv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function mP(r){return r.encoding}function Hv(r){return r.q>0}});var Vv=O((q4,Ap)=>{"use strict";Ap.exports=Kv;Ap.exports.preferredLanguages=Kv;var gP=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function vP(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var i=zv(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function zv(r,e){var t=gP.exec(r);if(!t)return null;var n=t[1],i=t[2],s=n;i&&(s+="-"+i);var o=1;if(t[3])for(var a=t[3].split(";"),c=0;c<a.length;c++){var u=a[c].split("=");u[0]==="q"&&(o=parseFloat(u[1]))}return{prefix:n,suffix:i,q:o,i:e,full:s}}function xP(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=yP(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function yP(r,e,t){var n=zv(r);if(!n)return null;var i=0;if(e.full.toLowerCase()===n.full.toLowerCase())i|=4;else if(e.prefix.toLowerCase()===n.full.toLowerCase())i|=2;else if(e.full.toLowerCase()===n.prefix.toLowerCase())i|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s:i}}function Kv(r,e){var t=vP(r===void 0?"*":r||"");if(!e)return t.filter(Gv).sort(Wv).map(_P);var n=e.map(function(s,o){return xP(s,t,o)});return n.filter(Gv).sort(Wv).map(function(s){return e[n.indexOf(s)]})}function Wv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function _P(r){return r.full}function Gv(r){return r.q>0}});var ex=O((U4,Rp)=>{"use strict";Rp.exports=Qv;Rp.exports.preferredMediaTypes=Qv;var bP=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function wP(r){for(var e=AP(r),t=0,n=0;t<e.length;t++){var i=Jv(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function Jv(r,e){var t=bP.exec(r);if(!t)return null;var n=Object.create(null),i=1,s=t[2],o=t[1];if(t[3])for(var a=RP(t[3]).map(CP),c=0;c<a.length;c++){var u=a[c],p=u[0].toLowerCase(),f=u[1],m=f&&f[0]==='"'&&f[f.length-1]==='"'?f.substr(1,f.length-2):f;if(p==="q"){i=parseFloat(m);break}n[p]=m}return{type:o,subtype:s,params:n,q:i,i:e}}function SP(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=EP(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function EP(r,e,t){var n=Jv(r),i=0;if(!n)return null;if(e.type.toLowerCase()==n.type.toLowerCase())i|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==n.subtype.toLowerCase())i|=2;else if(e.subtype!="*")return null;var s=Object.keys(e.params);if(s.length>0)if(s.every(function(o){return e.params[o]=="*"||(e.params[o]||"").toLowerCase()==(n.params[o]||"").toLowerCase()}))i|=1;else return null;return{i:t,o:e.i,q:e.q,s:i}}function Qv(r,e){var t=wP(r===void 0?"*/*":r||"");if(!e)return t.filter(Xv).sort(Yv).map(TP);var n=e.map(function(s,o){return SP(s,t,o)});return n.filter(Xv).sort(Yv).map(function(s){return e[n.indexOf(s)]})}function Yv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function TP(r){return r.type+"/"+r.subtype}function Xv(r){return r.q>0}function Zv(r){for(var e=0,t=0;(t=r.indexOf('"',t))!==-1;)e++,t++;return e}function CP(r){var e=r.indexOf("="),t,n;return e===-1?t=r:(t=r.substr(0,e),n=r.substr(e+1)),[t,n]}function AP(r){for(var e=r.split(","),t=1,n=0;t<e.length;t++)Zv(e[n])%2==0?e[++n]=e[t]:e[n]+=","+e[t];return e.length=n+1,e}function RP(r){for(var e=r.split(";"),t=1,n=0;t<e.length;t++)Zv(e[n])%2==0?e[++n]=e[t]:e[n]+=";"+e[t];e.length=n+1;for(var t=0;t<e.length;t++)e[t]=e[t].trim();return e}});var tx=O((W4,kp)=>{"use strict";var kP=jv(),OP=Uv(),PP=Vv(),MP=ex();kp.exports=le;kp.exports.Negotiator=le;function le(r){if(!(this instanceof le))return new le(r);this.request=r}le.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]};le.prototype.charsets=function(e){return kP(this.request.headers["accept-charset"],e)};le.prototype.encoding=function(e){var t=this.encodings(e);return t&&t[0]};le.prototype.encodings=function(e){return OP(this.request.headers["accept-encoding"],e)};le.prototype.language=function(e){var t=this.languages(e);return t&&t[0]};le.prototype.languages=function(e){return PP(this.request.headers["accept-language"],e)};le.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]};le.prototype.mediaTypes=function(e){return MP(this.request.headers.accept,e)};le.prototype.preferredCharset=le.prototype.charset;le.prototype.preferredCharsets=le.prototype.charsets;le.prototype.preferredEncoding=le.prototype.encoding;le.prototype.preferredEncodings=le.prototype.encodings;le.prototype.preferredLanguage=le.prototype.language;le.prototype.preferredLanguages=le.prototype.languages;le.prototype.preferredMediaType=le.prototype.mediaType;le.prototype.preferredMediaTypes=le.prototype.mediaTypes});var rx=O((G4,IP)=>{IP.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var ix=O((z4,nx)=>{nx.exports=rx()});var ax=O(Nt=>{"use strict";var Ha=ix(),NP=require("path").extname,sx=/^\s*([^;\s]*)(?:;|\s|$)/,LP=/^text\//i;Nt.charset=ox;Nt.charsets={lookup:ox};Nt.contentType=DP;Nt.extension=BP;Nt.extensions=Object.create(null);Nt.lookup=jP;Nt.types=Object.create(null);FP(Nt.extensions,Nt.types);function ox(r){if(!r||typeof r!="string")return!1;var e=sx.exec(r),t=e&&Ha[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&LP.test(e[1])?"UTF-8":!1}function DP(r){if(!r||typeof r!="string")return!1;var e=r.indexOf("/")===-1?Nt.lookup(r):r;if(!e)return!1;if(e.indexOf("charset")===-1){var t=Nt.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function BP(r){if(!r||typeof r!="string")return!1;var e=sx.exec(r),t=e&&Nt.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function jP(r){if(!r||typeof r!="string")return!1;var e=NP("x."+r).toLowerCase().substr(1);return e&&Nt.types[e]||!1}function FP(r,e){var t=["nginx","apache",void 0,"iana"];Object.keys(Ha).forEach(function(i){var s=Ha[i],o=s.extensions;if(!(!o||!o.length)){r[i]=o;for(var a=0;a<o.length;a++){var c=o[a];if(e[c]){var u=t.indexOf(Ha[e[c]].source),p=t.indexOf(s.source);if(e[c]!=="application/octet-stream"&&(u>p||u===p&&e[c].substr(0,12)==="application/"))continue}e[c]=i}}})}});var $a=O((V4,cx)=>{"use strict";var HP=tx(),$P=ax();cx.exports=zt;function zt(r){if(!(this instanceof zt))return new zt(r);this.headers=r.headers,this.negotiator=new HP(r)}zt.prototype.type=zt.prototype.types=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}if(!e||e.length===0)return this.negotiator.mediaTypes();if(!this.headers.accept)return e[0];var n=e.map(qP),i=this.negotiator.mediaTypes(n.filter(UP)),s=i[0];return s?e[n.indexOf(s)]:!1};zt.prototype.encoding=zt.prototype.encodings=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}return!e||e.length===0?this.negotiator.encodings():this.negotiator.encodings(e)[0]||!1};zt.prototype.charset=zt.prototype.charsets=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}return!e||e.length===0?this.negotiator.charsets():this.negotiator.charsets(e)[0]||!1};zt.prototype.lang=zt.prototype.langs=zt.prototype.language=zt.prototype.languages=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}return!e||e.length===0?this.negotiator.languages():this.negotiator.languages(e)[0]||!1};function qP(r){return r.indexOf("/")===-1?$P.lookup(r):r}function UP(r){return typeof r=="string"}});var Pp=O((lx,ux)=>{var ro=require("crypto"),Op=function(){};Op.prototype.getRandomBytes=function(r){var e=4096,t=this;if(r=r||12,r>e)return ro.randomBytes(r);var n=parseInt(e/r),i=parseInt(n*.85);if(!i||(this.bytesBufferIndex==null&&(this.bytesBufferIndex=-1),this.bytesBufferIndex==n&&(this.bytesBuffer=null,this.bytesBufferIndex=-1),(this.bytesBufferIndex==-1||this.bytesBufferIndex>i)&&(this.isGeneratingBytes||(this.isGeneratingBytes=!0,ro.randomBytes(e,function(o,a){t.bytesBuffer=a,t.bytesBufferIndex=0,t.isGeneratingBytes=!1})),this.bytesBufferIndex==-1)))return ro.randomBytes(r);var s=this.bytesBuffer.slice(r*this.bytesBufferIndex,r*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,s};Op.prototype.generateId=function(){var r=Buffer.alloc(15);return r.writeInt32BE?(this.sequenceNumber=this.sequenceNumber+1|0,r.writeInt32BE(this.sequenceNumber,11),ro.randomBytes?this.getRandomBytes(12).copy(r):[0,4,8].forEach(function(e){r.writeInt32BE(Math.random()*Math.pow(2,32)|0,e)}),r.toString("base64").replace(/\//g,"_").replace(/\+/g,"-")):Math.abs(Math.random()*Math.random()*Date.now()|0).toString()+Math.abs(Math.random()*Math.random()*Date.now()|0).toString()};lx=ux.exports=new Op});var qa=O(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.ERROR_PACKET=kn.PACKET_TYPES_REVERSE=kn.PACKET_TYPES=void 0;var Nr=Object.create(null);kn.PACKET_TYPES=Nr;Nr.open="0";Nr.close="1";Nr.ping="2";Nr.pong="3";Nr.message="4";Nr.upgrade="5";Nr.noop="6";var px=Object.create(null);kn.PACKET_TYPES_REVERSE=px;Object.keys(Nr).forEach(r=>{px[Nr[r]]=r});var WP={type:"error",data:"parser error"};kn.ERROR_PACKET=WP});var dx=O(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.encodePacket=void 0;Ii.encodePacketToBinary=KP;var GP=qa(),zP=({type:r,data:e},t,n)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?n(t?e:"b"+fx(e,!0).toString("base64")):n(GP.PACKET_TYPES[r]+(e||""));Ii.encodePacket=zP;var fx=(r,e)=>Buffer.isBuffer(r)||r instanceof Uint8Array&&!e?r:r instanceof ArrayBuffer?Buffer.from(r):Buffer.from(r.buffer,r.byteOffset,r.byteLength),Mp;function KP(r,e){if(r.data instanceof ArrayBuffer||ArrayBuffer.isView(r.data))return e(fx(r.data,!1));(0,Ii.encodePacket)(r,!0,t=>{Mp||(Mp=new TextEncoder),e(Mp.encode(t))})}});var mx=O(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.decodePacket=void 0;var Ua=qa(),VP=(r,e)=>{if(typeof r!="string")return{type:"message",data:hx(r,e)};let t=r.charAt(0);if(t==="b"){let n=Buffer.from(r.substring(1),"base64");return{type:"message",data:hx(n,e)}}return Ua.PACKET_TYPES_REVERSE[t]?r.length>1?{type:Ua.PACKET_TYPES_REVERSE[t],data:r.substring(1)}:{type:Ua.PACKET_TYPES_REVERSE[t]}:Ua.ERROR_PACKET};Wa.decodePacket=VP;var hx=(r,e)=>e==="arraybuffer"?r instanceof ArrayBuffer?r:Buffer.isBuffer(r)?r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength):r.buffer:Buffer.isBuffer(r)?r:Buffer.from(r)});var no=O(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.decodePayload=Lt.decodePacket=Lt.encodePayload=Lt.encodePacket=Lt.protocol=void 0;Lt.createPacketEncoderStream=JP;Lt.createPacketDecoderStream=QP;var Np=dx();Object.defineProperty(Lt,"encodePacket",{enumerable:!0,get:function(){return Np.encodePacket}});var Lp=mx();Object.defineProperty(Lt,"decodePacket",{enumerable:!0,get:function(){return Lp.decodePacket}});var gx=qa(),vx="",YP=(r,e)=>{let t=r.length,n=new Array(t),i=0;r.forEach((s,o)=>{(0,Np.encodePacket)(s,!1,a=>{n[o]=a,++i===t&&e(n.join(vx))})})};Lt.encodePayload=YP;var XP=(r,e)=>{let t=r.split(vx),n=[];for(let i=0;i<t.length;i++){let s=(0,Lp.decodePacket)(t[i],e);if(n.push(s),s.type==="error")break}return n};Lt.decodePayload=XP;function JP(){return new TransformStream({transform(r,e){(0,Np.encodePacketToBinary)(r,t=>{let n=t.length,i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);let s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,n)}else{i=new Uint8Array(9);let s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(n))}r.data&&typeof r.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}var Ip;function Ga(r){return r.reduce((e,t)=>e+t.length,0)}function za(r,e){if(r[0].length===e)return r.shift();let t=new Uint8Array(e),n=0;for(let i=0;i<e;i++)t[i]=r[0][n++],n===r[0].length&&(r.shift(),n=0);return r.length&&n<r[0].length&&(r[0]=r[0].slice(n)),t}function QP(r,e){Ip||(Ip=new TextDecoder);let t=[],n=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(n===0){if(Ga(t)<1)break;let c=za(t,1);s=(c[0]&128)===128,i=c[0]&127,i<126?n=3:i===126?n=1:n=2}else if(n===1){if(Ga(t)<2)break;let c=za(t,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),n=3}else if(n===2){if(Ga(t)<8)break;let c=za(t,8),u=new DataView(c.buffer,c.byteOffset,c.length),p=u.getUint32(0);if(p>Math.pow(2,21)-1){a.enqueue(gx.ERROR_PACKET);break}i=p*Math.pow(2,32)+u.getUint32(4),n=3}else{if(Ga(t)<i)break;let c=za(t,i);a.enqueue((0,Lp.decodePacket)(s?c:Ip.decode(c),e)),n=0}if(i===0||i>r){a.enqueue(gx.ERROR_PACKET);break}}}})}Lt.protocol=4});var bx=O((Z4,_x)=>{var On=String.fromCharCode;function xx(r){for(var e=[],t=0,n=r.length,i,s;t<n;)i=r.charCodeAt(t++),i>=55296&&i<=56319&&t<n?(s=r.charCodeAt(t++),(s&64512)==56320?e.push(((i&1023)<<10)+(s&1023)+65536):(e.push(i),t--)):e.push(i);return e}function ZP(r){for(var e=r.length,t=-1,n,i="";++t<e;)n=r[t],n>65535&&(n-=65536,i+=On(n>>>10&1023|55296),n=56320|n&1023),i+=On(n);return i}function yx(r,e){if(r>=55296&&r<=57343){if(e)throw Error("Lone surrogate U+"+r.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function Dp(r,e){return On(r>>e&63|128)}function eM(r,e){if((r&4294967168)==0)return On(r);var t="";return(r&4294965248)==0?t=On(r>>6&31|192):(r&4294901760)==0?(yx(r,e)||(r=65533),t=On(r>>12&15|224),t+=Dp(r,6)):(r&4292870144)==0&&(t=On(r>>18&7|240),t+=Dp(r,12),t+=Dp(r,6)),t+=On(r&63|128),t}function tM(r,e){e=e||{};for(var t=e.strict!==!1,n=xx(r),i=n.length,s=-1,o,a="";++s<i;)o=n[s],a+=eM(o,t);return a}function Ni(){if(Pn>=Va)throw Error("Invalid byte index");var r=Ka[Pn]&255;if(Pn++,(r&192)==128)return r&63;throw Error("Invalid continuation byte")}function rM(r){var e,t,n,i,s;if(Pn>Va)throw Error("Invalid byte index");if(Pn==Va)return!1;if(e=Ka[Pn]&255,Pn++,(e&128)==0)return e;if((e&224)==192){if(t=Ni(),s=(e&31)<<6|t,s>=128)return s;throw Error("Invalid continuation byte")}if((e&240)==224){if(t=Ni(),n=Ni(),s=(e&15)<<12|t<<6|n,s>=2048)return yx(s,r)?s:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(t=Ni(),n=Ni(),i=Ni(),s=(e&7)<<18|t<<12|n<<6|i,s>=65536&&s<=1114111))return s;throw Error("Invalid UTF-8 detected")}var Ka,Va,Pn;function nM(r,e){e=e||{};var t=e.strict!==!1;Ka=xx(r),Va=Ka.length,Pn=0;for(var n=[],i;(i=rM(t))!==!1;)n.push(i);return ZP(n)}_x.exports={version:"2.1.2",encode:tM,decode:nM}});var kx=O(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.packets=at.protocol=void 0;at.encodePacket=Bp;at.encodeBase64Packet=Ex;at.decodePacket=jp;at.decodeBase64Packet=Tx;at.encodePayload=aM;at.decodePayload=lM;at.encodePayloadAsBinary=Ax;at.decodePayloadAsBinary=Rx;var Sx=bx();at.protocol=3;var iM=r=>{for(let e of r)if(e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data))return!0;return!1};at.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Li=Object.keys(at.packets),br={type:"error",data:"parser error"},sM=Buffer.concat([]);function Bp(r,e,t,n){if(typeof e=="function"&&(n=e,e=null),typeof t=="function"&&(n=t,t=null),Buffer.isBuffer(r.data))return wx(r,e,n);if(r.data&&(r.data.buffer||r.data)instanceof ArrayBuffer)return wx({type:r.type,data:Fp(r.data)},e,n);var i=at.packets[r.type];return r.data!==void 0&&(i+=t?Sx.encode(String(r.data),{strict:!1}):String(r.data)),n(""+i)}function wx(r,e,t){if(!e)return Ex(r,t);var n=r.data,i=Buffer.allocUnsafe(1);return i[0]=at.packets[r.type],t(Buffer.concat([i,n]))}function Ex(r,e){var t=Buffer.isBuffer(r.data)?r.data:Fp(r.data),n="b"+at.packets[r.type];return n+=t.toString("base64"),e(n)}function jp(r,e,t){if(r===void 0)return br;let n;if(typeof r=="string")return n=r.charAt(0),n==="b"?Tx(r.slice(1),e):t&&(r=oM(r),r===!1)||Number(n)!=n||!Li[n]?br:r.length>1?{type:Li[n],data:r.slice(1)}:{type:Li[n]};if(e==="arraybuffer"){var i=new Uint8Array(r);return n=i[0],{type:Li[n],data:i.buffer.slice(1)}}return r instanceof ArrayBuffer&&(r=Fp(r)),n=r[0],{type:Li[n],data:r.slice(1)}}function oM(r){try{r=Sx.decode(r,{strict:!1})}catch{return!1}return r}function Tx(r,e){var t=Li[r.charAt(0)],n=Buffer.from(r.slice(1),"base64");if(e==="arraybuffer"){for(var i=new Uint8Array(n.length),s=0;s<i.length;s++)i[s]=n[s];n=i.buffer}return{type:t,data:n}}function aM(r,e,t){if(typeof e=="function"&&(t=e,e=null),e&&iM(r))return Ax(r,t);if(!r.length)return t("0:");function n(i,s){Bp(i,e,!1,function(o){s(null,cM(o))})}Cx(r,n,function(i,s){return t(s.join(""))})}function cM(r){return r.length+":"+r}function Cx(r,e,t){let n=new Array(r.length),i=0;for(let s=0;s<r.length;s++)e(r[s],(o,a)=>{n[s]=a,++i===r.length&&t(null,n)})}function lM(r,e,t){if(typeof r!="string")return Rx(r,e,t);if(typeof e=="function"&&(t=e,e=null),r==="")return t(br,0,1);for(var n="",i,s,o,a=0,c=r.length;a<c;a++){var u=r.charAt(a);if(u!==":"){n+=u;continue}if(n===""||n!=(i=Number(n))||(s=r.slice(a+1,a+1+i),n!=s.length))return t(br,0,1);if(s.length){if(o=jp(s,e,!1),br.type===o.type&&br.data===o.data)return t(br,0,1);var p=t(o,a+i,c);if(p===!1)return}a+=i,n=""}if(n!=="")return t(br,0,1)}function uM(r){for(var e="",t=0,n=r.length;t<n;t++)e+=String.fromCharCode(r[t]);return e}function pM(r){for(var e=Buffer.allocUnsafe(r.length),t=0,n=r.length;t<n;t++)e.writeUInt8(r.charCodeAt(t),t);return e}function Fp(r){var e=r.byteLength||r.length,t=r.byteOffset||0;return Buffer.from(r.buffer||r,t,e)}function Ax(r,e){if(!r.length)return e(sM);Cx(r,fM,function(t,n){return e(Buffer.concat(n))})}function fM(r,e){function t(n){var i=""+n.length,s;if(typeof n=="string"){s=Buffer.allocUnsafe(i.length+2),s[0]=0;for(var o=0;o<i.length;o++)s[o+1]=parseInt(i[o],10);return s[s.length-1]=255,e(null,Buffer.concat([s,pM(n)]))}s=Buffer.allocUnsafe(i.length+2),s[0]=1;for(var o=0;o<i.length;o++)s[o+1]=parseInt(i[o],10);s[s.length-1]=255,e(null,Buffer.concat([s,n]))}Bp(r,!0,!0,t)}function Rx(r,e,t){typeof e=="function"&&(t=e,e=null);for(var n=r,i=[],s;n.length>0;){var o="",a=n[0]===0;for(s=1;n[s]!==255;s++){if(o.length>310)return t(br,0,1);o+=""+n[s]}n=n.slice(o.length+1);var c=parseInt(o,10),u=n.slice(1,c+1);a&&(u=uM(u)),i.push(u),n=n.slice(c+1)}var p=i.length;for(s=0;s<p;s++){var f=i[s];t(jp(f,e,!0),s,p)}}});var Px=O((t6,Ox)=>{var Di=1e3,Bi=Di*60,ji=Bi*60,Xn=ji*24,dM=Xn*7,hM=Xn*365.25;Ox.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return mM(r);if(t==="number"&&isFinite(r))return e.long?vM(r):gM(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function mM(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*hM;case"weeks":case"week":case"w":return t*dM;case"days":case"day":case"d":return t*Xn;case"hours":case"hour":case"hrs":case"hr":case"h":return t*ji;case"minutes":case"minute":case"mins":case"min":case"m":return t*Bi;case"seconds":case"second":case"secs":case"sec":case"s":return t*Di;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function gM(r){var e=Math.abs(r);return e>=Xn?Math.round(r/Xn)+"d":e>=ji?Math.round(r/ji)+"h":e>=Bi?Math.round(r/Bi)+"m":e>=Di?Math.round(r/Di)+"s":r+"ms"}function vM(r){var e=Math.abs(r);return e>=Xn?Ya(r,e,Xn,"day"):e>=ji?Ya(r,e,ji,"hour"):e>=Bi?Ya(r,e,Bi,"minute"):e>=Di?Ya(r,e,Di,"second"):r+" ms"}function Ya(r,e,t,n){var i=e>=t*1.5;return Math.round(r/t)+" "+n+(i?"s":"")}});var Hp=O((r6,Mx)=>{function xM(r){t.debug=t,t.default=t,t.coerce=c,t.disable=o,t.enable=i,t.enabled=a,t.humanize=Px(),t.destroy=u,Object.keys(r).forEach(p=>{t[p]=r[p]}),t.names=[],t.skips=[],t.formatters={};function e(p){let f=0;for(let m=0;m<p.length;m++)f=(f<<5)-f+p.charCodeAt(m),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(p){let f,m=null,y,_;function S(...A){if(!S.enabled)return;let P=S,L=Number(new Date),N=L-(f||L);P.diff=N,P.prev=f,P.curr=L,f=L,A[0]=t.coerce(A[0]),typeof A[0]!="string"&&A.unshift("%O");let H=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(U,G)=>{if(U==="%%")return"%";H++;let M=t.formatters[G];if(typeof M=="function"){let F=A[H];U=M.call(P,F),A.splice(H,1),H--}return U}),t.formatArgs.call(P,A),(P.log||t.log).apply(P,A)}return S.namespace=p,S.useColors=t.useColors(),S.color=t.selectColor(p),S.extend=n,S.destroy=t.destroy,Object.defineProperty(S,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(y!==t.namespaces&&(y=t.namespaces,_=t.enabled(p)),_),set:A=>{m=A}}),typeof t.init=="function"&&t.init(S),S}function n(p,f){let m=t(this.namespace+(typeof f>"u"?":":f)+p);return m.log=this.log,m}function i(p){t.save(p),t.namespaces=p,t.names=[],t.skips=[];let f=(typeof p=="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of f)m[0]==="-"?t.skips.push(m.slice(1)):t.names.push(m)}function s(p,f){let m=0,y=0,_=-1,S=0;for(;m<p.length;)if(y<f.length&&(f[y]===p[m]||f[y]==="*"))f[y]==="*"?(_=y,S=m,y++):(m++,y++);else if(_!==-1)y=_+1,S++,m=S;else return!1;for(;y<f.length&&f[y]==="*";)y++;return y===f.length}function o(){let p=[...t.names,...t.skips.map(f=>"-"+f)].join(",");return t.enable(""),p}function a(p){for(let f of t.skips)if(s(p,f))return!1;for(let f of t.names)if(s(p,f))return!0;return!1}function c(p){return p instanceof Error?p.stack||p.message:p}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}Mx.exports=xM});var Ix=O((Dt,Xa)=>{Dt.formatArgs=_M;Dt.save=bM;Dt.load=wM;Dt.useColors=yM;Dt.storage=SM();Dt.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Dt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function yM(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let r;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(r[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function _M(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+Xa.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,n=0;r[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(t++,i==="%c"&&(n=t))}),r.splice(n,0,e)}Dt.log=console.debug||console.log||(()=>{});function bM(r){try{r?Dt.storage.setItem("debug",r):Dt.storage.removeItem("debug")}catch{}}function wM(){let r;try{r=Dt.storage.getItem("debug")||Dt.storage.getItem("DEBUG")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function SM(){try{return localStorage}catch{}}Xa.exports=Hp()(Dt);var{formatters:EM}=Xa.exports;EM.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Lx=O((n6,Nx)=>{"use strict";Nx.exports=(r,e=process.argv)=>{let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var jx=O((i6,Bx)=>{"use strict";var TM=require("os"),Dx=require("tty"),nr=Lx(),{env:ct}=process,Mn;nr("no-color")||nr("no-colors")||nr("color=false")||nr("color=never")?Mn=0:(nr("color")||nr("colors")||nr("color=true")||nr("color=always"))&&(Mn=1);"FORCE_COLOR"in ct&&(ct.FORCE_COLOR==="true"?Mn=1:ct.FORCE_COLOR==="false"?Mn=0:Mn=ct.FORCE_COLOR.length===0?1:Math.min(parseInt(ct.FORCE_COLOR,10),3));function $p(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function qp(r,e){if(Mn===0)return 0;if(nr("color=16m")||nr("color=full")||nr("color=truecolor"))return 3;if(nr("color=256"))return 2;if(r&&!e&&Mn===void 0)return 0;let t=Mn||0;if(ct.TERM==="dumb")return t;if(process.platform==="win32"){let n=TM.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in ct)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in ct)||ct.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in ct)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ct.TEAMCITY_VERSION)?1:0;if(ct.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in ct){let n=parseInt((ct.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ct.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ct.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ct.TERM)||"COLORTERM"in ct?1:t}function CM(r){let e=qp(r,r&&r.isTTY);return $p(e)}Bx.exports={supportsColor:CM,stdout:$p(qp(!0,Dx.isatty(1))),stderr:$p(qp(!0,Dx.isatty(2)))}});var Hx=O((lt,Qa)=>{var AM=require("tty"),Ja=require("util");lt.init=NM;lt.log=PM;lt.formatArgs=kM;lt.save=MM;lt.load=IM;lt.useColors=RM;lt.destroy=Ja.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");lt.colors=[6,2,3,4,5,1];try{let r=jx();r&&(r.stderr||r).level>=2&&(lt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}lt.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),r[t]=n,r},{});function RM(){return"colors"in lt.inspectOpts?!!lt.inspectOpts.colors:AM.isatty(process.stderr.fd)}function kM(r){let{namespace:e,useColors:t}=this;if(t){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${e} \x1B[0m`;r[0]=s+r[0].split(`
6
6
  `).join(`
7
- `+s),r.push(i+"m+"+Ja.exports.humanize(this.diff)+"\x1B[0m")}else r[0]=CM()+e+" "+r[0]}function CM(){return ct.inspectOpts.hideDate?"":new Date().toISOString()+" "}function AM(...r){return process.stderr.write(Xa.formatWithOptions(ct.inspectOpts,...r)+`
8
- `)}function RM(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function kM(){return process.env.DEBUG}function OM(r){r.inspectOpts={};let e=Object.keys(ct.inspectOpts);for(let t=0;t<e.length;t++)r.inspectOpts[e[t]]=ct.inspectOpts[e[t]]}Ja.exports=Fp()(ct);var{formatters:Bx}=Ja.exports;Bx.o=function(r){return this.inspectOpts.colors=this.useColors,Xa.inspect(r,this.inspectOpts).split(`
9
- `).map(e=>e.trim()).join(" ")};Bx.O=function(r){return this.inspectOpts.colors=this.useColors,Xa.inspect(r,this.inspectOpts)}});var Ce=O((t6,qp)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?qp.exports=Px():qp.exports=jx()});var Yn=O(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.Transport=void 0;var PM=require("events"),MM=no(),IM=Ax(),NM=Ce(),Fx=(0,NM.default)("engine:transport");function LM(){}var Qa=class extends PM.EventEmitter{get readyState(){return this._readyState}set readyState(e){Fx("readyState updated from %s to %s (%s)",this._readyState,e,this.name),this._readyState=e}constructor(e){super(),this.writable=!1,this._readyState="open",this.discarded=!1,this.protocol=e._query.EIO==="4"?4:3,this.parser=this.protocol===4?MM:IM,this.supportsBinary=!(e._query&&e._query.b64)}discard(){this.discarded=!0}onRequest(e){}close(e){this.readyState==="closed"||this.readyState==="closing"||(this.readyState="closing",this.doClose(e||LM))}onError(e,t){if(this.listeners("error").length){let n=new Error(e);n.type="TransportError",n.description=t,this.emit("error",n)}else Fx("ignored transport error %s (%s)",e,t)}onPacket(e){this.emit("packet",e)}onData(e){this.onPacket(this.parser.decodePacket(e))}onClose(){this.readyState="closed",this.emit("close")}};Za.Transport=Qa;Qa.upgradesTo=[]});var Wp=O(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.Polling=void 0;var DM=Yn(),Hx=require("zlib"),BM=Ha(),jM=Ce(),Kt=(0,jM.default)("engine:polling"),FM={gzip:Hx.createGzip,deflate:Hx.createDeflate},Up=class extends DM.Transport{constructor(e){super(e),this.closeTimeout=30*1e3}get name(){return"polling"}onRequest(e){let t=e.res;e.res=null,e.method==="GET"?this.onPollRequest(e,t):e.method==="POST"?this.onDataRequest(e,t):(t.writeHead(500),t.end())}onPollRequest(e,t){if(this.req){Kt("request overlap"),this.onError("overlap from client"),t.writeHead(400),t.end();return}Kt("setting request"),this.req=e,this.res=t;let n=()=>{this.onError("poll connection closed prematurely")},i=()=>{e.removeListener("close",n),this.req=this.res=null};e.cleanup=i,e.on("close",n),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose&&(Kt("triggering empty send to append close packet"),this.send([{type:"noop"}]))}onDataRequest(e,t){if(this.dataReq){this.onError("data request overlap from client"),t.writeHead(400),t.end();return}let n=e.headers["content-type"]==="application/octet-stream";if(n&&this.protocol===4)return this.onError("invalid content");this.dataReq=e,this.dataRes=t;let i=n?Buffer.concat([]):"",s=()=>{e.removeListener("data",a),e.removeListener("end",c),e.removeListener("close",o),this.dataReq=this.dataRes=i=null},o=()=>{s(),this.onError("data request connection closed prematurely")},a=u=>{let p;n?(i=Buffer.concat([i,u]),p=i.length):(i+=u,p=Buffer.byteLength(i)),p>this.maxHttpBufferSize&&(t.writeHead(413).end(),s())},c=()=>{this.onData(i);let u={"Content-Type":"text/html","Content-Length":"2"};t.writeHead(200,this.headers(e,u)),t.end("ok"),s()};e.on("close",o),n||e.setEncoding("utf8"),e.on("data",a),e.on("end",c)}onData(e){Kt('received "%s"',e);let t=n=>{if(n.type==="close")return Kt("got xhr close packet"),this.onClose(),!1;this.onPacket(n)};this.protocol===3?this.parser.decodePayload(e,t):this.parser.decodePayload(e).forEach(t)}onClose(){this.writable&&this.send([{type:"noop"}]),super.onClose()}send(e){this.writable=!1,this.shouldClose&&(Kt("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=n=>{let i=e.some(s=>s.options&&s.options.compress);this.write(n,{compress:i})};this.protocol===3?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){Kt('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,n){let i=typeof e=="string",o={"Content-Type":i?"text/plain; charset=UTF-8":"application/octet-stream"},a=p=>{o["Content-Length"]=typeof p=="string"?Buffer.byteLength(p):p.length,this.res.writeHead(200,this.headers(this.req,o)),this.res.end(p),n()};if(!this.httpCompression||!t.compress){a(e);return}if((i?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let u=BM(this.req).encodings(["gzip","deflate"]);if(!u){a(e);return}this.compress(e,u,(p,f)=>{if(p){this.res.writeHead(500),this.res.end(),n(p);return}o["Content-Encoding"]=u,a(f)})}compress(e,t,n){Kt("compressing");let i=[],s=0;FM[t](this.httpCompression).on("error",n).on("data",function(o){i.push(o),s+=o.length}).on("end",function(){n(null,Buffer.concat(i,s))}).end(e)}doClose(e){Kt("closing");let t;this.dataReq&&(Kt("aborting ongoing data request"),this.dataReq.destroy());let n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(Kt("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(Kt("transport discarded - closing right away"),n()):(Kt("transport not writable - buffering orderly close"),this.shouldClose=n,t=setTimeout(n,this.closeTimeout))}headers(e,t={}){let n=e.headers["user-agent"];return n&&(~n.indexOf(";MSIE")||~n.indexOf("Trident/"))&&(t["X-XSS-Protection"]="0"),t["cache-control"]="no-store",this.emit("headers",t,e),t}};ec.Polling=Up});var $x=O(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.JSONP=void 0;var HM=Wp(),$M=require("querystring"),qM=/\\\\n/g,UM=/(\\)?\\n/g,Gp=class extends HM.Polling{constructor(e){super(e),this.head="___eio["+(e._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(e){e=$M.parse(e).d,typeof e=="string"&&(e=e.replace(UM,function(t,n){return n?t:`
10
- `}),super.onData(e.replace(qM,"\\n")))}doWrite(e,t,n){let i=JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");e=this.head+i+this.foot,super.doWrite(e,t,n)}};tc.JSONP=Gp});var Ux=O(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.WebSocket=void 0;var WM=Yn(),GM=Ce(),qx=(0,GM.default)("engine:ws"),zp=class extends WM.Transport{constructor(e){super(e),this._doSend=t=>{this.socket.send(t,this._onSent)},this._doSendLast=t=>{this.socket.send(t,this._onSentLast)},this._onSent=t=>{t&&this.onError("write error",t.stack)},this._onSentLast=t=>{t?this.onError("write error",t.stack):(this.emit("drain"),this.writable=!0,this.emit("ready"))},this.socket=e.websocket,this.socket.on("message",(t,n)=>{let i=n?t:t.toString();qx('received "%s"',i),super.onData(i)}),this.socket.once("close",this.onClose.bind(this)),this.socket.on("error",this.onError.bind(this)),this.writable=!0,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],i=t+1===e.length;this._canSendPreEncodedFrame(n)?this.socket._sender.sendFrame(n.options.wsPreEncodedFrame,i?this._onSentLast:this._onSent):this.parser.encodePacket(n,this.supportsBinary,i?this._doSendLast:this._doSend)}}_canSendPreEncodedFrame(e){var t,n,i;return!this.perMessageDeflate&&typeof((n=(t=this.socket)===null||t===void 0?void 0:t._sender)===null||n===void 0?void 0:n.sendFrame)=="function"&&((i=e.options)===null||i===void 0?void 0:i.wsPreEncodedFrame)!==void 0}doClose(e){qx("closing"),this.socket.close(),e&&e()}};rc.WebSocket=zp});var Vp=O(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.WebTransport=void 0;var zM=Yn(),KM=Ce(),VM=no(),ji=(0,KM.default)("engine:webtransport"),Kp=class extends zM.Transport{constructor(e,t,n){super({_query:{EIO:"4"}}),this.session=e;let i=(0,VM.createPacketEncoderStream)();i.readable.pipeTo(t.writable).catch(()=>{ji("the stream was closed")}),this.writer=i.writable.getWriter(),(async()=>{try{for(;;){let{value:s,done:o}=await n.read();if(o){ji("session is closed");break}ji("received chunk: %o",s),this.onPacket(s)}}catch(s){ji("error while reading: %s",s.message)}})(),e.closed.then(()=>this.onClose()),this.writable=!0}get name(){return"webtransport"}async send(e){this.writable=!1;try{for(let t=0;t<e.length;t++){let n=e[t];await this.writer.write(n)}}catch(t){ji("error while writing: %s",t.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(e){ji("closing WebTransport session"),this.session.close(),e&&e()}};nc.WebTransport=Kp});var Xp=O(Yp=>{"use strict";Object.defineProperty(Yp,"__esModule",{value:!0});var YM=Wp(),XM=$x(),JM=Ux(),QM=Vp();Yp.default={polling:Wx,websocket:JM.WebSocket,webtransport:QM.WebTransport};function Wx(r){return typeof r._query.j=="string"?new XM.JSONP(r):new YM.Polling(r)}Wx.upgradesTo=["websocket","webtransport"]});var Qp=O(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.Socket=void 0;var ZM=require("events"),eI=Ce(),Qr=require("timers"),Ae=(0,eI.default)("engine:socket"),Jp=class extends ZM.EventEmitter{get readyState(){return this._readyState}set readyState(e){Ae("readyState updated from %s to %s",this._readyState,e),this._readyState=e}constructor(e,t,n,i,s){super(),this._readyState="opening",this.upgrading=!1,this.upgraded=!1,this.writeBuffer=[],this.packetsFn=[],this.sentCallbackFn=[],this.cleanupFn=[],this.id=e,this.server=t,this.request=i,this.protocol=s,i&&(i.websocket&&i.websocket._socket?this.remoteAddress=i.websocket._socket.remoteAddress:this.remoteAddress=i.connection.remoteAddress),this.pingTimeoutTimer=null,this.pingIntervalTimer=null,this.setTransport(n),this.onOpen()}onOpen(){this.readyState="open",this.transport.sid=this.id,this.sendPacket("open",JSON.stringify({sid:this.id,upgrades:this.getAvailableUpgrades(),pingInterval:this.server.opts.pingInterval,pingTimeout:this.server.opts.pingTimeout,maxPayload:this.server.opts.maxHttpBufferSize})),this.server.opts.initialPacket&&this.sendPacket("message",this.server.opts.initialPacket),this.emit("open"),this.protocol===3?this.resetPingTimeout():this.schedulePing()}onPacket(e){if(this.readyState!=="open")return Ae("packet received with closed socket");switch(Ae(`received packet ${e.type}`),this.emit("packet",e),e.type){case"ping":if(this.transport.protocol!==3){this.onError(new Error("invalid heartbeat direction"));return}Ae("got ping"),this.pingTimeoutTimer.refresh(),this.sendPacket("pong"),this.emit("heartbeat");break;case"pong":if(this.transport.protocol===3){this.onError(new Error("invalid heartbeat direction"));return}Ae("got pong"),(0,Qr.clearTimeout)(this.pingTimeoutTimer),this.pingIntervalTimer.refresh(),this.emit("heartbeat");break;case"error":this.onClose("parse error");break;case"message":this.emit("data",e.data),this.emit("message",e.data);break}}onError(e){Ae("transport error"),this.onClose("transport error",e)}schedulePing(){this.pingIntervalTimer=(0,Qr.setTimeout)(()=>{Ae("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){(0,Qr.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,Qr.setTimeout)(()=>{this.readyState!=="closed"&&this.onClose("ping timeout")},this.protocol===3?this.server.opts.pingInterval+this.server.opts.pingTimeout:this.server.opts.pingTimeout)}setTransport(e){let t=this.onError.bind(this),n=()=>this.flush(),i=this.onPacket.bind(this),s=this.onDrain.bind(this),o=this.onClose.bind(this,"transport close");this.transport=e,this.transport.once("error",t),this.transport.on("ready",n),this.transport.on("packet",i),this.transport.on("drain",s),this.transport.once("close",o),this.cleanupFn.push(function(){e.removeListener("error",t),e.removeListener("ready",n),e.removeListener("packet",i),e.removeListener("drain",s),e.removeListener("close",o)})}onDrain(){if(this.sentCallbackFn.length>0){Ae("executing batch send callback");let e=this.sentCallbackFn.shift();if(e)for(let t=0;t<e.length;t++)e[t](this.transport)}}_maybeUpgrade(e){Ae('might upgrade socket transport from "%s" to "%s"',this.transport.name,e.name),this.upgrading=!0;let t=(0,Qr.setTimeout)(()=>{Ae("client did not complete upgrade - closing transport"),o(),e.readyState==="open"&&e.close()},this.server.opts.upgradeTimeout),n,i=p=>{p.type==="ping"&&p.data==="probe"?(Ae("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(n),n=setInterval(s,100)):p.type==="upgrade"&&this.readyState!=="closed"?(Ae("got upgrade packet - upgrading"),o(),this.transport.discard(),this.upgraded=!0,this.clearTransport(),this.setTransport(e),this.emit("upgrade",e),this.flush(),this.readyState==="closing"&&e.close(()=>{this.onClose("forced close")})):(o(),e.close())},s=()=>{this.transport.name==="polling"&&this.transport.writable&&(Ae("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}]))},o=()=>{this.upgrading=!1,clearInterval(n),(0,Qr.clearTimeout)(t),e.removeListener("packet",i),e.removeListener("close",c),e.removeListener("error",a),this.removeListener("close",u)},a=p=>{Ae("client did not complete upgrade - %s",p),o(),e.close(),e=null},c=()=>{a("transport closed")},u=()=>{a("socket closed")};e.on("packet",i),e.once("close",c),e.once("error",a),this.once("close",u)}clearTransport(){let e,t=this.cleanupFn.length;for(let n=0;n<t;n++)e=this.cleanupFn.shift(),e();this.transport.on("error",function(){Ae("error triggered by discarded transport")}),this.transport.close(),(0,Qr.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){this.readyState!=="closed"&&(this.readyState="closed",(0,Qr.clearTimeout)(this.pingIntervalTimer),(0,Qr.clearTimeout)(this.pingTimeoutTimer),process.nextTick(()=>{this.writeBuffer=[]}),this.packetsFn=[],this.sentCallbackFn=[],this.clearTransport(),this.emit("close",e,t))}send(e,t,n){return this.sendPacket("message",e,t,n),this}write(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n={},i){if(typeof n=="function"&&(i=n,n={}),this.readyState!=="closing"&&this.readyState!=="closed"){Ae('sending packet "%s" (%s)',e,t),n.compress=n.compress!==!1;let s={type:e,options:n};t&&(s.data=t),this.emit("packetCreate",s),this.writeBuffer.push(s),typeof i=="function"&&this.packetsFn.push(i),this.flush()}}flush(){if(this.readyState!=="closed"&&this.transport.writable&&this.writeBuffer.length){Ae("flushing buffer to transport"),this.emit("flush",this.writeBuffer),this.server.emit("flush",this,this.writeBuffer);let e=this.writeBuffer;this.writeBuffer=[],this.packetsFn.length?(this.sentCallbackFn.push(this.packetsFn),this.packetsFn=[]):this.sentCallbackFn.push(null),this.transport.send(e),this.emit("drain"),this.server.emit("drain",this)}}getAvailableUpgrades(){let e=[],t=this.server.upgrades(this.transport.name);for(let n=0;n<t.length;++n){let i=t[n];this.server.opts.transports.indexOf(i)!==-1&&e.push(i)}return e}close(e){if(e&&(this.readyState==="open"||this.readyState==="closing"))return this.closeTransport(e);if(this.readyState==="open"){if(this.readyState="closing",this.writeBuffer.length){Ae("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{Ae("all packets have been sent, closing the transport"),this.closeTransport(e)});return}Ae("the buffer is empty, closing the transport right away"),this.closeTransport(e)}}closeTransport(e){Ae("closing the transport (discard? %s)",!!e),e&&this.transport.discard(),this.transport.close(this.onClose.bind(this,"forced close"))}};ic.Socket=Jp});var Kx=O(Zp=>{"use strict";Zp.parse=aI;Zp.serialize=cI;var tI=Object.prototype.toString,rI=Object.prototype.hasOwnProperty,nI=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,iI=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,sI=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,oI=/^[\u0020-\u003A\u003D-\u007E]*$/;function aI(r,e){if(typeof r!="string")throw new TypeError("argument str must be a string");var t={},n=r.length;if(n<2)return t;var i=e&&e.decode||lI,s=0,o=0,a=0;do{if(o=r.indexOf("=",s),o===-1)break;if(a=r.indexOf(";",s),a===-1)a=n;else if(o>a){s=r.lastIndexOf(";",o-1)+1;continue}var c=Gx(r,s,o),u=zx(r,o,c),p=r.slice(c,u);if(!rI.call(t,p)){var f=Gx(r,o+1,a),m=zx(r,a,f);r.charCodeAt(f)===34&&r.charCodeAt(m-1)===34&&(f++,m--);var y=r.slice(f,m);t[p]=pI(y,i)}s=a+1}while(s<n);return t}function Gx(r,e,t){do{var n=r.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<t);return t}function zx(r,e,t){for(;e>t;){var n=r.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return t}function cI(r,e,t){var n=t&&t.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!nI.test(r))throw new TypeError("argument name is invalid");var i=n(e);if(!iI.test(i))throw new TypeError("argument val is invalid");var s=r+"="+i;if(!t)return s;if(t.maxAge!=null){var o=Math.floor(t.maxAge);if(!isFinite(o))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+o}if(t.domain){if(!sI.test(t.domain))throw new TypeError("option domain is invalid");s+="; Domain="+t.domain}if(t.path){if(!oI.test(t.path))throw new TypeError("option path is invalid");s+="; Path="+t.path}if(t.expires){var a=t.expires;if(!uI(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+a.toUTCString()}if(t.httpOnly&&(s+="; HttpOnly"),t.secure&&(s+="; Secure"),t.partitioned&&(s+="; Partitioned"),t.priority){var c=typeof t.priority=="string"?t.priority.toLowerCase():t.priority;switch(c){case"low":s+="; Priority=Low";break;case"medium":s+="; Priority=Medium";break;case"high":s+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(t.sameSite){var u=typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite;switch(u){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s}function lI(r){return r.indexOf("%")!==-1?decodeURIComponent(r):r}function uI(r){return tI.call(r)==="[object Date]"}function pI(r,e){try{return e(r)}catch{return r}}});var Zr=O((u6,Xx)=>{"use strict";var Vx=["nodebuffer","arraybuffer","fragments"],Yx=typeof Blob<"u";Yx&&Vx.push("blob");Xx.exports={BINARY_TYPES:Vx,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Yx,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var fy=O((p6,py)=>{var ey=require("fs"),en=require("path"),ty=require("os"),ry=typeof __webpack_require__=="function"?__non_webpack_require__:require,fI=process.config&&process.config.variables||{},dI=!!process.env.PREBUILDS_ONLY,Jx=process.versions.modules,ef=gI()?"electron":mI()?"node-webkit":"node",tf=process.env.npm_config_arch||ty.arch(),rf=process.env.npm_config_platform||ty.platform(),ny=process.env.LIBC||(vI(rf)?"musl":"glibc"),nf=process.env.ARM_VERSION||(tf==="arm64"?"8":fI.arm_version)||"",iy=(process.versions.uv||"").split(".")[0];py.exports=Lr;function Lr(r){return ry(Lr.resolve(r))}Lr.resolve=Lr.path=function(r){r=en.resolve(r||".");try{var e=ry(en.join(r,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(r=process.env[e+"_PREBUILD"])}catch{}if(!dI){var t=Qx(en.join(r,"build/Release"),Zx);if(t)return t;var n=Qx(en.join(r,"build/Debug"),Zx);if(n)return n}var i=a(r);if(i)return i;var s=a(en.dirname(process.execPath));if(s)return s;var o=["platform="+rf,"arch="+tf,"runtime="+ef,"abi="+Jx,"uv="+iy,nf?"armv="+nf:"","libc="+ny,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"",typeof __webpack_require__=="function"?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+o+`
7
+ `+s),r.push(i+"m+"+Qa.exports.humanize(this.diff)+"\x1B[0m")}else r[0]=OM()+e+" "+r[0]}function OM(){return lt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function PM(...r){return process.stderr.write(Ja.formatWithOptions(lt.inspectOpts,...r)+`
8
+ `)}function MM(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function IM(){return process.env.DEBUG}function NM(r){r.inspectOpts={};let e=Object.keys(lt.inspectOpts);for(let t=0;t<e.length;t++)r.inspectOpts[e[t]]=lt.inspectOpts[e[t]]}Qa.exports=Hp()(lt);var{formatters:Fx}=Qa.exports;Fx.o=function(r){return this.inspectOpts.colors=this.useColors,Ja.inspect(r,this.inspectOpts).split(`
9
+ `).map(e=>e.trim()).join(" ")};Fx.O=function(r){return this.inspectOpts.colors=this.useColors,Ja.inspect(r,this.inspectOpts)}});var Ae=O((s6,Up)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Up.exports=Ix():Up.exports=Hx()});var Jn=O(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.Transport=void 0;var LM=require("events"),DM=no(),BM=kx(),jM=Ae(),$x=(0,jM.default)("engine:transport");function FM(){}var Za=class extends LM.EventEmitter{get readyState(){return this._readyState}set readyState(e){$x("readyState updated from %s to %s (%s)",this._readyState,e,this.name),this._readyState=e}constructor(e){super(),this.writable=!1,this._readyState="open",this.discarded=!1,this.protocol=e._query.EIO==="4"?4:3,this.parser=this.protocol===4?DM:BM,this.supportsBinary=!(e._query&&e._query.b64)}discard(){this.discarded=!0}onRequest(e){}close(e){this.readyState==="closed"||this.readyState==="closing"||(this.readyState="closing",this.doClose(e||FM))}onError(e,t){if(this.listeners("error").length){let n=new Error(e);n.type="TransportError",n.description=t,this.emit("error",n)}else $x("ignored transport error %s (%s)",e,t)}onPacket(e){this.emit("packet",e)}onData(e){this.onPacket(this.parser.decodePacket(e))}onClose(){this.readyState="closed",this.emit("close")}};ec.Transport=Za;Za.upgradesTo=[]});var Gp=O(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.Polling=void 0;var HM=Jn(),qx=require("zlib"),$M=$a(),qM=Ae(),Kt=(0,qM.default)("engine:polling"),UM={gzip:qx.createGzip,deflate:qx.createDeflate},Wp=class extends HM.Transport{constructor(e){super(e),this.closeTimeout=30*1e3}get name(){return"polling"}onRequest(e){let t=e.res;e.res=null,e.method==="GET"?this.onPollRequest(e,t):e.method==="POST"?this.onDataRequest(e,t):(t.writeHead(500),t.end())}onPollRequest(e,t){if(this.req){Kt("request overlap"),this.onError("overlap from client"),t.writeHead(400),t.end();return}Kt("setting request"),this.req=e,this.res=t;let n=()=>{this.onError("poll connection closed prematurely")},i=()=>{e.removeListener("close",n),this.req=this.res=null};e.cleanup=i,e.on("close",n),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose&&(Kt("triggering empty send to append close packet"),this.send([{type:"noop"}]))}onDataRequest(e,t){if(this.dataReq){this.onError("data request overlap from client"),t.writeHead(400),t.end();return}let n=e.headers["content-type"]==="application/octet-stream";if(n&&this.protocol===4)return this.onError("invalid content");this.dataReq=e,this.dataRes=t;let i=n?Buffer.concat([]):"",s=()=>{e.removeListener("data",a),e.removeListener("end",c),e.removeListener("close",o),this.dataReq=this.dataRes=i=null},o=()=>{s(),this.onError("data request connection closed prematurely")},a=u=>{let p;n?(i=Buffer.concat([i,u]),p=i.length):(i+=u,p=Buffer.byteLength(i)),p>this.maxHttpBufferSize&&(t.writeHead(413).end(),s())},c=()=>{this.onData(i);let u={"Content-Type":"text/html","Content-Length":"2"};t.writeHead(200,this.headers(e,u)),t.end("ok"),s()};e.on("close",o),n||e.setEncoding("utf8"),e.on("data",a),e.on("end",c)}onData(e){Kt('received "%s"',e);let t=n=>{if(n.type==="close")return Kt("got xhr close packet"),this.onClose(),!1;this.onPacket(n)};this.protocol===3?this.parser.decodePayload(e,t):this.parser.decodePayload(e).forEach(t)}onClose(){this.writable&&this.send([{type:"noop"}]),super.onClose()}send(e){this.writable=!1,this.shouldClose&&(Kt("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=n=>{let i=e.some(s=>s.options&&s.options.compress);this.write(n,{compress:i})};this.protocol===3?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){Kt('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,n){let i=typeof e=="string",o={"Content-Type":i?"text/plain; charset=UTF-8":"application/octet-stream"},a=p=>{o["Content-Length"]=typeof p=="string"?Buffer.byteLength(p):p.length,this.res.writeHead(200,this.headers(this.req,o)),this.res.end(p),n()};if(!this.httpCompression||!t.compress){a(e);return}if((i?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let u=$M(this.req).encodings(["gzip","deflate"]);if(!u){a(e);return}this.compress(e,u,(p,f)=>{if(p){this.res.writeHead(500),this.res.end(),n(p);return}o["Content-Encoding"]=u,a(f)})}compress(e,t,n){Kt("compressing");let i=[],s=0;UM[t](this.httpCompression).on("error",n).on("data",function(o){i.push(o),s+=o.length}).on("end",function(){n(null,Buffer.concat(i,s))}).end(e)}doClose(e){Kt("closing");let t;this.dataReq&&(Kt("aborting ongoing data request"),this.dataReq.destroy());let n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(Kt("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(Kt("transport discarded - closing right away"),n()):(Kt("transport not writable - buffering orderly close"),this.shouldClose=n,t=setTimeout(n,this.closeTimeout))}headers(e,t={}){let n=e.headers["user-agent"];return n&&(~n.indexOf(";MSIE")||~n.indexOf("Trident/"))&&(t["X-XSS-Protection"]="0"),t["cache-control"]="no-store",this.emit("headers",t,e),t}};tc.Polling=Wp});var Ux=O(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.JSONP=void 0;var WM=Gp(),GM=require("querystring"),zM=/\\\\n/g,KM=/(\\)?\\n/g,zp=class extends WM.Polling{constructor(e){super(e),this.head="___eio["+(e._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(e){e=GM.parse(e).d,typeof e=="string"&&(e=e.replace(KM,function(t,n){return n?t:`
10
+ `}),super.onData(e.replace(zM,"\\n")))}doWrite(e,t,n){let i=JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");e=this.head+i+this.foot,super.doWrite(e,t,n)}};rc.JSONP=zp});var Gx=O(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.WebSocket=void 0;var VM=Jn(),YM=Ae(),Wx=(0,YM.default)("engine:ws"),Kp=class extends VM.Transport{constructor(e){super(e),this._doSend=t=>{this.socket.send(t,this._onSent)},this._doSendLast=t=>{this.socket.send(t,this._onSentLast)},this._onSent=t=>{t&&this.onError("write error",t.stack)},this._onSentLast=t=>{t?this.onError("write error",t.stack):(this.emit("drain"),this.writable=!0,this.emit("ready"))},this.socket=e.websocket,this.socket.on("message",(t,n)=>{let i=n?t:t.toString();Wx('received "%s"',i),super.onData(i)}),this.socket.once("close",this.onClose.bind(this)),this.socket.on("error",this.onError.bind(this)),this.writable=!0,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],i=t+1===e.length;this._canSendPreEncodedFrame(n)?this.socket._sender.sendFrame(n.options.wsPreEncodedFrame,i?this._onSentLast:this._onSent):this.parser.encodePacket(n,this.supportsBinary,i?this._doSendLast:this._doSend)}}_canSendPreEncodedFrame(e){var t,n,i;return!this.perMessageDeflate&&typeof((n=(t=this.socket)===null||t===void 0?void 0:t._sender)===null||n===void 0?void 0:n.sendFrame)=="function"&&((i=e.options)===null||i===void 0?void 0:i.wsPreEncodedFrame)!==void 0}doClose(e){Wx("closing"),this.socket.close(),e&&e()}};nc.WebSocket=Kp});var Yp=O(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.WebTransport=void 0;var XM=Jn(),JM=Ae(),QM=no(),Fi=(0,JM.default)("engine:webtransport"),Vp=class extends XM.Transport{constructor(e,t,n){super({_query:{EIO:"4"}}),this.session=e;let i=(0,QM.createPacketEncoderStream)();i.readable.pipeTo(t.writable).catch(()=>{Fi("the stream was closed")}),this.writer=i.writable.getWriter(),(async()=>{try{for(;;){let{value:s,done:o}=await n.read();if(o){Fi("session is closed");break}Fi("received chunk: %o",s),this.onPacket(s)}}catch(s){Fi("error while reading: %s",s.message)}})(),e.closed.then(()=>this.onClose()),this.writable=!0}get name(){return"webtransport"}async send(e){this.writable=!1;try{for(let t=0;t<e.length;t++){let n=e[t];await this.writer.write(n)}}catch(t){Fi("error while writing: %s",t.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(e){Fi("closing WebTransport session"),this.session.close(),e&&e()}};ic.WebTransport=Vp});var Jp=O(Xp=>{"use strict";Object.defineProperty(Xp,"__esModule",{value:!0});var ZM=Gp(),eI=Ux(),tI=Gx(),rI=Yp();Xp.default={polling:zx,websocket:tI.WebSocket,webtransport:rI.WebTransport};function zx(r){return typeof r._query.j=="string"?new eI.JSONP(r):new ZM.Polling(r)}zx.upgradesTo=["websocket","webtransport"]});var Zp=O(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.Socket=void 0;var nI=require("events"),iI=Ae(),Qr=require("timers"),Re=(0,iI.default)("engine:socket"),Qp=class extends nI.EventEmitter{get readyState(){return this._readyState}set readyState(e){Re("readyState updated from %s to %s",this._readyState,e),this._readyState=e}constructor(e,t,n,i,s){super(),this._readyState="opening",this.upgrading=!1,this.upgraded=!1,this.writeBuffer=[],this.packetsFn=[],this.sentCallbackFn=[],this.cleanupFn=[],this.id=e,this.server=t,this.request=i,this.protocol=s,i&&(i.websocket&&i.websocket._socket?this.remoteAddress=i.websocket._socket.remoteAddress:this.remoteAddress=i.connection.remoteAddress),this.pingTimeoutTimer=null,this.pingIntervalTimer=null,this.setTransport(n),this.onOpen()}onOpen(){this.readyState="open",this.transport.sid=this.id,this.sendPacket("open",JSON.stringify({sid:this.id,upgrades:this.getAvailableUpgrades(),pingInterval:this.server.opts.pingInterval,pingTimeout:this.server.opts.pingTimeout,maxPayload:this.server.opts.maxHttpBufferSize})),this.server.opts.initialPacket&&this.sendPacket("message",this.server.opts.initialPacket),this.emit("open"),this.protocol===3?this.resetPingTimeout():this.schedulePing()}onPacket(e){if(this.readyState!=="open")return Re("packet received with closed socket");switch(Re(`received packet ${e.type}`),this.emit("packet",e),e.type){case"ping":if(this.transport.protocol!==3){this.onError(new Error("invalid heartbeat direction"));return}Re("got ping"),this.pingTimeoutTimer.refresh(),this.sendPacket("pong"),this.emit("heartbeat");break;case"pong":if(this.transport.protocol===3){this.onError(new Error("invalid heartbeat direction"));return}Re("got pong"),(0,Qr.clearTimeout)(this.pingTimeoutTimer),this.pingIntervalTimer.refresh(),this.emit("heartbeat");break;case"error":this.onClose("parse error");break;case"message":this.emit("data",e.data),this.emit("message",e.data);break}}onError(e){Re("transport error"),this.onClose("transport error",e)}schedulePing(){this.pingIntervalTimer=(0,Qr.setTimeout)(()=>{Re("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){(0,Qr.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,Qr.setTimeout)(()=>{this.readyState!=="closed"&&this.onClose("ping timeout")},this.protocol===3?this.server.opts.pingInterval+this.server.opts.pingTimeout:this.server.opts.pingTimeout)}setTransport(e){let t=this.onError.bind(this),n=()=>this.flush(),i=this.onPacket.bind(this),s=this.onDrain.bind(this),o=this.onClose.bind(this,"transport close");this.transport=e,this.transport.once("error",t),this.transport.on("ready",n),this.transport.on("packet",i),this.transport.on("drain",s),this.transport.once("close",o),this.cleanupFn.push(function(){e.removeListener("error",t),e.removeListener("ready",n),e.removeListener("packet",i),e.removeListener("drain",s),e.removeListener("close",o)})}onDrain(){if(this.sentCallbackFn.length>0){Re("executing batch send callback");let e=this.sentCallbackFn.shift();if(e)for(let t=0;t<e.length;t++)e[t](this.transport)}}_maybeUpgrade(e){Re('might upgrade socket transport from "%s" to "%s"',this.transport.name,e.name),this.upgrading=!0;let t=(0,Qr.setTimeout)(()=>{Re("client did not complete upgrade - closing transport"),o(),e.readyState==="open"&&e.close()},this.server.opts.upgradeTimeout),n,i=p=>{p.type==="ping"&&p.data==="probe"?(Re("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(n),n=setInterval(s,100)):p.type==="upgrade"&&this.readyState!=="closed"?(Re("got upgrade packet - upgrading"),o(),this.transport.discard(),this.upgraded=!0,this.clearTransport(),this.setTransport(e),this.emit("upgrade",e),this.flush(),this.readyState==="closing"&&e.close(()=>{this.onClose("forced close")})):(o(),e.close())},s=()=>{this.transport.name==="polling"&&this.transport.writable&&(Re("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}]))},o=()=>{this.upgrading=!1,clearInterval(n),(0,Qr.clearTimeout)(t),e.removeListener("packet",i),e.removeListener("close",c),e.removeListener("error",a),this.removeListener("close",u)},a=p=>{Re("client did not complete upgrade - %s",p),o(),e.close(),e=null},c=()=>{a("transport closed")},u=()=>{a("socket closed")};e.on("packet",i),e.once("close",c),e.once("error",a),this.once("close",u)}clearTransport(){let e,t=this.cleanupFn.length;for(let n=0;n<t;n++)e=this.cleanupFn.shift(),e();this.transport.on("error",function(){Re("error triggered by discarded transport")}),this.transport.close(),(0,Qr.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){this.readyState!=="closed"&&(this.readyState="closed",(0,Qr.clearTimeout)(this.pingIntervalTimer),(0,Qr.clearTimeout)(this.pingTimeoutTimer),process.nextTick(()=>{this.writeBuffer=[]}),this.packetsFn=[],this.sentCallbackFn=[],this.clearTransport(),this.emit("close",e,t))}send(e,t,n){return this.sendPacket("message",e,t,n),this}write(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n={},i){if(typeof n=="function"&&(i=n,n={}),this.readyState!=="closing"&&this.readyState!=="closed"){Re('sending packet "%s" (%s)',e,t),n.compress=n.compress!==!1;let s={type:e,options:n};t&&(s.data=t),this.emit("packetCreate",s),this.writeBuffer.push(s),typeof i=="function"&&this.packetsFn.push(i),this.flush()}}flush(){if(this.readyState!=="closed"&&this.transport.writable&&this.writeBuffer.length){Re("flushing buffer to transport"),this.emit("flush",this.writeBuffer),this.server.emit("flush",this,this.writeBuffer);let e=this.writeBuffer;this.writeBuffer=[],this.packetsFn.length?(this.sentCallbackFn.push(this.packetsFn),this.packetsFn=[]):this.sentCallbackFn.push(null),this.transport.send(e),this.emit("drain"),this.server.emit("drain",this)}}getAvailableUpgrades(){let e=[],t=this.server.upgrades(this.transport.name);for(let n=0;n<t.length;++n){let i=t[n];this.server.opts.transports.indexOf(i)!==-1&&e.push(i)}return e}close(e){if(e&&(this.readyState==="open"||this.readyState==="closing"))return this.closeTransport(e);if(this.readyState==="open"){if(this.readyState="closing",this.writeBuffer.length){Re("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{Re("all packets have been sent, closing the transport"),this.closeTransport(e)});return}Re("the buffer is empty, closing the transport right away"),this.closeTransport(e)}}closeTransport(e){Re("closing the transport (discard? %s)",!!e),e&&this.transport.discard(),this.transport.close(this.onClose.bind(this,"forced close"))}};sc.Socket=Qp});var Yx=O(ef=>{"use strict";ef.parse=pI;ef.serialize=fI;var sI=Object.prototype.toString,oI=Object.prototype.hasOwnProperty,aI=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,cI=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,lI=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,uI=/^[\u0020-\u003A\u003D-\u007E]*$/;function pI(r,e){if(typeof r!="string")throw new TypeError("argument str must be a string");var t={},n=r.length;if(n<2)return t;var i=e&&e.decode||dI,s=0,o=0,a=0;do{if(o=r.indexOf("=",s),o===-1)break;if(a=r.indexOf(";",s),a===-1)a=n;else if(o>a){s=r.lastIndexOf(";",o-1)+1;continue}var c=Kx(r,s,o),u=Vx(r,o,c),p=r.slice(c,u);if(!oI.call(t,p)){var f=Kx(r,o+1,a),m=Vx(r,a,f);r.charCodeAt(f)===34&&r.charCodeAt(m-1)===34&&(f++,m--);var y=r.slice(f,m);t[p]=mI(y,i)}s=a+1}while(s<n);return t}function Kx(r,e,t){do{var n=r.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<t);return t}function Vx(r,e,t){for(;e>t;){var n=r.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return t}function fI(r,e,t){var n=t&&t.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!aI.test(r))throw new TypeError("argument name is invalid");var i=n(e);if(!cI.test(i))throw new TypeError("argument val is invalid");var s=r+"="+i;if(!t)return s;if(t.maxAge!=null){var o=Math.floor(t.maxAge);if(!isFinite(o))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+o}if(t.domain){if(!lI.test(t.domain))throw new TypeError("option domain is invalid");s+="; Domain="+t.domain}if(t.path){if(!uI.test(t.path))throw new TypeError("option path is invalid");s+="; Path="+t.path}if(t.expires){var a=t.expires;if(!hI(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+a.toUTCString()}if(t.httpOnly&&(s+="; HttpOnly"),t.secure&&(s+="; Secure"),t.partitioned&&(s+="; Partitioned"),t.priority){var c=typeof t.priority=="string"?t.priority.toLowerCase():t.priority;switch(c){case"low":s+="; Priority=Low";break;case"medium":s+="; Priority=Medium";break;case"high":s+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(t.sameSite){var u=typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite;switch(u){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s}function dI(r){return r.indexOf("%")!==-1?decodeURIComponent(r):r}function hI(r){return sI.call(r)==="[object Date]"}function mI(r,e){try{return e(r)}catch{return r}}});var Zr=O((h6,Qx)=>{"use strict";var Xx=["nodebuffer","arraybuffer","fragments"],Jx=typeof Blob<"u";Jx&&Xx.push("blob");Qx.exports={BINARY_TYPES:Xx,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Jx,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var hy=O((m6,dy)=>{var ry=require("fs"),en=require("path"),ny=require("os"),iy=typeof __webpack_require__=="function"?__non_webpack_require__:require,gI=process.config&&process.config.variables||{},vI=!!process.env.PREBUILDS_ONLY,Zx=process.versions.modules,tf=_I()?"electron":yI()?"node-webkit":"node",rf=process.env.npm_config_arch||ny.arch(),nf=process.env.npm_config_platform||ny.platform(),sy=process.env.LIBC||(bI(nf)?"musl":"glibc"),sf=process.env.ARM_VERSION||(rf==="arm64"?"8":gI.arm_version)||"",oy=(process.versions.uv||"").split(".")[0];dy.exports=Lr;function Lr(r){return iy(Lr.resolve(r))}Lr.resolve=Lr.path=function(r){r=en.resolve(r||".");try{var e=iy(en.join(r,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(r=process.env[e+"_PREBUILD"])}catch{}if(!vI){var t=ey(en.join(r,"build/Release"),ty);if(t)return t;var n=ey(en.join(r,"build/Debug"),ty);if(n)return n}var i=a(r);if(i)return i;var s=a(en.dirname(process.execPath));if(s)return s;var o=["platform="+nf,"arch="+rf,"runtime="+tf,"abi="+Zx,"uv="+oy,sf?"armv="+sf:"","libc="+sy,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"",typeof __webpack_require__=="function"?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+o+`
11
11
  loaded from: `+r+`
12
- `);function a(c){var u=sf(en.join(c,"prebuilds")).map(sy),p=u.filter(oy(rf,tf)).sort(ay)[0];if(p){var f=en.join(c,"prebuilds",p.name),m=sf(f).map(cy),y=m.filter(ly(ef,Jx)),_=y.sort(uy(ef))[0];if(_)return en.join(f,_.file)}}};function sf(r){try{return ey.readdirSync(r)}catch{return[]}}function Qx(r,e){var t=sf(r).filter(e);return t[0]&&en.join(r,t[0])}function Zx(r){return/\.node$/.test(r)}function sy(r){var e=r.split("-");if(e.length===2){var t=e[0],n=e[1].split("+");if(t&&n.length&&n.every(Boolean))return{name:r,platform:t,architectures:n}}}function oy(r,e){return function(t){return t==null||t.platform!==r?!1:t.architectures.includes(e)}}function ay(r,e){return r.architectures.length-e.architectures.length}function cy(r){var e=r.split("."),t=e.pop(),n={file:r,specificity:0};if(t==="node"){for(var i=0;i<e.length;i++){var s=e[i];if(s==="node"||s==="electron"||s==="node-webkit")n.runtime=s;else if(s==="napi")n.napi=!0;else if(s.slice(0,3)==="abi")n.abi=s.slice(3);else if(s.slice(0,2)==="uv")n.uv=s.slice(2);else if(s.slice(0,4)==="armv")n.armv=s.slice(4);else if(s==="glibc"||s==="musl")n.libc=s;else continue;n.specificity++}return n}}function ly(r,e){return function(t){return!(t==null||t.runtime&&t.runtime!==r&&!hI(t)||t.abi&&t.abi!==e&&!t.napi||t.uv&&t.uv!==iy||t.armv&&t.armv!==nf||t.libc&&t.libc!==ny)}}function hI(r){return r.runtime==="node"&&r.napi}function uy(r){return function(e,t){return e.runtime!==t.runtime?e.runtime===r?-1:1:e.abi!==t.abi?e.abi?-1:1:e.specificity!==t.specificity?e.specificity>t.specificity?-1:1:0}}function mI(){return!!(process.versions&&process.versions.nw)}function gI(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function vI(r){return r==="linux"&&ey.existsSync("/etc/alpine-release")}Lr.parseTags=cy;Lr.matchTags=ly;Lr.compareTags=uy;Lr.parseTuple=sy;Lr.matchTuple=oy;Lr.compareTuples=ay});var cf=O((f6,af)=>{var of=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof of.addon=="function"?af.exports=of.addon.bind(of):af.exports=fy()});var hy=O((d6,dy)=>{"use strict";var xI=(r,e,t,n,i)=>{for(var s=0;s<i;s++)t[n+s]=r[s]^e[s&3]},yI=(r,e)=>{let t=r.length;for(var n=0;n<t;n++)r[n]^=e[n&3]};dy.exports={mask:xI,unmask:yI}});var uf=O((h6,lf)=>{"use strict";try{lf.exports=cf()(__dirname)}catch{lf.exports=hy()}});var io=O((m6,sc)=>{"use strict";var{EMPTY_BUFFER:_I}=Zr(),pf=Buffer[Symbol.species];function bI(r,e){if(r.length===0)return _I;if(r.length===1)return r[0];let t=Buffer.allocUnsafe(e),n=0;for(let i=0;i<r.length;i++){let s=r[i];t.set(s,n),n+=s.length}return n<e?new pf(t.buffer,t.byteOffset,n):t}function my(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function gy(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function wI(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function ff(r){if(ff.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new pf(r):ArrayBuffer.isView(r)?e=new pf(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),ff.readOnly=!1),e}sc.exports={concat:bI,mask:my,toArrayBuffer:wI,toBuffer:ff,unmask:gy};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=uf();sc.exports.mask=function(e,t,n,i,s){s<48?my(e,t,n,i,s):r.mask(e,t,n,i,s)},sc.exports.unmask=function(e,t){e.length<32?gy(e,t):r.unmask(e,t)}}catch{}});var yy=O((g6,xy)=>{"use strict";var vy=Symbol("kDone"),df=Symbol("kRun"),hf=class{constructor(e){this[vy]=()=>{this.pending--,this[df]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[df]()}[df](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[vy])}}};xy.exports=hf});var oo=O((v6,Sy)=>{"use strict";var so=require("zlib"),_y=io(),SI=yy(),{kStatusCode:by}=Zr(),EI=Buffer[Symbol.species],TI=Buffer.from([0,0,255,255]),ac=Symbol("permessage-deflate"),tn=Symbol("total-length"),Fi=Symbol("callback"),Mn=Symbol("buffers"),Hi=Symbol("error"),oc,mf=class{constructor(e,t,n){if(this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!oc){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;oc=new SI(i)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[Fi];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,n=e.find(i=>!(t.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>i.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof t.serverMaxWindowBits=="number"&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach(t=>{Object.keys(t).forEach(n=>{let i=t[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);t[n]=i})}),e}decompress(e,t,n){oc.add(i=>{this._decompress(e,t,(s,o)=>{i(),n(s,o)})})}compress(e,t,n){oc.add(i=>{this._compress(e,t,(s,o)=>{i(),n(s,o)})})}_decompress(e,t,n){let i=this._isServer?"client":"server";if(!this._inflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?so.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=so.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[ac]=this,this._inflate[tn]=0,this._inflate[Mn]=[],this._inflate.on("error",AI),this._inflate.on("data",wy)}this._inflate[Fi]=n,this._inflate.write(e),t&&this._inflate.write(TI),this._inflate.flush(()=>{let s=this._inflate[Hi];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=_y.concat(this._inflate[Mn],this._inflate[tn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[tn]=0,this._inflate[Mn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(e,t,n){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?so.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=so.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[tn]=0,this._deflate[Mn]=[],this._deflate.on("data",CI)}this._deflate[Fi]=n,this._deflate.write(e),this._deflate.flush(so.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=_y.concat(this._deflate[Mn],this._deflate[tn]);t&&(s=new EI(s.buffer,s.byteOffset,s.length-4)),this._deflate[Fi]=null,this._deflate[tn]=0,this._deflate[Mn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};Sy.exports=mf;function CI(r){this[Mn].push(r),this[tn]+=r.length}function wy(r){if(this[tn]+=r.length,this[ac]._maxPayload<1||this[tn]<=this[ac]._maxPayload){this[Mn].push(r);return}this[Hi]=new RangeError("Max payload size exceeded"),this[Hi].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Hi][by]=1009,this.removeListener("data",wy),this.reset()}function AI(r){if(this[ac]._inflate=null,this[Hi]){this[Fi](this[Hi]);return}r[by]=1007,this[Fi](r)}});var Ty=O((x6,Ey)=>{"use strict";function RI(r){let e=r.length,t=0;for(;t<e;)if((r[t]&128)===0)t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}Ey.exports=RI});var vf=O((y6,gf)=>{"use strict";try{gf.exports=cf()(__dirname)}catch{gf.exports=Ty()}});var $i=O((_6,cc)=>{"use strict";var{isUtf8:Cy}=require("buffer"),{hasBlob:kI}=Zr(),OI=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function PI(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function xf(r){let e=r.length,t=0;for(;t<e;)if((r[t]&128)===0)t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}function MI(r){return kI&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}cc.exports={isBlob:MI,isValidStatusCode:PI,isValidUTF8:xf,tokenChars:OI};if(Cy)cc.exports.isValidUTF8=function(r){return r.length<24?xf(r):Cy(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=vf();cc.exports.isValidUTF8=function(e){return e.length<32?xf(e):r(e)}}catch{}});var Sf=O((b6,Iy)=>{"use strict";var{Writable:II}=require("stream"),Ay=oo(),{BINARY_TYPES:NI,EMPTY_BUFFER:Ry,kStatusCode:LI,kWebSocket:DI}=Zr(),{concat:yf,toArrayBuffer:BI,unmask:jI}=io(),{isValidStatusCode:FI,isValidUTF8:ky}=$i(),lc=Buffer[Symbol.species],ir=0,Oy=1,Py=2,My=3,_f=4,bf=5,uc=6,wf=class extends II{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||NI[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[DI]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=ir}_write(e,t,n){if(this._opcode===8&&this._state==ir)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new lc(n.buffer,n.byteOffset+e,n.length-e),new lc(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],i=t.length-e;e>=n.length?t.set(this._buffers.shift(),i):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),i),this._buffers[0]=new lc(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case ir:this.getInfo(e);break;case Oy:this.getPayloadLength16(e);break;case Py:this.getPayloadLength64(e);break;case My:this.getMask();break;case _f:this.getData(e);break;case bf:case uc:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let n=(t[0]&64)===64;if(n&&!this._extensions[Ay.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=Oy:this._payloadLength===127?this._state=Py:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);if(n>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(i);return}this._payloadLength=n*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}this._masked?this._state=My:this._state=_f}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=_f}getData(e){let t=Ry;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&jI(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=bf,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[Ay.extensionName].decompress(e,this._fin,(i,s)=>{if(i)return t(i);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._fragments.push(s)}this.dataMessage(t),this._state===ir&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=ir;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=yf(n,t):this._binaryType==="arraybuffer"?i=BI(yf(n,t)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=ir):(this._state=uc,setImmediate(()=>{this.emit("message",i,!0),this._state=ir,this.startLoop(e)}))}else{let i=yf(n,t);if(!this._skipUTF8Validation&&!ky(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===bf||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=ir):(this._state=uc,setImmediate(()=>{this.emit("message",i,!1),this._state=ir,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,Ry),this.end();else{let n=e.readUInt16BE(0);if(!FI(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new lc(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!ky(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=ir;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=ir):(this._state=uc,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=ir,this.startLoop(t)}))}createError(e,t,n,i,s){this._loop=!1,this._errored=!0;let o=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=s,o[LI]=i,o}};Iy.exports=wf});var Cf=O((S6,Dy)=>{"use strict";var{Duplex:w6}=require("stream"),{randomFillSync:HI}=require("crypto"),Ny=oo(),{EMPTY_BUFFER:$I,kWebSocket:qI,NOOP:UI}=Zr(),{isBlob:qi,isValidStatusCode:WI}=$i(),{mask:Ly,toBuffer:Xn}=io(),sr=Symbol("kByteLength"),GI=Buffer.alloc(4),pc=8*1024,Jn,Ui=pc,wr=0,zI=1,KI=2,Ef=class r{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=wr,this.onerror=UI,this[qI]=void 0}static frame(e,t){let n,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||GI,t.generateMask?t.generateMask(n):(Ui===pc&&(Jn===void 0&&(Jn=Buffer.alloc(pc)),HI(Jn,0,pc),Ui=0),n[0]=Jn[Ui++],n[1]=Jn[Ui++],n[2]=Jn[Ui++],n[3]=Jn[Ui++]),o=(n[0]|n[1]|n[2]|n[3])===0,s=6);let a;typeof e=="string"?(!t.mask||o)&&t[sr]!==void 0?a=t[sr]:(e=Buffer.from(e),a=e.length):(a=e.length,i=t.mask&&t.readOnly&&!o);let c=a;a>=65536?(s+=8,c=127):a>125&&(s+=2,c=126);let u=Buffer.allocUnsafe(i?a+s:s);return u[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),t.mask?(u[1]|=128,u[s-4]=n[0],u[s-3]=n[1],u[s-2]=n[2],u[s-1]=n[3],o?[u,e]:i?(Ly(e,n,u,s,a),[u]):(Ly(e,n,e,0,a),[u,e])):[u,e]}close(e,t,n,i){let s;if(e===void 0)s=$I;else{if(typeof e!="number"||!WI(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+a),s.writeUInt16BE(e,0),typeof t=="string"?s.write(t,2):s.set(t,2)}}let o={[sr]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==wr?this.enqueue([this.dispatch,s,!1,o,i]):this.sendFrame(r.frame(s,o),i)}ping(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):qi(e)?(i=e.size,s=!1):(e=Xn(e),i=e.length,s=Xn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[sr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};qi(e)?this._state!==wr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==wr?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}pong(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):qi(e)?(i=e.size,s=!1):(e=Xn(e),i=e.length,s=Xn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[sr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};qi(e)?this._state!==wr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==wr?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}send(e,t,n){let i=this._extensions[Ny.extensionName],s=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):qi(e)?(a=e.size,c=!1):(e=Xn(e),a=e.length,c=Xn.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=i._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0);let u={[sr]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};qi(e)?this._state!==wr?this.enqueue([this.getBlobData,e,this._compress,u,n]):this.getBlobData(e,this._compress,u,n):this._state!==wr?this.enqueue([this.dispatch,e,this._compress,u,n]):this.dispatch(e,this._compress,u,n)}getBlobData(e,t,n,i){this._bufferedBytes+=n[sr],this._state=KI,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Tf,this,a,i);return}this._bufferedBytes-=n[sr];let o=Xn(s);t?this.dispatch(o,t,n,i):(this._state=wr,this.sendFrame(r.frame(o,n),i),this.dequeue())}).catch(s=>{process.nextTick(VI,this,s,i)})}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let s=this._extensions[Ny.extensionName];this._bufferedBytes+=n[sr],this._state=zI,s.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Tf(this,c,i);return}this._bufferedBytes-=n[sr],this._state=wr,n.readOnly=!1,this.sendFrame(r.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===wr&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][sr],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][sr],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};Dy.exports=Ef;function Tf(r,e,t){typeof t=="function"&&t(e);for(let n=0;n<r._queue.length;n++){let i=r._queue[n],s=i[i.length-1];typeof s=="function"&&s(e)}}function VI(r,e,t){Tf(r,e,t),r.onerror(e)}});var Gy=O((E6,Wy)=>{"use strict";var{kForOnEventAttribute:ao,kListener:Af}=Zr(),By=Symbol("kCode"),jy=Symbol("kData"),Fy=Symbol("kError"),Hy=Symbol("kMessage"),$y=Symbol("kReason"),Wi=Symbol("kTarget"),qy=Symbol("kType"),Uy=Symbol("kWasClean"),rn=class{constructor(e){this[Wi]=null,this[qy]=e}get target(){return this[Wi]}get type(){return this[qy]}};Object.defineProperty(rn.prototype,"target",{enumerable:!0});Object.defineProperty(rn.prototype,"type",{enumerable:!0});var Qn=class extends rn{constructor(e,t={}){super(e),this[By]=t.code===void 0?0:t.code,this[$y]=t.reason===void 0?"":t.reason,this[Uy]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[By]}get reason(){return this[$y]}get wasClean(){return this[Uy]}};Object.defineProperty(Qn.prototype,"code",{enumerable:!0});Object.defineProperty(Qn.prototype,"reason",{enumerable:!0});Object.defineProperty(Qn.prototype,"wasClean",{enumerable:!0});var Gi=class extends rn{constructor(e,t={}){super(e),this[Fy]=t.error===void 0?null:t.error,this[Hy]=t.message===void 0?"":t.message}get error(){return this[Fy]}get message(){return this[Hy]}};Object.defineProperty(Gi.prototype,"error",{enumerable:!0});Object.defineProperty(Gi.prototype,"message",{enumerable:!0});var co=class extends rn{constructor(e,t={}){super(e),this[jy]=t.data===void 0?null:t.data}get data(){return this[jy]}};Object.defineProperty(co.prototype,"data",{enumerable:!0});var YI={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[ao]&&i[Af]===e&&!i[ao])return;let n;if(r==="message")n=function(s,o){let a=new co("message",{data:o?s:s.toString()});a[Wi]=this,fc(e,this,a)};else if(r==="close")n=function(s,o){let a=new Qn("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[Wi]=this,fc(e,this,a)};else if(r==="error")n=function(s){let o=new Gi("error",{error:s,message:s.message});o[Wi]=this,fc(e,this,o)};else if(r==="open")n=function(){let s=new rn("open");s[Wi]=this,fc(e,this,s)};else return;n[ao]=!!t[ao],n[Af]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[Af]===e&&!t[ao]){this.removeListener(r,t);break}}};Wy.exports={CloseEvent:Qn,ErrorEvent:Gi,Event:rn,EventTarget:YI,MessageEvent:co};function fc(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var Rf=O((T6,zy)=>{"use strict";var{tokenChars:lo}=$i();function Dr(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function XI(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,u=-1,p=-1,f=0;for(;f<r.length;f++)if(u=r.charCodeAt(f),o===void 0)if(p===-1&&lo[u]===1)c===-1&&(c=f);else if(f!==0&&(u===32||u===9))p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);u===44?(Dr(e,y,t),t=Object.create(null)):o=y,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(p===-1&&lo[u]===1)c===-1&&(c=f);else if(u===32||u===9)p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f),Dr(t,r.slice(c,p),!0),u===44&&(Dr(e,o,t),t=Object.create(null),o=void 0),c=p=-1}else if(u===61&&c!==-1&&p===-1)a=r.slice(c,f),c=p=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(lo[u]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),i=!1}else if(s)if(lo[u]===1)c===-1&&(c=f);else if(u===34&&c!==-1)s=!1,p=f;else if(u===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(u===34&&r.charCodeAt(f-1)===61)s=!0;else if(p===-1&&lo[u]===1)c===-1&&(c=f);else if(c!==-1&&(u===32||u===9))p===-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);n&&(y=y.replace(/\\/g,""),n=!1),Dr(t,a,y),u===44&&(Dr(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||s||u===32||u===9)throw new SyntaxError("Unexpected end of input");p===-1&&(p=f);let m=r.slice(c,p);return o===void 0?Dr(e,m,t):(a===void 0?Dr(t,m,!0):n?Dr(t,a,m.replace(/\\/g,"")):Dr(t,a,m),Dr(e,o,t)),e}function JI(r){return Object.keys(r).map(e=>{let t=r[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(i=>{let s=n[i];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}zy.exports={format:JI,parse:XI}});var gc=O((R6,i0)=>{"use strict";var QI=require("events"),ZI=require("https"),eN=require("http"),Yy=require("net"),tN=require("tls"),{randomBytes:rN,createHash:nN}=require("crypto"),{Duplex:C6,Readable:A6}=require("stream"),{URL:kf}=require("url"),In=oo(),iN=Sf(),sN=Cf(),{isBlob:oN}=$i(),{BINARY_TYPES:Ky,EMPTY_BUFFER:dc,GUID:aN,kForOnEventAttribute:Of,kListener:cN,kStatusCode:lN,kWebSocket:lt,NOOP:Xy}=Zr(),{EventTarget:{addEventListener:uN,removeEventListener:pN}}=Gy(),{format:fN,parse:dN}=Rf(),{toBuffer:hN}=io(),mN=30*1e3,Jy=Symbol("kAborted"),Pf=[8,13],nn=["CONNECTING","OPEN","CLOSING","CLOSED"],gN=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,be=class r extends QI{constructor(e,t,n){super(),this._binaryType=Ky[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=dc,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(n=t,t=[]):t=[t]),Qy(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Ky.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,n){let i=new iN({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new sN(e,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=e,i[lt]=this,s[lt]=this,e[lt]=this,i.on("conclude",yN),i.on("drain",_N),i.on("error",bN),i.on("message",wN),i.on("ping",SN),i.on("pong",EN),s.onerror=TN,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",t0),e.on("data",mc),e.on("end",r0),e.on("error",n0),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[In.extensionName]&&this._extensions[In.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Vt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),e0(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Mf(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||dc,t,n)}pong(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Mf(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||dc,t,n)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(n=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Mf(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[In.extensionName]||(i.compress=!1),this._sender.send(e||dc,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Vt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(be,"CONNECTING",{enumerable:!0,value:nn.indexOf("CONNECTING")});Object.defineProperty(be.prototype,"CONNECTING",{enumerable:!0,value:nn.indexOf("CONNECTING")});Object.defineProperty(be,"OPEN",{enumerable:!0,value:nn.indexOf("OPEN")});Object.defineProperty(be.prototype,"OPEN",{enumerable:!0,value:nn.indexOf("OPEN")});Object.defineProperty(be,"CLOSING",{enumerable:!0,value:nn.indexOf("CLOSING")});Object.defineProperty(be.prototype,"CLOSING",{enumerable:!0,value:nn.indexOf("CLOSING")});Object.defineProperty(be,"CLOSED",{enumerable:!0,value:nn.indexOf("CLOSED")});Object.defineProperty(be.prototype,"CLOSED",{enumerable:!0,value:nn.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(be.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(be.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Of])return e[cN];return null},set(e){for(let t of this.listeners(r))if(t[Of]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[Of]:!0})}})});be.prototype.addEventListener=uN;be.prototype.removeEventListener=pN;i0.exports=be;function Qy(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Pf[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=i.autoPong,!Pf.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Pf.join(", ")})`);let s;if(e instanceof kf)s=e;else try{s=new kf(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),r._url=s.href;let o=s.protocol==="wss:",a=s.protocol==="ws+unix:",c;if(s.protocol!=="ws:"&&!o&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"),c){let S=new SyntaxError(c);if(r._redirects===0)throw S;hc(r,S);return}let u=o?443:80,p=rN(16).toString("base64"),f=o?ZI.request:eN.request,m=new Set,y;if(i.createConnection=i.createConnection||(o?xN:vN),i.defaultPort=i.defaultPort||u,i.port=s.port||u,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":p,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(y=new In(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=fN({[In.extensionName]:y.offer()})),t.length){for(let S of t){if(typeof S!="string"||!gN.test(S)||m.has(S))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.add(S)}i.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(s.username||s.password)&&(i.auth=`${s.username}:${s.password}`),a){let S=i.path.split(":");i.socketPath=S[0],i.path=S[1]}let _;if(i.followRedirects){if(r._redirects===0){r._originalIpc=a,r._originalSecure=o,r._originalHostOrSocketPath=a?i.socketPath:s.host;let S=n&&n.headers;if(n={...n,headers:{}},S)for(let[A,P]of Object.entries(S))n.headers[A.toLowerCase()]=P}else if(r.listenerCount("redirect")===0){let S=a?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:s.host===r._originalHostOrSocketPath;(!S||r._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,S||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),_=r._req=f(i),r._redirects&&r.emit("redirect",r.url,_)}else _=r._req=f(i);i.timeout&&_.on("timeout",()=>{Vt(r,_,"Opening handshake has timed out")}),_.on("error",S=>{_===null||_[Jy]||(_=r._req=null,hc(r,S))}),_.on("response",S=>{let A=S.headers.location,P=S.statusCode;if(A&&i.followRedirects&&P>=300&&P<400){if(++r._redirects>i.maxRedirects){Vt(r,_,"Maximum redirects exceeded");return}_.abort();let L;try{L=new kf(A,e)}catch{let H=new SyntaxError(`Invalid URL: ${A}`);hc(r,H);return}Qy(r,L,t,n)}else r.emit("unexpected-response",_,S)||Vt(r,_,`Unexpected server response: ${S.statusCode}`)}),_.on("upgrade",(S,A,P)=>{if(r.emit("upgrade",S),r.readyState!==be.CONNECTING)return;_=r._req=null;let L=S.headers.upgrade;if(L===void 0||L.toLowerCase()!=="websocket"){Vt(r,A,"Invalid Upgrade header");return}let N=nN("sha1").update(p+aN).digest("base64");if(S.headers["sec-websocket-accept"]!==N){Vt(r,A,"Invalid Sec-WebSocket-Accept header");return}let H=S.headers["sec-websocket-protocol"],W;if(H!==void 0?m.size?m.has(H)||(W="Server sent an invalid subprotocol"):W="Server sent a subprotocol but none was requested":m.size&&(W="Server sent no subprotocol"),W){Vt(r,A,W);return}H&&(r._protocol=H);let U=S.headers["sec-websocket-extensions"];if(U!==void 0){if(!y){Vt(r,A,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let G;try{G=dN(U)}catch{Vt(r,A,"Invalid Sec-WebSocket-Extensions header");return}let M=Object.keys(G);if(M.length!==1||M[0]!==In.extensionName){Vt(r,A,"Server indicated an extension that was not requested");return}try{y.accept(G[In.extensionName])}catch{Vt(r,A,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[In.extensionName]=y}r.setSocket(A,P,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(_,r):_.end()}function hc(r,e){r._readyState=be.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function vN(r){return r.path=r.socketPath,Yy.connect(r)}function xN(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=Yy.isIP(r.host)?"":r.host),tN.connect(r)}function Vt(r,e,t){r._readyState=be.CLOSING;let n=new Error(t);Error.captureStackTrace(n,Vt),e.setHeader?(e[Jy]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(hc,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Mf(r,e,t){if(e){let n=oN(e)?e.size:hN(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${nn[r.readyState]})`);process.nextTick(t,n)}}function yN(r,e){let t=this[lt];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[lt]!==void 0&&(t._socket.removeListener("data",mc),process.nextTick(Zy,t._socket),r===1005?t.close():t.close(r,e))}function _N(){let r=this[lt];r.isPaused||r._socket.resume()}function bN(r){let e=this[lt];e._socket[lt]!==void 0&&(e._socket.removeListener("data",mc),process.nextTick(Zy,e._socket),e.close(r[lN])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function Vy(){this[lt].emitClose()}function wN(r,e){this[lt].emit("message",r,e)}function SN(r){let e=this[lt];e._autoPong&&e.pong(r,!this._isServer,Xy),e.emit("ping",r)}function EN(r){this[lt].emit("pong",r)}function Zy(r){r.resume()}function TN(r){let e=this[lt];e.readyState!==be.CLOSED&&(e.readyState===be.OPEN&&(e._readyState=be.CLOSING,e0(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function e0(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),mN)}function t0(){let r=this[lt];this.removeListener("close",t0),this.removeListener("data",mc),this.removeListener("end",r0),r._readyState=be.CLOSING;let e;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(e=r._socket.read())!==null&&r._receiver.write(e),r._receiver.end(),this[lt]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",Vy),r._receiver.on("finish",Vy))}function mc(r){this[lt]._receiver.write(r)||this.pause()}function r0(){let r=this[lt];r._readyState=be.CLOSING,r._receiver.end(),this.end()}function n0(){let r=this[lt];this.removeListener("error",n0),this.on("error",Xy),r&&(r._readyState=be.CLOSING,this.destroy())}});var c0=O((O6,a0)=>{"use strict";var k6=gc(),{Duplex:CN}=require("stream");function s0(r){r.emit("close")}function AN(){!this.destroyed&&this._writableState.finished&&this.destroy()}function o0(r){this.removeListener("error",o0),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function RN(r,e){let t=!0,n=new CN({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(s,o){let a=!o&&n._readableState.objectMode?s.toString():s;n.push(a)||r.pause()}),r.once("error",function(s){n.destroyed||(t=!1,n.destroy(s))}),r.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,s){if(r.readyState===r.CLOSED){s(i),process.nextTick(s0,n);return}let o=!1;r.once("error",function(c){o=!0,s(c)}),r.once("close",function(){o||s(i),process.nextTick(s0,n)}),t&&r.terminate()},n._final=function(i){if(r.readyState===r.CONNECTING){r.once("open",function(){n._final(i)});return}r._socket!==null&&(r._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(r._socket.once("finish",function(){i()}),r.close()))},n._read=function(){r.isPaused&&r.resume()},n._write=function(i,s,o){if(r.readyState===r.CONNECTING){r.once("open",function(){n._write(i,s,o)});return}r.send(i,o)},n.on("end",AN),n.on("error",o0),n}a0.exports=RN});var u0=O((P6,l0)=>{"use strict";var{tokenChars:kN}=$i();function ON(r){let e=new Set,t=-1,n=-1,i=0;for(i;i<r.length;i++){let o=r.charCodeAt(i);if(n===-1&&kN[o]===1)t===-1&&(t=i);else if(i!==0&&(o===32||o===9))n===-1&&t!==-1&&(n=i);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=r.slice(t,n);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),t=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=r.slice(t,i);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}l0.exports={parse:ON}});var v0=O((I6,g0)=>{"use strict";var PN=require("events"),vc=require("http"),{Duplex:M6}=require("stream"),{createHash:MN}=require("crypto"),p0=Rf(),Zn=oo(),IN=u0(),NN=gc(),{GUID:LN,kWebSocket:DN}=Zr(),BN=/^[+/0-9A-Za-z]{22}==$/,f0=0,d0=1,m0=2,If=class extends PN{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:NN,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=vc.createServer((n,i)=>{let s=vc.STATUS_CODES[426];i.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),i.end(s)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=jN(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,s,o)=>{this.handleUpgrade(i,s,o,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=f0}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===m0){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(uo,this);return}if(e&&this.once("close",e),this._state!==d0)if(this._state=d0,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(uo,this):process.nextTick(uo,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{uo(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,i){t.on("error",h0);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){ei(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){ei(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!BN.test(s)){ei(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){ei(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){po(t,400);return}let c=e.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=IN.parse(c)}catch{ei(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let p=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&p!==void 0){let m=new Zn(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let y=p0.parse(p);y[Zn.extensionName]&&(m.accept(y[Zn.extensionName]),f[Zn.extensionName]=m)}catch{ei(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(m,(y,_,S,A)=>{if(!y)return po(t,_||401,S,A);this.completeUpgrade(f,s,u,e,t,n,i)});return}if(!this.options.verifyClient(m))return po(t,401)}this.completeUpgrade(f,s,u,e,t,n,i)}completeUpgrade(e,t,n,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[DN])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>f0)return po(s,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${MN("sha1").update(t+LN).digest("base64")}`],p=new this.options.WebSocket(null,void 0,this.options);if(n.size){let f=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;f&&(u.push(`Sec-WebSocket-Protocol: ${f}`),p._protocol=f)}if(e[Zn.extensionName]){let f=e[Zn.extensionName].params,m=p0.format({[Zn.extensionName]:[f]});u.push(`Sec-WebSocket-Extensions: ${m}`),p._extensions=e}this.emit("headers",u,i),s.write(u.concat(`\r
12
+ `);function a(c){var u=of(en.join(c,"prebuilds")).map(ay),p=u.filter(cy(nf,rf)).sort(ly)[0];if(p){var f=en.join(c,"prebuilds",p.name),m=of(f).map(uy),y=m.filter(py(tf,Zx)),_=y.sort(fy(tf))[0];if(_)return en.join(f,_.file)}}};function of(r){try{return ry.readdirSync(r)}catch{return[]}}function ey(r,e){var t=of(r).filter(e);return t[0]&&en.join(r,t[0])}function ty(r){return/\.node$/.test(r)}function ay(r){var e=r.split("-");if(e.length===2){var t=e[0],n=e[1].split("+");if(t&&n.length&&n.every(Boolean))return{name:r,platform:t,architectures:n}}}function cy(r,e){return function(t){return t==null||t.platform!==r?!1:t.architectures.includes(e)}}function ly(r,e){return r.architectures.length-e.architectures.length}function uy(r){var e=r.split("."),t=e.pop(),n={file:r,specificity:0};if(t==="node"){for(var i=0;i<e.length;i++){var s=e[i];if(s==="node"||s==="electron"||s==="node-webkit")n.runtime=s;else if(s==="napi")n.napi=!0;else if(s.slice(0,3)==="abi")n.abi=s.slice(3);else if(s.slice(0,2)==="uv")n.uv=s.slice(2);else if(s.slice(0,4)==="armv")n.armv=s.slice(4);else if(s==="glibc"||s==="musl")n.libc=s;else continue;n.specificity++}return n}}function py(r,e){return function(t){return!(t==null||t.runtime&&t.runtime!==r&&!xI(t)||t.abi&&t.abi!==e&&!t.napi||t.uv&&t.uv!==oy||t.armv&&t.armv!==sf||t.libc&&t.libc!==sy)}}function xI(r){return r.runtime==="node"&&r.napi}function fy(r){return function(e,t){return e.runtime!==t.runtime?e.runtime===r?-1:1:e.abi!==t.abi?e.abi?-1:1:e.specificity!==t.specificity?e.specificity>t.specificity?-1:1:0}}function yI(){return!!(process.versions&&process.versions.nw)}function _I(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function bI(r){return r==="linux"&&ry.existsSync("/etc/alpine-release")}Lr.parseTags=uy;Lr.matchTags=py;Lr.compareTags=fy;Lr.parseTuple=ay;Lr.matchTuple=cy;Lr.compareTuples=ly});var lf=O((g6,cf)=>{var af=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof af.addon=="function"?cf.exports=af.addon.bind(af):cf.exports=hy()});var gy=O((v6,my)=>{"use strict";var wI=(r,e,t,n,i)=>{for(var s=0;s<i;s++)t[n+s]=r[s]^e[s&3]},SI=(r,e)=>{let t=r.length;for(var n=0;n<t;n++)r[n]^=e[n&3]};my.exports={mask:wI,unmask:SI}});var pf=O((x6,uf)=>{"use strict";try{uf.exports=lf()(__dirname)}catch{uf.exports=gy()}});var io=O((y6,oc)=>{"use strict";var{EMPTY_BUFFER:EI}=Zr(),ff=Buffer[Symbol.species];function TI(r,e){if(r.length===0)return EI;if(r.length===1)return r[0];let t=Buffer.allocUnsafe(e),n=0;for(let i=0;i<r.length;i++){let s=r[i];t.set(s,n),n+=s.length}return n<e?new ff(t.buffer,t.byteOffset,n):t}function vy(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function xy(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function CI(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function df(r){if(df.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new ff(r):ArrayBuffer.isView(r)?e=new ff(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),df.readOnly=!1),e}oc.exports={concat:TI,mask:vy,toArrayBuffer:CI,toBuffer:df,unmask:xy};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=pf();oc.exports.mask=function(e,t,n,i,s){s<48?vy(e,t,n,i,s):r.mask(e,t,n,i,s)},oc.exports.unmask=function(e,t){e.length<32?xy(e,t):r.unmask(e,t)}}catch{}});var by=O((_6,_y)=>{"use strict";var yy=Symbol("kDone"),hf=Symbol("kRun"),mf=class{constructor(e){this[yy]=()=>{this.pending--,this[hf]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[hf]()}[hf](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[yy])}}};_y.exports=mf});var oo=O((b6,Ty)=>{"use strict";var so=require("zlib"),wy=io(),AI=by(),{kStatusCode:Sy}=Zr(),RI=Buffer[Symbol.species],kI=Buffer.from([0,0,255,255]),cc=Symbol("permessage-deflate"),tn=Symbol("total-length"),Hi=Symbol("callback"),In=Symbol("buffers"),$i=Symbol("error"),ac,gf=class{constructor(e,t,n){if(this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!ac){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;ac=new AI(i)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[Hi];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,n=e.find(i=>!(t.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>i.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof t.serverMaxWindowBits=="number"&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach(t=>{Object.keys(t).forEach(n=>{let i=t[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);t[n]=i})}),e}decompress(e,t,n){ac.add(i=>{this._decompress(e,t,(s,o)=>{i(),n(s,o)})})}compress(e,t,n){ac.add(i=>{this._compress(e,t,(s,o)=>{i(),n(s,o)})})}_decompress(e,t,n){let i=this._isServer?"client":"server";if(!this._inflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?so.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=so.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[cc]=this,this._inflate[tn]=0,this._inflate[In]=[],this._inflate.on("error",PI),this._inflate.on("data",Ey)}this._inflate[Hi]=n,this._inflate.write(e),t&&this._inflate.write(kI),this._inflate.flush(()=>{let s=this._inflate[$i];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=wy.concat(this._inflate[In],this._inflate[tn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[tn]=0,this._inflate[In]=[],t&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(e,t,n){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?so.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=so.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[tn]=0,this._deflate[In]=[],this._deflate.on("data",OI)}this._deflate[Hi]=n,this._deflate.write(e),this._deflate.flush(so.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=wy.concat(this._deflate[In],this._deflate[tn]);t&&(s=new RI(s.buffer,s.byteOffset,s.length-4)),this._deflate[Hi]=null,this._deflate[tn]=0,this._deflate[In]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};Ty.exports=gf;function OI(r){this[In].push(r),this[tn]+=r.length}function Ey(r){if(this[tn]+=r.length,this[cc]._maxPayload<1||this[tn]<=this[cc]._maxPayload){this[In].push(r);return}this[$i]=new RangeError("Max payload size exceeded"),this[$i].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[$i][Sy]=1009,this.removeListener("data",Ey),this.reset()}function PI(r){if(this[cc]._inflate=null,this[$i]){this[Hi](this[$i]);return}r[Sy]=1007,this[Hi](r)}});var Ay=O((w6,Cy)=>{"use strict";function MI(r){let e=r.length,t=0;for(;t<e;)if((r[t]&128)===0)t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}Cy.exports=MI});var xf=O((S6,vf)=>{"use strict";try{vf.exports=lf()(__dirname)}catch{vf.exports=Ay()}});var qi=O((E6,lc)=>{"use strict";var{isUtf8:Ry}=require("buffer"),{hasBlob:II}=Zr(),NI=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function LI(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function yf(r){let e=r.length,t=0;for(;t<e;)if((r[t]&128)===0)t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}function DI(r){return II&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}lc.exports={isBlob:DI,isValidStatusCode:LI,isValidUTF8:yf,tokenChars:NI};if(Ry)lc.exports.isValidUTF8=function(r){return r.length<24?yf(r):Ry(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=xf();lc.exports.isValidUTF8=function(e){return e.length<32?yf(e):r(e)}}catch{}});var Ef=O((T6,Ly)=>{"use strict";var{Writable:BI}=require("stream"),ky=oo(),{BINARY_TYPES:jI,EMPTY_BUFFER:Oy,kStatusCode:FI,kWebSocket:HI}=Zr(),{concat:_f,toArrayBuffer:$I,unmask:qI}=io(),{isValidStatusCode:UI,isValidUTF8:Py}=qi(),uc=Buffer[Symbol.species],ir=0,My=1,Iy=2,Ny=3,bf=4,wf=5,pc=6,Sf=class extends BI{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||jI[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[HI]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=ir}_write(e,t,n){if(this._opcode===8&&this._state==ir)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new uc(n.buffer,n.byteOffset+e,n.length-e),new uc(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],i=t.length-e;e>=n.length?t.set(this._buffers.shift(),i):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),i),this._buffers[0]=new uc(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case ir:this.getInfo(e);break;case My:this.getPayloadLength16(e);break;case Iy:this.getPayloadLength64(e);break;case Ny:this.getMask();break;case bf:this.getData(e);break;case wf:case pc:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let n=(t[0]&64)===64;if(n&&!this._extensions[ky.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=My:this._payloadLength===127?this._state=Iy:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);if(n>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(i);return}this._payloadLength=n*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}this._masked?this._state=Ny:this._state=bf}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=bf}getData(e){let t=Oy;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&qI(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=wf,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[ky.extensionName].decompress(e,this._fin,(i,s)=>{if(i)return t(i);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._fragments.push(s)}this.dataMessage(t),this._state===ir&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=ir;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=_f(n,t):this._binaryType==="arraybuffer"?i=$I(_f(n,t)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=ir):(this._state=pc,setImmediate(()=>{this.emit("message",i,!0),this._state=ir,this.startLoop(e)}))}else{let i=_f(n,t);if(!this._skipUTF8Validation&&!Py(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===wf||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=ir):(this._state=pc,setImmediate(()=>{this.emit("message",i,!1),this._state=ir,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,Oy),this.end();else{let n=e.readUInt16BE(0);if(!UI(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new uc(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Py(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=ir;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=ir):(this._state=pc,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=ir,this.startLoop(t)}))}createError(e,t,n,i,s){this._loop=!1,this._errored=!0;let o=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=s,o[FI]=i,o}};Ly.exports=Sf});var Af=O((A6,jy)=>{"use strict";var{Duplex:C6}=require("stream"),{randomFillSync:WI}=require("crypto"),Dy=oo(),{EMPTY_BUFFER:GI,kWebSocket:zI,NOOP:KI}=Zr(),{isBlob:Ui,isValidStatusCode:VI}=qi(),{mask:By,toBuffer:Qn}=io(),sr=Symbol("kByteLength"),YI=Buffer.alloc(4),fc=8*1024,Zn,Wi=fc,wr=0,XI=1,JI=2,Tf=class r{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=wr,this.onerror=KI,this[zI]=void 0}static frame(e,t){let n,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||YI,t.generateMask?t.generateMask(n):(Wi===fc&&(Zn===void 0&&(Zn=Buffer.alloc(fc)),WI(Zn,0,fc),Wi=0),n[0]=Zn[Wi++],n[1]=Zn[Wi++],n[2]=Zn[Wi++],n[3]=Zn[Wi++]),o=(n[0]|n[1]|n[2]|n[3])===0,s=6);let a;typeof e=="string"?(!t.mask||o)&&t[sr]!==void 0?a=t[sr]:(e=Buffer.from(e),a=e.length):(a=e.length,i=t.mask&&t.readOnly&&!o);let c=a;a>=65536?(s+=8,c=127):a>125&&(s+=2,c=126);let u=Buffer.allocUnsafe(i?a+s:s);return u[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),t.mask?(u[1]|=128,u[s-4]=n[0],u[s-3]=n[1],u[s-2]=n[2],u[s-1]=n[3],o?[u,e]:i?(By(e,n,u,s,a),[u]):(By(e,n,e,0,a),[u,e])):[u,e]}close(e,t,n,i){let s;if(e===void 0)s=GI;else{if(typeof e!="number"||!VI(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+a),s.writeUInt16BE(e,0),typeof t=="string"?s.write(t,2):s.set(t,2)}}let o={[sr]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==wr?this.enqueue([this.dispatch,s,!1,o,i]):this.sendFrame(r.frame(s,o),i)}ping(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):Ui(e)?(i=e.size,s=!1):(e=Qn(e),i=e.length,s=Qn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[sr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};Ui(e)?this._state!==wr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==wr?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}pong(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):Ui(e)?(i=e.size,s=!1):(e=Qn(e),i=e.length,s=Qn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[sr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};Ui(e)?this._state!==wr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==wr?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}send(e,t,n){let i=this._extensions[Dy.extensionName],s=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):Ui(e)?(a=e.size,c=!1):(e=Qn(e),a=e.length,c=Qn.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=i._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0);let u={[sr]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};Ui(e)?this._state!==wr?this.enqueue([this.getBlobData,e,this._compress,u,n]):this.getBlobData(e,this._compress,u,n):this._state!==wr?this.enqueue([this.dispatch,e,this._compress,u,n]):this.dispatch(e,this._compress,u,n)}getBlobData(e,t,n,i){this._bufferedBytes+=n[sr],this._state=JI,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Cf,this,a,i);return}this._bufferedBytes-=n[sr];let o=Qn(s);t?this.dispatch(o,t,n,i):(this._state=wr,this.sendFrame(r.frame(o,n),i),this.dequeue())}).catch(s=>{process.nextTick(QI,this,s,i)})}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let s=this._extensions[Dy.extensionName];this._bufferedBytes+=n[sr],this._state=XI,s.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Cf(this,c,i);return}this._bufferedBytes-=n[sr],this._state=wr,n.readOnly=!1,this.sendFrame(r.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===wr&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][sr],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][sr],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};jy.exports=Tf;function Cf(r,e,t){typeof t=="function"&&t(e);for(let n=0;n<r._queue.length;n++){let i=r._queue[n],s=i[i.length-1];typeof s=="function"&&s(e)}}function QI(r,e,t){Cf(r,e,t),r.onerror(e)}});var Ky=O((R6,zy)=>{"use strict";var{kForOnEventAttribute:ao,kListener:Rf}=Zr(),Fy=Symbol("kCode"),Hy=Symbol("kData"),$y=Symbol("kError"),qy=Symbol("kMessage"),Uy=Symbol("kReason"),Gi=Symbol("kTarget"),Wy=Symbol("kType"),Gy=Symbol("kWasClean"),rn=class{constructor(e){this[Gi]=null,this[Wy]=e}get target(){return this[Gi]}get type(){return this[Wy]}};Object.defineProperty(rn.prototype,"target",{enumerable:!0});Object.defineProperty(rn.prototype,"type",{enumerable:!0});var ei=class extends rn{constructor(e,t={}){super(e),this[Fy]=t.code===void 0?0:t.code,this[Uy]=t.reason===void 0?"":t.reason,this[Gy]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[Fy]}get reason(){return this[Uy]}get wasClean(){return this[Gy]}};Object.defineProperty(ei.prototype,"code",{enumerable:!0});Object.defineProperty(ei.prototype,"reason",{enumerable:!0});Object.defineProperty(ei.prototype,"wasClean",{enumerable:!0});var zi=class extends rn{constructor(e,t={}){super(e),this[$y]=t.error===void 0?null:t.error,this[qy]=t.message===void 0?"":t.message}get error(){return this[$y]}get message(){return this[qy]}};Object.defineProperty(zi.prototype,"error",{enumerable:!0});Object.defineProperty(zi.prototype,"message",{enumerable:!0});var co=class extends rn{constructor(e,t={}){super(e),this[Hy]=t.data===void 0?null:t.data}get data(){return this[Hy]}};Object.defineProperty(co.prototype,"data",{enumerable:!0});var ZI={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[ao]&&i[Rf]===e&&!i[ao])return;let n;if(r==="message")n=function(s,o){let a=new co("message",{data:o?s:s.toString()});a[Gi]=this,dc(e,this,a)};else if(r==="close")n=function(s,o){let a=new ei("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[Gi]=this,dc(e,this,a)};else if(r==="error")n=function(s){let o=new zi("error",{error:s,message:s.message});o[Gi]=this,dc(e,this,o)};else if(r==="open")n=function(){let s=new rn("open");s[Gi]=this,dc(e,this,s)};else return;n[ao]=!!t[ao],n[Rf]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[Rf]===e&&!t[ao]){this.removeListener(r,t);break}}};zy.exports={CloseEvent:ei,ErrorEvent:zi,Event:rn,EventTarget:ZI,MessageEvent:co};function dc(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var kf=O((k6,Vy)=>{"use strict";var{tokenChars:lo}=qi();function Dr(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function eN(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,u=-1,p=-1,f=0;for(;f<r.length;f++)if(u=r.charCodeAt(f),o===void 0)if(p===-1&&lo[u]===1)c===-1&&(c=f);else if(f!==0&&(u===32||u===9))p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);u===44?(Dr(e,y,t),t=Object.create(null)):o=y,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(p===-1&&lo[u]===1)c===-1&&(c=f);else if(u===32||u===9)p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f),Dr(t,r.slice(c,p),!0),u===44&&(Dr(e,o,t),t=Object.create(null),o=void 0),c=p=-1}else if(u===61&&c!==-1&&p===-1)a=r.slice(c,f),c=p=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(lo[u]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),i=!1}else if(s)if(lo[u]===1)c===-1&&(c=f);else if(u===34&&c!==-1)s=!1,p=f;else if(u===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(u===34&&r.charCodeAt(f-1)===61)s=!0;else if(p===-1&&lo[u]===1)c===-1&&(c=f);else if(c!==-1&&(u===32||u===9))p===-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);n&&(y=y.replace(/\\/g,""),n=!1),Dr(t,a,y),u===44&&(Dr(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||s||u===32||u===9)throw new SyntaxError("Unexpected end of input");p===-1&&(p=f);let m=r.slice(c,p);return o===void 0?Dr(e,m,t):(a===void 0?Dr(t,m,!0):n?Dr(t,a,m.replace(/\\/g,"")):Dr(t,a,m),Dr(e,o,t)),e}function tN(r){return Object.keys(r).map(e=>{let t=r[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(i=>{let s=n[i];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Vy.exports={format:tN,parse:eN}});var vc=O((M6,o0)=>{"use strict";var rN=require("events"),nN=require("https"),iN=require("http"),Jy=require("net"),sN=require("tls"),{randomBytes:oN,createHash:aN}=require("crypto"),{Duplex:O6,Readable:P6}=require("stream"),{URL:Of}=require("url"),Nn=oo(),cN=Ef(),lN=Af(),{isBlob:uN}=qi(),{BINARY_TYPES:Yy,EMPTY_BUFFER:hc,GUID:pN,kForOnEventAttribute:Pf,kListener:fN,kStatusCode:dN,kWebSocket:ut,NOOP:Qy}=Zr(),{EventTarget:{addEventListener:hN,removeEventListener:mN}}=Ky(),{format:gN,parse:vN}=kf(),{toBuffer:xN}=io(),yN=30*1e3,Zy=Symbol("kAborted"),Mf=[8,13],nn=["CONNECTING","OPEN","CLOSING","CLOSED"],_N=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,be=class r extends rN{constructor(e,t,n){super(),this._binaryType=Yy[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=hc,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(n=t,t=[]):t=[t]),e0(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Yy.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,n){let i=new cN({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new lN(e,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=e,i[ut]=this,s[ut]=this,e[ut]=this,i.on("conclude",SN),i.on("drain",EN),i.on("error",TN),i.on("message",CN),i.on("ping",AN),i.on("pong",RN),s.onerror=kN,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",n0),e.on("data",gc),e.on("end",i0),e.on("error",s0),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Nn.extensionName]&&this._extensions[Nn.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Vt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),r0(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){If(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||hc,t,n)}pong(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){If(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||hc,t,n)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(n=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){If(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[Nn.extensionName]||(i.compress=!1),this._sender.send(e||hc,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Vt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(be,"CONNECTING",{enumerable:!0,value:nn.indexOf("CONNECTING")});Object.defineProperty(be.prototype,"CONNECTING",{enumerable:!0,value:nn.indexOf("CONNECTING")});Object.defineProperty(be,"OPEN",{enumerable:!0,value:nn.indexOf("OPEN")});Object.defineProperty(be.prototype,"OPEN",{enumerable:!0,value:nn.indexOf("OPEN")});Object.defineProperty(be,"CLOSING",{enumerable:!0,value:nn.indexOf("CLOSING")});Object.defineProperty(be.prototype,"CLOSING",{enumerable:!0,value:nn.indexOf("CLOSING")});Object.defineProperty(be,"CLOSED",{enumerable:!0,value:nn.indexOf("CLOSED")});Object.defineProperty(be.prototype,"CLOSED",{enumerable:!0,value:nn.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(be.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(be.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Pf])return e[fN];return null},set(e){for(let t of this.listeners(r))if(t[Pf]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[Pf]:!0})}})});be.prototype.addEventListener=hN;be.prototype.removeEventListener=mN;o0.exports=be;function e0(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Mf[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=i.autoPong,!Mf.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Mf.join(", ")})`);let s;if(e instanceof Of)s=e;else try{s=new Of(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),r._url=s.href;let o=s.protocol==="wss:",a=s.protocol==="ws+unix:",c;if(s.protocol!=="ws:"&&!o&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"),c){let S=new SyntaxError(c);if(r._redirects===0)throw S;mc(r,S);return}let u=o?443:80,p=oN(16).toString("base64"),f=o?nN.request:iN.request,m=new Set,y;if(i.createConnection=i.createConnection||(o?wN:bN),i.defaultPort=i.defaultPort||u,i.port=s.port||u,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":p,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(y=new Nn(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=gN({[Nn.extensionName]:y.offer()})),t.length){for(let S of t){if(typeof S!="string"||!_N.test(S)||m.has(S))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.add(S)}i.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(s.username||s.password)&&(i.auth=`${s.username}:${s.password}`),a){let S=i.path.split(":");i.socketPath=S[0],i.path=S[1]}let _;if(i.followRedirects){if(r._redirects===0){r._originalIpc=a,r._originalSecure=o,r._originalHostOrSocketPath=a?i.socketPath:s.host;let S=n&&n.headers;if(n={...n,headers:{}},S)for(let[A,P]of Object.entries(S))n.headers[A.toLowerCase()]=P}else if(r.listenerCount("redirect")===0){let S=a?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:s.host===r._originalHostOrSocketPath;(!S||r._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,S||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),_=r._req=f(i),r._redirects&&r.emit("redirect",r.url,_)}else _=r._req=f(i);i.timeout&&_.on("timeout",()=>{Vt(r,_,"Opening handshake has timed out")}),_.on("error",S=>{_===null||_[Zy]||(_=r._req=null,mc(r,S))}),_.on("response",S=>{let A=S.headers.location,P=S.statusCode;if(A&&i.followRedirects&&P>=300&&P<400){if(++r._redirects>i.maxRedirects){Vt(r,_,"Maximum redirects exceeded");return}_.abort();let L;try{L=new Of(A,e)}catch{let H=new SyntaxError(`Invalid URL: ${A}`);mc(r,H);return}e0(r,L,t,n)}else r.emit("unexpected-response",_,S)||Vt(r,_,`Unexpected server response: ${S.statusCode}`)}),_.on("upgrade",(S,A,P)=>{if(r.emit("upgrade",S),r.readyState!==be.CONNECTING)return;_=r._req=null;let L=S.headers.upgrade;if(L===void 0||L.toLowerCase()!=="websocket"){Vt(r,A,"Invalid Upgrade header");return}let N=aN("sha1").update(p+pN).digest("base64");if(S.headers["sec-websocket-accept"]!==N){Vt(r,A,"Invalid Sec-WebSocket-Accept header");return}let H=S.headers["sec-websocket-protocol"],W;if(H!==void 0?m.size?m.has(H)||(W="Server sent an invalid subprotocol"):W="Server sent a subprotocol but none was requested":m.size&&(W="Server sent no subprotocol"),W){Vt(r,A,W);return}H&&(r._protocol=H);let U=S.headers["sec-websocket-extensions"];if(U!==void 0){if(!y){Vt(r,A,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let G;try{G=vN(U)}catch{Vt(r,A,"Invalid Sec-WebSocket-Extensions header");return}let M=Object.keys(G);if(M.length!==1||M[0]!==Nn.extensionName){Vt(r,A,"Server indicated an extension that was not requested");return}try{y.accept(G[Nn.extensionName])}catch{Vt(r,A,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[Nn.extensionName]=y}r.setSocket(A,P,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(_,r):_.end()}function mc(r,e){r._readyState=be.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function bN(r){return r.path=r.socketPath,Jy.connect(r)}function wN(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=Jy.isIP(r.host)?"":r.host),sN.connect(r)}function Vt(r,e,t){r._readyState=be.CLOSING;let n=new Error(t);Error.captureStackTrace(n,Vt),e.setHeader?(e[Zy]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(mc,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function If(r,e,t){if(e){let n=uN(e)?e.size:xN(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${nn[r.readyState]})`);process.nextTick(t,n)}}function SN(r,e){let t=this[ut];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[ut]!==void 0&&(t._socket.removeListener("data",gc),process.nextTick(t0,t._socket),r===1005?t.close():t.close(r,e))}function EN(){let r=this[ut];r.isPaused||r._socket.resume()}function TN(r){let e=this[ut];e._socket[ut]!==void 0&&(e._socket.removeListener("data",gc),process.nextTick(t0,e._socket),e.close(r[dN])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function Xy(){this[ut].emitClose()}function CN(r,e){this[ut].emit("message",r,e)}function AN(r){let e=this[ut];e._autoPong&&e.pong(r,!this._isServer,Qy),e.emit("ping",r)}function RN(r){this[ut].emit("pong",r)}function t0(r){r.resume()}function kN(r){let e=this[ut];e.readyState!==be.CLOSED&&(e.readyState===be.OPEN&&(e._readyState=be.CLOSING,r0(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function r0(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),yN)}function n0(){let r=this[ut];this.removeListener("close",n0),this.removeListener("data",gc),this.removeListener("end",i0),r._readyState=be.CLOSING;let e;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(e=r._socket.read())!==null&&r._receiver.write(e),r._receiver.end(),this[ut]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",Xy),r._receiver.on("finish",Xy))}function gc(r){this[ut]._receiver.write(r)||this.pause()}function i0(){let r=this[ut];r._readyState=be.CLOSING,r._receiver.end(),this.end()}function s0(){let r=this[ut];this.removeListener("error",s0),this.on("error",Qy),r&&(r._readyState=be.CLOSING,this.destroy())}});var u0=O((N6,l0)=>{"use strict";var I6=vc(),{Duplex:ON}=require("stream");function a0(r){r.emit("close")}function PN(){!this.destroyed&&this._writableState.finished&&this.destroy()}function c0(r){this.removeListener("error",c0),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function MN(r,e){let t=!0,n=new ON({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(s,o){let a=!o&&n._readableState.objectMode?s.toString():s;n.push(a)||r.pause()}),r.once("error",function(s){n.destroyed||(t=!1,n.destroy(s))}),r.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,s){if(r.readyState===r.CLOSED){s(i),process.nextTick(a0,n);return}let o=!1;r.once("error",function(c){o=!0,s(c)}),r.once("close",function(){o||s(i),process.nextTick(a0,n)}),t&&r.terminate()},n._final=function(i){if(r.readyState===r.CONNECTING){r.once("open",function(){n._final(i)});return}r._socket!==null&&(r._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(r._socket.once("finish",function(){i()}),r.close()))},n._read=function(){r.isPaused&&r.resume()},n._write=function(i,s,o){if(r.readyState===r.CONNECTING){r.once("open",function(){n._write(i,s,o)});return}r.send(i,o)},n.on("end",PN),n.on("error",c0),n}l0.exports=MN});var f0=O((L6,p0)=>{"use strict";var{tokenChars:IN}=qi();function NN(r){let e=new Set,t=-1,n=-1,i=0;for(i;i<r.length;i++){let o=r.charCodeAt(i);if(n===-1&&IN[o]===1)t===-1&&(t=i);else if(i!==0&&(o===32||o===9))n===-1&&t!==-1&&(n=i);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=r.slice(t,n);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),t=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=r.slice(t,i);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}p0.exports={parse:NN}});var y0=O((B6,x0)=>{"use strict";var LN=require("events"),xc=require("http"),{Duplex:D6}=require("stream"),{createHash:DN}=require("crypto"),d0=kf(),ti=oo(),BN=f0(),jN=vc(),{GUID:FN,kWebSocket:HN}=Zr(),$N=/^[+/0-9A-Za-z]{22}==$/,h0=0,m0=1,v0=2,Nf=class extends LN{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:jN,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=xc.createServer((n,i)=>{let s=xc.STATUS_CODES[426];i.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),i.end(s)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=qN(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,s,o)=>{this.handleUpgrade(i,s,o,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=h0}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===v0){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(uo,this);return}if(e&&this.once("close",e),this._state!==m0)if(this._state=m0,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(uo,this):process.nextTick(uo,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{uo(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,i){t.on("error",g0);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){ri(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){ri(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!$N.test(s)){ri(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){ri(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){po(t,400);return}let c=e.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=BN.parse(c)}catch{ri(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let p=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&p!==void 0){let m=new ti(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let y=d0.parse(p);y[ti.extensionName]&&(m.accept(y[ti.extensionName]),f[ti.extensionName]=m)}catch{ri(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(m,(y,_,S,A)=>{if(!y)return po(t,_||401,S,A);this.completeUpgrade(f,s,u,e,t,n,i)});return}if(!this.options.verifyClient(m))return po(t,401)}this.completeUpgrade(f,s,u,e,t,n,i)}completeUpgrade(e,t,n,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[HN])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>h0)return po(s,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${DN("sha1").update(t+FN).digest("base64")}`],p=new this.options.WebSocket(null,void 0,this.options);if(n.size){let f=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;f&&(u.push(`Sec-WebSocket-Protocol: ${f}`),p._protocol=f)}if(e[ti.extensionName]){let f=e[ti.extensionName].params,m=d0.format({[ti.extensionName]:[f]});u.push(`Sec-WebSocket-Extensions: ${m}`),p._extensions=e}this.emit("headers",u,i),s.write(u.concat(`\r
13
13
  `).join(`\r
14
- `)),s.removeListener("error",h0),p.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(p),p.on("close",()=>{this.clients.delete(p),this._shouldEmitClose&&!this.clients.size&&process.nextTick(uo,this)})),a(p,i)}};g0.exports=If;function jN(r,e){for(let t of Object.keys(e))r.on(t,e[t]);return function(){for(let n of Object.keys(e))r.removeListener(n,e[n])}}function uo(r){r._state=m0,r.emit("close")}function h0(){this.destroy()}function po(r,e,t,n){t=t||vc.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...n},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${vc.STATUS_CODES[e]}\r
14
+ `)),s.removeListener("error",g0),p.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(p),p.on("close",()=>{this.clients.delete(p),this._shouldEmitClose&&!this.clients.size&&process.nextTick(uo,this)})),a(p,i)}};x0.exports=Nf;function qN(r,e){for(let t of Object.keys(e))r.on(t,e[t]);return function(){for(let n of Object.keys(e))r.removeListener(n,e[n])}}function uo(r){r._state=v0,r.emit("close")}function g0(){this.destroy()}function po(r,e,t,n){t=t||xc.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...n},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${xc.STATUS_CODES[e]}\r
15
15
  `+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
16
16
  `)+`\r
17
17
  \r
18
- `+t)}function ei(r,e,t,n,i,s){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,ei),r.emit("wsClientError",o,t,e)}else po(t,n,i,s)}});var y0=O((N6,x0)=>{"use strict";var sn=gc();sn.createWebSocketStream=c0();sn.Server=v0();sn.Receiver=Sf();sn.Sender=Cf();sn.WebSocket=sn;sn.WebSocketServer=sn.Server;x0.exports=sn});var w0=O((L6,b0)=>{"use strict";var _0=Object.getOwnPropertySymbols,FN=Object.prototype.hasOwnProperty,HN=Object.prototype.propertyIsEnumerable;function $N(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function qN(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(e).map(function(s){return e[s]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(s){i[s]=s}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}b0.exports=qN()?Object.assign:function(r,e){for(var t,n=$N(r),i,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var o in t)FN.call(t,o)&&(n[o]=t[o]);if(_0){i=_0(t);for(var a=0;a<i.length;a++)HN.call(t,i[a])&&(n[i[a]]=t[i[a]])}}return n}});var T0=O((D6,Nf)=>{"use strict";Nf.exports=WN;Nf.exports.append=E0;var UN=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function E0(r,e){if(typeof r!="string")throw new TypeError("header argument is required");if(!e)throw new TypeError("field argument is required");for(var t=Array.isArray(e)?e:S0(String(e)),n=0;n<t.length;n++)if(!UN.test(t[n]))throw new TypeError("field argument contains an invalid header name");if(r==="*")return r;var i=r,s=S0(r.toLowerCase());if(t.indexOf("*")!==-1||s.indexOf("*")!==-1)return"*";for(var o=0;o<t.length;o++){var a=t[o].toLowerCase();s.indexOf(a)===-1&&(s.push(a),i=i?i+", "+t[o]:t[o])}return i}function S0(r){for(var e=0,t=[],n=0,i=0,s=r.length;i<s;i++)switch(r.charCodeAt(i)){case 32:n===e&&(n=e=i+1);break;case 44:t.push(r.substring(n,e)),n=e=i+1;break;default:e=i+1;break}return t.push(r.substring(n,e)),t}function WN(r,e){if(!r||!r.getHeader||!r.setHeader)throw new TypeError("res argument is required");var t=r.getHeader("Vary")||"",n=Array.isArray(t)?t.join(", "):String(t);(t=E0(n,e))&&r.setHeader("Vary",t)}});var Lf=O((B6,C0)=>{(function(){"use strict";var r=w0(),e=T0(),t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function n(_){return typeof _=="string"||_ instanceof String}function i(_,S){if(Array.isArray(S)){for(var A=0;A<S.length;++A)if(i(_,S[A]))return!0;return!1}else return n(S)?_===S:S instanceof RegExp?S.test(_):!!S}function s(_,S){var A=S.headers.origin,P=[],L;return!_.origin||_.origin==="*"?P.push([{key:"Access-Control-Allow-Origin",value:"*"}]):n(_.origin)?(P.push([{key:"Access-Control-Allow-Origin",value:_.origin}]),P.push([{key:"Vary",value:"Origin"}])):(L=i(A,_.origin),P.push([{key:"Access-Control-Allow-Origin",value:L?A:!1}]),P.push([{key:"Vary",value:"Origin"}])),P}function o(_){var S=_.methods;return S.join&&(S=_.methods.join(",")),{key:"Access-Control-Allow-Methods",value:S}}function a(_){return _.credentials===!0?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function c(_,S){var A=_.allowedHeaders||_.headers,P=[];return A?A.join&&(A=A.join(",")):(A=S.headers["access-control-request-headers"],P.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),A&&A.length&&P.push([{key:"Access-Control-Allow-Headers",value:A}]),P}function u(_){var S=_.exposedHeaders;if(S)S.join&&(S=S.join(","));else return null;return S&&S.length?{key:"Access-Control-Expose-Headers",value:S}:null}function p(_){var S=(typeof _.maxAge=="number"||_.maxAge)&&_.maxAge.toString();return S&&S.length?{key:"Access-Control-Max-Age",value:S}:null}function f(_,S){for(var A=0,P=_.length;A<P;A++){var L=_[A];L&&(Array.isArray(L)?f(L,S):L.key==="Vary"&&L.value?e(S,L.value):L.value&&S.setHeader(L.key,L.value))}}function m(_,S,A,P){var L=[],N=S.method&&S.method.toUpperCase&&S.method.toUpperCase();N==="OPTIONS"?(L.push(s(_,S)),L.push(a(_)),L.push(o(_)),L.push(c(_,S)),L.push(p(_)),L.push(u(_)),f(L,A),_.preflightContinue?P():(A.statusCode=_.optionsSuccessStatus,A.setHeader("Content-Length","0"),A.end())):(L.push(s(_,S)),L.push(a(_)),L.push(u(_)),f(L,A),P())}function y(_){var S=null;return typeof _=="function"?S=_:S=function(A,P){P(null,_)},function(P,L,N){S(P,function(H,W){if(H)N(H);else{var U=r({},t,W),G=null;U.origin&&typeof U.origin=="function"?G=U.origin:U.origin&&(G=function(M,F){F(null,U.origin)}),G?G(P.headers.origin,function(M,F){M||!F?N(M):(U.origin=F,m(U,P,L,N))}):N()}})}}C0.exports=y})()});var Bf=O(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.Server=Vi.BaseServer=void 0;var A0=Op(),xc=Xp(),GN=require("events"),R0=Qp(),zN=Ce(),KN=Kx(),VN=y0(),k0=Vp(),YN=no(),ne=(0,zN.default)("engine"),zi=Symbol("responseHeaders");function XN(r){try{let e=JSON.parse(r);if(typeof e.sid=="string")return e.sid}catch{}}var Ki=class extends GN.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:VN.Server,pingTimeout:2e4,pingInterval:25e3,upgradeTimeout:1e4,maxHttpBufferSize:1e6,transports:["polling","websocket"],allowUpgrades:!0,httpCompression:{threshold:1024},cors:!1,allowEIO3:!1},e),e.cookie&&(this.opts.cookie=Object.assign({name:"io",path:"/",httpOnly:e.cookie.path!==!1,sameSite:"lax"},e.cookie)),this.opts.cors&&this.use(Lf()(this.opts.cors)),e.perMessageDeflate&&(this.opts.perMessageDeflate=Object.assign({threshold:1024},e.perMessageDeflate)),this.init()}_computePath(e){let t=(e.path||"/engine.io").replace(/\/$/,"");return e.addTrailingSlash!==!1&&(t+="/"),t}upgrades(e){return this.opts.allowUpgrades?xc.default[e].upgradesTo||[]:[]}verify(e,t,n){let i=e._query.transport;if(!~this.opts.transports.indexOf(i)||i==="webtransport")return ne('unknown transport "%s"',i),n(xe.errors.UNKNOWN_TRANSPORT,{transport:i});if(JN(e.headers.origin)){let a=e.headers.origin;return e.headers.origin=null,ne("origin header invalid"),n(xe.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:a})}let o=e._query.sid;if(o){if(!this.clients.hasOwnProperty(o))return ne('unknown sid "%s"',o),n(xe.errors.UNKNOWN_SID,{sid:o});let a=this.clients[o].transport.name;if(!t&&a!==i)return ne("bad request: unexpected transport without upgrade"),n(xe.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:i,previousTransport:a})}else return e.method!=="GET"?n(xe.errors.BAD_HANDSHAKE_METHOD,{method:e.method}):i==="websocket"&&!t?(ne("invalid transport upgrade"),n(xe.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"})):this.opts.allowRequest?this.opts.allowRequest(e,(a,c)=>{if(!c)return n(xe.errors.FORBIDDEN,{message:a});n()}):n();n()}use(e){this.middlewares.push(e)}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return ne("no middleware to apply, skipping"),n();let i=s=>{ne("applying middleware n\xB0%d",s+1),this.middlewares[s](e,t,o=>{if(o)return n(o);s+1<this.middlewares.length?i(s+1):n()})};i(0)}close(){ne("closing all open clients");for(let e in this.clients)this.clients.hasOwnProperty(e)&&this.clients[e].close(!0);return this.cleanup(),this}generateId(e){return A0.generateId()}async handshake(e,t,n){let i=t._query.EIO==="4"?4:3;if(i===3&&!this.opts.allowEIO3){ne("unsupported protocol version"),this.emit("connection_error",{req:t,code:xe.errors.UNSUPPORTED_PROTOCOL_VERSION,message:xe.errorMessages[xe.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:i}}),n(xe.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let s;try{s=await this.generateId(t)}catch(c){ne("error while generating an id"),this.emit("connection_error",{req:t,code:xe.errors.BAD_REQUEST,message:xe.errorMessages[xe.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:c}}),n(xe.errors.BAD_REQUEST);return}ne('handshaking client "%s"',s);try{var o=this.createTransport(e,t);e==="polling"?(o.maxHttpBufferSize=this.opts.maxHttpBufferSize,o.httpCompression=this.opts.httpCompression):e==="websocket"&&(o.perMessageDeflate=this.opts.perMessageDeflate)}catch(c){ne('error handshaking to transport "%s"',e),this.emit("connection_error",{req:t,code:xe.errors.BAD_REQUEST,message:xe.errorMessages[xe.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:c}}),n(xe.errors.BAD_REQUEST);return}let a=new R0.Socket(s,this,o,t,i);return o.on("headers",(c,u)=>{!u._query.sid&&(this.opts.cookie&&(c["Set-Cookie"]=[(0,KN.serialize)(this.opts.cookie.name,s,this.opts.cookie)]),this.emit("initial_headers",c,u)),this.emit("headers",c,u)}),o.onRequest(t),this.clients[s]=a,this.clientsCount++,a.once("close",()=>{delete this.clients[s],this.clientsCount--}),this.emit("connection",a),o}async onWebTransportSession(e){let t=setTimeout(()=>{ne("the client failed to establish a bidirectional stream in the given period"),e.close()},this.opts.upgradeTimeout),i=await e.incomingBidirectionalStreams.getReader().read();if(i.done){ne("session is closed");return}let s=i.value,o=(0,YN.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),a=s.readable.pipeThrough(o).getReader(),{value:c,done:u}=await a.read();if(u){ne("stream is closed");return}if(clearTimeout(t),c.type!=="open")return ne("invalid WebTransport handshake"),e.close();if(c.data===void 0){let m=new k0.WebTransport(e,s,a),y=A0.generateId();ne('handshaking client "%s" (WebTransport)',y);let _=new R0.Socket(y,this,m,null,4);this.clients[y]=_,this.clientsCount++,_.once("close",()=>{delete this.clients[y],this.clientsCount--}),this.emit("connection",_);return}let p=XN(c.data);if(!p)return ne("invalid WebTransport handshake"),e.close();let f=this.clients[p];if(!f)ne("upgrade attempt for closed client"),e.close();else if(f.upgrading)ne("transport has already been trying to upgrade"),e.close();else if(f.upgraded)ne("transport had already been upgraded"),e.close();else{ne("upgrading existing transport");let m=new k0.WebTransport(e,s,a);f._maybeUpgrade(m)}}};Vi.BaseServer=Ki;Ki.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};Ki.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};var Df=class{constructor(e,t){this.req=e,this.socket=t,e[zi]={}}setHeader(e,t){this.req[zi][e]=t}getHeader(e){return this.req[zi][e]}removeHeader(e){delete this.req[zi][e]}write(){}writeHead(){}end(){this.socket.destroy()}},xe=class r extends Ki{init(){~this.opts.transports.indexOf("websocket")&&(this.ws&&this.ws.close(),this.ws=new this.opts.wsEngine({noServer:!0,clientTracking:!1,perMessageDeflate:this.opts.perMessageDeflate,maxPayload:this.opts.maxHttpBufferSize}),typeof this.ws.on=="function"&&this.ws.on("headers",(e,t)=>{let n=t[zi]||{};delete t[zi],!t._query.sid&&this.emit("initial_headers",n,t),this.emit("headers",n,t),ne("writing headers: %j",n),Object.keys(n).forEach(s=>{e.push(`${s}: ${n[s]}`)})}))}cleanup(){this.ws&&(ne("closing webSocketServer"),this.ws.close())}prepare(e){if(!e._query){let t=new URL(e.url,"https://socket.io");e._query=Object.fromEntries(t.searchParams.entries())}}createTransport(e,t){return new xc.default[e](t)}handleRequest(e,t){ne('handling "%s" http request "%s"',e.method,e.url),this.prepare(e),e.res=t;let n=(i,s)=>{if(i!==void 0){this.emit("connection_error",{req:e,code:i,message:r.errorMessages[i],context:s}),O0(t,i,s);return}if(e._query.sid)ne("setting new request for existing client"),this.clients[e._query.sid].transport.onRequest(e);else{let o=(a,c)=>O0(t,a,c);this.handshake(e._query.transport,e,o)}};this._applyMiddlewares(e,t,i=>{i?n(r.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!1,n)})}handleUpgrade(e,t,n){this.prepare(e);let i=new Df(e,t),s=(o,a)=>{if(o!==void 0){this.emit("connection_error",{req:e,code:o,message:r.errorMessages[o],context:a}),P0(t,o,a);return}let c=Buffer.from(n);n=null,i.writeHead(),this.ws.handleUpgrade(e,t,c,u=>{this.onWebSocket(e,t,u)})};this._applyMiddlewares(e,i,o=>{o?s(r.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!0,s)})}onWebSocket(e,t,n){if(n.on("error",s),xc.default[e._query.transport]!==void 0&&!xc.default[e._query.transport].prototype.handlesUpgrades){ne("transport doesnt handle upgraded requests"),n.close();return}let i=e._query.sid;if(e.websocket=n,i){let o=this.clients[i];if(!o)ne("upgrade attempt for closed client"),n.close();else if(o.upgrading)ne("transport has already been trying to upgrade"),n.close();else if(o.upgraded)ne("transport had already been upgraded"),n.close();else{ne("upgrading existing transport"),n.removeListener("error",s);let a=this.createTransport(e._query.transport,e);a.perMessageDeflate=this.opts.perMessageDeflate,o._maybeUpgrade(a)}}else{let o=(a,c)=>P0(t,a,c);this.handshake(e._query.transport,e,o)}function s(){ne("websocket error before upgrade")}}attach(e,t={}){let n=this._computePath(t),i=t.destroyUpgradeTimeout||1e3;function s(a){return n===a.url.slice(0,n.length)}let o=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("close",this.close.bind(this)),e.on("listening",this.init.bind(this)),e.on("request",(a,c)=>{if(s(a))ne('intercepting request for path "%s"',n),this.handleRequest(a,c);else{let u=0,p=o.length;for(;u<p;u++)o[u].call(e,a,c)}}),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",(a,c,u)=>{s(a)?this.handleUpgrade(a,c,u):t.destroyUpgrade!==!1&&setTimeout(function(){if(c.writable&&c.bytesWritten<=0)return c.on("error",p=>{ne("error while destroying upgrade: %s",p.message)}),c.end()},i)})}};Vi.Server=xe;function O0(r,e,t){let n=e===xe.errors.FORBIDDEN?403:400,i=t&&t.message?t.message:xe.errorMessages[e];r.writeHead(n,{"Content-Type":"application/json"}),r.end(JSON.stringify({code:e,message:i}))}function P0(r,e,t={}){if(r.on("error",()=>{ne("ignoring error from closed connection")}),r.writable){let n=t.message||xe.errorMessages[e],i=Buffer.byteLength(n);r.write(`HTTP/1.1 400 Bad Request\r
18
+ `+t)}function ri(r,e,t,n,i,s){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,ri),r.emit("wsClientError",o,t,e)}else po(t,n,i,s)}});var b0=O((j6,_0)=>{"use strict";var sn=vc();sn.createWebSocketStream=u0();sn.Server=y0();sn.Receiver=Ef();sn.Sender=Af();sn.WebSocket=sn;sn.WebSocketServer=sn.Server;_0.exports=sn});var E0=O((F6,S0)=>{"use strict";var w0=Object.getOwnPropertySymbols,UN=Object.prototype.hasOwnProperty,WN=Object.prototype.propertyIsEnumerable;function GN(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function zN(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(e).map(function(s){return e[s]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(s){i[s]=s}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}S0.exports=zN()?Object.assign:function(r,e){for(var t,n=GN(r),i,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var o in t)UN.call(t,o)&&(n[o]=t[o]);if(w0){i=w0(t);for(var a=0;a<i.length;a++)WN.call(t,i[a])&&(n[i[a]]=t[i[a]])}}return n}});var A0=O((H6,Lf)=>{"use strict";Lf.exports=VN;Lf.exports.append=C0;var KN=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function C0(r,e){if(typeof r!="string")throw new TypeError("header argument is required");if(!e)throw new TypeError("field argument is required");for(var t=Array.isArray(e)?e:T0(String(e)),n=0;n<t.length;n++)if(!KN.test(t[n]))throw new TypeError("field argument contains an invalid header name");if(r==="*")return r;var i=r,s=T0(r.toLowerCase());if(t.indexOf("*")!==-1||s.indexOf("*")!==-1)return"*";for(var o=0;o<t.length;o++){var a=t[o].toLowerCase();s.indexOf(a)===-1&&(s.push(a),i=i?i+", "+t[o]:t[o])}return i}function T0(r){for(var e=0,t=[],n=0,i=0,s=r.length;i<s;i++)switch(r.charCodeAt(i)){case 32:n===e&&(n=e=i+1);break;case 44:t.push(r.substring(n,e)),n=e=i+1;break;default:e=i+1;break}return t.push(r.substring(n,e)),t}function VN(r,e){if(!r||!r.getHeader||!r.setHeader)throw new TypeError("res argument is required");var t=r.getHeader("Vary")||"",n=Array.isArray(t)?t.join(", "):String(t);(t=C0(n,e))&&r.setHeader("Vary",t)}});var Df=O(($6,R0)=>{(function(){"use strict";var r=E0(),e=A0(),t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function n(_){return typeof _=="string"||_ instanceof String}function i(_,S){if(Array.isArray(S)){for(var A=0;A<S.length;++A)if(i(_,S[A]))return!0;return!1}else return n(S)?_===S:S instanceof RegExp?S.test(_):!!S}function s(_,S){var A=S.headers.origin,P=[],L;return!_.origin||_.origin==="*"?P.push([{key:"Access-Control-Allow-Origin",value:"*"}]):n(_.origin)?(P.push([{key:"Access-Control-Allow-Origin",value:_.origin}]),P.push([{key:"Vary",value:"Origin"}])):(L=i(A,_.origin),P.push([{key:"Access-Control-Allow-Origin",value:L?A:!1}]),P.push([{key:"Vary",value:"Origin"}])),P}function o(_){var S=_.methods;return S.join&&(S=_.methods.join(",")),{key:"Access-Control-Allow-Methods",value:S}}function a(_){return _.credentials===!0?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function c(_,S){var A=_.allowedHeaders||_.headers,P=[];return A?A.join&&(A=A.join(",")):(A=S.headers["access-control-request-headers"],P.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),A&&A.length&&P.push([{key:"Access-Control-Allow-Headers",value:A}]),P}function u(_){var S=_.exposedHeaders;if(S)S.join&&(S=S.join(","));else return null;return S&&S.length?{key:"Access-Control-Expose-Headers",value:S}:null}function p(_){var S=(typeof _.maxAge=="number"||_.maxAge)&&_.maxAge.toString();return S&&S.length?{key:"Access-Control-Max-Age",value:S}:null}function f(_,S){for(var A=0,P=_.length;A<P;A++){var L=_[A];L&&(Array.isArray(L)?f(L,S):L.key==="Vary"&&L.value?e(S,L.value):L.value&&S.setHeader(L.key,L.value))}}function m(_,S,A,P){var L=[],N=S.method&&S.method.toUpperCase&&S.method.toUpperCase();N==="OPTIONS"?(L.push(s(_,S)),L.push(a(_)),L.push(o(_)),L.push(c(_,S)),L.push(p(_)),L.push(u(_)),f(L,A),_.preflightContinue?P():(A.statusCode=_.optionsSuccessStatus,A.setHeader("Content-Length","0"),A.end())):(L.push(s(_,S)),L.push(a(_)),L.push(u(_)),f(L,A),P())}function y(_){var S=null;return typeof _=="function"?S=_:S=function(A,P){P(null,_)},function(P,L,N){S(P,function(H,W){if(H)N(H);else{var U=r({},t,W),G=null;U.origin&&typeof U.origin=="function"?G=U.origin:U.origin&&(G=function(M,F){F(null,U.origin)}),G?G(P.headers.origin,function(M,F){M||!F?N(M):(U.origin=F,m(U,P,L,N))}):N()}})}}R0.exports=y})()});var jf=O(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.Server=Yi.BaseServer=void 0;var k0=Pp(),yc=Jp(),YN=require("events"),O0=Zp(),XN=Ae(),JN=Yx(),QN=b0(),P0=Yp(),ZN=no(),ne=(0,XN.default)("engine"),Ki=Symbol("responseHeaders");function eL(r){try{let e=JSON.parse(r);if(typeof e.sid=="string")return e.sid}catch{}}var Vi=class extends YN.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:QN.Server,pingTimeout:2e4,pingInterval:25e3,upgradeTimeout:1e4,maxHttpBufferSize:1e6,transports:["polling","websocket"],allowUpgrades:!0,httpCompression:{threshold:1024},cors:!1,allowEIO3:!1},e),e.cookie&&(this.opts.cookie=Object.assign({name:"io",path:"/",httpOnly:e.cookie.path!==!1,sameSite:"lax"},e.cookie)),this.opts.cors&&this.use(Df()(this.opts.cors)),e.perMessageDeflate&&(this.opts.perMessageDeflate=Object.assign({threshold:1024},e.perMessageDeflate)),this.init()}_computePath(e){let t=(e.path||"/engine.io").replace(/\/$/,"");return e.addTrailingSlash!==!1&&(t+="/"),t}upgrades(e){return this.opts.allowUpgrades?yc.default[e].upgradesTo||[]:[]}verify(e,t,n){let i=e._query.transport;if(!~this.opts.transports.indexOf(i)||i==="webtransport")return ne('unknown transport "%s"',i),n(xe.errors.UNKNOWN_TRANSPORT,{transport:i});if(tL(e.headers.origin)){let a=e.headers.origin;return e.headers.origin=null,ne("origin header invalid"),n(xe.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:a})}let o=e._query.sid;if(o){if(!this.clients.hasOwnProperty(o))return ne('unknown sid "%s"',o),n(xe.errors.UNKNOWN_SID,{sid:o});let a=this.clients[o].transport.name;if(!t&&a!==i)return ne("bad request: unexpected transport without upgrade"),n(xe.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:i,previousTransport:a})}else return e.method!=="GET"?n(xe.errors.BAD_HANDSHAKE_METHOD,{method:e.method}):i==="websocket"&&!t?(ne("invalid transport upgrade"),n(xe.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"})):this.opts.allowRequest?this.opts.allowRequest(e,(a,c)=>{if(!c)return n(xe.errors.FORBIDDEN,{message:a});n()}):n();n()}use(e){this.middlewares.push(e)}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return ne("no middleware to apply, skipping"),n();let i=s=>{ne("applying middleware n\xB0%d",s+1),this.middlewares[s](e,t,o=>{if(o)return n(o);s+1<this.middlewares.length?i(s+1):n()})};i(0)}close(){ne("closing all open clients");for(let e in this.clients)this.clients.hasOwnProperty(e)&&this.clients[e].close(!0);return this.cleanup(),this}generateId(e){return k0.generateId()}async handshake(e,t,n){let i=t._query.EIO==="4"?4:3;if(i===3&&!this.opts.allowEIO3){ne("unsupported protocol version"),this.emit("connection_error",{req:t,code:xe.errors.UNSUPPORTED_PROTOCOL_VERSION,message:xe.errorMessages[xe.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:i}}),n(xe.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let s;try{s=await this.generateId(t)}catch(c){ne("error while generating an id"),this.emit("connection_error",{req:t,code:xe.errors.BAD_REQUEST,message:xe.errorMessages[xe.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:c}}),n(xe.errors.BAD_REQUEST);return}ne('handshaking client "%s"',s);try{var o=this.createTransport(e,t);e==="polling"?(o.maxHttpBufferSize=this.opts.maxHttpBufferSize,o.httpCompression=this.opts.httpCompression):e==="websocket"&&(o.perMessageDeflate=this.opts.perMessageDeflate)}catch(c){ne('error handshaking to transport "%s"',e),this.emit("connection_error",{req:t,code:xe.errors.BAD_REQUEST,message:xe.errorMessages[xe.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:c}}),n(xe.errors.BAD_REQUEST);return}let a=new O0.Socket(s,this,o,t,i);return o.on("headers",(c,u)=>{!u._query.sid&&(this.opts.cookie&&(c["Set-Cookie"]=[(0,JN.serialize)(this.opts.cookie.name,s,this.opts.cookie)]),this.emit("initial_headers",c,u)),this.emit("headers",c,u)}),o.onRequest(t),this.clients[s]=a,this.clientsCount++,a.once("close",()=>{delete this.clients[s],this.clientsCount--}),this.emit("connection",a),o}async onWebTransportSession(e){let t=setTimeout(()=>{ne("the client failed to establish a bidirectional stream in the given period"),e.close()},this.opts.upgradeTimeout),i=await e.incomingBidirectionalStreams.getReader().read();if(i.done){ne("session is closed");return}let s=i.value,o=(0,ZN.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),a=s.readable.pipeThrough(o).getReader(),{value:c,done:u}=await a.read();if(u){ne("stream is closed");return}if(clearTimeout(t),c.type!=="open")return ne("invalid WebTransport handshake"),e.close();if(c.data===void 0){let m=new P0.WebTransport(e,s,a),y=k0.generateId();ne('handshaking client "%s" (WebTransport)',y);let _=new O0.Socket(y,this,m,null,4);this.clients[y]=_,this.clientsCount++,_.once("close",()=>{delete this.clients[y],this.clientsCount--}),this.emit("connection",_);return}let p=eL(c.data);if(!p)return ne("invalid WebTransport handshake"),e.close();let f=this.clients[p];if(!f)ne("upgrade attempt for closed client"),e.close();else if(f.upgrading)ne("transport has already been trying to upgrade"),e.close();else if(f.upgraded)ne("transport had already been upgraded"),e.close();else{ne("upgrading existing transport");let m=new P0.WebTransport(e,s,a);f._maybeUpgrade(m)}}};Yi.BaseServer=Vi;Vi.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};Vi.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};var Bf=class{constructor(e,t){this.req=e,this.socket=t,e[Ki]={}}setHeader(e,t){this.req[Ki][e]=t}getHeader(e){return this.req[Ki][e]}removeHeader(e){delete this.req[Ki][e]}write(){}writeHead(){}end(){this.socket.destroy()}},xe=class r extends Vi{init(){~this.opts.transports.indexOf("websocket")&&(this.ws&&this.ws.close(),this.ws=new this.opts.wsEngine({noServer:!0,clientTracking:!1,perMessageDeflate:this.opts.perMessageDeflate,maxPayload:this.opts.maxHttpBufferSize}),typeof this.ws.on=="function"&&this.ws.on("headers",(e,t)=>{let n=t[Ki]||{};delete t[Ki],!t._query.sid&&this.emit("initial_headers",n,t),this.emit("headers",n,t),ne("writing headers: %j",n),Object.keys(n).forEach(s=>{e.push(`${s}: ${n[s]}`)})}))}cleanup(){this.ws&&(ne("closing webSocketServer"),this.ws.close())}prepare(e){if(!e._query){let t=new URL(e.url,"https://socket.io");e._query=Object.fromEntries(t.searchParams.entries())}}createTransport(e,t){return new yc.default[e](t)}handleRequest(e,t){ne('handling "%s" http request "%s"',e.method,e.url),this.prepare(e),e.res=t;let n=(i,s)=>{if(i!==void 0){this.emit("connection_error",{req:e,code:i,message:r.errorMessages[i],context:s}),M0(t,i,s);return}if(e._query.sid)ne("setting new request for existing client"),this.clients[e._query.sid].transport.onRequest(e);else{let o=(a,c)=>M0(t,a,c);this.handshake(e._query.transport,e,o)}};this._applyMiddlewares(e,t,i=>{i?n(r.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!1,n)})}handleUpgrade(e,t,n){this.prepare(e);let i=new Bf(e,t),s=(o,a)=>{if(o!==void 0){this.emit("connection_error",{req:e,code:o,message:r.errorMessages[o],context:a}),I0(t,o,a);return}let c=Buffer.from(n);n=null,i.writeHead(),this.ws.handleUpgrade(e,t,c,u=>{this.onWebSocket(e,t,u)})};this._applyMiddlewares(e,i,o=>{o?s(r.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!0,s)})}onWebSocket(e,t,n){if(n.on("error",s),yc.default[e._query.transport]!==void 0&&!yc.default[e._query.transport].prototype.handlesUpgrades){ne("transport doesnt handle upgraded requests"),n.close();return}let i=e._query.sid;if(e.websocket=n,i){let o=this.clients[i];if(!o)ne("upgrade attempt for closed client"),n.close();else if(o.upgrading)ne("transport has already been trying to upgrade"),n.close();else if(o.upgraded)ne("transport had already been upgraded"),n.close();else{ne("upgrading existing transport"),n.removeListener("error",s);let a=this.createTransport(e._query.transport,e);a.perMessageDeflate=this.opts.perMessageDeflate,o._maybeUpgrade(a)}}else{let o=(a,c)=>I0(t,a,c);this.handshake(e._query.transport,e,o)}function s(){ne("websocket error before upgrade")}}attach(e,t={}){let n=this._computePath(t),i=t.destroyUpgradeTimeout||1e3;function s(a){return n===a.url.slice(0,n.length)}let o=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("close",this.close.bind(this)),e.on("listening",this.init.bind(this)),e.on("request",(a,c)=>{if(s(a))ne('intercepting request for path "%s"',n),this.handleRequest(a,c);else{let u=0,p=o.length;for(;u<p;u++)o[u].call(e,a,c)}}),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",(a,c,u)=>{s(a)?this.handleUpgrade(a,c,u):t.destroyUpgrade!==!1&&setTimeout(function(){if(c.writable&&c.bytesWritten<=0)return c.on("error",p=>{ne("error while destroying upgrade: %s",p.message)}),c.end()},i)})}};Yi.Server=xe;function M0(r,e,t){let n=e===xe.errors.FORBIDDEN?403:400,i=t&&t.message?t.message:xe.errorMessages[e];r.writeHead(n,{"Content-Type":"application/json"}),r.end(JSON.stringify({code:e,message:i}))}function I0(r,e,t={}){if(r.on("error",()=>{ne("ignoring error from closed connection")}),r.writable){let n=t.message||xe.errorMessages[e],i=Buffer.byteLength(n);r.write(`HTTP/1.1 400 Bad Request\r
19
19
  Connection: close\r
20
20
  Content-type: text/html\r
21
21
  Content-Length: `+i+`\r
22
22
  \r
23
- `+n)}r.destroy()}var fo=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];function JN(r){if(r+="",r.length<1)return!1;if(!fo[r.charCodeAt(0)])return ne('invalid header, index 0, char "%s"',r.charCodeAt(0)),!0;if(r.length<2)return!1;if(!fo[r.charCodeAt(1)])return ne('invalid header, index 1, char "%s"',r.charCodeAt(1)),!0;if(r.length<3)return!1;if(!fo[r.charCodeAt(2)])return ne('invalid header, index 2, char "%s"',r.charCodeAt(2)),!0;if(r.length<4)return!1;if(!fo[r.charCodeAt(3)])return ne('invalid header, index 3, char "%s"',r.charCodeAt(3)),!0;for(let e=4;e<r.length;++e)if(!fo[r.charCodeAt(e)])return ne('invalid header, index "%i", char "%s"',e,r.charCodeAt(e)),!0;return!1}});var I0=O(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.Polling=void 0;var QN=Yn(),M0=require("zlib"),ZN=Ha(),eL=Ce(),or=(0,eL.default)("engine:polling"),tL={gzip:M0.createGzip,deflate:M0.createDeflate},jf=class extends QN.Transport{constructor(e){super(e),this.closeTimeout=30*1e3}get name(){return"polling"}onRequest(e){let t=e.res;e.res=null,e.getMethod()==="get"?this.onPollRequest(e,t):e.getMethod()==="post"?this.onDataRequest(e,t):(t.writeStatus("500 Internal Server Error"),t.end())}onPollRequest(e,t){if(this.req){or("request overlap"),this.onError("overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}or("setting request"),this.req=e,this.res=t;let n=()=>{this.writable=!1,this.onError("poll connection closed prematurely")},i=()=>{this.req=this.res=null};e.cleanup=i,t.onAborted(n),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose&&(or("triggering empty send to append close packet"),this.send([{type:"noop"}]))}onDataRequest(e,t){if(this.dataReq){this.onError("data request overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}let n=Number(e.headers["content-length"]);if(!n){this.onError("content-length header required"),t.writeStatus("411 Length Required").end();return}if(n>this.maxHttpBufferSize){this.onError("payload too large"),t.writeStatus("413 Payload Too Large").end();return}if(e.headers["content-type"]==="application/octet-stream"&&this.protocol===4)return this.onError("invalid content");this.dataReq=e,this.dataRes=t;let s,o=0,a={"Content-Type":"text/html"};this.headers(e,a);for(let u in a)t.writeHeader(u,String(a[u]));let c=u=>{this.onData(u.toString()),this.onDataRequestCleanup(),t.cork(()=>{t.end("ok")})};t.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),t.onData((u,p)=>{let f=o+u.byteLength;if(f>n){this.onError("content-length mismatch"),t.close();return}if(!s){if(p){c(Buffer.from(u));return}s=Buffer.allocUnsafe(n)}if(Buffer.from(u).copy(s,o),p){if(f!=n){this.onError("content-length mismatch"),t.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}c(s);return}o=f})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(e){or('received "%s"',e);let t=n=>{if(n.type==="close")return or("got xhr close packet"),this.onClose(),!1;this.onPacket(n)};this.protocol===3?this.parser.decodePayload(e,t):this.parser.decodePayload(e).forEach(t)}onClose(){this.writable&&this.send([{type:"noop"}]),super.onClose()}send(e){this.writable=!1,this.shouldClose&&(or("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=n=>{let i=e.some(s=>s.options&&s.options.compress);this.write(n,{compress:i})};this.protocol===3?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){or('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,n){let i=typeof e=="string",o={"Content-Type":i?"text/plain; charset=UTF-8":"application/octet-stream"},a=p=>{this.headers(this.req,o),this.res.cork(()=>{Object.keys(o).forEach(f=>{this.res.writeHeader(f,String(o[f]))}),this.res.end(p)}),n()};if(!this.httpCompression||!t.compress){a(e);return}if((i?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let u=ZN(this.req).encodings(["gzip","deflate"]);if(!u){a(e);return}this.compress(e,u,(p,f)=>{if(p){this.res.writeStatus("500 Internal Server Error"),this.res.end(),n(p);return}o["Content-Encoding"]=u,a(f)})}compress(e,t,n){or("compressing");let i=[],s=0;tL[t](this.httpCompression).on("error",n).on("data",function(o){i.push(o),s+=o.length}).on("end",function(){n(null,Buffer.concat(i,s))}).end(e)}doClose(e){or("closing");let t,n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(or("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(or("transport discarded - closing right away"),n()):(or("transport not writable - buffering orderly close"),this.shouldClose=n,t=setTimeout(n,this.closeTimeout))}headers(e,t){t=t||{};let n=e.headers["user-agent"];return n&&(~n.indexOf(";MSIE")||~n.indexOf("Trident/"))&&(t["X-XSS-Protection"]="0"),t["cache-control"]="no-store",this.emit("headers",t,e),t}};yc.Polling=jf});var L0=O(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.WebSocket=void 0;var rL=Yn(),nL=Ce(),N0=(0,nL.default)("engine:ws"),Ff=class extends rL.Transport{constructor(e){super(e),this.writable=!1,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],i=t+1===e.length,s=o=>{let a=typeof o!="string",c=this.perMessageDeflate&&Buffer.byteLength(o)>this.perMessageDeflate.threshold;N0('writing "%s"',o),this.socket.send(o,a,c),i&&(this.emit("drain"),this.writable=!0,this.emit("ready"))};n.options&&typeof n.options.wsPreEncoded=="string"?s(n.options.wsPreEncoded):this.parser.encodePacket(n,this.supportsBinary,s)}}doClose(e){N0("closing"),e&&e(),this.socket.end()}};_c.WebSocket=Ff});var D0=O(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});var iL=I0(),sL=L0();Hf.default={polling:iL.Polling,websocket:sL.WebSocket}});var B0=O(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.uServer=void 0;var oL=Ce(),ti=Bf(),aL=D0(),Nn=(0,oL.default)("engine:uws"),$f=class extends ti.BaseServer{init(){}cleanup(){}prepare(e,t){e.method=e.getMethod().toUpperCase(),e.url=e.getUrl();let n=new URLSearchParams(e.getQuery());e._query=Object.fromEntries(n.entries()),e.headers={},e.forEach((i,s)=>{e.headers[i]=s}),e.connection={remoteAddress:Buffer.from(t.getRemoteAddressAsText()).toString()},t.onAborted(()=>{Nn("response has been aborted")})}createTransport(e,t){return new aL.default[e](t)}attach(e,t={}){let n=this._computePath(t);e.any(n,this.handleRequest.bind(this)).ws(n,{compression:t.compression,idleTimeout:t.idleTimeout,maxBackpressure:t.maxBackpressure,maxPayloadLength:this.opts.maxHttpBufferSize,upgrade:this.handleUpgrade.bind(this),open:i=>{let s=i.getUserData().transport;s.socket=i,s.writable=!0,s.emit("ready")},message:(i,s,o)=>{i.getUserData().transport.onData(o?s:Buffer.from(s).toString())},close:(i,s,o)=>{i.getUserData().transport.onClose(s,o)}})}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return n();e.res=new qf(t),super._applyMiddlewares(e,e.res,i=>{e.res.writeHead(),n(i)})}handleRequest(e,t){Nn('handling "%s" http request "%s"',t.getMethod(),t.getUrl()),this.prepare(t,e),t.res=e;let n=(i,s)=>{if(i!==void 0){this.emit("connection_error",{req:t,code:i,message:ti.Server.errorMessages[i],context:s}),this.abortRequest(t.res,i,s);return}if(t._query.sid)Nn("setting new request for existing client"),this.clients[t._query.sid].transport.onRequest(t);else{let o=(a,c)=>this.abortRequest(e,a,c);this.handshake(t._query.transport,t,o)}};this._applyMiddlewares(t,e,i=>{i?n(ti.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,n)})}handleUpgrade(e,t,n){Nn("on upgrade"),this.prepare(t,e),t.res=e;let i=async(s,o)=>{if(s!==void 0){this.emit("connection_error",{req:t,code:s,message:ti.Server.errorMessages[s],context:o}),this.abortRequest(e,s,o);return}let a=t._query.sid,c;if(a){let f=this.clients[a];if(f){if(f.upgrading)return Nn("transport has already been trying to upgrade"),e.close();if(f.upgraded)return Nn("transport had already been upgraded"),e.close();Nn("upgrading existing transport"),c=this.createTransport(t._query.transport,t),f._maybeUpgrade(c)}else return Nn("upgrade attempt for closed client"),e.close()}else if(c=await this.handshake(t._query.transport,t,(f,m)=>this.abortRequest(e,f,m)),!c)return;let u={};!a&&this.emit("initial_headers",u,t),this.emit("headers",u,t),t.res.writeStatus("101 Switching Protocols"),Object.keys(u).forEach(f=>{t.res.writeHeader(f,u[f])}),e.upgrade({transport:c},t.getHeader("sec-websocket-key"),t.getHeader("sec-websocket-protocol"),t.getHeader("sec-websocket-extensions"),n)};this._applyMiddlewares(t,e,s=>{s?i(ti.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,i)})}abortRequest(e,t,n){let i=t===ti.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",s=n&&n.message?n.message:ti.Server.errorMessages[t];e.writeStatus(i),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:s}))}};bc.uServer=$f;var qf=class{constructor(e){this.res=e,this.statusWritten=!1,this.headers=[],this.isAborted=!1}set statusCode(e){e&&this.writeStatus(e===200?"200 OK":"204 No Content")}writeHead(e){this.statusCode=e}setHeader(e,t){Array.isArray(t)?t.forEach(n=>{this.writeHeader(e,n)}):this.writeHeader(e,t)}removeHeader(){}getHeader(){}writeStatus(e){if(!this.isAborted)return this.res.writeStatus(e),this.statusWritten=!0,this.writeBufferedHeaders(),this}writeHeader(e,t){this.isAborted||e!=="Content-Length"&&(this.statusWritten?this.res.writeHeader(e,t):this.headers.push([e,t]))}writeBufferedHeaders(){this.headers.forEach(([e,t])=>{this.res.writeHeader(e,t)})}end(e){this.isAborted||this.res.cork(()=>{this.statusWritten||this.writeBufferedHeaders(),this.res.end(e)})}onData(e){this.isAborted||this.res.onData(e)}onAborted(e){this.isAborted||this.res.onAborted(()=>{this.isAborted=!0,e()})}cork(e){this.isAborted||this.res.cork(e)}}});var $0=O(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.protocol=ut.Transport=ut.Socket=ut.uServer=ut.parser=ut.transports=ut.Server=void 0;ut.listen=dL;ut.attach=H0;var cL=require("http"),j0=Bf();Object.defineProperty(ut,"Server",{enumerable:!0,get:function(){return j0.Server}});var lL=Xp();ut.transports=lL.default;var F0=no();ut.parser=F0;var uL=B0();Object.defineProperty(ut,"uServer",{enumerable:!0,get:function(){return uL.uServer}});var pL=Qp();Object.defineProperty(ut,"Socket",{enumerable:!0,get:function(){return pL.Socket}});var fL=Yn();Object.defineProperty(ut,"Transport",{enumerable:!0,get:function(){return fL.Transport}});ut.protocol=F0.protocol;function dL(r,e,t){typeof e=="function"&&(t=e,e={});let n=(0,cL.createServer)(function(s,o){o.writeHead(501),o.end("Not Implemented")}),i=H0(n,e);return i.httpServer=n,n.listen(r,t),i}function H0(r,e){let t=new j0.Server(e);return t.attach(r,e),t}});var U0=O(q0=>{q0.Emitter=At;function At(r){if(r)return hL(r)}function hL(r){for(var e in At.prototype)r[e]=At.prototype[e];return r}At.prototype.on=At.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};At.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};At.prototype.off=At.prototype.removeListener=At.prototype.removeAllListeners=At.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var n,i=0;i<t.length;i++)if(n=t[i],n===e||n.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+r],this};At.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,i=t.length;n<i;++n)t[n].apply(this,e)}return this};At.prototype.emitReserved=At.prototype.emit;At.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};At.prototype.hasListeners=function(r){return!!this.listeners(r).length}});var Uf=O(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.isBinary=G0;Sc.hasBinary=wc;var mL=typeof ArrayBuffer=="function",gL=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,W0=Object.prototype.toString,vL=typeof Blob=="function"||typeof Blob<"u"&&W0.call(Blob)==="[object BlobConstructor]",xL=typeof File=="function"||typeof File<"u"&&W0.call(File)==="[object FileConstructor]";function G0(r){return mL&&(r instanceof ArrayBuffer||gL(r))||vL&&r instanceof Blob||xL&&r instanceof File}function wc(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,n=r.length;t<n;t++)if(wc(r[t]))return!0;return!1}if(G0(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return wc(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&wc(r[t]))return!0;return!1}});var z0=O(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.deconstructPacket=_L;Ec.reconstructPacket=bL;var yL=Uf();function _L(r){let e=[],t=r.data,n=r;return n.data=Wf(t,e),n.attachments=e.length,{packet:n,buffers:e}}function Wf(r,e){if(!r)return r;if((0,yL.isBinary)(r)){let t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Array.isArray(r)){let t=new Array(r.length);for(let n=0;n<r.length;n++)t[n]=Wf(r[n],e);return t}else if(typeof r=="object"&&!(r instanceof Date)){let t={};for(let n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=Wf(r[n],e));return t}return r}function bL(r,e){return r.data=Gf(r.data,e),delete r.attachments,r}function Gf(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=Gf(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=Gf(r[t],e));return r}});var ho=O(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.Decoder=Sr.Encoder=Sr.PacketType=Sr.protocol=void 0;Sr.isPacketValid=AL;var wL=U0(),K0=z0(),V0=Uf(),SL=Ce(),zf=(0,SL.default)("socket.io-parser"),Y0=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];Sr.protocol=5;var ue;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(ue||(Sr.PacketType=ue={}));var Kf=class{constructor(e){this.replacer=e}encode(e){return zf("encoding packet %j",e),(e.type===ue.EVENT||e.type===ue.ACK)&&(0,V0.hasBinary)(e)?this.encodeAsBinary({type:e.type===ue.EVENT?ue.BINARY_EVENT:ue.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===ue.BINARY_EVENT||e.type===ue.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),zf("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,K0.deconstructPacket)(e),n=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(n),i}};Sr.Encoder=Kf;var Vf=class r extends wL.Emitter{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let n=t.type===ue.BINARY_EVENT;n||t.type===ue.BINARY_ACK?(t.type=n?ue.EVENT:ue.ACK,this.reconstructor=new Yf(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,V0.isBinary)(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,n={type:Number(e.charAt(0))};if(ue[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===ue.BINARY_EVENT||n.type===ue.BINARY_ACK){let s=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(s,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");let a=Number(o);if(!X0(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");n.attachments=a}if(e.charAt(t+1)==="/"){let s=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(s,t)}else n.nsp="/";let i=e.charAt(t+1);if(i!==""&&Number(i)==i){let s=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}n.id=Number(e.substring(s,t+1))}if(e.charAt(++t)){let s=this.tryParse(e.substr(t));if(r.isPayloadValid(n.type,s))n.data=s;else throw new Error("invalid payload")}return zf("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case ue.CONNECT:return Tc(t);case ue.DISCONNECT:return t===void 0;case ue.CONNECT_ERROR:return typeof t=="string"||Tc(t);case ue.EVENT:case ue.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&Y0.indexOf(t[0])===-1);case ue.ACK:case ue.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};Sr.Decoder=Vf;var Yf=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=(0,K0.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function EL(r){return typeof r=="string"}var X0=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function TL(r){return r===void 0||X0(r)}function Tc(r){return Object.prototype.toString.call(r)==="[object Object]"}function CL(r,e){switch(r){case ue.CONNECT:return e===void 0||Tc(e);case ue.DISCONNECT:return e===void 0;case ue.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&Y0.indexOf(e[0])===-1);case ue.ACK:return Array.isArray(e);case ue.CONNECT_ERROR:return typeof e=="string"||Tc(e);default:return!1}}function AL(r){return EL(r.nsp)&&TL(r.id)&&CL(r.type,r.data)}});var J0=O(Yi=>{"use strict";var RL=Yi&&Yi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.Client=void 0;var Cc=ho(),kL=RL(Ce()),Er=(0,kL.default)("socket.io:client"),Xf=class{constructor(e,t){this.sockets=new Map,this.nsps=new Map,this.server=e,this.conn=t,this.encoder=e.encoder,this.decoder=new e._parser.Decoder,this.id=t.id,this.setup()}get request(){return this.conn.request}setup(){this.onclose=this.onclose.bind(this),this.ondata=this.ondata.bind(this),this.onerror=this.onerror.bind(this),this.ondecoded=this.ondecoded.bind(this),this.decoder.on("decoded",this.ondecoded),this.conn.on("data",this.ondata),this.conn.on("error",this.onerror),this.conn.on("close",this.onclose),this.connectTimeout=setTimeout(()=>{this.nsps.size===0?(Er("no namespace joined yet, close the client"),this.close()):Er("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return Er("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,n=>{n?this.doConnect(e,t):(Er("creation of namespace %s was denied",e),this._packet({type:Cc.PacketType.CONNECT_ERROR,nsp:e,data:{message:"Invalid namespace"}}))})}doConnect(e,t){let n=this.server.of(e);n._add(this,t,i=>{this.sockets.set(i.id,i),this.nsps.set(n.name,i),this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=void 0)})}_disconnect(){for(let e of this.sockets.values())e.disconnect();this.sockets.clear(),this.close()}_remove(e){if(this.sockets.has(e.id)){let t=this.sockets.get(e.id).nsp.name;this.sockets.delete(e.id),this.nsps.delete(t)}else Er("ignoring remove for %s",e.id)}close(){this.conn.readyState==="open"&&(Er("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if(this.conn.readyState!=="open"){Er("ignoring packet write %j",e);return}let n=t.preEncoded?e:this.encoder.encode(e);this.writeToEngine(n,t)}writeToEngine(e,t){if(t.volatile&&!this.conn.transport.writable){Er("volatile packet is discarded since the transport is not currently writable");return}let n=Array.isArray(e)?e:[e];for(let i of n)this.conn.write(i,t)}ondata(e){try{this.decoder.add(e)}catch(t){Er("invalid packet format"),this.onerror(t)}}ondecoded(e){let{namespace:t,authPayload:n}=this._parseNamespace(e),i=this.nsps.get(t);!i&&e.type===Cc.PacketType.CONNECT?this.connect(t,n):i&&e.type!==Cc.PacketType.CONNECT&&e.type!==Cc.PacketType.CONNECT_ERROR?process.nextTick(function(){i._onpacket(e)}):(Er("invalid state (packet type: %s)",e.type),this.close())}_parseNamespace(e){if(this.conn.protocol!==3)return{namespace:e.nsp,authPayload:e.data};let t=new URL(e.nsp,"https://socket.io");return{namespace:t.pathname,authPayload:Object.fromEntries(t.searchParams.entries())}}onerror(e){for(let t of this.sockets.values())t._onerror(e);this.conn.close()}onclose(e,t){Er("client close with reason %s",e),this.destroy();for(let n of this.sockets.values())n._onclose(e,t);this.sockets.clear(),this.decoder.destroy()}destroy(){this.conn.removeListener("data",this.ondata),this.conn.removeListener("error",this.onerror),this.conn.removeListener("close",this.onclose),this.decoder.removeListener("decoded",this.ondecoded),this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=void 0)}};Yi.Client=Xf});var Rc=O(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.StrictEventEmitter=void 0;var OL=require("events"),Jf=class extends OL.EventEmitter{on(e,t){return super.on(e,t)}once(e,t){return super.once(e,t)}emit(e,...t){return super.emit(e,...t)}emitReserved(e,...t){return super.emit(e,...t)}emitUntyped(e,...t){return super.emit(e,...t)}listeners(e){return super.listeners(e)}};Ac.StrictEventEmitter=Jf});var Qf=O(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.RESERVED_EVENTS=void 0;kc.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var Zf=O(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.RemoteSocket=Xi.BroadcastOperator=void 0;var PL=Qf(),ML=ho(),Oc=class r{constructor(e,t=new Set,n=new Set,i={}){this.adapter=e,this.rooms=t,this.exceptRooms=n,this.flags=i}to(e){let t=new Set(this.rooms);return Array.isArray(e)?e.forEach(n=>t.add(n)):t.add(e),new r(this.adapter,t,this.exceptRooms,this.flags)}in(e){return this.to(e)}except(e){let t=new Set(this.exceptRooms);return Array.isArray(e)?e.forEach(n=>t.add(n)):t.add(e),new r(this.adapter,this.rooms,t,this.flags)}compress(e){let t=Object.assign({},this.flags,{compress:e});return new r(this.adapter,this.rooms,this.exceptRooms,t)}get volatile(){let e=Object.assign({},this.flags,{volatile:!0});return new r(this.adapter,this.rooms,this.exceptRooms,e)}get local(){let e=Object.assign({},this.flags,{local:!0});return new r(this.adapter,this.rooms,this.exceptRooms,e)}timeout(e){let t=Object.assign({},this.flags,{timeout:e});return new r(this.adapter,this.rooms,this.exceptRooms,t)}emit(e,...t){if(PL.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],i={type:ML.PacketType.EVENT,data:n};if(!(typeof n[n.length-1]=="function"))return this.adapter.broadcast(i,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let o=n.pop(),a=!1,c=[],u=setTimeout(()=>{a=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:c])},this.flags.timeout),p=-1,f=0,m=0,y=()=>{!a&&p===f&&c.length===m&&(clearTimeout(u),o.apply(this,[null,this.flags.expectSingleResponse?c[0]:c]))};return this.adapter.broadcastWithAck(i,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},_=>{m+=_,f++,y()},_=>{c.push(_),y()}),this.adapter.serverCount().then(_=>{p=_,y()}),!0}emitWithAck(e,...t){return new Promise((n,i)=>{t.push((s,o)=>s?(s.responses=o,i(s)):n(o)),this.emit(e,...t)})}allSockets(){if(!this.adapter)throw new Error("No adapter for this namespace, are you trying to get the list of clients of a dynamic namespace?");return this.adapter.sockets(this.rooms)}fetchSockets(){return this.adapter.fetchSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags}).then(e=>e.map(t=>t.server?t:new Pc(this.adapter,t)))}socketsJoin(e){this.adapter.addSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(e)?e:[e])}socketsLeave(e){this.adapter.delSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(e)?e:[e])}disconnectSockets(e=!1){this.adapter.disconnectSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},e)}};Xi.BroadcastOperator=Oc;var Pc=class{constructor(e,t){this.id=t.id,this.handshake=t.handshake,this.rooms=new Set(t.rooms),this.data=t.data,this.operator=new Oc(e,new Set([this.id]),new Set,{expectSingleResponse:!0})}timeout(e){return this.operator.timeout(e)}emit(e,...t){return this.operator.emit(e,...t)}join(e){return this.operator.socketsJoin(e)}leave(e){return this.operator.socketsLeave(e)}disconnect(e=!1){return this.operator.disconnectSockets(e),this}};Xi.RemoteSocket=Pc});var td=O(Ji=>{"use strict";var e_=Ji&&Ji.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ji,"__esModule",{value:!0});Ji.Socket=void 0;var ar=ho(),IL=e_(Ce()),NL=Rc(),Q0=e_(Op()),LL=Zf(),DL=Qf(),yt=(0,IL.default)("socket.io:socket"),BL=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function Z0(){}var ed=class extends NL.StrictEventEmitter{constructor(e,t,n,i){super(),this.nsp=e,this.client=t,this.recovered=!1,this.data={},this.connected=!1,this.acks=new Map,this.fns=[],this.flags={},this.server=e.server,this.adapter=e.adapter,i?(this.id=i.sid,this.pid=i.pid,i.rooms.forEach(s=>this.join(s)),this.data=i.data,i.missedPackets.forEach(s=>{this.packet({type:ar.PacketType.EVENT,data:s})}),this.recovered=!0):(t.conn.protocol===3?this.id=e.name!=="/"?e.name+"#"+t.id:t.id:this.id=Q0.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=Q0.default.generateId())),this.handshake=this.buildHandshake(n),this.on("error",Z0)}buildHandshake(e){var t,n,i,s;return{headers:((t=this.request)===null||t===void 0?void 0:t.headers)||{},time:new Date+"",address:this.conn.remoteAddress,xdomain:!!(!((n=this.request)===null||n===void 0)&&n.headers.origin),secure:!this.request||!!this.request.connection.encrypted,issued:+new Date,url:(i=this.request)===null||i===void 0?void 0:i.url,query:((s=this.request)===null||s===void 0?void 0:s._query)||{},auth:e}}emit(e,...t){if(DL.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],i={type:ar.PacketType.EVENT,data:n};if(typeof n[n.length-1]=="function"){let o=this.nsp._ids++;yt("emitting packet with ack id %d",o),this.registerAckCallback(o,n.pop()),i.id=o}let s=Object.assign({},this.flags);return this.flags={},this.nsp.server.opts.connectionStateRecovery?this.adapter.broadcast(i,{rooms:new Set([this.id]),except:new Set,flags:s}):(this.notifyOutgoingListeners(i),this.packet(i,s)),!0}emitWithAck(e,...t){let n=this.flags.timeout!==void 0;return new Promise((i,s)=>{t.push((o,a)=>n?o?s(o):i(a):i(o)),this.emit(e,...t)})}registerAckCallback(e,t){let n=this.flags.timeout;if(n===void 0){this.acks.set(e,t);return}let i=setTimeout(()=>{yt("event with ack id %d has timed out after %d ms",e,n),this.acks.delete(e),t.call(this,new Error("operation has timed out"))},n);this.acks.set(e,(...s)=>{clearTimeout(i),t.apply(this,[null,...s])})}to(e){return this.newBroadcastOperator().to(e)}in(e){return this.newBroadcastOperator().in(e)}except(e){return this.newBroadcastOperator().except(e)}send(...e){return this.emit("message",...e),this}write(...e){return this.emit("message",...e),this}packet(e,t={}){e.nsp=this.nsp.name,t.compress=t.compress!==!1,this.client._packet(e,t)}join(e){return yt("join room %s",e),this.adapter.addAll(this.id,new Set(Array.isArray(e)?e:[e]))}leave(e){return yt("leave room %s",e),this.adapter.del(this.id,e)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){yt("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3?this.packet({type:ar.PacketType.CONNECT}):this.packet({type:ar.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(yt("got packet %j",e),e.type){case ar.PacketType.EVENT:this.onevent(e);break;case ar.PacketType.BINARY_EVENT:this.onevent(e);break;case ar.PacketType.ACK:this.onack(e);break;case ar.PacketType.BINARY_ACK:this.onack(e);break;case ar.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(e){let t=e.data||[];if(yt("emitting event %j",t),e.id!=null&&(yt("attaching ack callback to event"),t.push(this.ack(e.id))),this._anyListeners&&this._anyListeners.length){let n=this._anyListeners.slice();for(let i of n)i.apply(this,t)}this.dispatch(t)}ack(e){let t=this,n=!1;return function(){if(n)return;let i=Array.prototype.slice.call(arguments);yt("sending ack %j",i),t.packet({id:e,type:ar.PacketType.ACK,data:i}),n=!0}}onack(e){let t=this.acks.get(e.id);typeof t=="function"?(yt("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),this.acks.delete(e.id)):yt("bad ack %s",e.id)}ondisconnect(){yt("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(e){this.emitReserved("error",e)}_onclose(e,t){if(!this.connected)return this;yt("closing socket - reason %s",e),this.emitReserved("disconnecting",e,t),this.server._opts.connectionStateRecovery&&BL.has(e)&&(yt("connection state recovery is enabled for sid %s",this.id),this.adapter.persistSession({sid:this.id,pid:this.pid,rooms:[...this.rooms],data:this.data})),this._cleanup(),this.client._remove(this),this.connected=!1,this.emitReserved("disconnect",e,t)}_cleanup(){this.leaveAll(),this.nsp._remove(this),this.join=Z0}_error(e){this.packet({type:ar.PacketType.CONNECT_ERROR,data:e})}disconnect(e=!1){return this.connected?(e?this.client._disconnect():(this.packet({type:ar.PacketType.DISCONNECT}),this._onclose("server namespace disconnect")),this):this}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}get broadcast(){return this.newBroadcastOperator()}get local(){return this.newBroadcastOperator().local}timeout(e){return this.flags.timeout=e,this}dispatch(e){yt("dispatching an event %j",e),this.run(e,t=>{process.nextTick(()=>{if(t)return this._onerror(t);this.connected?super.emitUntyped.apply(this,e):yt("ignore packet received after disconnection")})})}use(e){return this.fns.push(e),this}run(e,t){if(!this.fns.length)return t();let n=this.fns.slice(0);function i(s){n[s](e,o=>{if(o)return t(o);if(!n[s+1])return t();i(s+1)})}i(0)}get disconnected(){return!this.connected}get request(){return this.client.request}get conn(){return this.client.conn}get rooms(){return this.adapter.socketRooms(this.id)||new Set}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let n of t)n.apply(this,e.data)}}newBroadcastOperator(){let e=Object.assign({},this.flags);return this.flags={},new LL.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}};Ji.Socket=ed});var nd=O(on=>{"use strict";var jL=on&&on.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(on,"__esModule",{value:!0});on.Namespace=on.RESERVED_EVENTS=void 0;var t_=td(),FL=Rc(),HL=jL(Ce()),Yt=Zf(),Qi=(0,HL.default)("socket.io:namespace");on.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);var rd=class extends FL.StrictEventEmitter{constructor(e,t){super(),this.sockets=new Map,this._preConnectSockets=new Map,this._fns=[],this._ids=0,this.server=e,this.name=t,this._initAdapter()}_initAdapter(){this.adapter=new(this.server.adapter())(this),Promise.resolve(this.adapter.init()).catch(e=>{Qi("error while initializing adapter: %s",e)})}use(e){return this._fns.push(e),this}run(e,t){if(!this._fns.length)return t();let n=this._fns.slice(0);function i(s){n[s](e,o=>{if(o)return t(o);if(!n[s+1])return t();i(s+1)})}i(0)}to(e){return new Yt.BroadcastOperator(this.adapter).to(e)}in(e){return new Yt.BroadcastOperator(this.adapter).in(e)}except(e){return new Yt.BroadcastOperator(this.adapter).except(e)}async _add(e,t,n){var i;Qi("adding socket to nsp %s",this.name);let s=await this._createSocket(e,t);if(this._preConnectSockets.set(s.id,s),!((i=this.server.opts.connectionStateRecovery)===null||i===void 0)&&i.skipMiddlewares&&s.recovered&&e.conn.readyState==="open")return this._doConnect(s,n);this.run(s,o=>{process.nextTick(()=>{if(e.conn.readyState!=="open"){Qi("next called after client was closed - ignoring socket"),s._cleanup();return}if(o)return Qi("middleware error, sending CONNECT_ERROR packet to the client"),s._cleanup(),e.conn.protocol===3?s._error(o.data||o.message):s._error({message:o.message,data:o.data});this._doConnect(s,n)})})}async _createSocket(e,t){let n=t.pid,i=t.offset;if(this.server.opts.connectionStateRecovery&&typeof n=="string"&&typeof i=="string"){let s;try{s=await this.adapter.restoreSession(n,i)}catch(o){Qi("error while restoring session: %s",o)}if(s)return Qi("connection state recovered for sid %s",s.sid),new t_.Socket(this,e,t,s)}return new t_.Socket(this,e,t)}_doConnect(e,t){this._preConnectSockets.delete(e.id),this.sockets.set(e.id,e),e._onconnect(),t&&t(e),this.emitReserved("connect",e),this.emitReserved("connection",e)}_remove(e){this.sockets.delete(e.id)||this._preConnectSockets.delete(e.id)}emit(e,...t){return new Yt.BroadcastOperator(this.adapter).emit(e,...t)}send(...e){return this.emit("message",...e),this}write(...e){return this.emit("message",...e),this}serverSideEmit(e,...t){if(on.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);return t.unshift(e),this.adapter.serverSideEmit(t),!0}serverSideEmitWithAck(e,...t){return new Promise((n,i)=>{t.push((s,o)=>s?(s.responses=o,i(s)):n(o)),this.serverSideEmit(e,...t)})}_onServerSideEmit(e){super.emitUntyped.apply(this,e)}allSockets(){return new Yt.BroadcastOperator(this.adapter).allSockets()}compress(e){return new Yt.BroadcastOperator(this.adapter).compress(e)}get volatile(){return new Yt.BroadcastOperator(this.adapter).volatile}get local(){return new Yt.BroadcastOperator(this.adapter).local}timeout(e){return new Yt.BroadcastOperator(this.adapter).timeout(e)}fetchSockets(){return new Yt.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(e){return new Yt.BroadcastOperator(this.adapter).socketsJoin(e)}socketsLeave(e){return new Yt.BroadcastOperator(this.adapter).socketsLeave(e)}disconnectSockets(e=!1){return new Yt.BroadcastOperator(this.adapter).disconnectSockets(e)}};on.Namespace=rd});var o_=O(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.encode=id;mo.decode=$L;mo.yeast=qL;var i_="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Mc=64,s_={},r_=0,Ln=0,n_;function id(r){let e="";do e=i_[r%Mc]+e,r=Math.floor(r/Mc);while(r>0);return e}function $L(r){let e=0;for(Ln=0;Ln<r.length;Ln++)e=e*Mc+s_[r.charAt(Ln)];return e}function qL(){let r=id(+new Date);return r!==n_?(r_=0,n_=r):r+"."+id(r_++)}for(;Ln<Mc;Ln++)s_[i_[Ln]]=Ln});var an=O((tW,l_)=>{"use strict";var a_=["nodebuffer","arraybuffer","fragments"],c_=typeof Blob<"u";c_&&a_.push("blob");l_.exports={BINARY_TYPES:a_,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:c_,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var go=O((rW,Ic)=>{"use strict";var{EMPTY_BUFFER:UL}=an(),sd=Buffer[Symbol.species];function WL(r,e){if(r.length===0)return UL;if(r.length===1)return r[0];let t=Buffer.allocUnsafe(e),n=0;for(let i=0;i<r.length;i++){let s=r[i];t.set(s,n),n+=s.length}return n<e?new sd(t.buffer,t.byteOffset,n):t}function u_(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function p_(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function GL(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function od(r){if(od.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new sd(r):ArrayBuffer.isView(r)?e=new sd(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),od.readOnly=!1),e}Ic.exports={concat:WL,mask:u_,toArrayBuffer:GL,toBuffer:od,unmask:p_};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=uf();Ic.exports.mask=function(e,t,n,i,s){s<48?u_(e,t,n,i,s):r.mask(e,t,n,i,s)},Ic.exports.unmask=function(e,t){e.length<32?p_(e,t):r.unmask(e,t)}}catch{}});var h_=O((nW,d_)=>{"use strict";var f_=Symbol("kDone"),ad=Symbol("kRun"),cd=class{constructor(e){this[f_]=()=>{this.pending--,this[ad]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[ad]()}[ad](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[f_])}}};d_.exports=cd});var xo=O((iW,x_)=>{"use strict";var vo=require("zlib"),m_=go(),zL=h_(),{kStatusCode:g_}=an(),KL=Buffer[Symbol.species],VL=Buffer.from([0,0,255,255]),Lc=Symbol("permessage-deflate"),cn=Symbol("total-length"),Zi=Symbol("callback"),Dn=Symbol("buffers"),es=Symbol("error"),Nc,ld=class{constructor(e,t,n){if(this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!Nc){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Nc=new zL(i)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[Zi];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,n=e.find(i=>!(t.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>i.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof t.serverMaxWindowBits=="number"&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach(t=>{Object.keys(t).forEach(n=>{let i=t[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);t[n]=i})}),e}decompress(e,t,n){Nc.add(i=>{this._decompress(e,t,(s,o)=>{i(),n(s,o)})})}compress(e,t,n){Nc.add(i=>{this._compress(e,t,(s,o)=>{i(),n(s,o)})})}_decompress(e,t,n){let i=this._isServer?"client":"server";if(!this._inflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?vo.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=vo.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[Lc]=this,this._inflate[cn]=0,this._inflate[Dn]=[],this._inflate.on("error",XL),this._inflate.on("data",v_)}this._inflate[Zi]=n,this._inflate.write(e),t&&this._inflate.write(VL),this._inflate.flush(()=>{let s=this._inflate[es];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=m_.concat(this._inflate[Dn],this._inflate[cn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[cn]=0,this._inflate[Dn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(e,t,n){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?vo.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=vo.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[cn]=0,this._deflate[Dn]=[],this._deflate.on("data",YL)}this._deflate[Zi]=n,this._deflate.write(e),this._deflate.flush(vo.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=m_.concat(this._deflate[Dn],this._deflate[cn]);t&&(s=new KL(s.buffer,s.byteOffset,s.length-4)),this._deflate[Zi]=null,this._deflate[cn]=0,this._deflate[Dn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};x_.exports=ld;function YL(r){this[Dn].push(r),this[cn]+=r.length}function v_(r){if(this[cn]+=r.length,this[Lc]._maxPayload<1||this[cn]<=this[Lc]._maxPayload){this[Dn].push(r);return}this[es]=new RangeError("Max payload size exceeded"),this[es].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[es][g_]=1009,this.removeListener("data",v_),this.reset()}function XL(r){if(this[Lc]._inflate=null,this[es]){this[Zi](this[es]);return}r[g_]=1007,this[Zi](r)}});var ts=O((sW,Dc)=>{"use strict";var{isUtf8:y_}=require("buffer"),{hasBlob:JL}=an(),QL=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function ZL(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function ud(r){let e=r.length,t=0;for(;t<e;)if((r[t]&128)===0)t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}function eD(r){return JL&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}Dc.exports={isBlob:eD,isValidStatusCode:ZL,isValidUTF8:ud,tokenChars:QL};if(y_)Dc.exports.isValidUTF8=function(r){return r.length<24?ud(r):y_(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=vf();Dc.exports.isValidUTF8=function(e){return e.length<32?ud(e):r(e)}}catch{}});var md=O((oW,C_)=>{"use strict";var{Writable:tD}=require("stream"),__=xo(),{BINARY_TYPES:rD,EMPTY_BUFFER:b_,kStatusCode:nD,kWebSocket:iD}=an(),{concat:pd,toArrayBuffer:sD,unmask:oD}=go(),{isValidStatusCode:aD,isValidUTF8:w_}=ts(),Bc=Buffer[Symbol.species],cr=0,S_=1,E_=2,T_=3,fd=4,dd=5,jc=6,hd=class extends tD{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||rD[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[iD]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=cr}_write(e,t,n){if(this._opcode===8&&this._state==cr)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new Bc(n.buffer,n.byteOffset+e,n.length-e),new Bc(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],i=t.length-e;e>=n.length?t.set(this._buffers.shift(),i):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),i),this._buffers[0]=new Bc(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case cr:this.getInfo(e);break;case S_:this.getPayloadLength16(e);break;case E_:this.getPayloadLength64(e);break;case T_:this.getMask();break;case fd:this.getData(e);break;case dd:case jc:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let n=(t[0]&64)===64;if(n&&!this._extensions[__.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=S_:this._payloadLength===127?this._state=E_:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);if(n>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(i);return}this._payloadLength=n*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}this._masked?this._state=T_:this._state=fd}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=fd}getData(e){let t=b_;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&oD(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=dd,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[__.extensionName].decompress(e,this._fin,(i,s)=>{if(i)return t(i);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._fragments.push(s)}this.dataMessage(t),this._state===cr&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=cr;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=pd(n,t):this._binaryType==="arraybuffer"?i=sD(pd(n,t)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=cr):(this._state=jc,setImmediate(()=>{this.emit("message",i,!0),this._state=cr,this.startLoop(e)}))}else{let i=pd(n,t);if(!this._skipUTF8Validation&&!w_(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===dd||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=cr):(this._state=jc,setImmediate(()=>{this.emit("message",i,!1),this._state=cr,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,b_),this.end();else{let n=e.readUInt16BE(0);if(!aD(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new Bc(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!w_(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=cr;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=cr):(this._state=jc,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=cr,this.startLoop(t)}))}createError(e,t,n,i,s){this._loop=!1,this._errored=!0;let o=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=s,o[nD]=i,o}};C_.exports=hd});var xd=O((cW,k_)=>{"use strict";var{Duplex:aW}=require("stream"),{randomFillSync:cD}=require("crypto"),A_=xo(),{EMPTY_BUFFER:lD,kWebSocket:uD,NOOP:pD}=an(),{isBlob:rs,isValidStatusCode:fD}=ts(),{mask:R_,toBuffer:ri}=go(),lr=Symbol("kByteLength"),dD=Buffer.alloc(4),Fc=8*1024,ni,ns=Fc,Tr=0,hD=1,mD=2,gd=class r{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Tr,this.onerror=pD,this[uD]=void 0}static frame(e,t){let n,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||dD,t.generateMask?t.generateMask(n):(ns===Fc&&(ni===void 0&&(ni=Buffer.alloc(Fc)),cD(ni,0,Fc),ns=0),n[0]=ni[ns++],n[1]=ni[ns++],n[2]=ni[ns++],n[3]=ni[ns++]),o=(n[0]|n[1]|n[2]|n[3])===0,s=6);let a;typeof e=="string"?(!t.mask||o)&&t[lr]!==void 0?a=t[lr]:(e=Buffer.from(e),a=e.length):(a=e.length,i=t.mask&&t.readOnly&&!o);let c=a;a>=65536?(s+=8,c=127):a>125&&(s+=2,c=126);let u=Buffer.allocUnsafe(i?a+s:s);return u[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),t.mask?(u[1]|=128,u[s-4]=n[0],u[s-3]=n[1],u[s-2]=n[2],u[s-1]=n[3],o?[u,e]:i?(R_(e,n,u,s,a),[u]):(R_(e,n,e,0,a),[u,e])):[u,e]}close(e,t,n,i){let s;if(e===void 0)s=lD;else{if(typeof e!="number"||!fD(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+a),s.writeUInt16BE(e,0),typeof t=="string"?s.write(t,2):s.set(t,2)}}let o={[lr]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Tr?this.enqueue([this.dispatch,s,!1,o,i]):this.sendFrame(r.frame(s,o),i)}ping(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):rs(e)?(i=e.size,s=!1):(e=ri(e),i=e.length,s=ri.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[lr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};rs(e)?this._state!==Tr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Tr?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}pong(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):rs(e)?(i=e.size,s=!1):(e=ri(e),i=e.length,s=ri.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[lr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};rs(e)?this._state!==Tr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Tr?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}send(e,t,n){let i=this._extensions[A_.extensionName],s=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):rs(e)?(a=e.size,c=!1):(e=ri(e),a=e.length,c=ri.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=i._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0);let u={[lr]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};rs(e)?this._state!==Tr?this.enqueue([this.getBlobData,e,this._compress,u,n]):this.getBlobData(e,this._compress,u,n):this._state!==Tr?this.enqueue([this.dispatch,e,this._compress,u,n]):this.dispatch(e,this._compress,u,n)}getBlobData(e,t,n,i){this._bufferedBytes+=n[lr],this._state=mD,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(vd,this,a,i);return}this._bufferedBytes-=n[lr];let o=ri(s);t?this.dispatch(o,t,n,i):(this._state=Tr,this.sendFrame(r.frame(o,n),i),this.dequeue())}).catch(s=>{process.nextTick(gD,this,s,i)})}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let s=this._extensions[A_.extensionName];this._bufferedBytes+=n[lr],this._state=hD,s.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");vd(this,c,i);return}this._bufferedBytes-=n[lr],this._state=Tr,n.readOnly=!1,this.sendFrame(r.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===Tr&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][lr],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][lr],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};k_.exports=gd;function vd(r,e,t){typeof t=="function"&&t(e);for(let n=0;n<r._queue.length;n++){let i=r._queue[n],s=i[i.length-1];typeof s=="function"&&s(e)}}function gD(r,e,t){vd(r,e,t),r.onerror(e)}});var j_=O((lW,B_)=>{"use strict";var{kForOnEventAttribute:yo,kListener:yd}=an(),O_=Symbol("kCode"),P_=Symbol("kData"),M_=Symbol("kError"),I_=Symbol("kMessage"),N_=Symbol("kReason"),is=Symbol("kTarget"),L_=Symbol("kType"),D_=Symbol("kWasClean"),ln=class{constructor(e){this[is]=null,this[L_]=e}get target(){return this[is]}get type(){return this[L_]}};Object.defineProperty(ln.prototype,"target",{enumerable:!0});Object.defineProperty(ln.prototype,"type",{enumerable:!0});var ii=class extends ln{constructor(e,t={}){super(e),this[O_]=t.code===void 0?0:t.code,this[N_]=t.reason===void 0?"":t.reason,this[D_]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[O_]}get reason(){return this[N_]}get wasClean(){return this[D_]}};Object.defineProperty(ii.prototype,"code",{enumerable:!0});Object.defineProperty(ii.prototype,"reason",{enumerable:!0});Object.defineProperty(ii.prototype,"wasClean",{enumerable:!0});var ss=class extends ln{constructor(e,t={}){super(e),this[M_]=t.error===void 0?null:t.error,this[I_]=t.message===void 0?"":t.message}get error(){return this[M_]}get message(){return this[I_]}};Object.defineProperty(ss.prototype,"error",{enumerable:!0});Object.defineProperty(ss.prototype,"message",{enumerable:!0});var _o=class extends ln{constructor(e,t={}){super(e),this[P_]=t.data===void 0?null:t.data}get data(){return this[P_]}};Object.defineProperty(_o.prototype,"data",{enumerable:!0});var vD={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[yo]&&i[yd]===e&&!i[yo])return;let n;if(r==="message")n=function(s,o){let a=new _o("message",{data:o?s:s.toString()});a[is]=this,Hc(e,this,a)};else if(r==="close")n=function(s,o){let a=new ii("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[is]=this,Hc(e,this,a)};else if(r==="error")n=function(s){let o=new ss("error",{error:s,message:s.message});o[is]=this,Hc(e,this,o)};else if(r==="open")n=function(){let s=new ln("open");s[is]=this,Hc(e,this,s)};else return;n[yo]=!!t[yo],n[yd]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[yd]===e&&!t[yo]){this.removeListener(r,t);break}}};B_.exports={CloseEvent:ii,ErrorEvent:ss,Event:ln,EventTarget:vD,MessageEvent:_o};function Hc(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var _d=O((uW,F_)=>{"use strict";var{tokenChars:bo}=ts();function Br(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function xD(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,u=-1,p=-1,f=0;for(;f<r.length;f++)if(u=r.charCodeAt(f),o===void 0)if(p===-1&&bo[u]===1)c===-1&&(c=f);else if(f!==0&&(u===32||u===9))p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);u===44?(Br(e,y,t),t=Object.create(null)):o=y,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(p===-1&&bo[u]===1)c===-1&&(c=f);else if(u===32||u===9)p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f),Br(t,r.slice(c,p),!0),u===44&&(Br(e,o,t),t=Object.create(null),o=void 0),c=p=-1}else if(u===61&&c!==-1&&p===-1)a=r.slice(c,f),c=p=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(bo[u]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),i=!1}else if(s)if(bo[u]===1)c===-1&&(c=f);else if(u===34&&c!==-1)s=!1,p=f;else if(u===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(u===34&&r.charCodeAt(f-1)===61)s=!0;else if(p===-1&&bo[u]===1)c===-1&&(c=f);else if(c!==-1&&(u===32||u===9))p===-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);n&&(y=y.replace(/\\/g,""),n=!1),Br(t,a,y),u===44&&(Br(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||s||u===32||u===9)throw new SyntaxError("Unexpected end of input");p===-1&&(p=f);let m=r.slice(c,p);return o===void 0?Br(e,m,t):(a===void 0?Br(t,m,!0):n?Br(t,a,m.replace(/\\/g,"")):Br(t,a,m),Br(e,o,t)),e}function yD(r){return Object.keys(r).map(e=>{let t=r[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(i=>{let s=n[i];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}F_.exports={format:yD,parse:xD}});var Wc=O((dW,J_)=>{"use strict";var _D=require("events"),bD=require("https"),wD=require("http"),q_=require("net"),SD=require("tls"),{randomBytes:ED,createHash:TD}=require("crypto"),{Duplex:pW,Readable:fW}=require("stream"),{URL:bd}=require("url"),Bn=xo(),CD=md(),AD=xd(),{isBlob:RD}=ts(),{BINARY_TYPES:H_,EMPTY_BUFFER:$c,GUID:kD,kForOnEventAttribute:wd,kListener:OD,kStatusCode:PD,kWebSocket:pt,NOOP:U_}=an(),{EventTarget:{addEventListener:MD,removeEventListener:ID}}=j_(),{format:ND,parse:LD}=_d(),{toBuffer:DD}=go(),BD=30*1e3,W_=Symbol("kAborted"),Sd=[8,13],un=["CONNECTING","OPEN","CLOSING","CLOSED"],jD=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,we=class r extends _D{constructor(e,t,n){super(),this._binaryType=H_[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=$c,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(n=t,t=[]):t=[t]),G_(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){H_.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,n){let i=new CD({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new AD(e,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=e,i[pt]=this,s[pt]=this,e[pt]=this,i.on("conclude",$D),i.on("drain",qD),i.on("error",UD),i.on("message",WD),i.on("ping",GD),i.on("pong",zD),s.onerror=KD,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",V_),e.on("data",Uc),e.on("end",Y_),e.on("error",X_),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Bn.extensionName]&&this._extensions[Bn.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Xt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),K_(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Ed(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||$c,t,n)}pong(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Ed(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||$c,t,n)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(n=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Ed(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[Bn.extensionName]||(i.compress=!1),this._sender.send(e||$c,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Xt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(we,"CONNECTING",{enumerable:!0,value:un.indexOf("CONNECTING")});Object.defineProperty(we.prototype,"CONNECTING",{enumerable:!0,value:un.indexOf("CONNECTING")});Object.defineProperty(we,"OPEN",{enumerable:!0,value:un.indexOf("OPEN")});Object.defineProperty(we.prototype,"OPEN",{enumerable:!0,value:un.indexOf("OPEN")});Object.defineProperty(we,"CLOSING",{enumerable:!0,value:un.indexOf("CLOSING")});Object.defineProperty(we.prototype,"CLOSING",{enumerable:!0,value:un.indexOf("CLOSING")});Object.defineProperty(we,"CLOSED",{enumerable:!0,value:un.indexOf("CLOSED")});Object.defineProperty(we.prototype,"CLOSED",{enumerable:!0,value:un.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(we.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(we.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[wd])return e[OD];return null},set(e){for(let t of this.listeners(r))if(t[wd]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[wd]:!0})}})});we.prototype.addEventListener=MD;we.prototype.removeEventListener=ID;J_.exports=we;function G_(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Sd[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=i.autoPong,!Sd.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Sd.join(", ")})`);let s;if(e instanceof bd)s=e;else try{s=new bd(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),r._url=s.href;let o=s.protocol==="wss:",a=s.protocol==="ws+unix:",c;if(s.protocol!=="ws:"&&!o&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"),c){let S=new SyntaxError(c);if(r._redirects===0)throw S;qc(r,S);return}let u=o?443:80,p=ED(16).toString("base64"),f=o?bD.request:wD.request,m=new Set,y;if(i.createConnection=i.createConnection||(o?HD:FD),i.defaultPort=i.defaultPort||u,i.port=s.port||u,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":p,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(y=new Bn(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=ND({[Bn.extensionName]:y.offer()})),t.length){for(let S of t){if(typeof S!="string"||!jD.test(S)||m.has(S))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.add(S)}i.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(s.username||s.password)&&(i.auth=`${s.username}:${s.password}`),a){let S=i.path.split(":");i.socketPath=S[0],i.path=S[1]}let _;if(i.followRedirects){if(r._redirects===0){r._originalIpc=a,r._originalSecure=o,r._originalHostOrSocketPath=a?i.socketPath:s.host;let S=n&&n.headers;if(n={...n,headers:{}},S)for(let[A,P]of Object.entries(S))n.headers[A.toLowerCase()]=P}else if(r.listenerCount("redirect")===0){let S=a?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:s.host===r._originalHostOrSocketPath;(!S||r._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,S||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),_=r._req=f(i),r._redirects&&r.emit("redirect",r.url,_)}else _=r._req=f(i);i.timeout&&_.on("timeout",()=>{Xt(r,_,"Opening handshake has timed out")}),_.on("error",S=>{_===null||_[W_]||(_=r._req=null,qc(r,S))}),_.on("response",S=>{let A=S.headers.location,P=S.statusCode;if(A&&i.followRedirects&&P>=300&&P<400){if(++r._redirects>i.maxRedirects){Xt(r,_,"Maximum redirects exceeded");return}_.abort();let L;try{L=new bd(A,e)}catch{let H=new SyntaxError(`Invalid URL: ${A}`);qc(r,H);return}G_(r,L,t,n)}else r.emit("unexpected-response",_,S)||Xt(r,_,`Unexpected server response: ${S.statusCode}`)}),_.on("upgrade",(S,A,P)=>{if(r.emit("upgrade",S),r.readyState!==we.CONNECTING)return;_=r._req=null;let L=S.headers.upgrade;if(L===void 0||L.toLowerCase()!=="websocket"){Xt(r,A,"Invalid Upgrade header");return}let N=TD("sha1").update(p+kD).digest("base64");if(S.headers["sec-websocket-accept"]!==N){Xt(r,A,"Invalid Sec-WebSocket-Accept header");return}let H=S.headers["sec-websocket-protocol"],W;if(H!==void 0?m.size?m.has(H)||(W="Server sent an invalid subprotocol"):W="Server sent a subprotocol but none was requested":m.size&&(W="Server sent no subprotocol"),W){Xt(r,A,W);return}H&&(r._protocol=H);let U=S.headers["sec-websocket-extensions"];if(U!==void 0){if(!y){Xt(r,A,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let G;try{G=LD(U)}catch{Xt(r,A,"Invalid Sec-WebSocket-Extensions header");return}let M=Object.keys(G);if(M.length!==1||M[0]!==Bn.extensionName){Xt(r,A,"Server indicated an extension that was not requested");return}try{y.accept(G[Bn.extensionName])}catch{Xt(r,A,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[Bn.extensionName]=y}r.setSocket(A,P,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(_,r):_.end()}function qc(r,e){r._readyState=we.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function FD(r){return r.path=r.socketPath,q_.connect(r)}function HD(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=q_.isIP(r.host)?"":r.host),SD.connect(r)}function Xt(r,e,t){r._readyState=we.CLOSING;let n=new Error(t);Error.captureStackTrace(n,Xt),e.setHeader?(e[W_]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(qc,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Ed(r,e,t){if(e){let n=RD(e)?e.size:DD(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${un[r.readyState]})`);process.nextTick(t,n)}}function $D(r,e){let t=this[pt];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[pt]!==void 0&&(t._socket.removeListener("data",Uc),process.nextTick(z_,t._socket),r===1005?t.close():t.close(r,e))}function qD(){let r=this[pt];r.isPaused||r._socket.resume()}function UD(r){let e=this[pt];e._socket[pt]!==void 0&&(e._socket.removeListener("data",Uc),process.nextTick(z_,e._socket),e.close(r[PD])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function $_(){this[pt].emitClose()}function WD(r,e){this[pt].emit("message",r,e)}function GD(r){let e=this[pt];e._autoPong&&e.pong(r,!this._isServer,U_),e.emit("ping",r)}function zD(r){this[pt].emit("pong",r)}function z_(r){r.resume()}function KD(r){let e=this[pt];e.readyState!==we.CLOSED&&(e.readyState===we.OPEN&&(e._readyState=we.CLOSING,K_(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function K_(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),BD)}function V_(){let r=this[pt];this.removeListener("close",V_),this.removeListener("data",Uc),this.removeListener("end",Y_),r._readyState=we.CLOSING;let e;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(e=r._socket.read())!==null&&r._receiver.write(e),r._receiver.end(),this[pt]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",$_),r._receiver.on("finish",$_))}function Uc(r){this[pt]._receiver.write(r)||this.pause()}function Y_(){let r=this[pt];r._readyState=we.CLOSING,r._receiver.end(),this.end()}function X_(){let r=this[pt];this.removeListener("error",X_),this.on("error",U_),r&&(r._readyState=we.CLOSING,this.destroy())}});var tb=O((mW,eb)=>{"use strict";var hW=Wc(),{Duplex:VD}=require("stream");function Q_(r){r.emit("close")}function YD(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Z_(r){this.removeListener("error",Z_),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function XD(r,e){let t=!0,n=new VD({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(s,o){let a=!o&&n._readableState.objectMode?s.toString():s;n.push(a)||r.pause()}),r.once("error",function(s){n.destroyed||(t=!1,n.destroy(s))}),r.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,s){if(r.readyState===r.CLOSED){s(i),process.nextTick(Q_,n);return}let o=!1;r.once("error",function(c){o=!0,s(c)}),r.once("close",function(){o||s(i),process.nextTick(Q_,n)}),t&&r.terminate()},n._final=function(i){if(r.readyState===r.CONNECTING){r.once("open",function(){n._final(i)});return}r._socket!==null&&(r._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(r._socket.once("finish",function(){i()}),r.close()))},n._read=function(){r.isPaused&&r.resume()},n._write=function(i,s,o){if(r.readyState===r.CONNECTING){r.once("open",function(){n._write(i,s,o)});return}r.send(i,o)},n.on("end",YD),n.on("error",Z_),n}eb.exports=XD});var nb=O((gW,rb)=>{"use strict";var{tokenChars:JD}=ts();function QD(r){let e=new Set,t=-1,n=-1,i=0;for(i;i<r.length;i++){let o=r.charCodeAt(i);if(n===-1&&JD[o]===1)t===-1&&(t=i);else if(i!==0&&(o===32||o===9))n===-1&&t!==-1&&(n=i);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=r.slice(t,n);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),t=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=r.slice(t,i);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}rb.exports={parse:QD}});var ub=O((xW,lb)=>{"use strict";var ZD=require("events"),Gc=require("http"),{Duplex:vW}=require("stream"),{createHash:e2}=require("crypto"),ib=_d(),si=xo(),t2=nb(),r2=Wc(),{GUID:n2,kWebSocket:i2}=an(),s2=/^[+/0-9A-Za-z]{22}==$/,sb=0,ob=1,cb=2,Td=class extends ZD{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:r2,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=Gc.createServer((n,i)=>{let s=Gc.STATUS_CODES[426];i.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),i.end(s)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=o2(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,s,o)=>{this.handleUpgrade(i,s,o,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=sb}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===cb){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(wo,this);return}if(e&&this.once("close",e),this._state!==ob)if(this._state=ob,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(wo,this):process.nextTick(wo,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{wo(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,i){t.on("error",ab);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){oi(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){oi(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!s2.test(s)){oi(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){oi(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){So(t,400);return}let c=e.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=t2.parse(c)}catch{oi(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let p=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&p!==void 0){let m=new si(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let y=ib.parse(p);y[si.extensionName]&&(m.accept(y[si.extensionName]),f[si.extensionName]=m)}catch{oi(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(m,(y,_,S,A)=>{if(!y)return So(t,_||401,S,A);this.completeUpgrade(f,s,u,e,t,n,i)});return}if(!this.options.verifyClient(m))return So(t,401)}this.completeUpgrade(f,s,u,e,t,n,i)}completeUpgrade(e,t,n,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[i2])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>sb)return So(s,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${e2("sha1").update(t+n2).digest("base64")}`],p=new this.options.WebSocket(null,void 0,this.options);if(n.size){let f=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;f&&(u.push(`Sec-WebSocket-Protocol: ${f}`),p._protocol=f)}if(e[si.extensionName]){let f=e[si.extensionName].params,m=ib.format({[si.extensionName]:[f]});u.push(`Sec-WebSocket-Extensions: ${m}`),p._extensions=e}this.emit("headers",u,i),s.write(u.concat(`\r
23
+ `+n)}r.destroy()}var fo=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];function tL(r){if(r+="",r.length<1)return!1;if(!fo[r.charCodeAt(0)])return ne('invalid header, index 0, char "%s"',r.charCodeAt(0)),!0;if(r.length<2)return!1;if(!fo[r.charCodeAt(1)])return ne('invalid header, index 1, char "%s"',r.charCodeAt(1)),!0;if(r.length<3)return!1;if(!fo[r.charCodeAt(2)])return ne('invalid header, index 2, char "%s"',r.charCodeAt(2)),!0;if(r.length<4)return!1;if(!fo[r.charCodeAt(3)])return ne('invalid header, index 3, char "%s"',r.charCodeAt(3)),!0;for(let e=4;e<r.length;++e)if(!fo[r.charCodeAt(e)])return ne('invalid header, index "%i", char "%s"',e,r.charCodeAt(e)),!0;return!1}});var L0=O(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.Polling=void 0;var rL=Jn(),N0=require("zlib"),nL=$a(),iL=Ae(),or=(0,iL.default)("engine:polling"),sL={gzip:N0.createGzip,deflate:N0.createDeflate},Ff=class extends rL.Transport{constructor(e){super(e),this.closeTimeout=30*1e3}get name(){return"polling"}onRequest(e){let t=e.res;e.res=null,e.getMethod()==="get"?this.onPollRequest(e,t):e.getMethod()==="post"?this.onDataRequest(e,t):(t.writeStatus("500 Internal Server Error"),t.end())}onPollRequest(e,t){if(this.req){or("request overlap"),this.onError("overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}or("setting request"),this.req=e,this.res=t;let n=()=>{this.writable=!1,this.onError("poll connection closed prematurely")},i=()=>{this.req=this.res=null};e.cleanup=i,t.onAborted(n),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose&&(or("triggering empty send to append close packet"),this.send([{type:"noop"}]))}onDataRequest(e,t){if(this.dataReq){this.onError("data request overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}let n=Number(e.headers["content-length"]);if(!n){this.onError("content-length header required"),t.writeStatus("411 Length Required").end();return}if(n>this.maxHttpBufferSize){this.onError("payload too large"),t.writeStatus("413 Payload Too Large").end();return}if(e.headers["content-type"]==="application/octet-stream"&&this.protocol===4)return this.onError("invalid content");this.dataReq=e,this.dataRes=t;let s,o=0,a={"Content-Type":"text/html"};this.headers(e,a);for(let u in a)t.writeHeader(u,String(a[u]));let c=u=>{this.onData(u.toString()),this.onDataRequestCleanup(),t.cork(()=>{t.end("ok")})};t.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),t.onData((u,p)=>{let f=o+u.byteLength;if(f>n){this.onError("content-length mismatch"),t.close();return}if(!s){if(p){c(Buffer.from(u));return}s=Buffer.allocUnsafe(n)}if(Buffer.from(u).copy(s,o),p){if(f!=n){this.onError("content-length mismatch"),t.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}c(s);return}o=f})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(e){or('received "%s"',e);let t=n=>{if(n.type==="close")return or("got xhr close packet"),this.onClose(),!1;this.onPacket(n)};this.protocol===3?this.parser.decodePayload(e,t):this.parser.decodePayload(e).forEach(t)}onClose(){this.writable&&this.send([{type:"noop"}]),super.onClose()}send(e){this.writable=!1,this.shouldClose&&(or("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=n=>{let i=e.some(s=>s.options&&s.options.compress);this.write(n,{compress:i})};this.protocol===3?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){or('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,n){let i=typeof e=="string",o={"Content-Type":i?"text/plain; charset=UTF-8":"application/octet-stream"},a=p=>{this.headers(this.req,o),this.res.cork(()=>{Object.keys(o).forEach(f=>{this.res.writeHeader(f,String(o[f]))}),this.res.end(p)}),n()};if(!this.httpCompression||!t.compress){a(e);return}if((i?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let u=nL(this.req).encodings(["gzip","deflate"]);if(!u){a(e);return}this.compress(e,u,(p,f)=>{if(p){this.res.writeStatus("500 Internal Server Error"),this.res.end(),n(p);return}o["Content-Encoding"]=u,a(f)})}compress(e,t,n){or("compressing");let i=[],s=0;sL[t](this.httpCompression).on("error",n).on("data",function(o){i.push(o),s+=o.length}).on("end",function(){n(null,Buffer.concat(i,s))}).end(e)}doClose(e){or("closing");let t,n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(or("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(or("transport discarded - closing right away"),n()):(or("transport not writable - buffering orderly close"),this.shouldClose=n,t=setTimeout(n,this.closeTimeout))}headers(e,t){t=t||{};let n=e.headers["user-agent"];return n&&(~n.indexOf(";MSIE")||~n.indexOf("Trident/"))&&(t["X-XSS-Protection"]="0"),t["cache-control"]="no-store",this.emit("headers",t,e),t}};_c.Polling=Ff});var B0=O(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.WebSocket=void 0;var oL=Jn(),aL=Ae(),D0=(0,aL.default)("engine:ws"),Hf=class extends oL.Transport{constructor(e){super(e),this.writable=!1,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],i=t+1===e.length,s=o=>{let a=typeof o!="string",c=this.perMessageDeflate&&Buffer.byteLength(o)>this.perMessageDeflate.threshold;D0('writing "%s"',o),this.socket.send(o,a,c),i&&(this.emit("drain"),this.writable=!0,this.emit("ready"))};n.options&&typeof n.options.wsPreEncoded=="string"?s(n.options.wsPreEncoded):this.parser.encodePacket(n,this.supportsBinary,s)}}doClose(e){D0("closing"),e&&e(),this.socket.end()}};bc.WebSocket=Hf});var j0=O($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});var cL=L0(),lL=B0();$f.default={polling:cL.Polling,websocket:lL.WebSocket}});var F0=O(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.uServer=void 0;var uL=Ae(),ni=jf(),pL=j0(),Ln=(0,uL.default)("engine:uws"),qf=class extends ni.BaseServer{init(){}cleanup(){}prepare(e,t){e.method=e.getMethod().toUpperCase(),e.url=e.getUrl();let n=new URLSearchParams(e.getQuery());e._query=Object.fromEntries(n.entries()),e.headers={},e.forEach((i,s)=>{e.headers[i]=s}),e.connection={remoteAddress:Buffer.from(t.getRemoteAddressAsText()).toString()},t.onAborted(()=>{Ln("response has been aborted")})}createTransport(e,t){return new pL.default[e](t)}attach(e,t={}){let n=this._computePath(t);e.any(n,this.handleRequest.bind(this)).ws(n,{compression:t.compression,idleTimeout:t.idleTimeout,maxBackpressure:t.maxBackpressure,maxPayloadLength:this.opts.maxHttpBufferSize,upgrade:this.handleUpgrade.bind(this),open:i=>{let s=i.getUserData().transport;s.socket=i,s.writable=!0,s.emit("ready")},message:(i,s,o)=>{i.getUserData().transport.onData(o?s:Buffer.from(s).toString())},close:(i,s,o)=>{i.getUserData().transport.onClose(s,o)}})}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return n();e.res=new Uf(t),super._applyMiddlewares(e,e.res,i=>{e.res.writeHead(),n(i)})}handleRequest(e,t){Ln('handling "%s" http request "%s"',t.getMethod(),t.getUrl()),this.prepare(t,e),t.res=e;let n=(i,s)=>{if(i!==void 0){this.emit("connection_error",{req:t,code:i,message:ni.Server.errorMessages[i],context:s}),this.abortRequest(t.res,i,s);return}if(t._query.sid)Ln("setting new request for existing client"),this.clients[t._query.sid].transport.onRequest(t);else{let o=(a,c)=>this.abortRequest(e,a,c);this.handshake(t._query.transport,t,o)}};this._applyMiddlewares(t,e,i=>{i?n(ni.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,n)})}handleUpgrade(e,t,n){Ln("on upgrade"),this.prepare(t,e),t.res=e;let i=async(s,o)=>{if(s!==void 0){this.emit("connection_error",{req:t,code:s,message:ni.Server.errorMessages[s],context:o}),this.abortRequest(e,s,o);return}let a=t._query.sid,c;if(a){let f=this.clients[a];if(f){if(f.upgrading)return Ln("transport has already been trying to upgrade"),e.close();if(f.upgraded)return Ln("transport had already been upgraded"),e.close();Ln("upgrading existing transport"),c=this.createTransport(t._query.transport,t),f._maybeUpgrade(c)}else return Ln("upgrade attempt for closed client"),e.close()}else if(c=await this.handshake(t._query.transport,t,(f,m)=>this.abortRequest(e,f,m)),!c)return;let u={};!a&&this.emit("initial_headers",u,t),this.emit("headers",u,t),t.res.writeStatus("101 Switching Protocols"),Object.keys(u).forEach(f=>{t.res.writeHeader(f,u[f])}),e.upgrade({transport:c},t.getHeader("sec-websocket-key"),t.getHeader("sec-websocket-protocol"),t.getHeader("sec-websocket-extensions"),n)};this._applyMiddlewares(t,e,s=>{s?i(ni.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,i)})}abortRequest(e,t,n){let i=t===ni.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",s=n&&n.message?n.message:ni.Server.errorMessages[t];e.writeStatus(i),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:s}))}};wc.uServer=qf;var Uf=class{constructor(e){this.res=e,this.statusWritten=!1,this.headers=[],this.isAborted=!1}set statusCode(e){e&&this.writeStatus(e===200?"200 OK":"204 No Content")}writeHead(e){this.statusCode=e}setHeader(e,t){Array.isArray(t)?t.forEach(n=>{this.writeHeader(e,n)}):this.writeHeader(e,t)}removeHeader(){}getHeader(){}writeStatus(e){if(!this.isAborted)return this.res.writeStatus(e),this.statusWritten=!0,this.writeBufferedHeaders(),this}writeHeader(e,t){this.isAborted||e!=="Content-Length"&&(this.statusWritten?this.res.writeHeader(e,t):this.headers.push([e,t]))}writeBufferedHeaders(){this.headers.forEach(([e,t])=>{this.res.writeHeader(e,t)})}end(e){this.isAborted||this.res.cork(()=>{this.statusWritten||this.writeBufferedHeaders(),this.res.end(e)})}onData(e){this.isAborted||this.res.onData(e)}onAborted(e){this.isAborted||this.res.onAborted(()=>{this.isAborted=!0,e()})}cork(e){this.isAborted||this.res.cork(e)}}});var U0=O(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.protocol=pt.Transport=pt.Socket=pt.uServer=pt.parser=pt.transports=pt.Server=void 0;pt.listen=vL;pt.attach=q0;var fL=require("http"),H0=jf();Object.defineProperty(pt,"Server",{enumerable:!0,get:function(){return H0.Server}});var dL=Jp();pt.transports=dL.default;var $0=no();pt.parser=$0;var hL=F0();Object.defineProperty(pt,"uServer",{enumerable:!0,get:function(){return hL.uServer}});var mL=Zp();Object.defineProperty(pt,"Socket",{enumerable:!0,get:function(){return mL.Socket}});var gL=Jn();Object.defineProperty(pt,"Transport",{enumerable:!0,get:function(){return gL.Transport}});pt.protocol=$0.protocol;function vL(r,e,t){typeof e=="function"&&(t=e,e={});let n=(0,fL.createServer)(function(s,o){o.writeHead(501),o.end("Not Implemented")}),i=q0(n,e);return i.httpServer=n,n.listen(r,t),i}function q0(r,e){let t=new H0.Server(e);return t.attach(r,e),t}});var G0=O(W0=>{W0.Emitter=Rt;function Rt(r){if(r)return xL(r)}function xL(r){for(var e in Rt.prototype)r[e]=Rt.prototype[e];return r}Rt.prototype.on=Rt.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};Rt.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};Rt.prototype.off=Rt.prototype.removeListener=Rt.prototype.removeAllListeners=Rt.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var n,i=0;i<t.length;i++)if(n=t[i],n===e||n.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+r],this};Rt.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,i=t.length;n<i;++n)t[n].apply(this,e)}return this};Rt.prototype.emitReserved=Rt.prototype.emit;Rt.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};Rt.prototype.hasListeners=function(r){return!!this.listeners(r).length}});var Wf=O(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.isBinary=K0;Ec.hasBinary=Sc;var yL=typeof ArrayBuffer=="function",_L=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,z0=Object.prototype.toString,bL=typeof Blob=="function"||typeof Blob<"u"&&z0.call(Blob)==="[object BlobConstructor]",wL=typeof File=="function"||typeof File<"u"&&z0.call(File)==="[object FileConstructor]";function K0(r){return yL&&(r instanceof ArrayBuffer||_L(r))||bL&&r instanceof Blob||wL&&r instanceof File}function Sc(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,n=r.length;t<n;t++)if(Sc(r[t]))return!0;return!1}if(K0(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return Sc(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&Sc(r[t]))return!0;return!1}});var V0=O(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.deconstructPacket=EL;Tc.reconstructPacket=TL;var SL=Wf();function EL(r){let e=[],t=r.data,n=r;return n.data=Gf(t,e),n.attachments=e.length,{packet:n,buffers:e}}function Gf(r,e){if(!r)return r;if((0,SL.isBinary)(r)){let t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Array.isArray(r)){let t=new Array(r.length);for(let n=0;n<r.length;n++)t[n]=Gf(r[n],e);return t}else if(typeof r=="object"&&!(r instanceof Date)){let t={};for(let n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=Gf(r[n],e));return t}return r}function TL(r,e){return r.data=zf(r.data,e),delete r.attachments,r}function zf(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=zf(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=zf(r[t],e));return r}});var ho=O(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.Decoder=Sr.Encoder=Sr.PacketType=Sr.protocol=void 0;Sr.isPacketValid=PL;var CL=G0(),Y0=V0(),X0=Wf(),AL=Ae(),Kf=(0,AL.default)("socket.io-parser"),J0=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];Sr.protocol=5;var ue;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(ue||(Sr.PacketType=ue={}));var Vf=class{constructor(e){this.replacer=e}encode(e){return Kf("encoding packet %j",e),(e.type===ue.EVENT||e.type===ue.ACK)&&(0,X0.hasBinary)(e)?this.encodeAsBinary({type:e.type===ue.EVENT?ue.BINARY_EVENT:ue.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===ue.BINARY_EVENT||e.type===ue.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),Kf("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,Y0.deconstructPacket)(e),n=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(n),i}};Sr.Encoder=Vf;var Yf=class r extends CL.Emitter{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let n=t.type===ue.BINARY_EVENT;n||t.type===ue.BINARY_ACK?(t.type=n?ue.EVENT:ue.ACK,this.reconstructor=new Xf(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,X0.isBinary)(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,n={type:Number(e.charAt(0))};if(ue[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===ue.BINARY_EVENT||n.type===ue.BINARY_ACK){let s=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(s,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");let a=Number(o);if(!Q0(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");n.attachments=a}if(e.charAt(t+1)==="/"){let s=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(s,t)}else n.nsp="/";let i=e.charAt(t+1);if(i!==""&&Number(i)==i){let s=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}n.id=Number(e.substring(s,t+1))}if(e.charAt(++t)){let s=this.tryParse(e.substr(t));if(r.isPayloadValid(n.type,s))n.data=s;else throw new Error("invalid payload")}return Kf("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case ue.CONNECT:return Cc(t);case ue.DISCONNECT:return t===void 0;case ue.CONNECT_ERROR:return typeof t=="string"||Cc(t);case ue.EVENT:case ue.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&J0.indexOf(t[0])===-1);case ue.ACK:case ue.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};Sr.Decoder=Yf;var Xf=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=(0,Y0.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function RL(r){return typeof r=="string"}var Q0=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function kL(r){return r===void 0||Q0(r)}function Cc(r){return Object.prototype.toString.call(r)==="[object Object]"}function OL(r,e){switch(r){case ue.CONNECT:return e===void 0||Cc(e);case ue.DISCONNECT:return e===void 0;case ue.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&J0.indexOf(e[0])===-1);case ue.ACK:return Array.isArray(e);case ue.CONNECT_ERROR:return typeof e=="string"||Cc(e);default:return!1}}function PL(r){return RL(r.nsp)&&kL(r.id)&&OL(r.type,r.data)}});var Z0=O(Xi=>{"use strict";var ML=Xi&&Xi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.Client=void 0;var Ac=ho(),IL=ML(Ae()),Er=(0,IL.default)("socket.io:client"),Jf=class{constructor(e,t){this.sockets=new Map,this.nsps=new Map,this.server=e,this.conn=t,this.encoder=e.encoder,this.decoder=new e._parser.Decoder,this.id=t.id,this.setup()}get request(){return this.conn.request}setup(){this.onclose=this.onclose.bind(this),this.ondata=this.ondata.bind(this),this.onerror=this.onerror.bind(this),this.ondecoded=this.ondecoded.bind(this),this.decoder.on("decoded",this.ondecoded),this.conn.on("data",this.ondata),this.conn.on("error",this.onerror),this.conn.on("close",this.onclose),this.connectTimeout=setTimeout(()=>{this.nsps.size===0?(Er("no namespace joined yet, close the client"),this.close()):Er("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return Er("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,n=>{n?this.doConnect(e,t):(Er("creation of namespace %s was denied",e),this._packet({type:Ac.PacketType.CONNECT_ERROR,nsp:e,data:{message:"Invalid namespace"}}))})}doConnect(e,t){let n=this.server.of(e);n._add(this,t,i=>{this.sockets.set(i.id,i),this.nsps.set(n.name,i),this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=void 0)})}_disconnect(){for(let e of this.sockets.values())e.disconnect();this.sockets.clear(),this.close()}_remove(e){if(this.sockets.has(e.id)){let t=this.sockets.get(e.id).nsp.name;this.sockets.delete(e.id),this.nsps.delete(t)}else Er("ignoring remove for %s",e.id)}close(){this.conn.readyState==="open"&&(Er("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if(this.conn.readyState!=="open"){Er("ignoring packet write %j",e);return}let n=t.preEncoded?e:this.encoder.encode(e);this.writeToEngine(n,t)}writeToEngine(e,t){if(t.volatile&&!this.conn.transport.writable){Er("volatile packet is discarded since the transport is not currently writable");return}let n=Array.isArray(e)?e:[e];for(let i of n)this.conn.write(i,t)}ondata(e){try{this.decoder.add(e)}catch(t){Er("invalid packet format"),this.onerror(t)}}ondecoded(e){let{namespace:t,authPayload:n}=this._parseNamespace(e),i=this.nsps.get(t);!i&&e.type===Ac.PacketType.CONNECT?this.connect(t,n):i&&e.type!==Ac.PacketType.CONNECT&&e.type!==Ac.PacketType.CONNECT_ERROR?process.nextTick(function(){i._onpacket(e)}):(Er("invalid state (packet type: %s)",e.type),this.close())}_parseNamespace(e){if(this.conn.protocol!==3)return{namespace:e.nsp,authPayload:e.data};let t=new URL(e.nsp,"https://socket.io");return{namespace:t.pathname,authPayload:Object.fromEntries(t.searchParams.entries())}}onerror(e){for(let t of this.sockets.values())t._onerror(e);this.conn.close()}onclose(e,t){Er("client close with reason %s",e),this.destroy();for(let n of this.sockets.values())n._onclose(e,t);this.sockets.clear(),this.decoder.destroy()}destroy(){this.conn.removeListener("data",this.ondata),this.conn.removeListener("error",this.onerror),this.conn.removeListener("close",this.onclose),this.decoder.removeListener("decoded",this.ondecoded),this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=void 0)}};Xi.Client=Jf});var kc=O(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.StrictEventEmitter=void 0;var NL=require("events"),Qf=class extends NL.EventEmitter{on(e,t){return super.on(e,t)}once(e,t){return super.once(e,t)}emit(e,...t){return super.emit(e,...t)}emitReserved(e,...t){return super.emit(e,...t)}emitUntyped(e,...t){return super.emit(e,...t)}listeners(e){return super.listeners(e)}};Rc.StrictEventEmitter=Qf});var Zf=O(Oc=>{"use strict";Object.defineProperty(Oc,"__esModule",{value:!0});Oc.RESERVED_EVENTS=void 0;Oc.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var ed=O(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.RemoteSocket=Ji.BroadcastOperator=void 0;var LL=Zf(),DL=ho(),Pc=class r{constructor(e,t=new Set,n=new Set,i={}){this.adapter=e,this.rooms=t,this.exceptRooms=n,this.flags=i}to(e){let t=new Set(this.rooms);return Array.isArray(e)?e.forEach(n=>t.add(n)):t.add(e),new r(this.adapter,t,this.exceptRooms,this.flags)}in(e){return this.to(e)}except(e){let t=new Set(this.exceptRooms);return Array.isArray(e)?e.forEach(n=>t.add(n)):t.add(e),new r(this.adapter,this.rooms,t,this.flags)}compress(e){let t=Object.assign({},this.flags,{compress:e});return new r(this.adapter,this.rooms,this.exceptRooms,t)}get volatile(){let e=Object.assign({},this.flags,{volatile:!0});return new r(this.adapter,this.rooms,this.exceptRooms,e)}get local(){let e=Object.assign({},this.flags,{local:!0});return new r(this.adapter,this.rooms,this.exceptRooms,e)}timeout(e){let t=Object.assign({},this.flags,{timeout:e});return new r(this.adapter,this.rooms,this.exceptRooms,t)}emit(e,...t){if(LL.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],i={type:DL.PacketType.EVENT,data:n};if(!(typeof n[n.length-1]=="function"))return this.adapter.broadcast(i,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let o=n.pop(),a=!1,c=[],u=setTimeout(()=>{a=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:c])},this.flags.timeout),p=-1,f=0,m=0,y=()=>{!a&&p===f&&c.length===m&&(clearTimeout(u),o.apply(this,[null,this.flags.expectSingleResponse?c[0]:c]))};return this.adapter.broadcastWithAck(i,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},_=>{m+=_,f++,y()},_=>{c.push(_),y()}),this.adapter.serverCount().then(_=>{p=_,y()}),!0}emitWithAck(e,...t){return new Promise((n,i)=>{t.push((s,o)=>s?(s.responses=o,i(s)):n(o)),this.emit(e,...t)})}allSockets(){if(!this.adapter)throw new Error("No adapter for this namespace, are you trying to get the list of clients of a dynamic namespace?");return this.adapter.sockets(this.rooms)}fetchSockets(){return this.adapter.fetchSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags}).then(e=>e.map(t=>t.server?t:new Mc(this.adapter,t)))}socketsJoin(e){this.adapter.addSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(e)?e:[e])}socketsLeave(e){this.adapter.delSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(e)?e:[e])}disconnectSockets(e=!1){this.adapter.disconnectSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},e)}};Ji.BroadcastOperator=Pc;var Mc=class{constructor(e,t){this.id=t.id,this.handshake=t.handshake,this.rooms=new Set(t.rooms),this.data=t.data,this.operator=new Pc(e,new Set([this.id]),new Set,{expectSingleResponse:!0})}timeout(e){return this.operator.timeout(e)}emit(e,...t){return this.operator.emit(e,...t)}join(e){return this.operator.socketsJoin(e)}leave(e){return this.operator.socketsLeave(e)}disconnect(e=!1){return this.operator.disconnectSockets(e),this}};Ji.RemoteSocket=Mc});var rd=O(Qi=>{"use strict";var r_=Qi&&Qi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qi,"__esModule",{value:!0});Qi.Socket=void 0;var ar=ho(),BL=r_(Ae()),jL=kc(),e_=r_(Pp()),FL=ed(),HL=Zf(),yt=(0,BL.default)("socket.io:socket"),$L=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function t_(){}var td=class extends jL.StrictEventEmitter{constructor(e,t,n,i){super(),this.nsp=e,this.client=t,this.recovered=!1,this.data={},this.connected=!1,this.acks=new Map,this.fns=[],this.flags={},this.server=e.server,this.adapter=e.adapter,i?(this.id=i.sid,this.pid=i.pid,i.rooms.forEach(s=>this.join(s)),this.data=i.data,i.missedPackets.forEach(s=>{this.packet({type:ar.PacketType.EVENT,data:s})}),this.recovered=!0):(t.conn.protocol===3?this.id=e.name!=="/"?e.name+"#"+t.id:t.id:this.id=e_.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=e_.default.generateId())),this.handshake=this.buildHandshake(n),this.on("error",t_)}buildHandshake(e){var t,n,i,s;return{headers:((t=this.request)===null||t===void 0?void 0:t.headers)||{},time:new Date+"",address:this.conn.remoteAddress,xdomain:!!(!((n=this.request)===null||n===void 0)&&n.headers.origin),secure:!this.request||!!this.request.connection.encrypted,issued:+new Date,url:(i=this.request)===null||i===void 0?void 0:i.url,query:((s=this.request)===null||s===void 0?void 0:s._query)||{},auth:e}}emit(e,...t){if(HL.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],i={type:ar.PacketType.EVENT,data:n};if(typeof n[n.length-1]=="function"){let o=this.nsp._ids++;yt("emitting packet with ack id %d",o),this.registerAckCallback(o,n.pop()),i.id=o}let s=Object.assign({},this.flags);return this.flags={},this.nsp.server.opts.connectionStateRecovery?this.adapter.broadcast(i,{rooms:new Set([this.id]),except:new Set,flags:s}):(this.notifyOutgoingListeners(i),this.packet(i,s)),!0}emitWithAck(e,...t){let n=this.flags.timeout!==void 0;return new Promise((i,s)=>{t.push((o,a)=>n?o?s(o):i(a):i(o)),this.emit(e,...t)})}registerAckCallback(e,t){let n=this.flags.timeout;if(n===void 0){this.acks.set(e,t);return}let i=setTimeout(()=>{yt("event with ack id %d has timed out after %d ms",e,n),this.acks.delete(e),t.call(this,new Error("operation has timed out"))},n);this.acks.set(e,(...s)=>{clearTimeout(i),t.apply(this,[null,...s])})}to(e){return this.newBroadcastOperator().to(e)}in(e){return this.newBroadcastOperator().in(e)}except(e){return this.newBroadcastOperator().except(e)}send(...e){return this.emit("message",...e),this}write(...e){return this.emit("message",...e),this}packet(e,t={}){e.nsp=this.nsp.name,t.compress=t.compress!==!1,this.client._packet(e,t)}join(e){return yt("join room %s",e),this.adapter.addAll(this.id,new Set(Array.isArray(e)?e:[e]))}leave(e){return yt("leave room %s",e),this.adapter.del(this.id,e)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){yt("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3?this.packet({type:ar.PacketType.CONNECT}):this.packet({type:ar.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(yt("got packet %j",e),e.type){case ar.PacketType.EVENT:this.onevent(e);break;case ar.PacketType.BINARY_EVENT:this.onevent(e);break;case ar.PacketType.ACK:this.onack(e);break;case ar.PacketType.BINARY_ACK:this.onack(e);break;case ar.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(e){let t=e.data||[];if(yt("emitting event %j",t),e.id!=null&&(yt("attaching ack callback to event"),t.push(this.ack(e.id))),this._anyListeners&&this._anyListeners.length){let n=this._anyListeners.slice();for(let i of n)i.apply(this,t)}this.dispatch(t)}ack(e){let t=this,n=!1;return function(){if(n)return;let i=Array.prototype.slice.call(arguments);yt("sending ack %j",i),t.packet({id:e,type:ar.PacketType.ACK,data:i}),n=!0}}onack(e){let t=this.acks.get(e.id);typeof t=="function"?(yt("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),this.acks.delete(e.id)):yt("bad ack %s",e.id)}ondisconnect(){yt("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(e){this.emitReserved("error",e)}_onclose(e,t){if(!this.connected)return this;yt("closing socket - reason %s",e),this.emitReserved("disconnecting",e,t),this.server._opts.connectionStateRecovery&&$L.has(e)&&(yt("connection state recovery is enabled for sid %s",this.id),this.adapter.persistSession({sid:this.id,pid:this.pid,rooms:[...this.rooms],data:this.data})),this._cleanup(),this.client._remove(this),this.connected=!1,this.emitReserved("disconnect",e,t)}_cleanup(){this.leaveAll(),this.nsp._remove(this),this.join=t_}_error(e){this.packet({type:ar.PacketType.CONNECT_ERROR,data:e})}disconnect(e=!1){return this.connected?(e?this.client._disconnect():(this.packet({type:ar.PacketType.DISCONNECT}),this._onclose("server namespace disconnect")),this):this}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}get broadcast(){return this.newBroadcastOperator()}get local(){return this.newBroadcastOperator().local}timeout(e){return this.flags.timeout=e,this}dispatch(e){yt("dispatching an event %j",e),this.run(e,t=>{process.nextTick(()=>{if(t)return this._onerror(t);this.connected?super.emitUntyped.apply(this,e):yt("ignore packet received after disconnection")})})}use(e){return this.fns.push(e),this}run(e,t){if(!this.fns.length)return t();let n=this.fns.slice(0);function i(s){n[s](e,o=>{if(o)return t(o);if(!n[s+1])return t();i(s+1)})}i(0)}get disconnected(){return!this.connected}get request(){return this.client.request}get conn(){return this.client.conn}get rooms(){return this.adapter.socketRooms(this.id)||new Set}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let n of t)n.apply(this,e.data)}}newBroadcastOperator(){let e=Object.assign({},this.flags);return this.flags={},new FL.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}};Qi.Socket=td});var id=O(on=>{"use strict";var qL=on&&on.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(on,"__esModule",{value:!0});on.Namespace=on.RESERVED_EVENTS=void 0;var n_=rd(),UL=kc(),WL=qL(Ae()),Yt=ed(),Zi=(0,WL.default)("socket.io:namespace");on.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);var nd=class extends UL.StrictEventEmitter{constructor(e,t){super(),this.sockets=new Map,this._preConnectSockets=new Map,this._fns=[],this._ids=0,this.server=e,this.name=t,this._initAdapter()}_initAdapter(){this.adapter=new(this.server.adapter())(this),Promise.resolve(this.adapter.init()).catch(e=>{Zi("error while initializing adapter: %s",e)})}use(e){return this._fns.push(e),this}run(e,t){if(!this._fns.length)return t();let n=this._fns.slice(0);function i(s){n[s](e,o=>{if(o)return t(o);if(!n[s+1])return t();i(s+1)})}i(0)}to(e){return new Yt.BroadcastOperator(this.adapter).to(e)}in(e){return new Yt.BroadcastOperator(this.adapter).in(e)}except(e){return new Yt.BroadcastOperator(this.adapter).except(e)}async _add(e,t,n){var i;Zi("adding socket to nsp %s",this.name);let s=await this._createSocket(e,t);if(this._preConnectSockets.set(s.id,s),!((i=this.server.opts.connectionStateRecovery)===null||i===void 0)&&i.skipMiddlewares&&s.recovered&&e.conn.readyState==="open")return this._doConnect(s,n);this.run(s,o=>{process.nextTick(()=>{if(e.conn.readyState!=="open"){Zi("next called after client was closed - ignoring socket"),s._cleanup();return}if(o)return Zi("middleware error, sending CONNECT_ERROR packet to the client"),s._cleanup(),e.conn.protocol===3?s._error(o.data||o.message):s._error({message:o.message,data:o.data});this._doConnect(s,n)})})}async _createSocket(e,t){let n=t.pid,i=t.offset;if(this.server.opts.connectionStateRecovery&&typeof n=="string"&&typeof i=="string"){let s;try{s=await this.adapter.restoreSession(n,i)}catch(o){Zi("error while restoring session: %s",o)}if(s)return Zi("connection state recovered for sid %s",s.sid),new n_.Socket(this,e,t,s)}return new n_.Socket(this,e,t)}_doConnect(e,t){this._preConnectSockets.delete(e.id),this.sockets.set(e.id,e),e._onconnect(),t&&t(e),this.emitReserved("connect",e),this.emitReserved("connection",e)}_remove(e){this.sockets.delete(e.id)||this._preConnectSockets.delete(e.id)}emit(e,...t){return new Yt.BroadcastOperator(this.adapter).emit(e,...t)}send(...e){return this.emit("message",...e),this}write(...e){return this.emit("message",...e),this}serverSideEmit(e,...t){if(on.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);return t.unshift(e),this.adapter.serverSideEmit(t),!0}serverSideEmitWithAck(e,...t){return new Promise((n,i)=>{t.push((s,o)=>s?(s.responses=o,i(s)):n(o)),this.serverSideEmit(e,...t)})}_onServerSideEmit(e){super.emitUntyped.apply(this,e)}allSockets(){return new Yt.BroadcastOperator(this.adapter).allSockets()}compress(e){return new Yt.BroadcastOperator(this.adapter).compress(e)}get volatile(){return new Yt.BroadcastOperator(this.adapter).volatile}get local(){return new Yt.BroadcastOperator(this.adapter).local}timeout(e){return new Yt.BroadcastOperator(this.adapter).timeout(e)}fetchSockets(){return new Yt.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(e){return new Yt.BroadcastOperator(this.adapter).socketsJoin(e)}socketsLeave(e){return new Yt.BroadcastOperator(this.adapter).socketsLeave(e)}disconnectSockets(e=!1){return new Yt.BroadcastOperator(this.adapter).disconnectSockets(e)}};on.Namespace=nd});var c_=O(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.encode=sd;mo.decode=GL;mo.yeast=zL;var o_="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Ic=64,a_={},i_=0,Dn=0,s_;function sd(r){let e="";do e=o_[r%Ic]+e,r=Math.floor(r/Ic);while(r>0);return e}function GL(r){let e=0;for(Dn=0;Dn<r.length;Dn++)e=e*Ic+a_[r.charAt(Dn)];return e}function zL(){let r=sd(+new Date);return r!==s_?(i_=0,s_=r):r+"."+sd(i_++)}for(;Dn<Ic;Dn++)a_[o_[Dn]]=Dn});var an=O((sW,p_)=>{"use strict";var l_=["nodebuffer","arraybuffer","fragments"],u_=typeof Blob<"u";u_&&l_.push("blob");p_.exports={BINARY_TYPES:l_,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:u_,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var go=O((oW,Nc)=>{"use strict";var{EMPTY_BUFFER:KL}=an(),od=Buffer[Symbol.species];function VL(r,e){if(r.length===0)return KL;if(r.length===1)return r[0];let t=Buffer.allocUnsafe(e),n=0;for(let i=0;i<r.length;i++){let s=r[i];t.set(s,n),n+=s.length}return n<e?new od(t.buffer,t.byteOffset,n):t}function f_(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function d_(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function YL(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function ad(r){if(ad.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new od(r):ArrayBuffer.isView(r)?e=new od(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),ad.readOnly=!1),e}Nc.exports={concat:VL,mask:f_,toArrayBuffer:YL,toBuffer:ad,unmask:d_};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=pf();Nc.exports.mask=function(e,t,n,i,s){s<48?f_(e,t,n,i,s):r.mask(e,t,n,i,s)},Nc.exports.unmask=function(e,t){e.length<32?d_(e,t):r.unmask(e,t)}}catch{}});var g_=O((aW,m_)=>{"use strict";var h_=Symbol("kDone"),cd=Symbol("kRun"),ld=class{constructor(e){this[h_]=()=>{this.pending--,this[cd]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[cd]()}[cd](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[h_])}}};m_.exports=ld});var xo=O((cW,__)=>{"use strict";var vo=require("zlib"),v_=go(),XL=g_(),{kStatusCode:x_}=an(),JL=Buffer[Symbol.species],QL=Buffer.from([0,0,255,255]),Dc=Symbol("permessage-deflate"),cn=Symbol("total-length"),es=Symbol("callback"),Bn=Symbol("buffers"),ts=Symbol("error"),Lc,ud=class{constructor(e,t,n){if(this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!Lc){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Lc=new XL(i)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[es];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,n=e.find(i=>!(t.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>i.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof t.serverMaxWindowBits=="number"&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach(t=>{Object.keys(t).forEach(n=>{let i=t[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);t[n]=i})}),e}decompress(e,t,n){Lc.add(i=>{this._decompress(e,t,(s,o)=>{i(),n(s,o)})})}compress(e,t,n){Lc.add(i=>{this._compress(e,t,(s,o)=>{i(),n(s,o)})})}_decompress(e,t,n){let i=this._isServer?"client":"server";if(!this._inflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?vo.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=vo.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[Dc]=this,this._inflate[cn]=0,this._inflate[Bn]=[],this._inflate.on("error",eD),this._inflate.on("data",y_)}this._inflate[es]=n,this._inflate.write(e),t&&this._inflate.write(QL),this._inflate.flush(()=>{let s=this._inflate[ts];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=v_.concat(this._inflate[Bn],this._inflate[cn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[cn]=0,this._inflate[Bn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(e,t,n){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?vo.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=vo.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[cn]=0,this._deflate[Bn]=[],this._deflate.on("data",ZL)}this._deflate[es]=n,this._deflate.write(e),this._deflate.flush(vo.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=v_.concat(this._deflate[Bn],this._deflate[cn]);t&&(s=new JL(s.buffer,s.byteOffset,s.length-4)),this._deflate[es]=null,this._deflate[cn]=0,this._deflate[Bn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};__.exports=ud;function ZL(r){this[Bn].push(r),this[cn]+=r.length}function y_(r){if(this[cn]+=r.length,this[Dc]._maxPayload<1||this[cn]<=this[Dc]._maxPayload){this[Bn].push(r);return}this[ts]=new RangeError("Max payload size exceeded"),this[ts].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[ts][x_]=1009,this.removeListener("data",y_),this.reset()}function eD(r){if(this[Dc]._inflate=null,this[ts]){this[es](this[ts]);return}r[x_]=1007,this[es](r)}});var rs=O((lW,Bc)=>{"use strict";var{isUtf8:b_}=require("buffer"),{hasBlob:tD}=an(),rD=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function nD(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function pd(r){let e=r.length,t=0;for(;t<e;)if((r[t]&128)===0)t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}function iD(r){return tD&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}Bc.exports={isBlob:iD,isValidStatusCode:nD,isValidUTF8:pd,tokenChars:rD};if(b_)Bc.exports.isValidUTF8=function(r){return r.length<24?pd(r):b_(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=xf();Bc.exports.isValidUTF8=function(e){return e.length<32?pd(e):r(e)}}catch{}});var gd=O((uW,R_)=>{"use strict";var{Writable:sD}=require("stream"),w_=xo(),{BINARY_TYPES:oD,EMPTY_BUFFER:S_,kStatusCode:aD,kWebSocket:cD}=an(),{concat:fd,toArrayBuffer:lD,unmask:uD}=go(),{isValidStatusCode:pD,isValidUTF8:E_}=rs(),jc=Buffer[Symbol.species],cr=0,T_=1,C_=2,A_=3,dd=4,hd=5,Fc=6,md=class extends sD{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||oD[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[cD]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=cr}_write(e,t,n){if(this._opcode===8&&this._state==cr)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new jc(n.buffer,n.byteOffset+e,n.length-e),new jc(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],i=t.length-e;e>=n.length?t.set(this._buffers.shift(),i):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),i),this._buffers[0]=new jc(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case cr:this.getInfo(e);break;case T_:this.getPayloadLength16(e);break;case C_:this.getPayloadLength64(e);break;case A_:this.getMask();break;case dd:this.getData(e);break;case hd:case Fc:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let n=(t[0]&64)===64;if(n&&!this._extensions[w_.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=T_:this._payloadLength===127?this._state=C_:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);if(n>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(i);return}this._payloadLength=n*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}this._masked?this._state=A_:this._state=dd}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=dd}getData(e){let t=S_;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&uD(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=hd,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[w_.extensionName].decompress(e,this._fin,(i,s)=>{if(i)return t(i);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._fragments.push(s)}this.dataMessage(t),this._state===cr&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=cr;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=fd(n,t):this._binaryType==="arraybuffer"?i=lD(fd(n,t)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=cr):(this._state=Fc,setImmediate(()=>{this.emit("message",i,!0),this._state=cr,this.startLoop(e)}))}else{let i=fd(n,t);if(!this._skipUTF8Validation&&!E_(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===hd||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=cr):(this._state=Fc,setImmediate(()=>{this.emit("message",i,!1),this._state=cr,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,S_),this.end();else{let n=e.readUInt16BE(0);if(!pD(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new jc(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!E_(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=cr;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=cr):(this._state=Fc,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=cr,this.startLoop(t)}))}createError(e,t,n,i,s){this._loop=!1,this._errored=!0;let o=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=s,o[aD]=i,o}};R_.exports=md});var yd=O((fW,P_)=>{"use strict";var{Duplex:pW}=require("stream"),{randomFillSync:fD}=require("crypto"),k_=xo(),{EMPTY_BUFFER:dD,kWebSocket:hD,NOOP:mD}=an(),{isBlob:ns,isValidStatusCode:gD}=rs(),{mask:O_,toBuffer:ii}=go(),lr=Symbol("kByteLength"),vD=Buffer.alloc(4),Hc=8*1024,si,is=Hc,Tr=0,xD=1,yD=2,vd=class r{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Tr,this.onerror=mD,this[hD]=void 0}static frame(e,t){let n,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||vD,t.generateMask?t.generateMask(n):(is===Hc&&(si===void 0&&(si=Buffer.alloc(Hc)),fD(si,0,Hc),is=0),n[0]=si[is++],n[1]=si[is++],n[2]=si[is++],n[3]=si[is++]),o=(n[0]|n[1]|n[2]|n[3])===0,s=6);let a;typeof e=="string"?(!t.mask||o)&&t[lr]!==void 0?a=t[lr]:(e=Buffer.from(e),a=e.length):(a=e.length,i=t.mask&&t.readOnly&&!o);let c=a;a>=65536?(s+=8,c=127):a>125&&(s+=2,c=126);let u=Buffer.allocUnsafe(i?a+s:s);return u[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),t.mask?(u[1]|=128,u[s-4]=n[0],u[s-3]=n[1],u[s-2]=n[2],u[s-1]=n[3],o?[u,e]:i?(O_(e,n,u,s,a),[u]):(O_(e,n,e,0,a),[u,e])):[u,e]}close(e,t,n,i){let s;if(e===void 0)s=dD;else{if(typeof e!="number"||!gD(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+a),s.writeUInt16BE(e,0),typeof t=="string"?s.write(t,2):s.set(t,2)}}let o={[lr]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Tr?this.enqueue([this.dispatch,s,!1,o,i]):this.sendFrame(r.frame(s,o),i)}ping(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):ns(e)?(i=e.size,s=!1):(e=ii(e),i=e.length,s=ii.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[lr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};ns(e)?this._state!==Tr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Tr?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}pong(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):ns(e)?(i=e.size,s=!1):(e=ii(e),i=e.length,s=ii.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[lr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};ns(e)?this._state!==Tr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Tr?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}send(e,t,n){let i=this._extensions[k_.extensionName],s=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):ns(e)?(a=e.size,c=!1):(e=ii(e),a=e.length,c=ii.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=i._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0);let u={[lr]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};ns(e)?this._state!==Tr?this.enqueue([this.getBlobData,e,this._compress,u,n]):this.getBlobData(e,this._compress,u,n):this._state!==Tr?this.enqueue([this.dispatch,e,this._compress,u,n]):this.dispatch(e,this._compress,u,n)}getBlobData(e,t,n,i){this._bufferedBytes+=n[lr],this._state=yD,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(xd,this,a,i);return}this._bufferedBytes-=n[lr];let o=ii(s);t?this.dispatch(o,t,n,i):(this._state=Tr,this.sendFrame(r.frame(o,n),i),this.dequeue())}).catch(s=>{process.nextTick(_D,this,s,i)})}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let s=this._extensions[k_.extensionName];this._bufferedBytes+=n[lr],this._state=xD,s.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");xd(this,c,i);return}this._bufferedBytes-=n[lr],this._state=Tr,n.readOnly=!1,this.sendFrame(r.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===Tr&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][lr],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][lr],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};P_.exports=vd;function xd(r,e,t){typeof t=="function"&&t(e);for(let n=0;n<r._queue.length;n++){let i=r._queue[n],s=i[i.length-1];typeof s=="function"&&s(e)}}function _D(r,e,t){xd(r,e,t),r.onerror(e)}});var H_=O((dW,F_)=>{"use strict";var{kForOnEventAttribute:yo,kListener:_d}=an(),M_=Symbol("kCode"),I_=Symbol("kData"),N_=Symbol("kError"),L_=Symbol("kMessage"),D_=Symbol("kReason"),ss=Symbol("kTarget"),B_=Symbol("kType"),j_=Symbol("kWasClean"),ln=class{constructor(e){this[ss]=null,this[B_]=e}get target(){return this[ss]}get type(){return this[B_]}};Object.defineProperty(ln.prototype,"target",{enumerable:!0});Object.defineProperty(ln.prototype,"type",{enumerable:!0});var oi=class extends ln{constructor(e,t={}){super(e),this[M_]=t.code===void 0?0:t.code,this[D_]=t.reason===void 0?"":t.reason,this[j_]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[M_]}get reason(){return this[D_]}get wasClean(){return this[j_]}};Object.defineProperty(oi.prototype,"code",{enumerable:!0});Object.defineProperty(oi.prototype,"reason",{enumerable:!0});Object.defineProperty(oi.prototype,"wasClean",{enumerable:!0});var os=class extends ln{constructor(e,t={}){super(e),this[N_]=t.error===void 0?null:t.error,this[L_]=t.message===void 0?"":t.message}get error(){return this[N_]}get message(){return this[L_]}};Object.defineProperty(os.prototype,"error",{enumerable:!0});Object.defineProperty(os.prototype,"message",{enumerable:!0});var _o=class extends ln{constructor(e,t={}){super(e),this[I_]=t.data===void 0?null:t.data}get data(){return this[I_]}};Object.defineProperty(_o.prototype,"data",{enumerable:!0});var bD={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[yo]&&i[_d]===e&&!i[yo])return;let n;if(r==="message")n=function(s,o){let a=new _o("message",{data:o?s:s.toString()});a[ss]=this,$c(e,this,a)};else if(r==="close")n=function(s,o){let a=new oi("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[ss]=this,$c(e,this,a)};else if(r==="error")n=function(s){let o=new os("error",{error:s,message:s.message});o[ss]=this,$c(e,this,o)};else if(r==="open")n=function(){let s=new ln("open");s[ss]=this,$c(e,this,s)};else return;n[yo]=!!t[yo],n[_d]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[_d]===e&&!t[yo]){this.removeListener(r,t);break}}};F_.exports={CloseEvent:oi,ErrorEvent:os,Event:ln,EventTarget:bD,MessageEvent:_o};function $c(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var bd=O((hW,$_)=>{"use strict";var{tokenChars:bo}=rs();function Br(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function wD(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,u=-1,p=-1,f=0;for(;f<r.length;f++)if(u=r.charCodeAt(f),o===void 0)if(p===-1&&bo[u]===1)c===-1&&(c=f);else if(f!==0&&(u===32||u===9))p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);u===44?(Br(e,y,t),t=Object.create(null)):o=y,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(p===-1&&bo[u]===1)c===-1&&(c=f);else if(u===32||u===9)p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f),Br(t,r.slice(c,p),!0),u===44&&(Br(e,o,t),t=Object.create(null),o=void 0),c=p=-1}else if(u===61&&c!==-1&&p===-1)a=r.slice(c,f),c=p=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(bo[u]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),i=!1}else if(s)if(bo[u]===1)c===-1&&(c=f);else if(u===34&&c!==-1)s=!1,p=f;else if(u===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(u===34&&r.charCodeAt(f-1)===61)s=!0;else if(p===-1&&bo[u]===1)c===-1&&(c=f);else if(c!==-1&&(u===32||u===9))p===-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);n&&(y=y.replace(/\\/g,""),n=!1),Br(t,a,y),u===44&&(Br(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||s||u===32||u===9)throw new SyntaxError("Unexpected end of input");p===-1&&(p=f);let m=r.slice(c,p);return o===void 0?Br(e,m,t):(a===void 0?Br(t,m,!0):n?Br(t,a,m.replace(/\\/g,"")):Br(t,a,m),Br(e,o,t)),e}function SD(r){return Object.keys(r).map(e=>{let t=r[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(i=>{let s=n[i];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}$_.exports={format:SD,parse:wD}});var Gc=O((vW,Z_)=>{"use strict";var ED=require("events"),TD=require("https"),CD=require("http"),W_=require("net"),AD=require("tls"),{randomBytes:RD,createHash:kD}=require("crypto"),{Duplex:mW,Readable:gW}=require("stream"),{URL:wd}=require("url"),jn=xo(),OD=gd(),PD=yd(),{isBlob:MD}=rs(),{BINARY_TYPES:q_,EMPTY_BUFFER:qc,GUID:ID,kForOnEventAttribute:Sd,kListener:ND,kStatusCode:LD,kWebSocket:ft,NOOP:G_}=an(),{EventTarget:{addEventListener:DD,removeEventListener:BD}}=H_(),{format:jD,parse:FD}=bd(),{toBuffer:HD}=go(),$D=30*1e3,z_=Symbol("kAborted"),Ed=[8,13],un=["CONNECTING","OPEN","CLOSING","CLOSED"],qD=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,we=class r extends ED{constructor(e,t,n){super(),this._binaryType=q_[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=qc,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(n=t,t=[]):t=[t]),K_(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){q_.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,n){let i=new OD({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new PD(e,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=e,i[ft]=this,s[ft]=this,e[ft]=this,i.on("conclude",GD),i.on("drain",zD),i.on("error",KD),i.on("message",VD),i.on("ping",YD),i.on("pong",XD),s.onerror=JD,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",X_),e.on("data",Wc),e.on("end",J_),e.on("error",Q_),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[jn.extensionName]&&this._extensions[jn.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Xt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Y_(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Td(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||qc,t,n)}pong(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Td(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||qc,t,n)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(n=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Td(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[jn.extensionName]||(i.compress=!1),this._sender.send(e||qc,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Xt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(we,"CONNECTING",{enumerable:!0,value:un.indexOf("CONNECTING")});Object.defineProperty(we.prototype,"CONNECTING",{enumerable:!0,value:un.indexOf("CONNECTING")});Object.defineProperty(we,"OPEN",{enumerable:!0,value:un.indexOf("OPEN")});Object.defineProperty(we.prototype,"OPEN",{enumerable:!0,value:un.indexOf("OPEN")});Object.defineProperty(we,"CLOSING",{enumerable:!0,value:un.indexOf("CLOSING")});Object.defineProperty(we.prototype,"CLOSING",{enumerable:!0,value:un.indexOf("CLOSING")});Object.defineProperty(we,"CLOSED",{enumerable:!0,value:un.indexOf("CLOSED")});Object.defineProperty(we.prototype,"CLOSED",{enumerable:!0,value:un.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(we.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(we.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Sd])return e[ND];return null},set(e){for(let t of this.listeners(r))if(t[Sd]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[Sd]:!0})}})});we.prototype.addEventListener=DD;we.prototype.removeEventListener=BD;Z_.exports=we;function K_(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Ed[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=i.autoPong,!Ed.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Ed.join(", ")})`);let s;if(e instanceof wd)s=e;else try{s=new wd(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),r._url=s.href;let o=s.protocol==="wss:",a=s.protocol==="ws+unix:",c;if(s.protocol!=="ws:"&&!o&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"),c){let S=new SyntaxError(c);if(r._redirects===0)throw S;Uc(r,S);return}let u=o?443:80,p=RD(16).toString("base64"),f=o?TD.request:CD.request,m=new Set,y;if(i.createConnection=i.createConnection||(o?WD:UD),i.defaultPort=i.defaultPort||u,i.port=s.port||u,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":p,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(y=new jn(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=jD({[jn.extensionName]:y.offer()})),t.length){for(let S of t){if(typeof S!="string"||!qD.test(S)||m.has(S))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.add(S)}i.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(s.username||s.password)&&(i.auth=`${s.username}:${s.password}`),a){let S=i.path.split(":");i.socketPath=S[0],i.path=S[1]}let _;if(i.followRedirects){if(r._redirects===0){r._originalIpc=a,r._originalSecure=o,r._originalHostOrSocketPath=a?i.socketPath:s.host;let S=n&&n.headers;if(n={...n,headers:{}},S)for(let[A,P]of Object.entries(S))n.headers[A.toLowerCase()]=P}else if(r.listenerCount("redirect")===0){let S=a?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:s.host===r._originalHostOrSocketPath;(!S||r._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,S||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),_=r._req=f(i),r._redirects&&r.emit("redirect",r.url,_)}else _=r._req=f(i);i.timeout&&_.on("timeout",()=>{Xt(r,_,"Opening handshake has timed out")}),_.on("error",S=>{_===null||_[z_]||(_=r._req=null,Uc(r,S))}),_.on("response",S=>{let A=S.headers.location,P=S.statusCode;if(A&&i.followRedirects&&P>=300&&P<400){if(++r._redirects>i.maxRedirects){Xt(r,_,"Maximum redirects exceeded");return}_.abort();let L;try{L=new wd(A,e)}catch{let H=new SyntaxError(`Invalid URL: ${A}`);Uc(r,H);return}K_(r,L,t,n)}else r.emit("unexpected-response",_,S)||Xt(r,_,`Unexpected server response: ${S.statusCode}`)}),_.on("upgrade",(S,A,P)=>{if(r.emit("upgrade",S),r.readyState!==we.CONNECTING)return;_=r._req=null;let L=S.headers.upgrade;if(L===void 0||L.toLowerCase()!=="websocket"){Xt(r,A,"Invalid Upgrade header");return}let N=kD("sha1").update(p+ID).digest("base64");if(S.headers["sec-websocket-accept"]!==N){Xt(r,A,"Invalid Sec-WebSocket-Accept header");return}let H=S.headers["sec-websocket-protocol"],W;if(H!==void 0?m.size?m.has(H)||(W="Server sent an invalid subprotocol"):W="Server sent a subprotocol but none was requested":m.size&&(W="Server sent no subprotocol"),W){Xt(r,A,W);return}H&&(r._protocol=H);let U=S.headers["sec-websocket-extensions"];if(U!==void 0){if(!y){Xt(r,A,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let G;try{G=FD(U)}catch{Xt(r,A,"Invalid Sec-WebSocket-Extensions header");return}let M=Object.keys(G);if(M.length!==1||M[0]!==jn.extensionName){Xt(r,A,"Server indicated an extension that was not requested");return}try{y.accept(G[jn.extensionName])}catch{Xt(r,A,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[jn.extensionName]=y}r.setSocket(A,P,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(_,r):_.end()}function Uc(r,e){r._readyState=we.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function UD(r){return r.path=r.socketPath,W_.connect(r)}function WD(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=W_.isIP(r.host)?"":r.host),AD.connect(r)}function Xt(r,e,t){r._readyState=we.CLOSING;let n=new Error(t);Error.captureStackTrace(n,Xt),e.setHeader?(e[z_]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Uc,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Td(r,e,t){if(e){let n=MD(e)?e.size:HD(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${un[r.readyState]})`);process.nextTick(t,n)}}function GD(r,e){let t=this[ft];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[ft]!==void 0&&(t._socket.removeListener("data",Wc),process.nextTick(V_,t._socket),r===1005?t.close():t.close(r,e))}function zD(){let r=this[ft];r.isPaused||r._socket.resume()}function KD(r){let e=this[ft];e._socket[ft]!==void 0&&(e._socket.removeListener("data",Wc),process.nextTick(V_,e._socket),e.close(r[LD])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function U_(){this[ft].emitClose()}function VD(r,e){this[ft].emit("message",r,e)}function YD(r){let e=this[ft];e._autoPong&&e.pong(r,!this._isServer,G_),e.emit("ping",r)}function XD(r){this[ft].emit("pong",r)}function V_(r){r.resume()}function JD(r){let e=this[ft];e.readyState!==we.CLOSED&&(e.readyState===we.OPEN&&(e._readyState=we.CLOSING,Y_(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function Y_(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),$D)}function X_(){let r=this[ft];this.removeListener("close",X_),this.removeListener("data",Wc),this.removeListener("end",J_),r._readyState=we.CLOSING;let e;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(e=r._socket.read())!==null&&r._receiver.write(e),r._receiver.end(),this[ft]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",U_),r._receiver.on("finish",U_))}function Wc(r){this[ft]._receiver.write(r)||this.pause()}function J_(){let r=this[ft];r._readyState=we.CLOSING,r._receiver.end(),this.end()}function Q_(){let r=this[ft];this.removeListener("error",Q_),this.on("error",G_),r&&(r._readyState=we.CLOSING,this.destroy())}});var nb=O((yW,rb)=>{"use strict";var xW=Gc(),{Duplex:QD}=require("stream");function eb(r){r.emit("close")}function ZD(){!this.destroyed&&this._writableState.finished&&this.destroy()}function tb(r){this.removeListener("error",tb),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function e2(r,e){let t=!0,n=new QD({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(s,o){let a=!o&&n._readableState.objectMode?s.toString():s;n.push(a)||r.pause()}),r.once("error",function(s){n.destroyed||(t=!1,n.destroy(s))}),r.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,s){if(r.readyState===r.CLOSED){s(i),process.nextTick(eb,n);return}let o=!1;r.once("error",function(c){o=!0,s(c)}),r.once("close",function(){o||s(i),process.nextTick(eb,n)}),t&&r.terminate()},n._final=function(i){if(r.readyState===r.CONNECTING){r.once("open",function(){n._final(i)});return}r._socket!==null&&(r._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(r._socket.once("finish",function(){i()}),r.close()))},n._read=function(){r.isPaused&&r.resume()},n._write=function(i,s,o){if(r.readyState===r.CONNECTING){r.once("open",function(){n._write(i,s,o)});return}r.send(i,o)},n.on("end",ZD),n.on("error",tb),n}rb.exports=e2});var sb=O((_W,ib)=>{"use strict";var{tokenChars:t2}=rs();function r2(r){let e=new Set,t=-1,n=-1,i=0;for(i;i<r.length;i++){let o=r.charCodeAt(i);if(n===-1&&t2[o]===1)t===-1&&(t=i);else if(i!==0&&(o===32||o===9))n===-1&&t!==-1&&(n=i);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=r.slice(t,n);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),t=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=r.slice(t,i);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}ib.exports={parse:r2}});var fb=O((wW,pb)=>{"use strict";var n2=require("events"),zc=require("http"),{Duplex:bW}=require("stream"),{createHash:i2}=require("crypto"),ob=bd(),ai=xo(),s2=sb(),o2=Gc(),{GUID:a2,kWebSocket:c2}=an(),l2=/^[+/0-9A-Za-z]{22}==$/,ab=0,cb=1,ub=2,Cd=class extends n2{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:o2,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=zc.createServer((n,i)=>{let s=zc.STATUS_CODES[426];i.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),i.end(s)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=u2(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,s,o)=>{this.handleUpgrade(i,s,o,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=ab}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===ub){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(wo,this);return}if(e&&this.once("close",e),this._state!==cb)if(this._state=cb,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(wo,this):process.nextTick(wo,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{wo(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,i){t.on("error",lb);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){ci(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){ci(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!l2.test(s)){ci(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){ci(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){So(t,400);return}let c=e.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=s2.parse(c)}catch{ci(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let p=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&p!==void 0){let m=new ai(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let y=ob.parse(p);y[ai.extensionName]&&(m.accept(y[ai.extensionName]),f[ai.extensionName]=m)}catch{ci(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(m,(y,_,S,A)=>{if(!y)return So(t,_||401,S,A);this.completeUpgrade(f,s,u,e,t,n,i)});return}if(!this.options.verifyClient(m))return So(t,401)}this.completeUpgrade(f,s,u,e,t,n,i)}completeUpgrade(e,t,n,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[c2])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>ab)return So(s,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${i2("sha1").update(t+a2).digest("base64")}`],p=new this.options.WebSocket(null,void 0,this.options);if(n.size){let f=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;f&&(u.push(`Sec-WebSocket-Protocol: ${f}`),p._protocol=f)}if(e[ai.extensionName]){let f=e[ai.extensionName].params,m=ob.format({[ai.extensionName]:[f]});u.push(`Sec-WebSocket-Extensions: ${m}`),p._extensions=e}this.emit("headers",u,i),s.write(u.concat(`\r
24
24
  `).join(`\r
25
- `)),s.removeListener("error",ab),p.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(p),p.on("close",()=>{this.clients.delete(p),this._shouldEmitClose&&!this.clients.size&&process.nextTick(wo,this)})),a(p,i)}};lb.exports=Td;function o2(r,e){for(let t of Object.keys(e))r.on(t,e[t]);return function(){for(let n of Object.keys(e))r.removeListener(n,e[n])}}function wo(r){r._state=cb,r.emit("close")}function ab(){this.destroy()}function So(r,e,t,n){t=t||Gc.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...n},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${Gc.STATUS_CODES[e]}\r
25
+ `)),s.removeListener("error",lb),p.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(p),p.on("close",()=>{this.clients.delete(p),this._shouldEmitClose&&!this.clients.size&&process.nextTick(wo,this)})),a(p,i)}};pb.exports=Cd;function u2(r,e){for(let t of Object.keys(e))r.on(t,e[t]);return function(){for(let n of Object.keys(e))r.removeListener(n,e[n])}}function wo(r){r._state=ub,r.emit("close")}function lb(){this.destroy()}function So(r,e,t,n){t=t||zc.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...n},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${zc.STATUS_CODES[e]}\r
26
26
  `+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
27
27
  `)+`\r
28
28
  \r
29
- `+t)}function oi(r,e,t,n,i,s){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,oi),r.emit("wsClientError",o,t,e)}else So(t,n,i,s)}});var fb=O((yW,pb)=>{"use strict";var pn=Wc();pn.createWebSocketStream=tb();pn.Server=ub();pn.Receiver=md();pn.Sender=xd();pn.WebSocket=pn;pn.WebSocketServer=pn.Server;pb.exports=pn});var Rd=O(os=>{"use strict";var Cd;Object.defineProperty(os,"__esModule",{value:!0});os.SessionAwareAdapter=os.Adapter=void 0;var a2=require("events"),c2=o_(),zc=fb(),l2=typeof((Cd=zc?.Sender)===null||Cd===void 0?void 0:Cd.frame)=="function",Kc=class extends a2.EventEmitter{constructor(e){super(),this.nsp=e,this.rooms=new Map,this.sids=new Map,this.encoder=e.server.encoder}init(){}close(){}serverCount(){return Promise.resolve(1)}addAll(e,t){this.sids.has(e)||this.sids.set(e,new Set);for(let n of t)this.sids.get(e).add(n),this.rooms.has(n)||(this.rooms.set(n,new Set),this.emit("create-room",n)),this.rooms.get(n).has(e)||(this.rooms.get(n).add(e),this.emit("join-room",n,e))}del(e,t){this.sids.has(e)&&this.sids.get(e).delete(t),this._del(t,e)}_del(e,t){let n=this.rooms.get(e);n!=null&&(n.delete(t)&&this.emit("leave-room",e,t),n.size===0&&this.rooms.delete(e)&&this.emit("delete-room",e))}delAll(e){if(this.sids.has(e)){for(let t of this.sids.get(e))this._del(t,e);this.sids.delete(e)}}broadcast(e,t){let n=t.flags||{},i={preEncoded:!0,volatile:n.volatile,compress:n.compress};e.nsp=this.nsp.name;let s=this._encode(e,i);this.apply(t,o=>{typeof o.notifyOutgoingListeners=="function"&&o.notifyOutgoingListeners(e),o.client.writeToEngine(s,i)})}broadcastWithAck(e,t,n,i){let s=t.flags||{},o={preEncoded:!0,volatile:s.volatile,compress:s.compress};e.nsp=this.nsp.name,e.id=this.nsp._ids++;let a=this._encode(e,o),c=0;this.apply(t,u=>{c++,u.acks.set(e.id,i),typeof u.notifyOutgoingListeners=="function"&&u.notifyOutgoingListeners(e),u.client.writeToEngine(a,o)}),n(c)}_encode(e,t){let n=this.encoder.encode(e);if(l2&&n.length===1&&typeof n[0]=="string"){let i=Buffer.from("4"+n[0]);t.wsPreEncodedFrame=zc.Sender.frame(i,{readOnly:!1,mask:!1,rsv1:!1,opcode:1,fin:!0})}return n}sockets(e){let t=new Set;return this.apply({rooms:e},n=>{t.add(n.id)}),Promise.resolve(t)}socketRooms(e){return this.sids.get(e)}fetchSockets(e){let t=[];return this.apply(e,n=>{t.push(n)}),Promise.resolve(t)}addSockets(e,t){this.apply(e,n=>{n.join(t)})}delSockets(e,t){this.apply(e,n=>{t.forEach(i=>n.leave(i))})}disconnectSockets(e,t){this.apply(e,n=>{n.disconnect(t)})}apply(e,t){let n=e.rooms,i=this.computeExceptSids(e.except);if(n.size){let s=new Set;for(let o of n)if(this.rooms.has(o))for(let a of this.rooms.get(o)){if(s.has(a)||i.has(a))continue;let c=this.nsp.sockets.get(a);c&&(t(c),s.add(a))}}else for(let[s]of this.sids){if(i.has(s))continue;let o=this.nsp.sockets.get(s);o&&t(o)}}computeExceptSids(e){let t=new Set;if(e&&e.size>0)for(let n of e)this.rooms.has(n)&&this.rooms.get(n).forEach(i=>t.add(i));return t}serverSideEmit(e){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(e){}restoreSession(e,t){return null}};os.Adapter=Kc;var Ad=class extends Kc{constructor(e){super(e),this.nsp=e,this.sessions=new Map,this.packets=[],this.maxDisconnectionDuration=e.server.opts.connectionStateRecovery.maxDisconnectionDuration,setInterval(()=>{let n=Date.now()-this.maxDisconnectionDuration;this.sessions.forEach((i,s)=>{i.disconnectedAt<n&&this.sessions.delete(s)});for(let i=this.packets.length-1;i>=0;i--)if(this.packets[i].emittedAt<n){this.packets.splice(0,i+1);break}},60*1e3).unref()}persistSession(e){e.disconnectedAt=Date.now(),this.sessions.set(e.pid,e)}restoreSession(e,t){let n=this.sessions.get(e);if(!n)return null;if(n.disconnectedAt+this.maxDisconnectionDuration<Date.now())return this.sessions.delete(e),null;let s=this.packets.findIndex(a=>a.id===t);if(s===-1)return null;let o=[];for(let a=s+1;a<this.packets.length;a++){let c=this.packets[a];u2(n.rooms,c.opts)&&o.push(c.data)}return Promise.resolve(Object.assign(Object.assign({},n),{missedPackets:o}))}broadcast(e,t){var n;let i=e.type===2,s=e.id===void 0,o=((n=t.flags)===null||n===void 0?void 0:n.volatile)===void 0;if(i&&s&&o){let a=(0,c2.yeast)();e.data.push(a),this.packets.push({id:a,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};os.SessionAwareAdapter=Ad;function u2(r,e){let t=e.rooms.size===0||r.some(i=>e.rooms.has(i)),n=r.every(i=>!e.except.has(i));return t&&n}});var db=O(jr=>{"use strict";var p2=jr&&jr.__rest||function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};Object.defineProperty(jr,"__esModule",{value:!0});jr.ClusterAdapterWithHeartbeat=jr.ClusterAdapter=jr.MessageType=void 0;var f2=Rd(),d2=Ce(),h2=require("crypto"),Se=(0,d2.debug)("socket.io-adapter"),m2="emitter",Vc=5e3;function cs(){return(0,h2.randomBytes)(8).toString("hex")}var te;(function(r){r[r.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",r[r.HEARTBEAT=2]="HEARTBEAT",r[r.BROADCAST=3]="BROADCAST",r[r.SOCKETS_JOIN=4]="SOCKETS_JOIN",r[r.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",r[r.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",r[r.FETCH_SOCKETS=7]="FETCH_SOCKETS",r[r.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",r[r.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",r[r.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",r[r.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",r[r.BROADCAST_ACK=12]="BROADCAST_ACK",r[r.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"})(te||(jr.MessageType=te={}));function ai(r){return{rooms:[...r.rooms],except:[...r.except],flags:r.flags}}function as(r){return{rooms:new Set(r.rooms),except:new Set(r.except),flags:r.flags}}var Yc=class extends f2.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=cs()}onMessage(e,t){if(e.uid===this.uid)return Se("[%s] ignore message from self",this.uid);if(e.nsp!==this.nsp.name)return Se("[%s] ignore message from another namespace (%s)",this.uid,e.nsp);switch(Se("[%s] new event of type %d from %s",this.uid,e.type,e.uid),e.type){case te.BROADCAST:{if(e.data.requestId!==void 0)super.broadcastWithAck(e.data.packet,as(e.data.opts),i=>{Se("[%s] waiting for %d client acknowledgements",this.uid,i),this.publishResponse(e.uid,{type:te.BROADCAST_CLIENT_COUNT,data:{requestId:e.data.requestId,clientCount:i}})},i=>{Se("[%s] received acknowledgement with value %j",this.uid,i),this.publishResponse(e.uid,{type:te.BROADCAST_ACK,data:{requestId:e.data.requestId,packet:i}})});else{let i=e.data.packet,s=as(e.data.opts);this.addOffsetIfNecessary(i,s,t),super.broadcast(i,s)}break}case te.SOCKETS_JOIN:super.addSockets(as(e.data.opts),e.data.rooms);break;case te.SOCKETS_LEAVE:super.delSockets(as(e.data.opts),e.data.rooms);break;case te.DISCONNECT_SOCKETS:super.disconnectSockets(as(e.data.opts),e.data.close);break;case te.FETCH_SOCKETS:{Se("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(as(e.data.opts)).then(n=>{this.publishResponse(e.uid,{type:te.FETCH_SOCKETS_RESPONSE,data:{requestId:e.data.requestId,sockets:n.map(i=>{let s=i.handshake,{sessionStore:o}=s,a=p2(s,["sessionStore"]);return{id:i.id,handshake:a,rooms:[...i.rooms],data:i.data}})}})});break}case te.SERVER_SIDE_EMIT:{let n=e.data.packet;if(!(e.data.requestId!==void 0)){this.nsp._onServerSideEmit(n);return}let s=!1,o=a=>{s||(s=!0,Se("[%s] calling acknowledgement with %j",this.uid,a),this.publishResponse(e.uid,{type:te.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:e.data.requestId,packet:a}}))};this.nsp._onServerSideEmit([...n,o]);break}case te.BROADCAST_CLIENT_COUNT:case te.BROADCAST_ACK:case te.FETCH_SOCKETS_RESPONSE:case te.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(e);break;default:Se("[%s] unknown message type: %s",this.uid,e.type)}}onResponse(e){var t,n;let i=e.data.requestId;switch(Se("[%s] received response %s to request %s",this.uid,e.type,i),e.type){case te.BROADCAST_CLIENT_COUNT:{(t=this.ackRequests.get(i))===null||t===void 0||t.clientCountCallback(e.data.clientCount);break}case te.BROADCAST_ACK:{(n=this.ackRequests.get(i))===null||n===void 0||n.ack(e.data.packet);break}case te.FETCH_SOCKETS_RESPONSE:{let s=this.requests.get(i);if(!s)return;s.current++,e.data.sockets.forEach(o=>s.responses.push(o)),s.current===s.expected&&(clearTimeout(s.timeout),s.resolve(s.responses),this.requests.delete(i));break}case te.SERVER_SIDE_EMIT_RESPONSE:{let s=this.requests.get(i);if(!s)return;s.current++,s.responses.push(e.data.packet),s.current===s.expected&&(clearTimeout(s.timeout),s.resolve(null,s.responses),this.requests.delete(i));break}default:Se("[%s] unknown response type: %s",this.uid,e.type)}}async broadcast(e,t){var n;if(!((n=t.flags)===null||n===void 0?void 0:n.local))try{let s=await this.publishAndReturnOffset({type:te.BROADCAST,data:{packet:e,opts:ai(t)}});this.addOffsetIfNecessary(e,t,s)}catch(s){return Se("[%s] error while broadcasting message: %s",this.uid,s.message)}super.broadcast(e,t)}addOffsetIfNecessary(e,t,n){var i;if(!this.nsp.server.opts.connectionStateRecovery)return;let s=e.type===2,o=e.id===void 0,a=((i=t.flags)===null||i===void 0?void 0:i.volatile)===void 0;s&&o&&a&&e.data.push(n)}broadcastWithAck(e,t,n,i){var s;if(!((s=t?.flags)===null||s===void 0?void 0:s.local)){let a=cs();this.ackRequests.set(a,{clientCountCallback:n,ack:i}),this.publish({type:te.BROADCAST,data:{packet:e,requestId:a,opts:ai(t)}}),setTimeout(()=>{this.ackRequests.delete(a)},t.flags.timeout)}super.broadcastWithAck(e,t,n,i)}async addSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:te.SOCKETS_JOIN,data:{opts:ai(e),rooms:t}})}catch(s){Se("[%s] error while publishing message: %s",this.uid,s.message)}super.addSockets(e,t)}async delSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:te.SOCKETS_LEAVE,data:{opts:ai(e),rooms:t}})}catch(s){Se("[%s] error while publishing message: %s",this.uid,s.message)}super.delSockets(e,t)}async disconnectSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:te.DISCONNECT_SOCKETS,data:{opts:ai(e),close:t}})}catch(s){Se("[%s] error while publishing message: %s",this.uid,s.message)}super.disconnectSockets(e,t)}async fetchSockets(e){var t;let[n,i]=await Promise.all([super.fetchSockets(e),this.serverCount()]),s=i-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return n;let o=cs();return new Promise((a,c)=>{let u=setTimeout(()=>{let f=this.requests.get(o);f&&(c(new Error(`timeout reached: only ${f.current} responses received out of ${f.expected}`)),this.requests.delete(o))},e.flags.timeout||Vc),p={type:te.FETCH_SOCKETS,resolve:a,timeout:u,current:0,expected:s,responses:n};this.requests.set(o,p),this.publish({type:te.FETCH_SOCKETS,data:{opts:ai(e),requestId:o}})})}async serverSideEmit(e){if(!(typeof e[e.length-1]=="function"))return this.publish({type:te.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),i=await this.serverCount()-1;if(Se('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,i),i<=0)return n(null,[]);let s=cs(),o=setTimeout(()=>{let c=this.requests.get(s);c&&(n(new Error(`timeout reached: only ${c.current} responses received out of ${c.expected}`),c.responses),this.requests.delete(s))},Vc),a={type:te.SERVER_SIDE_EMIT,resolve:n,timeout:o,current:0,expected:i,responses:[]};this.requests.set(s,a),this.publish({type:te.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}publish(e){Se("[%s] sending message %s",this.uid,e.type),this.publishAndReturnOffset(e).catch(t=>{Se("[%s] error while publishing message: %s",this.uid,t)})}publishAndReturnOffset(e){return e.uid=this.uid,e.nsp=this.nsp.name,this.doPublish(e)}publishResponse(e,t){t.uid=this.uid,t.nsp=this.nsp.name,Se("[%s] sending response %s to %s",this.uid,t.type,e),this.doPublishResponse(e,t).catch(n=>{Se("[%s] error while publishing response: %s",this.uid,n)})}};jr.ClusterAdapter=Yc;var kd=class extends Yc{constructor(e,t){super(e),this.nodesMap=new Map,this.customRequests=new Map,this._opts=Object.assign({heartbeatInterval:5e3,heartbeatTimeout:1e4},t),this.cleanupTimer=setInterval(()=>{let n=Date.now();this.nodesMap.forEach((i,s)=>{n-i>this._opts.heartbeatTimeout&&(Se("[%s] node %s seems down",this.uid,s),this.removeNode(s))})},1e3)}init(){this.publish({type:te.INITIAL_HEARTBEAT})}scheduleHeartbeat(){this.heartbeatTimer?this.heartbeatTimer.refresh():this.heartbeatTimer=setTimeout(()=>{this.publish({type:te.HEARTBEAT})},this._opts.heartbeatInterval)}close(){this.publish({type:te.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer&&clearInterval(this.cleanupTimer)}onMessage(e,t){if(e.uid===this.uid)return Se("[%s] ignore message from self",this.uid);switch(e.uid&&e.uid!==m2&&this.nodesMap.set(e.uid,Date.now()),e.type){case te.INITIAL_HEARTBEAT:this.publish({type:te.HEARTBEAT});break;case te.HEARTBEAT:break;case te.ADAPTER_CLOSE:this.removeNode(e.uid);break;default:super.onMessage(e,t)}}serverCount(){return Promise.resolve(1+this.nodesMap.size)}publish(e){return this.scheduleHeartbeat(),super.publish(e)}async serverSideEmit(e){if(!(typeof e[e.length-1]=="function"))return this.publish({type:te.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),i=this.nodesMap.size;if(Se('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,i),i<=0)return n(null,[]);let s=cs(),o=setTimeout(()=>{let c=this.customRequests.get(s);c&&(n(new Error(`timeout reached: missing ${c.missingUids.size} responses`),c.responses),this.customRequests.delete(s))},Vc),a={type:te.SERVER_SIDE_EMIT,resolve:n,timeout:o,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(s,a),this.publish({type:te.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}async fetchSockets(e){var t;let[n,i]=await Promise.all([super.fetchSockets({rooms:e.rooms,except:e.except,flags:{local:!0}}),this.serverCount()]),s=i-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return n;let o=cs();return new Promise((a,c)=>{let u=setTimeout(()=>{let f=this.customRequests.get(o);f&&(c(new Error(`timeout reached: missing ${f.missingUids.size} responses`)),this.customRequests.delete(o))},e.flags.timeout||Vc),p={type:te.FETCH_SOCKETS,resolve:a,timeout:u,missingUids:new Set([...this.nodesMap.keys()]),responses:n};this.customRequests.set(o,p),this.publish({type:te.FETCH_SOCKETS,data:{opts:ai(e),requestId:o}})})}onResponse(e){let t=e.data.requestId;switch(Se("[%s] received response %s to request %s",this.uid,e.type,t),e.type){case te.FETCH_SOCKETS_RESPONSE:{let n=this.customRequests.get(t);if(!n)return;e.data.sockets.forEach(i=>n.responses.push(i)),n.missingUids.delete(e.uid),n.missingUids.size===0&&(clearTimeout(n.timeout),n.resolve(n.responses),this.customRequests.delete(t));break}case te.SERVER_SIDE_EMIT_RESPONSE:{let n=this.customRequests.get(t);if(!n)return;n.responses.push(e.data.packet),n.missingUids.delete(e.uid),n.missingUids.size===0&&(clearTimeout(n.timeout),n.resolve(null,n.responses),this.customRequests.delete(t));break}default:super.onResponse(e)}}removeNode(e){this.customRequests.forEach((t,n)=>{t.missingUids.delete(e),t.missingUids.size===0&&(clearTimeout(t.timeout),t.type===te.FETCH_SOCKETS?t.resolve(t.responses):t.type===te.SERVER_SIDE_EMIT&&t.resolve(null,t.responses),this.customRequests.delete(n))}),this.nodesMap.delete(e)}};jr.ClusterAdapterWithHeartbeat=kd});var Xc=O(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.MessageType=ur.ClusterAdapterWithHeartbeat=ur.ClusterAdapter=ur.SessionAwareAdapter=ur.Adapter=void 0;var hb=Rd();Object.defineProperty(ur,"Adapter",{enumerable:!0,get:function(){return hb.Adapter}});Object.defineProperty(ur,"SessionAwareAdapter",{enumerable:!0,get:function(){return hb.SessionAwareAdapter}});var Od=db();Object.defineProperty(ur,"ClusterAdapter",{enumerable:!0,get:function(){return Od.ClusterAdapter}});Object.defineProperty(ur,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return Od.ClusterAdapterWithHeartbeat}});Object.defineProperty(ur,"MessageType",{enumerable:!0,get:function(){return Od.MessageType}})});var vb=O(ls=>{"use strict";var g2=ls&&ls.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ls,"__esModule",{value:!0});ls.ParentNamespace=void 0;var mb=nd(),v2=Xc(),x2=g2(Ce()),gb=(0,x2.default)("socket.io:parent-namespace"),Jc=class r extends mb.Namespace{constructor(e){super(e,"/_"+r.count++),this.children=new Set}_initAdapter(){this.adapter=new Pd(this)}emit(e,...t){return this.children.forEach(n=>{n.emit(e,...t)}),!0}createChild(e){gb("creating child namespace %s",e);let t=new mb.Namespace(this.server,e);if(this._fns.forEach(n=>t.use(n)),this.listeners("connect").forEach(n=>t.on("connect",n)),this.listeners("connection").forEach(n=>t.on("connection",n)),this.children.add(t),this.server._opts.cleanupEmptyChildNamespaces){let n=t._remove;t._remove=i=>{n.call(t,i),t.sockets.size===0&&(gb("closing child namespace %s",e),t.adapter.close(),this.server._nsps.delete(t.name),this.children.delete(t))}}return this.server._nsps.set(e,t),this.server.sockets.emitReserved("new_namespace",t),t}fetchSockets(){throw new Error("fetchSockets() is not supported on parent namespaces")}};ls.ParentNamespace=Jc;Jc.count=0;var Pd=class extends v2.Adapter{broadcast(e,t){this.nsp.children.forEach(n=>{n.adapter.broadcast(e,t)})}}});var Sb=O(li=>{"use strict";var y2=li&&li.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(li,"__esModule",{value:!0});li.patchAdapter=b2;li.restoreAdapter=w2;li.serveFile=E2;var ci=Xc(),xb=require("fs"),_2=y2(Ce()),Qc=(0,_2.default)("socket.io:adapter-uws"),Md="",{addAll:_b,del:bb,broadcast:wb}=ci.Adapter.prototype;function b2(r){ci.Adapter.prototype.addAll=function(e,t){let n=!this.sids.has(e);_b.call(this,e,t);let i=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(i){if(i.conn.transport.name==="websocket"){yb(this.nsp.name,i,n,t);return}n&&i.conn.on("upgrade",()=>{let s=this.sids.get(e);s&&yb(this.nsp.name,i,n,s)})}},ci.Adapter.prototype.del=function(e,t){bb.call(this,e,t);let n=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(n&&n.conn.transport.name==="websocket"){let i=n.conn.id,s=n.conn.transport.socket,o=`${this.nsp.name}${Md}${t}`;Qc("unsubscribe connection %s from topic %s",i,o),s.unsubscribe(o)}},ci.Adapter.prototype.broadcast=function(e,t){if(!(t.rooms.size<=1&&t.except.size===0)){wb.call(this,e,t);return}let i=t.flags||{},s={preEncoded:!0,volatile:i.volatile,compress:i.compress};e.nsp=this.nsp.name;let o=this.encoder.encode(e),a=t.rooms.size===0?this.nsp.name:`${this.nsp.name}${Md}${t.rooms.keys().next().value}`;Qc("fast publish to %s",a),o.forEach(c=>{let u=typeof c!="string";r.publish(a,u?c:"4"+c,u)}),this.apply(t,c=>{c.conn.transport.name!=="websocket"&&c.client.writeToEngine(o,s)})}}function yb(r,e,t,n){let i=e.conn.id,s=e.conn.transport.socket;t&&(Qc("subscribe connection %s to topic %s",i,r),s.subscribe(r)),n.forEach(o=>{let a=`${r}${Md}${o}`;Qc("subscribe connection %s to topic %s",i,a),s.subscribe(a)})}function w2(){ci.Adapter.prototype.addAll=_b,ci.Adapter.prototype.del=bb,ci.Adapter.prototype.broadcast=wb}var S2=r=>{let{buffer:e,byteOffset:t,byteLength:n}=r;return e.slice(t,t+n)};function E2(r,e){let{size:t}=(0,xb.statSync)(e),n=(0,xb.createReadStream)(e),i=()=>!n.destroyed&&n.destroy(),s=a=>{throw i(),a},o=a=>{let c=S2(a);r.cork(()=>{let u=r.getWriteOffset(),[p,f]=r.tryEnd(c,t);!f&&!p&&(n.pause(),r.onWritable(m=>{let[y,_]=r.tryEnd(c.slice(m-u),t);return!_&&y&&n.resume(),y}))})};r.onAborted(i),n.on("data",o).on("error",s).on("end",i)}});var Eb=O((TW,T2)=>{T2.exports={name:"socket.io",version:"4.8.3",description:"node.js realtime framework server",keywords:["realtime","framework","websocket","tcp","events","socket","io"],files:["dist/","client-dist/","wrapper.mjs","!**/*.tsbuildinfo"],directories:{doc:"docs/",example:"example/",lib:"lib/",test:"test/"},type:"commonjs",main:"./dist/index.js",exports:{".":{types:"./dist/index.d.ts",import:"./wrapper.mjs",require:"./dist/index.js"},"./package.json":"./package.json"},types:"./dist/index.d.ts",license:"MIT",homepage:"https://github.com/socketio/socket.io/tree/main/packages/socket.io#readme",repository:{type:"git",url:"git+https://github.com/socketio/socket.io.git"},bugs:{url:"https://github.com/socketio/socket.io/issues"},scripts:{compile:"rimraf ./dist && tsc",test:"npm run format:check && npm run compile && npm run test:types && npm run test:unit","test:types":"tsd","test:unit":"nyc mocha --import=tsx --reporter spec --slow 200 --bail --timeout 10000 test/index.ts","format:check":'prettier --check "lib/**/*.ts" "test/**/*.ts"',"format:fix":'prettier --write "lib/**/*.ts" "test/**/*.ts"',prepack:"npm run compile"},dependencies:{accepts:"~1.3.4",base64id:"~2.0.0",cors:"~2.8.5",debug:"~4.4.1","engine.io":"~6.6.0","socket.io-adapter":"~2.5.2","socket.io-parser":"~4.2.4"},contributors:[{name:"Guillermo Rauch",email:"rauchg@gmail.com"},{name:"Arnout Kazemier",email:"info@3rd-eden.com"},{name:"Vladimir Dronnikov",email:"dronnikov@gmail.com"},{name:"Einar Otto Stangvik",email:"einaros@gmail.com"}],engines:{node:">=10.2.0"},tsd:{directory:"test"}}});var Mb=O((_t,Eo)=>{"use strict";var C2=_t&&_t.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),A2=_t&&_t.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),R2=_t&&_t.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&C2(e,r,t);return A2(e,r),e},Ld=_t&&_t.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_t,"__esModule",{value:!0});_t.Namespace=_t.Socket=_t.Server=void 0;var k2=Ld(require("http")),O2=require("fs"),Id=require("zlib"),P2=Ha(),Zc=require("stream"),Tb=require("path"),Cb=$0(),M2=J0(),Ab=require("events"),Dd=nd();Object.defineProperty(_t,"Namespace",{enumerable:!0,get:function(){return Dd.Namespace}});var I2=vb(),Rb=Xc(),N2=R2(ho()),L2=Ld(Ce()),Pb=td();Object.defineProperty(_t,"Socket",{enumerable:!0,get:function(){return Pb.Socket}});var D2=Rc(),Nd=Sb(),B2=Ld(Lf()),Rt=(0,L2.default)("socket.io:server"),kb=Eb().version,Ob=/\.map/,us=class r extends D2.StrictEventEmitter{constructor(e,t={}){super(),this._nsps=new Map,this.parentNsps=new Map,this.parentNamespacesFromRegExp=new Map,typeof e=="object"&&e instanceof Object&&!e.listen&&(t=e,e=void 0),this.path(t.path||"/socket.io"),this.connectTimeout(t.connectTimeout||45e3),this.serveClient(t.serveClient!==!1),this._parser=t.parser||N2,this.encoder=new this._parser.Encoder,this.opts=t,t.connectionStateRecovery?(t.connectionStateRecovery=Object.assign({maxDisconnectionDuration:120*1e3,skipMiddlewares:!0},t.connectionStateRecovery),this.adapter(t.adapter||Rb.SessionAwareAdapter)):this.adapter(t.adapter||Rb.Adapter),t.cleanupEmptyChildNamespaces=!!t.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),(e||typeof e=="number")&&this.attach(e),this.opts.cors&&(this._corsMiddleware=(0,B2.default)(this.opts.cors))}get _opts(){return this.opts}serveClient(e){return arguments.length?(this._serveClient=e,this):this._serveClient}_checkNamespace(e,t,n){if(this.parentNsps.size===0)return n(!1);let i=this.parentNsps.keys(),s=()=>{let o=i.next();if(o.done)return n(!1);o.value(e,t,(a,c)=>{if(a||!c)return s();if(this._nsps.has(e))return Rt("dynamic namespace %s already exists",e),n(this._nsps.get(e));let u=this.parentNsps.get(o.value).createChild(e);Rt("dynamic namespace %s was created",e),n(u)})};s()}path(e){if(!arguments.length)return this._path;this._path=e.replace(/\/$/,"");let t=this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return this.clientPathRegex=new RegExp("^"+t+"/socket\\.io(\\.msgpack|\\.esm)?(\\.min)?\\.js(\\.map)?(?:\\?|$)"),this}connectTimeout(e){return e===void 0?this._connectTimeout:(this._connectTimeout=e,this)}adapter(e){if(!arguments.length)return this._adapter;this._adapter=e;for(let t of this._nsps.values())t._initAdapter();return this}listen(e,t={}){return this.attach(e,t)}attach(e,t={}){if(typeof e=="function"){let n="You are trying to attach socket.io to an express request handler function. Please pass a http.Server instance.";throw new Error(n)}if(Number(e)==e&&(e=Number(e)),typeof e=="number"){Rt("creating http server and binding to %d",e);let n=e;e=k2.default.createServer((i,s)=>{s.writeHead(404),s.end()}),e.listen(n)}return Object.assign(t,this.opts),t.path=t.path||this._path,this.initEngine(e,t),this}attachApp(e,t={}){Object.assign(t,this.opts),t.path=t.path||this._path,Rt("creating uWebSockets.js-based engine with opts %j",t);let n=new Cb.uServer(t);n.attach(e,t),this.bind(n),this._serveClient&&e.get(`${this._path}/*`,(i,s)=>{if(!this.clientPathRegex.test(s.getUrl())){s.setYield(!0);return}let o=s.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),a=Ob.test(o),c=a?"map":"source",u='"'+kb+'"',p="W/"+u,f=s.getHeader("if-none-match");if(f&&(u===f||p===f)){Rt("serve client %s 304",c),i.writeStatus("304 Not Modified"),i.end();return}Rt("serve client %s",c),i.writeHeader("cache-control","public, max-age=0"),i.writeHeader("content-type","application/"+(a?"json":"javascript")+"; charset=utf-8"),i.writeHeader("etag",u);let m=Tb.join(__dirname,"../client-dist/",o);(0,Nd.serveFile)(i,m)}),(0,Nd.patchAdapter)(e)}initEngine(e,t){Rt("creating engine.io instance with opts %j",t),this.eio=(0,Cb.attach)(e,t),this._serveClient&&this.attachServe(e),this.httpServer=e,this.bind(this.eio)}attachServe(e){Rt("attaching client serving req handler");let t=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("request",(n,i)=>{if(this.clientPathRegex.test(n.url))this._corsMiddleware?this._corsMiddleware(n,i,()=>{this.serve(n,i)}):this.serve(n,i);else for(let s=0;s<t.length;s++)t[s].call(e,n,i)})}serve(e,t){let n=e.url.replace(this._path,"").replace(/\?.*$/,""),i=Ob.test(n),s=i?"map":"source",o='"'+kb+'"',a="W/"+o,c=e.headers["if-none-match"];if(c&&(o===c||a===c)){Rt("serve client %s 304",s),t.writeHead(304),t.end();return}Rt("serve client %s",s),t.setHeader("Cache-Control","public, max-age=0"),t.setHeader("Content-Type","application/"+(i?"json":"javascript")+"; charset=utf-8"),t.setHeader("ETag",o),r.sendFile(n,e,t)}static sendFile(e,t,n){let i=(0,O2.createReadStream)(Tb.join(__dirname,"../client-dist/",e)),s=P2(t).encodings(["br","gzip","deflate"]),o=a=>{a&&n.end()};switch(s){case"br":n.writeHead(200,{"content-encoding":"br"}),(0,Zc.pipeline)(i,(0,Id.createBrotliCompress)(),n,o);break;case"gzip":n.writeHead(200,{"content-encoding":"gzip"}),(0,Zc.pipeline)(i,(0,Id.createGzip)(),n,o);break;case"deflate":n.writeHead(200,{"content-encoding":"deflate"}),(0,Zc.pipeline)(i,(0,Id.createDeflate)(),n,o);break;default:n.writeHead(200),(0,Zc.pipeline)(i,n,o)}}bind(e){return this.engine=e,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(e){Rt("incoming connection with id %s",e.id);let t=new M2.Client(this,e);return e.protocol===3&&t.connect("/"),this}of(e,t){if(typeof e=="function"||e instanceof RegExp){let i=new I2.ParentNamespace(this);return Rt("initializing parent namespace %s",i.name),typeof e=="function"?this.parentNsps.set(e,i):(this.parentNsps.set((s,o,a)=>a(null,e.test(s)),i),this.parentNamespacesFromRegExp.set(e,i)),t&&i.on("connect",t),i}String(e)[0]!=="/"&&(e="/"+e);let n=this._nsps.get(e);if(!n){for(let[i,s]of this.parentNamespacesFromRegExp)if(i.test(e))return Rt("attaching namespace %s to parent namespace %s",e,i),s.createChild(e);Rt("initializing namespace %s",e),n=new Dd.Namespace(this,e),this._nsps.set(e,n),e!=="/"&&this.sockets.emitReserved("new_namespace",n)}return t&&n.on("connect",t),n}async close(e){if(await Promise.allSettled([...this._nsps.values()].map(async t=>{t.sockets.forEach(n=>{n._onclose("server shutting down")}),await t.adapter.close()})),this.engine.close(),(0,Nd.restoreAdapter)(),this.httpServer)return new Promise(t=>{this.httpServer.close(n=>{e&&e(n),n&&Rt("server was not running"),t()})});e&&e()}use(e){return this.sockets.use(e),this}to(e){return this.sockets.to(e)}in(e){return this.sockets.in(e)}except(e){return this.sockets.except(e)}send(...e){return this.sockets.emit("message",...e),this}write(...e){return this.sockets.emit("message",...e),this}serverSideEmit(e,...t){return this.sockets.serverSideEmit(e,...t)}serverSideEmitWithAck(e,...t){return this.sockets.serverSideEmitWithAck(e,...t)}allSockets(){return this.sockets.allSockets()}compress(e){return this.sockets.compress(e)}get volatile(){return this.sockets.volatile}get local(){return this.sockets.local}timeout(e){return this.sockets.timeout(e)}fetchSockets(){return this.sockets.fetchSockets()}socketsJoin(e){return this.sockets.socketsJoin(e)}socketsLeave(e){return this.sockets.socketsLeave(e)}disconnectSockets(e=!1){return this.sockets.disconnectSockets(e)}};_t.Server=us;var j2=Object.keys(Ab.EventEmitter.prototype).filter(function(r){return typeof Ab.EventEmitter.prototype[r]=="function"});j2.forEach(function(r){us.prototype[r]=function(){return this.sockets[r].apply(this.sockets,arguments)}});Eo.exports=(r,e)=>new us(r,e);Eo.exports.Server=us;Eo.exports.Namespace=Dd.Namespace;Eo.exports.Socket=Pb.Socket});function Bd(){return To=(0,Lb.randomBytes)(32).toString("hex"),To}function Db(){return To||Bd(),To}function Bb(r){return!!r&&typeof r=="string"&&r===To}var Lb,To,el=Te(()=>{Lb=require("crypto"),To=null});var $b,rl,Z,bt=Te(()=>{$b={darwin:{capture:"robotjs",encoder:"sharp",tileSize:128,inputFormat:"bgra"},win32:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"},linux:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"}},rl=$b[process.platform]||$b.linux,Z={pipeline:{captureLib:rl.capture,encoder:rl.encoder,inputFormat:rl.inputFormat,tileSize:rl.tileSize,jpegQuality:50,outputScale:1,adaptiveTiers:[{minEffective:1,outputScale:1,jpegQuality:72},{minEffective:.7,outputScale:.95,jpegQuality:62},{minEffective:.4,outputScale:.8,jpegQuality:52},{minEffective:0,outputScale:.65,jpegQuality:45}],tierHysteresis:.05},webrtc:{enableWebRTC:!0,enableTurn:!1,turnApiUrl:"https://9remote.cc/api/webrtc/turn-credentials",turnRefreshInterval:1380*60*1e3,dcMaxMessageSize:65536,dcBufferThreshold:65536,dcChunkSize:8,dcMaxTilesPerFrame:32,dcReliable:!0,dcOrdered:!1,answerTimeout:1e4},robotSettings:{mouseDelay:2,keyboardDelay:2},throttling:{mouseThrottle:8,keyThrottle:25,typeTextThrottle:100,maxTextLength:1e3},resourceManagement:{inactiveTimeout:120*1e3,memoryCheckInterval:6e4,memoryWarningThreshold:1e3,maxTimersPerClient:100,maxChunkTimersPerClient:50},streaming:{activeInterval:60,idleInterval:400,idleThreshold:3,actionCaptureDelay:50,chunkSize:32,chunkDelay:5},focus:{paddingTiles:4},displayWake:{enabled:!0,throttleMs:3e4,macDurationSec:5},sleepInhibit:{defaultMode:"never",presets:{"30m":1800*1e3,"1h":3600*1e3,"2h":7200*1e3,"4h":14400*1e3,"24h":1440*60*1e3,never:null}},desktopSwitch:{darwin:{prev:{keyCode:123,mods:"control down"},next:{keyCode:124,mods:"control down"},new:{type:"missionControl"}},win32:{prev:["left",["control","command"]],next:["right",["control","command"]],new:["d",["control","command"]]},linux:{prev:null,next:null,new:null}},logging:{lifecycle:!1,errors:!0,dpiDetection:!1,focus:!1,focusEveryFrames:60,metrics:!1,metricsEveryFrames:30,webrtc:!1}}});var Co,Ao,ve,Fd=Te(()=>{bt();Pi();Co=()=>Z.logging,Ao=An("remote"),ve={lifecycle:r=>{Co().lifecycle&&Ao.info(r)},focus:r=>{Co().focus&&Ao.info(r)},dpi:r=>{Co().dpiDetection&&Ao.info(r)},error:(r,e)=>{Co().errors&&Ao.error(`${r} ${e?.message||e||""}`)},warn:r=>{Co().errors&&Ao.warn(r)}}});var Vb={};Xr(Vb,{ScreenHandler:()=>Hd,encodeTilesBatch:()=>fs});function K2(r){let e=Buffer.alloc(28);return e.writeUInt32LE(r.tileIndex,0),e.writeUInt32LE(r.x,4),e.writeUInt32LE(r.y,8),e.writeUInt32LE(r.width,12),e.writeUInt32LE(r.height,16),e.writeUInt32LE(r.imageBuffer.length,20),e.writeUInt32LE(r.hash>>>0,24),Buffer.concat([e,r.imageBuffer])}function fs(r,e){let t=Buffer.alloc(12);return t.writeUInt32LE(r.length,0),t.writeDoubleBE(e,4),Buffer.concat([t,...r.map(K2)])}var Hd,$d=Te(()=>{Fd();Hd=class{constructor(e,t){this.resourceManager=e,this.screenUpdateHelper=t}setupScreenHandlers(e,t,n){e.on("request-screen",t(async()=>{let i=this.resourceManager.getClient(e.id);if(i)try{let s=await i.tileManager.detectChangedTiles();s.length>0&&n.sendTiles({tiles:s,timestamp:Date.now()},fs),this.resourceManager.updateClientActivity(e.id)}catch(s){ve.error("Tile capture error:",s),n.emit("screen-error",{error:s.message})}})),e.on("request-screen-with-hashes",t(async i=>{let s=this.resourceManager.getClient(e.id);if(s)try{let o=i.tileHashes||[],a=await s.tileManager.compareClientTileHashes(o);a?.tiles?.length>0&&n.sendTiles({tiles:a.tiles,timestamp:Date.now()},fs),this.resourceManager.updateClientActivity(e.id)}catch(o){ve.error("Tile capture with hashes error:",o),n.emit("screen-error",{error:o.message})}})),e.on("start-streaming",t(async()=>{let i=this.resourceManager.getClient(e.id);if(!i)return;i.streamingTimeout&&(clearTimeout(i.streamingTimeout),i.streamingTimeout=null),ve.lifecycle("\u{1F680} Remote streaming started"),i.idleFrameCount=0,i.isStreaming=!0,i.streamGen=(i.streamGen||0)+1;let s=i.streamGen;i.tileManager.lastTileChecksums.clear();try{let a=await i.tileManager.getScreenDimensions();n.emit("screen-dimensions",a)}catch(a){ve.error("Get dimensions error:",a)}let o=async()=>{if(!e.connected||!i.isStreaming||i.streamGen!==s){i.streamingTimeout=null;return}try{let a=performance.now(),c=await i.tileManager.detectChangedTilesWithHashes();c.tiles.length>0&&e.connected?(n.sendTiles({tiles:c.tiles,timestamp:Date.now(),currentHashes:c.currentHashes},fs),i.idleFrameCount=0):i.idleFrameCount++;let{activeInterval:u,idleInterval:p,idleThreshold:f}=this.resourceManager.getStreamingConfig(),m=i.idleFrameCount>=f?p:u,y=Math.max(0,m-(performance.now()-a));i.streamingTimeout=setTimeout(o,y)}catch(a){ve.error("Auto streaming error:",a),i.streamingTimeout=setTimeout(o,200)}};o()})),e.on("stop-streaming",()=>{let i=this.resourceManager.getClient(e.id);i&&(i.isStreaming=!1,i.streamingTimeout&&(clearTimeout(i.streamingTimeout),i.streamingTimeout=null),ve.lifecycle("\u23F9\uFE0F Remote streaming stopped"))}),e.on("get-screen-dimensions",t(async()=>{let i=this.resourceManager.getClient(e.id);if(i)try{let s=await i.tileManager.getScreenDimensions();n.emit("screen-dimensions",s)}catch(s){ve.error("Get dimensions error:",s),n.emit("screen-error",{error:s.message})}})),e.on("boost-stream",t(()=>{let i=this.resourceManager.getClient(e.id);i&&(i.idleFrameCount=0)})),e.on("set-focus",t(i=>{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=i?.rect||null,a=typeof i?.zoom=="number"?i.zoom:1,c=typeof i?.viewerWidth=="number"?i.viewerWidth:0,u=typeof i?.dpr=="number"?i.dpr:1,p=s.tileManager.pickProfile({zoom:a,viewerWidth:c,dpr:u});if(s.tileManager.setProfile(p),s.tileManager.setFocusRect(o),o){let f=s.tileManager.activeTileSet?.size||0,m=s.tileManager.totalTiles,y=m?(f/m*100).toFixed(0):0;ve.focus(`\u{1F3AF} [Focus] rect=${o.x},${o.y} ${o.w}x${o.h} | tiles ${f}/${m} (${y}%)`)}else ve.focus("\u{1F3AF} [Focus] cleared \u2192 full screen")}))}}});async function pw(){if(ko)return ko;let r=await import("node-screenshots");if(ko=(r.Monitor||r.default?.Monitor).all()[0],!ko)throw new Error("No monitor found via node-screenshots");return ko}async function fw(r){Yd=r,Z.pipeline.captureLib==="nodeScreenshots"&&await pw()}async function dw(){let{captureLib:r,inputFormat:e}=Z.pipeline;if(r==="robotjs"){let{width:s,height:o}=Yd.getScreenSize(),a=Yd.screen.capture(0,0,s,o),c=a.byteWidth/a.bytesPerPixel;return{buffer:Buffer.from(a.image),width:c,height:a.height,channels:a.bytesPerPixel,format:e}}let n=(await pw()).captureImageSync();return{buffer:n.toRawSync?n.toRawSync():n.rawSync(),width:n.width,height:n.height,channels:4,format:e}}var Yd,ko,hw=Te(()=>{bt();Yd=null,ko=null});function aB(r){return r==="bgra"?Jd.FORMAT_BGRA:Jd.FORMAT_RGBA}function Qd(r){let e=new Uint32Array(r.buffer,r.byteOffset,r.length>>2);for(let t=0;t<e.length;t++){let n=e[t];e[t]=n&4278255360|(n&16711680)>>16|(n&255)<<16}}async function Zd(r,e,t,n=4,i,s){let{encoder:o,inputFormat:a,jpegQuality:c}=Z.pipeline,u=i??c,p=s??a;if(o==="jpegTurbo")return Jd.compressSync(r,{width:e,height:t,format:aB(p),quality:u});let f=r;return p==="bgra"&&(f=Buffer.from(r),Qd(f)),(0,mw.default)(f,{raw:{width:e,height:t,channels:n}}).jpeg({quality:u}).toBuffer()}var mw,Xd,Jd,gw=Te(()=>{mw=X(require("sharp"),1),Xd=X(require("@julusian/jpeg-turbo"),1);bt();Jd=Xd.default.default||Xd.default});function Po(){for(let r of[oe.ROOT,oe.STATE])Hr.default.existsSync(r)||Hr.default.mkdirSync(r,{recursive:!0})}function rh(){try{return Po(),Hr.default.existsSync(th)?JSON.parse(Hr.default.readFileSync(th,"utf8"))||{}:{}}catch{return{}}}function vw(r){try{Po();let e={...rh(),...r};return Hr.default.writeFileSync(th,JSON.stringify(e,null,2),{mode:384}),e}catch(e){return console.error("Error saving settings:",e),null}}function xw(){try{return Po(),Hr.default.existsSync(eh)?JSON.parse(Hr.default.readFileSync(eh,"utf8")):{machineId:null,key:null,name:"Default",createdAt:null}}catch{return{machineId:null,key:null,name:"Default",createdAt:null}}}function gl(r){try{Po(),Hr.default.writeFileSync(cB,JSON.stringify({cmd:r,ts:Date.now()}))}catch{}}function yw(r,e,t="Default"){try{Po();let n={machineId:r,key:e,name:t,createdAt:new Date().toISOString()};return Hr.default.writeFileSync(eh,JSON.stringify(n,null,2),{mode:384}),n}catch(n){return console.error("Error saving key:",n),null}}var Hr,Oo,p8,f8,eh,cB,th,Mo=Te(()=>{Hr=X(require("fs"),1),Oo=X(require("path"),1);gt();p8=oe.STATE,f8=Oo.default.join(oe.STATE,"state.json"),eh=Oo.default.join(oe.ROOT,"keys.json"),cB=Oo.default.join(oe.STATE,"cmd.json"),th=Oo.default.join(oe.STATE,"settings.json")});function _w(){return new Promise(r=>{if(process.platform!=="darwin"){r({screenRecording:!0,accessibility:!0});return}let e=!1,t=!1,n=0,i=()=>{++n===2&&r({screenRecording:e,accessibility:t})};(0,Io.execFile)("osascript",["-e",'use framework "ApplicationServices"',"-e",`set checkOptions to current application's NSDictionary's dictionaryWithObject:(false) forKey:("AXTrustedCheckOptionPrompt" as string)`,"-e","return current application's AXIsProcessTrustedWithOptions(checkOptions) as boolean"],{timeout:3e3},(s,o)=>{t=!s&&o.trim()==="true",i()}),(0,Io.exec)(`osascript -e 'use framework "CoreGraphics"' -e "return (current application's CGPreflightScreenCaptureAccess()) as boolean"`,{timeout:3e3},(s,o)=>{e=!s&&o.trim()==="true",i()})})}function bw(r){let e=lB[r];e&&process.platform==="darwin"&&(0,Io.exec)(`open "${e}"`,()=>{})}var Io,lB,ww=Te(()=>{Io=require("child_process"),lB={screenRecording:"x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture",accessibility:"x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"}});function uB(){return!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY}function bl(){for(let r=Sw,e=null;r!==e;e=r,r=$r.default.dirname(r)){let t=$r.default.join(r,"package.json");if((0,Ee.existsSync)(t)){try{let n=JSON.parse((0,Ee.readFileSync)(t,"utf8"));if(n.name!=="9remote")continue;let i=typeof n.bin=="string"?n.bin:n.bin?.["9remote"];if(i){let s=$r.default.resolve(r,i);if((0,Ee.existsSync)(s))return s}}catch{}break}}return $r.default.resolve(Sw,"..","index.js")}function Do(){return process.execPath}function Cw(){let r=$r.default.dirname(Do()),e=["/usr/local/bin","/usr/bin","/bin","/usr/sbin","/sbin","/opt/homebrew/bin"];return e.includes(r)||e.unshift(r),e.join(":")}function nh(r){return String(r).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function pB(r,e){let t=[r,e,..._l].map(n=>` <string>${nh(n)}</string>`).join(`
29
+ `+t)}function ci(r,e,t,n,i,s){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,ci),r.emit("wsClientError",o,t,e)}else So(t,n,i,s)}});var hb=O((SW,db)=>{"use strict";var pn=Gc();pn.createWebSocketStream=nb();pn.Server=fb();pn.Receiver=gd();pn.Sender=yd();pn.WebSocket=pn;pn.WebSocketServer=pn.Server;db.exports=pn});var kd=O(as=>{"use strict";var Ad;Object.defineProperty(as,"__esModule",{value:!0});as.SessionAwareAdapter=as.Adapter=void 0;var p2=require("events"),f2=c_(),Kc=hb(),d2=typeof((Ad=Kc?.Sender)===null||Ad===void 0?void 0:Ad.frame)=="function",Vc=class extends p2.EventEmitter{constructor(e){super(),this.nsp=e,this.rooms=new Map,this.sids=new Map,this.encoder=e.server.encoder}init(){}close(){}serverCount(){return Promise.resolve(1)}addAll(e,t){this.sids.has(e)||this.sids.set(e,new Set);for(let n of t)this.sids.get(e).add(n),this.rooms.has(n)||(this.rooms.set(n,new Set),this.emit("create-room",n)),this.rooms.get(n).has(e)||(this.rooms.get(n).add(e),this.emit("join-room",n,e))}del(e,t){this.sids.has(e)&&this.sids.get(e).delete(t),this._del(t,e)}_del(e,t){let n=this.rooms.get(e);n!=null&&(n.delete(t)&&this.emit("leave-room",e,t),n.size===0&&this.rooms.delete(e)&&this.emit("delete-room",e))}delAll(e){if(this.sids.has(e)){for(let t of this.sids.get(e))this._del(t,e);this.sids.delete(e)}}broadcast(e,t){let n=t.flags||{},i={preEncoded:!0,volatile:n.volatile,compress:n.compress};e.nsp=this.nsp.name;let s=this._encode(e,i);this.apply(t,o=>{typeof o.notifyOutgoingListeners=="function"&&o.notifyOutgoingListeners(e),o.client.writeToEngine(s,i)})}broadcastWithAck(e,t,n,i){let s=t.flags||{},o={preEncoded:!0,volatile:s.volatile,compress:s.compress};e.nsp=this.nsp.name,e.id=this.nsp._ids++;let a=this._encode(e,o),c=0;this.apply(t,u=>{c++,u.acks.set(e.id,i),typeof u.notifyOutgoingListeners=="function"&&u.notifyOutgoingListeners(e),u.client.writeToEngine(a,o)}),n(c)}_encode(e,t){let n=this.encoder.encode(e);if(d2&&n.length===1&&typeof n[0]=="string"){let i=Buffer.from("4"+n[0]);t.wsPreEncodedFrame=Kc.Sender.frame(i,{readOnly:!1,mask:!1,rsv1:!1,opcode:1,fin:!0})}return n}sockets(e){let t=new Set;return this.apply({rooms:e},n=>{t.add(n.id)}),Promise.resolve(t)}socketRooms(e){return this.sids.get(e)}fetchSockets(e){let t=[];return this.apply(e,n=>{t.push(n)}),Promise.resolve(t)}addSockets(e,t){this.apply(e,n=>{n.join(t)})}delSockets(e,t){this.apply(e,n=>{t.forEach(i=>n.leave(i))})}disconnectSockets(e,t){this.apply(e,n=>{n.disconnect(t)})}apply(e,t){let n=e.rooms,i=this.computeExceptSids(e.except);if(n.size){let s=new Set;for(let o of n)if(this.rooms.has(o))for(let a of this.rooms.get(o)){if(s.has(a)||i.has(a))continue;let c=this.nsp.sockets.get(a);c&&(t(c),s.add(a))}}else for(let[s]of this.sids){if(i.has(s))continue;let o=this.nsp.sockets.get(s);o&&t(o)}}computeExceptSids(e){let t=new Set;if(e&&e.size>0)for(let n of e)this.rooms.has(n)&&this.rooms.get(n).forEach(i=>t.add(i));return t}serverSideEmit(e){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(e){}restoreSession(e,t){return null}};as.Adapter=Vc;var Rd=class extends Vc{constructor(e){super(e),this.nsp=e,this.sessions=new Map,this.packets=[],this.maxDisconnectionDuration=e.server.opts.connectionStateRecovery.maxDisconnectionDuration,setInterval(()=>{let n=Date.now()-this.maxDisconnectionDuration;this.sessions.forEach((i,s)=>{i.disconnectedAt<n&&this.sessions.delete(s)});for(let i=this.packets.length-1;i>=0;i--)if(this.packets[i].emittedAt<n){this.packets.splice(0,i+1);break}},60*1e3).unref()}persistSession(e){e.disconnectedAt=Date.now(),this.sessions.set(e.pid,e)}restoreSession(e,t){let n=this.sessions.get(e);if(!n)return null;if(n.disconnectedAt+this.maxDisconnectionDuration<Date.now())return this.sessions.delete(e),null;let s=this.packets.findIndex(a=>a.id===t);if(s===-1)return null;let o=[];for(let a=s+1;a<this.packets.length;a++){let c=this.packets[a];h2(n.rooms,c.opts)&&o.push(c.data)}return Promise.resolve(Object.assign(Object.assign({},n),{missedPackets:o}))}broadcast(e,t){var n;let i=e.type===2,s=e.id===void 0,o=((n=t.flags)===null||n===void 0?void 0:n.volatile)===void 0;if(i&&s&&o){let a=(0,f2.yeast)();e.data.push(a),this.packets.push({id:a,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};as.SessionAwareAdapter=Rd;function h2(r,e){let t=e.rooms.size===0||r.some(i=>e.rooms.has(i)),n=r.every(i=>!e.except.has(i));return t&&n}});var mb=O(jr=>{"use strict";var m2=jr&&jr.__rest||function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};Object.defineProperty(jr,"__esModule",{value:!0});jr.ClusterAdapterWithHeartbeat=jr.ClusterAdapter=jr.MessageType=void 0;var g2=kd(),v2=Ae(),x2=require("crypto"),Se=(0,v2.debug)("socket.io-adapter"),y2="emitter",Yc=5e3;function ls(){return(0,x2.randomBytes)(8).toString("hex")}var te;(function(r){r[r.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",r[r.HEARTBEAT=2]="HEARTBEAT",r[r.BROADCAST=3]="BROADCAST",r[r.SOCKETS_JOIN=4]="SOCKETS_JOIN",r[r.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",r[r.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",r[r.FETCH_SOCKETS=7]="FETCH_SOCKETS",r[r.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",r[r.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",r[r.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",r[r.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",r[r.BROADCAST_ACK=12]="BROADCAST_ACK",r[r.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"})(te||(jr.MessageType=te={}));function li(r){return{rooms:[...r.rooms],except:[...r.except],flags:r.flags}}function cs(r){return{rooms:new Set(r.rooms),except:new Set(r.except),flags:r.flags}}var Xc=class extends g2.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=ls()}onMessage(e,t){if(e.uid===this.uid)return Se("[%s] ignore message from self",this.uid);if(e.nsp!==this.nsp.name)return Se("[%s] ignore message from another namespace (%s)",this.uid,e.nsp);switch(Se("[%s] new event of type %d from %s",this.uid,e.type,e.uid),e.type){case te.BROADCAST:{if(e.data.requestId!==void 0)super.broadcastWithAck(e.data.packet,cs(e.data.opts),i=>{Se("[%s] waiting for %d client acknowledgements",this.uid,i),this.publishResponse(e.uid,{type:te.BROADCAST_CLIENT_COUNT,data:{requestId:e.data.requestId,clientCount:i}})},i=>{Se("[%s] received acknowledgement with value %j",this.uid,i),this.publishResponse(e.uid,{type:te.BROADCAST_ACK,data:{requestId:e.data.requestId,packet:i}})});else{let i=e.data.packet,s=cs(e.data.opts);this.addOffsetIfNecessary(i,s,t),super.broadcast(i,s)}break}case te.SOCKETS_JOIN:super.addSockets(cs(e.data.opts),e.data.rooms);break;case te.SOCKETS_LEAVE:super.delSockets(cs(e.data.opts),e.data.rooms);break;case te.DISCONNECT_SOCKETS:super.disconnectSockets(cs(e.data.opts),e.data.close);break;case te.FETCH_SOCKETS:{Se("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(cs(e.data.opts)).then(n=>{this.publishResponse(e.uid,{type:te.FETCH_SOCKETS_RESPONSE,data:{requestId:e.data.requestId,sockets:n.map(i=>{let s=i.handshake,{sessionStore:o}=s,a=m2(s,["sessionStore"]);return{id:i.id,handshake:a,rooms:[...i.rooms],data:i.data}})}})});break}case te.SERVER_SIDE_EMIT:{let n=e.data.packet;if(!(e.data.requestId!==void 0)){this.nsp._onServerSideEmit(n);return}let s=!1,o=a=>{s||(s=!0,Se("[%s] calling acknowledgement with %j",this.uid,a),this.publishResponse(e.uid,{type:te.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:e.data.requestId,packet:a}}))};this.nsp._onServerSideEmit([...n,o]);break}case te.BROADCAST_CLIENT_COUNT:case te.BROADCAST_ACK:case te.FETCH_SOCKETS_RESPONSE:case te.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(e);break;default:Se("[%s] unknown message type: %s",this.uid,e.type)}}onResponse(e){var t,n;let i=e.data.requestId;switch(Se("[%s] received response %s to request %s",this.uid,e.type,i),e.type){case te.BROADCAST_CLIENT_COUNT:{(t=this.ackRequests.get(i))===null||t===void 0||t.clientCountCallback(e.data.clientCount);break}case te.BROADCAST_ACK:{(n=this.ackRequests.get(i))===null||n===void 0||n.ack(e.data.packet);break}case te.FETCH_SOCKETS_RESPONSE:{let s=this.requests.get(i);if(!s)return;s.current++,e.data.sockets.forEach(o=>s.responses.push(o)),s.current===s.expected&&(clearTimeout(s.timeout),s.resolve(s.responses),this.requests.delete(i));break}case te.SERVER_SIDE_EMIT_RESPONSE:{let s=this.requests.get(i);if(!s)return;s.current++,s.responses.push(e.data.packet),s.current===s.expected&&(clearTimeout(s.timeout),s.resolve(null,s.responses),this.requests.delete(i));break}default:Se("[%s] unknown response type: %s",this.uid,e.type)}}async broadcast(e,t){var n;if(!((n=t.flags)===null||n===void 0?void 0:n.local))try{let s=await this.publishAndReturnOffset({type:te.BROADCAST,data:{packet:e,opts:li(t)}});this.addOffsetIfNecessary(e,t,s)}catch(s){return Se("[%s] error while broadcasting message: %s",this.uid,s.message)}super.broadcast(e,t)}addOffsetIfNecessary(e,t,n){var i;if(!this.nsp.server.opts.connectionStateRecovery)return;let s=e.type===2,o=e.id===void 0,a=((i=t.flags)===null||i===void 0?void 0:i.volatile)===void 0;s&&o&&a&&e.data.push(n)}broadcastWithAck(e,t,n,i){var s;if(!((s=t?.flags)===null||s===void 0?void 0:s.local)){let a=ls();this.ackRequests.set(a,{clientCountCallback:n,ack:i}),this.publish({type:te.BROADCAST,data:{packet:e,requestId:a,opts:li(t)}}),setTimeout(()=>{this.ackRequests.delete(a)},t.flags.timeout)}super.broadcastWithAck(e,t,n,i)}async addSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:te.SOCKETS_JOIN,data:{opts:li(e),rooms:t}})}catch(s){Se("[%s] error while publishing message: %s",this.uid,s.message)}super.addSockets(e,t)}async delSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:te.SOCKETS_LEAVE,data:{opts:li(e),rooms:t}})}catch(s){Se("[%s] error while publishing message: %s",this.uid,s.message)}super.delSockets(e,t)}async disconnectSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:te.DISCONNECT_SOCKETS,data:{opts:li(e),close:t}})}catch(s){Se("[%s] error while publishing message: %s",this.uid,s.message)}super.disconnectSockets(e,t)}async fetchSockets(e){var t;let[n,i]=await Promise.all([super.fetchSockets(e),this.serverCount()]),s=i-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return n;let o=ls();return new Promise((a,c)=>{let u=setTimeout(()=>{let f=this.requests.get(o);f&&(c(new Error(`timeout reached: only ${f.current} responses received out of ${f.expected}`)),this.requests.delete(o))},e.flags.timeout||Yc),p={type:te.FETCH_SOCKETS,resolve:a,timeout:u,current:0,expected:s,responses:n};this.requests.set(o,p),this.publish({type:te.FETCH_SOCKETS,data:{opts:li(e),requestId:o}})})}async serverSideEmit(e){if(!(typeof e[e.length-1]=="function"))return this.publish({type:te.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),i=await this.serverCount()-1;if(Se('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,i),i<=0)return n(null,[]);let s=ls(),o=setTimeout(()=>{let c=this.requests.get(s);c&&(n(new Error(`timeout reached: only ${c.current} responses received out of ${c.expected}`),c.responses),this.requests.delete(s))},Yc),a={type:te.SERVER_SIDE_EMIT,resolve:n,timeout:o,current:0,expected:i,responses:[]};this.requests.set(s,a),this.publish({type:te.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}publish(e){Se("[%s] sending message %s",this.uid,e.type),this.publishAndReturnOffset(e).catch(t=>{Se("[%s] error while publishing message: %s",this.uid,t)})}publishAndReturnOffset(e){return e.uid=this.uid,e.nsp=this.nsp.name,this.doPublish(e)}publishResponse(e,t){t.uid=this.uid,t.nsp=this.nsp.name,Se("[%s] sending response %s to %s",this.uid,t.type,e),this.doPublishResponse(e,t).catch(n=>{Se("[%s] error while publishing response: %s",this.uid,n)})}};jr.ClusterAdapter=Xc;var Od=class extends Xc{constructor(e,t){super(e),this.nodesMap=new Map,this.customRequests=new Map,this._opts=Object.assign({heartbeatInterval:5e3,heartbeatTimeout:1e4},t),this.cleanupTimer=setInterval(()=>{let n=Date.now();this.nodesMap.forEach((i,s)=>{n-i>this._opts.heartbeatTimeout&&(Se("[%s] node %s seems down",this.uid,s),this.removeNode(s))})},1e3)}init(){this.publish({type:te.INITIAL_HEARTBEAT})}scheduleHeartbeat(){this.heartbeatTimer?this.heartbeatTimer.refresh():this.heartbeatTimer=setTimeout(()=>{this.publish({type:te.HEARTBEAT})},this._opts.heartbeatInterval)}close(){this.publish({type:te.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer&&clearInterval(this.cleanupTimer)}onMessage(e,t){if(e.uid===this.uid)return Se("[%s] ignore message from self",this.uid);switch(e.uid&&e.uid!==y2&&this.nodesMap.set(e.uid,Date.now()),e.type){case te.INITIAL_HEARTBEAT:this.publish({type:te.HEARTBEAT});break;case te.HEARTBEAT:break;case te.ADAPTER_CLOSE:this.removeNode(e.uid);break;default:super.onMessage(e,t)}}serverCount(){return Promise.resolve(1+this.nodesMap.size)}publish(e){return this.scheduleHeartbeat(),super.publish(e)}async serverSideEmit(e){if(!(typeof e[e.length-1]=="function"))return this.publish({type:te.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),i=this.nodesMap.size;if(Se('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,i),i<=0)return n(null,[]);let s=ls(),o=setTimeout(()=>{let c=this.customRequests.get(s);c&&(n(new Error(`timeout reached: missing ${c.missingUids.size} responses`),c.responses),this.customRequests.delete(s))},Yc),a={type:te.SERVER_SIDE_EMIT,resolve:n,timeout:o,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(s,a),this.publish({type:te.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}async fetchSockets(e){var t;let[n,i]=await Promise.all([super.fetchSockets({rooms:e.rooms,except:e.except,flags:{local:!0}}),this.serverCount()]),s=i-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return n;let o=ls();return new Promise((a,c)=>{let u=setTimeout(()=>{let f=this.customRequests.get(o);f&&(c(new Error(`timeout reached: missing ${f.missingUids.size} responses`)),this.customRequests.delete(o))},e.flags.timeout||Yc),p={type:te.FETCH_SOCKETS,resolve:a,timeout:u,missingUids:new Set([...this.nodesMap.keys()]),responses:n};this.customRequests.set(o,p),this.publish({type:te.FETCH_SOCKETS,data:{opts:li(e),requestId:o}})})}onResponse(e){let t=e.data.requestId;switch(Se("[%s] received response %s to request %s",this.uid,e.type,t),e.type){case te.FETCH_SOCKETS_RESPONSE:{let n=this.customRequests.get(t);if(!n)return;e.data.sockets.forEach(i=>n.responses.push(i)),n.missingUids.delete(e.uid),n.missingUids.size===0&&(clearTimeout(n.timeout),n.resolve(n.responses),this.customRequests.delete(t));break}case te.SERVER_SIDE_EMIT_RESPONSE:{let n=this.customRequests.get(t);if(!n)return;n.responses.push(e.data.packet),n.missingUids.delete(e.uid),n.missingUids.size===0&&(clearTimeout(n.timeout),n.resolve(null,n.responses),this.customRequests.delete(t));break}default:super.onResponse(e)}}removeNode(e){this.customRequests.forEach((t,n)=>{t.missingUids.delete(e),t.missingUids.size===0&&(clearTimeout(t.timeout),t.type===te.FETCH_SOCKETS?t.resolve(t.responses):t.type===te.SERVER_SIDE_EMIT&&t.resolve(null,t.responses),this.customRequests.delete(n))}),this.nodesMap.delete(e)}};jr.ClusterAdapterWithHeartbeat=Od});var Jc=O(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.MessageType=ur.ClusterAdapterWithHeartbeat=ur.ClusterAdapter=ur.SessionAwareAdapter=ur.Adapter=void 0;var gb=kd();Object.defineProperty(ur,"Adapter",{enumerable:!0,get:function(){return gb.Adapter}});Object.defineProperty(ur,"SessionAwareAdapter",{enumerable:!0,get:function(){return gb.SessionAwareAdapter}});var Pd=mb();Object.defineProperty(ur,"ClusterAdapter",{enumerable:!0,get:function(){return Pd.ClusterAdapter}});Object.defineProperty(ur,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return Pd.ClusterAdapterWithHeartbeat}});Object.defineProperty(ur,"MessageType",{enumerable:!0,get:function(){return Pd.MessageType}})});var yb=O(us=>{"use strict";var _2=us&&us.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(us,"__esModule",{value:!0});us.ParentNamespace=void 0;var vb=id(),b2=Jc(),w2=_2(Ae()),xb=(0,w2.default)("socket.io:parent-namespace"),Qc=class r extends vb.Namespace{constructor(e){super(e,"/_"+r.count++),this.children=new Set}_initAdapter(){this.adapter=new Md(this)}emit(e,...t){return this.children.forEach(n=>{n.emit(e,...t)}),!0}createChild(e){xb("creating child namespace %s",e);let t=new vb.Namespace(this.server,e);if(this._fns.forEach(n=>t.use(n)),this.listeners("connect").forEach(n=>t.on("connect",n)),this.listeners("connection").forEach(n=>t.on("connection",n)),this.children.add(t),this.server._opts.cleanupEmptyChildNamespaces){let n=t._remove;t._remove=i=>{n.call(t,i),t.sockets.size===0&&(xb("closing child namespace %s",e),t.adapter.close(),this.server._nsps.delete(t.name),this.children.delete(t))}}return this.server._nsps.set(e,t),this.server.sockets.emitReserved("new_namespace",t),t}fetchSockets(){throw new Error("fetchSockets() is not supported on parent namespaces")}};us.ParentNamespace=Qc;Qc.count=0;var Md=class extends b2.Adapter{broadcast(e,t){this.nsp.children.forEach(n=>{n.adapter.broadcast(e,t)})}}});var Tb=O(pi=>{"use strict";var S2=pi&&pi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pi,"__esModule",{value:!0});pi.patchAdapter=T2;pi.restoreAdapter=C2;pi.serveFile=R2;var ui=Jc(),_b=require("fs"),E2=S2(Ae()),Zc=(0,E2.default)("socket.io:adapter-uws"),Id="",{addAll:wb,del:Sb,broadcast:Eb}=ui.Adapter.prototype;function T2(r){ui.Adapter.prototype.addAll=function(e,t){let n=!this.sids.has(e);wb.call(this,e,t);let i=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(i){if(i.conn.transport.name==="websocket"){bb(this.nsp.name,i,n,t);return}n&&i.conn.on("upgrade",()=>{let s=this.sids.get(e);s&&bb(this.nsp.name,i,n,s)})}},ui.Adapter.prototype.del=function(e,t){Sb.call(this,e,t);let n=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(n&&n.conn.transport.name==="websocket"){let i=n.conn.id,s=n.conn.transport.socket,o=`${this.nsp.name}${Id}${t}`;Zc("unsubscribe connection %s from topic %s",i,o),s.unsubscribe(o)}},ui.Adapter.prototype.broadcast=function(e,t){if(!(t.rooms.size<=1&&t.except.size===0)){Eb.call(this,e,t);return}let i=t.flags||{},s={preEncoded:!0,volatile:i.volatile,compress:i.compress};e.nsp=this.nsp.name;let o=this.encoder.encode(e),a=t.rooms.size===0?this.nsp.name:`${this.nsp.name}${Id}${t.rooms.keys().next().value}`;Zc("fast publish to %s",a),o.forEach(c=>{let u=typeof c!="string";r.publish(a,u?c:"4"+c,u)}),this.apply(t,c=>{c.conn.transport.name!=="websocket"&&c.client.writeToEngine(o,s)})}}function bb(r,e,t,n){let i=e.conn.id,s=e.conn.transport.socket;t&&(Zc("subscribe connection %s to topic %s",i,r),s.subscribe(r)),n.forEach(o=>{let a=`${r}${Id}${o}`;Zc("subscribe connection %s to topic %s",i,a),s.subscribe(a)})}function C2(){ui.Adapter.prototype.addAll=wb,ui.Adapter.prototype.del=Sb,ui.Adapter.prototype.broadcast=Eb}var A2=r=>{let{buffer:e,byteOffset:t,byteLength:n}=r;return e.slice(t,t+n)};function R2(r,e){let{size:t}=(0,_b.statSync)(e),n=(0,_b.createReadStream)(e),i=()=>!n.destroyed&&n.destroy(),s=a=>{throw i(),a},o=a=>{let c=A2(a);r.cork(()=>{let u=r.getWriteOffset(),[p,f]=r.tryEnd(c,t);!f&&!p&&(n.pause(),r.onWritable(m=>{let[y,_]=r.tryEnd(c.slice(m-u),t);return!_&&y&&n.resume(),y}))})};r.onAborted(i),n.on("data",o).on("error",s).on("end",i)}});var Cb=O((kW,k2)=>{k2.exports={name:"socket.io",version:"4.8.3",description:"node.js realtime framework server",keywords:["realtime","framework","websocket","tcp","events","socket","io"],files:["dist/","client-dist/","wrapper.mjs","!**/*.tsbuildinfo"],directories:{doc:"docs/",example:"example/",lib:"lib/",test:"test/"},type:"commonjs",main:"./dist/index.js",exports:{".":{types:"./dist/index.d.ts",import:"./wrapper.mjs",require:"./dist/index.js"},"./package.json":"./package.json"},types:"./dist/index.d.ts",license:"MIT",homepage:"https://github.com/socketio/socket.io/tree/main/packages/socket.io#readme",repository:{type:"git",url:"git+https://github.com/socketio/socket.io.git"},bugs:{url:"https://github.com/socketio/socket.io/issues"},scripts:{compile:"rimraf ./dist && tsc",test:"npm run format:check && npm run compile && npm run test:types && npm run test:unit","test:types":"tsd","test:unit":"nyc mocha --import=tsx --reporter spec --slow 200 --bail --timeout 10000 test/index.ts","format:check":'prettier --check "lib/**/*.ts" "test/**/*.ts"',"format:fix":'prettier --write "lib/**/*.ts" "test/**/*.ts"',prepack:"npm run compile"},dependencies:{accepts:"~1.3.4",base64id:"~2.0.0",cors:"~2.8.5",debug:"~4.4.1","engine.io":"~6.6.0","socket.io-adapter":"~2.5.2","socket.io-parser":"~4.2.4"},contributors:[{name:"Guillermo Rauch",email:"rauchg@gmail.com"},{name:"Arnout Kazemier",email:"info@3rd-eden.com"},{name:"Vladimir Dronnikov",email:"dronnikov@gmail.com"},{name:"Einar Otto Stangvik",email:"einaros@gmail.com"}],engines:{node:">=10.2.0"},tsd:{directory:"test"}}});var Nb=O((_t,Eo)=>{"use strict";var O2=_t&&_t.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),P2=_t&&_t.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),M2=_t&&_t.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&O2(e,r,t);return P2(e,r),e},Dd=_t&&_t.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_t,"__esModule",{value:!0});_t.Namespace=_t.Socket=_t.Server=void 0;var I2=Dd(require("http")),N2=require("fs"),Nd=require("zlib"),L2=$a(),el=require("stream"),Ab=require("path"),Rb=U0(),D2=Z0(),kb=require("events"),Bd=id();Object.defineProperty(_t,"Namespace",{enumerable:!0,get:function(){return Bd.Namespace}});var B2=yb(),Ob=Jc(),j2=M2(ho()),F2=Dd(Ae()),Ib=rd();Object.defineProperty(_t,"Socket",{enumerable:!0,get:function(){return Ib.Socket}});var H2=kc(),Ld=Tb(),$2=Dd(Df()),kt=(0,F2.default)("socket.io:server"),Pb=Cb().version,Mb=/\.map/,ps=class r extends H2.StrictEventEmitter{constructor(e,t={}){super(),this._nsps=new Map,this.parentNsps=new Map,this.parentNamespacesFromRegExp=new Map,typeof e=="object"&&e instanceof Object&&!e.listen&&(t=e,e=void 0),this.path(t.path||"/socket.io"),this.connectTimeout(t.connectTimeout||45e3),this.serveClient(t.serveClient!==!1),this._parser=t.parser||j2,this.encoder=new this._parser.Encoder,this.opts=t,t.connectionStateRecovery?(t.connectionStateRecovery=Object.assign({maxDisconnectionDuration:120*1e3,skipMiddlewares:!0},t.connectionStateRecovery),this.adapter(t.adapter||Ob.SessionAwareAdapter)):this.adapter(t.adapter||Ob.Adapter),t.cleanupEmptyChildNamespaces=!!t.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),(e||typeof e=="number")&&this.attach(e),this.opts.cors&&(this._corsMiddleware=(0,$2.default)(this.opts.cors))}get _opts(){return this.opts}serveClient(e){return arguments.length?(this._serveClient=e,this):this._serveClient}_checkNamespace(e,t,n){if(this.parentNsps.size===0)return n(!1);let i=this.parentNsps.keys(),s=()=>{let o=i.next();if(o.done)return n(!1);o.value(e,t,(a,c)=>{if(a||!c)return s();if(this._nsps.has(e))return kt("dynamic namespace %s already exists",e),n(this._nsps.get(e));let u=this.parentNsps.get(o.value).createChild(e);kt("dynamic namespace %s was created",e),n(u)})};s()}path(e){if(!arguments.length)return this._path;this._path=e.replace(/\/$/,"");let t=this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return this.clientPathRegex=new RegExp("^"+t+"/socket\\.io(\\.msgpack|\\.esm)?(\\.min)?\\.js(\\.map)?(?:\\?|$)"),this}connectTimeout(e){return e===void 0?this._connectTimeout:(this._connectTimeout=e,this)}adapter(e){if(!arguments.length)return this._adapter;this._adapter=e;for(let t of this._nsps.values())t._initAdapter();return this}listen(e,t={}){return this.attach(e,t)}attach(e,t={}){if(typeof e=="function"){let n="You are trying to attach socket.io to an express request handler function. Please pass a http.Server instance.";throw new Error(n)}if(Number(e)==e&&(e=Number(e)),typeof e=="number"){kt("creating http server and binding to %d",e);let n=e;e=I2.default.createServer((i,s)=>{s.writeHead(404),s.end()}),e.listen(n)}return Object.assign(t,this.opts),t.path=t.path||this._path,this.initEngine(e,t),this}attachApp(e,t={}){Object.assign(t,this.opts),t.path=t.path||this._path,kt("creating uWebSockets.js-based engine with opts %j",t);let n=new Rb.uServer(t);n.attach(e,t),this.bind(n),this._serveClient&&e.get(`${this._path}/*`,(i,s)=>{if(!this.clientPathRegex.test(s.getUrl())){s.setYield(!0);return}let o=s.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),a=Mb.test(o),c=a?"map":"source",u='"'+Pb+'"',p="W/"+u,f=s.getHeader("if-none-match");if(f&&(u===f||p===f)){kt("serve client %s 304",c),i.writeStatus("304 Not Modified"),i.end();return}kt("serve client %s",c),i.writeHeader("cache-control","public, max-age=0"),i.writeHeader("content-type","application/"+(a?"json":"javascript")+"; charset=utf-8"),i.writeHeader("etag",u);let m=Ab.join(__dirname,"../client-dist/",o);(0,Ld.serveFile)(i,m)}),(0,Ld.patchAdapter)(e)}initEngine(e,t){kt("creating engine.io instance with opts %j",t),this.eio=(0,Rb.attach)(e,t),this._serveClient&&this.attachServe(e),this.httpServer=e,this.bind(this.eio)}attachServe(e){kt("attaching client serving req handler");let t=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("request",(n,i)=>{if(this.clientPathRegex.test(n.url))this._corsMiddleware?this._corsMiddleware(n,i,()=>{this.serve(n,i)}):this.serve(n,i);else for(let s=0;s<t.length;s++)t[s].call(e,n,i)})}serve(e,t){let n=e.url.replace(this._path,"").replace(/\?.*$/,""),i=Mb.test(n),s=i?"map":"source",o='"'+Pb+'"',a="W/"+o,c=e.headers["if-none-match"];if(c&&(o===c||a===c)){kt("serve client %s 304",s),t.writeHead(304),t.end();return}kt("serve client %s",s),t.setHeader("Cache-Control","public, max-age=0"),t.setHeader("Content-Type","application/"+(i?"json":"javascript")+"; charset=utf-8"),t.setHeader("ETag",o),r.sendFile(n,e,t)}static sendFile(e,t,n){let i=(0,N2.createReadStream)(Ab.join(__dirname,"../client-dist/",e)),s=L2(t).encodings(["br","gzip","deflate"]),o=a=>{a&&n.end()};switch(s){case"br":n.writeHead(200,{"content-encoding":"br"}),(0,el.pipeline)(i,(0,Nd.createBrotliCompress)(),n,o);break;case"gzip":n.writeHead(200,{"content-encoding":"gzip"}),(0,el.pipeline)(i,(0,Nd.createGzip)(),n,o);break;case"deflate":n.writeHead(200,{"content-encoding":"deflate"}),(0,el.pipeline)(i,(0,Nd.createDeflate)(),n,o);break;default:n.writeHead(200),(0,el.pipeline)(i,n,o)}}bind(e){return this.engine=e,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(e){kt("incoming connection with id %s",e.id);let t=new D2.Client(this,e);return e.protocol===3&&t.connect("/"),this}of(e,t){if(typeof e=="function"||e instanceof RegExp){let i=new B2.ParentNamespace(this);return kt("initializing parent namespace %s",i.name),typeof e=="function"?this.parentNsps.set(e,i):(this.parentNsps.set((s,o,a)=>a(null,e.test(s)),i),this.parentNamespacesFromRegExp.set(e,i)),t&&i.on("connect",t),i}String(e)[0]!=="/"&&(e="/"+e);let n=this._nsps.get(e);if(!n){for(let[i,s]of this.parentNamespacesFromRegExp)if(i.test(e))return kt("attaching namespace %s to parent namespace %s",e,i),s.createChild(e);kt("initializing namespace %s",e),n=new Bd.Namespace(this,e),this._nsps.set(e,n),e!=="/"&&this.sockets.emitReserved("new_namespace",n)}return t&&n.on("connect",t),n}async close(e){if(await Promise.allSettled([...this._nsps.values()].map(async t=>{t.sockets.forEach(n=>{n._onclose("server shutting down")}),await t.adapter.close()})),this.engine.close(),(0,Ld.restoreAdapter)(),this.httpServer)return new Promise(t=>{this.httpServer.close(n=>{e&&e(n),n&&kt("server was not running"),t()})});e&&e()}use(e){return this.sockets.use(e),this}to(e){return this.sockets.to(e)}in(e){return this.sockets.in(e)}except(e){return this.sockets.except(e)}send(...e){return this.sockets.emit("message",...e),this}write(...e){return this.sockets.emit("message",...e),this}serverSideEmit(e,...t){return this.sockets.serverSideEmit(e,...t)}serverSideEmitWithAck(e,...t){return this.sockets.serverSideEmitWithAck(e,...t)}allSockets(){return this.sockets.allSockets()}compress(e){return this.sockets.compress(e)}get volatile(){return this.sockets.volatile}get local(){return this.sockets.local}timeout(e){return this.sockets.timeout(e)}fetchSockets(){return this.sockets.fetchSockets()}socketsJoin(e){return this.sockets.socketsJoin(e)}socketsLeave(e){return this.sockets.socketsLeave(e)}disconnectSockets(e=!1){return this.sockets.disconnectSockets(e)}};_t.Server=ps;var q2=Object.keys(kb.EventEmitter.prototype).filter(function(r){return typeof kb.EventEmitter.prototype[r]=="function"});q2.forEach(function(r){ps.prototype[r]=function(){return this.sockets[r].apply(this.sockets,arguments)}});Eo.exports=(r,e)=>new ps(r,e);Eo.exports.Server=ps;Eo.exports.Namespace=Bd.Namespace;Eo.exports.Socket=Ib.Socket});function jd(){return To=(0,Bb.randomBytes)(32).toString("hex"),To}function jb(){return To||jd(),To}function Fb(r){return!!r&&typeof r=="string"&&r===To}var Bb,To,tl=Ce(()=>{Bb=require("crypto"),To=null});var Ub,nl,Z,bt=Ce(()=>{Ub={darwin:{capture:"robotjs",encoder:"sharp",tileSize:128,inputFormat:"bgra"},win32:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"},linux:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"}},nl=Ub[process.platform]||Ub.linux,Z={pipeline:{captureLib:nl.capture,encoder:nl.encoder,inputFormat:nl.inputFormat,tileSize:nl.tileSize,jpegQuality:50,outputScale:1,adaptiveTiers:[{minEffective:1,outputScale:1,jpegQuality:72},{minEffective:.7,outputScale:.95,jpegQuality:62},{minEffective:.4,outputScale:.8,jpegQuality:52},{minEffective:0,outputScale:.65,jpegQuality:45}],tierHysteresis:.05},webrtc:{enableWebRTC:!0,enableTurn:!1,turnApiUrl:"https://9remote.cc/api/webrtc/turn-credentials",turnRefreshInterval:1380*60*1e3,dcMaxMessageSize:65536,dcBufferThreshold:65536,dcChunkSize:8,dcMaxTilesPerFrame:32,dcReliable:!0,dcOrdered:!1,answerTimeout:1e4},robotSettings:{mouseDelay:2,keyboardDelay:2},throttling:{mouseThrottle:8,keyThrottle:25,typeTextThrottle:100,maxTextLength:1e3},resourceManagement:{inactiveTimeout:120*1e3,memoryCheckInterval:6e4,memoryWarningThreshold:1e3,maxTimersPerClient:100,maxChunkTimersPerClient:50},streaming:{activeInterval:60,idleInterval:400,idleThreshold:3,actionCaptureDelay:50,chunkSize:32,chunkDelay:5},focus:{paddingTiles:4},displayWake:{enabled:!0,throttleMs:3e4,macDurationSec:5},sleepInhibit:{defaultMode:"never",presets:{"30m":1800*1e3,"1h":3600*1e3,"2h":7200*1e3,"4h":14400*1e3,"24h":1440*60*1e3,never:null}},desktopSwitch:{darwin:{prev:{keyCode:123,mods:"control down"},next:{keyCode:124,mods:"control down"},new:{type:"missionControl"}},win32:{prev:["left",["control","command"]],next:["right",["control","command"]],new:["d",["control","command"]]},linux:{prev:null,next:null,new:null}},logging:{lifecycle:!1,errors:!0,dpiDetection:!1,focus:!1,focusEveryFrames:60,metrics:!1,metricsEveryFrames:30,webrtc:!1}}});var Co,Ao,ve,Hd=Ce(()=>{bt();Mi();Co=()=>Z.logging,Ao=Rn("remote"),ve={lifecycle:r=>{Co().lifecycle&&Ao.info(r)},focus:r=>{Co().focus&&Ao.info(r)},dpi:r=>{Co().dpiDetection&&Ao.info(r)},error:(r,e)=>{Co().errors&&Ao.error(`${r} ${e?.message||e||""}`)},warn:r=>{Co().errors&&Ao.warn(r)}}});var Xb={};Xr(Xb,{ScreenHandler:()=>$d,encodeTilesBatch:()=>ds});function J2(r){let e=Buffer.alloc(28);return e.writeUInt32LE(r.tileIndex,0),e.writeUInt32LE(r.x,4),e.writeUInt32LE(r.y,8),e.writeUInt32LE(r.width,12),e.writeUInt32LE(r.height,16),e.writeUInt32LE(r.imageBuffer.length,20),e.writeUInt32LE(r.hash>>>0,24),Buffer.concat([e,r.imageBuffer])}function ds(r,e){let t=Buffer.alloc(12);return t.writeUInt32LE(r.length,0),t.writeDoubleBE(e,4),Buffer.concat([t,...r.map(J2)])}var $d,qd=Ce(()=>{Hd();$d=class{constructor(e,t){this.resourceManager=e,this.screenUpdateHelper=t}setupScreenHandlers(e,t,n){e.on("request-screen",t(async()=>{let i=this.resourceManager.getClient(e.id);if(i)try{let s=await i.tileManager.detectChangedTiles();s.length>0&&n.sendTiles({tiles:s,timestamp:Date.now()},ds),this.resourceManager.updateClientActivity(e.id)}catch(s){ve.error("Tile capture error:",s),n.emit("screen-error",{error:s.message})}})),e.on("request-screen-with-hashes",t(async i=>{let s=this.resourceManager.getClient(e.id);if(s)try{let o=i.tileHashes||[],a=await s.tileManager.compareClientTileHashes(o);a?.tiles?.length>0&&n.sendTiles({tiles:a.tiles,timestamp:Date.now()},ds),this.resourceManager.updateClientActivity(e.id)}catch(o){ve.error("Tile capture with hashes error:",o),n.emit("screen-error",{error:o.message})}})),e.on("start-streaming",t(async()=>{let i=this.resourceManager.getClient(e.id);if(!i)return;i.streamingTimeout&&(clearTimeout(i.streamingTimeout),i.streamingTimeout=null),ve.lifecycle("\u{1F680} Remote streaming started"),i.idleFrameCount=0,i.isStreaming=!0,i.streamGen=(i.streamGen||0)+1;let s=i.streamGen;i.tileManager.lastTileChecksums.clear();try{let a=await i.tileManager.getScreenDimensions();n.emit("screen-dimensions",a)}catch(a){ve.error("Get dimensions error:",a)}let o=async()=>{if(!e.connected||!i.isStreaming||i.streamGen!==s){i.streamingTimeout=null;return}try{let a=performance.now(),c=await i.tileManager.detectChangedTilesWithHashes();c.tiles.length>0&&e.connected?(n.sendTiles({tiles:c.tiles,timestamp:Date.now(),currentHashes:c.currentHashes},ds),i.idleFrameCount=0):i.idleFrameCount++;let{activeInterval:u,idleInterval:p,idleThreshold:f}=this.resourceManager.getStreamingConfig(),m=i.idleFrameCount>=f?p:u,y=Math.max(0,m-(performance.now()-a));i.streamingTimeout=setTimeout(o,y)}catch(a){ve.error("Auto streaming error:",a),i.streamingTimeout=setTimeout(o,200)}};o()})),e.on("stop-streaming",()=>{let i=this.resourceManager.getClient(e.id);i&&(i.isStreaming=!1,i.streamingTimeout&&(clearTimeout(i.streamingTimeout),i.streamingTimeout=null),ve.lifecycle("\u23F9\uFE0F Remote streaming stopped"))}),e.on("get-screen-dimensions",t(async()=>{let i=this.resourceManager.getClient(e.id);if(i)try{let s=await i.tileManager.getScreenDimensions();n.emit("screen-dimensions",s)}catch(s){ve.error("Get dimensions error:",s),n.emit("screen-error",{error:s.message})}})),e.on("boost-stream",t(()=>{let i=this.resourceManager.getClient(e.id);i&&(i.idleFrameCount=0)})),e.on("set-focus",t(i=>{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=i?.rect||null,a=typeof i?.zoom=="number"?i.zoom:1,c=typeof i?.viewerWidth=="number"?i.viewerWidth:0,u=typeof i?.dpr=="number"?i.dpr:1,p=s.tileManager.pickProfile({zoom:a,viewerWidth:c,dpr:u});if(s.tileManager.setProfile(p),s.tileManager.setFocusRect(o),o){let f=s.tileManager.activeTileSet?.size||0,m=s.tileManager.totalTiles,y=m?(f/m*100).toFixed(0):0;ve.focus(`\u{1F3AF} [Focus] rect=${o.x},${o.y} ${o.w}x${o.h} | tiles ${f}/${m} (${y}%)`)}else ve.focus("\u{1F3AF} [Focus] cleared \u2192 full screen")}))}}});async function dw(){if(ko)return ko;let r=await import("node-screenshots");if(ko=(r.Monitor||r.default?.Monitor).all()[0],!ko)throw new Error("No monitor found via node-screenshots");return ko}async function hw(r){Xd=r,Z.pipeline.captureLib==="nodeScreenshots"&&await dw()}async function mw(){let{captureLib:r,inputFormat:e}=Z.pipeline;if(r==="robotjs"){let{width:s,height:o}=Xd.getScreenSize(),a=Xd.screen.capture(0,0,s,o),c=a.byteWidth/a.bytesPerPixel;return{buffer:Buffer.from(a.image),width:c,height:a.height,channels:a.bytesPerPixel,format:e}}let n=(await dw()).captureImageSync();return{buffer:n.toRawSync?n.toRawSync():n.rawSync(),width:n.width,height:n.height,channels:4,format:e}}var Xd,ko,gw=Ce(()=>{bt();Xd=null,ko=null});function pB(r){return r==="bgra"?Qd.FORMAT_BGRA:Qd.FORMAT_RGBA}function Zd(r){let e=new Uint32Array(r.buffer,r.byteOffset,r.length>>2);for(let t=0;t<e.length;t++){let n=e[t];e[t]=n&4278255360|(n&16711680)>>16|(n&255)<<16}}async function eh(r,e,t,n=4,i,s){let{encoder:o,inputFormat:a,jpegQuality:c}=Z.pipeline,u=i??c,p=s??a;if(o==="jpegTurbo")return Qd.compressSync(r,{width:e,height:t,format:pB(p),quality:u});let f=r;return p==="bgra"&&(f=Buffer.from(r),Zd(f)),(0,vw.default)(f,{raw:{width:e,height:t,channels:n}}).jpeg({quality:u}).toBuffer()}var vw,Jd,Qd,xw=Ce(()=>{vw=X(require("sharp"),1),Jd=X(require("@julusian/jpeg-turbo"),1);bt();Qd=Jd.default.default||Jd.default});function Po(){for(let r of[oe.ROOT,oe.STATE])Hr.default.existsSync(r)||Hr.default.mkdirSync(r,{recursive:!0})}function nh(){try{return Po(),Hr.default.existsSync(rh)?JSON.parse(Hr.default.readFileSync(rh,"utf8"))||{}:{}}catch{return{}}}function yw(r){try{Po();let e={...nh(),...r};return Hr.default.writeFileSync(rh,JSON.stringify(e,null,2),{mode:384}),e}catch(e){return console.error("Error saving settings:",e),null}}function _w(){try{return Po(),Hr.default.existsSync(th)?JSON.parse(Hr.default.readFileSync(th,"utf8")):{machineId:null,key:null,name:"Default",createdAt:null}}catch{return{machineId:null,key:null,name:"Default",createdAt:null}}}function Mo(r){try{Po(),Hr.default.writeFileSync(fB,JSON.stringify({cmd:r,ts:Date.now()}))}catch{}}function bw(r,e,t="Default"){try{Po();let n={machineId:r,key:e,name:t,createdAt:new Date().toISOString()};return Hr.default.writeFileSync(th,JSON.stringify(n,null,2),{mode:384}),n}catch(n){return console.error("Error saving key:",n),null}}var Hr,Oo,m8,g8,th,fB,rh,Io=Ce(()=>{Hr=X(require("fs"),1),Oo=X(require("path"),1);vt();m8=oe.STATE,g8=Oo.default.join(oe.STATE,"state.json"),th=Oo.default.join(oe.ROOT,"keys.json"),fB=Oo.default.join(oe.STATE,"cmd.json"),rh=Oo.default.join(oe.STATE,"settings.json")});function ww(){return new Promise(r=>{if(process.platform!=="darwin"){r({screenRecording:!0,accessibility:!0});return}let e=!1,t=!1,n=0,i=()=>{++n===2&&r({screenRecording:e,accessibility:t})};(0,No.execFile)("osascript",["-e",'use framework "ApplicationServices"',"-e",`set checkOptions to current application's NSDictionary's dictionaryWithObject:(false) forKey:("AXTrustedCheckOptionPrompt" as string)`,"-e","return current application's AXIsProcessTrustedWithOptions(checkOptions) as boolean"],{timeout:3e3},(s,o)=>{t=!s&&o.trim()==="true",i()}),(0,No.exec)(`osascript -e 'use framework "CoreGraphics"' -e "return (current application's CGPreflightScreenCaptureAccess()) as boolean"`,{timeout:3e3},(s,o)=>{e=!s&&o.trim()==="true",i()})})}function Sw(r){let e=dB[r];e&&process.platform==="darwin"&&(0,No.exec)(`open "${e}"`,()=>{})}var No,dB,Ew=Ce(()=>{No=require("child_process"),dB={screenRecording:"x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture",accessibility:"x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"}});function hB(){return!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY}function bl(){for(let r=Tw,e=null;r!==e;e=r,r=$r.default.dirname(r)){let t=$r.default.join(r,"package.json");if((0,Ee.existsSync)(t)){try{let n=JSON.parse((0,Ee.readFileSync)(t,"utf8"));if(n.name!=="9remote")continue;let i=typeof n.bin=="string"?n.bin:n.bin?.["9remote"];if(i){let s=$r.default.resolve(r,i);if((0,Ee.existsSync)(s))return s}}catch{}break}}return $r.default.resolve(Tw,"..","index.js")}function Bo(){return process.execPath}function Rw(){let r=$r.default.dirname(Bo()),e=["/usr/local/bin","/usr/bin","/bin","/usr/sbin","/sbin","/opt/homebrew/bin"];return e.includes(r)||e.unshift(r),e.join(":")}function ih(r){return String(r).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function mB(r,e){let t=[r,e,..._l].map(n=>` <string>${ih(n)}</string>`).join(`
30
30
  `);return`<?xml version="1.0" encoding="UTF-8"?>
31
31
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
32
32
  <plist version="1.0">
33
33
  <dict>
34
34
  <key>Label</key>
35
- <string>${ms}</string>
35
+ <string>${gs}</string>
36
36
  <key>ProgramArguments</key>
37
37
  <array>
38
38
  ${t}
@@ -44,9 +44,9 @@ ${t}
44
44
  <key>EnvironmentVariables</key>
45
45
  <dict>
46
46
  <key>PATH</key>
47
- <string>${nh(Cw())}</string>
47
+ <string>${ih(Rw())}</string>
48
48
  <key>HOME</key>
49
- <string>${nh(Lo)}</string>
49
+ <string>${ih(Do)}</string>
50
50
  </dict>
51
51
  <key>StandardOutPath</key>
52
52
  <string>${vl}</string>
@@ -54,86 +54,86 @@ ${t}
54
54
  <string>${vl}</string>
55
55
  </dict>
56
56
  </plist>
57
- `}function fB(){return(0,Ee.mkdirSync)($r.default.dirname(kt.darwin),{recursive:!0}),(0,Ee.writeFileSync)(kt.darwin,pB(Do(),bl())),!0}function dB(){if((0,Ee.existsSync)(kt.darwin))try{(0,Ee.unlinkSync)(kt.darwin)}catch{}return!0}function hB(){return(0,Ee.existsSync)(kt.darwin)}function mB(){return`"${Do()}" "${bl()}" ${_l.join(" ")}`}function ih(r){return new Promise(e=>{(0,yl.execFile)("reg",r,{windowsHide:!0},(t,n)=>{e({ok:!t,stdout:n||""})})})}async function gB(){let r=mB(),{ok:e}=await ih(["ADD","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run","/V",gs,"/t","REG_SZ","/D",r,"/F"]);return e}async function vB(){return await ih(["DELETE","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run","/V",gs,"/F"]),!0}async function xB(){let{ok:r,stdout:e}=await ih(["QUERY","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run","/V",gs]);return r&&e.includes(gs)}function yB(){let r=`${Do()} ${bl()} ${_l.join(" ")}`;return`[Desktop Entry]
57
+ `}function gB(){return(0,Ee.mkdirSync)($r.default.dirname(Ot.darwin),{recursive:!0}),(0,Ee.writeFileSync)(Ot.darwin,mB(Bo(),bl())),!0}function vB(){if((0,Ee.existsSync)(Ot.darwin))try{(0,Ee.unlinkSync)(Ot.darwin)}catch{}return!0}function xB(){return(0,Ee.existsSync)(Ot.darwin)}function yB(){return`"${Bo()}" "${bl()}" ${_l.join(" ")}`}function sh(r){return new Promise(e=>{(0,yl.execFile)("reg",r,{windowsHide:!0},(t,n)=>{e({ok:!t,stdout:n||""})})})}async function _B(){let r=yB(),{ok:e}=await sh(["ADD","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run","/V",vs,"/t","REG_SZ","/D",r,"/F"]);return e}async function bB(){return await sh(["DELETE","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run","/V",vs,"/F"]),!0}async function wB(){let{ok:r,stdout:e}=await sh(["QUERY","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run","/V",vs]);return r&&e.includes(vs)}function SB(){let r=`${Bo()} ${bl()} ${_l.join(" ")}`;return`[Desktop Entry]
58
58
  Type=Application
59
- Name=${gs}
59
+ Name=${vs}
60
60
  Exec=${r}
61
61
  X-GNOME-Autostart-enabled=true
62
62
  NoDisplay=false
63
63
  Terminal=false
64
- `}function _B(){let r=_l.map(e=>`'${e}'`).join(" ");return`[Unit]
65
- Description=${gs} Agent
64
+ `}function EB(){let r=_l.map(e=>`'${e}'`).join(" ");return`[Unit]
65
+ Description=${vs} Agent
66
66
  After=network-online.target
67
67
  Wants=network-online.target
68
68
 
69
69
  [Service]
70
70
  Type=simple
71
- ExecStart=${Do()} ${bl()} ${r}
71
+ ExecStart=${Bo()} ${bl()} ${r}
72
72
  Restart=always
73
73
  RestartSec=10
74
- Environment=PATH=${Cw()}
75
- Environment=HOME=${Lo}
74
+ Environment=PATH=${Rw()}
75
+ Environment=HOME=${Do}
76
76
  StandardOutput=append:${vl}
77
77
  StandardError=append:${vl}
78
78
 
79
79
  [Install]
80
80
  WantedBy=default.target
81
- `}function xl(r){try{return(0,yl.execFileSync)("systemctl",["--user",...r],{stdio:"ignore"}),!0}catch{return!1}}function bB(){return uB()?((0,Ee.mkdirSync)($r.default.dirname(kt.linuxSystemd),{recursive:!0}),(0,Ee.writeFileSync)(kt.linuxSystemd,_B()),xl(["daemon-reload"]),xl(["enable",`${ms}.service`]),!0):((0,Ee.mkdirSync)($r.default.dirname(kt.linux),{recursive:!0}),(0,Ee.writeFileSync)(kt.linux,yB()),!0)}function wB(){if((0,Ee.existsSync)(kt.linuxSystemd)){xl(["disable",`${ms}.service`]);try{(0,Ee.unlinkSync)(kt.linuxSystemd)}catch{}xl(["daemon-reload"])}if((0,Ee.existsSync)(kt.linux))try{(0,Ee.unlinkSync)(kt.linux)}catch{}return!0}function SB(){return(0,Ee.existsSync)(kt.linux)||(0,Ee.existsSync)(kt.linuxSystemd)}async function sh(){try{if(process.platform==="darwin")return hB();if(process.platform==="win32")return await xB();if(process.platform==="linux")return SB()}catch{}return!1}async function Aw(r){try{if(process.platform==="darwin")return r?fB():dB();if(process.platform==="win32")return r?await gB():await vB();if(process.platform==="linux")return r?bB():wB()}catch{}return!1}var yl,Ee,No,Ew,$r,Tw,vl,ms,gs,_l,Lo,Sw,kt,Rw=Te(()=>{yl=require("child_process"),Ee=require("fs"),No=require("path"),Ew=X(require("os"),1),$r=X(require("path"),1),Tw=require("url");gt();vl=(0,No.join)(oe.LOGS,"autostart.log"),ms="cc.9remote.agent",gs="9Remote",_l=["--tray","--skip-update","--start"],Lo=Ew.default.homedir(),Sw=$r.default.dirname((0,Tw.fileURLToPath)(__importMetaUrl)),kt={darwin:(0,No.join)(Lo,"Library","LaunchAgents",`${ms}.plist`),linux:(0,No.join)(Lo,".config","autostart",`${ms}.desktop`),linuxSystemd:(0,No.join)(Lo,".config","systemd","user",`${ms}.service`)}});function EB(){Bo.default.existsSync(oe.CONFIG)||Bo.default.mkdirSync(oe.CONFIG,{recursive:!0})}function jo(){try{return JSON.parse(Bo.default.readFileSync(Ow,"utf8"))||{}}catch{return{}}}function wl(r){try{EB();let e={...jo(),...r};return Bo.default.writeFileSync(Ow,JSON.stringify(e,null,2)),e}catch{return null}}var Bo,kw,Ow,oh=Te(()=>{Bo=X(require("fs"),1),kw=X(require("path"),1);gt();Ow=kw.default.join(oe.CONFIG,"settings.json")});var Tl={};Xr(Tl,{getMode:()=>ph,isActive:()=>uh,onConnectionChange:()=>OB,setMode:()=>Ho,start:()=>kB,stop:()=>lh});function CB(){Pw||(Pw=!0,process.on("exit",()=>{if(Bt){try{Bt.kill()}catch{}Bt=null}}))}function Sl(){if(Bt)return;let r=TB[process.platform];if(r)try{Bt=(0,Mw.spawn)(r.cmd,r.args,{stdio:"ignore",windowsHide:!0}),Bt.on("error",e=>{El.warn(`inhibitor error: ${e.message}`),Bt=null}),Bt.on("exit",()=>{Bt=null}),CB(),El.info(`\u{1F4A4} Sleep inhibitor started (${r.cmd})`)}catch(e){El.warn(`Failed to start sleep inhibitor: ${e.message}`),Bt=null}}function Iw(){if(Bt){try{Bt.kill()}catch{}Bt=null,El.info("\u{1F4A4} Sleep inhibitor stopped")}}function Nw(){Fo&&(clearTimeout(Fo),Fo=null)}function AB(r){return(Z.sleepInhibit?.presets||{})[r]??null}function RB(r){let e=Z.sleepInhibit?.presets||{};return Object.prototype.hasOwnProperty.call(e,r)}function ch(){if(Nw(),vs==="never"){Sl();return}let r=AB(vs);if(r==null){Sl();return}if(ah>0){Sl();return}Sl(),Fo=setTimeout(()=>{Fo=null,ah===0&&Iw()},r)}function kB(){ch()}function lh(){Nw(),Iw()}function uh(){return Bt!==null}function ph(){return vs}function Ho(r){return RB(r)&&(vs=r,ch()),vs}function OB(r){ah=r,ch()}var Mw,El,TB,Bt,vs,Fo,ah,Pw,Cl=Te(()=>{Mw=require("child_process");bt();Pi();El=An("sleep"),TB={darwin:{cmd:"caffeinate",args:["-imsd"]},linux:{cmd:"systemd-inhibit",args:["--what=idle:sleep:handle-lid-switch","--who=9remote","--why=remote-active","sleep","infinity"]},win32:{cmd:"powershell.exe",args:["-NonInteractive","-NoProfile","-WindowStyle","Hidden","-Command",`Add-Type -Name K -Namespace W -MemberDefinition '[System.Runtime.InteropServices.DllImport("kernel32")]public static extern uint SetThreadExecutionState(uint e);'; [void][W.K]::SetThreadExecutionState(0x80000041); while($true){Start-Sleep 3600}`]}},Bt=null,vs=Z.sleepInhibit?.defaultMode||"never",Fo=null,ah=0,Pw=!1});function PB(){(0,Fn.mkdirSync)(oe.STATE,{recursive:!0})}function Dw(){try{if((0,Fn.existsSync)(fh)){let r=JSON.parse((0,Fn.readFileSync)(fh,"utf8"));r.step===Oi.READY&&r.permanentKey&&(dn={...dn,...r})}}catch{}}function MB(){try{PB(),(0,Fn.writeFileSync)(fh,JSON.stringify(dn),{mode:384})}catch{}}function Bw(){jt=!!jo().desktopEnabled}function dh(){wl({desktopEnabled:jt})}function St(r,e){let t=`data: ${JSON.stringify({type:r,...e})}
81
+ `}function xl(r){try{return(0,yl.execFileSync)("systemctl",["--user",...r],{stdio:"ignore"}),!0}catch{return!1}}function TB(){return hB()?((0,Ee.mkdirSync)($r.default.dirname(Ot.linuxSystemd),{recursive:!0}),(0,Ee.writeFileSync)(Ot.linuxSystemd,EB()),xl(["daemon-reload"]),xl(["enable",`${gs}.service`]),!0):((0,Ee.mkdirSync)($r.default.dirname(Ot.linux),{recursive:!0}),(0,Ee.writeFileSync)(Ot.linux,SB()),!0)}function CB(){if((0,Ee.existsSync)(Ot.linuxSystemd)){xl(["disable",`${gs}.service`]);try{(0,Ee.unlinkSync)(Ot.linuxSystemd)}catch{}xl(["daemon-reload"])}if((0,Ee.existsSync)(Ot.linux))try{(0,Ee.unlinkSync)(Ot.linux)}catch{}return!0}function AB(){return(0,Ee.existsSync)(Ot.linux)||(0,Ee.existsSync)(Ot.linuxSystemd)}async function oh(){try{if(process.platform==="darwin")return xB();if(process.platform==="win32")return await wB();if(process.platform==="linux")return AB()}catch{}return!1}async function kw(r){try{if(process.platform==="darwin")return r?gB():vB();if(process.platform==="win32")return r?await _B():await bB();if(process.platform==="linux")return r?TB():CB()}catch{}return!1}var yl,Ee,Lo,Cw,$r,Aw,vl,gs,vs,_l,Do,Tw,Ot,Ow=Ce(()=>{yl=require("child_process"),Ee=require("fs"),Lo=require("path"),Cw=X(require("os"),1),$r=X(require("path"),1),Aw=require("url");vt();vl=(0,Lo.join)(oe.LOGS,"autostart.log"),gs="cc.9remote.agent",vs="9Remote",_l=["--tray","--skip-update","--start"],Do=Cw.default.homedir(),Tw=$r.default.dirname((0,Aw.fileURLToPath)(__importMetaUrl)),Ot={darwin:(0,Lo.join)(Do,"Library","LaunchAgents",`${gs}.plist`),linux:(0,Lo.join)(Do,".config","autostart",`${gs}.desktop`),linuxSystemd:(0,Lo.join)(Do,".config","systemd","user",`${gs}.service`)}});function RB(){jo.default.existsSync(oe.CONFIG)||jo.default.mkdirSync(oe.CONFIG,{recursive:!0})}function Fo(){try{return JSON.parse(jo.default.readFileSync(Mw,"utf8"))||{}}catch{return{}}}function wl(r){try{RB();let e={...Fo(),...r};return jo.default.writeFileSync(Mw,JSON.stringify(e,null,2)),e}catch{return null}}var jo,Pw,Mw,ah=Ce(()=>{jo=X(require("fs"),1),Pw=X(require("path"),1);vt();Mw=Pw.default.join(oe.CONFIG,"settings.json")});var Tl={};Xr(Tl,{getMode:()=>fh,isActive:()=>ph,onConnectionChange:()=>NB,setMode:()=>$o,start:()=>IB,stop:()=>uh});function OB(){Iw||(Iw=!0,process.on("exit",()=>{if(Bt){try{Bt.kill()}catch{}Bt=null}}))}function Sl(){if(Bt)return;let r=kB[process.platform];if(r)try{Bt=(0,Nw.spawn)(r.cmd,r.args,{stdio:"ignore",windowsHide:!0}),Bt.on("error",e=>{El.warn(`inhibitor error: ${e.message}`),Bt=null}),Bt.on("exit",()=>{Bt=null}),OB(),El.info(`\u{1F4A4} Sleep inhibitor started (${r.cmd})`)}catch(e){El.warn(`Failed to start sleep inhibitor: ${e.message}`),Bt=null}}function Lw(){if(Bt){try{Bt.kill()}catch{}Bt=null,El.info("\u{1F4A4} Sleep inhibitor stopped")}}function Dw(){Ho&&(clearTimeout(Ho),Ho=null)}function PB(r){return(Z.sleepInhibit?.presets||{})[r]??null}function MB(r){let e=Z.sleepInhibit?.presets||{};return Object.prototype.hasOwnProperty.call(e,r)}function lh(){if(Dw(),xs==="never"){Sl();return}let r=PB(xs);if(r==null){Sl();return}if(ch>0){Sl();return}Sl(),Ho=setTimeout(()=>{Ho=null,ch===0&&Lw()},r)}function IB(){lh()}function uh(){Dw(),Lw()}function ph(){return Bt!==null}function fh(){return xs}function $o(r){return MB(r)&&(xs=r,lh()),xs}function NB(r){ch=r,lh()}var Nw,El,kB,Bt,xs,Ho,ch,Iw,Cl=Ce(()=>{Nw=require("child_process");bt();Mi();El=Rn("sleep"),kB={darwin:{cmd:"caffeinate",args:["-imsd"]},linux:{cmd:"systemd-inhibit",args:["--what=idle:sleep:handle-lid-switch","--who=9remote","--why=remote-active","sleep","infinity"]},win32:{cmd:"powershell.exe",args:["-NonInteractive","-NoProfile","-WindowStyle","Hidden","-Command",`Add-Type -Name K -Namespace W -MemberDefinition '[System.Runtime.InteropServices.DllImport("kernel32")]public static extern uint SetThreadExecutionState(uint e);'; [void][W.K]::SetThreadExecutionState(0x80000041); while($true){Start-Sleep 3600}`]}},Bt=null,xs=Z.sleepInhibit?.defaultMode||"never",Ho=null,ch=0,Iw=!1});function LB(){(0,Hn.mkdirSync)(oe.STATE,{recursive:!0})}function jw(){try{if((0,Hn.existsSync)(dh)){let r=JSON.parse((0,Hn.readFileSync)(dh,"utf8"));r.step===Yn.READY&&r.permanentKey&&(dn={...dn,...r})}}catch{}}function DB(){try{LB(),(0,Hn.writeFileSync)(dh,JSON.stringify(dn),{mode:384})}catch{}}function Fw(){jt=!!Fo().desktopEnabled}function hh(){wl({desktopEnabled:jt})}function St(r,e){let t=`data: ${JSON.stringify({type:r,...e})}
82
82
 
83
- `;for(let n of Al)try{n.write(t)}catch{Al.delete(n)}}function xt(r){St("log",{message:`[${new Date().toLocaleTimeString()}] ${r}`})}function jw(){return dn}function Hn(r){dn={...dn,...r},St("state",dn),MB()}function Fw(){Hn({oneTimeKey:"",oneTimeKeyExpiresAt:null,qrUrl:""})}function Hw(r){hh=!!r}function xs(){return!!hh&&!!jt&&!!Ar.screenRecording&&!!Ar.accessibility}function $w(r){mh=r}async function Rl(){let r=await _w(),e=Ar,t=xs();Ar=r,jt&&(!r.screenRecording||!r.accessibility)&&(jt=!1,dh());let n=e.screenRecording&&e.accessibility,i=r.screenRecording&&r.accessibility;return!jt&&!n&&i&&(jt=!0,dh()),(e.screenRecording!==r.screenRecording||e.accessibility!==r.accessibility)&&St("permissions",{...Ar,desktopEnabled:jt}),xs()!==t&&mh?.(),r}function qw(r,e){let t=r.headers.origin;if(t&&!La.includes(t))return he(e,403,"Forbidden origin");ee(e,{localToken:Db()})}function Uw(r,e,t=null,n="ws"){pi.set(r,{socketId:r,ip:e,deviceId:t,type:n,connectedAt:Date.now()}),St("connections",{connections:[...pi.values()]}),Gw()}function Ww(r){pi.delete(r),St("connections",{connections:[...pi.values()]}),Gw()}async function Gw(){try{(await Promise.resolve().then(()=>(Cl(),Tl))).onConnectionChange(pi.size)}catch{}}function zw(r,e){e.setHeader("Content-Type","text/event-stream"),e.setHeader("Cache-Control","no-cache"),e.setHeader("Connection","keep-alive"),e.writeHead(200),e.write(`data: ${JSON.stringify({type:"state",...dn})}
83
+ `;for(let n of Al)try{n.write(t)}catch{Al.delete(n)}}function Te(r){St("log",{message:`[${new Date().toLocaleTimeString()}] ${r}`})}function Hw(){return dn}function hn(r){dn={...dn,...r},St("state",dn),DB()}function $w(){hn({oneTimeKey:"",oneTimeKeyExpiresAt:null,qrUrl:""})}function qw(r){mh=!!r}function ys(){return!!mh&&!!jt&&!!Ar.screenRecording&&!!Ar.accessibility}function Uw(r){gh=r}async function Rl(){let r=await ww(),e=Ar,t=ys();Ar=r,jt&&(!r.screenRecording||!r.accessibility)&&(jt=!1,hh());let n=e.screenRecording&&e.accessibility,i=r.screenRecording&&r.accessibility;return!jt&&!n&&i&&(jt=!0,hh()),(e.screenRecording!==r.screenRecording||e.accessibility!==r.accessibility)&&St("permissions",{...Ar,desktopEnabled:jt}),ys()!==t&&gh?.(),r}function Ww(r,e){let t=r.headers.origin;if(t&&!Da.includes(t))return he(e,403,"Forbidden origin");ee(e,{localToken:jb()})}function Gw(r,e,t=null,n="ws"){di.set(r,{socketId:r,ip:e,deviceId:t,type:n,connectedAt:Date.now()}),St("connections",{connections:[...di.values()]}),Kw()}function zw(r){di.delete(r),St("connections",{connections:[...di.values()]}),Kw()}async function Kw(){try{(await Promise.resolve().then(()=>(Cl(),Tl))).onConnectionChange(di.size)}catch{}}function Vw(r,e){e.setHeader("Content-Type","text/event-stream"),e.setHeader("Cache-Control","no-cache"),e.setHeader("Connection","keep-alive"),e.writeHead(200),e.write(`data: ${JSON.stringify({type:"state",...dn})}
84
84
 
85
- `),e.write(`data: ${JSON.stringify({type:"connections",connections:[...pi.values()]})}
85
+ `),e.write(`data: ${JSON.stringify({type:"connections",connections:[...di.values()]})}
86
86
 
87
87
  `),e.write(`data: ${JSON.stringify({type:"permissions",...Ar,desktopEnabled:jt})}
88
88
 
89
- `),Al.add(e),r.on("close",()=>Al.delete(e))}function Kw(r,e){ee(e,{...dn,...Ar,desktopEnabled:jt,remoteAvailable:hh})}async function Vw(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Gt(),ki)),n=await t(r,e);n&&(Hn(n),ee(e))}function Yw(r,e){ee(e),Hn({step:Oi.PREPARING,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),gl("restart-tunnel")}function Xw(r,e){ee(e),Hn({step:Oi.PREPARING,stepDesc:""}),gl("start-tunnel")}function Jw(r,e){ee(e),Hn({step:Oi.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),gl("shutdown")}function Qw(r,e){ee(e,{connections:[...pi.values()]})}function Zw(r,e){let t=new URL(r.url,"http://localhost"),n=parseInt(t.searchParams.get("lines")||yp,10);ee(e,{logs:Mv(Number.isFinite(n)?n:yp)})}async function eS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Gt(),ki)),n=await t(r,e);if(!n)return;let i=!!n.enabled;if(i&&(!Ar.screenRecording||!Ar.accessibility)){ee(e,{ok:!1,enabled:jt,reason:"permissions_required"});return}let s=xs();jt=i,dh(),St("permissions",{...Ar,desktopEnabled:jt}),xs()!==s&&mh?.(),ee(e,{ok:!0,enabled:jt})}function tS(r,e){ee(e,Ar)}async function rS(r,e){let t=await sh();ee(e,{enabled:t})}async function nS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Gt(),ki)),n=await t(r,e);if(!n)return;let i=await Aw(!!n.enabled),s=await sh();St("autostart",{enabled:s}),ee(e,{ok:i,enabled:s})}async function iS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Gt(),ki)),n=await t(r,e);if(!n)return;let{type:i}=n;if(process.platform==="darwin"){bw(i);let s=Date.now(),o=setInterval(async()=>{((await Rl())[i]||Date.now()-s>Tv)&&clearInterval(o)},Ev)}ee(e)}var Fn,Lw,fh,dn,jt,hh,Ar,Al,pi,mh,fi=Te(()=>{gt();Pi();gt();Mo();ww();Rw();Gt();el();gt();Fn=require("fs"),Lw=require("path");gt();oh();fh=(0,Lw.join)(oe.STATE,"ui-state.json");dn={step:Oi.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null,permanentKey:"",qrUrl:"",latency:null,uptime:null,healthCheck:{running:!1,timeoutMs:0,startedAt:null,logs:[]},tunnelHealth:{status:"unknown",checkedAt:null}},jt=!1,hh=!1,Ar={screenRecording:!1,accessibility:!1},Al=new Set,pi=new Map;Pv(xt);mh=null});var kl,sS=Te(()=>{bt();fi();kl=class{constructor(){this.cfg=Z.logging,this.samples=[],this.lastLogTime=Date.now()}now(){return this.cfg.metrics?performance.now():0}record({capture:e,checksum:t,encode:n,total:i,changedTiles:s,totalTiles:o,tileBytes:a,rawBytes:c}){this.cfg.metrics&&(this.samples.push({capture:e,checksum:t,encode:n,total:i,changedTiles:s,totalTiles:o,tileBytes:a,rawBytes:c}),this.samples.length>=this.cfg.metricsEveryFrames&&this._flush())}_flush(){let e=this.samples.length,t=N=>(this.samples.reduce((H,W)=>H+W[N],0)/e).toFixed(1),n=(Date.now()-this.lastLogTime)/1e3,i=(e/n).toFixed(1),s=[],o=0;for(let N of this.samples){for(let H of N.tileBytes)s.push(H);o+=N.tileBytes.reduce((H,W)=>H+W,0)}let a=(o/e/1024).toFixed(1),c=s.length?(s.reduce((N,H)=>N+H,0)/s.length/1024).toFixed(2):"0",u=s.length?(Math.min(...s)/1024).toFixed(2):"0",p=s.length?(Math.max(...s)/1024).toFixed(2):"0",f=this.samples.reduce((N,H)=>N+H.rawBytes,0)/e,m=o/e,y=m>0?(f/m).toFixed(0):"0",_=(this.samples.reduce((N,H)=>N+H.changedTiles,0)/e).toFixed(0),S=this.samples[0]?.totalTiles||0,A=S?(_/S*100).toFixed(1):"0",P=Z.pipeline,L=`[Metrics] ${P.captureLib}+${P.encoder} tile=${P.tileSize} q${P.jpegQuality} scale=${P.outputScale} | fps=${i} | capture=${t("capture")}ms enc=${t("encode")}ms total=${t("total")}ms | tiles=${_}/${S} (${A}%) | data=${a}KB/frame | tileAvg=${c}KB (min ${u}, max ${p}) | compress=${y}x`;xt(L),console.log(L),this.samples=[],this.lastLogTime=Date.now()}}});var cS={};Xr(cS,{TileManager:()=>gh});var ys,Pl,oS,Ol,aS,IB,NB,gh,lS=Te(()=>{ys=X(require("fs"),1),Pl=X(require("path"),1),oS=X(require("sharp"),1),Ol=require("child_process"),aS=require("url");bt();hw();gw();sS();Fd();IB=(0,aS.fileURLToPath)(__importMetaUrl),NB=Pl.default.dirname(IB),gh=class{constructor(e){this.robot=e,this.metrics=new kl,this.tileSize=Z.pipeline.tileSize,this.lastTileChecksums=new Map,this.screenWidth=0,this.screenHeight=0,this.tilesPerRow=0,this.tilesPerColumn=0,this.totalTiles=0,this.frameCount=0,this.tempDir=Pl.default.join(NB,"../../temp"),this.changeThreshold=1,this.scaledWidth=0,this.scaledHeight=0,this.isProcessing=!1,this.sharedScreenCache=null,this.lastCaptureTime=0,this.CACHE_TTL=100,this.dpiScale=1,this.captureWidth=0,this.captureHeight=0,this.scaleFactor=Z.pipeline.outputScale||1,this.compressionQuality=Z.pipeline.jpegQuality,this.activeTileSet=null,this.focusStats={frames:0,scanned:0,changed:0,bytes:0},ys.default.existsSync(this.tempDir)||ys.default.mkdirSync(this.tempDir,{recursive:!0}),fw(e),this.initializeScreenDimensions()}initializeScreenDimensions(){try{let{width:e,height:t}=this.robot.getScreenSize();this.screenWidth=e,this.screenHeight=t,this.detectDpiScale(),this.scaledWidth=this.captureWidth,this.scaledHeight=this.captureHeight,this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn;let n=100;if(this.totalTiles>n){let i=Math.ceil(Math.sqrt(this.scaledWidth*this.scaledHeight/n));this.tileSize=Math.max(i,120),this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}}catch(e){ve.error("Screen dimensions error:",e),this.screenWidth=1920,this.screenHeight=1080,this.dpiScale=1,this.captureWidth=1920,this.captureHeight=1080,this.scaledWidth=1728,this.scaledHeight=972,this.tileSize=120,this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}}detectDpiScale(){if(process.platform==="darwin"){let e=this.robot.screen.capture(0,0,this.screenWidth,this.screenHeight),n=e.byteWidth/e.bytesPerPixel/this.screenWidth;n>=1.9&&n<=2.1?this.dpiScale=2:this.dpiScale=1}else process.platform==="win32"?this.dpiScale=this._detectDpiScaleWin32():this.dpiScale=1;this.captureWidth=Math.floor(this.screenWidth*this.dpiScale),this.captureHeight=Math.floor(this.screenHeight*this.dpiScale)}_detectDpiScaleWin32(){ve.dpi(`\u{1F50D} [DPI Detection] screenWidth from robot: ${this.screenWidth}x${this.screenHeight}`);try{let e=(0,Ol.execSync)(`powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "try{Get-ItemPropertyValue 'HKCU:\\Control Panel\\Desktop\\WindowMetrics' -Name AppliedDPI}catch{0}"`,{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(ve.dpi(`\u{1F50D} [DPI Detection] Strategy 1 (Registry AppliedDPI): ${t} DPI`),t>=96){let n=t/96;return ve.dpi(`\u2705 [DPI Detection] Using registry scale: ${n}x (${t}/96)`),n}}catch(e){ve.dpi(`\u274C [DPI Detection] Strategy 1 failed: ${e.message}`)}try{let e=(0,Ol.execSync)('powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "(Get-WmiObject -Class Win32_VideoController | Select-Object -First 1).CurrentHorizontalResolution"',{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(ve.dpi(`\u{1F50D} [DPI Detection] Strategy 2 (WMI): physical width = ${t}px`),t>0&&t>this.screenWidth){let n=t/this.screenWidth;return ve.dpi(`\u2705 [DPI Detection] Using WMI scale: ${n}x (${t}/${this.screenWidth})`),n}}catch(e){ve.dpi(`\u274C [DPI Detection] Strategy 2 failed: ${e.message}`)}try{let e=(0,Ol.execSync)(`powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "Add-Type -TypeDefinition 'using System;using System.Runtime.InteropServices;public class Disp{[DllImport(\\"user32\\")]public static extern bool EnumDisplaySettings(string d,int m,ref DEVMODE dm);[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Ansi)]public struct DEVMODE{[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)]public string dmDeviceName;public short dmSpecVersion,dmDriverVersion,dmSize,dmDriverExtra;public int dmFields;public int dmPositionX,dmPositionY,dmDisplayOrientation,dmDisplayFixedOutput;public short dmColor,dmDuplex,dmYResolution,dmTTOption,dmCollate;[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)]public string dmFormName;public short dmLogPixels;public int dmBitsPerPel,dmPelsWidth,dmPelsHeight,dmDisplayFlags,dmDisplayFrequency;}}'; $dm=New-Object Disp+DEVMODE; $dm.dmSize=[System.Runtime.InteropServices.Marshal]::SizeOf($dm); [Disp]::EnumDisplaySettings($null,-1,[ref]$dm) | Out-Null; Write-Output $dm.dmPelsWidth"`,{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(ve.dpi(`\u{1F50D} [DPI Detection] Strategy 3 (EnumDisplaySettings): physical width = ${t}px`),t>0&&t>this.screenWidth){let n=t/this.screenWidth;return ve.dpi(`\u2705 [DPI Detection] Using EnumDisplaySettings scale: ${n}x (${t}/${this.screenWidth})`),n}}catch(e){ve.dpi(`\u274C [DPI Detection] Strategy 3 failed: ${e.message}`)}return ve.dpi("\u26A0\uFE0F [DPI Detection] All strategies failed, fallback to 1x"),1}async captureFullScreen(){let e=await dw();return{buffer:e.buffer,width:e.width,height:e.height,channels:e.channels}}async getSharedScreenCapture(){let e=Date.now();return this.sharedScreenCache&&e-this.lastCaptureTime<this.CACHE_TTL?this.sharedScreenCache:(this.sharedScreenCache=await this.captureFullScreen(),this.lastCaptureTime=e,this.sharedScreenCache)}clearScreenCache(){}async detectChangedTiles(){return(await this.detectChangedTilesWithHashes()).tiles}async detectChangedTilesWithHashes(){if(this.isProcessing)return{tiles:[],currentHashes:Array.from(this.lastTileChecksums.values())};this.isProcessing=!0;let e=this.metrics.now(),t=e,n=e;try{let i=await this.getSharedScreenCapture();t=this.metrics.now();let s=[],o=[],a=new Map;this.frameCount++;let c=this.activeTileSet;for(let f=0;f<this.totalTiles;f++){if(c&&!c.has(f))continue;let m=this.calculateTileChecksumDirect(i,f);a.set(f,m)}n=this.metrics.now();let u=Array.from(a.values());if(this.lastTileChecksums.size===0){let f=[];for(let y=0;y<this.totalTiles;y++)c&&!c.has(y)||(this.lastTileChecksums.set(y,a.get(y)),f.push(this.processTileAsync(i,y)));let m=await Promise.all(f);return s.push(...m),this._recordFrame(e,t,n,s,i),{tiles:s,currentHashes:u}}for(let f=0;f<this.totalTiles;f++){if(c&&!c.has(f))continue;let m=a.get(f),y=this.lastTileChecksums.get(f);m!==y&&(o.push(f),this.lastTileChecksums.set(f,m))}if(o.length/this.totalTiles>this.changeThreshold){let f=[];for(let y=0;y<this.totalTiles;y++)c&&!c.has(y)||f.push(this.processTileAsync(i,y));let m=await Promise.all(f);s.push(...m.map(y=>({...y,fullRefresh:!0})))}else if(o.length>0){let f=o.map(y=>this.processTileAsync(i,y)),m=await Promise.all(f);s.push(...m)}return this._recordFrame(e,t,n,s,i),{tiles:s,currentHashes:u}}finally{this.isProcessing=!1}}async processTileAsync(e,t,n=null){let i=n||this.extractTile(e,t),s=await this.compressTileImage(i.buffer,i.width,i.height),{row:o,col:a}=this.getTilePosition(t);return{type:"tile-update",tileIndex:t,x:a*this.tileSize,y:o*this.tileSize,width:i.width,height:i.height,imageBuffer:s,hash:this.lastTileChecksums.get(t)??0,timestamp:Date.now(),frameCount:this.frameCount}}calculateTileChecksumDirect(e,t){let{row:n,col:i}=this.getTilePosition(t),s=i*this.tileSize,o=n*this.tileSize,a=Math.min(s+this.tileSize,e.width),c=Math.min(o+this.tileSize,e.height),u=a-s,p=c-o,f=e.channels,m=e.width*f,y=0,_=16;for(let S=0;S<p;S+=4){let A=(S>>2&1)*8,P=(o+S)*m+s*f;for(let L=A;L<u;L+=_){let N=P+L*f;y+=e.buffer[N],y^=e.buffer[N+1],y+=e.buffer[N+2]<<1,y^=e.buffer[N+3]<<2}}return y>>>0}setFocusRect(e){if(!e){this.activeTileSet=null;return}let t=Z.focus.paddingTiles,n=Math.max(0,Math.floor(e.x/this.tileSize)-t),i=Math.max(0,Math.floor(e.y/this.tileSize)-t),s=Math.min(this.tilesPerRow-1,Math.floor((e.x+e.w)/this.tileSize)+t),o=Math.min(this.tilesPerColumn-1,Math.floor((e.y+e.h)/this.tileSize)+t),a=new Set;for(let u=i;u<=o;u++)for(let p=n;p<=s;p++)a.add(u*this.tilesPerRow+p);let c=this.activeTileSet;if(c)for(let u of a)c.has(u)||this.lastTileChecksums.delete(u);this.activeTileSet=a}getTilePosition(e){return{row:Math.floor(e/this.tilesPerRow),col:e%this.tilesPerRow}}extractTile(e,t){let{row:n,col:i}=this.getTilePosition(t),s=i*this.tileSize,o=n*this.tileSize,a=Math.min(s+this.tileSize,e.width),c=Math.min(o+this.tileSize,e.height),u=a-s,p=c-o,f=e.channels,m=u*f,y=Buffer.alloc(u*p*f);for(let _=0;_<p;_++){let S=((o+_)*e.width+s)*f,A=_*m;e.buffer.copy(y,A,S,S+m)}return{buffer:y,width:u,height:p,channels:f,tileIndex:t,x:s,y:o}}async compressTileImage(e,t,n){let i=this.scaleFactor;if(i&&i>0&&i<1){let s=Math.max(1,Math.floor(t*i)),o=Math.max(1,Math.floor(n*i)),{inputFormat:a}=Z.pipeline,c=e,u=4;a==="bgra"&&(c=Buffer.from(e),Qd(c));let p=await(0,oS.default)(c,{raw:{width:t,height:n,channels:u}}).resize(s,o,{kernel:"lanczos3",fastShrinkOnLoad:!1}).raw().toBuffer();return Zd(p,s,o,4,this.compressionQuality,"rgba")}return Zd(e,t,n,4,this.compressionQuality)}pickProfile({zoom:e=1,viewerWidth:t=0,dpr:n=1}={}){let i=Z.pipeline.adaptiveTiers||[];if(!i.length)return null;let s=this.captureWidth||this.screenWidth||1,o=t>0?t:s,a=e>0?e:1,c=n>0?n:1,u=o*a*c/s,p=Z.pipeline.tierHysteresis||0,f=this._currentTier;for(let y of i){let _=f&&y===f?y.minEffective-p:y.minEffective;if(u>=_)return this._currentTier=y,y}let m=i[i.length-1];return this._currentTier=m,m}setProfile(e){if(!e)return;let t=e.outputScale??this.scaleFactor,n=e.jpegQuality??this.compressionQuality;t===this.scaleFactor&&n===this.compressionQuality||(this.scaleFactor=t,this.compressionQuality=n,this.lastTileChecksums.clear())}_recordFrame(e,t,n,i,s){if(this._recordFocusFrame(i),!this.metrics.cfg.metrics)return;let o=this.metrics.now(),a=i.map(u=>u.imageBuffer?.length||0),c=s?s.width*s.height*s.channels:0;this.metrics.record({capture:t-e,checksum:n-t,encode:o-n,total:o-e,changedTiles:i.length,totalTiles:this.totalTiles,tileBytes:a,rawBytes:c})}_recordFocusFrame(e){let t=this.focusStats;t.frames++,t.scanned+=this.activeTileSet?this.activeTileSet.size:this.totalTiles,t.changed+=e.length;for(let c of e)t.bytes+=c.imageBuffer?.length||0;if(t.frames<Z.logging.focusEveryFrames)return;let n=(t.scanned/t.frames).toFixed(0),i=(t.changed/t.frames).toFixed(1),s=(t.bytes/t.frames/1024).toFixed(1),o=this.totalTiles?((1-n/this.totalTiles)*100).toFixed(0):0,a=this.activeTileSet?"focus":"full";ve.focus(`\u{1F3AF} [Focus/${a}] ${t.frames}f | scan ${n}/${this.totalTiles} tiles (saved ${o}%) | changed ${i}/f | data ${s}KB/f`),this.focusStats={frames:0,scanned:0,changed:0,bytes:0}}async getScreenDimensions(){try{let e=await this.captureFullScreen();this.scaledWidth=e.width,this.scaledHeight=e.height,this.tilesPerRow=Math.ceil(e.width/this.tileSize),this.tilesPerColumn=Math.ceil(e.height/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}catch(e){ve.error("Error getting dimensions:",e)}return{width:this.scaledWidth,height:this.scaledHeight,tileWidth:this.tileSize,tileHeight:this.tileSize,tileCount:this.totalTiles,scaleFactor:this.scaleFactor,originalWidth:this.screenWidth,originalHeight:this.screenHeight}}async compareClientTileHashes(e){if(this.isProcessing)return{tiles:[],currentHashes:[],changedIndices:[]};this.isProcessing=!0;try{let t=await this.getSharedScreenCapture(),n=[],i=[];this.frameCount++;let s=this.activeTileSet,o=new Map;for(let c=0;c<this.totalTiles;c++){if(s&&!s.has(c))continue;let u=this.calculateTileChecksumDirect(t,c);o.set(c,u),this.lastTileChecksums.set(c,u)}if(!e||e.length===0){let c=[];for(let p=0;p<this.totalTiles;p++)s&&!s.has(p)||c.push(this.processTileAsync(t,p));let u=await Promise.all(c);return n.push(...u),{tiles:n,currentHashes:Array.from(o.values())}}for(let c=0;c<this.totalTiles;c++)s&&!s.has(c)||e[c]!==o.get(c)&&i.push(c);if(i.length/this.totalTiles>this.changeThreshold){let c=[];for(let p=0;p<this.totalTiles;p++)s&&!s.has(p)||c.push(this.processTileAsync(t,p));let u=await Promise.all(c);n.push(...u.map(p=>({...p,fullRefresh:!0})))}else if(i.length>0){let c=i.map(p=>this.processTileAsync(t,p)),u=await Promise.all(c);n.push(...u)}return this._recordFocusFrame(n),{tiles:n,currentHashes:Array.from(o.values()),changedIndices:i}}finally{this.isProcessing=!1}}clearMemory(){this.sharedScreenCache=null,this.lastCaptureTime=0,this.lastTileChecksums.clear()}reset(){this.lastTileChecksums.clear(),this.frameCount=0}cleanup(){try{ys.default.existsSync(this.tempDir)&&ys.default.readdirSync(this.tempDir).forEach(t=>ys.default.unlinkSync(Pl.default.join(this.tempDir,t)))}catch(e){ve.warn(`Cleanup error: ${e.message}`)}}}});var uS={};Xr(uS,{ResourceManager:()=>vh});var vh,pS=Te(()=>{bt();vh=class{constructor(){this.activeClients=new Map,this.activeTimers=new Map,this.chunkTimers=new Map,this.memoryCheckInterval=null}startResourceMonitoring(){this.memoryCheckInterval=setInterval(()=>{let e=process.memoryUsage(),t=Math.round(e.heapUsed/1024/1024);t>Z.resourceManagement.memoryWarningThreshold&&(console.warn(`\u26A0\uFE0F High memory: ${t}MB`),this.cleanupInactiveClients())},Z.resourceManagement.memoryCheckInterval)}stopResourceMonitoring(){this.memoryCheckInterval&&(clearInterval(this.memoryCheckInterval),this.memoryCheckInterval=null)}addClient(e,t){this.activeClients.set(e,{...t,lastActivity:Date.now()})}getClient(e){return this.activeClients.get(e)}updateClientActivity(e){let t=this.activeClients.get(e);t&&(t.lastActivity=Date.now())}cleanupInactiveClients(){let e=Date.now(),t=Z.resourceManagement.inactiveTimeout;for(let[n,i]of this.activeClients.entries())e-i.lastActivity>t&&(console.log(`\u{1F9F9} Cleaning inactive client: ${n}`),this.cleanupClientResources(n,i),this.activeClients.delete(n))}cleanupClientResources(e,t){try{t.isStreaming=!1,t?.streamingTimeout&&(clearTimeout(t.streamingTimeout),t.streamingTimeout=null),t?.screenInterval&&(clearInterval(t.screenInterval),t.screenInterval=null);let n=this.activeTimers.get(e);n&&(n.forEach(s=>clearTimeout(s)),this.activeTimers.delete(e));let i=this.chunkTimers.get(e);i&&(i.forEach(s=>clearTimeout(s)),this.chunkTimers.delete(e)),t?.tileManager&&(t.tileManager.clearMemory(),t.tileManager.cleanup(),t.tileManager.reset())}catch(n){console.error(`Error cleaning up ${e}:`,n.message)}}getStreamingConfig(){return Z.streaming}getWebRTCConfig(){return Z.webrtc}removeClient(e){let t=this.activeClients.get(e);t&&(this.cleanupClientResources(e,t),this.activeClients.delete(e))}getChunkTimers(e){return this.chunkTimers.has(e)||this.chunkTimers.set(e,new Set),this.chunkTimers.get(e)}cleanupAll(){this.stopResourceMonitoring();for(let[e,t]of this.activeClients.entries())this.cleanupClientResources(e,t);this.activeClients.clear(),this.activeTimers.clear(),this.chunkTimers.clear()}}});var fS={};Xr(fS,{ScreenUpdateHelper:()=>xh});var xh,dS=Te(()=>{bt();xh=class{constructor(e){this.resourceManager=e}async sendTilesInChunks(e,t,n,i=!1){if(!t||t.length===0)return;let s=Z.streaming.chunkSize,o=[];for(let c=0;c<t.length;c+=s)o.push(t.slice(c,c+s));let a=this.resourceManager.getChunkTimers(e.id);for(let c=0;c<o.length;c++){let u=o[c],p=c===o.length-1,f=setTimeout(()=>{a.delete(f),e.connected&&e.emit("tiles-data",{tiles:u,timestamp:n,forceRefresh:!1,userAction:i,chunkInfo:{chunkIndex:c,totalChunks:o.length,isLastChunk:p}})},c*Z.streaming.chunkDelay);a.add(f)}}}});var hS={};Xr(hS,{MouseHandler:()=>yh});var yh,mS=Te(()=>{bt();yh=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastMouseMove=0}setupMouseHandlers(e,t){let n=this.robot;e.on("mouse-move",t(i=>{let s=Date.now();if(!(s-this.lastMouseMove<Z.throttling.mouseThrottle)){this.lastMouseMove=s;try{let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Mouse move error:",o.message)}}})),e.on("mouse-click",t(async i=>{try{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),n.mouseClick(i.button||"left",i.double||!1),s.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse click error:",s.message)}})),e.on("mouse-press",t(async i=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),n.mouseToggle("down",i.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse press error:",s.message)}})),e.on("mouse-release",t(async i=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),n.mouseToggle("up",i.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse release error:",s.message)}})),e.on("scroll",t(async i=>{try{let{direction:s,amount:o=60,horizontal:a=!1}=i,c=this.resourceManager.getClient(e.id);if(!c)return;let u=0,p=0;a||s==="left"||s==="right"?u=s==="right"?o:-o:p=s==="down"?-o:o,n.scrollMouse(u,p),c.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Scroll error:",s.message)}})),e.on("mouse-drag-select",t(i=>{try{let{startX:s,startY:o,endX:a,endY:c}=i,u=n.getScreenSize(),p=Math.round(s/100*u.width),f=Math.round(o/100*u.height),m=Math.round(a/100*u.width),y=Math.round(c/100*u.height),_=Math.max(0,Math.min(u.width-1,p)),S=Math.max(0,Math.min(u.height-1,f)),A=Math.max(0,Math.min(u.width-1,m)),P=Math.max(0,Math.min(u.height-1,y));n.moveMouse(_,S),n.mouseToggle("down","left"),n.dragMouse(A,P),n.mouseToggle("up","left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Drag selection error:",s.message)}}))}}});var vS={};Xr(vS,{KeyboardHandler:()=>_h});function LB(r){let e;r.type==="missionControl"?e='tell application "System Events" to key code 160':e=`tell application "System Events" to key code ${r.keyCode} using ${r.mods}`,(0,gS.execFile)("osascript",["-e",e],t=>{t&&console.error("osascript error:",t.message)})}var gS,_h,xS=Te(()=>{gS=require("child_process");bt();_h=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastKeyPress=0,this.lastTypeText=0}setupKeyboardHandlers(e,t){let n=this.robot;e.on("key-press",t(i=>{let s=Date.now();if(!(s-this.lastKeyPress<Z.throttling.keyThrottle)){this.lastKeyPress=s;try{if(!i.key||typeof i.key!="string")return;let o=this.resourceManager.getClient(e.id),a=i.key,c=i.modifier||[];if(a.length===1){n.keyTap(a,c);for(let u of c)n.keyToggle(u,"up")}else{let p={return:"enter"}[a.toLowerCase()]??a.toLowerCase();n.keyTap(p,c)}o&&(o.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Key press error:",o.message)}}})),e.on("desktop-switch",t(i=>{try{let s=i?.direction,o=Z.desktopSwitch[process.platform]?.[s];if(!o)return;process.platform==="darwin"?LB(o):n.keyTap(o[0],o[1]);let a=this.resourceManager.getClient(e.id);a&&(a.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Desktop switch error:",s.message)}})),e.on("type-text",t(i=>{let s=Date.now();if(!(s-this.lastTypeText<Z.throttling.typeTextThrottle)){this.lastTypeText=s;try{if(!i.text||typeof i.text!="string")return;let o=i.text;o.length>Z.throttling.maxTextLength&&(o=o.substring(0,Z.throttling.maxTextLength));let a=o.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,""),c=this.resourceManager.getClient(e.id);setTimeout(()=>{try{n.typeString(a),this.resourceManager.updateClientActivity(e.id),c&&(c.idleFrameCount=0,c.tileManager&&c.tileManager.clearScreenCache())}catch(u){console.error("Robot typeString error:",u.message)}},10)}catch(o){console.error("Type text error:",o.message)}}}))}}});var kh=O((XS,Rh)=>{(function(r,e){"use strict";function t(T,l){if(!T)throw new Error(l||"Assertion failed")}function n(T,l){T.super_=l;var h=function(){};h.prototype=l.prototype,T.prototype=new h,T.prototype.constructor=T}function i(T,l,h){if(i.isBN(T))return T;this.negative=0,this.words=null,this.length=0,this.red=null,T!==null&&((l==="le"||l==="be")&&(h=l,l=10),this._init(T||0,l||10,h||"be"))}typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=require("buffer").Buffer}catch{}i.isBN=function(l){return l instanceof i?!0:l!==null&&typeof l=="object"&&l.constructor.wordSize===i.wordSize&&Array.isArray(l.words)},i.max=function(l,h){return l.cmp(h)>0?l:h},i.min=function(l,h){return l.cmp(h)<0?l:h},i.prototype._init=function(l,h,x){if(typeof l=="number")return this._initNumber(l,h,x);if(typeof l=="object")return this._initArray(l,h,x);h==="hex"&&(h=16),t(h===(h|0)&&h>=2&&h<=36),l=l.toString().replace(/\s+/g,"");var w=0;l[0]==="-"&&(w++,this.negative=1),w<l.length&&(h===16?this._parseHex(l,w,x):(this._parseBase(l,h,w),x==="le"&&this._initArray(this.toArray(),h,x)))},i.prototype._initNumber=function(l,h,x){l<0&&(this.negative=1,l=-l),l<67108864?(this.words=[l&67108863],this.length=1):l<4503599627370496?(this.words=[l&67108863,l/67108864&67108863],this.length=2):(t(l<9007199254740992),this.words=[l&67108863,l/67108864&67108863,1],this.length=3),x==="le"&&this._initArray(this.toArray(),h,x)},i.prototype._initArray=function(l,h,x){if(t(typeof l.length=="number"),l.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(l.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var g,v,C=0;if(x==="be")for(w=l.length-1,g=0;w>=0;w-=3)v=l[w]|l[w-1]<<8|l[w-2]<<16,this.words[g]|=v<<C&67108863,this.words[g+1]=v>>>26-C&67108863,C+=24,C>=26&&(C-=26,g++);else if(x==="le")for(w=0,g=0;w<l.length;w+=3)v=l[w]|l[w+1]<<8|l[w+2]<<16,this.words[g]|=v<<C&67108863,this.words[g+1]=v>>>26-C&67108863,C+=24,C>=26&&(C-=26,g++);return this.strip()};function o(T,l){var h=T.charCodeAt(l);return h>=65&&h<=70?h-55:h>=97&&h<=102?h-87:h-48&15}function a(T,l,h){var x=o(T,h);return h-1>=l&&(x|=o(T,h-1)<<4),x}i.prototype._parseHex=function(l,h,x){this.length=Math.ceil((l.length-h)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var g=0,v=0,C;if(x==="be")for(w=l.length-1;w>=h;w-=2)C=a(l,h,w)<<g,this.words[v]|=C&67108863,g>=18?(g-=18,v+=1,this.words[v]|=C>>>26):g+=8;else{var b=l.length-h;for(w=b%2===0?h+1:h;w<l.length;w+=2)C=a(l,h,w)<<g,this.words[v]|=C&67108863,g>=18?(g-=18,v+=1,this.words[v]|=C>>>26):g+=8}this.strip()};function c(T,l,h,x){for(var w=0,g=Math.min(T.length,h),v=l;v<g;v++){var C=T.charCodeAt(v)-48;w*=x,C>=49?w+=C-49+10:C>=17?w+=C-17+10:w+=C}return w}i.prototype._parseBase=function(l,h,x){this.words=[0],this.length=1;for(var w=0,g=1;g<=67108863;g*=h)w++;w--,g=g/h|0;for(var v=l.length-x,C=v%w,b=Math.min(v,v-C)+x,d=0,E=x;E<b;E+=w)d=c(l,E,E+w,h),this.imuln(g),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(C!==0){var q=1;for(d=c(l,E,l.length,h),E=0;E<C;E++)q*=h;this.imuln(q),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this.strip()},i.prototype.copy=function(l){l.words=new Array(this.length);for(var h=0;h<this.length;h++)l.words[h]=this.words[h];l.length=this.length,l.negative=this.negative,l.red=this.red},i.prototype.clone=function(){var l=new i(null);return this.copy(l),l},i.prototype._expand=function(l){for(;this.length<l;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(l,h){l=l||10,h=h|0||1;var x;if(l===16||l==="hex"){x="";for(var w=0,g=0,v=0;v<this.length;v++){var C=this.words[v],b=((C<<w|g)&16777215).toString(16);g=C>>>24-w&16777215,w+=2,w>=26&&(w-=26,v--),g!==0||v!==this.length-1?x=u[6-b.length]+b+x:x=b+x}for(g!==0&&(x=g.toString(16)+x);x.length%h!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}if(l===(l|0)&&l>=2&&l<=36){var d=p[l],E=f[l];x="";var q=this.clone();for(q.negative=0;!q.isZero();){var I=q.modn(E).toString(l);q=q.idivn(E),q.isZero()?x=I+x:x=u[d-I.length]+I+x}for(this.isZero()&&(x="0"+x);x.length%h!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}t(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var l=this.words[0];return this.length===2?l+=this.words[1]*67108864:this.length===3&&this.words[2]===1?l+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-l:l},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(l,h){return t(typeof s<"u"),this.toArrayLike(s,l,h)},i.prototype.toArray=function(l,h){return this.toArrayLike(Array,l,h)},i.prototype.toArrayLike=function(l,h,x){var w=this.byteLength(),g=x||Math.max(1,w);t(w<=g,"byte array longer than desired length"),t(g>0,"Requested array length <= 0"),this.strip();var v=h==="le",C=new l(g),b,d,E=this.clone();if(v){for(d=0;!E.isZero();d++)b=E.andln(255),E.iushrn(8),C[d]=b;for(;d<g;d++)C[d]=0}else{for(d=0;d<g-w;d++)C[d]=0;for(d=0;!E.isZero();d++)b=E.andln(255),E.iushrn(8),C[g-d-1]=b}return C},Math.clz32?i.prototype._countBits=function(l){return 32-Math.clz32(l)}:i.prototype._countBits=function(l){var h=l,x=0;return h>=4096&&(x+=13,h>>>=13),h>=64&&(x+=7,h>>>=7),h>=8&&(x+=4,h>>>=4),h>=2&&(x+=2,h>>>=2),x+h},i.prototype._zeroBits=function(l){if(l===0)return 26;var h=l,x=0;return(h&8191)===0&&(x+=13,h>>>=13),(h&127)===0&&(x+=7,h>>>=7),(h&15)===0&&(x+=4,h>>>=4),(h&3)===0&&(x+=2,h>>>=2),(h&1)===0&&x++,x},i.prototype.bitLength=function(){var l=this.words[this.length-1],h=this._countBits(l);return(this.length-1)*26+h};function m(T){for(var l=new Array(T.bitLength()),h=0;h<l.length;h++){var x=h/26|0,w=h%26;l[h]=(T.words[x]&1<<w)>>>w}return l}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var l=0,h=0;h<this.length;h++){var x=this._zeroBits(this.words[h]);if(l+=x,x!==26)break}return l},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(l){return this.negative!==0?this.abs().inotn(l).iaddn(1):this.clone()},i.prototype.fromTwos=function(l){return this.testn(l-1)?this.notn(l).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(l){for(;this.length<l.length;)this.words[this.length++]=0;for(var h=0;h<l.length;h++)this.words[h]=this.words[h]|l.words[h];return this.strip()},i.prototype.ior=function(l){return t((this.negative|l.negative)===0),this.iuor(l)},i.prototype.or=function(l){return this.length>l.length?this.clone().ior(l):l.clone().ior(this)},i.prototype.uor=function(l){return this.length>l.length?this.clone().iuor(l):l.clone().iuor(this)},i.prototype.iuand=function(l){var h;this.length>l.length?h=l:h=this;for(var x=0;x<h.length;x++)this.words[x]=this.words[x]&l.words[x];return this.length=h.length,this.strip()},i.prototype.iand=function(l){return t((this.negative|l.negative)===0),this.iuand(l)},i.prototype.and=function(l){return this.length>l.length?this.clone().iand(l):l.clone().iand(this)},i.prototype.uand=function(l){return this.length>l.length?this.clone().iuand(l):l.clone().iuand(this)},i.prototype.iuxor=function(l){var h,x;this.length>l.length?(h=this,x=l):(h=l,x=this);for(var w=0;w<x.length;w++)this.words[w]=h.words[w]^x.words[w];if(this!==h)for(;w<h.length;w++)this.words[w]=h.words[w];return this.length=h.length,this.strip()},i.prototype.ixor=function(l){return t((this.negative|l.negative)===0),this.iuxor(l)},i.prototype.xor=function(l){return this.length>l.length?this.clone().ixor(l):l.clone().ixor(this)},i.prototype.uxor=function(l){return this.length>l.length?this.clone().iuxor(l):l.clone().iuxor(this)},i.prototype.inotn=function(l){t(typeof l=="number"&&l>=0);var h=Math.ceil(l/26)|0,x=l%26;this._expand(h),x>0&&h--;for(var w=0;w<h;w++)this.words[w]=~this.words[w]&67108863;return x>0&&(this.words[w]=~this.words[w]&67108863>>26-x),this.strip()},i.prototype.notn=function(l){return this.clone().inotn(l)},i.prototype.setn=function(l,h){t(typeof l=="number"&&l>=0);var x=l/26|0,w=l%26;return this._expand(x+1),h?this.words[x]=this.words[x]|1<<w:this.words[x]=this.words[x]&~(1<<w),this.strip()},i.prototype.iadd=function(l){var h;if(this.negative!==0&&l.negative===0)return this.negative=0,h=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,h=this.isub(l),l.negative=1,h._normSign();var x,w;this.length>l.length?(x=this,w=l):(x=l,w=this);for(var g=0,v=0;v<w.length;v++)h=(x.words[v]|0)+(w.words[v]|0)+g,this.words[v]=h&67108863,g=h>>>26;for(;g!==0&&v<x.length;v++)h=(x.words[v]|0)+g,this.words[v]=h&67108863,g=h>>>26;if(this.length=x.length,g!==0)this.words[this.length]=g,this.length++;else if(x!==this)for(;v<x.length;v++)this.words[v]=x.words[v];return this},i.prototype.add=function(l){var h;return l.negative!==0&&this.negative===0?(l.negative=0,h=this.sub(l),l.negative^=1,h):l.negative===0&&this.negative!==0?(this.negative=0,h=l.sub(this),this.negative=1,h):this.length>l.length?this.clone().iadd(l):l.clone().iadd(this)},i.prototype.isub=function(l){if(l.negative!==0){l.negative=0;var h=this.iadd(l);return l.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var x=this.cmp(l);if(x===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,g;x>0?(w=this,g=l):(w=l,g=this);for(var v=0,C=0;C<g.length;C++)h=(w.words[C]|0)-(g.words[C]|0)+v,v=h>>26,this.words[C]=h&67108863;for(;v!==0&&C<w.length;C++)h=(w.words[C]|0)+v,v=h>>26,this.words[C]=h&67108863;if(v===0&&C<w.length&&w!==this)for(;C<w.length;C++)this.words[C]=w.words[C];return this.length=Math.max(this.length,C),w!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(l){return this.clone().isub(l)};function y(T,l,h){h.negative=l.negative^T.negative;var x=T.length+l.length|0;h.length=x,x=x-1|0;var w=T.words[0]|0,g=l.words[0]|0,v=w*g,C=v&67108863,b=v/67108864|0;h.words[0]=C;for(var d=1;d<x;d++){for(var E=b>>>26,q=b&67108863,I=Math.min(d,l.length-1),D=Math.max(0,d-T.length+1);D<=I;D++){var $=d-D|0;w=T.words[$]|0,g=l.words[D]|0,v=w*g+q,E+=v/67108864|0,q=v&67108863}h.words[d]=q|0,b=E|0}return b!==0?h.words[d]=b|0:h.length--,h.strip()}var _=function(l,h,x){var w=l.words,g=h.words,v=x.words,C=0,b,d,E,q=w[0]|0,I=q&8191,D=q>>>13,$=w[1]|0,K=$&8191,B=$>>>13,me=w[2]|0,ie=me&8191,R=me>>>13,Y=w[3]|0,k=Y&8191,j=Y>>>13,J=w[4]|0,V=J&8191,z=J>>>13,ge=w[5]|0,re=ge&8191,Pe=ge>>>13,zg=w[6]|0,Me=zg&8191,Ie=zg>>>13,Kg=w[7]|0,Ne=Kg&8191,Le=Kg>>>13,Vg=w[8]|0,De=Vg&8191,Be=Vg>>>13,Yg=w[9]|0,je=Yg&8191,Fe=Yg>>>13,Xg=g[0]|0,He=Xg&8191,$e=Xg>>>13,Jg=g[1]|0,qe=Jg&8191,Ue=Jg>>>13,Qg=g[2]|0,We=Qg&8191,Ge=Qg>>>13,Zg=g[3]|0,ze=Zg&8191,Ke=Zg>>>13,ev=g[4]|0,Ve=ev&8191,Ye=ev>>>13,tv=g[5]|0,Xe=tv&8191,Je=tv>>>13,rv=g[6]|0,Qe=rv&8191,Ze=rv>>>13,nv=g[7]|0,et=nv&8191,tt=nv>>>13,iv=g[8]|0,rt=iv&8191,nt=iv>>>13,sv=g[9]|0,it=sv&8191,st=sv>>>13;x.negative=l.negative^h.negative,x.length=19,b=Math.imul(I,He),d=Math.imul(I,$e),d=d+Math.imul(D,He)|0,E=Math.imul(D,$e);var Vu=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Vu>>>26)|0,Vu&=67108863,b=Math.imul(K,He),d=Math.imul(K,$e),d=d+Math.imul(B,He)|0,E=Math.imul(B,$e),b=b+Math.imul(I,qe)|0,d=d+Math.imul(I,Ue)|0,d=d+Math.imul(D,qe)|0,E=E+Math.imul(D,Ue)|0;var Yu=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Yu>>>26)|0,Yu&=67108863,b=Math.imul(ie,He),d=Math.imul(ie,$e),d=d+Math.imul(R,He)|0,E=Math.imul(R,$e),b=b+Math.imul(K,qe)|0,d=d+Math.imul(K,Ue)|0,d=d+Math.imul(B,qe)|0,E=E+Math.imul(B,Ue)|0,b=b+Math.imul(I,We)|0,d=d+Math.imul(I,Ge)|0,d=d+Math.imul(D,We)|0,E=E+Math.imul(D,Ge)|0;var Xu=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Xu>>>26)|0,Xu&=67108863,b=Math.imul(k,He),d=Math.imul(k,$e),d=d+Math.imul(j,He)|0,E=Math.imul(j,$e),b=b+Math.imul(ie,qe)|0,d=d+Math.imul(ie,Ue)|0,d=d+Math.imul(R,qe)|0,E=E+Math.imul(R,Ue)|0,b=b+Math.imul(K,We)|0,d=d+Math.imul(K,Ge)|0,d=d+Math.imul(B,We)|0,E=E+Math.imul(B,Ge)|0,b=b+Math.imul(I,ze)|0,d=d+Math.imul(I,Ke)|0,d=d+Math.imul(D,ze)|0,E=E+Math.imul(D,Ke)|0;var Ju=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Ju>>>26)|0,Ju&=67108863,b=Math.imul(V,He),d=Math.imul(V,$e),d=d+Math.imul(z,He)|0,E=Math.imul(z,$e),b=b+Math.imul(k,qe)|0,d=d+Math.imul(k,Ue)|0,d=d+Math.imul(j,qe)|0,E=E+Math.imul(j,Ue)|0,b=b+Math.imul(ie,We)|0,d=d+Math.imul(ie,Ge)|0,d=d+Math.imul(R,We)|0,E=E+Math.imul(R,Ge)|0,b=b+Math.imul(K,ze)|0,d=d+Math.imul(K,Ke)|0,d=d+Math.imul(B,ze)|0,E=E+Math.imul(B,Ke)|0,b=b+Math.imul(I,Ve)|0,d=d+Math.imul(I,Ye)|0,d=d+Math.imul(D,Ve)|0,E=E+Math.imul(D,Ye)|0;var Qu=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Qu>>>26)|0,Qu&=67108863,b=Math.imul(re,He),d=Math.imul(re,$e),d=d+Math.imul(Pe,He)|0,E=Math.imul(Pe,$e),b=b+Math.imul(V,qe)|0,d=d+Math.imul(V,Ue)|0,d=d+Math.imul(z,qe)|0,E=E+Math.imul(z,Ue)|0,b=b+Math.imul(k,We)|0,d=d+Math.imul(k,Ge)|0,d=d+Math.imul(j,We)|0,E=E+Math.imul(j,Ge)|0,b=b+Math.imul(ie,ze)|0,d=d+Math.imul(ie,Ke)|0,d=d+Math.imul(R,ze)|0,E=E+Math.imul(R,Ke)|0,b=b+Math.imul(K,Ve)|0,d=d+Math.imul(K,Ye)|0,d=d+Math.imul(B,Ve)|0,E=E+Math.imul(B,Ye)|0,b=b+Math.imul(I,Xe)|0,d=d+Math.imul(I,Je)|0,d=d+Math.imul(D,Xe)|0,E=E+Math.imul(D,Je)|0;var Zu=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Zu>>>26)|0,Zu&=67108863,b=Math.imul(Me,He),d=Math.imul(Me,$e),d=d+Math.imul(Ie,He)|0,E=Math.imul(Ie,$e),b=b+Math.imul(re,qe)|0,d=d+Math.imul(re,Ue)|0,d=d+Math.imul(Pe,qe)|0,E=E+Math.imul(Pe,Ue)|0,b=b+Math.imul(V,We)|0,d=d+Math.imul(V,Ge)|0,d=d+Math.imul(z,We)|0,E=E+Math.imul(z,Ge)|0,b=b+Math.imul(k,ze)|0,d=d+Math.imul(k,Ke)|0,d=d+Math.imul(j,ze)|0,E=E+Math.imul(j,Ke)|0,b=b+Math.imul(ie,Ve)|0,d=d+Math.imul(ie,Ye)|0,d=d+Math.imul(R,Ve)|0,E=E+Math.imul(R,Ye)|0,b=b+Math.imul(K,Xe)|0,d=d+Math.imul(K,Je)|0,d=d+Math.imul(B,Xe)|0,E=E+Math.imul(B,Je)|0,b=b+Math.imul(I,Qe)|0,d=d+Math.imul(I,Ze)|0,d=d+Math.imul(D,Qe)|0,E=E+Math.imul(D,Ze)|0;var ep=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(ep>>>26)|0,ep&=67108863,b=Math.imul(Ne,He),d=Math.imul(Ne,$e),d=d+Math.imul(Le,He)|0,E=Math.imul(Le,$e),b=b+Math.imul(Me,qe)|0,d=d+Math.imul(Me,Ue)|0,d=d+Math.imul(Ie,qe)|0,E=E+Math.imul(Ie,Ue)|0,b=b+Math.imul(re,We)|0,d=d+Math.imul(re,Ge)|0,d=d+Math.imul(Pe,We)|0,E=E+Math.imul(Pe,Ge)|0,b=b+Math.imul(V,ze)|0,d=d+Math.imul(V,Ke)|0,d=d+Math.imul(z,ze)|0,E=E+Math.imul(z,Ke)|0,b=b+Math.imul(k,Ve)|0,d=d+Math.imul(k,Ye)|0,d=d+Math.imul(j,Ve)|0,E=E+Math.imul(j,Ye)|0,b=b+Math.imul(ie,Xe)|0,d=d+Math.imul(ie,Je)|0,d=d+Math.imul(R,Xe)|0,E=E+Math.imul(R,Je)|0,b=b+Math.imul(K,Qe)|0,d=d+Math.imul(K,Ze)|0,d=d+Math.imul(B,Qe)|0,E=E+Math.imul(B,Ze)|0,b=b+Math.imul(I,et)|0,d=d+Math.imul(I,tt)|0,d=d+Math.imul(D,et)|0,E=E+Math.imul(D,tt)|0;var tp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(tp>>>26)|0,tp&=67108863,b=Math.imul(De,He),d=Math.imul(De,$e),d=d+Math.imul(Be,He)|0,E=Math.imul(Be,$e),b=b+Math.imul(Ne,qe)|0,d=d+Math.imul(Ne,Ue)|0,d=d+Math.imul(Le,qe)|0,E=E+Math.imul(Le,Ue)|0,b=b+Math.imul(Me,We)|0,d=d+Math.imul(Me,Ge)|0,d=d+Math.imul(Ie,We)|0,E=E+Math.imul(Ie,Ge)|0,b=b+Math.imul(re,ze)|0,d=d+Math.imul(re,Ke)|0,d=d+Math.imul(Pe,ze)|0,E=E+Math.imul(Pe,Ke)|0,b=b+Math.imul(V,Ve)|0,d=d+Math.imul(V,Ye)|0,d=d+Math.imul(z,Ve)|0,E=E+Math.imul(z,Ye)|0,b=b+Math.imul(k,Xe)|0,d=d+Math.imul(k,Je)|0,d=d+Math.imul(j,Xe)|0,E=E+Math.imul(j,Je)|0,b=b+Math.imul(ie,Qe)|0,d=d+Math.imul(ie,Ze)|0,d=d+Math.imul(R,Qe)|0,E=E+Math.imul(R,Ze)|0,b=b+Math.imul(K,et)|0,d=d+Math.imul(K,tt)|0,d=d+Math.imul(B,et)|0,E=E+Math.imul(B,tt)|0,b=b+Math.imul(I,rt)|0,d=d+Math.imul(I,nt)|0,d=d+Math.imul(D,rt)|0,E=E+Math.imul(D,nt)|0;var rp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(rp>>>26)|0,rp&=67108863,b=Math.imul(je,He),d=Math.imul(je,$e),d=d+Math.imul(Fe,He)|0,E=Math.imul(Fe,$e),b=b+Math.imul(De,qe)|0,d=d+Math.imul(De,Ue)|0,d=d+Math.imul(Be,qe)|0,E=E+Math.imul(Be,Ue)|0,b=b+Math.imul(Ne,We)|0,d=d+Math.imul(Ne,Ge)|0,d=d+Math.imul(Le,We)|0,E=E+Math.imul(Le,Ge)|0,b=b+Math.imul(Me,ze)|0,d=d+Math.imul(Me,Ke)|0,d=d+Math.imul(Ie,ze)|0,E=E+Math.imul(Ie,Ke)|0,b=b+Math.imul(re,Ve)|0,d=d+Math.imul(re,Ye)|0,d=d+Math.imul(Pe,Ve)|0,E=E+Math.imul(Pe,Ye)|0,b=b+Math.imul(V,Xe)|0,d=d+Math.imul(V,Je)|0,d=d+Math.imul(z,Xe)|0,E=E+Math.imul(z,Je)|0,b=b+Math.imul(k,Qe)|0,d=d+Math.imul(k,Ze)|0,d=d+Math.imul(j,Qe)|0,E=E+Math.imul(j,Ze)|0,b=b+Math.imul(ie,et)|0,d=d+Math.imul(ie,tt)|0,d=d+Math.imul(R,et)|0,E=E+Math.imul(R,tt)|0,b=b+Math.imul(K,rt)|0,d=d+Math.imul(K,nt)|0,d=d+Math.imul(B,rt)|0,E=E+Math.imul(B,nt)|0,b=b+Math.imul(I,it)|0,d=d+Math.imul(I,st)|0,d=d+Math.imul(D,it)|0,E=E+Math.imul(D,st)|0;var np=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(np>>>26)|0,np&=67108863,b=Math.imul(je,qe),d=Math.imul(je,Ue),d=d+Math.imul(Fe,qe)|0,E=Math.imul(Fe,Ue),b=b+Math.imul(De,We)|0,d=d+Math.imul(De,Ge)|0,d=d+Math.imul(Be,We)|0,E=E+Math.imul(Be,Ge)|0,b=b+Math.imul(Ne,ze)|0,d=d+Math.imul(Ne,Ke)|0,d=d+Math.imul(Le,ze)|0,E=E+Math.imul(Le,Ke)|0,b=b+Math.imul(Me,Ve)|0,d=d+Math.imul(Me,Ye)|0,d=d+Math.imul(Ie,Ve)|0,E=E+Math.imul(Ie,Ye)|0,b=b+Math.imul(re,Xe)|0,d=d+Math.imul(re,Je)|0,d=d+Math.imul(Pe,Xe)|0,E=E+Math.imul(Pe,Je)|0,b=b+Math.imul(V,Qe)|0,d=d+Math.imul(V,Ze)|0,d=d+Math.imul(z,Qe)|0,E=E+Math.imul(z,Ze)|0,b=b+Math.imul(k,et)|0,d=d+Math.imul(k,tt)|0,d=d+Math.imul(j,et)|0,E=E+Math.imul(j,tt)|0,b=b+Math.imul(ie,rt)|0,d=d+Math.imul(ie,nt)|0,d=d+Math.imul(R,rt)|0,E=E+Math.imul(R,nt)|0,b=b+Math.imul(K,it)|0,d=d+Math.imul(K,st)|0,d=d+Math.imul(B,it)|0,E=E+Math.imul(B,st)|0;var ip=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(ip>>>26)|0,ip&=67108863,b=Math.imul(je,We),d=Math.imul(je,Ge),d=d+Math.imul(Fe,We)|0,E=Math.imul(Fe,Ge),b=b+Math.imul(De,ze)|0,d=d+Math.imul(De,Ke)|0,d=d+Math.imul(Be,ze)|0,E=E+Math.imul(Be,Ke)|0,b=b+Math.imul(Ne,Ve)|0,d=d+Math.imul(Ne,Ye)|0,d=d+Math.imul(Le,Ve)|0,E=E+Math.imul(Le,Ye)|0,b=b+Math.imul(Me,Xe)|0,d=d+Math.imul(Me,Je)|0,d=d+Math.imul(Ie,Xe)|0,E=E+Math.imul(Ie,Je)|0,b=b+Math.imul(re,Qe)|0,d=d+Math.imul(re,Ze)|0,d=d+Math.imul(Pe,Qe)|0,E=E+Math.imul(Pe,Ze)|0,b=b+Math.imul(V,et)|0,d=d+Math.imul(V,tt)|0,d=d+Math.imul(z,et)|0,E=E+Math.imul(z,tt)|0,b=b+Math.imul(k,rt)|0,d=d+Math.imul(k,nt)|0,d=d+Math.imul(j,rt)|0,E=E+Math.imul(j,nt)|0,b=b+Math.imul(ie,it)|0,d=d+Math.imul(ie,st)|0,d=d+Math.imul(R,it)|0,E=E+Math.imul(R,st)|0;var sp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(sp>>>26)|0,sp&=67108863,b=Math.imul(je,ze),d=Math.imul(je,Ke),d=d+Math.imul(Fe,ze)|0,E=Math.imul(Fe,Ke),b=b+Math.imul(De,Ve)|0,d=d+Math.imul(De,Ye)|0,d=d+Math.imul(Be,Ve)|0,E=E+Math.imul(Be,Ye)|0,b=b+Math.imul(Ne,Xe)|0,d=d+Math.imul(Ne,Je)|0,d=d+Math.imul(Le,Xe)|0,E=E+Math.imul(Le,Je)|0,b=b+Math.imul(Me,Qe)|0,d=d+Math.imul(Me,Ze)|0,d=d+Math.imul(Ie,Qe)|0,E=E+Math.imul(Ie,Ze)|0,b=b+Math.imul(re,et)|0,d=d+Math.imul(re,tt)|0,d=d+Math.imul(Pe,et)|0,E=E+Math.imul(Pe,tt)|0,b=b+Math.imul(V,rt)|0,d=d+Math.imul(V,nt)|0,d=d+Math.imul(z,rt)|0,E=E+Math.imul(z,nt)|0,b=b+Math.imul(k,it)|0,d=d+Math.imul(k,st)|0,d=d+Math.imul(j,it)|0,E=E+Math.imul(j,st)|0;var op=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(op>>>26)|0,op&=67108863,b=Math.imul(je,Ve),d=Math.imul(je,Ye),d=d+Math.imul(Fe,Ve)|0,E=Math.imul(Fe,Ye),b=b+Math.imul(De,Xe)|0,d=d+Math.imul(De,Je)|0,d=d+Math.imul(Be,Xe)|0,E=E+Math.imul(Be,Je)|0,b=b+Math.imul(Ne,Qe)|0,d=d+Math.imul(Ne,Ze)|0,d=d+Math.imul(Le,Qe)|0,E=E+Math.imul(Le,Ze)|0,b=b+Math.imul(Me,et)|0,d=d+Math.imul(Me,tt)|0,d=d+Math.imul(Ie,et)|0,E=E+Math.imul(Ie,tt)|0,b=b+Math.imul(re,rt)|0,d=d+Math.imul(re,nt)|0,d=d+Math.imul(Pe,rt)|0,E=E+Math.imul(Pe,nt)|0,b=b+Math.imul(V,it)|0,d=d+Math.imul(V,st)|0,d=d+Math.imul(z,it)|0,E=E+Math.imul(z,st)|0;var ap=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(ap>>>26)|0,ap&=67108863,b=Math.imul(je,Xe),d=Math.imul(je,Je),d=d+Math.imul(Fe,Xe)|0,E=Math.imul(Fe,Je),b=b+Math.imul(De,Qe)|0,d=d+Math.imul(De,Ze)|0,d=d+Math.imul(Be,Qe)|0,E=E+Math.imul(Be,Ze)|0,b=b+Math.imul(Ne,et)|0,d=d+Math.imul(Ne,tt)|0,d=d+Math.imul(Le,et)|0,E=E+Math.imul(Le,tt)|0,b=b+Math.imul(Me,rt)|0,d=d+Math.imul(Me,nt)|0,d=d+Math.imul(Ie,rt)|0,E=E+Math.imul(Ie,nt)|0,b=b+Math.imul(re,it)|0,d=d+Math.imul(re,st)|0,d=d+Math.imul(Pe,it)|0,E=E+Math.imul(Pe,st)|0;var cp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(cp>>>26)|0,cp&=67108863,b=Math.imul(je,Qe),d=Math.imul(je,Ze),d=d+Math.imul(Fe,Qe)|0,E=Math.imul(Fe,Ze),b=b+Math.imul(De,et)|0,d=d+Math.imul(De,tt)|0,d=d+Math.imul(Be,et)|0,E=E+Math.imul(Be,tt)|0,b=b+Math.imul(Ne,rt)|0,d=d+Math.imul(Ne,nt)|0,d=d+Math.imul(Le,rt)|0,E=E+Math.imul(Le,nt)|0,b=b+Math.imul(Me,it)|0,d=d+Math.imul(Me,st)|0,d=d+Math.imul(Ie,it)|0,E=E+Math.imul(Ie,st)|0;var lp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(lp>>>26)|0,lp&=67108863,b=Math.imul(je,et),d=Math.imul(je,tt),d=d+Math.imul(Fe,et)|0,E=Math.imul(Fe,tt),b=b+Math.imul(De,rt)|0,d=d+Math.imul(De,nt)|0,d=d+Math.imul(Be,rt)|0,E=E+Math.imul(Be,nt)|0,b=b+Math.imul(Ne,it)|0,d=d+Math.imul(Ne,st)|0,d=d+Math.imul(Le,it)|0,E=E+Math.imul(Le,st)|0;var up=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(up>>>26)|0,up&=67108863,b=Math.imul(je,rt),d=Math.imul(je,nt),d=d+Math.imul(Fe,rt)|0,E=Math.imul(Fe,nt),b=b+Math.imul(De,it)|0,d=d+Math.imul(De,st)|0,d=d+Math.imul(Be,it)|0,E=E+Math.imul(Be,st)|0;var pp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(pp>>>26)|0,pp&=67108863,b=Math.imul(je,it),d=Math.imul(je,st),d=d+Math.imul(Fe,it)|0,E=Math.imul(Fe,st);var fp=(C+b|0)+((d&8191)<<13)|0;return C=(E+(d>>>13)|0)+(fp>>>26)|0,fp&=67108863,v[0]=Vu,v[1]=Yu,v[2]=Xu,v[3]=Ju,v[4]=Qu,v[5]=Zu,v[6]=ep,v[7]=tp,v[8]=rp,v[9]=np,v[10]=ip,v[11]=sp,v[12]=op,v[13]=ap,v[14]=cp,v[15]=lp,v[16]=up,v[17]=pp,v[18]=fp,C!==0&&(v[19]=C,x.length++),x};Math.imul||(_=y);function S(T,l,h){h.negative=l.negative^T.negative,h.length=T.length+l.length;for(var x=0,w=0,g=0;g<h.length-1;g++){var v=w;w=0;for(var C=x&67108863,b=Math.min(g,l.length-1),d=Math.max(0,g-T.length+1);d<=b;d++){var E=g-d,q=T.words[E]|0,I=l.words[d]|0,D=q*I,$=D&67108863;v=v+(D/67108864|0)|0,$=$+C|0,C=$&67108863,v=v+($>>>26)|0,w+=v>>>26,v&=67108863}h.words[g]=C,x=v,v=w}return x!==0?h.words[g]=x:h.length--,h.strip()}function A(T,l,h){var x=new P;return x.mulp(T,l,h)}i.prototype.mulTo=function(l,h){var x,w=this.length+l.length;return this.length===10&&l.length===10?x=_(this,l,h):w<63?x=y(this,l,h):w<1024?x=S(this,l,h):x=A(this,l,h),x};function P(T,l){this.x=T,this.y=l}P.prototype.makeRBT=function(l){for(var h=new Array(l),x=i.prototype._countBits(l)-1,w=0;w<l;w++)h[w]=this.revBin(w,x,l);return h},P.prototype.revBin=function(l,h,x){if(l===0||l===x-1)return l;for(var w=0,g=0;g<h;g++)w|=(l&1)<<h-g-1,l>>=1;return w},P.prototype.permute=function(l,h,x,w,g,v){for(var C=0;C<v;C++)w[C]=h[l[C]],g[C]=x[l[C]]},P.prototype.transform=function(l,h,x,w,g,v){this.permute(v,l,h,x,w,g);for(var C=1;C<g;C<<=1)for(var b=C<<1,d=Math.cos(2*Math.PI/b),E=Math.sin(2*Math.PI/b),q=0;q<g;q+=b)for(var I=d,D=E,$=0;$<C;$++){var K=x[q+$],B=w[q+$],me=x[q+$+C],ie=w[q+$+C],R=I*me-D*ie;ie=I*ie+D*me,me=R,x[q+$]=K+me,w[q+$]=B+ie,x[q+$+C]=K-me,w[q+$+C]=B-ie,$!==b&&(R=d*I-E*D,D=d*D+E*I,I=R)}},P.prototype.guessLen13b=function(l,h){var x=Math.max(h,l)|1,w=x&1,g=0;for(x=x/2|0;x;x=x>>>1)g++;return 1<<g+1+w},P.prototype.conjugate=function(l,h,x){if(!(x<=1))for(var w=0;w<x/2;w++){var g=l[w];l[w]=l[x-w-1],l[x-w-1]=g,g=h[w],h[w]=-h[x-w-1],h[x-w-1]=-g}},P.prototype.normalize13b=function(l,h){for(var x=0,w=0;w<h/2;w++){var g=Math.round(l[2*w+1]/h)*8192+Math.round(l[2*w]/h)+x;l[w]=g&67108863,g<67108864?x=0:x=g/67108864|0}return l},P.prototype.convert13b=function(l,h,x,w){for(var g=0,v=0;v<h;v++)g=g+(l[v]|0),x[2*v]=g&8191,g=g>>>13,x[2*v+1]=g&8191,g=g>>>13;for(v=2*h;v<w;++v)x[v]=0;t(g===0),t((g&-8192)===0)},P.prototype.stub=function(l){for(var h=new Array(l),x=0;x<l;x++)h[x]=0;return h},P.prototype.mulp=function(l,h,x){var w=2*this.guessLen13b(l.length,h.length),g=this.makeRBT(w),v=this.stub(w),C=new Array(w),b=new Array(w),d=new Array(w),E=new Array(w),q=new Array(w),I=new Array(w),D=x.words;D.length=w,this.convert13b(l.words,l.length,C,w),this.convert13b(h.words,h.length,E,w),this.transform(C,v,b,d,w,g),this.transform(E,v,q,I,w,g);for(var $=0;$<w;$++){var K=b[$]*q[$]-d[$]*I[$];d[$]=b[$]*I[$]+d[$]*q[$],b[$]=K}return this.conjugate(b,d,w),this.transform(b,d,D,v,w,g),this.conjugate(D,v,w),this.normalize13b(D,w),x.negative=l.negative^h.negative,x.length=l.length+h.length,x.strip()},i.prototype.mul=function(l){var h=new i(null);return h.words=new Array(this.length+l.length),this.mulTo(l,h)},i.prototype.mulf=function(l){var h=new i(null);return h.words=new Array(this.length+l.length),A(this,l,h)},i.prototype.imul=function(l){return this.clone().mulTo(l,this)},i.prototype.imuln=function(l){t(typeof l=="number"),t(l<67108864);for(var h=0,x=0;x<this.length;x++){var w=(this.words[x]|0)*l,g=(w&67108863)+(h&67108863);h>>=26,h+=w/67108864|0,h+=g>>>26,this.words[x]=g&67108863}return h!==0&&(this.words[x]=h,this.length++),this.length=l===0?1:this.length,this},i.prototype.muln=function(l){return this.clone().imuln(l)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(l){var h=m(l);if(h.length===0)return new i(1);for(var x=this,w=0;w<h.length&&h[w]===0;w++,x=x.sqr());if(++w<h.length)for(var g=x.sqr();w<h.length;w++,g=g.sqr())h[w]!==0&&(x=x.mul(g));return x},i.prototype.iushln=function(l){t(typeof l=="number"&&l>=0);var h=l%26,x=(l-h)/26,w=67108863>>>26-h<<26-h,g;if(h!==0){var v=0;for(g=0;g<this.length;g++){var C=this.words[g]&w,b=(this.words[g]|0)-C<<h;this.words[g]=b|v,v=C>>>26-h}v&&(this.words[g]=v,this.length++)}if(x!==0){for(g=this.length-1;g>=0;g--)this.words[g+x]=this.words[g];for(g=0;g<x;g++)this.words[g]=0;this.length+=x}return this.strip()},i.prototype.ishln=function(l){return t(this.negative===0),this.iushln(l)},i.prototype.iushrn=function(l,h,x){t(typeof l=="number"&&l>=0);var w;h?w=(h-h%26)/26:w=0;var g=l%26,v=Math.min((l-g)/26,this.length),C=67108863^67108863>>>g<<g,b=x;if(w-=v,w=Math.max(0,w),b){for(var d=0;d<v;d++)b.words[d]=this.words[d];b.length=v}if(v!==0)if(this.length>v)for(this.length-=v,d=0;d<this.length;d++)this.words[d]=this.words[d+v];else this.words[0]=0,this.length=1;var E=0;for(d=this.length-1;d>=0&&(E!==0||d>=w);d--){var q=this.words[d]|0;this.words[d]=E<<26-g|q>>>g,E=q&C}return b&&E!==0&&(b.words[b.length++]=E),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(l,h,x){return t(this.negative===0),this.iushrn(l,h,x)},i.prototype.shln=function(l){return this.clone().ishln(l)},i.prototype.ushln=function(l){return this.clone().iushln(l)},i.prototype.shrn=function(l){return this.clone().ishrn(l)},i.prototype.ushrn=function(l){return this.clone().iushrn(l)},i.prototype.testn=function(l){t(typeof l=="number"&&l>=0);var h=l%26,x=(l-h)/26,w=1<<h;if(this.length<=x)return!1;var g=this.words[x];return!!(g&w)},i.prototype.imaskn=function(l){t(typeof l=="number"&&l>=0);var h=l%26,x=(l-h)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=x)return this;if(h!==0&&x++,this.length=Math.min(x,this.length),h!==0){var w=67108863^67108863>>>h<<h;this.words[this.length-1]&=w}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.maskn=function(l){return this.clone().imaskn(l)},i.prototype.iaddn=function(l){return t(typeof l=="number"),t(l<67108864),l<0?this.isubn(-l):this.negative!==0?this.length===1&&(this.words[0]|0)<l?(this.words[0]=l-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(l),this.negative=1,this):this._iaddn(l)},i.prototype._iaddn=function(l){this.words[0]+=l;for(var h=0;h<this.length&&this.words[h]>=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},i.prototype.isubn=function(l){if(t(typeof l=="number"),t(l<67108864),l<0)return this.iaddn(-l);if(this.negative!==0)return this.negative=0,this.iaddn(l),this.negative=1,this;if(this.words[0]-=l,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h<this.length&&this.words[h]<0;h++)this.words[h]+=67108864,this.words[h+1]-=1;return this.strip()},i.prototype.addn=function(l){return this.clone().iaddn(l)},i.prototype.subn=function(l){return this.clone().isubn(l)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(l,h,x){var w=l.length+x,g;this._expand(w);var v,C=0;for(g=0;g<l.length;g++){v=(this.words[g+x]|0)+C;var b=(l.words[g]|0)*h;v-=b&67108863,C=(v>>26)-(b/67108864|0),this.words[g+x]=v&67108863}for(;g<this.length-x;g++)v=(this.words[g+x]|0)+C,C=v>>26,this.words[g+x]=v&67108863;if(C===0)return this.strip();for(t(C===-1),C=0,g=0;g<this.length;g++)v=-(this.words[g]|0)+C,C=v>>26,this.words[g]=v&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(l,h){var x=this.length-l.length,w=this.clone(),g=l,v=g.words[g.length-1]|0,C=this._countBits(v);x=26-C,x!==0&&(g=g.ushln(x),w.iushln(x),v=g.words[g.length-1]|0);var b=w.length-g.length,d;if(h!=="mod"){d=new i(null),d.length=b+1,d.words=new Array(d.length);for(var E=0;E<d.length;E++)d.words[E]=0}var q=w.clone()._ishlnsubmul(g,1,b);q.negative===0&&(w=q,d&&(d.words[b]=1));for(var I=b-1;I>=0;I--){var D=(w.words[g.length+I]|0)*67108864+(w.words[g.length+I-1]|0);for(D=Math.min(D/v|0,67108863),w._ishlnsubmul(g,D,I);w.negative!==0;)D--,w.negative=0,w._ishlnsubmul(g,1,I),w.isZero()||(w.negative^=1);d&&(d.words[I]=D)}return d&&d.strip(),w.strip(),h!=="div"&&x!==0&&w.iushrn(x),{div:d||null,mod:w}},i.prototype.divmod=function(l,h,x){if(t(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var w,g,v;return this.negative!==0&&l.negative===0?(v=this.neg().divmod(l,h),h!=="mod"&&(w=v.div.neg()),h!=="div"&&(g=v.mod.neg(),x&&g.negative!==0&&g.iadd(l)),{div:w,mod:g}):this.negative===0&&l.negative!==0?(v=this.divmod(l.neg(),h),h!=="mod"&&(w=v.div.neg()),{div:w,mod:v.mod}):(this.negative&l.negative)!==0?(v=this.neg().divmod(l.neg(),h),h!=="div"&&(g=v.mod.neg(),x&&g.negative!==0&&g.isub(l)),{div:v.div,mod:g}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?h==="div"?{div:this.divn(l.words[0]),mod:null}:h==="mod"?{div:null,mod:new i(this.modn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new i(this.modn(l.words[0]))}:this._wordDiv(l,h)},i.prototype.div=function(l){return this.divmod(l,"div",!1).div},i.prototype.mod=function(l){return this.divmod(l,"mod",!1).mod},i.prototype.umod=function(l){return this.divmod(l,"mod",!0).mod},i.prototype.divRound=function(l){var h=this.divmod(l);if(h.mod.isZero())return h.div;var x=h.div.negative!==0?h.mod.isub(l):h.mod,w=l.ushrn(1),g=l.andln(1),v=x.cmp(w);return v<0||g===1&&v===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},i.prototype.modn=function(l){t(l<=67108863);for(var h=(1<<26)%l,x=0,w=this.length-1;w>=0;w--)x=(h*x+(this.words[w]|0))%l;return x},i.prototype.idivn=function(l){t(l<=67108863);for(var h=0,x=this.length-1;x>=0;x--){var w=(this.words[x]|0)+h*67108864;this.words[x]=w/l|0,h=w%l}return this.strip()},i.prototype.divn=function(l){return this.clone().idivn(l)},i.prototype.egcd=function(l){t(l.negative===0),t(!l.isZero());var h=this,x=l.clone();h.negative!==0?h=h.umod(l):h=h.clone();for(var w=new i(1),g=new i(0),v=new i(0),C=new i(1),b=0;h.isEven()&&x.isEven();)h.iushrn(1),x.iushrn(1),++b;for(var d=x.clone(),E=h.clone();!h.isZero();){for(var q=0,I=1;(h.words[0]&I)===0&&q<26;++q,I<<=1);if(q>0)for(h.iushrn(q);q-- >0;)(w.isOdd()||g.isOdd())&&(w.iadd(d),g.isub(E)),w.iushrn(1),g.iushrn(1);for(var D=0,$=1;(x.words[0]&$)===0&&D<26;++D,$<<=1);if(D>0)for(x.iushrn(D);D-- >0;)(v.isOdd()||C.isOdd())&&(v.iadd(d),C.isub(E)),v.iushrn(1),C.iushrn(1);h.cmp(x)>=0?(h.isub(x),w.isub(v),g.isub(C)):(x.isub(h),v.isub(w),C.isub(g))}return{a:v,b:C,gcd:x.iushln(b)}},i.prototype._invmp=function(l){t(l.negative===0),t(!l.isZero());var h=this,x=l.clone();h.negative!==0?h=h.umod(l):h=h.clone();for(var w=new i(1),g=new i(0),v=x.clone();h.cmpn(1)>0&&x.cmpn(1)>0;){for(var C=0,b=1;(h.words[0]&b)===0&&C<26;++C,b<<=1);if(C>0)for(h.iushrn(C);C-- >0;)w.isOdd()&&w.iadd(v),w.iushrn(1);for(var d=0,E=1;(x.words[0]&E)===0&&d<26;++d,E<<=1);if(d>0)for(x.iushrn(d);d-- >0;)g.isOdd()&&g.iadd(v),g.iushrn(1);h.cmp(x)>=0?(h.isub(x),w.isub(g)):(x.isub(h),g.isub(w))}var q;return h.cmpn(1)===0?q=w:q=g,q.cmpn(0)<0&&q.iadd(l),q},i.prototype.gcd=function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var h=this.clone(),x=l.clone();h.negative=0,x.negative=0;for(var w=0;h.isEven()&&x.isEven();w++)h.iushrn(1),x.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;x.isEven();)x.iushrn(1);var g=h.cmp(x);if(g<0){var v=h;h=x,x=v}else if(g===0||x.cmpn(1)===0)break;h.isub(x)}while(!0);return x.iushln(w)},i.prototype.invm=function(l){return this.egcd(l).a.umod(l)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(l){return this.words[0]&l},i.prototype.bincn=function(l){t(typeof l=="number");var h=l%26,x=(l-h)/26,w=1<<h;if(this.length<=x)return this._expand(x+1),this.words[x]|=w,this;for(var g=w,v=x;g!==0&&v<this.length;v++){var C=this.words[v]|0;C+=g,g=C>>>26,C&=67108863,this.words[v]=C}return g!==0&&(this.words[v]=g,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(l){var h=l<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this.strip();var x;if(this.length>1)x=1;else{h&&(l=-l),t(l<=67108863,"Number is too big");var w=this.words[0]|0;x=w===l?0:w<l?-1:1}return this.negative!==0?-x|0:x},i.prototype.cmp=function(l){if(this.negative!==0&&l.negative===0)return-1;if(this.negative===0&&l.negative!==0)return 1;var h=this.ucmp(l);return this.negative!==0?-h|0:h},i.prototype.ucmp=function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var h=0,x=this.length-1;x>=0;x--){var w=this.words[x]|0,g=l.words[x]|0;if(w!==g){w<g?h=-1:w>g&&(h=1);break}}return h},i.prototype.gtn=function(l){return this.cmpn(l)===1},i.prototype.gt=function(l){return this.cmp(l)===1},i.prototype.gten=function(l){return this.cmpn(l)>=0},i.prototype.gte=function(l){return this.cmp(l)>=0},i.prototype.ltn=function(l){return this.cmpn(l)===-1},i.prototype.lt=function(l){return this.cmp(l)===-1},i.prototype.lten=function(l){return this.cmpn(l)<=0},i.prototype.lte=function(l){return this.cmp(l)<=0},i.prototype.eqn=function(l){return this.cmpn(l)===0},i.prototype.eq=function(l){return this.cmp(l)===0},i.red=function(l){return new M(l)},i.prototype.toRed=function(l){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},i.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(l){return this.red=l,this},i.prototype.forceRed=function(l){return t(!this.red,"Already a number in reduction context"),this._forceRed(l)},i.prototype.redAdd=function(l){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},i.prototype.redIAdd=function(l){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},i.prototype.redSub=function(l){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},i.prototype.redISub=function(l){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},i.prototype.redShl=function(l){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},i.prototype.redMul=function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.mul(this,l)},i.prototype.redIMul=function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.imul(this,l)},i.prototype.redSqr=function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(l){return t(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)};var L={k256:null,p224:null,p192:null,p25519:null};function N(T,l){this.name=T,this.p=new i(l,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}N.prototype._tmp=function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},N.prototype.ireduce=function(l){var h=l,x;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),x=h.bitLength();while(x>this.n);var w=x<this.n?-1:h.ucmp(this.p);return w===0?(h.words[0]=0,h.length=1):w>0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},N.prototype.split=function(l,h){l.iushrn(this.n,0,h)},N.prototype.imulK=function(l){return l.imul(this.k)};function H(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(H,N),H.prototype.split=function(l,h){for(var x=4194303,w=Math.min(l.length,9),g=0;g<w;g++)h.words[g]=l.words[g];if(h.length=w,l.length<=9){l.words[0]=0,l.length=1;return}var v=l.words[9];for(h.words[h.length++]=v&x,g=10;g<l.length;g++){var C=l.words[g]|0;l.words[g-10]=(C&x)<<4|v>>>22,v=C}v>>>=22,l.words[g-10]=v,v===0&&l.length>10?l.length-=10:l.length-=9},H.prototype.imulK=function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var h=0,x=0;x<l.length;x++){var w=l.words[x]|0;h+=w*977,l.words[x]=h&67108863,h=w*64+(h/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l};function W(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(W,N);function U(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(U,N);function G(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(G,N),G.prototype.imulK=function(l){for(var h=0,x=0;x<l.length;x++){var w=(l.words[x]|0)*19+h,g=w&67108863;w>>>=26,l.words[x]=g,h=w}return h!==0&&(l.words[l.length++]=h),l},i._prime=function(l){if(L[l])return L[l];var h;if(l==="k256")h=new H;else if(l==="p224")h=new W;else if(l==="p192")h=new U;else if(l==="p25519")h=new G;else throw new Error("Unknown prime "+l);return L[l]=h,h};function M(T){if(typeof T=="string"){var l=i._prime(T);this.m=l.p,this.prime=l}else t(T.gtn(1),"modulus must be greater than 1"),this.m=T,this.prime=null}M.prototype._verify1=function(l){t(l.negative===0,"red works only with positives"),t(l.red,"red works only with red numbers")},M.prototype._verify2=function(l,h){t((l.negative|h.negative)===0,"red works only with positives"),t(l.red&&l.red===h.red,"red works only with red numbers")},M.prototype.imod=function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):l.umod(this.m)._forceRed(this)},M.prototype.neg=function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},M.prototype.add=function(l,h){this._verify2(l,h);var x=l.add(h);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},M.prototype.iadd=function(l,h){this._verify2(l,h);var x=l.iadd(h);return x.cmp(this.m)>=0&&x.isub(this.m),x},M.prototype.sub=function(l,h){this._verify2(l,h);var x=l.sub(h);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},M.prototype.isub=function(l,h){this._verify2(l,h);var x=l.isub(h);return x.cmpn(0)<0&&x.iadd(this.m),x},M.prototype.shl=function(l,h){return this._verify1(l),this.imod(l.ushln(h))},M.prototype.imul=function(l,h){return this._verify2(l,h),this.imod(l.imul(h))},M.prototype.mul=function(l,h){return this._verify2(l,h),this.imod(l.mul(h))},M.prototype.isqr=function(l){return this.imul(l,l.clone())},M.prototype.sqr=function(l){return this.mul(l,l)},M.prototype.sqrt=function(l){if(l.isZero())return l.clone();var h=this.m.andln(3);if(t(h%2===1),h===3){var x=this.m.add(new i(1)).iushrn(2);return this.pow(l,x)}for(var w=this.m.subn(1),g=0;!w.isZero()&&w.andln(1)===0;)g++,w.iushrn(1);t(!w.isZero());var v=new i(1).toRed(this),C=v.redNeg(),b=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new i(2*d*d).toRed(this);this.pow(d,b).cmp(C)!==0;)d.redIAdd(C);for(var E=this.pow(d,w),q=this.pow(l,w.addn(1).iushrn(1)),I=this.pow(l,w),D=g;I.cmp(v)!==0;){for(var $=I,K=0;$.cmp(v)!==0;K++)$=$.redSqr();t(K<D);var B=this.pow(E,new i(1).iushln(D-K-1));q=q.redMul(B),E=B.redSqr(),I=I.redMul(E),D=K}return q},M.prototype.invm=function(l){var h=l._invmp(this.m);return h.negative!==0?(h.negative=0,this.imod(h).redNeg()):this.imod(h)},M.prototype.pow=function(l,h){if(h.isZero())return new i(1).toRed(this);if(h.cmpn(1)===0)return l.clone();var x=4,w=new Array(1<<x);w[0]=new i(1).toRed(this),w[1]=l;for(var g=2;g<w.length;g++)w[g]=this.mul(w[g-1],l);var v=w[0],C=0,b=0,d=h.bitLength()%26;for(d===0&&(d=26),g=h.length-1;g>=0;g--){for(var E=h.words[g],q=d-1;q>=0;q--){var I=E>>q&1;if(v!==w[0]&&(v=this.sqr(v)),I===0&&C===0){b=0;continue}C<<=1,C|=I,b++,!(b!==x&&(g!==0||q!==0))&&(v=this.mul(v,w[C]),b=0,C=0)}d=26}return v},M.prototype.convertTo=function(l){var h=l.umod(this.m);return h===l?h.clone():h},M.prototype.convertFrom=function(l){var h=l.clone();return h.red=null,h},i.mont=function(l){return new F(l)};function F(T){M.call(this,T),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(F,M),F.prototype.convertTo=function(l){return this.imod(l.ushln(this.shift))},F.prototype.convertFrom=function(l){var h=this.imod(l.mul(this.rinv));return h.red=null,h},F.prototype.imul=function(l,h){if(l.isZero()||h.isZero())return l.words[0]=0,l.length=1,l;var x=l.imul(h),w=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=x.isub(w).iushrn(this.shift),v=g;return g.cmp(this.m)>=0?v=g.isub(this.m):g.cmpn(0)<0&&(v=g.iadd(this.m)),v._forceRed(this)},F.prototype.mul=function(l,h){if(l.isZero()||h.isZero())return new i(0)._forceRed(this);var x=l.mul(h),w=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=x.isub(w).iushrn(this.shift),v=g;return g.cmp(this.m)>=0?v=g.isub(this.m):g.cmpn(0)<0&&(v=g.iadd(this.m)),v._forceRed(this)},F.prototype.invm=function(l){var h=this.imod(l._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(typeof Rh>"u"||Rh,XS)});var JS=O((oG,Oh)=>{typeof Object.create=="function"?Oh.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Oh.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}});var Un=O((aG,Mh)=>{try{if(Ph=require("util"),typeof Ph.inherits!="function")throw"";Mh.exports=Ph.inherits}catch{Mh.exports=JS()}var Ph});var Fl=O((cG,QS)=>{"use strict";var jl=require("buffer"),bs=jl.Buffer,pr={},fr;for(fr in jl)jl.hasOwnProperty(fr)&&(fr==="SlowBuffer"||fr==="Buffer"||(pr[fr]=jl[fr]));var ws=pr.Buffer={};for(fr in bs)bs.hasOwnProperty(fr)&&(fr==="allocUnsafe"||fr==="allocUnsafeSlow"||(ws[fr]=bs[fr]));pr.Buffer.prototype=bs.prototype;(!ws.from||ws.from===Uint8Array.from)&&(ws.from=function(r,e,t){if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof r);if(r&&typeof r.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);return bs(r,e,t)});ws.alloc||(ws.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof r);if(r<0||r>=2*(1<<30))throw new RangeError('The value "'+r+'" is invalid for option "size"');var n=bs(r);return!e||e.length===0?n.fill(0):typeof t=="string"?n.fill(e,t):n.fill(e),n});if(!pr.kStringMaxLength)try{pr.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}pr.constants||(pr.constants={MAX_LENGTH:pr.kMaxLength},pr.kStringMaxLength&&(pr.constants.MAX_STRING_LENGTH=pr.kStringMaxLength));QS.exports=pr});var Hl=O(ZS=>{"use strict";var qB=Un();function dr(r){this._reporterState={obj:null,path:[],options:r||{},errors:[]}}ZS.Reporter=dr;dr.prototype.isError=function(e){return e instanceof Ss};dr.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};dr.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)};dr.prototype.enterKey=function(e){return this._reporterState.path.push(e)};dr.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)};dr.prototype.leaveKey=function(e,t,n){let i=this._reporterState;this.exitKey(e),i.obj!==null&&(i.obj[t]=n)};dr.prototype.path=function(){return this._reporterState.path.join("/")};dr.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t};dr.prototype.leaveObject=function(e){let t=this._reporterState,n=t.obj;return t.obj=e,n};dr.prototype.error=function(e){let t,n=this._reporterState,i=e instanceof Ss;if(i?t=e:t=new Ss(n.path.map(function(s){return"["+JSON.stringify(s)+"]"}).join(""),e.message||e,e.stack),!n.options.partial)throw t;return i||n.errors.push(t),t};dr.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};function Ss(r,e){this.path=r,this.rethrow(e)}qB(Ss,Error);Ss.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Ss),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}});var Cs=O(Ih=>{"use strict";var UB=Un(),$l=Hl().Reporter,Es=Fl().Buffer;function hr(r,e){if($l.call(this,e),!Es.isBuffer(r)){this.error("Input not Buffer");return}this.base=r,this.offset=0,this.length=r.length}UB(hr,$l);Ih.DecoderBuffer=hr;hr.isDecoderBuffer=function(e){return e instanceof hr?!0:typeof e=="object"&&Es.isBuffer(e.base)&&e.constructor.name==="DecoderBuffer"&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.save=="function"&&typeof e.restore=="function"&&typeof e.isEmpty=="function"&&typeof e.readUInt8=="function"&&typeof e.skip=="function"&&typeof e.raw=="function"};hr.prototype.save=function(){return{offset:this.offset,reporter:$l.prototype.save.call(this)}};hr.prototype.restore=function(e){let t=new hr(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,$l.prototype.restore.call(this,e.reporter),t};hr.prototype.isEmpty=function(){return this.offset===this.length};hr.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};hr.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");let n=new hr(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n};hr.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function Ts(r,e){if(Array.isArray(r))this.length=0,this.value=r.map(function(t){return Ts.isEncoderBuffer(t)||(t=new Ts(t,e)),this.length+=t.length,t},this);else if(typeof r=="number"){if(!(0<=r&&r<=255))return e.error("non-byte EncoderBuffer value");this.value=r,this.length=1}else if(typeof r=="string")this.value=r,this.length=Es.byteLength(r);else if(Es.isBuffer(r))this.value=r,this.length=r.length;else return e.error("Unsupported type: "+typeof r)}Ih.EncoderBuffer=Ts;Ts.isEncoderBuffer=function(e){return e instanceof Ts?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};Ts.prototype.join=function(e,t){return e||(e=Es.alloc(this.length)),t||(t=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(n){n.join(e,t),t+=n.length}):(typeof this.value=="number"?e[t]=this.value:typeof this.value=="string"?e.write(this.value,t):Es.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}});var rE=O((pG,tE)=>{tE.exports=eE;function eE(r,e){if(!r)throw new Error(e||"Assertion failed")}eE.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}});var ql=O((fG,iE)=>{"use strict";var WB=Hl().Reporter,GB=Cs().EncoderBuffer,zB=Cs().DecoderBuffer,Ot=rE(),nE=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],KB=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(nE),VB=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function fe(r,e,t){let n={};this._baseState=n,n.name=t,n.enc=r,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}iE.exports=fe;var YB=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];fe.prototype.clone=function(){let e=this._baseState,t={};YB.forEach(function(i){t[i]=e[i]});let n=new this.constructor(t.parent);return n._baseState=t,n};fe.prototype._wrap=function(){let e=this._baseState;KB.forEach(function(t){this[t]=function(){let i=new this.constructor(this);return e.children.push(i),i[t].apply(i,arguments)}},this)};fe.prototype._init=function(e){let t=this._baseState;Ot(t.parent===null),e.call(this),t.children=t.children.filter(function(n){return n._baseState.parent===this},this),Ot.equal(t.children.length,1,"Root node can have only one child")};fe.prototype._useArgs=function(e){let t=this._baseState,n=e.filter(function(i){return i instanceof this.constructor},this);e=e.filter(function(i){return!(i instanceof this.constructor)},this),n.length!==0&&(Ot(t.children===null),t.children=n,n.forEach(function(i){i._baseState.parent=this},this)),e.length!==0&&(Ot(t.args===null),t.args=e,t.reverseArgs=e.map(function(i){if(typeof i!="object"||i.constructor!==Object)return i;let s={};return Object.keys(i).forEach(function(o){o==(o|0)&&(o|=0);let a=i[o];s[a]=o}),s}))};VB.forEach(function(r){fe.prototype[r]=function(){let t=this._baseState;throw new Error(r+" not implemented for encoding: "+t.enc)}});nE.forEach(function(r){fe.prototype[r]=function(){let t=this._baseState,n=Array.prototype.slice.call(arguments);return Ot(t.tag===null),t.tag=r,this._useArgs(n),this}});fe.prototype.use=function(e){Ot(e);let t=this._baseState;return Ot(t.use===null),t.use=e,this};fe.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};fe.prototype.def=function(e){let t=this._baseState;return Ot(t.default===null),t.default=e,t.optional=!0,this};fe.prototype.explicit=function(e){let t=this._baseState;return Ot(t.explicit===null&&t.implicit===null),t.explicit=e,this};fe.prototype.implicit=function(e){let t=this._baseState;return Ot(t.explicit===null&&t.implicit===null),t.implicit=e,this};fe.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this};fe.prototype.key=function(e){let t=this._baseState;return Ot(t.key===null),t.key=e,this};fe.prototype.any=function(){let e=this._baseState;return e.any=!0,this};fe.prototype.choice=function(e){let t=this._baseState;return Ot(t.choice===null),t.choice=e,this._useArgs(Object.keys(e).map(function(n){return e[n]})),this};fe.prototype.contains=function(e){let t=this._baseState;return Ot(t.use===null),t.contains=e,this};fe.prototype._decode=function(e,t){let n=this._baseState;if(n.parent===null)return e.wrapResult(n.children[0]._decode(e,t));let i=n.default,s=!0,o=null;if(n.key!==null&&(o=e.enterKey(n.key)),n.optional){let c=null;if(n.explicit!==null?c=n.explicit:n.implicit!==null?c=n.implicit:n.tag!==null&&(c=n.tag),c===null&&!n.any){let u=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),s=!0}catch{s=!1}e.restore(u)}else if(s=this._peekTag(e,c,n.any),e.isError(s))return s}let a;if(n.obj&&s&&(a=e.enterObject()),s){if(n.explicit!==null){let u=this._decodeTag(e,n.explicit);if(e.isError(u))return u;e=u}let c=e.offset;if(n.use===null&&n.choice===null){let u;n.any&&(u=e.save());let p=this._decodeTag(e,n.implicit!==null?n.implicit:n.tag,n.any);if(e.isError(p))return p;n.any?i=e.raw(u):e=p}if(t&&t.track&&n.tag!==null&&t.track(e.path(),c,e.length,"tagged"),t&&t.track&&n.tag!==null&&t.track(e.path(),e.offset,e.length,"content"),n.any||(n.choice===null?i=this._decodeGeneric(n.tag,e,t):i=this._decodeChoice(e,t)),e.isError(i))return i;if(!n.any&&n.choice===null&&n.children!==null&&n.children.forEach(function(p){p._decode(e,t)}),n.contains&&(n.tag==="octstr"||n.tag==="bitstr")){let u=new zB(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(u,t)}}return n.obj&&s&&(i=e.leaveObject(a)),n.key!==null&&(i!==null||s===!0)?e.leaveKey(o,n.key,i):o!==null&&e.exitKey(o),i};fe.prototype._decodeGeneric=function(e,t,n){let i=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(t,e,i.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):e==="objid"&&i.args?this._decodeObjid(t,i.args[0],i.args[1],n):e==="objid"?this._decodeObjid(t,null,null,n):e==="gentime"||e==="utctime"?this._decodeTime(t,e,n):e==="null_"?this._decodeNull(t,n):e==="bool"?this._decodeBool(t,n):e==="objDesc"?this._decodeStr(t,e,n):e==="int"||e==="enum"?this._decodeInt(t,i.args&&i.args[0],n):i.use!==null?this._getUse(i.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)};fe.prototype._getUse=function(e,t){let n=this._baseState;return n.useDecoder=this._use(e,t),Ot(n.useDecoder._baseState.parent===null),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder};fe.prototype._decodeChoice=function(e,t){let n=this._baseState,i=null,s=!1;return Object.keys(n.choice).some(function(o){let a=e.save(),c=n.choice[o];try{let u=c._decode(e,t);if(e.isError(u))return!1;i={type:o,value:u},s=!0}catch{return e.restore(a),!1}return!0},this),s?i:e.error("Choice not matched")};fe.prototype._createEncoderBuffer=function(e){return new GB(e,this.reporter)};fe.prototype._encode=function(e,t,n){let i=this._baseState;if(i.default!==null&&i.default===e)return;let s=this._encodeValue(e,t,n);if(s!==void 0&&!this._skipDefault(s,t,n))return s};fe.prototype._encodeValue=function(e,t,n){let i=this._baseState;if(i.parent===null)return i.children[0]._encode(e,t||new WB);let s=null;if(this.reporter=t,i.optional&&e===void 0)if(i.default!==null)e=i.default;else return;let o=null,a=!1;if(i.any)s=this._createEncoderBuffer(e);else if(i.choice)s=this._encodeChoice(e,t);else if(i.contains)o=this._getUse(i.contains,n)._encode(e,t),a=!0;else if(i.children)o=i.children.map(function(c){if(c._baseState.tag==="null_")return c._encode(null,t,e);if(c._baseState.key===null)return t.error("Child should have a key");let u=t.enterKey(c._baseState.key);if(typeof e!="object")return t.error("Child expected, but input is not object");let p=c._encode(e[c._baseState.key],t,e);return t.leaveKey(u),p},this).filter(function(c){return c}),o=this._createEncoderBuffer(o);else if(i.tag==="seqof"||i.tag==="setof"){if(!(i.args&&i.args.length===1))return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");let c=this.clone();c._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(u){let p=this._baseState;return this._getUse(p.args[0],e)._encode(u,t)},c))}else i.use!==null?s=this._getUse(i.use,n)._encode(e,t):(o=this._encodePrimitive(i.tag,e),a=!0);if(!i.any&&i.choice===null){let c=i.implicit!==null?i.implicit:i.tag,u=i.implicit===null?"universal":"context";c===null?i.use===null&&t.error("Tag could be omitted only for .use()"):i.use===null&&(s=this._encodeComposite(c,a,u,o))}return i.explicit!==null&&(s=this._encodeComposite(i.explicit,!1,"context",s)),s};fe.prototype._encodeChoice=function(e,t){let n=this._baseState,i=n.choice[e.type];return i||Ot(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),i._encode(e.value,t)};fe.prototype._encodePrimitive=function(e,t){let n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if(e==="objid"&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if(e==="objid")return this._encodeObjid(t,null,null);if(e==="gentime"||e==="utctime")return this._encodeTime(t,e);if(e==="null_")return this._encodeNull();if(e==="int"||e==="enum")return this._encodeInt(t,n.args&&n.reverseArgs[0]);if(e==="bool")return this._encodeBool(t);if(e==="objDesc")return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)};fe.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};fe.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var Ul=O(mi=>{"use strict";function sE(r){let e={};return Object.keys(r).forEach(function(t){(t|0)==t&&(t=t|0);let n=r[t];e[n]=t}),e}mi.tagClass={0:"universal",1:"application",2:"context",3:"private"};mi.tagClassByName=sE(mi.tagClass);mi.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"};mi.tagByName=sE(mi.tag)});var Lh=O((hG,cE)=>{"use strict";var XB=Un(),xn=Fl().Buffer,oE=ql(),Nh=Ul();function aE(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new Rr,this.tree._init(r.body)}cE.exports=aE;aE.prototype.encode=function(e,t){return this.tree._encode(e,t).join()};function Rr(r){oE.call(this,"der",r)}XB(Rr,oE);Rr.prototype._encodeComposite=function(e,t,n,i){let s=JB(e,t,n,this.reporter);if(i.length<128){let c=xn.alloc(2);return c[0]=s,c[1]=i.length,this._createEncoderBuffer([c,i])}let o=1;for(let c=i.length;c>=256;c>>=8)o++;let a=xn.alloc(2+o);a[0]=s,a[1]=128|o;for(let c=1+o,u=i.length;u>0;c--,u>>=8)a[c]=u&255;return this._createEncoderBuffer([a,i])};Rr.prototype._encodeStr=function(e,t){if(t==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(t==="bmpstr"){let n=xn.alloc(e.length*2);for(let i=0;i<e.length;i++)n.writeUInt16BE(e.charCodeAt(i),i*2);return this._createEncoderBuffer(n)}else return t==="numstr"?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):t==="printstr"?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):t==="objDesc"?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")};Rr.prototype._encodeObjid=function(e,t,n){if(typeof e=="string"){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s.]+/g);for(let a=0;a<e.length;a++)e[a]|=0}else if(Array.isArray(e)){e=e.slice();for(let a=0;a<e.length;a++)e[a]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!n){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}let i=0;for(let a=0;a<e.length;a++){let c=e[a];for(i++;c>=128;c>>=7)i++}let s=xn.alloc(i),o=s.length-1;for(let a=e.length-1;a>=0;a--){let c=e[a];for(s[o--]=c&127;(c>>=7)>0;)s[o--]=128|c&127}return this._createEncoderBuffer(s)};function mr(r){return r<10?"0"+r:r}Rr.prototype._encodeTime=function(e,t){let n,i=new Date(e);return t==="gentime"?n=[mr(i.getUTCFullYear()),mr(i.getUTCMonth()+1),mr(i.getUTCDate()),mr(i.getUTCHours()),mr(i.getUTCMinutes()),mr(i.getUTCSeconds()),"Z"].join(""):t==="utctime"?n=[mr(i.getUTCFullYear()%100),mr(i.getUTCMonth()+1),mr(i.getUTCDate()),mr(i.getUTCHours()),mr(i.getUTCMinutes()),mr(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")};Rr.prototype._encodeNull=function(){return this._createEncoderBuffer("")};Rr.prototype._encodeInt=function(e,t){if(typeof e=="string"){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if(typeof e!="number"&&!xn.isBuffer(e)){let s=e.toArray();!e.sign&&s[0]&128&&s.unshift(0),e=xn.from(s)}if(xn.isBuffer(e)){let s=e.length;e.length===0&&s++;let o=xn.alloc(s);return e.copy(o),e.length===0&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let n=1;for(let s=e;s>=256;s>>=8)n++;let i=new Array(n);for(let s=i.length-1;s>=0;s--)i[s]=e&255,e>>=8;return i[0]&128&&i.unshift(0),this._createEncoderBuffer(xn.from(i))};Rr.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};Rr.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getEncoder("der").tree};Rr.prototype._skipDefault=function(e,t,n){let i=this._baseState,s;if(i.default===null)return!1;let o=e.join();if(i.defaultBuffer===void 0&&(i.defaultBuffer=this._encodeValue(i.default,t,n).join()),o.length!==i.defaultBuffer.length)return!1;for(s=0;s<o.length;s++)if(o[s]!==i.defaultBuffer[s])return!1;return!0};function JB(r,e,t,n){let i;if(r==="seqof"?r="seq":r==="setof"&&(r="set"),Nh.tagByName.hasOwnProperty(r))i=Nh.tagByName[r];else if(typeof r=="number"&&(r|0)===r)i=r;else return n.error("Unknown tag: "+r);return i>=31?n.error("Multi-octet tag encoding unsupported"):(e||(i|=32),i|=Nh.tagClassByName[t||"universal"]<<6,i)}});var uE=O((mG,lE)=>{"use strict";var QB=Un(),Dh=Lh();function Bh(r){Dh.call(this,r),this.enc="pem"}QB(Bh,Dh);lE.exports=Bh;Bh.prototype.encode=function(e,t){let i=Dh.prototype.encode.call(this,e).toString("base64"),s=["-----BEGIN "+t.label+"-----"];for(let o=0;o<i.length;o+=64)s.push(i.slice(o,o+64));return s.push("-----END "+t.label+"-----"),s.join(`
90
- `)}});var jh=O(fE=>{"use strict";var pE=fE;pE.der=Lh();pE.pem=uE()});var Hh=O((vG,xE)=>{"use strict";var ZB=Un(),ej=kh(),dE=Cs().DecoderBuffer,mE=ql(),hE=Ul();function gE(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new Jt,this.tree._init(r.body)}xE.exports=gE;gE.prototype.decode=function(e,t){return dE.isDecoderBuffer(e)||(e=new dE(e,t)),this.tree._decode(e,t)};function Jt(r){mE.call(this,"der",r)}ZB(Jt,mE);Jt.prototype._peekTag=function(e,t,n){if(e.isEmpty())return!1;let i=e.save(),s=Fh(e,'Failed to peek tag: "'+t+'"');return e.isError(s)?s:(e.restore(i),s.tag===t||s.tagStr===t||s.tagStr+"of"===t||n)};Jt.prototype._decodeTag=function(e,t,n){let i=Fh(e,'Failed to decode tag of "'+t+'"');if(e.isError(i))return i;let s=vE(e,i.primitive,'Failed to get length of "'+t+'"');if(e.isError(s))return s;if(!n&&i.tag!==t&&i.tagStr!==t&&i.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(i.primitive||s!==null)return e.skip(s,'Failed to match body of: "'+t+'"');let o=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(s=e.offset-o.offset,e.restore(o),e.skip(s,'Failed to match body of: "'+t+'"'))};Jt.prototype._skipUntilEnd=function(e,t){for(;;){let n=Fh(e,t);if(e.isError(n))return n;let i=vE(e,n.primitive,t);if(e.isError(i))return i;let s;if(n.primitive||i!==null?s=e.skip(i):s=this._skipUntilEnd(e,t),e.isError(s))return s;if(n.tagStr==="end")break}};Jt.prototype._decodeList=function(e,t,n,i){let s=[];for(;!e.isEmpty();){let o=this._peekTag(e,"end");if(e.isError(o))return o;let a=n.decode(e,"der",i);if(e.isError(a)&&o)break;s.push(a)}return s};Jt.prototype._decodeStr=function(e,t){if(t==="bitstr"){let n=e.readUInt8();return e.isError(n)?n:{unused:n,data:e.raw()}}else if(t==="bmpstr"){let n=e.raw();if(n.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");let i="";for(let s=0;s<n.length/2;s++)i+=String.fromCharCode(n.readUInt16BE(s*2));return i}else if(t==="numstr"){let n=e.raw().toString("ascii");return this._isNumstr(n)?n:e.error("Decoding of string type: numstr unsupported characters")}else{if(t==="octstr")return e.raw();if(t==="objDesc")return e.raw();if(t==="printstr"){let n=e.raw().toString("ascii");return this._isPrintstr(n)?n:e.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")}};Jt.prototype._decodeObjid=function(e,t,n){let i,s=[],o=0,a=0;for(;!e.isEmpty();)a=e.readUInt8(),o<<=7,o|=a&127,(a&128)===0&&(s.push(o),o=0);a&128&&s.push(o);let c=s[0]/40|0,u=s[0]%40;if(n?i=s:i=[c,u].concat(s.slice(1)),t){let p=t[i.join(" ")];p===void 0&&(p=t[i.join(".")]),p!==void 0&&(i=p)}return i};Jt.prototype._decodeTime=function(e,t){let n=e.raw().toString(),i,s,o,a,c,u;if(t==="gentime")i=n.slice(0,4)|0,s=n.slice(4,6)|0,o=n.slice(6,8)|0,a=n.slice(8,10)|0,c=n.slice(10,12)|0,u=n.slice(12,14)|0;else if(t==="utctime")i=n.slice(0,2)|0,s=n.slice(2,4)|0,o=n.slice(4,6)|0,a=n.slice(6,8)|0,c=n.slice(8,10)|0,u=n.slice(10,12)|0,i<70?i=2e3+i:i=1900+i;else return e.error("Decoding "+t+" time is not supported yet");return Date.UTC(i,s-1,o,a,c,u,0)};Jt.prototype._decodeNull=function(){return null};Jt.prototype._decodeBool=function(e){let t=e.readUInt8();return e.isError(t)?t:t!==0};Jt.prototype._decodeInt=function(e,t){let n=e.raw(),i=new ej(n);return t&&(i=t[i.toString(10)]||i),i};Jt.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getDecoder("der").tree};function Fh(r,e){let t=r.readUInt8(e);if(r.isError(t))return t;let n=hE.tagClass[t>>6],i=(t&32)===0;if((t&31)===31){let o=t;for(t=0;(o&128)===128;){if(o=r.readUInt8(e),r.isError(o))return o;t<<=7,t|=o&127}}else t&=31;let s=hE.tag[t];return{cls:n,primitive:i,tag:t,tagStr:s}}function vE(r,e,t){let n=r.readUInt8(t);if(r.isError(n))return n;if(!e&&n===128)return null;if((n&128)===0)return n;let i=n&127;if(i>4)return r.error("length octect is too long");n=0;for(let s=0;s<i;s++){n<<=8;let o=r.readUInt8(t);if(r.isError(o))return o;n|=o}return n}});var _E=O((xG,yE)=>{"use strict";var tj=Un(),rj=Fl().Buffer,$h=Hh();function qh(r){$h.call(this,r),this.enc="pem"}tj(qh,$h);yE.exports=qh;qh.prototype.decode=function(e,t){let n=e.toString().split(/[\r\n]+/g),i=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,a=-1;for(let p=0;p<n.length;p++){let f=n[p].match(s);if(f!==null&&f[2]===i)if(o===-1){if(f[1]!=="BEGIN")break;o=p}else{if(f[1]!=="END")break;a=p;break}}if(o===-1||a===-1)throw new Error("PEM section not found for: "+i);let c=n.slice(o+1,a).join("");c.replace(/[^a-z0-9+/=]+/gi,"");let u=rj.from(c,"base64");return $h.prototype.decode.call(this,u,t)}});var Uh=O(wE=>{"use strict";var bE=wE;bE.der=Hh();bE.pem=_E()});var EE=O(SE=>{"use strict";var nj=jh(),ij=Uh(),sj=Un(),oj=SE;oj.define=function(e,t){return new As(e,t)};function As(r,e){this.name=r,this.body=e,this.decoders={},this.encoders={}}As.prototype._createNamed=function(e){let t=this.name;function n(i){this._initNamed(i,t)}return sj(n,e),n.prototype._initNamed=function(s,o){e.call(this,s,o)},new n(this)};As.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(ij[e])),this.decoders[e]};As.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)};As.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(nj[e])),this.encoders[e]};As.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}});var CE=O(TE=>{"use strict";var Wl=TE;Wl.Reporter=Hl().Reporter;Wl.DecoderBuffer=Cs().DecoderBuffer;Wl.EncoderBuffer=Cs().EncoderBuffer;Wl.Node=ql()});var kE=O(RE=>{"use strict";var AE=RE;AE._reverse=function(e){let t={};return Object.keys(e).forEach(function(n){(n|0)==n&&(n=n|0);let i=e[n];t[i]=n}),t};AE.der=Ul()});var PE=O(OE=>{"use strict";var Rs=OE;Rs.bignum=kh();Rs.define=EE().define;Rs.base=CE();Rs.constants=kE();Rs.decoders=Uh();Rs.encoders=jh()});var ks=O((Wh,IE)=>{var Gl=require("buffer"),qr=Gl.Buffer;function ME(r,e){for(var t in r)e[t]=r[t]}qr.from&&qr.alloc&&qr.allocUnsafe&&qr.allocUnsafeSlow?IE.exports=Gl:(ME(Gl,Wh),Wh.Buffer=gi);function gi(r,e,t){return qr(r,e,t)}gi.prototype=Object.create(qr.prototype);ME(qr,gi);gi.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return qr(r,e,t)};gi.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=qr(r);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n};gi.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return qr(r)};gi.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Gl.SlowBuffer(r)}});var Gh=O((EG,NE)=>{var zl=ks().Buffer,aj=require("stream"),cj=require("util");function Kl(r){if(this.buffer=null,this.writable=!0,this.readable=!0,!r)return this.buffer=zl.alloc(0),this;if(typeof r.pipe=="function")return this.buffer=zl.alloc(0),r.pipe(this),this;if(r.length||typeof r=="object")return this.buffer=r,this.writable=!1,process.nextTick(function(){this.emit("end",r),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof r+")")}cj.inherits(Kl,aj);Kl.prototype.write=function(e){this.buffer=zl.concat([this.buffer,zl.from(e)]),this.emit("data",e)};Kl.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};NE.exports=Kl});var DE=O((TG,LE)=>{"use strict";function zh(r){var e=(r/8|0)+(r%8===0?0:1);return e}var lj={ES256:zh(256),ES384:zh(384),ES512:zh(521)};function uj(r){var e=lj[r];if(e)return e;throw new Error('Unknown algorithm "'+r+'"')}LE.exports=uj});var UE=O((CG,qE)=>{"use strict";var Vl=ks().Buffer,jE=DE(),Yl=128,FE=0,pj=32,fj=16,dj=2,HE=fj|pj|FE<<6,Xl=dj|FE<<6;function hj(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function $E(r){if(Vl.isBuffer(r))return r;if(typeof r=="string")return Vl.from(r,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function mj(r,e){r=$E(r);var t=jE(e),n=t+1,i=r.length,s=0;if(r[s++]!==HE)throw new Error('Could not find expected "seq"');var o=r[s++];if(o===(Yl|1)&&(o=r[s++]),i-s<o)throw new Error('"seq" specified length of "'+o+'", only "'+(i-s)+'" remaining');if(r[s++]!==Xl)throw new Error('Could not find expected "int" for "r"');var a=r[s++];if(i-s-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(i-s-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var c=s;if(s+=a,r[s++]!==Xl)throw new Error('Could not find expected "int" for "s"');var u=r[s++];if(i-s!==u)throw new Error('"s" specified length of "'+u+'", expected "'+(i-s)+'"');if(n<u)throw new Error('"s" specified length of "'+u+'", max of "'+n+'" is acceptable');var p=s;if(s+=u,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var f=t-a,m=t-u,y=Vl.allocUnsafe(f+a+m+u);for(s=0;s<f;++s)y[s]=0;r.copy(y,s,c+Math.max(-f,0),c+a),s=t;for(var _=s;s<_+m;++s)y[s]=0;return r.copy(y,s,p+Math.max(-m,0),p+u),y=y.toString("base64"),y=hj(y),y}function BE(r,e,t){for(var n=0;e+n<t&&r[e+n]===0;)++n;var i=r[e+n]>=Yl;return i&&--n,n}function gj(r,e){r=$E(r);var t=jE(e),n=r.length;if(n!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+n+'"');var i=BE(r,0,t),s=BE(r,t,r.length),o=t-i,a=t-s,c=2+o+1+1+a,u=c<Yl,p=Vl.allocUnsafe((u?2:3)+c),f=0;return p[f++]=HE,u?p[f++]=c:(p[f++]=Yl|1,p[f++]=c&255),p[f++]=Xl,p[f++]=o,i<0?(p[f++]=0,f+=r.copy(p,f,0,t)):f+=r.copy(p,f,i,t),p[f++]=Xl,p[f++]=a,s<0?(p[f++]=0,r.copy(p,f,t)):r.copy(p,f,t+s),p}qE.exports={derToJose:mj,joseToDer:gj}});var GE=O((AG,WE)=>{"use strict";var qo=require("buffer").Buffer,Kh=require("buffer").SlowBuffer;WE.exports=Jl;function Jl(r,e){if(!qo.isBuffer(r)||!qo.isBuffer(e)||r.length!==e.length)return!1;for(var t=0,n=0;n<r.length;n++)t|=r[n]^e[n];return t===0}Jl.install=function(){qo.prototype.equal=Kh.prototype.equal=function(e){return Jl(this,e)}};var vj=qo.prototype.equal,xj=Kh.prototype.equal;Jl.restore=function(){qo.prototype.equal=vj,Kh.prototype.equal=xj}});var Jh=O((RG,e1)=>{var Ps=ks().Buffer,gr=require("crypto"),KE=UE(),zE=require("util"),yj=`"%s" is not a valid algorithm.
89
+ `),Al.add(e),r.on("close",()=>Al.delete(e))}function Yw(r,e){ee(e,{...dn,...Ar,desktopEnabled:jt,remoteAvailable:mh})}async function Xw(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Gt(),Pi)),n=await t(r,e);n&&(hn(n),ee(e))}function Jw(r,e){ee(e),hn({step:Yn.PREPARING,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),Mo("restart-tunnel")}function Qw(r,e){ee(e),hn({step:Yn.PREPARING,stepDesc:""}),Mo("start-tunnel")}function Zw(r,e){ee(e),hn({step:Yn.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),Mo("stop-tunnel")}function eS(r,e){ee(e),hn({step:Yn.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),Mo("shutdown")}function tS(r,e){ee(e,{connections:[...di.values()]})}function rS(r,e){let t=new URL(r.url,"http://localhost"),n=parseInt(t.searchParams.get("lines")||_p,10);ee(e,{logs:Nv(Number.isFinite(n)?n:_p)})}async function nS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Gt(),Pi)),n=await t(r,e);if(!n)return;let i=!!n.enabled;if(i&&(!Ar.screenRecording||!Ar.accessibility)){ee(e,{ok:!1,enabled:jt,reason:"permissions_required"});return}let s=ys();jt=i,hh(),St("permissions",{...Ar,desktopEnabled:jt}),ys()!==s&&gh?.(),ee(e,{ok:!0,enabled:jt})}function iS(r,e){ee(e,Ar)}async function sS(r,e){let t=await oh();ee(e,{enabled:t})}async function oS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Gt(),Pi)),n=await t(r,e);if(!n)return;let i=await kw(!!n.enabled),s=await oh();St("autostart",{enabled:s}),ee(e,{ok:i,enabled:s})}async function aS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Gt(),Pi)),n=await t(r,e);if(!n)return;let{type:i}=n;if(process.platform==="darwin"){Sw(i);let s=Date.now(),o=setInterval(async()=>{((await Rl())[i]||Date.now()-s>Av)&&clearInterval(o)},Cv)}ee(e)}var Hn,Bw,dh,dn,jt,mh,Ar,Al,di,gh,$n=Ce(()=>{vt();Mi();vt();Io();Ew();Ow();Gt();tl();vt();Hn=require("fs"),Bw=require("path");vt();ah();dh=(0,Bw.join)(oe.STATE,"ui-state.json");dn={step:Yn.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null,permanentKey:"",qrUrl:"",latency:null,uptime:null,healthCheck:{running:!1,timeoutMs:0,startedAt:null,logs:[]},tunnelHealth:{status:"unknown",checkedAt:null}},jt=!1,mh=!1,Ar={screenRecording:!1,accessibility:!1},Al=new Set,di=new Map;Iv(Te);gh=null});var kl,cS=Ce(()=>{bt();$n();kl=class{constructor(){this.cfg=Z.logging,this.samples=[],this.lastLogTime=Date.now()}now(){return this.cfg.metrics?performance.now():0}record({capture:e,checksum:t,encode:n,total:i,changedTiles:s,totalTiles:o,tileBytes:a,rawBytes:c}){this.cfg.metrics&&(this.samples.push({capture:e,checksum:t,encode:n,total:i,changedTiles:s,totalTiles:o,tileBytes:a,rawBytes:c}),this.samples.length>=this.cfg.metricsEveryFrames&&this._flush())}_flush(){let e=this.samples.length,t=N=>(this.samples.reduce((H,W)=>H+W[N],0)/e).toFixed(1),n=(Date.now()-this.lastLogTime)/1e3,i=(e/n).toFixed(1),s=[],o=0;for(let N of this.samples){for(let H of N.tileBytes)s.push(H);o+=N.tileBytes.reduce((H,W)=>H+W,0)}let a=(o/e/1024).toFixed(1),c=s.length?(s.reduce((N,H)=>N+H,0)/s.length/1024).toFixed(2):"0",u=s.length?(Math.min(...s)/1024).toFixed(2):"0",p=s.length?(Math.max(...s)/1024).toFixed(2):"0",f=this.samples.reduce((N,H)=>N+H.rawBytes,0)/e,m=o/e,y=m>0?(f/m).toFixed(0):"0",_=(this.samples.reduce((N,H)=>N+H.changedTiles,0)/e).toFixed(0),S=this.samples[0]?.totalTiles||0,A=S?(_/S*100).toFixed(1):"0",P=Z.pipeline,L=`[Metrics] ${P.captureLib}+${P.encoder} tile=${P.tileSize} q${P.jpegQuality} scale=${P.outputScale} | fps=${i} | capture=${t("capture")}ms enc=${t("encode")}ms total=${t("total")}ms | tiles=${_}/${S} (${A}%) | data=${a}KB/frame | tileAvg=${c}KB (min ${u}, max ${p}) | compress=${y}x`;Te(L),console.log(L),this.samples=[],this.lastLogTime=Date.now()}}});var pS={};Xr(pS,{TileManager:()=>vh});var _s,Pl,lS,Ol,uS,BB,jB,vh,fS=Ce(()=>{_s=X(require("fs"),1),Pl=X(require("path"),1),lS=X(require("sharp"),1),Ol=require("child_process"),uS=require("url");bt();gw();xw();cS();Hd();BB=(0,uS.fileURLToPath)(__importMetaUrl),jB=Pl.default.dirname(BB),vh=class{constructor(e){this.robot=e,this.metrics=new kl,this.tileSize=Z.pipeline.tileSize,this.lastTileChecksums=new Map,this.screenWidth=0,this.screenHeight=0,this.tilesPerRow=0,this.tilesPerColumn=0,this.totalTiles=0,this.frameCount=0,this.tempDir=Pl.default.join(jB,"../../temp"),this.changeThreshold=1,this.scaledWidth=0,this.scaledHeight=0,this.isProcessing=!1,this.sharedScreenCache=null,this.lastCaptureTime=0,this.CACHE_TTL=100,this.dpiScale=1,this.captureWidth=0,this.captureHeight=0,this.scaleFactor=Z.pipeline.outputScale||1,this.compressionQuality=Z.pipeline.jpegQuality,this.activeTileSet=null,this.focusStats={frames:0,scanned:0,changed:0,bytes:0},_s.default.existsSync(this.tempDir)||_s.default.mkdirSync(this.tempDir,{recursive:!0}),hw(e),this.initializeScreenDimensions()}initializeScreenDimensions(){try{let{width:e,height:t}=this.robot.getScreenSize();this.screenWidth=e,this.screenHeight=t,this.detectDpiScale(),this.scaledWidth=this.captureWidth,this.scaledHeight=this.captureHeight,this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn;let n=100;if(this.totalTiles>n){let i=Math.ceil(Math.sqrt(this.scaledWidth*this.scaledHeight/n));this.tileSize=Math.max(i,120),this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}}catch(e){ve.error("Screen dimensions error:",e),this.screenWidth=1920,this.screenHeight=1080,this.dpiScale=1,this.captureWidth=1920,this.captureHeight=1080,this.scaledWidth=1728,this.scaledHeight=972,this.tileSize=120,this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}}detectDpiScale(){if(process.platform==="darwin"){let e=this.robot.screen.capture(0,0,this.screenWidth,this.screenHeight),n=e.byteWidth/e.bytesPerPixel/this.screenWidth;n>=1.9&&n<=2.1?this.dpiScale=2:this.dpiScale=1}else process.platform==="win32"?this.dpiScale=this._detectDpiScaleWin32():this.dpiScale=1;this.captureWidth=Math.floor(this.screenWidth*this.dpiScale),this.captureHeight=Math.floor(this.screenHeight*this.dpiScale)}_detectDpiScaleWin32(){ve.dpi(`\u{1F50D} [DPI Detection] screenWidth from robot: ${this.screenWidth}x${this.screenHeight}`);try{let e=(0,Ol.execSync)(`powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "try{Get-ItemPropertyValue 'HKCU:\\Control Panel\\Desktop\\WindowMetrics' -Name AppliedDPI}catch{0}"`,{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(ve.dpi(`\u{1F50D} [DPI Detection] Strategy 1 (Registry AppliedDPI): ${t} DPI`),t>=96){let n=t/96;return ve.dpi(`\u2705 [DPI Detection] Using registry scale: ${n}x (${t}/96)`),n}}catch(e){ve.dpi(`\u274C [DPI Detection] Strategy 1 failed: ${e.message}`)}try{let e=(0,Ol.execSync)('powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "(Get-WmiObject -Class Win32_VideoController | Select-Object -First 1).CurrentHorizontalResolution"',{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(ve.dpi(`\u{1F50D} [DPI Detection] Strategy 2 (WMI): physical width = ${t}px`),t>0&&t>this.screenWidth){let n=t/this.screenWidth;return ve.dpi(`\u2705 [DPI Detection] Using WMI scale: ${n}x (${t}/${this.screenWidth})`),n}}catch(e){ve.dpi(`\u274C [DPI Detection] Strategy 2 failed: ${e.message}`)}try{let e=(0,Ol.execSync)(`powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "Add-Type -TypeDefinition 'using System;using System.Runtime.InteropServices;public class Disp{[DllImport(\\"user32\\")]public static extern bool EnumDisplaySettings(string d,int m,ref DEVMODE dm);[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Ansi)]public struct DEVMODE{[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)]public string dmDeviceName;public short dmSpecVersion,dmDriverVersion,dmSize,dmDriverExtra;public int dmFields;public int dmPositionX,dmPositionY,dmDisplayOrientation,dmDisplayFixedOutput;public short dmColor,dmDuplex,dmYResolution,dmTTOption,dmCollate;[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)]public string dmFormName;public short dmLogPixels;public int dmBitsPerPel,dmPelsWidth,dmPelsHeight,dmDisplayFlags,dmDisplayFrequency;}}'; $dm=New-Object Disp+DEVMODE; $dm.dmSize=[System.Runtime.InteropServices.Marshal]::SizeOf($dm); [Disp]::EnumDisplaySettings($null,-1,[ref]$dm) | Out-Null; Write-Output $dm.dmPelsWidth"`,{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(ve.dpi(`\u{1F50D} [DPI Detection] Strategy 3 (EnumDisplaySettings): physical width = ${t}px`),t>0&&t>this.screenWidth){let n=t/this.screenWidth;return ve.dpi(`\u2705 [DPI Detection] Using EnumDisplaySettings scale: ${n}x (${t}/${this.screenWidth})`),n}}catch(e){ve.dpi(`\u274C [DPI Detection] Strategy 3 failed: ${e.message}`)}return ve.dpi("\u26A0\uFE0F [DPI Detection] All strategies failed, fallback to 1x"),1}async captureFullScreen(){let e=await mw();return{buffer:e.buffer,width:e.width,height:e.height,channels:e.channels}}async getSharedScreenCapture(){let e=Date.now();return this.sharedScreenCache&&e-this.lastCaptureTime<this.CACHE_TTL?this.sharedScreenCache:(this.sharedScreenCache=await this.captureFullScreen(),this.lastCaptureTime=e,this.sharedScreenCache)}clearScreenCache(){}async detectChangedTiles(){return(await this.detectChangedTilesWithHashes()).tiles}async detectChangedTilesWithHashes(){if(this.isProcessing)return{tiles:[],currentHashes:Array.from(this.lastTileChecksums.values())};this.isProcessing=!0;let e=this.metrics.now(),t=e,n=e;try{let i=await this.getSharedScreenCapture();t=this.metrics.now();let s=[],o=[],a=new Map;this.frameCount++;let c=this.activeTileSet;for(let f=0;f<this.totalTiles;f++){if(c&&!c.has(f))continue;let m=this.calculateTileChecksumDirect(i,f);a.set(f,m)}n=this.metrics.now();let u=Array.from(a.values());if(this.lastTileChecksums.size===0){let f=[];for(let y=0;y<this.totalTiles;y++)c&&!c.has(y)||(this.lastTileChecksums.set(y,a.get(y)),f.push(this.processTileAsync(i,y)));let m=await Promise.all(f);return s.push(...m),this._recordFrame(e,t,n,s,i),{tiles:s,currentHashes:u}}for(let f=0;f<this.totalTiles;f++){if(c&&!c.has(f))continue;let m=a.get(f),y=this.lastTileChecksums.get(f);m!==y&&(o.push(f),this.lastTileChecksums.set(f,m))}if(o.length/this.totalTiles>this.changeThreshold){let f=[];for(let y=0;y<this.totalTiles;y++)c&&!c.has(y)||f.push(this.processTileAsync(i,y));let m=await Promise.all(f);s.push(...m.map(y=>({...y,fullRefresh:!0})))}else if(o.length>0){let f=o.map(y=>this.processTileAsync(i,y)),m=await Promise.all(f);s.push(...m)}return this._recordFrame(e,t,n,s,i),{tiles:s,currentHashes:u}}finally{this.isProcessing=!1}}async processTileAsync(e,t,n=null){let i=n||this.extractTile(e,t),s=await this.compressTileImage(i.buffer,i.width,i.height),{row:o,col:a}=this.getTilePosition(t);return{type:"tile-update",tileIndex:t,x:a*this.tileSize,y:o*this.tileSize,width:i.width,height:i.height,imageBuffer:s,hash:this.lastTileChecksums.get(t)??0,timestamp:Date.now(),frameCount:this.frameCount}}calculateTileChecksumDirect(e,t){let{row:n,col:i}=this.getTilePosition(t),s=i*this.tileSize,o=n*this.tileSize,a=Math.min(s+this.tileSize,e.width),c=Math.min(o+this.tileSize,e.height),u=a-s,p=c-o,f=e.channels,m=e.width*f,y=0,_=16;for(let S=0;S<p;S+=4){let A=(S>>2&1)*8,P=(o+S)*m+s*f;for(let L=A;L<u;L+=_){let N=P+L*f;y+=e.buffer[N],y^=e.buffer[N+1],y+=e.buffer[N+2]<<1,y^=e.buffer[N+3]<<2}}return y>>>0}setFocusRect(e){if(!e){this.activeTileSet=null;return}let t=Z.focus.paddingTiles,n=Math.max(0,Math.floor(e.x/this.tileSize)-t),i=Math.max(0,Math.floor(e.y/this.tileSize)-t),s=Math.min(this.tilesPerRow-1,Math.floor((e.x+e.w)/this.tileSize)+t),o=Math.min(this.tilesPerColumn-1,Math.floor((e.y+e.h)/this.tileSize)+t),a=new Set;for(let u=i;u<=o;u++)for(let p=n;p<=s;p++)a.add(u*this.tilesPerRow+p);let c=this.activeTileSet;if(c)for(let u of a)c.has(u)||this.lastTileChecksums.delete(u);this.activeTileSet=a}getTilePosition(e){return{row:Math.floor(e/this.tilesPerRow),col:e%this.tilesPerRow}}extractTile(e,t){let{row:n,col:i}=this.getTilePosition(t),s=i*this.tileSize,o=n*this.tileSize,a=Math.min(s+this.tileSize,e.width),c=Math.min(o+this.tileSize,e.height),u=a-s,p=c-o,f=e.channels,m=u*f,y=Buffer.alloc(u*p*f);for(let _=0;_<p;_++){let S=((o+_)*e.width+s)*f,A=_*m;e.buffer.copy(y,A,S,S+m)}return{buffer:y,width:u,height:p,channels:f,tileIndex:t,x:s,y:o}}async compressTileImage(e,t,n){let i=this.scaleFactor;if(i&&i>0&&i<1){let s=Math.max(1,Math.floor(t*i)),o=Math.max(1,Math.floor(n*i)),{inputFormat:a}=Z.pipeline,c=e,u=4;a==="bgra"&&(c=Buffer.from(e),Zd(c));let p=await(0,lS.default)(c,{raw:{width:t,height:n,channels:u}}).resize(s,o,{kernel:"lanczos3",fastShrinkOnLoad:!1}).raw().toBuffer();return eh(p,s,o,4,this.compressionQuality,"rgba")}return eh(e,t,n,4,this.compressionQuality)}pickProfile({zoom:e=1,viewerWidth:t=0,dpr:n=1}={}){let i=Z.pipeline.adaptiveTiers||[];if(!i.length)return null;let s=this.captureWidth||this.screenWidth||1,o=t>0?t:s,a=e>0?e:1,c=n>0?n:1,u=o*a*c/s,p=Z.pipeline.tierHysteresis||0,f=this._currentTier;for(let y of i){let _=f&&y===f?y.minEffective-p:y.minEffective;if(u>=_)return this._currentTier=y,y}let m=i[i.length-1];return this._currentTier=m,m}setProfile(e){if(!e)return;let t=e.outputScale??this.scaleFactor,n=e.jpegQuality??this.compressionQuality;t===this.scaleFactor&&n===this.compressionQuality||(this.scaleFactor=t,this.compressionQuality=n,this.lastTileChecksums.clear())}_recordFrame(e,t,n,i,s){if(this._recordFocusFrame(i),!this.metrics.cfg.metrics)return;let o=this.metrics.now(),a=i.map(u=>u.imageBuffer?.length||0),c=s?s.width*s.height*s.channels:0;this.metrics.record({capture:t-e,checksum:n-t,encode:o-n,total:o-e,changedTiles:i.length,totalTiles:this.totalTiles,tileBytes:a,rawBytes:c})}_recordFocusFrame(e){let t=this.focusStats;t.frames++,t.scanned+=this.activeTileSet?this.activeTileSet.size:this.totalTiles,t.changed+=e.length;for(let c of e)t.bytes+=c.imageBuffer?.length||0;if(t.frames<Z.logging.focusEveryFrames)return;let n=(t.scanned/t.frames).toFixed(0),i=(t.changed/t.frames).toFixed(1),s=(t.bytes/t.frames/1024).toFixed(1),o=this.totalTiles?((1-n/this.totalTiles)*100).toFixed(0):0,a=this.activeTileSet?"focus":"full";ve.focus(`\u{1F3AF} [Focus/${a}] ${t.frames}f | scan ${n}/${this.totalTiles} tiles (saved ${o}%) | changed ${i}/f | data ${s}KB/f`),this.focusStats={frames:0,scanned:0,changed:0,bytes:0}}async getScreenDimensions(){try{let e=await this.captureFullScreen();this.scaledWidth=e.width,this.scaledHeight=e.height,this.tilesPerRow=Math.ceil(e.width/this.tileSize),this.tilesPerColumn=Math.ceil(e.height/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}catch(e){ve.error("Error getting dimensions:",e)}return{width:this.scaledWidth,height:this.scaledHeight,tileWidth:this.tileSize,tileHeight:this.tileSize,tileCount:this.totalTiles,scaleFactor:this.scaleFactor,originalWidth:this.screenWidth,originalHeight:this.screenHeight}}async compareClientTileHashes(e){if(this.isProcessing)return{tiles:[],currentHashes:[],changedIndices:[]};this.isProcessing=!0;try{let t=await this.getSharedScreenCapture(),n=[],i=[];this.frameCount++;let s=this.activeTileSet,o=new Map;for(let c=0;c<this.totalTiles;c++){if(s&&!s.has(c))continue;let u=this.calculateTileChecksumDirect(t,c);o.set(c,u),this.lastTileChecksums.set(c,u)}if(!e||e.length===0){let c=[];for(let p=0;p<this.totalTiles;p++)s&&!s.has(p)||c.push(this.processTileAsync(t,p));let u=await Promise.all(c);return n.push(...u),{tiles:n,currentHashes:Array.from(o.values())}}for(let c=0;c<this.totalTiles;c++)s&&!s.has(c)||e[c]!==o.get(c)&&i.push(c);if(i.length/this.totalTiles>this.changeThreshold){let c=[];for(let p=0;p<this.totalTiles;p++)s&&!s.has(p)||c.push(this.processTileAsync(t,p));let u=await Promise.all(c);n.push(...u.map(p=>({...p,fullRefresh:!0})))}else if(i.length>0){let c=i.map(p=>this.processTileAsync(t,p)),u=await Promise.all(c);n.push(...u)}return this._recordFocusFrame(n),{tiles:n,currentHashes:Array.from(o.values()),changedIndices:i}}finally{this.isProcessing=!1}}clearMemory(){this.sharedScreenCache=null,this.lastCaptureTime=0,this.lastTileChecksums.clear()}reset(){this.lastTileChecksums.clear(),this.frameCount=0}cleanup(){try{_s.default.existsSync(this.tempDir)&&_s.default.readdirSync(this.tempDir).forEach(t=>_s.default.unlinkSync(Pl.default.join(this.tempDir,t)))}catch(e){ve.warn(`Cleanup error: ${e.message}`)}}}});var dS={};Xr(dS,{ResourceManager:()=>xh});var xh,hS=Ce(()=>{bt();xh=class{constructor(){this.activeClients=new Map,this.activeTimers=new Map,this.chunkTimers=new Map,this.memoryCheckInterval=null}startResourceMonitoring(){this.memoryCheckInterval=setInterval(()=>{let e=process.memoryUsage(),t=Math.round(e.heapUsed/1024/1024);t>Z.resourceManagement.memoryWarningThreshold&&(console.warn(`\u26A0\uFE0F High memory: ${t}MB`),this.cleanupInactiveClients())},Z.resourceManagement.memoryCheckInterval)}stopResourceMonitoring(){this.memoryCheckInterval&&(clearInterval(this.memoryCheckInterval),this.memoryCheckInterval=null)}addClient(e,t){this.activeClients.set(e,{...t,lastActivity:Date.now()})}getClient(e){return this.activeClients.get(e)}updateClientActivity(e){let t=this.activeClients.get(e);t&&(t.lastActivity=Date.now())}cleanupInactiveClients(){let e=Date.now(),t=Z.resourceManagement.inactiveTimeout;for(let[n,i]of this.activeClients.entries())e-i.lastActivity>t&&(console.log(`\u{1F9F9} Cleaning inactive client: ${n}`),this.cleanupClientResources(n,i),this.activeClients.delete(n))}cleanupClientResources(e,t){try{t.isStreaming=!1,t?.streamingTimeout&&(clearTimeout(t.streamingTimeout),t.streamingTimeout=null),t?.screenInterval&&(clearInterval(t.screenInterval),t.screenInterval=null);let n=this.activeTimers.get(e);n&&(n.forEach(s=>clearTimeout(s)),this.activeTimers.delete(e));let i=this.chunkTimers.get(e);i&&(i.forEach(s=>clearTimeout(s)),this.chunkTimers.delete(e)),t?.tileManager&&(t.tileManager.clearMemory(),t.tileManager.cleanup(),t.tileManager.reset())}catch(n){console.error(`Error cleaning up ${e}:`,n.message)}}getStreamingConfig(){return Z.streaming}getWebRTCConfig(){return Z.webrtc}removeClient(e){let t=this.activeClients.get(e);t&&(this.cleanupClientResources(e,t),this.activeClients.delete(e))}getChunkTimers(e){return this.chunkTimers.has(e)||this.chunkTimers.set(e,new Set),this.chunkTimers.get(e)}cleanupAll(){this.stopResourceMonitoring();for(let[e,t]of this.activeClients.entries())this.cleanupClientResources(e,t);this.activeClients.clear(),this.activeTimers.clear(),this.chunkTimers.clear()}}});var mS={};Xr(mS,{ScreenUpdateHelper:()=>yh});var yh,gS=Ce(()=>{bt();yh=class{constructor(e){this.resourceManager=e}async sendTilesInChunks(e,t,n,i=!1){if(!t||t.length===0)return;let s=Z.streaming.chunkSize,o=[];for(let c=0;c<t.length;c+=s)o.push(t.slice(c,c+s));let a=this.resourceManager.getChunkTimers(e.id);for(let c=0;c<o.length;c++){let u=o[c],p=c===o.length-1,f=setTimeout(()=>{a.delete(f),e.connected&&e.emit("tiles-data",{tiles:u,timestamp:n,forceRefresh:!1,userAction:i,chunkInfo:{chunkIndex:c,totalChunks:o.length,isLastChunk:p}})},c*Z.streaming.chunkDelay);a.add(f)}}}});var vS={};Xr(vS,{MouseHandler:()=>_h});var _h,xS=Ce(()=>{bt();_h=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastMouseMove=0}setupMouseHandlers(e,t){let n=this.robot;e.on("mouse-move",t(i=>{let s=Date.now();if(!(s-this.lastMouseMove<Z.throttling.mouseThrottle)){this.lastMouseMove=s;try{let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Mouse move error:",o.message)}}})),e.on("mouse-click",t(async i=>{try{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),n.mouseClick(i.button||"left",i.double||!1),s.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse click error:",s.message)}})),e.on("mouse-press",t(async i=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),n.mouseToggle("down",i.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse press error:",s.message)}})),e.on("mouse-release",t(async i=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),n.mouseToggle("up",i.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse release error:",s.message)}})),e.on("scroll",t(async i=>{try{let{direction:s,amount:o=60,horizontal:a=!1}=i,c=this.resourceManager.getClient(e.id);if(!c)return;let u=0,p=0;a||s==="left"||s==="right"?u=s==="right"?o:-o:p=s==="down"?-o:o,n.scrollMouse(u,p),c.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Scroll error:",s.message)}})),e.on("mouse-drag-select",t(i=>{try{let{startX:s,startY:o,endX:a,endY:c}=i,u=n.getScreenSize(),p=Math.round(s/100*u.width),f=Math.round(o/100*u.height),m=Math.round(a/100*u.width),y=Math.round(c/100*u.height),_=Math.max(0,Math.min(u.width-1,p)),S=Math.max(0,Math.min(u.height-1,f)),A=Math.max(0,Math.min(u.width-1,m)),P=Math.max(0,Math.min(u.height-1,y));n.moveMouse(_,S),n.mouseToggle("down","left"),n.dragMouse(A,P),n.mouseToggle("up","left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Drag selection error:",s.message)}}))}}});var _S={};Xr(_S,{KeyboardHandler:()=>bh});function FB(r){let e;r.type==="missionControl"?e='tell application "System Events" to key code 160':e=`tell application "System Events" to key code ${r.keyCode} using ${r.mods}`,(0,yS.execFile)("osascript",["-e",e],t=>{t&&console.error("osascript error:",t.message)})}var yS,bh,bS=Ce(()=>{yS=require("child_process");bt();bh=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastKeyPress=0,this.lastTypeText=0}setupKeyboardHandlers(e,t){let n=this.robot;e.on("key-press",t(i=>{let s=Date.now();if(!(s-this.lastKeyPress<Z.throttling.keyThrottle)){this.lastKeyPress=s;try{if(!i.key||typeof i.key!="string")return;let o=this.resourceManager.getClient(e.id),a=i.key,c=i.modifier||[];if(a.length===1){n.keyTap(a,c);for(let u of c)n.keyToggle(u,"up")}else{let p={return:"enter"}[a.toLowerCase()]??a.toLowerCase();n.keyTap(p,c)}o&&(o.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Key press error:",o.message)}}})),e.on("desktop-switch",t(i=>{try{let s=i?.direction,o=Z.desktopSwitch[process.platform]?.[s];if(!o)return;process.platform==="darwin"?FB(o):n.keyTap(o[0],o[1]);let a=this.resourceManager.getClient(e.id);a&&(a.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Desktop switch error:",s.message)}})),e.on("type-text",t(i=>{let s=Date.now();if(!(s-this.lastTypeText<Z.throttling.typeTextThrottle)){this.lastTypeText=s;try{if(!i.text||typeof i.text!="string")return;let o=i.text;o.length>Z.throttling.maxTextLength&&(o=o.substring(0,Z.throttling.maxTextLength));let a=o.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,""),c=this.resourceManager.getClient(e.id);setTimeout(()=>{try{n.typeString(a),this.resourceManager.updateClientActivity(e.id),c&&(c.idleFrameCount=0,c.tileManager&&c.tileManager.clearScreenCache())}catch(u){console.error("Robot typeString error:",u.message)}},10)}catch(o){console.error("Type text error:",o.message)}}}))}}});var Oh=O((ZS,kh)=>{(function(r,e){"use strict";function t(T,l){if(!T)throw new Error(l||"Assertion failed")}function n(T,l){T.super_=l;var h=function(){};h.prototype=l.prototype,T.prototype=new h,T.prototype.constructor=T}function i(T,l,h){if(i.isBN(T))return T;this.negative=0,this.words=null,this.length=0,this.red=null,T!==null&&((l==="le"||l==="be")&&(h=l,l=10),this._init(T||0,l||10,h||"be"))}typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=require("buffer").Buffer}catch{}i.isBN=function(l){return l instanceof i?!0:l!==null&&typeof l=="object"&&l.constructor.wordSize===i.wordSize&&Array.isArray(l.words)},i.max=function(l,h){return l.cmp(h)>0?l:h},i.min=function(l,h){return l.cmp(h)<0?l:h},i.prototype._init=function(l,h,x){if(typeof l=="number")return this._initNumber(l,h,x);if(typeof l=="object")return this._initArray(l,h,x);h==="hex"&&(h=16),t(h===(h|0)&&h>=2&&h<=36),l=l.toString().replace(/\s+/g,"");var w=0;l[0]==="-"&&(w++,this.negative=1),w<l.length&&(h===16?this._parseHex(l,w,x):(this._parseBase(l,h,w),x==="le"&&this._initArray(this.toArray(),h,x)))},i.prototype._initNumber=function(l,h,x){l<0&&(this.negative=1,l=-l),l<67108864?(this.words=[l&67108863],this.length=1):l<4503599627370496?(this.words=[l&67108863,l/67108864&67108863],this.length=2):(t(l<9007199254740992),this.words=[l&67108863,l/67108864&67108863,1],this.length=3),x==="le"&&this._initArray(this.toArray(),h,x)},i.prototype._initArray=function(l,h,x){if(t(typeof l.length=="number"),l.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(l.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var g,v,C=0;if(x==="be")for(w=l.length-1,g=0;w>=0;w-=3)v=l[w]|l[w-1]<<8|l[w-2]<<16,this.words[g]|=v<<C&67108863,this.words[g+1]=v>>>26-C&67108863,C+=24,C>=26&&(C-=26,g++);else if(x==="le")for(w=0,g=0;w<l.length;w+=3)v=l[w]|l[w+1]<<8|l[w+2]<<16,this.words[g]|=v<<C&67108863,this.words[g+1]=v>>>26-C&67108863,C+=24,C>=26&&(C-=26,g++);return this.strip()};function o(T,l){var h=T.charCodeAt(l);return h>=65&&h<=70?h-55:h>=97&&h<=102?h-87:h-48&15}function a(T,l,h){var x=o(T,h);return h-1>=l&&(x|=o(T,h-1)<<4),x}i.prototype._parseHex=function(l,h,x){this.length=Math.ceil((l.length-h)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var g=0,v=0,C;if(x==="be")for(w=l.length-1;w>=h;w-=2)C=a(l,h,w)<<g,this.words[v]|=C&67108863,g>=18?(g-=18,v+=1,this.words[v]|=C>>>26):g+=8;else{var b=l.length-h;for(w=b%2===0?h+1:h;w<l.length;w+=2)C=a(l,h,w)<<g,this.words[v]|=C&67108863,g>=18?(g-=18,v+=1,this.words[v]|=C>>>26):g+=8}this.strip()};function c(T,l,h,x){for(var w=0,g=Math.min(T.length,h),v=l;v<g;v++){var C=T.charCodeAt(v)-48;w*=x,C>=49?w+=C-49+10:C>=17?w+=C-17+10:w+=C}return w}i.prototype._parseBase=function(l,h,x){this.words=[0],this.length=1;for(var w=0,g=1;g<=67108863;g*=h)w++;w--,g=g/h|0;for(var v=l.length-x,C=v%w,b=Math.min(v,v-C)+x,d=0,E=x;E<b;E+=w)d=c(l,E,E+w,h),this.imuln(g),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(C!==0){var q=1;for(d=c(l,E,l.length,h),E=0;E<C;E++)q*=h;this.imuln(q),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this.strip()},i.prototype.copy=function(l){l.words=new Array(this.length);for(var h=0;h<this.length;h++)l.words[h]=this.words[h];l.length=this.length,l.negative=this.negative,l.red=this.red},i.prototype.clone=function(){var l=new i(null);return this.copy(l),l},i.prototype._expand=function(l){for(;this.length<l;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(l,h){l=l||10,h=h|0||1;var x;if(l===16||l==="hex"){x="";for(var w=0,g=0,v=0;v<this.length;v++){var C=this.words[v],b=((C<<w|g)&16777215).toString(16);g=C>>>24-w&16777215,w+=2,w>=26&&(w-=26,v--),g!==0||v!==this.length-1?x=u[6-b.length]+b+x:x=b+x}for(g!==0&&(x=g.toString(16)+x);x.length%h!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}if(l===(l|0)&&l>=2&&l<=36){var d=p[l],E=f[l];x="";var q=this.clone();for(q.negative=0;!q.isZero();){var I=q.modn(E).toString(l);q=q.idivn(E),q.isZero()?x=I+x:x=u[d-I.length]+I+x}for(this.isZero()&&(x="0"+x);x.length%h!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}t(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var l=this.words[0];return this.length===2?l+=this.words[1]*67108864:this.length===3&&this.words[2]===1?l+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-l:l},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(l,h){return t(typeof s<"u"),this.toArrayLike(s,l,h)},i.prototype.toArray=function(l,h){return this.toArrayLike(Array,l,h)},i.prototype.toArrayLike=function(l,h,x){var w=this.byteLength(),g=x||Math.max(1,w);t(w<=g,"byte array longer than desired length"),t(g>0,"Requested array length <= 0"),this.strip();var v=h==="le",C=new l(g),b,d,E=this.clone();if(v){for(d=0;!E.isZero();d++)b=E.andln(255),E.iushrn(8),C[d]=b;for(;d<g;d++)C[d]=0}else{for(d=0;d<g-w;d++)C[d]=0;for(d=0;!E.isZero();d++)b=E.andln(255),E.iushrn(8),C[g-d-1]=b}return C},Math.clz32?i.prototype._countBits=function(l){return 32-Math.clz32(l)}:i.prototype._countBits=function(l){var h=l,x=0;return h>=4096&&(x+=13,h>>>=13),h>=64&&(x+=7,h>>>=7),h>=8&&(x+=4,h>>>=4),h>=2&&(x+=2,h>>>=2),x+h},i.prototype._zeroBits=function(l){if(l===0)return 26;var h=l,x=0;return(h&8191)===0&&(x+=13,h>>>=13),(h&127)===0&&(x+=7,h>>>=7),(h&15)===0&&(x+=4,h>>>=4),(h&3)===0&&(x+=2,h>>>=2),(h&1)===0&&x++,x},i.prototype.bitLength=function(){var l=this.words[this.length-1],h=this._countBits(l);return(this.length-1)*26+h};function m(T){for(var l=new Array(T.bitLength()),h=0;h<l.length;h++){var x=h/26|0,w=h%26;l[h]=(T.words[x]&1<<w)>>>w}return l}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var l=0,h=0;h<this.length;h++){var x=this._zeroBits(this.words[h]);if(l+=x,x!==26)break}return l},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(l){return this.negative!==0?this.abs().inotn(l).iaddn(1):this.clone()},i.prototype.fromTwos=function(l){return this.testn(l-1)?this.notn(l).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(l){for(;this.length<l.length;)this.words[this.length++]=0;for(var h=0;h<l.length;h++)this.words[h]=this.words[h]|l.words[h];return this.strip()},i.prototype.ior=function(l){return t((this.negative|l.negative)===0),this.iuor(l)},i.prototype.or=function(l){return this.length>l.length?this.clone().ior(l):l.clone().ior(this)},i.prototype.uor=function(l){return this.length>l.length?this.clone().iuor(l):l.clone().iuor(this)},i.prototype.iuand=function(l){var h;this.length>l.length?h=l:h=this;for(var x=0;x<h.length;x++)this.words[x]=this.words[x]&l.words[x];return this.length=h.length,this.strip()},i.prototype.iand=function(l){return t((this.negative|l.negative)===0),this.iuand(l)},i.prototype.and=function(l){return this.length>l.length?this.clone().iand(l):l.clone().iand(this)},i.prototype.uand=function(l){return this.length>l.length?this.clone().iuand(l):l.clone().iuand(this)},i.prototype.iuxor=function(l){var h,x;this.length>l.length?(h=this,x=l):(h=l,x=this);for(var w=0;w<x.length;w++)this.words[w]=h.words[w]^x.words[w];if(this!==h)for(;w<h.length;w++)this.words[w]=h.words[w];return this.length=h.length,this.strip()},i.prototype.ixor=function(l){return t((this.negative|l.negative)===0),this.iuxor(l)},i.prototype.xor=function(l){return this.length>l.length?this.clone().ixor(l):l.clone().ixor(this)},i.prototype.uxor=function(l){return this.length>l.length?this.clone().iuxor(l):l.clone().iuxor(this)},i.prototype.inotn=function(l){t(typeof l=="number"&&l>=0);var h=Math.ceil(l/26)|0,x=l%26;this._expand(h),x>0&&h--;for(var w=0;w<h;w++)this.words[w]=~this.words[w]&67108863;return x>0&&(this.words[w]=~this.words[w]&67108863>>26-x),this.strip()},i.prototype.notn=function(l){return this.clone().inotn(l)},i.prototype.setn=function(l,h){t(typeof l=="number"&&l>=0);var x=l/26|0,w=l%26;return this._expand(x+1),h?this.words[x]=this.words[x]|1<<w:this.words[x]=this.words[x]&~(1<<w),this.strip()},i.prototype.iadd=function(l){var h;if(this.negative!==0&&l.negative===0)return this.negative=0,h=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,h=this.isub(l),l.negative=1,h._normSign();var x,w;this.length>l.length?(x=this,w=l):(x=l,w=this);for(var g=0,v=0;v<w.length;v++)h=(x.words[v]|0)+(w.words[v]|0)+g,this.words[v]=h&67108863,g=h>>>26;for(;g!==0&&v<x.length;v++)h=(x.words[v]|0)+g,this.words[v]=h&67108863,g=h>>>26;if(this.length=x.length,g!==0)this.words[this.length]=g,this.length++;else if(x!==this)for(;v<x.length;v++)this.words[v]=x.words[v];return this},i.prototype.add=function(l){var h;return l.negative!==0&&this.negative===0?(l.negative=0,h=this.sub(l),l.negative^=1,h):l.negative===0&&this.negative!==0?(this.negative=0,h=l.sub(this),this.negative=1,h):this.length>l.length?this.clone().iadd(l):l.clone().iadd(this)},i.prototype.isub=function(l){if(l.negative!==0){l.negative=0;var h=this.iadd(l);return l.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var x=this.cmp(l);if(x===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,g;x>0?(w=this,g=l):(w=l,g=this);for(var v=0,C=0;C<g.length;C++)h=(w.words[C]|0)-(g.words[C]|0)+v,v=h>>26,this.words[C]=h&67108863;for(;v!==0&&C<w.length;C++)h=(w.words[C]|0)+v,v=h>>26,this.words[C]=h&67108863;if(v===0&&C<w.length&&w!==this)for(;C<w.length;C++)this.words[C]=w.words[C];return this.length=Math.max(this.length,C),w!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(l){return this.clone().isub(l)};function y(T,l,h){h.negative=l.negative^T.negative;var x=T.length+l.length|0;h.length=x,x=x-1|0;var w=T.words[0]|0,g=l.words[0]|0,v=w*g,C=v&67108863,b=v/67108864|0;h.words[0]=C;for(var d=1;d<x;d++){for(var E=b>>>26,q=b&67108863,I=Math.min(d,l.length-1),D=Math.max(0,d-T.length+1);D<=I;D++){var $=d-D|0;w=T.words[$]|0,g=l.words[D]|0,v=w*g+q,E+=v/67108864|0,q=v&67108863}h.words[d]=q|0,b=E|0}return b!==0?h.words[d]=b|0:h.length--,h.strip()}var _=function(l,h,x){var w=l.words,g=h.words,v=x.words,C=0,b,d,E,q=w[0]|0,I=q&8191,D=q>>>13,$=w[1]|0,K=$&8191,B=$>>>13,me=w[2]|0,ie=me&8191,R=me>>>13,Y=w[3]|0,k=Y&8191,j=Y>>>13,J=w[4]|0,V=J&8191,z=J>>>13,ge=w[5]|0,re=ge&8191,Me=ge>>>13,Vg=w[6]|0,Ie=Vg&8191,Ne=Vg>>>13,Yg=w[7]|0,Le=Yg&8191,De=Yg>>>13,Xg=w[8]|0,Be=Xg&8191,je=Xg>>>13,Jg=w[9]|0,Fe=Jg&8191,He=Jg>>>13,Qg=g[0]|0,$e=Qg&8191,qe=Qg>>>13,Zg=g[1]|0,Ue=Zg&8191,We=Zg>>>13,ev=g[2]|0,Ge=ev&8191,ze=ev>>>13,tv=g[3]|0,Ke=tv&8191,Ve=tv>>>13,rv=g[4]|0,Ye=rv&8191,Xe=rv>>>13,nv=g[5]|0,Je=nv&8191,Qe=nv>>>13,iv=g[6]|0,Ze=iv&8191,et=iv>>>13,sv=g[7]|0,tt=sv&8191,rt=sv>>>13,ov=g[8]|0,nt=ov&8191,it=ov>>>13,av=g[9]|0,st=av&8191,ot=av>>>13;x.negative=l.negative^h.negative,x.length=19,b=Math.imul(I,$e),d=Math.imul(I,qe),d=d+Math.imul(D,$e)|0,E=Math.imul(D,qe);var Yu=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Yu>>>26)|0,Yu&=67108863,b=Math.imul(K,$e),d=Math.imul(K,qe),d=d+Math.imul(B,$e)|0,E=Math.imul(B,qe),b=b+Math.imul(I,Ue)|0,d=d+Math.imul(I,We)|0,d=d+Math.imul(D,Ue)|0,E=E+Math.imul(D,We)|0;var Xu=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Xu>>>26)|0,Xu&=67108863,b=Math.imul(ie,$e),d=Math.imul(ie,qe),d=d+Math.imul(R,$e)|0,E=Math.imul(R,qe),b=b+Math.imul(K,Ue)|0,d=d+Math.imul(K,We)|0,d=d+Math.imul(B,Ue)|0,E=E+Math.imul(B,We)|0,b=b+Math.imul(I,Ge)|0,d=d+Math.imul(I,ze)|0,d=d+Math.imul(D,Ge)|0,E=E+Math.imul(D,ze)|0;var Ju=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Ju>>>26)|0,Ju&=67108863,b=Math.imul(k,$e),d=Math.imul(k,qe),d=d+Math.imul(j,$e)|0,E=Math.imul(j,qe),b=b+Math.imul(ie,Ue)|0,d=d+Math.imul(ie,We)|0,d=d+Math.imul(R,Ue)|0,E=E+Math.imul(R,We)|0,b=b+Math.imul(K,Ge)|0,d=d+Math.imul(K,ze)|0,d=d+Math.imul(B,Ge)|0,E=E+Math.imul(B,ze)|0,b=b+Math.imul(I,Ke)|0,d=d+Math.imul(I,Ve)|0,d=d+Math.imul(D,Ke)|0,E=E+Math.imul(D,Ve)|0;var Qu=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Qu>>>26)|0,Qu&=67108863,b=Math.imul(V,$e),d=Math.imul(V,qe),d=d+Math.imul(z,$e)|0,E=Math.imul(z,qe),b=b+Math.imul(k,Ue)|0,d=d+Math.imul(k,We)|0,d=d+Math.imul(j,Ue)|0,E=E+Math.imul(j,We)|0,b=b+Math.imul(ie,Ge)|0,d=d+Math.imul(ie,ze)|0,d=d+Math.imul(R,Ge)|0,E=E+Math.imul(R,ze)|0,b=b+Math.imul(K,Ke)|0,d=d+Math.imul(K,Ve)|0,d=d+Math.imul(B,Ke)|0,E=E+Math.imul(B,Ve)|0,b=b+Math.imul(I,Ye)|0,d=d+Math.imul(I,Xe)|0,d=d+Math.imul(D,Ye)|0,E=E+Math.imul(D,Xe)|0;var Zu=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Zu>>>26)|0,Zu&=67108863,b=Math.imul(re,$e),d=Math.imul(re,qe),d=d+Math.imul(Me,$e)|0,E=Math.imul(Me,qe),b=b+Math.imul(V,Ue)|0,d=d+Math.imul(V,We)|0,d=d+Math.imul(z,Ue)|0,E=E+Math.imul(z,We)|0,b=b+Math.imul(k,Ge)|0,d=d+Math.imul(k,ze)|0,d=d+Math.imul(j,Ge)|0,E=E+Math.imul(j,ze)|0,b=b+Math.imul(ie,Ke)|0,d=d+Math.imul(ie,Ve)|0,d=d+Math.imul(R,Ke)|0,E=E+Math.imul(R,Ve)|0,b=b+Math.imul(K,Ye)|0,d=d+Math.imul(K,Xe)|0,d=d+Math.imul(B,Ye)|0,E=E+Math.imul(B,Xe)|0,b=b+Math.imul(I,Je)|0,d=d+Math.imul(I,Qe)|0,d=d+Math.imul(D,Je)|0,E=E+Math.imul(D,Qe)|0;var ep=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(ep>>>26)|0,ep&=67108863,b=Math.imul(Ie,$e),d=Math.imul(Ie,qe),d=d+Math.imul(Ne,$e)|0,E=Math.imul(Ne,qe),b=b+Math.imul(re,Ue)|0,d=d+Math.imul(re,We)|0,d=d+Math.imul(Me,Ue)|0,E=E+Math.imul(Me,We)|0,b=b+Math.imul(V,Ge)|0,d=d+Math.imul(V,ze)|0,d=d+Math.imul(z,Ge)|0,E=E+Math.imul(z,ze)|0,b=b+Math.imul(k,Ke)|0,d=d+Math.imul(k,Ve)|0,d=d+Math.imul(j,Ke)|0,E=E+Math.imul(j,Ve)|0,b=b+Math.imul(ie,Ye)|0,d=d+Math.imul(ie,Xe)|0,d=d+Math.imul(R,Ye)|0,E=E+Math.imul(R,Xe)|0,b=b+Math.imul(K,Je)|0,d=d+Math.imul(K,Qe)|0,d=d+Math.imul(B,Je)|0,E=E+Math.imul(B,Qe)|0,b=b+Math.imul(I,Ze)|0,d=d+Math.imul(I,et)|0,d=d+Math.imul(D,Ze)|0,E=E+Math.imul(D,et)|0;var tp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(tp>>>26)|0,tp&=67108863,b=Math.imul(Le,$e),d=Math.imul(Le,qe),d=d+Math.imul(De,$e)|0,E=Math.imul(De,qe),b=b+Math.imul(Ie,Ue)|0,d=d+Math.imul(Ie,We)|0,d=d+Math.imul(Ne,Ue)|0,E=E+Math.imul(Ne,We)|0,b=b+Math.imul(re,Ge)|0,d=d+Math.imul(re,ze)|0,d=d+Math.imul(Me,Ge)|0,E=E+Math.imul(Me,ze)|0,b=b+Math.imul(V,Ke)|0,d=d+Math.imul(V,Ve)|0,d=d+Math.imul(z,Ke)|0,E=E+Math.imul(z,Ve)|0,b=b+Math.imul(k,Ye)|0,d=d+Math.imul(k,Xe)|0,d=d+Math.imul(j,Ye)|0,E=E+Math.imul(j,Xe)|0,b=b+Math.imul(ie,Je)|0,d=d+Math.imul(ie,Qe)|0,d=d+Math.imul(R,Je)|0,E=E+Math.imul(R,Qe)|0,b=b+Math.imul(K,Ze)|0,d=d+Math.imul(K,et)|0,d=d+Math.imul(B,Ze)|0,E=E+Math.imul(B,et)|0,b=b+Math.imul(I,tt)|0,d=d+Math.imul(I,rt)|0,d=d+Math.imul(D,tt)|0,E=E+Math.imul(D,rt)|0;var rp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(rp>>>26)|0,rp&=67108863,b=Math.imul(Be,$e),d=Math.imul(Be,qe),d=d+Math.imul(je,$e)|0,E=Math.imul(je,qe),b=b+Math.imul(Le,Ue)|0,d=d+Math.imul(Le,We)|0,d=d+Math.imul(De,Ue)|0,E=E+Math.imul(De,We)|0,b=b+Math.imul(Ie,Ge)|0,d=d+Math.imul(Ie,ze)|0,d=d+Math.imul(Ne,Ge)|0,E=E+Math.imul(Ne,ze)|0,b=b+Math.imul(re,Ke)|0,d=d+Math.imul(re,Ve)|0,d=d+Math.imul(Me,Ke)|0,E=E+Math.imul(Me,Ve)|0,b=b+Math.imul(V,Ye)|0,d=d+Math.imul(V,Xe)|0,d=d+Math.imul(z,Ye)|0,E=E+Math.imul(z,Xe)|0,b=b+Math.imul(k,Je)|0,d=d+Math.imul(k,Qe)|0,d=d+Math.imul(j,Je)|0,E=E+Math.imul(j,Qe)|0,b=b+Math.imul(ie,Ze)|0,d=d+Math.imul(ie,et)|0,d=d+Math.imul(R,Ze)|0,E=E+Math.imul(R,et)|0,b=b+Math.imul(K,tt)|0,d=d+Math.imul(K,rt)|0,d=d+Math.imul(B,tt)|0,E=E+Math.imul(B,rt)|0,b=b+Math.imul(I,nt)|0,d=d+Math.imul(I,it)|0,d=d+Math.imul(D,nt)|0,E=E+Math.imul(D,it)|0;var np=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(np>>>26)|0,np&=67108863,b=Math.imul(Fe,$e),d=Math.imul(Fe,qe),d=d+Math.imul(He,$e)|0,E=Math.imul(He,qe),b=b+Math.imul(Be,Ue)|0,d=d+Math.imul(Be,We)|0,d=d+Math.imul(je,Ue)|0,E=E+Math.imul(je,We)|0,b=b+Math.imul(Le,Ge)|0,d=d+Math.imul(Le,ze)|0,d=d+Math.imul(De,Ge)|0,E=E+Math.imul(De,ze)|0,b=b+Math.imul(Ie,Ke)|0,d=d+Math.imul(Ie,Ve)|0,d=d+Math.imul(Ne,Ke)|0,E=E+Math.imul(Ne,Ve)|0,b=b+Math.imul(re,Ye)|0,d=d+Math.imul(re,Xe)|0,d=d+Math.imul(Me,Ye)|0,E=E+Math.imul(Me,Xe)|0,b=b+Math.imul(V,Je)|0,d=d+Math.imul(V,Qe)|0,d=d+Math.imul(z,Je)|0,E=E+Math.imul(z,Qe)|0,b=b+Math.imul(k,Ze)|0,d=d+Math.imul(k,et)|0,d=d+Math.imul(j,Ze)|0,E=E+Math.imul(j,et)|0,b=b+Math.imul(ie,tt)|0,d=d+Math.imul(ie,rt)|0,d=d+Math.imul(R,tt)|0,E=E+Math.imul(R,rt)|0,b=b+Math.imul(K,nt)|0,d=d+Math.imul(K,it)|0,d=d+Math.imul(B,nt)|0,E=E+Math.imul(B,it)|0,b=b+Math.imul(I,st)|0,d=d+Math.imul(I,ot)|0,d=d+Math.imul(D,st)|0,E=E+Math.imul(D,ot)|0;var ip=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(ip>>>26)|0,ip&=67108863,b=Math.imul(Fe,Ue),d=Math.imul(Fe,We),d=d+Math.imul(He,Ue)|0,E=Math.imul(He,We),b=b+Math.imul(Be,Ge)|0,d=d+Math.imul(Be,ze)|0,d=d+Math.imul(je,Ge)|0,E=E+Math.imul(je,ze)|0,b=b+Math.imul(Le,Ke)|0,d=d+Math.imul(Le,Ve)|0,d=d+Math.imul(De,Ke)|0,E=E+Math.imul(De,Ve)|0,b=b+Math.imul(Ie,Ye)|0,d=d+Math.imul(Ie,Xe)|0,d=d+Math.imul(Ne,Ye)|0,E=E+Math.imul(Ne,Xe)|0,b=b+Math.imul(re,Je)|0,d=d+Math.imul(re,Qe)|0,d=d+Math.imul(Me,Je)|0,E=E+Math.imul(Me,Qe)|0,b=b+Math.imul(V,Ze)|0,d=d+Math.imul(V,et)|0,d=d+Math.imul(z,Ze)|0,E=E+Math.imul(z,et)|0,b=b+Math.imul(k,tt)|0,d=d+Math.imul(k,rt)|0,d=d+Math.imul(j,tt)|0,E=E+Math.imul(j,rt)|0,b=b+Math.imul(ie,nt)|0,d=d+Math.imul(ie,it)|0,d=d+Math.imul(R,nt)|0,E=E+Math.imul(R,it)|0,b=b+Math.imul(K,st)|0,d=d+Math.imul(K,ot)|0,d=d+Math.imul(B,st)|0,E=E+Math.imul(B,ot)|0;var sp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(sp>>>26)|0,sp&=67108863,b=Math.imul(Fe,Ge),d=Math.imul(Fe,ze),d=d+Math.imul(He,Ge)|0,E=Math.imul(He,ze),b=b+Math.imul(Be,Ke)|0,d=d+Math.imul(Be,Ve)|0,d=d+Math.imul(je,Ke)|0,E=E+Math.imul(je,Ve)|0,b=b+Math.imul(Le,Ye)|0,d=d+Math.imul(Le,Xe)|0,d=d+Math.imul(De,Ye)|0,E=E+Math.imul(De,Xe)|0,b=b+Math.imul(Ie,Je)|0,d=d+Math.imul(Ie,Qe)|0,d=d+Math.imul(Ne,Je)|0,E=E+Math.imul(Ne,Qe)|0,b=b+Math.imul(re,Ze)|0,d=d+Math.imul(re,et)|0,d=d+Math.imul(Me,Ze)|0,E=E+Math.imul(Me,et)|0,b=b+Math.imul(V,tt)|0,d=d+Math.imul(V,rt)|0,d=d+Math.imul(z,tt)|0,E=E+Math.imul(z,rt)|0,b=b+Math.imul(k,nt)|0,d=d+Math.imul(k,it)|0,d=d+Math.imul(j,nt)|0,E=E+Math.imul(j,it)|0,b=b+Math.imul(ie,st)|0,d=d+Math.imul(ie,ot)|0,d=d+Math.imul(R,st)|0,E=E+Math.imul(R,ot)|0;var op=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(op>>>26)|0,op&=67108863,b=Math.imul(Fe,Ke),d=Math.imul(Fe,Ve),d=d+Math.imul(He,Ke)|0,E=Math.imul(He,Ve),b=b+Math.imul(Be,Ye)|0,d=d+Math.imul(Be,Xe)|0,d=d+Math.imul(je,Ye)|0,E=E+Math.imul(je,Xe)|0,b=b+Math.imul(Le,Je)|0,d=d+Math.imul(Le,Qe)|0,d=d+Math.imul(De,Je)|0,E=E+Math.imul(De,Qe)|0,b=b+Math.imul(Ie,Ze)|0,d=d+Math.imul(Ie,et)|0,d=d+Math.imul(Ne,Ze)|0,E=E+Math.imul(Ne,et)|0,b=b+Math.imul(re,tt)|0,d=d+Math.imul(re,rt)|0,d=d+Math.imul(Me,tt)|0,E=E+Math.imul(Me,rt)|0,b=b+Math.imul(V,nt)|0,d=d+Math.imul(V,it)|0,d=d+Math.imul(z,nt)|0,E=E+Math.imul(z,it)|0,b=b+Math.imul(k,st)|0,d=d+Math.imul(k,ot)|0,d=d+Math.imul(j,st)|0,E=E+Math.imul(j,ot)|0;var ap=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(ap>>>26)|0,ap&=67108863,b=Math.imul(Fe,Ye),d=Math.imul(Fe,Xe),d=d+Math.imul(He,Ye)|0,E=Math.imul(He,Xe),b=b+Math.imul(Be,Je)|0,d=d+Math.imul(Be,Qe)|0,d=d+Math.imul(je,Je)|0,E=E+Math.imul(je,Qe)|0,b=b+Math.imul(Le,Ze)|0,d=d+Math.imul(Le,et)|0,d=d+Math.imul(De,Ze)|0,E=E+Math.imul(De,et)|0,b=b+Math.imul(Ie,tt)|0,d=d+Math.imul(Ie,rt)|0,d=d+Math.imul(Ne,tt)|0,E=E+Math.imul(Ne,rt)|0,b=b+Math.imul(re,nt)|0,d=d+Math.imul(re,it)|0,d=d+Math.imul(Me,nt)|0,E=E+Math.imul(Me,it)|0,b=b+Math.imul(V,st)|0,d=d+Math.imul(V,ot)|0,d=d+Math.imul(z,st)|0,E=E+Math.imul(z,ot)|0;var cp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(cp>>>26)|0,cp&=67108863,b=Math.imul(Fe,Je),d=Math.imul(Fe,Qe),d=d+Math.imul(He,Je)|0,E=Math.imul(He,Qe),b=b+Math.imul(Be,Ze)|0,d=d+Math.imul(Be,et)|0,d=d+Math.imul(je,Ze)|0,E=E+Math.imul(je,et)|0,b=b+Math.imul(Le,tt)|0,d=d+Math.imul(Le,rt)|0,d=d+Math.imul(De,tt)|0,E=E+Math.imul(De,rt)|0,b=b+Math.imul(Ie,nt)|0,d=d+Math.imul(Ie,it)|0,d=d+Math.imul(Ne,nt)|0,E=E+Math.imul(Ne,it)|0,b=b+Math.imul(re,st)|0,d=d+Math.imul(re,ot)|0,d=d+Math.imul(Me,st)|0,E=E+Math.imul(Me,ot)|0;var lp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(lp>>>26)|0,lp&=67108863,b=Math.imul(Fe,Ze),d=Math.imul(Fe,et),d=d+Math.imul(He,Ze)|0,E=Math.imul(He,et),b=b+Math.imul(Be,tt)|0,d=d+Math.imul(Be,rt)|0,d=d+Math.imul(je,tt)|0,E=E+Math.imul(je,rt)|0,b=b+Math.imul(Le,nt)|0,d=d+Math.imul(Le,it)|0,d=d+Math.imul(De,nt)|0,E=E+Math.imul(De,it)|0,b=b+Math.imul(Ie,st)|0,d=d+Math.imul(Ie,ot)|0,d=d+Math.imul(Ne,st)|0,E=E+Math.imul(Ne,ot)|0;var up=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(up>>>26)|0,up&=67108863,b=Math.imul(Fe,tt),d=Math.imul(Fe,rt),d=d+Math.imul(He,tt)|0,E=Math.imul(He,rt),b=b+Math.imul(Be,nt)|0,d=d+Math.imul(Be,it)|0,d=d+Math.imul(je,nt)|0,E=E+Math.imul(je,it)|0,b=b+Math.imul(Le,st)|0,d=d+Math.imul(Le,ot)|0,d=d+Math.imul(De,st)|0,E=E+Math.imul(De,ot)|0;var pp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(pp>>>26)|0,pp&=67108863,b=Math.imul(Fe,nt),d=Math.imul(Fe,it),d=d+Math.imul(He,nt)|0,E=Math.imul(He,it),b=b+Math.imul(Be,st)|0,d=d+Math.imul(Be,ot)|0,d=d+Math.imul(je,st)|0,E=E+Math.imul(je,ot)|0;var fp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(fp>>>26)|0,fp&=67108863,b=Math.imul(Fe,st),d=Math.imul(Fe,ot),d=d+Math.imul(He,st)|0,E=Math.imul(He,ot);var dp=(C+b|0)+((d&8191)<<13)|0;return C=(E+(d>>>13)|0)+(dp>>>26)|0,dp&=67108863,v[0]=Yu,v[1]=Xu,v[2]=Ju,v[3]=Qu,v[4]=Zu,v[5]=ep,v[6]=tp,v[7]=rp,v[8]=np,v[9]=ip,v[10]=sp,v[11]=op,v[12]=ap,v[13]=cp,v[14]=lp,v[15]=up,v[16]=pp,v[17]=fp,v[18]=dp,C!==0&&(v[19]=C,x.length++),x};Math.imul||(_=y);function S(T,l,h){h.negative=l.negative^T.negative,h.length=T.length+l.length;for(var x=0,w=0,g=0;g<h.length-1;g++){var v=w;w=0;for(var C=x&67108863,b=Math.min(g,l.length-1),d=Math.max(0,g-T.length+1);d<=b;d++){var E=g-d,q=T.words[E]|0,I=l.words[d]|0,D=q*I,$=D&67108863;v=v+(D/67108864|0)|0,$=$+C|0,C=$&67108863,v=v+($>>>26)|0,w+=v>>>26,v&=67108863}h.words[g]=C,x=v,v=w}return x!==0?h.words[g]=x:h.length--,h.strip()}function A(T,l,h){var x=new P;return x.mulp(T,l,h)}i.prototype.mulTo=function(l,h){var x,w=this.length+l.length;return this.length===10&&l.length===10?x=_(this,l,h):w<63?x=y(this,l,h):w<1024?x=S(this,l,h):x=A(this,l,h),x};function P(T,l){this.x=T,this.y=l}P.prototype.makeRBT=function(l){for(var h=new Array(l),x=i.prototype._countBits(l)-1,w=0;w<l;w++)h[w]=this.revBin(w,x,l);return h},P.prototype.revBin=function(l,h,x){if(l===0||l===x-1)return l;for(var w=0,g=0;g<h;g++)w|=(l&1)<<h-g-1,l>>=1;return w},P.prototype.permute=function(l,h,x,w,g,v){for(var C=0;C<v;C++)w[C]=h[l[C]],g[C]=x[l[C]]},P.prototype.transform=function(l,h,x,w,g,v){this.permute(v,l,h,x,w,g);for(var C=1;C<g;C<<=1)for(var b=C<<1,d=Math.cos(2*Math.PI/b),E=Math.sin(2*Math.PI/b),q=0;q<g;q+=b)for(var I=d,D=E,$=0;$<C;$++){var K=x[q+$],B=w[q+$],me=x[q+$+C],ie=w[q+$+C],R=I*me-D*ie;ie=I*ie+D*me,me=R,x[q+$]=K+me,w[q+$]=B+ie,x[q+$+C]=K-me,w[q+$+C]=B-ie,$!==b&&(R=d*I-E*D,D=d*D+E*I,I=R)}},P.prototype.guessLen13b=function(l,h){var x=Math.max(h,l)|1,w=x&1,g=0;for(x=x/2|0;x;x=x>>>1)g++;return 1<<g+1+w},P.prototype.conjugate=function(l,h,x){if(!(x<=1))for(var w=0;w<x/2;w++){var g=l[w];l[w]=l[x-w-1],l[x-w-1]=g,g=h[w],h[w]=-h[x-w-1],h[x-w-1]=-g}},P.prototype.normalize13b=function(l,h){for(var x=0,w=0;w<h/2;w++){var g=Math.round(l[2*w+1]/h)*8192+Math.round(l[2*w]/h)+x;l[w]=g&67108863,g<67108864?x=0:x=g/67108864|0}return l},P.prototype.convert13b=function(l,h,x,w){for(var g=0,v=0;v<h;v++)g=g+(l[v]|0),x[2*v]=g&8191,g=g>>>13,x[2*v+1]=g&8191,g=g>>>13;for(v=2*h;v<w;++v)x[v]=0;t(g===0),t((g&-8192)===0)},P.prototype.stub=function(l){for(var h=new Array(l),x=0;x<l;x++)h[x]=0;return h},P.prototype.mulp=function(l,h,x){var w=2*this.guessLen13b(l.length,h.length),g=this.makeRBT(w),v=this.stub(w),C=new Array(w),b=new Array(w),d=new Array(w),E=new Array(w),q=new Array(w),I=new Array(w),D=x.words;D.length=w,this.convert13b(l.words,l.length,C,w),this.convert13b(h.words,h.length,E,w),this.transform(C,v,b,d,w,g),this.transform(E,v,q,I,w,g);for(var $=0;$<w;$++){var K=b[$]*q[$]-d[$]*I[$];d[$]=b[$]*I[$]+d[$]*q[$],b[$]=K}return this.conjugate(b,d,w),this.transform(b,d,D,v,w,g),this.conjugate(D,v,w),this.normalize13b(D,w),x.negative=l.negative^h.negative,x.length=l.length+h.length,x.strip()},i.prototype.mul=function(l){var h=new i(null);return h.words=new Array(this.length+l.length),this.mulTo(l,h)},i.prototype.mulf=function(l){var h=new i(null);return h.words=new Array(this.length+l.length),A(this,l,h)},i.prototype.imul=function(l){return this.clone().mulTo(l,this)},i.prototype.imuln=function(l){t(typeof l=="number"),t(l<67108864);for(var h=0,x=0;x<this.length;x++){var w=(this.words[x]|0)*l,g=(w&67108863)+(h&67108863);h>>=26,h+=w/67108864|0,h+=g>>>26,this.words[x]=g&67108863}return h!==0&&(this.words[x]=h,this.length++),this.length=l===0?1:this.length,this},i.prototype.muln=function(l){return this.clone().imuln(l)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(l){var h=m(l);if(h.length===0)return new i(1);for(var x=this,w=0;w<h.length&&h[w]===0;w++,x=x.sqr());if(++w<h.length)for(var g=x.sqr();w<h.length;w++,g=g.sqr())h[w]!==0&&(x=x.mul(g));return x},i.prototype.iushln=function(l){t(typeof l=="number"&&l>=0);var h=l%26,x=(l-h)/26,w=67108863>>>26-h<<26-h,g;if(h!==0){var v=0;for(g=0;g<this.length;g++){var C=this.words[g]&w,b=(this.words[g]|0)-C<<h;this.words[g]=b|v,v=C>>>26-h}v&&(this.words[g]=v,this.length++)}if(x!==0){for(g=this.length-1;g>=0;g--)this.words[g+x]=this.words[g];for(g=0;g<x;g++)this.words[g]=0;this.length+=x}return this.strip()},i.prototype.ishln=function(l){return t(this.negative===0),this.iushln(l)},i.prototype.iushrn=function(l,h,x){t(typeof l=="number"&&l>=0);var w;h?w=(h-h%26)/26:w=0;var g=l%26,v=Math.min((l-g)/26,this.length),C=67108863^67108863>>>g<<g,b=x;if(w-=v,w=Math.max(0,w),b){for(var d=0;d<v;d++)b.words[d]=this.words[d];b.length=v}if(v!==0)if(this.length>v)for(this.length-=v,d=0;d<this.length;d++)this.words[d]=this.words[d+v];else this.words[0]=0,this.length=1;var E=0;for(d=this.length-1;d>=0&&(E!==0||d>=w);d--){var q=this.words[d]|0;this.words[d]=E<<26-g|q>>>g,E=q&C}return b&&E!==0&&(b.words[b.length++]=E),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(l,h,x){return t(this.negative===0),this.iushrn(l,h,x)},i.prototype.shln=function(l){return this.clone().ishln(l)},i.prototype.ushln=function(l){return this.clone().iushln(l)},i.prototype.shrn=function(l){return this.clone().ishrn(l)},i.prototype.ushrn=function(l){return this.clone().iushrn(l)},i.prototype.testn=function(l){t(typeof l=="number"&&l>=0);var h=l%26,x=(l-h)/26,w=1<<h;if(this.length<=x)return!1;var g=this.words[x];return!!(g&w)},i.prototype.imaskn=function(l){t(typeof l=="number"&&l>=0);var h=l%26,x=(l-h)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=x)return this;if(h!==0&&x++,this.length=Math.min(x,this.length),h!==0){var w=67108863^67108863>>>h<<h;this.words[this.length-1]&=w}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.maskn=function(l){return this.clone().imaskn(l)},i.prototype.iaddn=function(l){return t(typeof l=="number"),t(l<67108864),l<0?this.isubn(-l):this.negative!==0?this.length===1&&(this.words[0]|0)<l?(this.words[0]=l-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(l),this.negative=1,this):this._iaddn(l)},i.prototype._iaddn=function(l){this.words[0]+=l;for(var h=0;h<this.length&&this.words[h]>=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},i.prototype.isubn=function(l){if(t(typeof l=="number"),t(l<67108864),l<0)return this.iaddn(-l);if(this.negative!==0)return this.negative=0,this.iaddn(l),this.negative=1,this;if(this.words[0]-=l,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h<this.length&&this.words[h]<0;h++)this.words[h]+=67108864,this.words[h+1]-=1;return this.strip()},i.prototype.addn=function(l){return this.clone().iaddn(l)},i.prototype.subn=function(l){return this.clone().isubn(l)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(l,h,x){var w=l.length+x,g;this._expand(w);var v,C=0;for(g=0;g<l.length;g++){v=(this.words[g+x]|0)+C;var b=(l.words[g]|0)*h;v-=b&67108863,C=(v>>26)-(b/67108864|0),this.words[g+x]=v&67108863}for(;g<this.length-x;g++)v=(this.words[g+x]|0)+C,C=v>>26,this.words[g+x]=v&67108863;if(C===0)return this.strip();for(t(C===-1),C=0,g=0;g<this.length;g++)v=-(this.words[g]|0)+C,C=v>>26,this.words[g]=v&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(l,h){var x=this.length-l.length,w=this.clone(),g=l,v=g.words[g.length-1]|0,C=this._countBits(v);x=26-C,x!==0&&(g=g.ushln(x),w.iushln(x),v=g.words[g.length-1]|0);var b=w.length-g.length,d;if(h!=="mod"){d=new i(null),d.length=b+1,d.words=new Array(d.length);for(var E=0;E<d.length;E++)d.words[E]=0}var q=w.clone()._ishlnsubmul(g,1,b);q.negative===0&&(w=q,d&&(d.words[b]=1));for(var I=b-1;I>=0;I--){var D=(w.words[g.length+I]|0)*67108864+(w.words[g.length+I-1]|0);for(D=Math.min(D/v|0,67108863),w._ishlnsubmul(g,D,I);w.negative!==0;)D--,w.negative=0,w._ishlnsubmul(g,1,I),w.isZero()||(w.negative^=1);d&&(d.words[I]=D)}return d&&d.strip(),w.strip(),h!=="div"&&x!==0&&w.iushrn(x),{div:d||null,mod:w}},i.prototype.divmod=function(l,h,x){if(t(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var w,g,v;return this.negative!==0&&l.negative===0?(v=this.neg().divmod(l,h),h!=="mod"&&(w=v.div.neg()),h!=="div"&&(g=v.mod.neg(),x&&g.negative!==0&&g.iadd(l)),{div:w,mod:g}):this.negative===0&&l.negative!==0?(v=this.divmod(l.neg(),h),h!=="mod"&&(w=v.div.neg()),{div:w,mod:v.mod}):(this.negative&l.negative)!==0?(v=this.neg().divmod(l.neg(),h),h!=="div"&&(g=v.mod.neg(),x&&g.negative!==0&&g.isub(l)),{div:v.div,mod:g}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?h==="div"?{div:this.divn(l.words[0]),mod:null}:h==="mod"?{div:null,mod:new i(this.modn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new i(this.modn(l.words[0]))}:this._wordDiv(l,h)},i.prototype.div=function(l){return this.divmod(l,"div",!1).div},i.prototype.mod=function(l){return this.divmod(l,"mod",!1).mod},i.prototype.umod=function(l){return this.divmod(l,"mod",!0).mod},i.prototype.divRound=function(l){var h=this.divmod(l);if(h.mod.isZero())return h.div;var x=h.div.negative!==0?h.mod.isub(l):h.mod,w=l.ushrn(1),g=l.andln(1),v=x.cmp(w);return v<0||g===1&&v===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},i.prototype.modn=function(l){t(l<=67108863);for(var h=(1<<26)%l,x=0,w=this.length-1;w>=0;w--)x=(h*x+(this.words[w]|0))%l;return x},i.prototype.idivn=function(l){t(l<=67108863);for(var h=0,x=this.length-1;x>=0;x--){var w=(this.words[x]|0)+h*67108864;this.words[x]=w/l|0,h=w%l}return this.strip()},i.prototype.divn=function(l){return this.clone().idivn(l)},i.prototype.egcd=function(l){t(l.negative===0),t(!l.isZero());var h=this,x=l.clone();h.negative!==0?h=h.umod(l):h=h.clone();for(var w=new i(1),g=new i(0),v=new i(0),C=new i(1),b=0;h.isEven()&&x.isEven();)h.iushrn(1),x.iushrn(1),++b;for(var d=x.clone(),E=h.clone();!h.isZero();){for(var q=0,I=1;(h.words[0]&I)===0&&q<26;++q,I<<=1);if(q>0)for(h.iushrn(q);q-- >0;)(w.isOdd()||g.isOdd())&&(w.iadd(d),g.isub(E)),w.iushrn(1),g.iushrn(1);for(var D=0,$=1;(x.words[0]&$)===0&&D<26;++D,$<<=1);if(D>0)for(x.iushrn(D);D-- >0;)(v.isOdd()||C.isOdd())&&(v.iadd(d),C.isub(E)),v.iushrn(1),C.iushrn(1);h.cmp(x)>=0?(h.isub(x),w.isub(v),g.isub(C)):(x.isub(h),v.isub(w),C.isub(g))}return{a:v,b:C,gcd:x.iushln(b)}},i.prototype._invmp=function(l){t(l.negative===0),t(!l.isZero());var h=this,x=l.clone();h.negative!==0?h=h.umod(l):h=h.clone();for(var w=new i(1),g=new i(0),v=x.clone();h.cmpn(1)>0&&x.cmpn(1)>0;){for(var C=0,b=1;(h.words[0]&b)===0&&C<26;++C,b<<=1);if(C>0)for(h.iushrn(C);C-- >0;)w.isOdd()&&w.iadd(v),w.iushrn(1);for(var d=0,E=1;(x.words[0]&E)===0&&d<26;++d,E<<=1);if(d>0)for(x.iushrn(d);d-- >0;)g.isOdd()&&g.iadd(v),g.iushrn(1);h.cmp(x)>=0?(h.isub(x),w.isub(g)):(x.isub(h),g.isub(w))}var q;return h.cmpn(1)===0?q=w:q=g,q.cmpn(0)<0&&q.iadd(l),q},i.prototype.gcd=function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var h=this.clone(),x=l.clone();h.negative=0,x.negative=0;for(var w=0;h.isEven()&&x.isEven();w++)h.iushrn(1),x.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;x.isEven();)x.iushrn(1);var g=h.cmp(x);if(g<0){var v=h;h=x,x=v}else if(g===0||x.cmpn(1)===0)break;h.isub(x)}while(!0);return x.iushln(w)},i.prototype.invm=function(l){return this.egcd(l).a.umod(l)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(l){return this.words[0]&l},i.prototype.bincn=function(l){t(typeof l=="number");var h=l%26,x=(l-h)/26,w=1<<h;if(this.length<=x)return this._expand(x+1),this.words[x]|=w,this;for(var g=w,v=x;g!==0&&v<this.length;v++){var C=this.words[v]|0;C+=g,g=C>>>26,C&=67108863,this.words[v]=C}return g!==0&&(this.words[v]=g,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(l){var h=l<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this.strip();var x;if(this.length>1)x=1;else{h&&(l=-l),t(l<=67108863,"Number is too big");var w=this.words[0]|0;x=w===l?0:w<l?-1:1}return this.negative!==0?-x|0:x},i.prototype.cmp=function(l){if(this.negative!==0&&l.negative===0)return-1;if(this.negative===0&&l.negative!==0)return 1;var h=this.ucmp(l);return this.negative!==0?-h|0:h},i.prototype.ucmp=function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var h=0,x=this.length-1;x>=0;x--){var w=this.words[x]|0,g=l.words[x]|0;if(w!==g){w<g?h=-1:w>g&&(h=1);break}}return h},i.prototype.gtn=function(l){return this.cmpn(l)===1},i.prototype.gt=function(l){return this.cmp(l)===1},i.prototype.gten=function(l){return this.cmpn(l)>=0},i.prototype.gte=function(l){return this.cmp(l)>=0},i.prototype.ltn=function(l){return this.cmpn(l)===-1},i.prototype.lt=function(l){return this.cmp(l)===-1},i.prototype.lten=function(l){return this.cmpn(l)<=0},i.prototype.lte=function(l){return this.cmp(l)<=0},i.prototype.eqn=function(l){return this.cmpn(l)===0},i.prototype.eq=function(l){return this.cmp(l)===0},i.red=function(l){return new M(l)},i.prototype.toRed=function(l){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},i.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(l){return this.red=l,this},i.prototype.forceRed=function(l){return t(!this.red,"Already a number in reduction context"),this._forceRed(l)},i.prototype.redAdd=function(l){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},i.prototype.redIAdd=function(l){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},i.prototype.redSub=function(l){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},i.prototype.redISub=function(l){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},i.prototype.redShl=function(l){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},i.prototype.redMul=function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.mul(this,l)},i.prototype.redIMul=function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.imul(this,l)},i.prototype.redSqr=function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(l){return t(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)};var L={k256:null,p224:null,p192:null,p25519:null};function N(T,l){this.name=T,this.p=new i(l,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}N.prototype._tmp=function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},N.prototype.ireduce=function(l){var h=l,x;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),x=h.bitLength();while(x>this.n);var w=x<this.n?-1:h.ucmp(this.p);return w===0?(h.words[0]=0,h.length=1):w>0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},N.prototype.split=function(l,h){l.iushrn(this.n,0,h)},N.prototype.imulK=function(l){return l.imul(this.k)};function H(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(H,N),H.prototype.split=function(l,h){for(var x=4194303,w=Math.min(l.length,9),g=0;g<w;g++)h.words[g]=l.words[g];if(h.length=w,l.length<=9){l.words[0]=0,l.length=1;return}var v=l.words[9];for(h.words[h.length++]=v&x,g=10;g<l.length;g++){var C=l.words[g]|0;l.words[g-10]=(C&x)<<4|v>>>22,v=C}v>>>=22,l.words[g-10]=v,v===0&&l.length>10?l.length-=10:l.length-=9},H.prototype.imulK=function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var h=0,x=0;x<l.length;x++){var w=l.words[x]|0;h+=w*977,l.words[x]=h&67108863,h=w*64+(h/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l};function W(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(W,N);function U(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(U,N);function G(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(G,N),G.prototype.imulK=function(l){for(var h=0,x=0;x<l.length;x++){var w=(l.words[x]|0)*19+h,g=w&67108863;w>>>=26,l.words[x]=g,h=w}return h!==0&&(l.words[l.length++]=h),l},i._prime=function(l){if(L[l])return L[l];var h;if(l==="k256")h=new H;else if(l==="p224")h=new W;else if(l==="p192")h=new U;else if(l==="p25519")h=new G;else throw new Error("Unknown prime "+l);return L[l]=h,h};function M(T){if(typeof T=="string"){var l=i._prime(T);this.m=l.p,this.prime=l}else t(T.gtn(1),"modulus must be greater than 1"),this.m=T,this.prime=null}M.prototype._verify1=function(l){t(l.negative===0,"red works only with positives"),t(l.red,"red works only with red numbers")},M.prototype._verify2=function(l,h){t((l.negative|h.negative)===0,"red works only with positives"),t(l.red&&l.red===h.red,"red works only with red numbers")},M.prototype.imod=function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):l.umod(this.m)._forceRed(this)},M.prototype.neg=function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},M.prototype.add=function(l,h){this._verify2(l,h);var x=l.add(h);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},M.prototype.iadd=function(l,h){this._verify2(l,h);var x=l.iadd(h);return x.cmp(this.m)>=0&&x.isub(this.m),x},M.prototype.sub=function(l,h){this._verify2(l,h);var x=l.sub(h);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},M.prototype.isub=function(l,h){this._verify2(l,h);var x=l.isub(h);return x.cmpn(0)<0&&x.iadd(this.m),x},M.prototype.shl=function(l,h){return this._verify1(l),this.imod(l.ushln(h))},M.prototype.imul=function(l,h){return this._verify2(l,h),this.imod(l.imul(h))},M.prototype.mul=function(l,h){return this._verify2(l,h),this.imod(l.mul(h))},M.prototype.isqr=function(l){return this.imul(l,l.clone())},M.prototype.sqr=function(l){return this.mul(l,l)},M.prototype.sqrt=function(l){if(l.isZero())return l.clone();var h=this.m.andln(3);if(t(h%2===1),h===3){var x=this.m.add(new i(1)).iushrn(2);return this.pow(l,x)}for(var w=this.m.subn(1),g=0;!w.isZero()&&w.andln(1)===0;)g++,w.iushrn(1);t(!w.isZero());var v=new i(1).toRed(this),C=v.redNeg(),b=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new i(2*d*d).toRed(this);this.pow(d,b).cmp(C)!==0;)d.redIAdd(C);for(var E=this.pow(d,w),q=this.pow(l,w.addn(1).iushrn(1)),I=this.pow(l,w),D=g;I.cmp(v)!==0;){for(var $=I,K=0;$.cmp(v)!==0;K++)$=$.redSqr();t(K<D);var B=this.pow(E,new i(1).iushln(D-K-1));q=q.redMul(B),E=B.redSqr(),I=I.redMul(E),D=K}return q},M.prototype.invm=function(l){var h=l._invmp(this.m);return h.negative!==0?(h.negative=0,this.imod(h).redNeg()):this.imod(h)},M.prototype.pow=function(l,h){if(h.isZero())return new i(1).toRed(this);if(h.cmpn(1)===0)return l.clone();var x=4,w=new Array(1<<x);w[0]=new i(1).toRed(this),w[1]=l;for(var g=2;g<w.length;g++)w[g]=this.mul(w[g-1],l);var v=w[0],C=0,b=0,d=h.bitLength()%26;for(d===0&&(d=26),g=h.length-1;g>=0;g--){for(var E=h.words[g],q=d-1;q>=0;q--){var I=E>>q&1;if(v!==w[0]&&(v=this.sqr(v)),I===0&&C===0){b=0;continue}C<<=1,C|=I,b++,!(b!==x&&(g!==0||q!==0))&&(v=this.mul(v,w[C]),b=0,C=0)}d=26}return v},M.prototype.convertTo=function(l){var h=l.umod(this.m);return h===l?h.clone():h},M.prototype.convertFrom=function(l){var h=l.clone();return h.red=null,h},i.mont=function(l){return new F(l)};function F(T){M.call(this,T),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(F,M),F.prototype.convertTo=function(l){return this.imod(l.ushln(this.shift))},F.prototype.convertFrom=function(l){var h=this.imod(l.mul(this.rinv));return h.red=null,h},F.prototype.imul=function(l,h){if(l.isZero()||h.isZero())return l.words[0]=0,l.length=1,l;var x=l.imul(h),w=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=x.isub(w).iushrn(this.shift),v=g;return g.cmp(this.m)>=0?v=g.isub(this.m):g.cmpn(0)<0&&(v=g.iadd(this.m)),v._forceRed(this)},F.prototype.mul=function(l,h){if(l.isZero()||h.isZero())return new i(0)._forceRed(this);var x=l.mul(h),w=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=x.isub(w).iushrn(this.shift),v=g;return g.cmp(this.m)>=0?v=g.isub(this.m):g.cmpn(0)<0&&(v=g.iadd(this.m)),v._forceRed(this)},F.prototype.invm=function(l){var h=this.imod(l._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(typeof kh>"u"||kh,ZS)});var eE=O((uG,Ph)=>{typeof Object.create=="function"?Ph.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Ph.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}});var Wn=O((pG,Ih)=>{try{if(Mh=require("util"),typeof Mh.inherits!="function")throw"";Ih.exports=Mh.inherits}catch{Ih.exports=eE()}var Mh});var Fl=O((fG,tE)=>{"use strict";var jl=require("buffer"),ws=jl.Buffer,pr={},fr;for(fr in jl)jl.hasOwnProperty(fr)&&(fr==="SlowBuffer"||fr==="Buffer"||(pr[fr]=jl[fr]));var Ss=pr.Buffer={};for(fr in ws)ws.hasOwnProperty(fr)&&(fr==="allocUnsafe"||fr==="allocUnsafeSlow"||(Ss[fr]=ws[fr]));pr.Buffer.prototype=ws.prototype;(!Ss.from||Ss.from===Uint8Array.from)&&(Ss.from=function(r,e,t){if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof r);if(r&&typeof r.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);return ws(r,e,t)});Ss.alloc||(Ss.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof r);if(r<0||r>=2*(1<<30))throw new RangeError('The value "'+r+'" is invalid for option "size"');var n=ws(r);return!e||e.length===0?n.fill(0):typeof t=="string"?n.fill(e,t):n.fill(e),n});if(!pr.kStringMaxLength)try{pr.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}pr.constants||(pr.constants={MAX_LENGTH:pr.kMaxLength},pr.kStringMaxLength&&(pr.constants.MAX_STRING_LENGTH=pr.kStringMaxLength));tE.exports=pr});var Hl=O(rE=>{"use strict";var zB=Wn();function dr(r){this._reporterState={obj:null,path:[],options:r||{},errors:[]}}rE.Reporter=dr;dr.prototype.isError=function(e){return e instanceof Es};dr.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};dr.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)};dr.prototype.enterKey=function(e){return this._reporterState.path.push(e)};dr.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)};dr.prototype.leaveKey=function(e,t,n){let i=this._reporterState;this.exitKey(e),i.obj!==null&&(i.obj[t]=n)};dr.prototype.path=function(){return this._reporterState.path.join("/")};dr.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t};dr.prototype.leaveObject=function(e){let t=this._reporterState,n=t.obj;return t.obj=e,n};dr.prototype.error=function(e){let t,n=this._reporterState,i=e instanceof Es;if(i?t=e:t=new Es(n.path.map(function(s){return"["+JSON.stringify(s)+"]"}).join(""),e.message||e,e.stack),!n.options.partial)throw t;return i||n.errors.push(t),t};dr.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};function Es(r,e){this.path=r,this.rethrow(e)}zB(Es,Error);Es.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Es),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}});var As=O(Nh=>{"use strict";var KB=Wn(),$l=Hl().Reporter,Ts=Fl().Buffer;function hr(r,e){if($l.call(this,e),!Ts.isBuffer(r)){this.error("Input not Buffer");return}this.base=r,this.offset=0,this.length=r.length}KB(hr,$l);Nh.DecoderBuffer=hr;hr.isDecoderBuffer=function(e){return e instanceof hr?!0:typeof e=="object"&&Ts.isBuffer(e.base)&&e.constructor.name==="DecoderBuffer"&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.save=="function"&&typeof e.restore=="function"&&typeof e.isEmpty=="function"&&typeof e.readUInt8=="function"&&typeof e.skip=="function"&&typeof e.raw=="function"};hr.prototype.save=function(){return{offset:this.offset,reporter:$l.prototype.save.call(this)}};hr.prototype.restore=function(e){let t=new hr(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,$l.prototype.restore.call(this,e.reporter),t};hr.prototype.isEmpty=function(){return this.offset===this.length};hr.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};hr.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");let n=new hr(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n};hr.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function Cs(r,e){if(Array.isArray(r))this.length=0,this.value=r.map(function(t){return Cs.isEncoderBuffer(t)||(t=new Cs(t,e)),this.length+=t.length,t},this);else if(typeof r=="number"){if(!(0<=r&&r<=255))return e.error("non-byte EncoderBuffer value");this.value=r,this.length=1}else if(typeof r=="string")this.value=r,this.length=Ts.byteLength(r);else if(Ts.isBuffer(r))this.value=r,this.length=r.length;else return e.error("Unsupported type: "+typeof r)}Nh.EncoderBuffer=Cs;Cs.isEncoderBuffer=function(e){return e instanceof Cs?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};Cs.prototype.join=function(e,t){return e||(e=Ts.alloc(this.length)),t||(t=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(n){n.join(e,t),t+=n.length}):(typeof this.value=="number"?e[t]=this.value:typeof this.value=="string"?e.write(this.value,t):Ts.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}});var sE=O((mG,iE)=>{iE.exports=nE;function nE(r,e){if(!r)throw new Error(e||"Assertion failed")}nE.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}});var ql=O((gG,aE)=>{"use strict";var VB=Hl().Reporter,YB=As().EncoderBuffer,XB=As().DecoderBuffer,Pt=sE(),oE=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],JB=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(oE),QB=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function fe(r,e,t){let n={};this._baseState=n,n.name=t,n.enc=r,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}aE.exports=fe;var ZB=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];fe.prototype.clone=function(){let e=this._baseState,t={};ZB.forEach(function(i){t[i]=e[i]});let n=new this.constructor(t.parent);return n._baseState=t,n};fe.prototype._wrap=function(){let e=this._baseState;JB.forEach(function(t){this[t]=function(){let i=new this.constructor(this);return e.children.push(i),i[t].apply(i,arguments)}},this)};fe.prototype._init=function(e){let t=this._baseState;Pt(t.parent===null),e.call(this),t.children=t.children.filter(function(n){return n._baseState.parent===this},this),Pt.equal(t.children.length,1,"Root node can have only one child")};fe.prototype._useArgs=function(e){let t=this._baseState,n=e.filter(function(i){return i instanceof this.constructor},this);e=e.filter(function(i){return!(i instanceof this.constructor)},this),n.length!==0&&(Pt(t.children===null),t.children=n,n.forEach(function(i){i._baseState.parent=this},this)),e.length!==0&&(Pt(t.args===null),t.args=e,t.reverseArgs=e.map(function(i){if(typeof i!="object"||i.constructor!==Object)return i;let s={};return Object.keys(i).forEach(function(o){o==(o|0)&&(o|=0);let a=i[o];s[a]=o}),s}))};QB.forEach(function(r){fe.prototype[r]=function(){let t=this._baseState;throw new Error(r+" not implemented for encoding: "+t.enc)}});oE.forEach(function(r){fe.prototype[r]=function(){let t=this._baseState,n=Array.prototype.slice.call(arguments);return Pt(t.tag===null),t.tag=r,this._useArgs(n),this}});fe.prototype.use=function(e){Pt(e);let t=this._baseState;return Pt(t.use===null),t.use=e,this};fe.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};fe.prototype.def=function(e){let t=this._baseState;return Pt(t.default===null),t.default=e,t.optional=!0,this};fe.prototype.explicit=function(e){let t=this._baseState;return Pt(t.explicit===null&&t.implicit===null),t.explicit=e,this};fe.prototype.implicit=function(e){let t=this._baseState;return Pt(t.explicit===null&&t.implicit===null),t.implicit=e,this};fe.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this};fe.prototype.key=function(e){let t=this._baseState;return Pt(t.key===null),t.key=e,this};fe.prototype.any=function(){let e=this._baseState;return e.any=!0,this};fe.prototype.choice=function(e){let t=this._baseState;return Pt(t.choice===null),t.choice=e,this._useArgs(Object.keys(e).map(function(n){return e[n]})),this};fe.prototype.contains=function(e){let t=this._baseState;return Pt(t.use===null),t.contains=e,this};fe.prototype._decode=function(e,t){let n=this._baseState;if(n.parent===null)return e.wrapResult(n.children[0]._decode(e,t));let i=n.default,s=!0,o=null;if(n.key!==null&&(o=e.enterKey(n.key)),n.optional){let c=null;if(n.explicit!==null?c=n.explicit:n.implicit!==null?c=n.implicit:n.tag!==null&&(c=n.tag),c===null&&!n.any){let u=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),s=!0}catch{s=!1}e.restore(u)}else if(s=this._peekTag(e,c,n.any),e.isError(s))return s}let a;if(n.obj&&s&&(a=e.enterObject()),s){if(n.explicit!==null){let u=this._decodeTag(e,n.explicit);if(e.isError(u))return u;e=u}let c=e.offset;if(n.use===null&&n.choice===null){let u;n.any&&(u=e.save());let p=this._decodeTag(e,n.implicit!==null?n.implicit:n.tag,n.any);if(e.isError(p))return p;n.any?i=e.raw(u):e=p}if(t&&t.track&&n.tag!==null&&t.track(e.path(),c,e.length,"tagged"),t&&t.track&&n.tag!==null&&t.track(e.path(),e.offset,e.length,"content"),n.any||(n.choice===null?i=this._decodeGeneric(n.tag,e,t):i=this._decodeChoice(e,t)),e.isError(i))return i;if(!n.any&&n.choice===null&&n.children!==null&&n.children.forEach(function(p){p._decode(e,t)}),n.contains&&(n.tag==="octstr"||n.tag==="bitstr")){let u=new XB(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(u,t)}}return n.obj&&s&&(i=e.leaveObject(a)),n.key!==null&&(i!==null||s===!0)?e.leaveKey(o,n.key,i):o!==null&&e.exitKey(o),i};fe.prototype._decodeGeneric=function(e,t,n){let i=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(t,e,i.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):e==="objid"&&i.args?this._decodeObjid(t,i.args[0],i.args[1],n):e==="objid"?this._decodeObjid(t,null,null,n):e==="gentime"||e==="utctime"?this._decodeTime(t,e,n):e==="null_"?this._decodeNull(t,n):e==="bool"?this._decodeBool(t,n):e==="objDesc"?this._decodeStr(t,e,n):e==="int"||e==="enum"?this._decodeInt(t,i.args&&i.args[0],n):i.use!==null?this._getUse(i.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)};fe.prototype._getUse=function(e,t){let n=this._baseState;return n.useDecoder=this._use(e,t),Pt(n.useDecoder._baseState.parent===null),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder};fe.prototype._decodeChoice=function(e,t){let n=this._baseState,i=null,s=!1;return Object.keys(n.choice).some(function(o){let a=e.save(),c=n.choice[o];try{let u=c._decode(e,t);if(e.isError(u))return!1;i={type:o,value:u},s=!0}catch{return e.restore(a),!1}return!0},this),s?i:e.error("Choice not matched")};fe.prototype._createEncoderBuffer=function(e){return new YB(e,this.reporter)};fe.prototype._encode=function(e,t,n){let i=this._baseState;if(i.default!==null&&i.default===e)return;let s=this._encodeValue(e,t,n);if(s!==void 0&&!this._skipDefault(s,t,n))return s};fe.prototype._encodeValue=function(e,t,n){let i=this._baseState;if(i.parent===null)return i.children[0]._encode(e,t||new VB);let s=null;if(this.reporter=t,i.optional&&e===void 0)if(i.default!==null)e=i.default;else return;let o=null,a=!1;if(i.any)s=this._createEncoderBuffer(e);else if(i.choice)s=this._encodeChoice(e,t);else if(i.contains)o=this._getUse(i.contains,n)._encode(e,t),a=!0;else if(i.children)o=i.children.map(function(c){if(c._baseState.tag==="null_")return c._encode(null,t,e);if(c._baseState.key===null)return t.error("Child should have a key");let u=t.enterKey(c._baseState.key);if(typeof e!="object")return t.error("Child expected, but input is not object");let p=c._encode(e[c._baseState.key],t,e);return t.leaveKey(u),p},this).filter(function(c){return c}),o=this._createEncoderBuffer(o);else if(i.tag==="seqof"||i.tag==="setof"){if(!(i.args&&i.args.length===1))return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");let c=this.clone();c._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(u){let p=this._baseState;return this._getUse(p.args[0],e)._encode(u,t)},c))}else i.use!==null?s=this._getUse(i.use,n)._encode(e,t):(o=this._encodePrimitive(i.tag,e),a=!0);if(!i.any&&i.choice===null){let c=i.implicit!==null?i.implicit:i.tag,u=i.implicit===null?"universal":"context";c===null?i.use===null&&t.error("Tag could be omitted only for .use()"):i.use===null&&(s=this._encodeComposite(c,a,u,o))}return i.explicit!==null&&(s=this._encodeComposite(i.explicit,!1,"context",s)),s};fe.prototype._encodeChoice=function(e,t){let n=this._baseState,i=n.choice[e.type];return i||Pt(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),i._encode(e.value,t)};fe.prototype._encodePrimitive=function(e,t){let n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if(e==="objid"&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if(e==="objid")return this._encodeObjid(t,null,null);if(e==="gentime"||e==="utctime")return this._encodeTime(t,e);if(e==="null_")return this._encodeNull();if(e==="int"||e==="enum")return this._encodeInt(t,n.args&&n.reverseArgs[0]);if(e==="bool")return this._encodeBool(t);if(e==="objDesc")return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)};fe.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};fe.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var Ul=O(gi=>{"use strict";function cE(r){let e={};return Object.keys(r).forEach(function(t){(t|0)==t&&(t=t|0);let n=r[t];e[n]=t}),e}gi.tagClass={0:"universal",1:"application",2:"context",3:"private"};gi.tagClassByName=cE(gi.tagClass);gi.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"};gi.tagByName=cE(gi.tag)});var Dh=O((xG,pE)=>{"use strict";var ej=Wn(),yn=Fl().Buffer,lE=ql(),Lh=Ul();function uE(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new Rr,this.tree._init(r.body)}pE.exports=uE;uE.prototype.encode=function(e,t){return this.tree._encode(e,t).join()};function Rr(r){lE.call(this,"der",r)}ej(Rr,lE);Rr.prototype._encodeComposite=function(e,t,n,i){let s=tj(e,t,n,this.reporter);if(i.length<128){let c=yn.alloc(2);return c[0]=s,c[1]=i.length,this._createEncoderBuffer([c,i])}let o=1;for(let c=i.length;c>=256;c>>=8)o++;let a=yn.alloc(2+o);a[0]=s,a[1]=128|o;for(let c=1+o,u=i.length;u>0;c--,u>>=8)a[c]=u&255;return this._createEncoderBuffer([a,i])};Rr.prototype._encodeStr=function(e,t){if(t==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(t==="bmpstr"){let n=yn.alloc(e.length*2);for(let i=0;i<e.length;i++)n.writeUInt16BE(e.charCodeAt(i),i*2);return this._createEncoderBuffer(n)}else return t==="numstr"?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):t==="printstr"?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):t==="objDesc"?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")};Rr.prototype._encodeObjid=function(e,t,n){if(typeof e=="string"){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s.]+/g);for(let a=0;a<e.length;a++)e[a]|=0}else if(Array.isArray(e)){e=e.slice();for(let a=0;a<e.length;a++)e[a]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!n){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}let i=0;for(let a=0;a<e.length;a++){let c=e[a];for(i++;c>=128;c>>=7)i++}let s=yn.alloc(i),o=s.length-1;for(let a=e.length-1;a>=0;a--){let c=e[a];for(s[o--]=c&127;(c>>=7)>0;)s[o--]=128|c&127}return this._createEncoderBuffer(s)};function mr(r){return r<10?"0"+r:r}Rr.prototype._encodeTime=function(e,t){let n,i=new Date(e);return t==="gentime"?n=[mr(i.getUTCFullYear()),mr(i.getUTCMonth()+1),mr(i.getUTCDate()),mr(i.getUTCHours()),mr(i.getUTCMinutes()),mr(i.getUTCSeconds()),"Z"].join(""):t==="utctime"?n=[mr(i.getUTCFullYear()%100),mr(i.getUTCMonth()+1),mr(i.getUTCDate()),mr(i.getUTCHours()),mr(i.getUTCMinutes()),mr(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")};Rr.prototype._encodeNull=function(){return this._createEncoderBuffer("")};Rr.prototype._encodeInt=function(e,t){if(typeof e=="string"){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if(typeof e!="number"&&!yn.isBuffer(e)){let s=e.toArray();!e.sign&&s[0]&128&&s.unshift(0),e=yn.from(s)}if(yn.isBuffer(e)){let s=e.length;e.length===0&&s++;let o=yn.alloc(s);return e.copy(o),e.length===0&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let n=1;for(let s=e;s>=256;s>>=8)n++;let i=new Array(n);for(let s=i.length-1;s>=0;s--)i[s]=e&255,e>>=8;return i[0]&128&&i.unshift(0),this._createEncoderBuffer(yn.from(i))};Rr.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};Rr.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getEncoder("der").tree};Rr.prototype._skipDefault=function(e,t,n){let i=this._baseState,s;if(i.default===null)return!1;let o=e.join();if(i.defaultBuffer===void 0&&(i.defaultBuffer=this._encodeValue(i.default,t,n).join()),o.length!==i.defaultBuffer.length)return!1;for(s=0;s<o.length;s++)if(o[s]!==i.defaultBuffer[s])return!1;return!0};function tj(r,e,t,n){let i;if(r==="seqof"?r="seq":r==="setof"&&(r="set"),Lh.tagByName.hasOwnProperty(r))i=Lh.tagByName[r];else if(typeof r=="number"&&(r|0)===r)i=r;else return n.error("Unknown tag: "+r);return i>=31?n.error("Multi-octet tag encoding unsupported"):(e||(i|=32),i|=Lh.tagClassByName[t||"universal"]<<6,i)}});var dE=O((yG,fE)=>{"use strict";var rj=Wn(),Bh=Dh();function jh(r){Bh.call(this,r),this.enc="pem"}rj(jh,Bh);fE.exports=jh;jh.prototype.encode=function(e,t){let i=Bh.prototype.encode.call(this,e).toString("base64"),s=["-----BEGIN "+t.label+"-----"];for(let o=0;o<i.length;o+=64)s.push(i.slice(o,o+64));return s.push("-----END "+t.label+"-----"),s.join(`
90
+ `)}});var Fh=O(mE=>{"use strict";var hE=mE;hE.der=Dh();hE.pem=dE()});var $h=O((bG,bE)=>{"use strict";var nj=Wn(),ij=Oh(),gE=As().DecoderBuffer,xE=ql(),vE=Ul();function yE(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new Jt,this.tree._init(r.body)}bE.exports=yE;yE.prototype.decode=function(e,t){return gE.isDecoderBuffer(e)||(e=new gE(e,t)),this.tree._decode(e,t)};function Jt(r){xE.call(this,"der",r)}nj(Jt,xE);Jt.prototype._peekTag=function(e,t,n){if(e.isEmpty())return!1;let i=e.save(),s=Hh(e,'Failed to peek tag: "'+t+'"');return e.isError(s)?s:(e.restore(i),s.tag===t||s.tagStr===t||s.tagStr+"of"===t||n)};Jt.prototype._decodeTag=function(e,t,n){let i=Hh(e,'Failed to decode tag of "'+t+'"');if(e.isError(i))return i;let s=_E(e,i.primitive,'Failed to get length of "'+t+'"');if(e.isError(s))return s;if(!n&&i.tag!==t&&i.tagStr!==t&&i.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(i.primitive||s!==null)return e.skip(s,'Failed to match body of: "'+t+'"');let o=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(s=e.offset-o.offset,e.restore(o),e.skip(s,'Failed to match body of: "'+t+'"'))};Jt.prototype._skipUntilEnd=function(e,t){for(;;){let n=Hh(e,t);if(e.isError(n))return n;let i=_E(e,n.primitive,t);if(e.isError(i))return i;let s;if(n.primitive||i!==null?s=e.skip(i):s=this._skipUntilEnd(e,t),e.isError(s))return s;if(n.tagStr==="end")break}};Jt.prototype._decodeList=function(e,t,n,i){let s=[];for(;!e.isEmpty();){let o=this._peekTag(e,"end");if(e.isError(o))return o;let a=n.decode(e,"der",i);if(e.isError(a)&&o)break;s.push(a)}return s};Jt.prototype._decodeStr=function(e,t){if(t==="bitstr"){let n=e.readUInt8();return e.isError(n)?n:{unused:n,data:e.raw()}}else if(t==="bmpstr"){let n=e.raw();if(n.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");let i="";for(let s=0;s<n.length/2;s++)i+=String.fromCharCode(n.readUInt16BE(s*2));return i}else if(t==="numstr"){let n=e.raw().toString("ascii");return this._isNumstr(n)?n:e.error("Decoding of string type: numstr unsupported characters")}else{if(t==="octstr")return e.raw();if(t==="objDesc")return e.raw();if(t==="printstr"){let n=e.raw().toString("ascii");return this._isPrintstr(n)?n:e.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")}};Jt.prototype._decodeObjid=function(e,t,n){let i,s=[],o=0,a=0;for(;!e.isEmpty();)a=e.readUInt8(),o<<=7,o|=a&127,(a&128)===0&&(s.push(o),o=0);a&128&&s.push(o);let c=s[0]/40|0,u=s[0]%40;if(n?i=s:i=[c,u].concat(s.slice(1)),t){let p=t[i.join(" ")];p===void 0&&(p=t[i.join(".")]),p!==void 0&&(i=p)}return i};Jt.prototype._decodeTime=function(e,t){let n=e.raw().toString(),i,s,o,a,c,u;if(t==="gentime")i=n.slice(0,4)|0,s=n.slice(4,6)|0,o=n.slice(6,8)|0,a=n.slice(8,10)|0,c=n.slice(10,12)|0,u=n.slice(12,14)|0;else if(t==="utctime")i=n.slice(0,2)|0,s=n.slice(2,4)|0,o=n.slice(4,6)|0,a=n.slice(6,8)|0,c=n.slice(8,10)|0,u=n.slice(10,12)|0,i<70?i=2e3+i:i=1900+i;else return e.error("Decoding "+t+" time is not supported yet");return Date.UTC(i,s-1,o,a,c,u,0)};Jt.prototype._decodeNull=function(){return null};Jt.prototype._decodeBool=function(e){let t=e.readUInt8();return e.isError(t)?t:t!==0};Jt.prototype._decodeInt=function(e,t){let n=e.raw(),i=new ij(n);return t&&(i=t[i.toString(10)]||i),i};Jt.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getDecoder("der").tree};function Hh(r,e){let t=r.readUInt8(e);if(r.isError(t))return t;let n=vE.tagClass[t>>6],i=(t&32)===0;if((t&31)===31){let o=t;for(t=0;(o&128)===128;){if(o=r.readUInt8(e),r.isError(o))return o;t<<=7,t|=o&127}}else t&=31;let s=vE.tag[t];return{cls:n,primitive:i,tag:t,tagStr:s}}function _E(r,e,t){let n=r.readUInt8(t);if(r.isError(n))return n;if(!e&&n===128)return null;if((n&128)===0)return n;let i=n&127;if(i>4)return r.error("length octect is too long");n=0;for(let s=0;s<i;s++){n<<=8;let o=r.readUInt8(t);if(r.isError(o))return o;n|=o}return n}});var SE=O((wG,wE)=>{"use strict";var sj=Wn(),oj=Fl().Buffer,qh=$h();function Uh(r){qh.call(this,r),this.enc="pem"}sj(Uh,qh);wE.exports=Uh;Uh.prototype.decode=function(e,t){let n=e.toString().split(/[\r\n]+/g),i=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,a=-1;for(let p=0;p<n.length;p++){let f=n[p].match(s);if(f!==null&&f[2]===i)if(o===-1){if(f[1]!=="BEGIN")break;o=p}else{if(f[1]!=="END")break;a=p;break}}if(o===-1||a===-1)throw new Error("PEM section not found for: "+i);let c=n.slice(o+1,a).join("");c.replace(/[^a-z0-9+/=]+/gi,"");let u=oj.from(c,"base64");return qh.prototype.decode.call(this,u,t)}});var Wh=O(TE=>{"use strict";var EE=TE;EE.der=$h();EE.pem=SE()});var AE=O(CE=>{"use strict";var aj=Fh(),cj=Wh(),lj=Wn(),uj=CE;uj.define=function(e,t){return new Rs(e,t)};function Rs(r,e){this.name=r,this.body=e,this.decoders={},this.encoders={}}Rs.prototype._createNamed=function(e){let t=this.name;function n(i){this._initNamed(i,t)}return lj(n,e),n.prototype._initNamed=function(s,o){e.call(this,s,o)},new n(this)};Rs.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(cj[e])),this.decoders[e]};Rs.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)};Rs.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(aj[e])),this.encoders[e]};Rs.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}});var kE=O(RE=>{"use strict";var Wl=RE;Wl.Reporter=Hl().Reporter;Wl.DecoderBuffer=As().DecoderBuffer;Wl.EncoderBuffer=As().EncoderBuffer;Wl.Node=ql()});var ME=O(PE=>{"use strict";var OE=PE;OE._reverse=function(e){let t={};return Object.keys(e).forEach(function(n){(n|0)==n&&(n=n|0);let i=e[n];t[i]=n}),t};OE.der=Ul()});var NE=O(IE=>{"use strict";var ks=IE;ks.bignum=Oh();ks.define=AE().define;ks.base=kE();ks.constants=ME();ks.decoders=Wh();ks.encoders=Fh()});var Os=O((Gh,DE)=>{var Gl=require("buffer"),qr=Gl.Buffer;function LE(r,e){for(var t in r)e[t]=r[t]}qr.from&&qr.alloc&&qr.allocUnsafe&&qr.allocUnsafeSlow?DE.exports=Gl:(LE(Gl,Gh),Gh.Buffer=vi);function vi(r,e,t){return qr(r,e,t)}vi.prototype=Object.create(qr.prototype);LE(qr,vi);vi.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return qr(r,e,t)};vi.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=qr(r);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n};vi.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return qr(r)};vi.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Gl.SlowBuffer(r)}});var zh=O((RG,BE)=>{var zl=Os().Buffer,pj=require("stream"),fj=require("util");function Kl(r){if(this.buffer=null,this.writable=!0,this.readable=!0,!r)return this.buffer=zl.alloc(0),this;if(typeof r.pipe=="function")return this.buffer=zl.alloc(0),r.pipe(this),this;if(r.length||typeof r=="object")return this.buffer=r,this.writable=!1,process.nextTick(function(){this.emit("end",r),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof r+")")}fj.inherits(Kl,pj);Kl.prototype.write=function(e){this.buffer=zl.concat([this.buffer,zl.from(e)]),this.emit("data",e)};Kl.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};BE.exports=Kl});var FE=O((kG,jE)=>{"use strict";function Kh(r){var e=(r/8|0)+(r%8===0?0:1);return e}var dj={ES256:Kh(256),ES384:Kh(384),ES512:Kh(521)};function hj(r){var e=dj[r];if(e)return e;throw new Error('Unknown algorithm "'+r+'"')}jE.exports=hj});var zE=O((OG,GE)=>{"use strict";var Vl=Os().Buffer,$E=FE(),Yl=128,qE=0,mj=32,gj=16,vj=2,UE=gj|mj|qE<<6,Xl=vj|qE<<6;function xj(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function WE(r){if(Vl.isBuffer(r))return r;if(typeof r=="string")return Vl.from(r,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function yj(r,e){r=WE(r);var t=$E(e),n=t+1,i=r.length,s=0;if(r[s++]!==UE)throw new Error('Could not find expected "seq"');var o=r[s++];if(o===(Yl|1)&&(o=r[s++]),i-s<o)throw new Error('"seq" specified length of "'+o+'", only "'+(i-s)+'" remaining');if(r[s++]!==Xl)throw new Error('Could not find expected "int" for "r"');var a=r[s++];if(i-s-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(i-s-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var c=s;if(s+=a,r[s++]!==Xl)throw new Error('Could not find expected "int" for "s"');var u=r[s++];if(i-s!==u)throw new Error('"s" specified length of "'+u+'", expected "'+(i-s)+'"');if(n<u)throw new Error('"s" specified length of "'+u+'", max of "'+n+'" is acceptable');var p=s;if(s+=u,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var f=t-a,m=t-u,y=Vl.allocUnsafe(f+a+m+u);for(s=0;s<f;++s)y[s]=0;r.copy(y,s,c+Math.max(-f,0),c+a),s=t;for(var _=s;s<_+m;++s)y[s]=0;return r.copy(y,s,p+Math.max(-m,0),p+u),y=y.toString("base64"),y=xj(y),y}function HE(r,e,t){for(var n=0;e+n<t&&r[e+n]===0;)++n;var i=r[e+n]>=Yl;return i&&--n,n}function _j(r,e){r=WE(r);var t=$E(e),n=r.length;if(n!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+n+'"');var i=HE(r,0,t),s=HE(r,t,r.length),o=t-i,a=t-s,c=2+o+1+1+a,u=c<Yl,p=Vl.allocUnsafe((u?2:3)+c),f=0;return p[f++]=UE,u?p[f++]=c:(p[f++]=Yl|1,p[f++]=c&255),p[f++]=Xl,p[f++]=o,i<0?(p[f++]=0,f+=r.copy(p,f,0,t)):f+=r.copy(p,f,i,t),p[f++]=Xl,p[f++]=a,s<0?(p[f++]=0,r.copy(p,f,t)):r.copy(p,f,t+s),p}GE.exports={derToJose:yj,joseToDer:_j}});var VE=O((PG,KE)=>{"use strict";var Uo=require("buffer").Buffer,Vh=require("buffer").SlowBuffer;KE.exports=Jl;function Jl(r,e){if(!Uo.isBuffer(r)||!Uo.isBuffer(e)||r.length!==e.length)return!1;for(var t=0,n=0;n<r.length;n++)t|=r[n]^e[n];return t===0}Jl.install=function(){Uo.prototype.equal=Vh.prototype.equal=function(e){return Jl(this,e)}};var bj=Uo.prototype.equal,wj=Vh.prototype.equal;Jl.restore=function(){Uo.prototype.equal=bj,Vh.prototype.equal=wj}});var Qh=O((MG,n1)=>{var Ms=Os().Buffer,gr=require("crypto"),XE=zE(),YE=require("util"),Sj=`"%s" is not a valid algorithm.
91
91
  Supported algorithms are:
92
- "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Uo="secret must be a string or buffer",Os="key must be a string or a buffer",_j="key must be a string, a buffer or an object",Yh=typeof gr.createPublicKey=="function";Yh&&(Os+=" or a KeyObject",Uo+="or a KeyObject");function VE(r){if(!Ps.isBuffer(r)&&typeof r!="string"&&(!Yh||typeof r!="object"||typeof r.type!="string"||typeof r.asymmetricKeyType!="string"||typeof r.export!="function"))throw kr(Os)}function YE(r){if(!Ps.isBuffer(r)&&typeof r!="string"&&typeof r!="object")throw kr(_j)}function bj(r){if(!Ps.isBuffer(r)){if(typeof r=="string")return r;if(!Yh||typeof r!="object"||r.type!=="secret"||typeof r.export!="function")throw kr(Uo)}}function Xh(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function XE(r){r=r.toString();var e=4-r.length%4;if(e!==4)for(var t=0;t<e;++t)r+="=";return r.replace(/\-/g,"+").replace(/_/g,"/")}function kr(r){var e=[].slice.call(arguments,1),t=zE.format.bind(zE,r).apply(null,e);return new TypeError(t)}function wj(r){return Ps.isBuffer(r)||typeof r=="string"}function Wo(r){return wj(r)||(r=JSON.stringify(r)),r}function JE(r){return function(t,n){bj(n),t=Wo(t);var i=gr.createHmac("sha"+r,n),s=(i.update(t),i.digest("base64"));return Xh(s)}}var Vh,Sj="timingSafeEqual"in gr?function(e,t){return e.byteLength!==t.byteLength?!1:gr.timingSafeEqual(e,t)}:function(e,t){return Vh||(Vh=GE()),Vh(e,t)};function Ej(r){return function(t,n,i){var s=JE(r)(t,i);return Sj(Ps.from(n),Ps.from(s))}}function QE(r){return function(t,n){YE(n),t=Wo(t);var i=gr.createSign("RSA-SHA"+r),s=(i.update(t),i.sign(n,"base64"));return Xh(s)}}function ZE(r){return function(t,n,i){VE(i),t=Wo(t),n=XE(n);var s=gr.createVerify("RSA-SHA"+r);return s.update(t),s.verify(i,n,"base64")}}function Tj(r){return function(t,n){YE(n),t=Wo(t);var i=gr.createSign("RSA-SHA"+r),s=(i.update(t),i.sign({key:n,padding:gr.constants.RSA_PKCS1_PSS_PADDING,saltLength:gr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Xh(s)}}function Cj(r){return function(t,n,i){VE(i),t=Wo(t),n=XE(n);var s=gr.createVerify("RSA-SHA"+r);return s.update(t),s.verify({key:i,padding:gr.constants.RSA_PKCS1_PSS_PADDING,saltLength:gr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function Aj(r){var e=QE(r);return function(){var n=e.apply(null,arguments);return n=KE.derToJose(n,"ES"+r),n}}function Rj(r){var e=ZE(r);return function(n,i,s){i=KE.joseToDer(i,"ES"+r).toString("base64");var o=e(n,i,s);return o}}function kj(){return function(){return""}}function Oj(){return function(e,t){return t===""}}e1.exports=function(e){var t={hs:JE,rs:QE,ps:Tj,es:Aj,none:kj},n={hs:Ej,rs:ZE,ps:Cj,es:Rj,none:Oj},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw kr(yj,e);var s=(i[1]||i[3]).toLowerCase(),o=i[2];return{sign:t[s](o),verify:n[s](o)}}});var Qh=O((kG,t1)=>{var Pj=require("buffer").Buffer;t1.exports=function(e){return typeof e=="string"?e:typeof e=="number"||Pj.isBuffer(e)?e.toString():JSON.stringify(e)}});var a1=O((OG,o1)=>{var Mj=ks().Buffer,r1=Gh(),Ij=Jh(),Nj=require("stream"),n1=Qh(),Zh=require("util");function i1(r,e){return Mj.from(r,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Lj(r,e,t){t=t||"utf8";var n=i1(n1(r),"binary"),i=i1(n1(e),t);return Zh.format("%s.%s",n,i)}function s1(r){var e=r.header,t=r.payload,n=r.secret||r.privateKey,i=r.encoding,s=Ij(e.alg),o=Lj(e,t,i),a=s.sign(o,n);return Zh.format("%s.%s",o,a)}function Ql(r){var e=r.secret;if(e=e??r.privateKey,e=e??r.key,/^hs/i.test(r.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new r1(e);this.readable=!0,this.header=r.header,this.encoding=r.encoding,this.secret=this.privateKey=this.key=t,this.payload=new r1(r.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}Zh.inherits(Ql,Nj);Ql.prototype.sign=function(){try{var e=s1({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(t){this.readable=!1,this.emit("error",t),this.emit("close")}};Ql.sign=s1;o1.exports=Ql});var v1=O((PG,g1)=>{var l1=ks().Buffer,c1=Gh(),Dj=Jh(),Bj=require("stream"),u1=Qh(),jj=require("util"),Fj=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function Hj(r){return Object.prototype.toString.call(r)==="[object Object]"}function $j(r){if(Hj(r))return r;try{return JSON.parse(r)}catch{return}}function p1(r){var e=r.split(".",1)[0];return $j(l1.from(e,"base64").toString("binary"))}function qj(r){return r.split(".",2).join(".")}function f1(r){return r.split(".")[2]}function Uj(r,e){e=e||"utf8";var t=r.split(".")[1];return l1.from(t,"base64").toString(e)}function d1(r){return Fj.test(r)&&!!p1(r)}function h1(r,e,t){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}r=u1(r);var i=f1(r),s=qj(r),o=Dj(e);return o.verify(s,i,t)}function m1(r,e){if(e=e||{},r=u1(r),!d1(r))return null;var t=p1(r);if(!t)return null;var n=Uj(r);return(t.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:t,payload:n,signature:f1(r)}}function Ms(r){r=r||{};var e=r.secret;if(e=e??r.publicKey,e=e??r.key,/^hs/i.test(r.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new c1(e);this.readable=!0,this.algorithm=r.algorithm,this.encoding=r.encoding,this.secret=this.publicKey=this.key=t,this.signature=new c1(r.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}jj.inherits(Ms,Bj);Ms.prototype.verify=function(){try{var e=h1(this.signature.buffer,this.algorithm,this.key.buffer),t=m1(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};Ms.decode=m1;Ms.isValid=d1;Ms.verify=h1;g1.exports=Ms});var y1=O(Wn=>{var x1=a1(),Zl=v1(),Wj=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Wn.ALGORITHMS=Wj;Wn.sign=x1.sign;Wn.verify=Zl.verify;Wn.decode=Zl.decode;Wn.isValid=Zl.isValid;Wn.createSign=function(e){return new x1(e)};Wn.createVerify=function(e){return new Zl(e)}});var eu=O((IG,_1)=>{"use strict";var em={};em.supportedContentEncodings={AES_GCM:"aesgcm",AES_128_GCM:"aes128gcm"};em.supportedUrgency={VERY_LOW:"very-low",LOW:"low",NORMAL:"normal",HIGH:"high"};_1.exports=em});var tm=O((NG,b1)=>{"use strict";function Gj(r){return/^[A-Za-z0-9\-_]+$/.test(r)}b1.exports={validate:Gj}});var nm=O((LG,k1)=>{"use strict";var zj=require("crypto"),Kj=PE(),Vj=y1(),{URL:S1}=require("url"),w1=eu(),E1=tm(),Yj=720*60,Xj=1440*60,Jj=Kj.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).objid().optional(),this.key("publicKey").explicit(1).bitstr().optional())});function Qj(r){return Jj.encode({version:1,privateKey:r,parameters:[1,2,840,10045,3,1,7]},"pem",{label:"EC PRIVATE KEY"})}function Zj(){let r=zj.createECDH("prime256v1");r.generateKeys();let e=r.getPublicKey(),t=r.getPrivateKey();if(t.length<32){let n=Buffer.alloc(32-t.length);n.fill(0),t=Buffer.concat([n,t])}if(e.length<65){let n=Buffer.alloc(65-e.length);n.fill(0),e=Buffer.concat([n,e])}return{publicKey:e.toString("base64url"),privateKey:t.toString("base64url")}}function T1(r){if(!r)throw new Error("No subject set in vapidDetails.subject.");if(typeof r!="string"||r.length===0)throw new Error("The subject value must be a string containing an https: URL or mailto: address. "+r);let e=null;try{e=new S1(r)}catch{throw new Error("Vapid subject is not a valid URL. "+r)}if(!["https:","mailto:"].includes(e.protocol))throw new Error("Vapid subject is not an https: or mailto: URL. "+r);e.hostname==="localhost"&&console.warn("Vapid subject points to a localhost web URI, which is unsupported by Apple's push notification server and will result in a BadJwtToken error when sending notifications.")}function C1(r){if(!r)throw new Error("No key set vapidDetails.publicKey");if(typeof r!="string")throw new Error("Vapid public key is must be a URL safe Base 64 encoded string.");if(!E1.validate(r))throw new Error('Vapid public key must be a URL safe Base 64 (without "=")');if(r=Buffer.from(r,"base64url"),r.length!==65)throw new Error("Vapid public key should be 65 bytes long when decoded.")}function A1(r){if(!r)throw new Error("No key set in vapidDetails.privateKey");if(typeof r!="string")throw new Error("Vapid private key must be a URL safe Base 64 encoded string.");if(!E1.validate(r))throw new Error('Vapid private key must be a URL safe Base 64 (without "=")');if(r=Buffer.from(r,"base64url"),r.length!==32)throw new Error("Vapid private key should be 32 bytes long when decoded.")}function rm(r){let e=new Date;return e.setSeconds(e.getSeconds()+r),Math.floor(e.getTime()/1e3)}function R1(r){if(!Number.isInteger(r))throw new Error("`expiration` value must be a number");if(r<0)throw new Error("`expiration` must be a positive integer");let e=rm(Xj);if(r>=e)throw new Error("`expiration` value is greater than maximum of 24 hours")}function eF(r,e,t,n,i,s){if(!r)throw new Error("No audience could be generated for VAPID.");if(typeof r!="string"||r.length===0)throw new Error("The audience value must be a string containing the origin of a push service. "+r);try{new S1(r)}catch{throw new Error("VAPID audience is not a url. "+r)}T1(e),C1(t),A1(n),n=Buffer.from(n,"base64url"),s?R1(s):s=rm(Yj);let o={typ:"JWT",alg:"ES256"},a={aud:r,exp:s,sub:e},c=Vj.sign({header:o,payload:a,privateKey:Qj(n)});if(i===w1.supportedContentEncodings.AES_128_GCM)return{Authorization:"vapid t="+c+", k="+t};if(i===w1.supportedContentEncodings.AES_GCM)return{Authorization:"WebPush "+c,"Crypto-Key":"p256ecdsa="+t};throw new Error("Unsupported encoding type specified.")}k1.exports={generateVAPIDKeys:Zj,getFutureExpirationTimestamp:rm,getVapidHeaders:eF,validateSubject:T1,validatePublicKey:C1,validatePrivateKey:A1,validateExpiration:R1}});var H1=O((DG,F1)=>{"use strict";var ru=require("crypto"),P1="aes-128-gcm",nu={aes128gcm:1,aesgcm:2},vi=16,Ur=16,tF=12,M1=32,Go="encrypt",zo="decrypt",de;process.env.ECE_KEYLOG==="1"?de=function(r,e){return console.warn(r+" ["+e.length+"]: "+e.toString("base64url")),e}:de=function(r,e){return e};function tu(r){return typeof r=="string"?Buffer.from(r,"base64url"):r}function I1(r,e){var t=ru.createHmac("sha256",r);return t.update(e),t.digest()}function N1(r,e){return de("salt",r),de("ikm",e),de("extract",I1(r,e))}function im(r,e,t){de("prk",r),de("info",e);var n=Buffer.alloc(0),i=Buffer.alloc(0);e=Buffer.from(e,"ascii");for(var s=0,o=Buffer.alloc(1);n.length<t;)o.writeUIntBE(++s,0,1),i=I1(r,Buffer.concat([i,e,o])),n=Buffer.concat([n,i]);return de("expand",n.slice(0,t))}function L1(r,e,t,n){return im(N1(r,e),t,n)}function sm(r,e){var t=Buffer.concat([Buffer.from("Content-Encoding: "+r+"\0","ascii"),e]);return de("info "+r,t),t}function O1(r){var e=Buffer.concat([Buffer.alloc(2),r]);return e.writeUIntBE(r.length,0,2),e}function rF(r,e){var t=r.privateKey,n,i;if(e===Go)n=t.getPublicKey(),i=r.dh;else if(e===zo)n=r.dh,i=t.getPublicKey();else throw new Error("Unknown mode only "+Go+" and "+zo+" supported");return{secret:t.computeSecret(r.dh),context:Buffer.concat([Buffer.from(r.keylabel,"ascii"),Buffer.from([0]),O1(i),O1(n)])}}function nF(r,e){var t={secret:null,context:Buffer.alloc(0)};if(r.key){if(t.secret=r.key,t.secret.length!==Ur)throw new Error("An explicit key must be "+Ur+" bytes")}else r.dh?t=rF(r,e):typeof r.keyid!==void 0&&(t.secret=r.keymap[r.keyid]);if(!t.secret)throw new Error("Unable to determine key");return de("secret",t.secret),de("context",t.context),r.authSecret&&(t.secret=L1(r.authSecret,t.secret,sm("auth",Buffer.alloc(0)),M1),de("authsecret",t.secret)),t}function iF(r,e){if(!r.authSecret)throw new Error("No authentication secret for webpush");de("authsecret",r.authSecret);var t,n,i;if(e===Go)n=r.privateKey.getPublicKey(),t=i=r.dh;else if(e===zo)t=n=r.keyid,i=r.privateKey.getPublicKey();else throw new Error("Unknown mode only "+Go+" and "+zo+" supported");return de("remote pubkey",t),de("sender pubkey",n),de("receiver pubkey",i),de("secret dh",L1(r.authSecret,r.privateKey.computeSecret(t),Buffer.concat([Buffer.from("WebPush: info\0"),i,n]),M1))}function sF(r,e,t){if(t&&!hF(t))throw new Error("Callback is not a function");if(r.key){if(r.key.length!==Ur)throw new Error("An explicit key must be "+Ur+" bytes");return de("secret key",r.key)}if(!r.privateKey){if(t)var n=t(r.keyid);else var n=r.keymap&&r.keymap[r.keyid];if(!n)throw new Error('No saved key (keyid: "'+r.keyid+'")');return n}return iF(r,e)}function D1(r,e,t){if(!r.salt)throw new Error("must include a salt parameter for "+r.version);var n,i,s;if(r.version==="aesgcm"){var o=nF(r,e,t);n=sm("aesgcm",o.context),i=sm("nonce",o.context),s=o.secret}else if(r.version==="aes128gcm")n=Buffer.from("Content-Encoding: aes128gcm\0"),i=Buffer.from("Content-Encoding: nonce\0"),s=sF(r,e,t);else throw new Error("Unable to set context for mode "+r.version);var a=N1(r.salt,s),c={key:im(a,n,Ur),nonce:im(a,i,tF)};return de("key",c.key),de("nonce base",c.nonce),c}function B1(r){var e={};e.version=r.version||"aes128gcm",e.rs=parseInt(r.rs,10),isNaN(e.rs)&&(e.rs=4096);var t=nu[e.version];if(e.version==="aes128gcm"&&(t+=vi),e.rs<=t)throw new Error("The rs parameter has to be greater than "+t);if(r.salt&&(e.salt=tu(r.salt),e.salt.length!==Ur))throw new Error("The salt parameter must be "+Ur+" bytes");return e.keyid=r.keyid,r.key?e.key=tu(r.key):(e.privateKey=r.privateKey,e.privateKey||(e.keymap=r.keymap),e.version!=="aes128gcm"&&(e.keylabel=r.keylabel||"P-256"),r.dh&&(e.dh=tu(r.dh))),r.authSecret&&(e.authSecret=tu(r.authSecret)),e}function j1(r,e){var t=Buffer.from(r),n=t.readUIntBE(t.length-6,6),i=((n^e)&16777215)+((n/16777216^e/16777216)&16777215)*16777216;return t.writeUIntBE(i,t.length-6,6),de("nonce"+e,t),t}function oF(r,e){var t=r.readUIntBE(20,1);return e.salt=r.slice(0,Ur),e.rs=r.readUIntBE(Ur,4),e.keyid=r.slice(21,21+t),21+t}function aF(r,e){var t=nu[e],n=r.readUIntBE(0,t);if(n+t>r.length)throw new Error("padding exceeds block size");de("padding",r.slice(0,t+n));var i=Buffer.alloc(n);if(i.fill(0),i.compare(r.slice(t,t+n))!==0)throw new Error("invalid padding");return r.slice(t+n)}function cF(r,e){for(var t=r.length-1;t>=0;){if(r[t]){if(e){if(r[t]!==2)throw new Error("last record needs to start padding with a 2")}else if(r[t]!==1)throw new Error("last record needs to start padding with a 2");return r.slice(0,t)}--t}throw new Error("all zero plaintext")}function lF(r,e,t,n,i){de("decrypt",t);var s=j1(r.nonce,e),o=ru.createDecipheriv(P1,r.key,s);o.setAuthTag(t.slice(t.length-vi));var a=o.update(t.slice(0,t.length-vi));return a=Buffer.concat([a,o.final()]),de("decrypted",a),n.version!=="aes128gcm"?aF(a,n.version):cF(a,i)}function uF(r,e,t){var n=B1(e);if(n.version==="aes128gcm"){var i=oF(r,n);r=r.slice(i)}var s=D1(n,zo,t),o=0,a=Buffer.alloc(0),c=n.rs;n.version!=="aes128gcm"&&(c+=vi);for(var u=0;o<r.length;++u){var p=o+c;if(n.version!=="aes128gcm"&&p===r.length)throw new Error("Truncated payload");if(p=Math.min(p,r.length),p-o<=vi)throw new Error("Invalid block: too small at "+u);var f=lF(s,u,r.slice(o,p),n,p>=r.length);a=Buffer.concat([a,f]),o=p}return a}function pF(r,e,t,n,i,s){de("encrypt",t),n=n||0;var o=j1(r.nonce,e),a=ru.createCipheriv(P1,r.key,o),c=[],u=nu[i.version],p=Buffer.alloc(n+u);if(p.fill(0),i.version!=="aes128gcm"){if(p.writeUIntBE(n,0,u),de("padding",p),c.push(a.update(p)),c.push(a.update(t)),!s&&p.length+t.length<i.rs)throw new Error("Unable to pad to record size")}else c.push(a.update(t)),p.writeUIntBE(s?2:1,0,1),de("padding",p),c.push(a.update(p));a.final();var f=a.getAuthTag();if(f.length!==vi)throw new Error("invalid tag generated");return c.push(f),de("encrypted",Buffer.concat(c))}function fF(r){var e=Buffer.alloc(5),t=Buffer.from(r.keyid||[]);if(t.length>255)throw new Error("keyid is too large");return e.writeUIntBE(r.rs,0,4),e.writeUIntBE(t.length,4,1),Buffer.concat([r.salt,e,t])}function dF(r,e,t){if(!Buffer.isBuffer(r))throw new Error("buffer argument must be a Buffer");var n=B1(e);n.salt||(n.salt=ru.randomBytes(Ur));var i;n.version==="aes128gcm"?(n.privateKey&&!n.keyid&&(n.keyid=n.privateKey.getPublicKey()),i=fF(n)):i=Buffer.alloc(0);var s=D1(n,Go,t),o=0,a=nu[n.version],c=a;n.version==="aes128gcm"&&(c+=vi);for(var u=isNaN(parseInt(e.pad,10))?0:parseInt(e.pad,10),p=0,f=!1;!f;){var m=Math.min(n.rs-c-1,u);n.version!=="aes128gcm"&&(m=Math.min((1<<a*8)-1,m)),u>0&&m===0&&++m,u-=m;var y=o+n.rs-c-m;n.version!=="aes128gcm"?f=y>r.length:f=y>=r.length,f=f&&u<=0;var _=pF(s,p,r.slice(o,y),m,n,f);i=Buffer.concat([i,_]),o=y,++p}return i}function hF(r){return typeof r=="function"}F1.exports={decrypt:uF,encrypt:dF}});var om=O((BG,q1)=>{"use strict";var $1=require("crypto"),mF=H1(),gF=function(r,e,t,n){if(!r)throw new Error("No user public key provided for encryption.");if(typeof r!="string")throw new Error("The subscription p256dh value must be a string.");if(Buffer.from(r,"base64url").length!==65)throw new Error("The subscription p256dh value should be 65 bytes long.");if(!e)throw new Error("No user auth provided for encryption.");if(typeof e!="string")throw new Error("The subscription auth key must be a string.");if(Buffer.from(e,"base64url").length<16)throw new Error("The subscription auth key should be at least 16 bytes long");if(typeof t!="string"&&!Buffer.isBuffer(t))throw new Error("Payload must be either a string or a Node Buffer.");(typeof t=="string"||t instanceof String)&&(t=Buffer.from(t));let i=$1.createECDH("prime256v1"),s=i.generateKeys(),o=$1.randomBytes(16).toString("base64url"),a=mF.encrypt(t,{version:n,dh:r,privateKey:i,salt:o,authSecret:e});return{localPublicKey:s,salt:o,cipherText:a}};q1.exports={encrypt:gF}});var am=O((jG,W1)=>{"use strict";function U1(r,e,t,n,i){Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=r,this.statusCode=e,this.headers=t,this.body=n,this.endpoint=i}require("util").inherits(U1,Error);W1.exports=U1});var K1=O(Ft=>{"use strict";var vF=Ft&&Ft.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),xF=Ft&&Ft.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),G1=Ft&&Ft.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&vF(e,r,t);return xF(e,r),e};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.req=Ft.json=Ft.toBuffer=void 0;var yF=G1(require("http")),_F=G1(require("https"));async function z1(r){let e=0,t=[];for await(let n of r)e+=n.length,t.push(n);return Buffer.concat(t,e)}Ft.toBuffer=z1;async function bF(r){let t=(await z1(r)).toString("utf8");try{return JSON.parse(t)}catch(n){let i=n;throw i.message+=` (input: ${t})`,i}}Ft.json=bF;function wF(r,e={}){let n=((typeof r=="string"?r:r.href).startsWith("https:")?_F:yF).request(r,e),i=new Promise((s,o)=>{n.once("response",s).once("error",o).end()});return n.then=i.then.bind(i),n}Ft.req=wF});var J1=O(Qt=>{"use strict";var Y1=Qt&&Qt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),SF=Qt&&Qt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),X1=Qt&&Qt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Y1(e,r,t);return SF(e,r),e},EF=Qt&&Qt.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Y1(e,r,t)};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.Agent=void 0;var TF=X1(require("net")),V1=X1(require("http")),CF=require("https");EF(K1(),Qt);var Wr=Symbol("AgentBaseInternalState"),cm=class extends V1.Agent{constructor(e){super(e),this[Wr]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
93
- `).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new TF.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let n=this.sockets[e],i=n.indexOf(t);i!==-1&&(n.splice(i,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?CF.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,n){let i={...t,secureEndpoint:this.isSecureEndpoint(t)},s=this.getName(i),o=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,i)).then(a=>{if(this.decrementSockets(s,o),a instanceof V1.Agent)try{return a.addRequest(e,i)}catch(c){return n(c)}this[Wr].currentSocket=a,super.createSocket(e,t,n)},a=>{this.decrementSockets(s,o),n(a)})}createConnection(){let e=this[Wr].currentSocket;if(this[Wr].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Wr].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Wr]&&(this[Wr].defaultPort=e)}get protocol(){return this[Wr].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Wr]&&(this[Wr].protocol=e)}};Qt.Agent=cm});var Q1=O(Is=>{"use strict";var AF=Is&&Is.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Is,"__esModule",{value:!0});Is.parseProxyResponse=void 0;var RF=AF(Ce()),iu=(0,RF.default)("https-proxy-agent:parse-proxy-response");function kF(r){return new Promise((e,t)=>{let n=0,i=[];function s(){let p=r.read();p?u(p):r.once("readable",s)}function o(){r.removeListener("end",a),r.removeListener("error",c),r.removeListener("readable",s)}function a(){o(),iu("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}function c(p){o(),iu("onerror %o",p),t(p)}function u(p){i.push(p),n+=p.length;let f=Buffer.concat(i,n),m=f.indexOf(`\r
92
+ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Wo="secret must be a string or buffer",Ps="key must be a string or a buffer",Ej="key must be a string, a buffer or an object",Xh=typeof gr.createPublicKey=="function";Xh&&(Ps+=" or a KeyObject",Wo+="or a KeyObject");function JE(r){if(!Ms.isBuffer(r)&&typeof r!="string"&&(!Xh||typeof r!="object"||typeof r.type!="string"||typeof r.asymmetricKeyType!="string"||typeof r.export!="function"))throw kr(Ps)}function QE(r){if(!Ms.isBuffer(r)&&typeof r!="string"&&typeof r!="object")throw kr(Ej)}function Tj(r){if(!Ms.isBuffer(r)){if(typeof r=="string")return r;if(!Xh||typeof r!="object"||r.type!=="secret"||typeof r.export!="function")throw kr(Wo)}}function Jh(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function ZE(r){r=r.toString();var e=4-r.length%4;if(e!==4)for(var t=0;t<e;++t)r+="=";return r.replace(/\-/g,"+").replace(/_/g,"/")}function kr(r){var e=[].slice.call(arguments,1),t=YE.format.bind(YE,r).apply(null,e);return new TypeError(t)}function Cj(r){return Ms.isBuffer(r)||typeof r=="string"}function Go(r){return Cj(r)||(r=JSON.stringify(r)),r}function e1(r){return function(t,n){Tj(n),t=Go(t);var i=gr.createHmac("sha"+r,n),s=(i.update(t),i.digest("base64"));return Jh(s)}}var Yh,Aj="timingSafeEqual"in gr?function(e,t){return e.byteLength!==t.byteLength?!1:gr.timingSafeEqual(e,t)}:function(e,t){return Yh||(Yh=VE()),Yh(e,t)};function Rj(r){return function(t,n,i){var s=e1(r)(t,i);return Aj(Ms.from(n),Ms.from(s))}}function t1(r){return function(t,n){QE(n),t=Go(t);var i=gr.createSign("RSA-SHA"+r),s=(i.update(t),i.sign(n,"base64"));return Jh(s)}}function r1(r){return function(t,n,i){JE(i),t=Go(t),n=ZE(n);var s=gr.createVerify("RSA-SHA"+r);return s.update(t),s.verify(i,n,"base64")}}function kj(r){return function(t,n){QE(n),t=Go(t);var i=gr.createSign("RSA-SHA"+r),s=(i.update(t),i.sign({key:n,padding:gr.constants.RSA_PKCS1_PSS_PADDING,saltLength:gr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Jh(s)}}function Oj(r){return function(t,n,i){JE(i),t=Go(t),n=ZE(n);var s=gr.createVerify("RSA-SHA"+r);return s.update(t),s.verify({key:i,padding:gr.constants.RSA_PKCS1_PSS_PADDING,saltLength:gr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function Pj(r){var e=t1(r);return function(){var n=e.apply(null,arguments);return n=XE.derToJose(n,"ES"+r),n}}function Mj(r){var e=r1(r);return function(n,i,s){i=XE.joseToDer(i,"ES"+r).toString("base64");var o=e(n,i,s);return o}}function Ij(){return function(){return""}}function Nj(){return function(e,t){return t===""}}n1.exports=function(e){var t={hs:e1,rs:t1,ps:kj,es:Pj,none:Ij},n={hs:Rj,rs:r1,ps:Oj,es:Mj,none:Nj},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw kr(Sj,e);var s=(i[1]||i[3]).toLowerCase(),o=i[2];return{sign:t[s](o),verify:n[s](o)}}});var Zh=O((IG,i1)=>{var Lj=require("buffer").Buffer;i1.exports=function(e){return typeof e=="string"?e:typeof e=="number"||Lj.isBuffer(e)?e.toString():JSON.stringify(e)}});var u1=O((NG,l1)=>{var Dj=Os().Buffer,s1=zh(),Bj=Qh(),jj=require("stream"),o1=Zh(),em=require("util");function a1(r,e){return Dj.from(r,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Fj(r,e,t){t=t||"utf8";var n=a1(o1(r),"binary"),i=a1(o1(e),t);return em.format("%s.%s",n,i)}function c1(r){var e=r.header,t=r.payload,n=r.secret||r.privateKey,i=r.encoding,s=Bj(e.alg),o=Fj(e,t,i),a=s.sign(o,n);return em.format("%s.%s",o,a)}function Ql(r){var e=r.secret;if(e=e??r.privateKey,e=e??r.key,/^hs/i.test(r.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new s1(e);this.readable=!0,this.header=r.header,this.encoding=r.encoding,this.secret=this.privateKey=this.key=t,this.payload=new s1(r.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}em.inherits(Ql,jj);Ql.prototype.sign=function(){try{var e=c1({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(t){this.readable=!1,this.emit("error",t),this.emit("close")}};Ql.sign=c1;l1.exports=Ql});var _1=O((LG,y1)=>{var f1=Os().Buffer,p1=zh(),Hj=Qh(),$j=require("stream"),d1=Zh(),qj=require("util"),Uj=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function Wj(r){return Object.prototype.toString.call(r)==="[object Object]"}function Gj(r){if(Wj(r))return r;try{return JSON.parse(r)}catch{return}}function h1(r){var e=r.split(".",1)[0];return Gj(f1.from(e,"base64").toString("binary"))}function zj(r){return r.split(".",2).join(".")}function m1(r){return r.split(".")[2]}function Kj(r,e){e=e||"utf8";var t=r.split(".")[1];return f1.from(t,"base64").toString(e)}function g1(r){return Uj.test(r)&&!!h1(r)}function v1(r,e,t){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}r=d1(r);var i=m1(r),s=zj(r),o=Hj(e);return o.verify(s,i,t)}function x1(r,e){if(e=e||{},r=d1(r),!g1(r))return null;var t=h1(r);if(!t)return null;var n=Kj(r);return(t.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:t,payload:n,signature:m1(r)}}function Is(r){r=r||{};var e=r.secret;if(e=e??r.publicKey,e=e??r.key,/^hs/i.test(r.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new p1(e);this.readable=!0,this.algorithm=r.algorithm,this.encoding=r.encoding,this.secret=this.publicKey=this.key=t,this.signature=new p1(r.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}qj.inherits(Is,$j);Is.prototype.verify=function(){try{var e=v1(this.signature.buffer,this.algorithm,this.key.buffer),t=x1(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};Is.decode=x1;Is.isValid=g1;Is.verify=v1;y1.exports=Is});var w1=O(Gn=>{var b1=u1(),Zl=_1(),Vj=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Gn.ALGORITHMS=Vj;Gn.sign=b1.sign;Gn.verify=Zl.verify;Gn.decode=Zl.decode;Gn.isValid=Zl.isValid;Gn.createSign=function(e){return new b1(e)};Gn.createVerify=function(e){return new Zl(e)}});var eu=O((BG,S1)=>{"use strict";var tm={};tm.supportedContentEncodings={AES_GCM:"aesgcm",AES_128_GCM:"aes128gcm"};tm.supportedUrgency={VERY_LOW:"very-low",LOW:"low",NORMAL:"normal",HIGH:"high"};S1.exports=tm});var rm=O((jG,E1)=>{"use strict";function Yj(r){return/^[A-Za-z0-9\-_]+$/.test(r)}E1.exports={validate:Yj}});var im=O((FG,M1)=>{"use strict";var Xj=require("crypto"),Jj=NE(),Qj=w1(),{URL:C1}=require("url"),T1=eu(),A1=rm(),Zj=720*60,eF=1440*60,tF=Jj.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).objid().optional(),this.key("publicKey").explicit(1).bitstr().optional())});function rF(r){return tF.encode({version:1,privateKey:r,parameters:[1,2,840,10045,3,1,7]},"pem",{label:"EC PRIVATE KEY"})}function nF(){let r=Xj.createECDH("prime256v1");r.generateKeys();let e=r.getPublicKey(),t=r.getPrivateKey();if(t.length<32){let n=Buffer.alloc(32-t.length);n.fill(0),t=Buffer.concat([n,t])}if(e.length<65){let n=Buffer.alloc(65-e.length);n.fill(0),e=Buffer.concat([n,e])}return{publicKey:e.toString("base64url"),privateKey:t.toString("base64url")}}function R1(r){if(!r)throw new Error("No subject set in vapidDetails.subject.");if(typeof r!="string"||r.length===0)throw new Error("The subject value must be a string containing an https: URL or mailto: address. "+r);let e=null;try{e=new C1(r)}catch{throw new Error("Vapid subject is not a valid URL. "+r)}if(!["https:","mailto:"].includes(e.protocol))throw new Error("Vapid subject is not an https: or mailto: URL. "+r);e.hostname==="localhost"&&console.warn("Vapid subject points to a localhost web URI, which is unsupported by Apple's push notification server and will result in a BadJwtToken error when sending notifications.")}function k1(r){if(!r)throw new Error("No key set vapidDetails.publicKey");if(typeof r!="string")throw new Error("Vapid public key is must be a URL safe Base 64 encoded string.");if(!A1.validate(r))throw new Error('Vapid public key must be a URL safe Base 64 (without "=")');if(r=Buffer.from(r,"base64url"),r.length!==65)throw new Error("Vapid public key should be 65 bytes long when decoded.")}function O1(r){if(!r)throw new Error("No key set in vapidDetails.privateKey");if(typeof r!="string")throw new Error("Vapid private key must be a URL safe Base 64 encoded string.");if(!A1.validate(r))throw new Error('Vapid private key must be a URL safe Base 64 (without "=")');if(r=Buffer.from(r,"base64url"),r.length!==32)throw new Error("Vapid private key should be 32 bytes long when decoded.")}function nm(r){let e=new Date;return e.setSeconds(e.getSeconds()+r),Math.floor(e.getTime()/1e3)}function P1(r){if(!Number.isInteger(r))throw new Error("`expiration` value must be a number");if(r<0)throw new Error("`expiration` must be a positive integer");let e=nm(eF);if(r>=e)throw new Error("`expiration` value is greater than maximum of 24 hours")}function iF(r,e,t,n,i,s){if(!r)throw new Error("No audience could be generated for VAPID.");if(typeof r!="string"||r.length===0)throw new Error("The audience value must be a string containing the origin of a push service. "+r);try{new C1(r)}catch{throw new Error("VAPID audience is not a url. "+r)}R1(e),k1(t),O1(n),n=Buffer.from(n,"base64url"),s?P1(s):s=nm(Zj);let o={typ:"JWT",alg:"ES256"},a={aud:r,exp:s,sub:e},c=Qj.sign({header:o,payload:a,privateKey:rF(n)});if(i===T1.supportedContentEncodings.AES_128_GCM)return{Authorization:"vapid t="+c+", k="+t};if(i===T1.supportedContentEncodings.AES_GCM)return{Authorization:"WebPush "+c,"Crypto-Key":"p256ecdsa="+t};throw new Error("Unsupported encoding type specified.")}M1.exports={generateVAPIDKeys:nF,getFutureExpirationTimestamp:nm,getVapidHeaders:iF,validateSubject:R1,validatePublicKey:k1,validatePrivateKey:O1,validateExpiration:P1}});var U1=O((HG,q1)=>{"use strict";var ru=require("crypto"),N1="aes-128-gcm",nu={aes128gcm:1,aesgcm:2},xi=16,Ur=16,sF=12,L1=32,zo="encrypt",Ko="decrypt",de;process.env.ECE_KEYLOG==="1"?de=function(r,e){return console.warn(r+" ["+e.length+"]: "+e.toString("base64url")),e}:de=function(r,e){return e};function tu(r){return typeof r=="string"?Buffer.from(r,"base64url"):r}function D1(r,e){var t=ru.createHmac("sha256",r);return t.update(e),t.digest()}function B1(r,e){return de("salt",r),de("ikm",e),de("extract",D1(r,e))}function sm(r,e,t){de("prk",r),de("info",e);var n=Buffer.alloc(0),i=Buffer.alloc(0);e=Buffer.from(e,"ascii");for(var s=0,o=Buffer.alloc(1);n.length<t;)o.writeUIntBE(++s,0,1),i=D1(r,Buffer.concat([i,e,o])),n=Buffer.concat([n,i]);return de("expand",n.slice(0,t))}function j1(r,e,t,n){return sm(B1(r,e),t,n)}function om(r,e){var t=Buffer.concat([Buffer.from("Content-Encoding: "+r+"\0","ascii"),e]);return de("info "+r,t),t}function I1(r){var e=Buffer.concat([Buffer.alloc(2),r]);return e.writeUIntBE(r.length,0,2),e}function oF(r,e){var t=r.privateKey,n,i;if(e===zo)n=t.getPublicKey(),i=r.dh;else if(e===Ko)n=r.dh,i=t.getPublicKey();else throw new Error("Unknown mode only "+zo+" and "+Ko+" supported");return{secret:t.computeSecret(r.dh),context:Buffer.concat([Buffer.from(r.keylabel,"ascii"),Buffer.from([0]),I1(i),I1(n)])}}function aF(r,e){var t={secret:null,context:Buffer.alloc(0)};if(r.key){if(t.secret=r.key,t.secret.length!==Ur)throw new Error("An explicit key must be "+Ur+" bytes")}else r.dh?t=oF(r,e):typeof r.keyid!==void 0&&(t.secret=r.keymap[r.keyid]);if(!t.secret)throw new Error("Unable to determine key");return de("secret",t.secret),de("context",t.context),r.authSecret&&(t.secret=j1(r.authSecret,t.secret,om("auth",Buffer.alloc(0)),L1),de("authsecret",t.secret)),t}function cF(r,e){if(!r.authSecret)throw new Error("No authentication secret for webpush");de("authsecret",r.authSecret);var t,n,i;if(e===zo)n=r.privateKey.getPublicKey(),t=i=r.dh;else if(e===Ko)t=n=r.keyid,i=r.privateKey.getPublicKey();else throw new Error("Unknown mode only "+zo+" and "+Ko+" supported");return de("remote pubkey",t),de("sender pubkey",n),de("receiver pubkey",i),de("secret dh",j1(r.authSecret,r.privateKey.computeSecret(t),Buffer.concat([Buffer.from("WebPush: info\0"),i,n]),L1))}function lF(r,e,t){if(t&&!xF(t))throw new Error("Callback is not a function");if(r.key){if(r.key.length!==Ur)throw new Error("An explicit key must be "+Ur+" bytes");return de("secret key",r.key)}if(!r.privateKey){if(t)var n=t(r.keyid);else var n=r.keymap&&r.keymap[r.keyid];if(!n)throw new Error('No saved key (keyid: "'+r.keyid+'")');return n}return cF(r,e)}function F1(r,e,t){if(!r.salt)throw new Error("must include a salt parameter for "+r.version);var n,i,s;if(r.version==="aesgcm"){var o=aF(r,e,t);n=om("aesgcm",o.context),i=om("nonce",o.context),s=o.secret}else if(r.version==="aes128gcm")n=Buffer.from("Content-Encoding: aes128gcm\0"),i=Buffer.from("Content-Encoding: nonce\0"),s=lF(r,e,t);else throw new Error("Unable to set context for mode "+r.version);var a=B1(r.salt,s),c={key:sm(a,n,Ur),nonce:sm(a,i,sF)};return de("key",c.key),de("nonce base",c.nonce),c}function H1(r){var e={};e.version=r.version||"aes128gcm",e.rs=parseInt(r.rs,10),isNaN(e.rs)&&(e.rs=4096);var t=nu[e.version];if(e.version==="aes128gcm"&&(t+=xi),e.rs<=t)throw new Error("The rs parameter has to be greater than "+t);if(r.salt&&(e.salt=tu(r.salt),e.salt.length!==Ur))throw new Error("The salt parameter must be "+Ur+" bytes");return e.keyid=r.keyid,r.key?e.key=tu(r.key):(e.privateKey=r.privateKey,e.privateKey||(e.keymap=r.keymap),e.version!=="aes128gcm"&&(e.keylabel=r.keylabel||"P-256"),r.dh&&(e.dh=tu(r.dh))),r.authSecret&&(e.authSecret=tu(r.authSecret)),e}function $1(r,e){var t=Buffer.from(r),n=t.readUIntBE(t.length-6,6),i=((n^e)&16777215)+((n/16777216^e/16777216)&16777215)*16777216;return t.writeUIntBE(i,t.length-6,6),de("nonce"+e,t),t}function uF(r,e){var t=r.readUIntBE(20,1);return e.salt=r.slice(0,Ur),e.rs=r.readUIntBE(Ur,4),e.keyid=r.slice(21,21+t),21+t}function pF(r,e){var t=nu[e],n=r.readUIntBE(0,t);if(n+t>r.length)throw new Error("padding exceeds block size");de("padding",r.slice(0,t+n));var i=Buffer.alloc(n);if(i.fill(0),i.compare(r.slice(t,t+n))!==0)throw new Error("invalid padding");return r.slice(t+n)}function fF(r,e){for(var t=r.length-1;t>=0;){if(r[t]){if(e){if(r[t]!==2)throw new Error("last record needs to start padding with a 2")}else if(r[t]!==1)throw new Error("last record needs to start padding with a 2");return r.slice(0,t)}--t}throw new Error("all zero plaintext")}function dF(r,e,t,n,i){de("decrypt",t);var s=$1(r.nonce,e),o=ru.createDecipheriv(N1,r.key,s);o.setAuthTag(t.slice(t.length-xi));var a=o.update(t.slice(0,t.length-xi));return a=Buffer.concat([a,o.final()]),de("decrypted",a),n.version!=="aes128gcm"?pF(a,n.version):fF(a,i)}function hF(r,e,t){var n=H1(e);if(n.version==="aes128gcm"){var i=uF(r,n);r=r.slice(i)}var s=F1(n,Ko,t),o=0,a=Buffer.alloc(0),c=n.rs;n.version!=="aes128gcm"&&(c+=xi);for(var u=0;o<r.length;++u){var p=o+c;if(n.version!=="aes128gcm"&&p===r.length)throw new Error("Truncated payload");if(p=Math.min(p,r.length),p-o<=xi)throw new Error("Invalid block: too small at "+u);var f=dF(s,u,r.slice(o,p),n,p>=r.length);a=Buffer.concat([a,f]),o=p}return a}function mF(r,e,t,n,i,s){de("encrypt",t),n=n||0;var o=$1(r.nonce,e),a=ru.createCipheriv(N1,r.key,o),c=[],u=nu[i.version],p=Buffer.alloc(n+u);if(p.fill(0),i.version!=="aes128gcm"){if(p.writeUIntBE(n,0,u),de("padding",p),c.push(a.update(p)),c.push(a.update(t)),!s&&p.length+t.length<i.rs)throw new Error("Unable to pad to record size")}else c.push(a.update(t)),p.writeUIntBE(s?2:1,0,1),de("padding",p),c.push(a.update(p));a.final();var f=a.getAuthTag();if(f.length!==xi)throw new Error("invalid tag generated");return c.push(f),de("encrypted",Buffer.concat(c))}function gF(r){var e=Buffer.alloc(5),t=Buffer.from(r.keyid||[]);if(t.length>255)throw new Error("keyid is too large");return e.writeUIntBE(r.rs,0,4),e.writeUIntBE(t.length,4,1),Buffer.concat([r.salt,e,t])}function vF(r,e,t){if(!Buffer.isBuffer(r))throw new Error("buffer argument must be a Buffer");var n=H1(e);n.salt||(n.salt=ru.randomBytes(Ur));var i;n.version==="aes128gcm"?(n.privateKey&&!n.keyid&&(n.keyid=n.privateKey.getPublicKey()),i=gF(n)):i=Buffer.alloc(0);var s=F1(n,zo,t),o=0,a=nu[n.version],c=a;n.version==="aes128gcm"&&(c+=xi);for(var u=isNaN(parseInt(e.pad,10))?0:parseInt(e.pad,10),p=0,f=!1;!f;){var m=Math.min(n.rs-c-1,u);n.version!=="aes128gcm"&&(m=Math.min((1<<a*8)-1,m)),u>0&&m===0&&++m,u-=m;var y=o+n.rs-c-m;n.version!=="aes128gcm"?f=y>r.length:f=y>=r.length,f=f&&u<=0;var _=mF(s,p,r.slice(o,y),m,n,f);i=Buffer.concat([i,_]),o=y,++p}return i}function xF(r){return typeof r=="function"}q1.exports={decrypt:hF,encrypt:vF}});var am=O(($G,G1)=>{"use strict";var W1=require("crypto"),yF=U1(),_F=function(r,e,t,n){if(!r)throw new Error("No user public key provided for encryption.");if(typeof r!="string")throw new Error("The subscription p256dh value must be a string.");if(Buffer.from(r,"base64url").length!==65)throw new Error("The subscription p256dh value should be 65 bytes long.");if(!e)throw new Error("No user auth provided for encryption.");if(typeof e!="string")throw new Error("The subscription auth key must be a string.");if(Buffer.from(e,"base64url").length<16)throw new Error("The subscription auth key should be at least 16 bytes long");if(typeof t!="string"&&!Buffer.isBuffer(t))throw new Error("Payload must be either a string or a Node Buffer.");(typeof t=="string"||t instanceof String)&&(t=Buffer.from(t));let i=W1.createECDH("prime256v1"),s=i.generateKeys(),o=W1.randomBytes(16).toString("base64url"),a=yF.encrypt(t,{version:n,dh:r,privateKey:i,salt:o,authSecret:e});return{localPublicKey:s,salt:o,cipherText:a}};G1.exports={encrypt:_F}});var cm=O((qG,K1)=>{"use strict";function z1(r,e,t,n,i){Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=r,this.statusCode=e,this.headers=t,this.body=n,this.endpoint=i}require("util").inherits(z1,Error);K1.exports=z1});var X1=O(Ft=>{"use strict";var bF=Ft&&Ft.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),wF=Ft&&Ft.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),V1=Ft&&Ft.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&bF(e,r,t);return wF(e,r),e};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.req=Ft.json=Ft.toBuffer=void 0;var SF=V1(require("http")),EF=V1(require("https"));async function Y1(r){let e=0,t=[];for await(let n of r)e+=n.length,t.push(n);return Buffer.concat(t,e)}Ft.toBuffer=Y1;async function TF(r){let t=(await Y1(r)).toString("utf8");try{return JSON.parse(t)}catch(n){let i=n;throw i.message+=` (input: ${t})`,i}}Ft.json=TF;function CF(r,e={}){let n=((typeof r=="string"?r:r.href).startsWith("https:")?EF:SF).request(r,e),i=new Promise((s,o)=>{n.once("response",s).once("error",o).end()});return n.then=i.then.bind(i),n}Ft.req=CF});var eT=O(Qt=>{"use strict";var Q1=Qt&&Qt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),AF=Qt&&Qt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Z1=Qt&&Qt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Q1(e,r,t);return AF(e,r),e},RF=Qt&&Qt.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Q1(e,r,t)};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.Agent=void 0;var kF=Z1(require("net")),J1=Z1(require("http")),OF=require("https");RF(X1(),Qt);var Wr=Symbol("AgentBaseInternalState"),lm=class extends J1.Agent{constructor(e){super(e),this[Wr]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
93
+ `).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new kF.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let n=this.sockets[e],i=n.indexOf(t);i!==-1&&(n.splice(i,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?OF.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,n){let i={...t,secureEndpoint:this.isSecureEndpoint(t)},s=this.getName(i),o=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,i)).then(a=>{if(this.decrementSockets(s,o),a instanceof J1.Agent)try{return a.addRequest(e,i)}catch(c){return n(c)}this[Wr].currentSocket=a,super.createSocket(e,t,n)},a=>{this.decrementSockets(s,o),n(a)})}createConnection(){let e=this[Wr].currentSocket;if(this[Wr].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Wr].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Wr]&&(this[Wr].defaultPort=e)}get protocol(){return this[Wr].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Wr]&&(this[Wr].protocol=e)}};Qt.Agent=lm});var tT=O(Ns=>{"use strict";var PF=Ns&&Ns.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ns,"__esModule",{value:!0});Ns.parseProxyResponse=void 0;var MF=PF(Ae()),iu=(0,MF.default)("https-proxy-agent:parse-proxy-response");function IF(r){return new Promise((e,t)=>{let n=0,i=[];function s(){let p=r.read();p?u(p):r.once("readable",s)}function o(){r.removeListener("end",a),r.removeListener("error",c),r.removeListener("readable",s)}function a(){o(),iu("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}function c(p){o(),iu("onerror %o",p),t(p)}function u(p){i.push(p),n+=p.length;let f=Buffer.concat(i,n),m=f.indexOf(`\r
94
94
  \r
95
95
  `);if(m===-1){iu("have not received end of HTTP headers yet..."),s();return}let y=f.slice(0,m).toString("ascii").split(`\r
96
- `),_=y.shift();if(!_)return r.destroy(),t(new Error("No header received from proxy CONNECT response"));let S=_.split(" "),A=+S[1],P=S.slice(2).join(" "),L={};for(let N of y){if(!N)continue;let H=N.indexOf(":");if(H===-1)return r.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${N}"`));let W=N.slice(0,H).toLowerCase(),U=N.slice(H+1).trimStart(),G=L[W];typeof G=="string"?L[W]=[G,U]:Array.isArray(G)?G.push(U):L[W]=U}iu("got proxy server response: %o %o",_,L),o(),e({connect:{statusCode:A,statusText:P,headers:L},buffered:f})}r.on("error",c),r.on("end",a),s()})}Is.parseProxyResponse=kF});var iT=O(vr=>{"use strict";var OF=vr&&vr.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),PF=vr&&vr.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),rT=vr&&vr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&OF(e,r,t);return PF(e,r),e},nT=vr&&vr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(vr,"__esModule",{value:!0});vr.HttpsProxyAgent=void 0;var su=rT(require("net")),Z1=rT(require("tls")),MF=nT(require("assert")),IF=nT(Ce()),NF=J1(),LF=require("url"),DF=Q1(),Ko=(0,IF.default)("https-proxy-agent"),eT=r=>r.servername===void 0&&r.host&&!su.isIP(r.host)?{...r,servername:r.host}:r,ou=class extends NF.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new LF.URL(e):e,this.proxyHeaders=t?.headers??{},Ko("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?tT(t,"headers"):null,host:n,port:i}}async connect(e,t){let{proxy:n}=this;if(!t.host)throw new TypeError('No "host" provided');let i;n.protocol==="https:"?(Ko("Creating `tls.Socket`: %o",this.connectOpts),i=Z1.connect(eT(this.connectOpts))):(Ko("Creating `net.Socket`: %o",this.connectOpts),i=su.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},o=su.isIPv6(t.host)?`[${t.host}]`:t.host,a=`CONNECT ${o}:${t.port} HTTP/1.1\r
96
+ `),_=y.shift();if(!_)return r.destroy(),t(new Error("No header received from proxy CONNECT response"));let S=_.split(" "),A=+S[1],P=S.slice(2).join(" "),L={};for(let N of y){if(!N)continue;let H=N.indexOf(":");if(H===-1)return r.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${N}"`));let W=N.slice(0,H).toLowerCase(),U=N.slice(H+1).trimStart(),G=L[W];typeof G=="string"?L[W]=[G,U]:Array.isArray(G)?G.push(U):L[W]=U}iu("got proxy server response: %o %o",_,L),o(),e({connect:{statusCode:A,statusText:P,headers:L},buffered:f})}r.on("error",c),r.on("end",a),s()})}Ns.parseProxyResponse=IF});var aT=O(vr=>{"use strict";var NF=vr&&vr.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),LF=vr&&vr.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),sT=vr&&vr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&NF(e,r,t);return LF(e,r),e},oT=vr&&vr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(vr,"__esModule",{value:!0});vr.HttpsProxyAgent=void 0;var su=sT(require("net")),rT=sT(require("tls")),DF=oT(require("assert")),BF=oT(Ae()),jF=eT(),FF=require("url"),HF=tT(),Vo=(0,BF.default)("https-proxy-agent"),nT=r=>r.servername===void 0&&r.host&&!su.isIP(r.host)?{...r,servername:r.host}:r,ou=class extends jF.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new FF.URL(e):e,this.proxyHeaders=t?.headers??{},Vo("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?iT(t,"headers"):null,host:n,port:i}}async connect(e,t){let{proxy:n}=this;if(!t.host)throw new TypeError('No "host" provided');let i;n.protocol==="https:"?(Vo("Creating `tls.Socket`: %o",this.connectOpts),i=rT.connect(nT(this.connectOpts))):(Vo("Creating `net.Socket`: %o",this.connectOpts),i=su.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},o=su.isIPv6(t.host)?`[${t.host}]`:t.host,a=`CONNECT ${o}:${t.port} HTTP/1.1\r
97
97
  `;if(n.username||n.password){let m=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(m).toString("base64")}`}s.Host=`${o}:${t.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let m of Object.keys(s))a+=`${m}: ${s[m]}\r
98
- `;let c=(0,DF.parseProxyResponse)(i);i.write(`${a}\r
99
- `);let{connect:u,buffered:p}=await c;if(e.emit("proxyConnect",u),this.emit("proxyConnect",u,e),u.statusCode===200)return e.once("socket",BF),t.secureEndpoint?(Ko("Upgrading socket connection to TLS"),Z1.connect({...tT(eT(t),"host","path","port"),socket:i})):i;i.destroy();let f=new su.Socket({writable:!1});return f.readable=!0,e.once("socket",m=>{Ko("Replaying proxy buffer for failed request"),(0,MF.default)(m.listenerCount("data")>0),m.push(p),m.push(null)}),f}};ou.protocols=["http","https"];vr.HttpsProxyAgent=ou;function BF(r){r.resume()}function tT(r,...e){let t={},n;for(n in r)e.includes(n)||(t[n]=r[n]);return t}});var lT=O((UG,cT)=>{"use strict";var oT=require("url"),aT=require("https"),jF=am(),au=nm(),FF=om(),Zt=eu(),HF=tm(),sT=2419200,lm="",um;function Vo(){}Vo.prototype.setGCMAPIKey=function(r){if(r===null){lm=null;return}if(typeof r>"u"||typeof r!="string"||r.length===0)throw new Error("The GCM API Key should be a non-empty string or null.");lm=r};Vo.prototype.setVapidDetails=function(r,e,t){if(arguments.length===1&&arguments[0]===null){um=null;return}au.validateSubject(r),au.validatePublicKey(e),au.validatePrivateKey(t),um={subject:r,publicKey:e,privateKey:t}};Vo.prototype.generateRequestDetails=function(r,e,t){if(!r||!r.endpoint)throw new Error("You must pass in a subscription with at least an endpoint.");if(typeof r.endpoint!="string"||r.endpoint.length===0)throw new Error("The subscription endpoint must be a string with a valid URL.");if(e&&(typeof r!="object"||!r.keys||!r.keys.p256dh||!r.keys.auth))throw new Error("To send a message with a payload, the subscription must have 'auth' and 'p256dh' keys.");let n=lm,i=um,s=sT,o={},a=Zt.supportedContentEncodings.AES_128_GCM,c=Zt.supportedUrgency.NORMAL,u,p,f,m;if(t){let P=["headers","gcmAPIKey","vapidDetails","TTL","contentEncoding","urgency","topic","proxy","agent","timeout"],L=Object.keys(t);for(let N=0;N<L.length;N+=1){let H=L[N];if(!P.includes(H))throw new Error("'"+H+"' is an invalid option. The valid options are ['"+P.join("', '")+"'].")}if(t.headers){o=t.headers;let N=Object.keys(o).filter(function(H){return typeof t[H]<"u"});if(N.length>0)throw new Error("Duplicated headers defined ["+N.join(",")+"]. Please either define the header in thetop level options OR in the 'headers' key.")}if(t.gcmAPIKey&&(n=t.gcmAPIKey),t.vapidDetails!==void 0&&(i=t.vapidDetails),t.TTL!==void 0&&(s=Number(t.TTL),s<0))throw new Error("TTL should be a number and should be at least 0");if(t.contentEncoding)if(t.contentEncoding===Zt.supportedContentEncodings.AES_128_GCM||t.contentEncoding===Zt.supportedContentEncodings.AES_GCM)a=t.contentEncoding;else throw new Error("Unsupported content encoding specified.");if(t.urgency)if(t.urgency===Zt.supportedUrgency.VERY_LOW||t.urgency===Zt.supportedUrgency.LOW||t.urgency===Zt.supportedUrgency.NORMAL||t.urgency===Zt.supportedUrgency.HIGH)c=t.urgency;else throw new Error("Unsupported urgency specified.");if(t.topic){if(!HF.validate(t.topic))throw new Error("Unsupported characters set use the URL or filename-safe Base64 characters set");if(t.topic.length>32)throw new Error("use maximum of 32 characters from the URL or filename-safe Base64 characters set");u=t.topic}t.proxy&&(typeof t.proxy=="string"||typeof t.proxy.host=="string"?p=t.proxy:console.warn("Attempt to use proxy option, but invalid type it should be a string or proxy options object.")),t.agent&&(t.agent instanceof aT.Agent?(p&&console.warn("Agent option will be ignored because proxy option is defined."),f=t.agent):console.warn("Wrong type for the agent option, it should be an instance of https.Agent.")),typeof t.timeout=="number"&&(m=t.timeout)}typeof s>"u"&&(s=sT);let y={method:"POST",headers:{TTL:s}};Object.keys(o).forEach(function(P){y.headers[P]=o[P]});let _=null;if(e){let P=FF.encrypt(r.keys.p256dh,r.keys.auth,e,a);y.headers["Content-Length"]=P.cipherText.length,y.headers["Content-Type"]="application/octet-stream",a===Zt.supportedContentEncodings.AES_128_GCM?y.headers["Content-Encoding"]=Zt.supportedContentEncodings.AES_128_GCM:a===Zt.supportedContentEncodings.AES_GCM&&(y.headers["Content-Encoding"]=Zt.supportedContentEncodings.AES_GCM,y.headers.Encryption="salt="+P.salt,y.headers["Crypto-Key"]="dh="+P.localPublicKey.toString("base64url")),_=P.cipherText}else y.headers["Content-Length"]=0;let S=r.endpoint.startsWith("https://android.googleapis.com/gcm/send"),A=r.endpoint.startsWith("https://fcm.googleapis.com/fcm/send");if(S)n?y.headers.Authorization="key="+n:console.warn("Attempt to send push notification to GCM endpoint, but no GCM key is defined. Please use setGCMApiKey() or add 'gcmAPIKey' as an option.");else if(i){let P=oT.parse(r.endpoint),L=P.protocol+"//"+P.host,N=au.getVapidHeaders(L,i.subject,i.publicKey,i.privateKey,a);y.headers.Authorization=N.Authorization,a===Zt.supportedContentEncodings.AES_GCM&&(y.headers["Crypto-Key"]?y.headers["Crypto-Key"]+=";"+N["Crypto-Key"]:y.headers["Crypto-Key"]=N["Crypto-Key"])}else A&&n&&(y.headers.Authorization="key="+n);return y.headers.Urgency=c,u&&(y.headers.Topic=u),y.body=_,y.endpoint=r.endpoint,p&&(y.proxy=p),f&&(y.agent=f),m&&(y.timeout=m),y};Vo.prototype.sendNotification=function(r,e,t){let n;try{n=this.generateRequestDetails(r,e,t)}catch(i){return Promise.reject(i)}return new Promise(function(i,s){let o={},a=oT.parse(n.endpoint);if(o.hostname=a.hostname,o.port=a.port,o.path=a.path,o.headers=n.headers,o.method=n.method,n.timeout&&(o.timeout=n.timeout),n.agent&&(o.agent=n.agent),n.proxy){let{HttpsProxyAgent:u}=iT();o.agent=new u(n.proxy)}let c=aT.request(o,function(u){let p="";u.on("data",function(f){p+=f}),u.on("end",function(){u.statusCode<200||u.statusCode>299?s(new jF("Received unexpected response code",u.statusCode,u.headers,p,n.endpoint)):i({statusCode:u.statusCode,body:p,headers:u.headers})})});n.timeout&&c.on("timeout",function(){c.destroy(new Error("Socket timeout"))}),c.on("error",function(u){s(u)}),n.body&&c.write(n.body),c.end()})};cT.exports=Vo});var fT=O((WG,pT)=>{"use strict";var uT=nm(),$F=om(),qF=lT(),UF=am(),WF=eu(),Yo=new qF;pT.exports={WebPushError:UF,supportedContentEncodings:WF.supportedContentEncodings,encrypt:$F.encrypt,getVapidHeaders:uT.getVapidHeaders,generateVAPIDKeys:uT.generateVAPIDKeys,setGCMAPIKey:Yo.setGCMAPIKey,setVapidDetails:Yo.setVapidDetails,generateRequestDetails:Yo.generateRequestDetails,sendNotification:Yo.sendNotification.bind(Yo)}});var ea=O((yz,HT)=>{"use strict";var d3=require("path"),zr="\\\\/",DT=`[^${zr}]`,h3=0,_n="\\.",m3="\\+",g3="\\?",du="\\/",v3="(?=.)",BT="[^/]",dm=`(?:${du}|$)`,jT=`(?:^|${du})`,hm=`${_n}{1,2}${dm}`,x3=`(?!${_n})`,y3=`(?!${jT}${hm})`,_3=`(?!${_n}{0,1}${dm})`,b3=`(?!${hm})`,w3=`[^.${du}]`,S3=`${BT}*?`,FT={DOT_LITERAL:_n,PLUS_LITERAL:m3,QMARK_LITERAL:g3,SLASH_LITERAL:du,ONE_CHAR:v3,QMARK:BT,END_ANCHOR:dm,DOTS_SLASH:hm,NO_DOT:x3,NO_DOTS:y3,NO_DOT_SLASH:_3,NO_DOTS_SLASH:b3,QMARK_NO_DOT:w3,STAR:S3,START_ANCHOR:jT},E3={...FT,SLASH_LITERAL:`[${zr}]`,QMARK:DT,STAR:`${DT}*?`,DOTS_SLASH:`${_n}{1,2}(?:[${zr}]|$)`,NO_DOT:`(?!${_n})`,NO_DOTS:`(?!(?:^|[${zr}])${_n}{1,2}(?:[${zr}]|$))`,NO_DOT_SLASH:`(?!${_n}{0,1}(?:[${zr}]|$))`,NO_DOTS_SLASH:`(?!${_n}{1,2}(?:[${zr}]|$))`,QMARK_NO_DOT:`[^.${zr}]`,START_ANCHOR:`(?:^|[${zr}])`,END_ANCHOR:`(?:[${zr}]|$)`},T3={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};HT.exports={DEFAULT_MAX_EXTGLOB_RECURSION:h3,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:T3,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:d3.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?E3:FT}}});var hu=O($t=>{"use strict";var C3=require("path"),A3=process.platform==="win32",{REGEX_BACKSLASH:R3,REGEX_REMOVE_BACKSLASH:k3,REGEX_SPECIAL_CHARS:O3,REGEX_SPECIAL_CHARS_GLOBAL:P3}=ea();$t.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);$t.hasRegexChars=r=>O3.test(r);$t.isRegexChar=r=>r.length===1&&$t.hasRegexChars(r);$t.escapeRegex=r=>r.replace(P3,"\\$1");$t.toPosixSlashes=r=>r.replace(R3,"/");$t.removeBackslashes=r=>r.replace(k3,e=>e==="\\"?"":e);$t.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};$t.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:A3===!0||C3.sep==="\\";$t.escapeLast=(r,e,t)=>{let n=r.lastIndexOf(e,t);return n===-1?r:r[n-1]==="\\"?$t.escapeLast(r,e,n-1):`${r.slice(0,n)}\\${r.slice(n)}`};$t.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};$t.wrapOutput=(r,e={},t={})=>{let n=t.contains?"":"^",i=t.contains?"":"$",s=`${n}(?:${r})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var VT=O((bz,KT)=>{"use strict";var $T=hu(),{CHAR_ASTERISK:mm,CHAR_AT:M3,CHAR_BACKWARD_SLASH:ta,CHAR_COMMA:I3,CHAR_DOT:gm,CHAR_EXCLAMATION_MARK:vm,CHAR_FORWARD_SLASH:zT,CHAR_LEFT_CURLY_BRACE:xm,CHAR_LEFT_PARENTHESES:ym,CHAR_LEFT_SQUARE_BRACKET:N3,CHAR_PLUS:L3,CHAR_QUESTION_MARK:qT,CHAR_RIGHT_CURLY_BRACE:D3,CHAR_RIGHT_PARENTHESES:UT,CHAR_RIGHT_SQUARE_BRACKET:B3}=ea(),WT=r=>r===zT||r===ta,GT=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},j3=(r,e)=>{let t=e||{},n=r.length-1,i=t.parts===!0||t.scanToEnd===!0,s=[],o=[],a=[],c=r,u=-1,p=0,f=0,m=!1,y=!1,_=!1,S=!1,A=!1,P=!1,L=!1,N=!1,H=!1,W=!1,U=0,G,M,F={value:"",depth:0,isGlob:!1},T=()=>u>=n,l=()=>c.charCodeAt(u+1),h=()=>(G=M,c.charCodeAt(++u));for(;u<n;){M=h();let C;if(M===ta){L=F.backslashes=!0,M=h(),M===xm&&(P=!0);continue}if(P===!0||M===xm){for(U++;T()!==!0&&(M=h());){if(M===ta){L=F.backslashes=!0,h();continue}if(M===xm){U++;continue}if(P!==!0&&M===gm&&(M=h())===gm){if(m=F.isBrace=!0,_=F.isGlob=!0,W=!0,i===!0)continue;break}if(P!==!0&&M===I3){if(m=F.isBrace=!0,_=F.isGlob=!0,W=!0,i===!0)continue;break}if(M===D3&&(U--,U===0)){P=!1,m=F.isBrace=!0,W=!0;break}}if(i===!0)continue;break}if(M===zT){if(s.push(u),o.push(F),F={value:"",depth:0,isGlob:!1},W===!0)continue;if(G===gm&&u===p+1){p+=2;continue}f=u+1;continue}if(t.noext!==!0&&(M===L3||M===M3||M===mm||M===qT||M===vm)===!0&&l()===ym){if(_=F.isGlob=!0,S=F.isExtglob=!0,W=!0,M===vm&&u===p&&(H=!0),i===!0){for(;T()!==!0&&(M=h());){if(M===ta){L=F.backslashes=!0,M=h();continue}if(M===UT){_=F.isGlob=!0,W=!0;break}}continue}break}if(M===mm){if(G===mm&&(A=F.isGlobstar=!0),_=F.isGlob=!0,W=!0,i===!0)continue;break}if(M===qT){if(_=F.isGlob=!0,W=!0,i===!0)continue;break}if(M===N3){for(;T()!==!0&&(C=h());){if(C===ta){L=F.backslashes=!0,h();continue}if(C===B3){y=F.isBracket=!0,_=F.isGlob=!0,W=!0;break}}if(i===!0)continue;break}if(t.nonegate!==!0&&M===vm&&u===p){N=F.negated=!0,p++;continue}if(t.noparen!==!0&&M===ym){if(_=F.isGlob=!0,i===!0){for(;T()!==!0&&(M=h());){if(M===ym){L=F.backslashes=!0,M=h();continue}if(M===UT){W=!0;break}}continue}break}if(_===!0){if(W=!0,i===!0)continue;break}}t.noext===!0&&(S=!1,_=!1);let x=c,w="",g="";p>0&&(w=c.slice(0,p),c=c.slice(p),f-=p),x&&_===!0&&f>0?(x=c.slice(0,f),g=c.slice(f)):_===!0?(x="",g=c):x=c,x&&x!==""&&x!=="/"&&x!==c&&WT(x.charCodeAt(x.length-1))&&(x=x.slice(0,-1)),t.unescape===!0&&(g&&(g=$T.removeBackslashes(g)),x&&L===!0&&(x=$T.removeBackslashes(x)));let v={prefix:w,input:r,start:p,base:x,glob:g,isBrace:m,isBracket:y,isGlob:_,isExtglob:S,isGlobstar:A,negated:N,negatedExtglob:H};if(t.tokens===!0&&(v.maxDepth=0,WT(M)||o.push(F),v.tokens=o),t.parts===!0||t.tokens===!0){let C;for(let b=0;b<s.length;b++){let d=C?C+1:p,E=s[b],q=r.slice(d,E);t.tokens&&(b===0&&p!==0?(o[b].isPrefix=!0,o[b].value=w):o[b].value=q,GT(o[b]),v.maxDepth+=o[b].depth),(b!==0||q!=="")&&a.push(q),C=E}if(C&&C+1<r.length){let b=r.slice(C+1);a.push(b),t.tokens&&(o[o.length-1].value=b,GT(o[o.length-1]),v.maxDepth+=o[o.length-1].depth)}v.slashes=s,v.parts=a}return v};KT.exports=j3});var ZT=O((wz,QT)=>{"use strict";var ra=ea(),Et=hu(),{MAX_LENGTH:mu,POSIX_REGEX_SOURCE:F3,REGEX_NON_SPECIAL_CHARS:H3,REGEX_SPECIAL_CHARS_BACKREF:$3,REPLACEMENTS:YT}=ra,q3=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch{return r.map(i=>Et.escapeRegex(i)).join("..")}return t},Ls=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,XT=r=>{let e=[],t=0,n=0,i=0,s="",o=!1;for(let a of r){if(o===!0){s+=a,o=!1;continue}if(a==="\\"){s+=a,o=!0;continue}if(a==='"'){i=i===1?0:1,s+=a;continue}if(i===0){if(a==="[")t++;else if(a==="]"&&t>0)t--;else if(t===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(s),s="";continue}}}s+=a}return e.push(s),e},U3=r=>{let e=!1;for(let t of r){if(e===!0){e=!1;continue}if(t==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(t))return!1}return!0},JT=r=>{let e=r.trim(),t=!0;for(;t===!0;)t=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),t=!0);if(U3(e))return e.replace(/\\(.)/g,"$1")},W3=r=>{let e=r.map(JT).filter(Boolean);for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let i=e[t],s=e[n],o=i[0];if(!(!o||i!==o.repeat(i.length)||s!==o.repeat(s.length))&&(i===s||i.startsWith(s)||s.startsWith(i)))return!0}return!1},_m=(r,e=!0)=>{if(r[0]!=="+"&&r[0]!=="*"||r[1]!=="(")return;let t=0,n=0,i=0,s=!1;for(let o=1;o<r.length;o++){let a=r[o];if(s===!0){s=!1;continue}if(a==="\\"){s=!0;continue}if(a==='"'){i=i===1?0:1;continue}if(i!==1){if(a==="["){t++;continue}if(a==="]"&&t>0){t--;continue}if(!(t>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&o!==r.length-1?void 0:{type:r[0],body:r.slice(2,o),end:o}}}}},G3=r=>{let e=0,t=[];for(;e<r.length;){let i=_m(r.slice(e),!1);if(!i||i.type!=="*")return;let s=XT(i.body).map(a=>a.trim());if(s.length!==1)return;let o=JT(s[0]);if(!o||o.length!==1)return;t.push(o),e+=i.end+1}return t.length<1?void 0:`${t.length===1?Et.escapeRegex(t[0]):`[${t.map(i=>Et.escapeRegex(i)).join("")}]`}*`},z3=r=>{let e=0,t=r.trim(),n=_m(t);for(;n;)e++,t=n.body.trim(),n=_m(t);return e},K3=(r,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let t=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:ra.DEFAULT_MAX_EXTGLOB_RECURSION,n=XT(r).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||W3(n)))return{risky:!0};for(let i of n){let s=G3(i);if(s)return{risky:!0,safeOutput:s};if(z3(i)>t)return{risky:!0}}return{risky:!1}},bm=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=YT[r]||r;let t={...e},n=typeof t.maxLength=="number"?Math.min(mu,t.maxLength):mu,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:t.prepend||""},o=[s],a=t.capture?"":"?:",c=Et.isWindows(e),u=ra.globChars(c),p=ra.extglobChars(u),{DOT_LITERAL:f,PLUS_LITERAL:m,SLASH_LITERAL:y,ONE_CHAR:_,DOTS_SLASH:S,NO_DOT:A,NO_DOT_SLASH:P,NO_DOTS_SLASH:L,QMARK:N,QMARK_NO_DOT:H,STAR:W,START_ANCHOR:U}=u,G=R=>`(${a}(?:(?!${U}${R.dot?S:f}).)*?)`,M=t.dot?"":A,F=t.dot?N:H,T=t.bash===!0?G(t):W;t.capture&&(T=`(${T})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let l={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};r=Et.removePrefix(r,l),i=r.length;let h=[],x=[],w=[],g=s,v,C=()=>l.index===i-1,b=l.peek=(R=1)=>r[l.index+R],d=l.advance=()=>r[++l.index]||"",E=()=>r.slice(l.index+1),q=(R="",Y=0)=>{l.consumed+=R,l.index+=Y},I=R=>{l.output+=R.output!=null?R.output:R.value,q(R.value)},D=()=>{let R=1;for(;b()==="!"&&(b(2)!=="("||b(3)==="?");)d(),l.start++,R++;return R%2===0?!1:(l.negated=!0,l.start++,!0)},$=R=>{l[R]++,w.push(R)},K=R=>{l[R]--,w.pop()},B=R=>{if(g.type==="globstar"){let Y=l.braces>0&&(R.type==="comma"||R.type==="brace"),k=R.extglob===!0||h.length&&(R.type==="pipe"||R.type==="paren");R.type!=="slash"&&R.type!=="paren"&&!Y&&!k&&(l.output=l.output.slice(0,-g.output.length),g.type="star",g.value="*",g.output=T,l.output+=g.output)}if(h.length&&R.type!=="paren"&&(h[h.length-1].inner+=R.value),(R.value||R.output)&&I(R),g&&g.type==="text"&&R.type==="text"){g.value+=R.value,g.output=(g.output||"")+R.value;return}R.prev=g,o.push(R),g=R},me=(R,Y)=>{let k={...p[Y],conditions:1,inner:""};k.prev=g,k.parens=l.parens,k.output=l.output,k.startIndex=l.index,k.tokensIndex=o.length;let j=(t.capture?"(":"")+k.open;$("parens"),B({type:R,value:Y,output:l.output?"":_}),B({type:"paren",extglob:!0,value:d(),output:j}),h.push(k)},ie=R=>{let Y=r.slice(R.startIndex,l.index+1),k=r.slice(R.startIndex+2,l.index),j=K3(k,t);if((R.type==="plus"||R.type==="star")&&j.risky){let z=j.safeOutput?(R.output?"":_)+(t.capture?`(${j.safeOutput})`:j.safeOutput):void 0,ge=o[R.tokensIndex];ge.type="text",ge.value=Y,ge.output=z||Et.escapeRegex(Y);for(let re=R.tokensIndex+1;re<o.length;re++)o[re].value="",o[re].output="",delete o[re].suffix;l.output=R.output+ge.output,l.backtrack=!0,B({type:"paren",extglob:!0,value:v,output:""}),K("parens");return}let J=R.close+(t.capture?")":""),V;if(R.type==="negate"){let z=T;if(R.inner&&R.inner.length>1&&R.inner.includes("/")&&(z=G(t)),(z!==T||C()||/^\)+$/.test(E()))&&(J=R.close=`)$))${z}`),R.inner.includes("*")&&(V=E())&&/^\.[^\\/.]+$/.test(V)){let ge=bm(V,{...e,fastpaths:!1}).output;J=R.close=`)${ge})${z})`}R.prev.type==="bos"&&(l.negatedExtglob=!0)}B({type:"paren",extglob:!0,value:v,output:J}),K("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let R=!1,Y=r.replace($3,(k,j,J,V,z,ge)=>V==="\\"?(R=!0,k):V==="?"?j?j+V+(z?N.repeat(z.length):""):ge===0?F+(z?N.repeat(z.length):""):N.repeat(J.length):V==="."?f.repeat(J.length):V==="*"?j?j+V+(z?T:""):T:j?k:`\\${k}`);return R===!0&&(t.unescape===!0?Y=Y.replace(/\\/g,""):Y=Y.replace(/\\+/g,k=>k.length%2===0?"\\\\":k?"\\":"")),Y===r&&t.contains===!0?(l.output=r,l):(l.output=Et.wrapOutput(Y,l,e),l)}for(;!C();){if(v=d(),v==="\0")continue;if(v==="\\"){let k=b();if(k==="/"&&t.bash!==!0||k==="."||k===";")continue;if(!k){v+="\\",B({type:"text",value:v});continue}let j=/^\\+/.exec(E()),J=0;if(j&&j[0].length>2&&(J=j[0].length,l.index+=J,J%2!==0&&(v+="\\")),t.unescape===!0?v=d():v+=d(),l.brackets===0){B({type:"text",value:v});continue}}if(l.brackets>0&&(v!=="]"||g.value==="["||g.value==="[^")){if(t.posix!==!1&&v===":"){let k=g.value.slice(1);if(k.includes("[")&&(g.posix=!0,k.includes(":"))){let j=g.value.lastIndexOf("["),J=g.value.slice(0,j),V=g.value.slice(j+2),z=F3[V];if(z){g.value=J+z,l.backtrack=!0,d(),!s.output&&o.indexOf(g)===1&&(s.output=_);continue}}}(v==="["&&b()!==":"||v==="-"&&b()==="]")&&(v=`\\${v}`),v==="]"&&(g.value==="["||g.value==="[^")&&(v=`\\${v}`),t.posix===!0&&v==="!"&&g.value==="["&&(v="^"),g.value+=v,I({value:v});continue}if(l.quotes===1&&v!=='"'){v=Et.escapeRegex(v),g.value+=v,I({value:v});continue}if(v==='"'){l.quotes=l.quotes===1?0:1,t.keepQuotes===!0&&B({type:"text",value:v});continue}if(v==="("){$("parens"),B({type:"paren",value:v});continue}if(v===")"){if(l.parens===0&&t.strictBrackets===!0)throw new SyntaxError(Ls("opening","("));let k=h[h.length-1];if(k&&l.parens===k.parens+1){ie(h.pop());continue}B({type:"paren",value:v,output:l.parens?")":"\\)"}),K("parens");continue}if(v==="["){if(t.nobracket===!0||!E().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(Ls("closing","]"));v=`\\${v}`}else $("brackets");B({type:"bracket",value:v});continue}if(v==="]"){if(t.nobracket===!0||g&&g.type==="bracket"&&g.value.length===1){B({type:"text",value:v,output:`\\${v}`});continue}if(l.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(Ls("opening","["));B({type:"text",value:v,output:`\\${v}`});continue}K("brackets");let k=g.value.slice(1);if(g.posix!==!0&&k[0]==="^"&&!k.includes("/")&&(v=`/${v}`),g.value+=v,I({value:v}),t.literalBrackets===!1||Et.hasRegexChars(k))continue;let j=Et.escapeRegex(g.value);if(l.output=l.output.slice(0,-g.value.length),t.literalBrackets===!0){l.output+=j,g.value=j;continue}g.value=`(${a}${j}|${g.value})`,l.output+=g.value;continue}if(v==="{"&&t.nobrace!==!0){$("braces");let k={type:"brace",value:v,output:"(",outputIndex:l.output.length,tokensIndex:l.tokens.length};x.push(k),B(k);continue}if(v==="}"){let k=x[x.length-1];if(t.nobrace===!0||!k){B({type:"text",value:v,output:v});continue}let j=")";if(k.dots===!0){let J=o.slice(),V=[];for(let z=J.length-1;z>=0&&(o.pop(),J[z].type!=="brace");z--)J[z].type!=="dots"&&V.unshift(J[z].value);j=q3(V,t),l.backtrack=!0}if(k.comma!==!0&&k.dots!==!0){let J=l.output.slice(0,k.outputIndex),V=l.tokens.slice(k.tokensIndex);k.value=k.output="\\{",v=j="\\}",l.output=J;for(let z of V)l.output+=z.output||z.value}B({type:"brace",value:v,output:j}),K("braces"),x.pop();continue}if(v==="|"){h.length>0&&h[h.length-1].conditions++,B({type:"text",value:v});continue}if(v===","){let k=v,j=x[x.length-1];j&&w[w.length-1]==="braces"&&(j.comma=!0,k="|"),B({type:"comma",value:v,output:k});continue}if(v==="/"){if(g.type==="dot"&&l.index===l.start+1){l.start=l.index+1,l.consumed="",l.output="",o.pop(),g=s;continue}B({type:"slash",value:v,output:y});continue}if(v==="."){if(l.braces>0&&g.type==="dot"){g.value==="."&&(g.output=f);let k=x[x.length-1];g.type="dots",g.output+=v,g.value+=v,k.dots=!0;continue}if(l.braces+l.parens===0&&g.type!=="bos"&&g.type!=="slash"){B({type:"text",value:v,output:f});continue}B({type:"dot",value:v,output:f});continue}if(v==="?"){if(!(g&&g.value==="(")&&t.noextglob!==!0&&b()==="("&&b(2)!=="?"){me("qmark",v);continue}if(g&&g.type==="paren"){let j=b(),J=v;if(j==="<"&&!Et.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(g.value==="("&&!/[!=<:]/.test(j)||j==="<"&&!/<([!=]|\w+>)/.test(E()))&&(J=`\\${v}`),B({type:"text",value:v,output:J});continue}if(t.dot!==!0&&(g.type==="slash"||g.type==="bos")){B({type:"qmark",value:v,output:H});continue}B({type:"qmark",value:v,output:N});continue}if(v==="!"){if(t.noextglob!==!0&&b()==="("&&(b(2)!=="?"||!/[!=<:]/.test(b(3)))){me("negate",v);continue}if(t.nonegate!==!0&&l.index===0){D();continue}}if(v==="+"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){me("plus",v);continue}if(g&&g.value==="("||t.regex===!1){B({type:"plus",value:v,output:m});continue}if(g&&(g.type==="bracket"||g.type==="paren"||g.type==="brace")||l.parens>0){B({type:"plus",value:v});continue}B({type:"plus",value:m});continue}if(v==="@"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){B({type:"at",extglob:!0,value:v,output:""});continue}B({type:"text",value:v});continue}if(v!=="*"){(v==="$"||v==="^")&&(v=`\\${v}`);let k=H3.exec(E());k&&(v+=k[0],l.index+=k[0].length),B({type:"text",value:v});continue}if(g&&(g.type==="globstar"||g.star===!0)){g.type="star",g.star=!0,g.value+=v,g.output=T,l.backtrack=!0,l.globstar=!0,q(v);continue}let R=E();if(t.noextglob!==!0&&/^\([^?]/.test(R)){me("star",v);continue}if(g.type==="star"){if(t.noglobstar===!0){q(v);continue}let k=g.prev,j=k.prev,J=k.type==="slash"||k.type==="bos",V=j&&(j.type==="star"||j.type==="globstar");if(t.bash===!0&&(!J||R[0]&&R[0]!=="/")){B({type:"star",value:v,output:""});continue}let z=l.braces>0&&(k.type==="comma"||k.type==="brace"),ge=h.length&&(k.type==="pipe"||k.type==="paren");if(!J&&k.type!=="paren"&&!z&&!ge){B({type:"star",value:v,output:""});continue}for(;R.slice(0,3)==="/**";){let re=r[l.index+4];if(re&&re!=="/")break;R=R.slice(3),q("/**",3)}if(k.type==="bos"&&C()){g.type="globstar",g.value+=v,g.output=G(t),l.output=g.output,l.globstar=!0,q(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&!V&&C()){l.output=l.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=G(t)+(t.strictSlashes?")":"|$)"),g.value+=v,l.globstar=!0,l.output+=k.output+g.output,q(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&R[0]==="/"){let re=R[1]!==void 0?"|$":"";l.output=l.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=`${G(t)}${y}|${y}${re})`,g.value+=v,l.output+=k.output+g.output,l.globstar=!0,q(v+d()),B({type:"slash",value:"/",output:""});continue}if(k.type==="bos"&&R[0]==="/"){g.type="globstar",g.value+=v,g.output=`(?:^|${y}|${G(t)}${y})`,l.output=g.output,l.globstar=!0,q(v+d()),B({type:"slash",value:"/",output:""});continue}l.output=l.output.slice(0,-g.output.length),g.type="globstar",g.output=G(t),g.value+=v,l.output+=g.output,l.globstar=!0,q(v);continue}let Y={type:"star",value:v,output:T};if(t.bash===!0){Y.output=".*?",(g.type==="bos"||g.type==="slash")&&(Y.output=M+Y.output),B(Y);continue}if(g&&(g.type==="bracket"||g.type==="paren")&&t.regex===!0){Y.output=v,B(Y);continue}(l.index===l.start||g.type==="slash"||g.type==="dot")&&(g.type==="dot"?(l.output+=P,g.output+=P):t.dot===!0?(l.output+=L,g.output+=L):(l.output+=M,g.output+=M),b()!=="*"&&(l.output+=_,g.output+=_)),B(Y)}for(;l.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ls("closing","]"));l.output=Et.escapeLast(l.output,"["),K("brackets")}for(;l.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ls("closing",")"));l.output=Et.escapeLast(l.output,"("),K("parens")}for(;l.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ls("closing","}"));l.output=Et.escapeLast(l.output,"{"),K("braces")}if(t.strictSlashes!==!0&&(g.type==="star"||g.type==="bracket")&&B({type:"maybe_slash",value:"",output:`${y}?`}),l.backtrack===!0){l.output="";for(let R of l.tokens)l.output+=R.output!=null?R.output:R.value,R.suffix&&(l.output+=R.suffix)}return l};bm.fastpaths=(r,e)=>{let t={...e},n=typeof t.maxLength=="number"?Math.min(mu,t.maxLength):mu,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);r=YT[r]||r;let s=Et.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:p,NO_DOTS:f,NO_DOTS_SLASH:m,STAR:y,START_ANCHOR:_}=ra.globChars(s),S=t.dot?f:p,A=t.dot?m:p,P=t.capture?"":"?:",L={negated:!1,prefix:""},N=t.bash===!0?".*?":y;t.capture&&(N=`(${N})`);let H=M=>M.noglobstar===!0?N:`(${P}(?:(?!${_}${M.dot?u:o}).)*?)`,W=M=>{switch(M){case"*":return`${S}${c}${N}`;case".*":return`${o}${c}${N}`;case"*.*":return`${S}${N}${o}${c}${N}`;case"*/*":return`${S}${N}${a}${c}${A}${N}`;case"**":return S+H(t);case"**/*":return`(?:${S}${H(t)}${a})?${A}${c}${N}`;case"**/*.*":return`(?:${S}${H(t)}${a})?${A}${N}${o}${c}${N}`;case"**/.*":return`(?:${S}${H(t)}${a})?${o}${c}${N}`;default:{let F=/^(.*?)\.(\w+)$/.exec(M);if(!F)return;let T=W(F[1]);return T?T+o+F[2]:void 0}}},U=Et.removePrefix(r,L),G=W(U);return G&&t.strictSlashes!==!0&&(G+=`${a}?`),G};QT.exports=bm});var tC=O((Sz,eC)=>{"use strict";var V3=require("path"),Y3=VT(),wm=ZT(),Sm=hu(),X3=ea(),J3=r=>r&&typeof r=="object"&&!Array.isArray(r),ke=(r,e,t=!1)=>{if(Array.isArray(r)){let p=r.map(m=>ke(m,e,t));return m=>{for(let y of p){let _=y(m);if(_)return _}return!1}}let n=J3(r)&&r.tokens&&r.input;if(r===""||typeof r!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},s=Sm.isWindows(e),o=n?ke.compileRe(r,e):ke.makeRe(r,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(i.ignore){let p={...e,ignore:null,onMatch:null,onResult:null};c=ke(i.ignore,p,t)}let u=(p,f=!1)=>{let{isMatch:m,match:y,output:_}=ke.test(p,o,e,{glob:r,posix:s}),S={glob:r,state:a,regex:o,posix:s,input:p,output:_,match:y,isMatch:m};return typeof i.onResult=="function"&&i.onResult(S),m===!1?(S.isMatch=!1,f?S:!1):c(p)?(typeof i.onIgnore=="function"&&i.onIgnore(S),S.isMatch=!1,f?S:!1):(typeof i.onMatch=="function"&&i.onMatch(S),f?S:!0)};return t&&(u.state=a),u};ke.test=(r,e,t,{glob:n,posix:i}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};let s=t||{},o=s.format||(i?Sm.toPosixSlashes:null),a=r===n,c=a&&o?o(r):r;return a===!1&&(c=o?o(r):r,a=c===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=ke.matchBase(r,e,t,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};ke.matchBase=(r,e,t,n=Sm.isWindows(t))=>(e instanceof RegExp?e:ke.makeRe(e,t)).test(V3.basename(r));ke.isMatch=(r,e,t)=>ke(e,t)(r);ke.parse=(r,e)=>Array.isArray(r)?r.map(t=>ke.parse(t,e)):wm(r,{...e,fastpaths:!1});ke.scan=(r,e)=>Y3(r,e);ke.compileRe=(r,e,t=!1,n=!1)=>{if(t===!0)return r.output;let i=e||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${r.output})${o}`;r&&r.negated===!0&&(a=`^(?!${a}).*$`);let c=ke.toRegex(a,e);return n===!0&&(c.state=r),c};ke.makeRe=(r,e={},t=!1,n=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(i.output=wm.fastpaths(r,e)),i.output||(i=wm(r,e)),ke.compileRe(i,e,t,n)};ke.toRegex=(r,e)=>{try{let t=e||{};return new RegExp(r,t.flags||(t.nocase?"i":""))}catch(t){if(e&&e.debug===!0)throw t;return/$^/}};ke.constants=X3;eC.exports=ke});var nC=O((Ez,rC)=>{"use strict";rC.exports=tC()});var pC=O((Tz,uC)=>{"use strict";var ia=require("fs"),{Readable:Q3}=require("stream"),na=require("path"),{promisify:yu}=require("util"),Em=nC(),Z3=yu(ia.readdir),eH=yu(ia.stat),iC=yu(ia.lstat),tH=yu(ia.realpath),rH="!",cC="READDIRP_RECURSIVE_ERROR",nH=new Set(["ENOENT","EPERM","EACCES","ELOOP",cC]),Tm="files",lC="directories",vu="files_directories",gu="all",sC=[Tm,lC,vu,gu],iH=r=>nH.has(r.code),[oC,sH]=process.versions.node.split(".").slice(0,2).map(r=>Number.parseInt(r,10)),oH=process.platform==="win32"&&(oC>10||oC===10&&sH>=5),aC=r=>{if(r!==void 0){if(typeof r=="function")return r;if(typeof r=="string"){let e=Em(r.trim());return t=>e(t.basename)}if(Array.isArray(r)){let e=[],t=[];for(let n of r){let i=n.trim();i.charAt(0)===rH?t.push(Em(i.slice(1))):e.push(Em(i))}return t.length>0?e.length>0?n=>e.some(i=>i(n.basename))&&!t.some(i=>i(n.basename)):n=>!t.some(i=>i(n.basename)):n=>e.some(i=>i(n.basename))}}},xu=class r extends Q3{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Tm,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let t={...r.defaultOptions,...e},{root:n,type:i}=t;this._fileFilter=aC(t.fileFilter),this._directoryFilter=aC(t.directoryFilter);let s=t.lstat?iC:eH;oH?this._stat=o=>s(o,{bigint:!0}):this._stat=s,this._maxDepth=t.depth,this._wantsDir=[lC,vu,gu].includes(i),this._wantsFile=[Tm,vu,gu].includes(i),this._wantsEverything=i===gu,this._root=na.resolve(n),this._isDirent="Dirent"in ia&&!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let{path:t,depth:n,files:i=[]}=this.parent||{};if(i.length>0){let s=i.splice(0,e).map(o=>this._formatEntry(o,t));for(let o of await Promise.all(s)){if(this.destroyed)return;let a=await this._getEntryType(o);a==="directory"&&this._directoryFilter(o)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(o.fullPath,n+1)),this._wantsDir&&(this.push(o),e--)):(a==="file"||this._includeAsFile(o))&&this._fileFilter(o)&&this._wantsFile&&(this.push(o),e--)}}else{let s=this.parents.pop();if(!s){this.push(null);break}if(this.parent=await s,this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=!1}}}async _exploreDir(e,t){let n;try{n=await Z3(e,this._rdOptions)}catch(i){this._onError(i)}return{files:n,depth:t,path:e}}async _formatEntry(e,t){let n;try{let i=this._isDirent?e.name:e,s=na.resolve(na.join(t,i));n={path:na.relative(this._root,s),fullPath:s,basename:i},n[this._statsProp]=this._isDirent?e:await this._stat(s)}catch(i){this._onError(i)}return n}_onError(e){iH(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){let t=e&&e[this._statsProp];if(t){if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){let n=e.fullPath;try{let i=await tH(n),s=await iC(i);if(s.isFile())return"file";if(s.isDirectory()){let o=i.length;if(n.startsWith(i)&&n.substr(o,1)===na.sep){let a=new Error(`Circular symlink detected: "${n}" points to "${i}"`);return a.code=cC,this._onError(a)}return"directory"}}catch(i){this._onError(i)}}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}},Ds=(r,e={})=>{let t=e.entryType||e.type;if(t==="both"&&(t=vu),t&&(e.type=t),r){if(typeof r!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(t&&!sC.includes(t))throw new Error(`readdirp: Invalid type passed. Use one of ${sC.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=r,new xu(e)},aH=(r,e={})=>new Promise((t,n)=>{let i=[];Ds(r,e).on("data",s=>i.push(s)).on("end",()=>t(i)).on("error",s=>n(s))});Ds.promise=aH;Ds.ReaddirpStream=xu;Ds.default=Ds;uC.exports=Ds});var sa=O((Cz,gC)=>{"use strict";var cH=require("path"),Kr="\\\\/",fC=`[^${Kr}]`,lH=0,bn="\\.",uH="\\+",pH="\\?",_u="\\/",fH="(?=.)",dC="[^/]",Cm=`(?:${_u}|$)`,hC=`(?:^|${_u})`,Am=`${bn}{1,2}${Cm}`,dH=`(?!${bn})`,hH=`(?!${hC}${Am})`,mH=`(?!${bn}{0,1}${Cm})`,gH=`(?!${Am})`,vH=`[^.${_u}]`,xH=`${dC}*?`,mC={DOT_LITERAL:bn,PLUS_LITERAL:uH,QMARK_LITERAL:pH,SLASH_LITERAL:_u,ONE_CHAR:fH,QMARK:dC,END_ANCHOR:Cm,DOTS_SLASH:Am,NO_DOT:dH,NO_DOTS:hH,NO_DOT_SLASH:mH,NO_DOTS_SLASH:gH,QMARK_NO_DOT:vH,STAR:xH,START_ANCHOR:hC},yH={...mC,SLASH_LITERAL:`[${Kr}]`,QMARK:fC,STAR:`${fC}*?`,DOTS_SLASH:`${bn}{1,2}(?:[${Kr}]|$)`,NO_DOT:`(?!${bn})`,NO_DOTS:`(?!(?:^|[${Kr}])${bn}{1,2}(?:[${Kr}]|$))`,NO_DOT_SLASH:`(?!${bn}{0,1}(?:[${Kr}]|$))`,NO_DOTS_SLASH:`(?!${bn}{1,2}(?:[${Kr}]|$))`,QMARK_NO_DOT:`[^.${Kr}]`,START_ANCHOR:`(?:^|[${Kr}])`,END_ANCHOR:`(?:[${Kr}]|$)`},_H={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};gC.exports={DEFAULT_MAX_EXTGLOB_RECURSION:lH,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:_H,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:cH.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?yH:mC}}});var bu=O(qt=>{"use strict";var bH=require("path"),wH=process.platform==="win32",{REGEX_BACKSLASH:SH,REGEX_REMOVE_BACKSLASH:EH,REGEX_SPECIAL_CHARS:TH,REGEX_SPECIAL_CHARS_GLOBAL:CH}=sa();qt.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);qt.hasRegexChars=r=>TH.test(r);qt.isRegexChar=r=>r.length===1&&qt.hasRegexChars(r);qt.escapeRegex=r=>r.replace(CH,"\\$1");qt.toPosixSlashes=r=>r.replace(SH,"/");qt.removeBackslashes=r=>r.replace(EH,e=>e==="\\"?"":e);qt.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};qt.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:wH===!0||bH.sep==="\\";qt.escapeLast=(r,e,t)=>{let n=r.lastIndexOf(e,t);return n===-1?r:r[n-1]==="\\"?qt.escapeLast(r,e,n-1):`${r.slice(0,n)}\\${r.slice(n)}`};qt.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};qt.wrapOutput=(r,e={},t={})=>{let n=t.contains?"":"^",i=t.contains?"":"$",s=`${n}(?:${r})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var EC=O((Rz,SC)=>{"use strict";var vC=bu(),{CHAR_ASTERISK:Rm,CHAR_AT:AH,CHAR_BACKWARD_SLASH:oa,CHAR_COMMA:RH,CHAR_DOT:km,CHAR_EXCLAMATION_MARK:Om,CHAR_FORWARD_SLASH:wC,CHAR_LEFT_CURLY_BRACE:Pm,CHAR_LEFT_PARENTHESES:Mm,CHAR_LEFT_SQUARE_BRACKET:kH,CHAR_PLUS:OH,CHAR_QUESTION_MARK:xC,CHAR_RIGHT_CURLY_BRACE:PH,CHAR_RIGHT_PARENTHESES:yC,CHAR_RIGHT_SQUARE_BRACKET:MH}=sa(),_C=r=>r===wC||r===oa,bC=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},IH=(r,e)=>{let t=e||{},n=r.length-1,i=t.parts===!0||t.scanToEnd===!0,s=[],o=[],a=[],c=r,u=-1,p=0,f=0,m=!1,y=!1,_=!1,S=!1,A=!1,P=!1,L=!1,N=!1,H=!1,W=!1,U=0,G,M,F={value:"",depth:0,isGlob:!1},T=()=>u>=n,l=()=>c.charCodeAt(u+1),h=()=>(G=M,c.charCodeAt(++u));for(;u<n;){M=h();let C;if(M===oa){L=F.backslashes=!0,M=h(),M===Pm&&(P=!0);continue}if(P===!0||M===Pm){for(U++;T()!==!0&&(M=h());){if(M===oa){L=F.backslashes=!0,h();continue}if(M===Pm){U++;continue}if(P!==!0&&M===km&&(M=h())===km){if(m=F.isBrace=!0,_=F.isGlob=!0,W=!0,i===!0)continue;break}if(P!==!0&&M===RH){if(m=F.isBrace=!0,_=F.isGlob=!0,W=!0,i===!0)continue;break}if(M===PH&&(U--,U===0)){P=!1,m=F.isBrace=!0,W=!0;break}}if(i===!0)continue;break}if(M===wC){if(s.push(u),o.push(F),F={value:"",depth:0,isGlob:!1},W===!0)continue;if(G===km&&u===p+1){p+=2;continue}f=u+1;continue}if(t.noext!==!0&&(M===OH||M===AH||M===Rm||M===xC||M===Om)===!0&&l()===Mm){if(_=F.isGlob=!0,S=F.isExtglob=!0,W=!0,M===Om&&u===p&&(H=!0),i===!0){for(;T()!==!0&&(M=h());){if(M===oa){L=F.backslashes=!0,M=h();continue}if(M===yC){_=F.isGlob=!0,W=!0;break}}continue}break}if(M===Rm){if(G===Rm&&(A=F.isGlobstar=!0),_=F.isGlob=!0,W=!0,i===!0)continue;break}if(M===xC){if(_=F.isGlob=!0,W=!0,i===!0)continue;break}if(M===kH){for(;T()!==!0&&(C=h());){if(C===oa){L=F.backslashes=!0,h();continue}if(C===MH){y=F.isBracket=!0,_=F.isGlob=!0,W=!0;break}}if(i===!0)continue;break}if(t.nonegate!==!0&&M===Om&&u===p){N=F.negated=!0,p++;continue}if(t.noparen!==!0&&M===Mm){if(_=F.isGlob=!0,i===!0){for(;T()!==!0&&(M=h());){if(M===Mm){L=F.backslashes=!0,M=h();continue}if(M===yC){W=!0;break}}continue}break}if(_===!0){if(W=!0,i===!0)continue;break}}t.noext===!0&&(S=!1,_=!1);let x=c,w="",g="";p>0&&(w=c.slice(0,p),c=c.slice(p),f-=p),x&&_===!0&&f>0?(x=c.slice(0,f),g=c.slice(f)):_===!0?(x="",g=c):x=c,x&&x!==""&&x!=="/"&&x!==c&&_C(x.charCodeAt(x.length-1))&&(x=x.slice(0,-1)),t.unescape===!0&&(g&&(g=vC.removeBackslashes(g)),x&&L===!0&&(x=vC.removeBackslashes(x)));let v={prefix:w,input:r,start:p,base:x,glob:g,isBrace:m,isBracket:y,isGlob:_,isExtglob:S,isGlobstar:A,negated:N,negatedExtglob:H};if(t.tokens===!0&&(v.maxDepth=0,_C(M)||o.push(F),v.tokens=o),t.parts===!0||t.tokens===!0){let C;for(let b=0;b<s.length;b++){let d=C?C+1:p,E=s[b],q=r.slice(d,E);t.tokens&&(b===0&&p!==0?(o[b].isPrefix=!0,o[b].value=w):o[b].value=q,bC(o[b]),v.maxDepth+=o[b].depth),(b!==0||q!=="")&&a.push(q),C=E}if(C&&C+1<r.length){let b=r.slice(C+1);a.push(b),t.tokens&&(o[o.length-1].value=b,bC(o[o.length-1]),v.maxDepth+=o[o.length-1].depth)}v.slashes=s,v.parts=a}return v};SC.exports=IH});var kC=O((kz,RC)=>{"use strict";var aa=sa(),Tt=bu(),{MAX_LENGTH:wu,POSIX_REGEX_SOURCE:NH,REGEX_NON_SPECIAL_CHARS:LH,REGEX_SPECIAL_CHARS_BACKREF:DH,REPLACEMENTS:TC}=aa,BH=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch{return r.map(i=>Tt.escapeRegex(i)).join("..")}return t},Bs=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,CC=r=>{let e=[],t=0,n=0,i=0,s="",o=!1;for(let a of r){if(o===!0){s+=a,o=!1;continue}if(a==="\\"){s+=a,o=!0;continue}if(a==='"'){i=i===1?0:1,s+=a;continue}if(i===0){if(a==="[")t++;else if(a==="]"&&t>0)t--;else if(t===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(s),s="";continue}}}s+=a}return e.push(s),e},jH=r=>{let e=!1;for(let t of r){if(e===!0){e=!1;continue}if(t==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(t))return!1}return!0},AC=r=>{let e=r.trim(),t=!0;for(;t===!0;)t=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),t=!0);if(jH(e))return e.replace(/\\(.)/g,"$1")},FH=r=>{let e=r.map(AC).filter(Boolean);for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let i=e[t],s=e[n],o=i[0];if(!(!o||i!==o.repeat(i.length)||s!==o.repeat(s.length))&&(i===s||i.startsWith(s)||s.startsWith(i)))return!0}return!1},Im=(r,e=!0)=>{if(r[0]!=="+"&&r[0]!=="*"||r[1]!=="(")return;let t=0,n=0,i=0,s=!1;for(let o=1;o<r.length;o++){let a=r[o];if(s===!0){s=!1;continue}if(a==="\\"){s=!0;continue}if(a==='"'){i=i===1?0:1;continue}if(i!==1){if(a==="["){t++;continue}if(a==="]"&&t>0){t--;continue}if(!(t>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&o!==r.length-1?void 0:{type:r[0],body:r.slice(2,o),end:o}}}}},HH=r=>{let e=0,t=[];for(;e<r.length;){let i=Im(r.slice(e),!1);if(!i||i.type!=="*")return;let s=CC(i.body).map(a=>a.trim());if(s.length!==1)return;let o=AC(s[0]);if(!o||o.length!==1)return;t.push(o),e+=i.end+1}return t.length<1?void 0:`${t.length===1?Tt.escapeRegex(t[0]):`[${t.map(i=>Tt.escapeRegex(i)).join("")}]`}*`},$H=r=>{let e=0,t=r.trim(),n=Im(t);for(;n;)e++,t=n.body.trim(),n=Im(t);return e},qH=(r,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let t=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:aa.DEFAULT_MAX_EXTGLOB_RECURSION,n=CC(r).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||FH(n)))return{risky:!0};for(let i of n){let s=HH(i);if(s)return{risky:!0,safeOutput:s};if($H(i)>t)return{risky:!0}}return{risky:!1}},Nm=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=TC[r]||r;let t={...e},n=typeof t.maxLength=="number"?Math.min(wu,t.maxLength):wu,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:t.prepend||""},o=[s],a=t.capture?"":"?:",c=Tt.isWindows(e),u=aa.globChars(c),p=aa.extglobChars(u),{DOT_LITERAL:f,PLUS_LITERAL:m,SLASH_LITERAL:y,ONE_CHAR:_,DOTS_SLASH:S,NO_DOT:A,NO_DOT_SLASH:P,NO_DOTS_SLASH:L,QMARK:N,QMARK_NO_DOT:H,STAR:W,START_ANCHOR:U}=u,G=R=>`(${a}(?:(?!${U}${R.dot?S:f}).)*?)`,M=t.dot?"":A,F=t.dot?N:H,T=t.bash===!0?G(t):W;t.capture&&(T=`(${T})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let l={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};r=Tt.removePrefix(r,l),i=r.length;let h=[],x=[],w=[],g=s,v,C=()=>l.index===i-1,b=l.peek=(R=1)=>r[l.index+R],d=l.advance=()=>r[++l.index]||"",E=()=>r.slice(l.index+1),q=(R="",Y=0)=>{l.consumed+=R,l.index+=Y},I=R=>{l.output+=R.output!=null?R.output:R.value,q(R.value)},D=()=>{let R=1;for(;b()==="!"&&(b(2)!=="("||b(3)==="?");)d(),l.start++,R++;return R%2===0?!1:(l.negated=!0,l.start++,!0)},$=R=>{l[R]++,w.push(R)},K=R=>{l[R]--,w.pop()},B=R=>{if(g.type==="globstar"){let Y=l.braces>0&&(R.type==="comma"||R.type==="brace"),k=R.extglob===!0||h.length&&(R.type==="pipe"||R.type==="paren");R.type!=="slash"&&R.type!=="paren"&&!Y&&!k&&(l.output=l.output.slice(0,-g.output.length),g.type="star",g.value="*",g.output=T,l.output+=g.output)}if(h.length&&R.type!=="paren"&&(h[h.length-1].inner+=R.value),(R.value||R.output)&&I(R),g&&g.type==="text"&&R.type==="text"){g.value+=R.value,g.output=(g.output||"")+R.value;return}R.prev=g,o.push(R),g=R},me=(R,Y)=>{let k={...p[Y],conditions:1,inner:""};k.prev=g,k.parens=l.parens,k.output=l.output,k.startIndex=l.index,k.tokensIndex=o.length;let j=(t.capture?"(":"")+k.open;$("parens"),B({type:R,value:Y,output:l.output?"":_}),B({type:"paren",extglob:!0,value:d(),output:j}),h.push(k)},ie=R=>{let Y=r.slice(R.startIndex,l.index+1),k=r.slice(R.startIndex+2,l.index),j=qH(k,t);if((R.type==="plus"||R.type==="star")&&j.risky){let z=j.safeOutput?(R.output?"":_)+(t.capture?`(${j.safeOutput})`:j.safeOutput):void 0,ge=o[R.tokensIndex];ge.type="text",ge.value=Y,ge.output=z||Tt.escapeRegex(Y);for(let re=R.tokensIndex+1;re<o.length;re++)o[re].value="",o[re].output="",delete o[re].suffix;l.output=R.output+ge.output,l.backtrack=!0,B({type:"paren",extglob:!0,value:v,output:""}),K("parens");return}let J=R.close+(t.capture?")":""),V;if(R.type==="negate"){let z=T;if(R.inner&&R.inner.length>1&&R.inner.includes("/")&&(z=G(t)),(z!==T||C()||/^\)+$/.test(E()))&&(J=R.close=`)$))${z}`),R.inner.includes("*")&&(V=E())&&/^\.[^\\/.]+$/.test(V)){let ge=Nm(V,{...e,fastpaths:!1}).output;J=R.close=`)${ge})${z})`}R.prev.type==="bos"&&(l.negatedExtglob=!0)}B({type:"paren",extglob:!0,value:v,output:J}),K("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let R=!1,Y=r.replace(DH,(k,j,J,V,z,ge)=>V==="\\"?(R=!0,k):V==="?"?j?j+V+(z?N.repeat(z.length):""):ge===0?F+(z?N.repeat(z.length):""):N.repeat(J.length):V==="."?f.repeat(J.length):V==="*"?j?j+V+(z?T:""):T:j?k:`\\${k}`);return R===!0&&(t.unescape===!0?Y=Y.replace(/\\/g,""):Y=Y.replace(/\\+/g,k=>k.length%2===0?"\\\\":k?"\\":"")),Y===r&&t.contains===!0?(l.output=r,l):(l.output=Tt.wrapOutput(Y,l,e),l)}for(;!C();){if(v=d(),v==="\0")continue;if(v==="\\"){let k=b();if(k==="/"&&t.bash!==!0||k==="."||k===";")continue;if(!k){v+="\\",B({type:"text",value:v});continue}let j=/^\\+/.exec(E()),J=0;if(j&&j[0].length>2&&(J=j[0].length,l.index+=J,J%2!==0&&(v+="\\")),t.unescape===!0?v=d():v+=d(),l.brackets===0){B({type:"text",value:v});continue}}if(l.brackets>0&&(v!=="]"||g.value==="["||g.value==="[^")){if(t.posix!==!1&&v===":"){let k=g.value.slice(1);if(k.includes("[")&&(g.posix=!0,k.includes(":"))){let j=g.value.lastIndexOf("["),J=g.value.slice(0,j),V=g.value.slice(j+2),z=NH[V];if(z){g.value=J+z,l.backtrack=!0,d(),!s.output&&o.indexOf(g)===1&&(s.output=_);continue}}}(v==="["&&b()!==":"||v==="-"&&b()==="]")&&(v=`\\${v}`),v==="]"&&(g.value==="["||g.value==="[^")&&(v=`\\${v}`),t.posix===!0&&v==="!"&&g.value==="["&&(v="^"),g.value+=v,I({value:v});continue}if(l.quotes===1&&v!=='"'){v=Tt.escapeRegex(v),g.value+=v,I({value:v});continue}if(v==='"'){l.quotes=l.quotes===1?0:1,t.keepQuotes===!0&&B({type:"text",value:v});continue}if(v==="("){$("parens"),B({type:"paren",value:v});continue}if(v===")"){if(l.parens===0&&t.strictBrackets===!0)throw new SyntaxError(Bs("opening","("));let k=h[h.length-1];if(k&&l.parens===k.parens+1){ie(h.pop());continue}B({type:"paren",value:v,output:l.parens?")":"\\)"}),K("parens");continue}if(v==="["){if(t.nobracket===!0||!E().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(Bs("closing","]"));v=`\\${v}`}else $("brackets");B({type:"bracket",value:v});continue}if(v==="]"){if(t.nobracket===!0||g&&g.type==="bracket"&&g.value.length===1){B({type:"text",value:v,output:`\\${v}`});continue}if(l.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(Bs("opening","["));B({type:"text",value:v,output:`\\${v}`});continue}K("brackets");let k=g.value.slice(1);if(g.posix!==!0&&k[0]==="^"&&!k.includes("/")&&(v=`/${v}`),g.value+=v,I({value:v}),t.literalBrackets===!1||Tt.hasRegexChars(k))continue;let j=Tt.escapeRegex(g.value);if(l.output=l.output.slice(0,-g.value.length),t.literalBrackets===!0){l.output+=j,g.value=j;continue}g.value=`(${a}${j}|${g.value})`,l.output+=g.value;continue}if(v==="{"&&t.nobrace!==!0){$("braces");let k={type:"brace",value:v,output:"(",outputIndex:l.output.length,tokensIndex:l.tokens.length};x.push(k),B(k);continue}if(v==="}"){let k=x[x.length-1];if(t.nobrace===!0||!k){B({type:"text",value:v,output:v});continue}let j=")";if(k.dots===!0){let J=o.slice(),V=[];for(let z=J.length-1;z>=0&&(o.pop(),J[z].type!=="brace");z--)J[z].type!=="dots"&&V.unshift(J[z].value);j=BH(V,t),l.backtrack=!0}if(k.comma!==!0&&k.dots!==!0){let J=l.output.slice(0,k.outputIndex),V=l.tokens.slice(k.tokensIndex);k.value=k.output="\\{",v=j="\\}",l.output=J;for(let z of V)l.output+=z.output||z.value}B({type:"brace",value:v,output:j}),K("braces"),x.pop();continue}if(v==="|"){h.length>0&&h[h.length-1].conditions++,B({type:"text",value:v});continue}if(v===","){let k=v,j=x[x.length-1];j&&w[w.length-1]==="braces"&&(j.comma=!0,k="|"),B({type:"comma",value:v,output:k});continue}if(v==="/"){if(g.type==="dot"&&l.index===l.start+1){l.start=l.index+1,l.consumed="",l.output="",o.pop(),g=s;continue}B({type:"slash",value:v,output:y});continue}if(v==="."){if(l.braces>0&&g.type==="dot"){g.value==="."&&(g.output=f);let k=x[x.length-1];g.type="dots",g.output+=v,g.value+=v,k.dots=!0;continue}if(l.braces+l.parens===0&&g.type!=="bos"&&g.type!=="slash"){B({type:"text",value:v,output:f});continue}B({type:"dot",value:v,output:f});continue}if(v==="?"){if(!(g&&g.value==="(")&&t.noextglob!==!0&&b()==="("&&b(2)!=="?"){me("qmark",v);continue}if(g&&g.type==="paren"){let j=b(),J=v;if(j==="<"&&!Tt.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(g.value==="("&&!/[!=<:]/.test(j)||j==="<"&&!/<([!=]|\w+>)/.test(E()))&&(J=`\\${v}`),B({type:"text",value:v,output:J});continue}if(t.dot!==!0&&(g.type==="slash"||g.type==="bos")){B({type:"qmark",value:v,output:H});continue}B({type:"qmark",value:v,output:N});continue}if(v==="!"){if(t.noextglob!==!0&&b()==="("&&(b(2)!=="?"||!/[!=<:]/.test(b(3)))){me("negate",v);continue}if(t.nonegate!==!0&&l.index===0){D();continue}}if(v==="+"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){me("plus",v);continue}if(g&&g.value==="("||t.regex===!1){B({type:"plus",value:v,output:m});continue}if(g&&(g.type==="bracket"||g.type==="paren"||g.type==="brace")||l.parens>0){B({type:"plus",value:v});continue}B({type:"plus",value:m});continue}if(v==="@"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){B({type:"at",extglob:!0,value:v,output:""});continue}B({type:"text",value:v});continue}if(v!=="*"){(v==="$"||v==="^")&&(v=`\\${v}`);let k=LH.exec(E());k&&(v+=k[0],l.index+=k[0].length),B({type:"text",value:v});continue}if(g&&(g.type==="globstar"||g.star===!0)){g.type="star",g.star=!0,g.value+=v,g.output=T,l.backtrack=!0,l.globstar=!0,q(v);continue}let R=E();if(t.noextglob!==!0&&/^\([^?]/.test(R)){me("star",v);continue}if(g.type==="star"){if(t.noglobstar===!0){q(v);continue}let k=g.prev,j=k.prev,J=k.type==="slash"||k.type==="bos",V=j&&(j.type==="star"||j.type==="globstar");if(t.bash===!0&&(!J||R[0]&&R[0]!=="/")){B({type:"star",value:v,output:""});continue}let z=l.braces>0&&(k.type==="comma"||k.type==="brace"),ge=h.length&&(k.type==="pipe"||k.type==="paren");if(!J&&k.type!=="paren"&&!z&&!ge){B({type:"star",value:v,output:""});continue}for(;R.slice(0,3)==="/**";){let re=r[l.index+4];if(re&&re!=="/")break;R=R.slice(3),q("/**",3)}if(k.type==="bos"&&C()){g.type="globstar",g.value+=v,g.output=G(t),l.output=g.output,l.globstar=!0,q(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&!V&&C()){l.output=l.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=G(t)+(t.strictSlashes?")":"|$)"),g.value+=v,l.globstar=!0,l.output+=k.output+g.output,q(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&R[0]==="/"){let re=R[1]!==void 0?"|$":"";l.output=l.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=`${G(t)}${y}|${y}${re})`,g.value+=v,l.output+=k.output+g.output,l.globstar=!0,q(v+d()),B({type:"slash",value:"/",output:""});continue}if(k.type==="bos"&&R[0]==="/"){g.type="globstar",g.value+=v,g.output=`(?:^|${y}|${G(t)}${y})`,l.output=g.output,l.globstar=!0,q(v+d()),B({type:"slash",value:"/",output:""});continue}l.output=l.output.slice(0,-g.output.length),g.type="globstar",g.output=G(t),g.value+=v,l.output+=g.output,l.globstar=!0,q(v);continue}let Y={type:"star",value:v,output:T};if(t.bash===!0){Y.output=".*?",(g.type==="bos"||g.type==="slash")&&(Y.output=M+Y.output),B(Y);continue}if(g&&(g.type==="bracket"||g.type==="paren")&&t.regex===!0){Y.output=v,B(Y);continue}(l.index===l.start||g.type==="slash"||g.type==="dot")&&(g.type==="dot"?(l.output+=P,g.output+=P):t.dot===!0?(l.output+=L,g.output+=L):(l.output+=M,g.output+=M),b()!=="*"&&(l.output+=_,g.output+=_)),B(Y)}for(;l.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(Bs("closing","]"));l.output=Tt.escapeLast(l.output,"["),K("brackets")}for(;l.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(Bs("closing",")"));l.output=Tt.escapeLast(l.output,"("),K("parens")}for(;l.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(Bs("closing","}"));l.output=Tt.escapeLast(l.output,"{"),K("braces")}if(t.strictSlashes!==!0&&(g.type==="star"||g.type==="bracket")&&B({type:"maybe_slash",value:"",output:`${y}?`}),l.backtrack===!0){l.output="";for(let R of l.tokens)l.output+=R.output!=null?R.output:R.value,R.suffix&&(l.output+=R.suffix)}return l};Nm.fastpaths=(r,e)=>{let t={...e},n=typeof t.maxLength=="number"?Math.min(wu,t.maxLength):wu,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);r=TC[r]||r;let s=Tt.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:p,NO_DOTS:f,NO_DOTS_SLASH:m,STAR:y,START_ANCHOR:_}=aa.globChars(s),S=t.dot?f:p,A=t.dot?m:p,P=t.capture?"":"?:",L={negated:!1,prefix:""},N=t.bash===!0?".*?":y;t.capture&&(N=`(${N})`);let H=M=>M.noglobstar===!0?N:`(${P}(?:(?!${_}${M.dot?u:o}).)*?)`,W=M=>{switch(M){case"*":return`${S}${c}${N}`;case".*":return`${o}${c}${N}`;case"*.*":return`${S}${N}${o}${c}${N}`;case"*/*":return`${S}${N}${a}${c}${A}${N}`;case"**":return S+H(t);case"**/*":return`(?:${S}${H(t)}${a})?${A}${c}${N}`;case"**/*.*":return`(?:${S}${H(t)}${a})?${A}${N}${o}${c}${N}`;case"**/.*":return`(?:${S}${H(t)}${a})?${o}${c}${N}`;default:{let F=/^(.*?)\.(\w+)$/.exec(M);if(!F)return;let T=W(F[1]);return T?T+o+F[2]:void 0}}},U=Tt.removePrefix(r,L),G=W(U);return G&&t.strictSlashes!==!0&&(G+=`${a}?`),G};RC.exports=Nm});var PC=O((Oz,OC)=>{"use strict";var UH=require("path"),WH=EC(),Lm=kC(),Dm=bu(),GH=sa(),zH=r=>r&&typeof r=="object"&&!Array.isArray(r),Oe=(r,e,t=!1)=>{if(Array.isArray(r)){let p=r.map(m=>Oe(m,e,t));return m=>{for(let y of p){let _=y(m);if(_)return _}return!1}}let n=zH(r)&&r.tokens&&r.input;if(r===""||typeof r!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},s=Dm.isWindows(e),o=n?Oe.compileRe(r,e):Oe.makeRe(r,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(i.ignore){let p={...e,ignore:null,onMatch:null,onResult:null};c=Oe(i.ignore,p,t)}let u=(p,f=!1)=>{let{isMatch:m,match:y,output:_}=Oe.test(p,o,e,{glob:r,posix:s}),S={glob:r,state:a,regex:o,posix:s,input:p,output:_,match:y,isMatch:m};return typeof i.onResult=="function"&&i.onResult(S),m===!1?(S.isMatch=!1,f?S:!1):c(p)?(typeof i.onIgnore=="function"&&i.onIgnore(S),S.isMatch=!1,f?S:!1):(typeof i.onMatch=="function"&&i.onMatch(S),f?S:!0)};return t&&(u.state=a),u};Oe.test=(r,e,t,{glob:n,posix:i}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};let s=t||{},o=s.format||(i?Dm.toPosixSlashes:null),a=r===n,c=a&&o?o(r):r;return a===!1&&(c=o?o(r):r,a=c===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=Oe.matchBase(r,e,t,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Oe.matchBase=(r,e,t,n=Dm.isWindows(t))=>(e instanceof RegExp?e:Oe.makeRe(e,t)).test(UH.basename(r));Oe.isMatch=(r,e,t)=>Oe(e,t)(r);Oe.parse=(r,e)=>Array.isArray(r)?r.map(t=>Oe.parse(t,e)):Lm(r,{...e,fastpaths:!1});Oe.scan=(r,e)=>WH(r,e);Oe.compileRe=(r,e,t=!1,n=!1)=>{if(t===!0)return r.output;let i=e||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${r.output})${o}`;r&&r.negated===!0&&(a=`^(?!${a}).*$`);let c=Oe.toRegex(a,e);return n===!0&&(c.state=r),c};Oe.makeRe=(r,e={},t=!1,n=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(i.output=Lm.fastpaths(r,e)),i.output||(i=Lm(r,e)),Oe.compileRe(i,e,t,n)};Oe.toRegex=(r,e)=>{try{let t=e||{};return new RegExp(r,t.flags||(t.nocase?"i":""))}catch(t){if(e&&e.debug===!0)throw t;return/$^/}};Oe.constants=GH;OC.exports=Oe});var IC=O((Pz,MC)=>{"use strict";MC.exports=PC()});var Bm=O((Mz,NC)=>{NC.exports=function(r,e){if(typeof r!="string")throw new TypeError("expected path to be a string");if(r==="\\"||r==="/")return"/";var t=r.length;if(t<=1)return r;var n="";if(t>4&&r[3]==="\\"){var i=r[2];(i==="?"||i===".")&&r.slice(0,2)==="\\\\"&&(r=r.slice(2),n="//")}var s=r.split(/[/\\]+/);return e!==!1&&s[s.length-1]===""&&s.pop(),n+s.join("/")}});var HC=O((jC,FC)=>{"use strict";Object.defineProperty(jC,"__esModule",{value:!0});var BC=IC(),KH=Bm(),LC="!",VH={returnIndex:!1},YH=r=>Array.isArray(r)?r:[r],XH=(r,e)=>{if(typeof r=="function")return r;if(typeof r=="string"){let t=BC(r,e);return n=>r===n||t(n)}return r instanceof RegExp?t=>r.test(t):t=>!1},DC=(r,e,t,n)=>{let i=Array.isArray(t),s=i?t[0]:t;if(!i&&typeof s!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(s));let o=KH(s,!1);for(let c=0;c<e.length;c++){let u=e[c];if(u(o))return n?-1:!1}let a=i&&[o].concat(t.slice(1));for(let c=0;c<r.length;c++){let u=r[c];if(i?u(...a):u(o))return n?c:!0}return n?-1:!1},jm=(r,e,t=VH)=>{if(r==null)throw new TypeError("anymatch: specify first argument");let n=typeof t=="boolean"?{returnIndex:t}:t,i=n.returnIndex||!1,s=YH(r),o=s.filter(c=>typeof c=="string"&&c.charAt(0)===LC).map(c=>c.slice(1)).map(c=>BC(c,n)),a=s.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==LC).map(c=>XH(c,n));return e==null?(c,u=!1)=>DC(a,o,c,typeof u=="boolean"?u:!1):DC(a,o,e,i)};jm.default=jm;FC.exports=jm});var qC=O((Iz,$C)=>{$C.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1}});var Fm=O((Nz,WC)=>{var JH=qC(),UC={"{":"}","(":")","[":"]"},QH=function(r){if(r[0]==="!")return!0;for(var e=0,t=-2,n=-2,i=-2,s=-2,o=-2;e<r.length;){if(r[e]==="*"||r[e+1]==="?"&&/[\].+)]/.test(r[e])||n!==-1&&r[e]==="["&&r[e+1]!=="]"&&(n<e&&(n=r.indexOf("]",e)),n>e&&(o===-1||o>n||(o=r.indexOf("\\",e),o===-1||o>n)))||i!==-1&&r[e]==="{"&&r[e+1]!=="}"&&(i=r.indexOf("}",e),i>e&&(o=r.indexOf("\\",e),o===-1||o>i))||s!==-1&&r[e]==="("&&r[e+1]==="?"&&/[:!=]/.test(r[e+2])&&r[e+3]!==")"&&(s=r.indexOf(")",e),s>e&&(o=r.indexOf("\\",e),o===-1||o>s))||t!==-1&&r[e]==="("&&r[e+1]!=="|"&&(t<e&&(t=r.indexOf("|",e)),t!==-1&&r[t+1]!==")"&&(s=r.indexOf(")",t),s>t&&(o=r.indexOf("\\",t),o===-1||o>s))))return!0;if(r[e]==="\\"){var a=r[e+1];e+=2;var c=UC[a];if(c){var u=r.indexOf(c,e);u!==-1&&(e=u+1)}if(r[e]==="!")return!0}else e++}return!1},ZH=function(r){if(r[0]==="!")return!0;for(var e=0;e<r.length;){if(/[*?{}()[\]]/.test(r[e]))return!0;if(r[e]==="\\"){var t=r[e+1];e+=2;var n=UC[t];if(n){var i=r.indexOf(n,e);i!==-1&&(e=i+1)}if(r[e]==="!")return!0}else e++}return!1};WC.exports=function(e,t){if(typeof e!="string"||e==="")return!1;if(JH(e))return!0;var n=QH;return t&&t.strict===!1&&(n=ZH),n(e)}});var zC=O((Lz,GC)=>{"use strict";var e$=Fm(),t$=require("path").posix.dirname,r$=require("os").platform()==="win32",Hm="/",n$=/\\/g,i$=/[\{\[].*[\}\]]$/,s$=/(^|[^\\])([\{\[]|\([^\)]+$)/,o$=/\\([\!\*\?\|\[\]\(\)\{\}])/g;GC.exports=function(e,t){var n=Object.assign({flipBackslashes:!0},t);n.flipBackslashes&&r$&&e.indexOf(Hm)<0&&(e=e.replace(n$,Hm)),i$.test(e)&&(e+=Hm),e+="a";do e=t$(e);while(e$(e)||s$.test(e));return e.replace(o$,"$1")}});var Su=O(xr=>{"use strict";xr.isInteger=r=>typeof r=="number"?Number.isInteger(r):typeof r=="string"&&r.trim()!==""?Number.isInteger(Number(r)):!1;xr.find=(r,e)=>r.nodes.find(t=>t.type===e);xr.exceedsLimit=(r,e,t=1,n)=>n===!1||!xr.isInteger(r)||!xr.isInteger(e)?!1:(Number(e)-Number(r))/Number(t)>=n;xr.escapeNode=(r,e=0,t)=>{let n=r.nodes[e];n&&(t&&n.type===t||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};xr.encloseBrace=r=>r.type!=="brace"?!1:r.commas>>0+r.ranges>>0===0?(r.invalid=!0,!0):!1;xr.isInvalidBrace=r=>r.type!=="brace"?!1:r.invalid===!0||r.dollar?!0:r.commas>>0+r.ranges>>0===0||r.open!==!0||r.close!==!0?(r.invalid=!0,!0):!1;xr.isOpenOrClose=r=>r.type==="open"||r.type==="close"?!0:r.open===!0||r.close===!0;xr.reduce=r=>r.reduce((e,t)=>(t.type==="text"&&e.push(t.value),t.type==="range"&&(t.type="text"),e),[]);xr.flatten=(...r)=>{let e=[],t=n=>{for(let i=0;i<n.length;i++){let s=n[i];if(Array.isArray(s)){t(s);continue}s!==void 0&&e.push(s)}return e};return t(r),e}});var Eu=O((Bz,VC)=>{"use strict";var KC=Su();VC.exports=(r,e={})=>{let t=(n,i={})=>{let s=e.escapeInvalid&&KC.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(s||o)&&KC.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)a+=t(c);return a};return t(r)}});var XC=O((jz,YC)=>{"use strict";YC.exports=function(r){return typeof r=="number"?r-r===0:typeof r=="string"&&r.trim()!==""?Number.isFinite?Number.isFinite(+r):isFinite(+r):!1}});var sA=O((Fz,iA)=>{"use strict";var JC=XC(),xi=(r,e,t)=>{if(JC(r)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||r===e)return String(r);if(JC(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...t};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let i=String(n.relaxZeros),s=String(n.shorthand),o=String(n.capture),a=String(n.wrap),c=r+":"+e+"="+i+s+o+a;if(xi.cache.hasOwnProperty(c))return xi.cache[c].result;let u=Math.min(r,e),p=Math.max(r,e);if(Math.abs(u-p)===1){let S=r+"|"+e;return n.capture?`(${S})`:n.wrap===!1?S:`(?:${S})`}let f=nA(r)||nA(e),m={min:r,max:e,a:u,b:p},y=[],_=[];if(f&&(m.isPadded=f,m.maxLen=String(m.max).length),u<0){let S=p<0?Math.abs(p):1;_=QC(S,Math.abs(u),m,n),u=m.a=0}return p>=0&&(y=QC(u,p,m,n)),m.negatives=_,m.positives=y,m.result=a$(_,y,n),n.capture===!0?m.result=`(${m.result})`:n.wrap!==!1&&y.length+_.length>1&&(m.result=`(?:${m.result})`),xi.cache[c]=m,m.result};function a$(r,e,t){let n=$m(r,e,"-",!1,t)||[],i=$m(e,r,"",!1,t)||[],s=$m(r,e,"-?",!0,t)||[];return n.concat(s).concat(i).join("|")}function c$(r,e){let t=1,n=1,i=eA(r,t),s=new Set([e]);for(;r<=i&&i<=e;)s.add(i),t+=1,i=eA(r,t);for(i=tA(e+1,n)-1;r<i&&i<=e;)s.add(i),n+=1,i=tA(e+1,n)-1;return s=[...s],s.sort(p$),s}function l$(r,e,t){if(r===e)return{pattern:r,count:[],digits:0};let n=u$(r,e),i=n.length,s="",o=0;for(let a=0;a<i;a++){let[c,u]=n[a];c===u?s+=c:c!=="0"||u!=="9"?s+=f$(c,u,t):o++}return o&&(s+=t.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function QC(r,e,t,n){let i=c$(r,e),s=[],o=r,a;for(let c=0;c<i.length;c++){let u=i[c],p=l$(String(o),String(u),n),f="";if(!t.isPadded&&a&&a.pattern===p.pattern){a.count.length>1&&a.count.pop(),a.count.push(p.count[0]),a.string=a.pattern+rA(a.count),o=u+1;continue}t.isPadded&&(f=d$(u,t,n)),p.string=f+p.pattern+rA(p.count),s.push(p),o=u+1,a=p}return s}function $m(r,e,t,n,i){let s=[];for(let o of r){let{string:a}=o;!n&&!ZC(e,"string",a)&&s.push(t+a),n&&ZC(e,"string",a)&&s.push(t+a)}return s}function u$(r,e){let t=[];for(let n=0;n<r.length;n++)t.push([r[n],e[n]]);return t}function p$(r,e){return r>e?1:e>r?-1:0}function ZC(r,e,t){return r.some(n=>n[e]===t)}function eA(r,e){return Number(String(r).slice(0,-e)+"9".repeat(e))}function tA(r,e){return r-r%Math.pow(10,e)}function rA(r){let[e=0,t=""]=r;return t||e>1?`{${e+(t?","+t:"")}}`:""}function f$(r,e,t){return`[${r}${e-r===1?"":"-"}${e}]`}function nA(r){return/^-?(0+)\d/.test(r)}function d$(r,e,t){if(!e.isPadded)return r;let n=Math.abs(e.maxLen-String(r).length),i=t.relaxZeros!==!1;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}xi.cache={};xi.clearCache=()=>xi.cache={};iA.exports=xi});var Wm=O((Hz,fA)=>{"use strict";var h$=require("util"),aA=sA(),oA=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),m$=r=>e=>r===!0?Number(e):String(e),qm=r=>typeof r=="number"||typeof r=="string"&&r!=="",ca=r=>Number.isInteger(+r),Um=r=>{let e=`${r}`,t=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++t]==="0";);return t>0},g$=(r,e,t)=>typeof r=="string"||typeof e=="string"?!0:t.stringify===!0,v$=(r,e,t)=>{if(e>0){let n=r[0]==="-"?"-":"";n&&(r=r.slice(1)),r=n+r.padStart(n?e-1:e,"0")}return t===!1?String(r):r},Cu=(r,e)=>{let t=r[0]==="-"?"-":"";for(t&&(r=r.slice(1),e--);r.length<e;)r="0"+r;return t?"-"+r:r},x$=(r,e,t)=>{r.negatives.sort((a,c)=>a<c?-1:a>c?1:0),r.positives.sort((a,c)=>a<c?-1:a>c?1:0);let n=e.capture?"":"?:",i="",s="",o;return r.positives.length&&(i=r.positives.map(a=>Cu(String(a),t)).join("|")),r.negatives.length&&(s=`-(${n}${r.negatives.map(a=>Cu(String(a),t)).join("|")})`),i&&s?o=`${i}|${s}`:o=i||s,e.wrap?`(${n}${o})`:o},cA=(r,e,t,n)=>{if(t)return aA(r,e,{wrap:!1,...n});let i=String.fromCharCode(r);if(r===e)return i;let s=String.fromCharCode(e);return`[${i}-${s}]`},lA=(r,e,t)=>{if(Array.isArray(r)){let n=t.wrap===!0,i=t.capture?"":"?:";return n?`(${i}${r.join("|")})`:r.join("|")}return aA(r,e,t)},uA=(...r)=>new RangeError("Invalid range arguments: "+h$.inspect(...r)),pA=(r,e,t)=>{if(t.strictRanges===!0)throw uA([r,e]);return[]},y$=(r,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${r}" to be a number`);return[]},_$=(r,e,t=1,n={})=>{let i=Number(r),s=Number(e);if(!Number.isInteger(i)||!Number.isInteger(s)){if(n.strictRanges===!0)throw uA([r,e]);return[]}i===0&&(i=0),s===0&&(s=0);let o=i>s,a=String(r),c=String(e),u=String(t);t=Math.max(Math.abs(t),1);let p=Um(a)||Um(c)||Um(u),f=p?Math.max(a.length,c.length,u.length):0,m=p===!1&&g$(r,e,n)===!1,y=n.transform||m$(m);if(n.toRegex&&t===1)return cA(Cu(r,f),Cu(e,f),!0,n);let _={negatives:[],positives:[]},S=L=>_[L<0?"negatives":"positives"].push(Math.abs(L)),A=[],P=0;for(;o?i>=s:i<=s;)n.toRegex===!0&&t>1?S(i):A.push(v$(y(i,P),f,m)),i=o?i-t:i+t,P++;return n.toRegex===!0?t>1?x$(_,n,f):lA(A,null,{wrap:!1,...n}):A},b$=(r,e,t=1,n={})=>{if(!ca(r)&&r.length>1||!ca(e)&&e.length>1)return pA(r,e,n);let i=n.transform||(m=>String.fromCharCode(m)),s=`${r}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=s>o,c=Math.min(s,o),u=Math.max(s,o);if(n.toRegex&&t===1)return cA(c,u,!1,n);let p=[],f=0;for(;a?s>=o:s<=o;)p.push(i(s,f)),s=a?s-t:s+t,f++;return n.toRegex===!0?lA(p,null,{wrap:!1,options:n}):p},Tu=(r,e,t,n={})=>{if(e==null&&qm(r))return[r];if(!qm(r)||!qm(e))return pA(r,e,n);if(typeof t=="function")return Tu(r,e,1,{transform:t});if(oA(t))return Tu(r,e,0,t);let i={...n};return i.capture===!0&&(i.wrap=!0),t=t||i.step||1,ca(t)?ca(r)&&ca(e)?_$(r,e,t,i):b$(r,e,Math.max(Math.abs(t),1),i):t!=null&&!oA(t)?y$(t,i):Tu(r,e,1,t)};fA.exports=Tu});var mA=O(($z,hA)=>{"use strict";var w$=Wm(),dA=Su(),S$=(r,e={})=>{let t=(n,i={})=>{let s=dA.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a=s===!0||o===!0,c=e.escapeInvalid===!0?"\\":"",u="";if(n.isOpen===!0)return c+n.value;if(n.isClose===!0)return console.log("node.isClose",c,n.value),c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let p=dA.reduce(n.nodes),f=w$(...p,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(f.length!==0)return p.length>1&&f.length>1?`(${f})`:f}if(n.nodes)for(let p of n.nodes)u+=t(p,n);return u};return t(r)};hA.exports=S$});var xA=O((qz,vA)=>{"use strict";var E$=Wm(),gA=Eu(),js=Su(),yi=(r="",e="",t=!1)=>{let n=[];if(r=[].concat(r),e=[].concat(e),!e.length)return r;if(!r.length)return t?js.flatten(e).map(i=>`{${i}}`):e;for(let i of r)if(Array.isArray(i))for(let s of i)n.push(yi(s,e,t));else for(let s of e)t===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?yi(i,s,t):i+s);return js.flatten(n)},T$=(r,e={})=>{let t=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(i,s={})=>{i.queue=[];let o=s,a=s.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(i.invalid||i.dollar){a.push(yi(a.pop(),gA(i,e)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(yi(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let f=js.reduce(i.nodes);if(js.exceedsLimit(...f,e.step,t))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let m=E$(...f,e);m.length===0&&(m=gA(i,e)),a.push(yi(a.pop(),m)),i.nodes=[];return}let c=js.encloseBrace(i),u=i.queue,p=i;for(;p.type!=="brace"&&p.type!=="root"&&p.parent;)p=p.parent,u=p.queue;for(let f=0;f<i.nodes.length;f++){let m=i.nodes[f];if(m.type==="comma"&&i.type==="brace"){f===1&&u.push(""),u.push("");continue}if(m.type==="close"){a.push(yi(a.pop(),u,c));continue}if(m.value&&m.type!=="open"){u.push(yi(u.pop(),m.value));continue}m.nodes&&n(m,i)}return u};return js.flatten(n(r))};vA.exports=T$});var _A=O((Uz,yA)=>{"use strict";yA.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
100
- `,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var TA=O((Wz,EA)=>{"use strict";var C$=Eu(),{MAX_LENGTH:bA,CHAR_BACKSLASH:Gm,CHAR_BACKTICK:A$,CHAR_COMMA:R$,CHAR_DOT:k$,CHAR_LEFT_PARENTHESES:O$,CHAR_RIGHT_PARENTHESES:P$,CHAR_LEFT_CURLY_BRACE:M$,CHAR_RIGHT_CURLY_BRACE:I$,CHAR_LEFT_SQUARE_BRACKET:wA,CHAR_RIGHT_SQUARE_BRACKET:SA,CHAR_DOUBLE_QUOTE:N$,CHAR_SINGLE_QUOTE:L$,CHAR_NO_BREAK_SPACE:D$,CHAR_ZERO_WIDTH_NOBREAK_SPACE:B$}=_A(),j$=(r,e={})=>{if(typeof r!="string")throw new TypeError("Expected a string");let t=e||{},n=typeof t.maxLength=="number"?Math.min(bA,t.maxLength):bA;if(r.length>n)throw new SyntaxError(`Input length (${r.length}), exceeds max characters (${n})`);let i={type:"root",input:r,nodes:[]},s=[i],o=i,a=i,c=0,u=r.length,p=0,f=0,m,y=()=>r[p++],_=S=>{if(S.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&S.type==="text"){a.value+=S.value;return}return o.nodes.push(S),S.parent=o,S.prev=a,a=S,S};for(_({type:"bos"});p<u;)if(o=s[s.length-1],m=y(),!(m===B$||m===D$)){if(m===Gm){_({type:"text",value:(e.keepEscaping?m:"")+y()});continue}if(m===SA){_({type:"text",value:"\\"+m});continue}if(m===wA){c++;let S;for(;p<u&&(S=y());){if(m+=S,S===wA){c++;continue}if(S===Gm){m+=y();continue}if(S===SA&&(c--,c===0))break}_({type:"text",value:m});continue}if(m===O$){o=_({type:"paren",nodes:[]}),s.push(o),_({type:"text",value:m});continue}if(m===P$){if(o.type!=="paren"){_({type:"text",value:m});continue}o=s.pop(),_({type:"text",value:m}),o=s[s.length-1];continue}if(m===N$||m===L$||m===A$){let S=m,A;for(e.keepQuotes!==!0&&(m="");p<u&&(A=y());){if(A===Gm){m+=A+y();continue}if(A===S){e.keepQuotes===!0&&(m+=A);break}m+=A}_({type:"text",value:m});continue}if(m===M$){f++;let A={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:f,commas:0,ranges:0,nodes:[]};o=_(A),s.push(o),_({type:"open",value:m});continue}if(m===I$){if(o.type!=="brace"){_({type:"text",value:m});continue}let S="close";o=s.pop(),o.close=!0,_({type:S,value:m}),f--,o=s[s.length-1];continue}if(m===R$&&f>0){if(o.ranges>0){o.ranges=0;let S=o.nodes.shift();o.nodes=[S,{type:"text",value:C$(o)}]}_({type:"comma",value:m}),o.commas++;continue}if(m===k$&&f>0&&o.commas===0){let S=o.nodes;if(f===0||S.length===0){_({type:"text",value:m});continue}if(a.type==="dot"){if(o.range=[],a.value+=m,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){S.pop();let A=S[S.length-1];A.value+=a.value+m,a=A,o.ranges--;continue}_({type:"dot",value:m});continue}_({type:"text",value:m})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(P=>{P.nodes||(P.type==="open"&&(P.isOpen=!0),P.type==="close"&&(P.isClose=!0),P.nodes||(P.type="text"),P.invalid=!0)});let S=s[s.length-1],A=S.nodes.indexOf(o);S.nodes.splice(A,1,...o.nodes)}while(s.length>0);return _({type:"eos"}),i};EA.exports=j$});var RA=O((Gz,AA)=>{"use strict";var CA=Eu(),F$=mA(),H$=xA(),$$=TA(),er=(r,e={})=>{let t=[];if(Array.isArray(r))for(let n of r){let i=er.create(n,e);Array.isArray(i)?t.push(...i):t.push(i)}else t=[].concat(er.create(r,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};er.parse=(r,e={})=>$$(r,e);er.stringify=(r,e={})=>CA(typeof r=="string"?er.parse(r,e):r,e);er.compile=(r,e={})=>(typeof r=="string"&&(r=er.parse(r,e)),F$(r,e));er.expand=(r,e={})=>{typeof r=="string"&&(r=er.parse(r,e));let t=H$(r,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};er.create=(r,e={})=>r===""||r.length<3?[r]:e.expand!==!0?er.compile(r,e):er.expand(r,e);AA.exports=er});var kA=O((zz,q$)=>{q$.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]});var PA=O((Kz,OA)=>{OA.exports=kA()});var IA=O((Vz,MA)=>{"use strict";var U$=require("path"),W$=PA(),G$=new Set(W$);MA.exports=r=>G$.has(U$.extname(r).slice(1).toLowerCase())});var Au=O(Q=>{"use strict";var{sep:z$}=require("path"),{platform:zm}=process,K$=require("os");Q.EV_ALL="all";Q.EV_READY="ready";Q.EV_ADD="add";Q.EV_CHANGE="change";Q.EV_ADD_DIR="addDir";Q.EV_UNLINK="unlink";Q.EV_UNLINK_DIR="unlinkDir";Q.EV_RAW="raw";Q.EV_ERROR="error";Q.STR_DATA="data";Q.STR_END="end";Q.STR_CLOSE="close";Q.FSEVENT_CREATED="created";Q.FSEVENT_MODIFIED="modified";Q.FSEVENT_DELETED="deleted";Q.FSEVENT_MOVED="moved";Q.FSEVENT_CLONED="cloned";Q.FSEVENT_UNKNOWN="unknown";Q.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1;Q.FSEVENT_TYPE_FILE="file";Q.FSEVENT_TYPE_DIRECTORY="directory";Q.FSEVENT_TYPE_SYMLINK="symlink";Q.KEY_LISTENERS="listeners";Q.KEY_ERR="errHandlers";Q.KEY_RAW="rawEmitters";Q.HANDLER_KEYS=[Q.KEY_LISTENERS,Q.KEY_ERR,Q.KEY_RAW];Q.DOT_SLASH=`.${z$}`;Q.BACK_SLASH_RE=/\\/g;Q.DOUBLE_SLASH_RE=/\/\//;Q.SLASH_OR_BACK_SLASH_RE=/[/\\]/;Q.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;Q.REPLACER_RE=/^\.[/\\]/;Q.SLASH="/";Q.SLASH_SLASH="//";Q.BRACE_START="{";Q.BANG="!";Q.ONE_DOT=".";Q.TWO_DOTS="..";Q.STAR="*";Q.GLOBSTAR="**";Q.ROOT_GLOBSTAR="/**/*";Q.SLASH_GLOBSTAR="/**";Q.DIR_SUFFIX="Dir";Q.ANYMATCH_OPTS={dot:!0};Q.STRING_TYPE="string";Q.FUNCTION_TYPE="function";Q.EMPTY_STR="";Q.EMPTY_FN=()=>{};Q.IDENTITY_FN=r=>r;Q.isWindows=zm==="win32";Q.isMacos=zm==="darwin";Q.isLinux=zm==="linux";Q.isIBMi=K$.type()==="OS400"});var FA=O((Xz,jA)=>{"use strict";var wn=require("fs"),ht=require("path"),{promisify:fa}=require("util"),V$=IA(),{isWindows:Y$,isLinux:X$,EMPTY_FN:J$,EMPTY_STR:Q$,KEY_LISTENERS:Fs,KEY_ERR:Km,KEY_RAW:la,HANDLER_KEYS:Z$,EV_CHANGE:ku,EV_ADD:Ru,EV_ADD_DIR:eq,EV_ERROR:LA,STR_DATA:tq,STR_END:rq,BRACE_START:nq,STAR:iq}=Au(),sq="watch",oq=fa(wn.open),DA=fa(wn.stat),aq=fa(wn.lstat),cq=fa(wn.close),Vm=fa(wn.realpath),lq={lstat:aq,stat:DA},Xm=(r,e)=>{r instanceof Set?r.forEach(e):e(r)},ua=(r,e,t)=>{let n=r[e];n instanceof Set||(r[e]=n=new Set([n])),n.add(t)},uq=r=>e=>{let t=r[e];t instanceof Set?t.clear():delete r[e]},pa=(r,e,t)=>{let n=r[e];n instanceof Set?n.delete(t):n===t&&delete r[e]},BA=r=>r instanceof Set?r.size===0:!r,Ou=new Map;function NA(r,e,t,n,i){let s=(o,a)=>{t(r),i(o,a,{watchedPath:r}),a&&r!==a&&Pu(ht.resolve(r,a),Fs,ht.join(r,a))};try{return wn.watch(r,e,s)}catch(o){n(o)}}var Pu=(r,e,t,n,i)=>{let s=Ou.get(r);s&&Xm(s[e],o=>{o(t,n,i)})},pq=(r,e,t,n)=>{let{listener:i,errHandler:s,rawEmitter:o}=n,a=Ou.get(e),c;if(!t.persistent)return c=NA(r,t,i,s,o),c.close.bind(c);if(a)ua(a,Fs,i),ua(a,Km,s),ua(a,la,o);else{if(c=NA(r,t,Pu.bind(null,e,Fs),s,Pu.bind(null,e,la)),!c)return;c.on(LA,async u=>{let p=Pu.bind(null,e,Km);if(a.watcherUnusable=!0,Y$&&u.code==="EPERM")try{let f=await oq(r,"r");await cq(f),p(u)}catch{}else p(u)}),a={listeners:i,errHandlers:s,rawEmitters:o,watcher:c},Ou.set(e,a)}return()=>{pa(a,Fs,i),pa(a,Km,s),pa(a,la,o),BA(a.listeners)&&(a.watcher.close(),Ou.delete(e),Z$.forEach(uq(a)),a.watcher=void 0,Object.freeze(a))}},Ym=new Map,fq=(r,e,t,n)=>{let{listener:i,rawEmitter:s}=n,o=Ym.get(e),a=new Set,c=new Set,u=o&&o.options;return u&&(u.persistent<t.persistent||u.interval>t.interval)&&(a=o.listeners,c=o.rawEmitters,wn.unwatchFile(e),o=void 0),o?(ua(o,Fs,i),ua(o,la,s)):(o={listeners:i,rawEmitters:s,options:t,watcher:wn.watchFile(e,t,(p,f)=>{Xm(o.rawEmitters,y=>{y(ku,e,{curr:p,prev:f})});let m=p.mtimeMs;(p.size!==f.size||m>f.mtimeMs||m===0)&&Xm(o.listeners,y=>y(r,p))})},Ym.set(e,o)),()=>{pa(o,Fs,i),pa(o,la,s),BA(o.listeners)&&(Ym.delete(e),wn.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o))}},Jm=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let n=this.fsw.options,i=ht.dirname(e),s=ht.basename(e);this.fsw._getWatchedDir(i).add(s);let a=ht.resolve(e),c={persistent:n.persistent};t||(t=J$);let u;return n.usePolling?(c.interval=n.enableBinaryInterval&&V$(s)?n.binaryInterval:n.interval,u=fq(e,a,c,{listener:t,rawEmitter:this.fsw._emitRaw})):u=pq(e,a,c,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),u}_handleFile(e,t,n){if(this.fsw.closed)return;let i=ht.dirname(e),s=ht.basename(e),o=this.fsw._getWatchedDir(i),a=t;if(o.has(s))return;let c=async(p,f)=>{if(this.fsw._throttle(sq,e,5)){if(!f||f.mtimeMs===0)try{let m=await DA(e);if(this.fsw.closed)return;let y=m.atimeMs,_=m.mtimeMs;(!y||y<=_||_!==a.mtimeMs)&&this.fsw._emit(ku,e,m),X$&&a.ino!==m.ino?(this.fsw._closeFile(p),a=m,this.fsw._addPathCloser(p,this._watchWithNodeFs(e,c))):a=m}catch{this.fsw._remove(i,s)}else if(o.has(s)){let m=f.atimeMs,y=f.mtimeMs;(!m||m<=y||y!==a.mtimeMs)&&this.fsw._emit(ku,e,f),a=f}}},u=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(Ru,e,0))return;this.fsw._emit(Ru,e,t)}return u}async _handleSymlink(e,t,n,i){if(this.fsw.closed)return;let s=e.fullPath,o=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await Vm(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(o.has(i)?this.fsw._symlinkPaths.get(s)!==a&&(this.fsw._symlinkPaths.set(s,a),this.fsw._emit(ku,n,e.stats)):(o.add(i),this.fsw._symlinkPaths.set(s,a),this.fsw._emit(Ru,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(s))return!0;this.fsw._symlinkPaths.set(s,!0)}_handleRead(e,t,n,i,s,o,a){if(e=ht.join(e,Q$),!n.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let c=this.fsw._getWatchedDir(n.path),u=new Set,p=this.fsw._readdirp(e,{fileFilter:f=>n.filterPath(f),directoryFilter:f=>n.filterDir(f),depth:0}).on(tq,async f=>{if(this.fsw.closed){p=void 0;return}let m=f.path,y=ht.join(e,m);if(u.add(m),!(f.stats.isSymbolicLink()&&await this._handleSymlink(f,e,y,m))){if(this.fsw.closed){p=void 0;return}(m===i||!i&&!c.has(m))&&(this.fsw._incrReadyCount(),y=ht.join(s,ht.relative(s,y)),this._addToNodeFs(y,t,n,o+1))}}).on(LA,this._boundHandleError);return new Promise(f=>p.once(rq,()=>{if(this.fsw.closed){p=void 0;return}let m=a?a.clear():!1;f(),c.getChildren().filter(y=>y!==e&&!u.has(y)&&(!n.hasGlob||n.filterPath({fullPath:ht.resolve(e,y)}))).forEach(y=>{this.fsw._remove(e,y)}),p=void 0,m&&this._handleRead(e,!1,n,i,s,o,a)}))}async _handleDir(e,t,n,i,s,o,a){let c=this.fsw._getWatchedDir(ht.dirname(e)),u=c.has(ht.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!s&&!u&&(!o.hasGlob||o.globFilter(e))&&this.fsw._emit(eq,e,t),c.add(ht.basename(e)),this.fsw._getWatchedDir(e);let p,f,m=this.fsw.options.depth;if((m==null||i<=m)&&!this.fsw._symlinkPaths.has(a)){if(!s&&(await this._handleRead(e,n,o,s,e,i,p),this.fsw.closed))return;f=this._watchWithNodeFs(e,(y,_)=>{_&&_.mtimeMs===0||this._handleRead(y,!1,o,s,e,i,p)})}return f}async _addToNodeFs(e,t,n,i,s){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let a=this.fsw._getWatchHelpers(e,i);!a.hasGlob&&n&&(a.hasGlob=n.hasGlob,a.globFilter=n.globFilter,a.filterPath=c=>n.filterPath(c),a.filterDir=c=>n.filterDir(c));try{let c=await lq[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return o(),!1;let u=this.fsw.options.followSymlinks&&!e.includes(iq)&&!e.includes(nq),p;if(c.isDirectory()){let f=ht.resolve(e),m=u?await Vm(e):e;if(this.fsw.closed||(p=await this._handleDir(a.watchPath,c,t,i,s,a,m),this.fsw.closed))return;f!==m&&m!==void 0&&this.fsw._symlinkPaths.set(f,m)}else if(c.isSymbolicLink()){let f=u?await Vm(e):e;if(this.fsw.closed)return;let m=ht.dirname(a.watchPath);if(this.fsw._getWatchedDir(m).add(a.watchPath),this.fsw._emit(Ru,a.watchPath,c),p=await this._handleDir(m,c,t,i,e,a,f),this.fsw.closed)return;f!==void 0&&this.fsw._symlinkPaths.set(ht.resolve(e),f)}else p=this._handleFile(a.watchPath,c,t);return o(),this.fsw._addPathCloser(e,p),!1}catch(c){if(this.fsw._handleError(c))return o(),e}}};jA.exports=Jm});var zA=O((Jz,sg)=>{"use strict";var ng=require("fs"),mt=require("path"),{promisify:ig}=require("util"),Hs;try{Hs=require("fsevents")}catch(r){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(r)}if(Hs){let r=process.version.match(/v(\d+)\.(\d+)/);if(r&&r[1]&&r[2]){let e=Number.parseInt(r[1],10),t=Number.parseInt(r[2],10);e===8&&t<16&&(Hs=void 0)}}var{EV_ADD:Qm,EV_CHANGE:dq,EV_ADD_DIR:HA,EV_UNLINK:Mu,EV_ERROR:hq,STR_DATA:mq,STR_END:gq,FSEVENT_CREATED:vq,FSEVENT_MODIFIED:xq,FSEVENT_DELETED:yq,FSEVENT_MOVED:_q,FSEVENT_UNKNOWN:bq,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:wq,FSEVENT_TYPE_FILE:Sq,FSEVENT_TYPE_DIRECTORY:da,FSEVENT_TYPE_SYMLINK:GA,ROOT_GLOBSTAR:$A,DIR_SUFFIX:Eq,DOT_SLASH:qA,FUNCTION_TYPE:Zm,EMPTY_FN:Tq,IDENTITY_FN:Cq}=Au(),Aq=r=>isNaN(r)?{}:{depth:r},tg=ig(ng.stat),Rq=ig(ng.lstat),UA=ig(ng.realpath),kq={stat:tg,lstat:Rq},_i=new Map,Oq=10,Pq=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),Mq=(r,e)=>({stop:Hs.watch(r,e)});function Iq(r,e,t,n){let i=mt.extname(e)?mt.dirname(e):e,s=mt.dirname(i),o=_i.get(i);Nq(s)&&(i=s);let a=mt.resolve(r),c=a!==e,u=(f,m,y)=>{c&&(f=f.replace(e,a)),(f===a||!f.indexOf(a+mt.sep))&&t(f,m,y)},p=!1;for(let f of _i.keys())if(e.indexOf(mt.resolve(f)+mt.sep)===0){i=f,o=_i.get(i),p=!0;break}return o||p?o.listeners.add(u):(o={listeners:new Set([u]),rawEmitter:n,watcher:Mq(i,(f,m)=>{if(!o.listeners.size||m&wq)return;let y=Hs.getInfo(f,m);o.listeners.forEach(_=>{_(f,m,y)}),o.rawEmitter(y.event,f,y)})},_i.set(i,o)),()=>{let f=o.listeners;if(f.delete(u),!f.size&&(_i.delete(i),o.watcher))return o.watcher.stop().then(()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o)})}}var Nq=r=>{let e=0;for(let t of _i.keys())if(t.indexOf(r)===0&&(e++,e>=Oq))return!0;return!1},Lq=()=>Hs&&_i.size<128,eg=(r,e)=>{let t=0;for(;!r.indexOf(e)&&(r=mt.dirname(r))!==e;)t++;return t},WA=(r,e)=>r.type===da&&e.isDirectory()||r.type===GA&&e.isSymbolicLink()||r.type===Sq&&e.isFile(),rg=class{constructor(e){this.fsw=e}checkIgnored(e,t){let n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,t))return n.add(e),t&&t.isDirectory()&&n.add(e+$A),!0;n.delete(e),n.delete(e+$A)}addOrChange(e,t,n,i,s,o,a,c){let u=s.has(o)?dq:Qm;this.handleEvent(u,e,t,n,i,s,o,a,c)}async checkExists(e,t,n,i,s,o,a,c){try{let u=await tg(e);if(this.fsw.closed)return;WA(a,u)?this.addOrChange(e,t,n,i,s,o,a,c):this.handleEvent(Mu,e,t,n,i,s,o,a,c)}catch(u){u.code==="EACCES"?this.addOrChange(e,t,n,i,s,o,a,c):this.handleEvent(Mu,e,t,n,i,s,o,a,c)}}handleEvent(e,t,n,i,s,o,a,c,u){if(!(this.fsw.closed||this.checkIgnored(t)))if(e===Mu){let p=c.type===da;(p||o.has(a))&&this.fsw._remove(s,a,p)}else{if(e===Qm){if(c.type===da&&this.fsw._getWatchedDir(t),c.type===GA&&u.followSymlinks){let f=u.depth===void 0?void 0:eg(n,i)+1;return this._addToFsEvents(t,!1,!0,f)}this.fsw._getWatchedDir(s).add(a)}let p=c.type===da?e+Eq:e;this.fsw._emit(p,t),p===HA&&this._addToFsEvents(t,!1,!0)}}_watchWithFsEvents(e,t,n,i){if(this.fsw.closed||this.fsw._isIgnored(e))return;let s=this.fsw.options,a=Iq(e,t,async(c,u,p)=>{if(this.fsw.closed||s.depth!==void 0&&eg(c,t)>s.depth)return;let f=n(mt.join(e,mt.relative(e,c)));if(i&&!i(f))return;let m=mt.dirname(f),y=mt.basename(f),_=this.fsw._getWatchedDir(p.type===da?f:m);if(Pq.has(u)||p.event===bq)if(typeof s.ignored===Zm){let S;try{S=await tg(f)}catch{}if(this.fsw.closed||this.checkIgnored(f,S))return;WA(p,S)?this.addOrChange(f,c,t,m,_,y,p,s):this.handleEvent(Mu,f,c,t,m,_,y,p,s)}else this.checkExists(f,c,t,m,_,y,p,s);else switch(p.event){case vq:case xq:return this.addOrChange(f,c,t,m,_,y,p,s);case yq:case _q:return this.checkExists(f,c,t,m,_,y,p,s)}},this.fsw._emitRaw);return this.fsw._emitReady(),a}async _handleFsEventsSymlink(e,t,n,i){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(t))){this.fsw._symlinkPaths.set(t,!0),this.fsw._incrReadyCount();try{let s=await UA(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(s))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(s||e,o=>{let a=e;return s&&s!==qA?a=o.replace(s,e):o!==qA&&(a=mt.join(e,o)),n(a)},!1,i)}catch(s){if(this.fsw._handleError(s))return this.fsw._emitReady()}}}emitAdd(e,t,n,i,s){let o=n(e),a=t.isDirectory(),c=this.fsw._getWatchedDir(mt.dirname(o)),u=mt.basename(o);a&&this.fsw._getWatchedDir(o),!c.has(u)&&(c.add(u),(!i.ignoreInitial||s===!0)&&this.fsw._emit(a?HA:Qm,o,t))}initWatch(e,t,n,i){if(this.fsw.closed)return;let s=this._watchWithFsEvents(n.watchPath,mt.resolve(e||n.watchPath),i,n.globFilter);this.fsw._addPathCloser(t,s)}async _addToFsEvents(e,t,n,i){if(this.fsw.closed)return;let s=this.fsw.options,o=typeof t===Zm?t:Cq,a=this.fsw._getWatchHelpers(e);try{let c=await kq[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))throw null;if(c.isDirectory()){if(a.globFilter||this.emitAdd(o(e),c,o,s,n),i&&i>s.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:u=>a.filterPath(u),directoryFilter:u=>a.filterDir(u),...Aq(s.depth-(i||0))}).on(mq,u=>{if(this.fsw.closed||u.stats.isDirectory()&&!a.filterPath(u))return;let p=mt.join(a.watchPath,u.path),{fullPath:f}=u;if(a.followSymlinks&&u.stats.isSymbolicLink()){let m=s.depth===void 0?void 0:eg(p,mt.resolve(a.watchPath))+1;this._handleFsEventsSymlink(p,f,o,m)}else this.emitAdd(p,u.stats,o,s,n)}).on(hq,Tq).on(gq,()=>{this.fsw._emitReady()})}else this.emitAdd(a.watchPath,c,o,s,n),this.fsw._emitReady()}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(s.persistent&&n!==!0)if(typeof t===Zm)this.initWatch(void 0,e,a,o);else{let c;try{c=await UA(a.watchPath)}catch{}this.initWatch(c,e,a,o)}}};sg.exports=rg;sg.exports.canUse=Lq});var nR=O(_g=>{"use strict";var{EventEmitter:Dq}=require("events"),xg=require("fs"),ce=require("path"),{promisify:ZA}=require("util"),Bq=pC(),pg=HC().default,jq=zC(),og=Fm(),Fq=RA(),Hq=Bm(),$q=FA(),KA=zA(),{EV_ALL:ag,EV_READY:qq,EV_ADD:Iu,EV_CHANGE:ha,EV_UNLINK:VA,EV_ADD_DIR:Uq,EV_UNLINK_DIR:Wq,EV_RAW:Gq,EV_ERROR:cg,STR_CLOSE:zq,STR_END:Kq,BACK_SLASH_RE:Vq,DOUBLE_SLASH_RE:YA,SLASH_OR_BACK_SLASH_RE:Yq,DOT_RE:Xq,REPLACER_RE:Jq,SLASH:lg,SLASH_SLASH:Qq,BRACE_START:Zq,BANG:fg,ONE_DOT:eR,TWO_DOTS:eU,GLOBSTAR:tU,SLASH_GLOBSTAR:ug,ANYMATCH_OPTS:dg,STRING_TYPE:yg,FUNCTION_TYPE:rU,EMPTY_STR:hg,EMPTY_FN:nU,isWindows:iU,isMacos:sU,isIBMi:oU}=Au(),aU=ZA(xg.stat),cU=ZA(xg.readdir),mg=(r=[])=>Array.isArray(r)?r:[r],tR=(r,e=[])=>(r.forEach(t=>{Array.isArray(t)?tR(t,e):e.push(t)}),e),XA=r=>{let e=tR(mg(r));if(!e.every(t=>typeof t===yg))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(rR)},JA=r=>{let e=r.replace(Vq,lg),t=!1;for(e.startsWith(Qq)&&(t=!0);e.match(YA);)e=e.replace(YA,lg);return t&&(e=lg+e),e},rR=r=>JA(ce.normalize(JA(r))),QA=(r=hg)=>e=>typeof e!==yg?e:rR(ce.isAbsolute(e)?e:ce.join(r,e)),lU=(r,e)=>ce.isAbsolute(r)?r:r.startsWith(fg)?fg+ce.join(e,r.slice(1)):ce.join(e,r),Pr=(r,e)=>r[e]===void 0,gg=class{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==eR&&e!==eU&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let n=this.path;try{await cU(n)}catch{this._removeWatcher&&this._removeWatcher(ce.dirname(n),ce.basename(n))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}},uU="stat",pU="lstat",vg=class{constructor(e,t,n,i){this.fsw=i,this.path=e=e.replace(Jq,hg),this.watchPath=t,this.fullWatchPath=ce.resolve(t),this.hasGlob=t!==e,e===hg&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?pg(e,void 0,dg):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(s=>{s.length>1&&s.pop()}),this.followSymlinks=n,this.statMethod=n?uU:pU}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return ce.join(this.watchPath,ce.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===rU?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}getDirParts(e){if(!this.hasGlob)return[];let t=[];return(e.includes(Zq)?Fq.expand(e):[e]).forEach(i=>{t.push(ce.relative(this.watchPath,i).split(Yq))}),t}filterDir(e){if(this.hasGlob){let t=this.getDirParts(this.checkGlobSymlink(e)),n=!1;this.unmatchedGlob=!this.dirParts.some(i=>i.every((s,o)=>(s===tU&&(n=!0),n||!t[0][o]||pg(s,t[0][o],dg))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Nu=class extends Dq{constructor(e){super();let t={};e&&Object.assign(t,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,Pr(t,"persistent")&&(t.persistent=!0),Pr(t,"ignoreInitial")&&(t.ignoreInitial=!1),Pr(t,"ignorePermissionErrors")&&(t.ignorePermissionErrors=!1),Pr(t,"interval")&&(t.interval=100),Pr(t,"binaryInterval")&&(t.binaryInterval=300),Pr(t,"disableGlobbing")&&(t.disableGlobbing=!1),t.enableBinaryInterval=t.binaryInterval!==t.interval,Pr(t,"useFsEvents")&&(t.useFsEvents=!t.usePolling),KA.canUse()||(t.useFsEvents=!1),Pr(t,"usePolling")&&!t.useFsEvents&&(t.usePolling=sU),oU&&(t.usePolling=!0);let i=process.env.CHOKIDAR_USEPOLLING;if(i!==void 0){let c=i.toLowerCase();c==="false"||c==="0"?t.usePolling=!1:c==="true"||c==="1"?t.usePolling=!0:t.usePolling=!!c}let s=process.env.CHOKIDAR_INTERVAL;s&&(t.interval=Number.parseInt(s,10)),Pr(t,"atomic")&&(t.atomic=!t.usePolling&&!t.useFsEvents),t.atomic&&(this._pendingUnlinks=new Map),Pr(t,"followSymlinks")&&(t.followSymlinks=!0),Pr(t,"awaitWriteFinish")&&(t.awaitWriteFinish=!1),t.awaitWriteFinish===!0&&(t.awaitWriteFinish={});let o=t.awaitWriteFinish;o&&(o.stabilityThreshold||(o.stabilityThreshold=2e3),o.pollInterval||(o.pollInterval=100),this._pendingWrites=new Map),t.ignored&&(t.ignored=mg(t.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=nU,this._readyEmitted=!0,process.nextTick(()=>this.emit(qq)))},this._emitRaw=(...c)=>this.emit(Gq,...c),this._readyEmitted=!1,this.options=t,t.useFsEvents?this._fsEventsHandler=new KA(this):this._nodeFsHandler=new $q(this),Object.freeze(t)}add(e,t,n){let{cwd:i,disableGlobbing:s}=this.options;this.closed=!1;let o=XA(e);return i&&(o=o.map(a=>{let c=lU(a,i);return s||!og(a)?c:Hq(c)})),o=o.filter(a=>a.startsWith(fg)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+ug),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=o.length),this.options.persistent&&(this._readyCount+=o.length),o.forEach(a=>this._fsEventsHandler._addToFsEvents(a))):(this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async a=>{let c=await this._nodeFsHandler._addToNodeFs(a,!n,0,0,t);return c&&this._emitReady(),c})).then(a=>{this.closed||a.filter(c=>c).forEach(c=>{this.add(ce.dirname(c),ce.basename(t||c))})})),this}unwatch(e){if(this.closed)return this;let t=XA(e),{cwd:n}=this.options;return t.forEach(i=>{!ce.isAbsolute(i)&&!this._closers.has(i)&&(n&&(i=ce.join(n,i)),i=ce.resolve(i)),this._closePath(i),this._ignoredPaths.add(i),this._watched.has(i)&&this._ignoredPaths.add(i+ug),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(n=>{let i=n();i instanceof Promise&&e.push(i)})),this._streams.forEach(t=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(t=>t.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(t=>{this[`_${t}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,n)=>{let i=this.options.cwd?ce.relative(this.options.cwd,n):n;e[i||eR]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(...t),e!==cg&&this.emit(ag,...t)}async _emit(e,t,n,i,s){if(this.closed)return;let o=this.options;iU&&(t=ce.normalize(t)),o.cwd&&(t=ce.relative(o.cwd,t));let a=[e,t];s!==void 0?a.push(n,i,s):i!==void 0?a.push(n,i):n!==void 0&&a.push(n);let c=o.awaitWriteFinish,u;if(c&&(u=this._pendingWrites.get(t)))return u.lastChange=new Date,this;if(o.atomic){if(e===VA)return this._pendingUnlinks.set(t,a),setTimeout(()=>{this._pendingUnlinks.forEach((p,f)=>{this.emit(...p),this.emit(ag,...p),this._pendingUnlinks.delete(f)})},typeof o.atomic=="number"?o.atomic:100),this;e===Iu&&this._pendingUnlinks.has(t)&&(e=a[0]=ha,this._pendingUnlinks.delete(t))}if(c&&(e===Iu||e===ha)&&this._readyEmitted){let p=(f,m)=>{f?(e=a[0]=cg,a[1]=f,this.emitWithAll(e,a)):m&&(a.length>2?a[2]=m:a.push(m),this.emitWithAll(e,a))};return this._awaitWriteFinish(t,c.stabilityThreshold,e,p),this}if(e===ha&&!this._throttle(ha,t,50))return this;if(o.alwaysStat&&n===void 0&&(e===Iu||e===Uq||e===ha)){let p=o.cwd?ce.join(o.cwd,t):t,f;try{f=await aU(p)}catch{}if(!f||this.closed)return;a.push(f)}return this.emitWithAll(e,a),this}_handleError(e){let t=e&&e.code;return e&&t!=="ENOENT"&&t!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||t!=="EPERM"&&t!=="EACCES")&&this.emit(cg,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);let i=this._throttled.get(e),s=i.get(t);if(s)return s.count++,!1;let o,a=()=>{let u=i.get(t),p=u?u.count:0;return i.delete(t),clearTimeout(o),u&&clearTimeout(u.timeoutObject),p};o=setTimeout(a,n);let c={timeoutObject:o,clear:a,count:0};return i.set(t,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,i){let s,o=e;this.options.cwd&&!ce.isAbsolute(e)&&(o=ce.join(this.options.cwd,e));let a=new Date,c=u=>{xg.stat(o,(p,f)=>{if(p||!this._pendingWrites.has(e)){p&&p.code!=="ENOENT"&&i(p);return}let m=Number(new Date);u&&f.size!==u.size&&(this._pendingWrites.get(e).lastChange=m);let y=this._pendingWrites.get(e);m-y.lastChange>=t?(this._pendingWrites.delete(e),i(void 0,f)):s=setTimeout(c,this.options.awaitWriteFinish.pollInterval,f)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:a,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(s),n)}),s=setTimeout(c,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,t){if(this.options.atomic&&Xq.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,i=this.options.ignored,s=i&&i.map(QA(n)),o=mg(s).filter(c=>typeof c===yg&&!og(c)).map(c=>c+ug),a=this._getGlobIgnored().map(QA(n)).concat(s,o);this._userIgnored=pg(a,void 0,dg)}return this._userIgnored([e,t])}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e,t){let n=t||this.options.disableGlobbing||!og(e)?e:jq(e),i=this.options.followSymlinks;return new vg(e,n,i,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let t=ce.resolve(e);return this._watched.has(t)||this._watched.set(t,new gg(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;let n=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(n.toString(8)[0],10))}_remove(e,t,n){let i=ce.join(e,t),s=ce.resolve(i);if(n=n??(this._watched.has(i)||this._watched.has(s)),!this._throttle("remove",i,100))return;!n&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(i).getChildren().forEach(m=>this._remove(i,m));let c=this._getWatchedDir(e),u=c.has(t);c.remove(t),this._symlinkPaths.has(s)&&this._symlinkPaths.delete(s);let p=i;if(this.options.cwd&&(p=ce.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(p)&&this._pendingWrites.get(p).cancelWait()===Iu)return;this._watched.delete(i),this._watched.delete(s);let f=n?Wq:VA;u&&!this._isIgnored(i)&&this._emit(f,i),this.options.useFsEvents||this._closePath(i)}_closePath(e){this._closeFile(e);let t=ce.dirname(e);this._getWatchedDir(t).remove(ce.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(n=>n()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(t)}_readdirp(e,t){if(this.closed)return;let n={type:ag,alwaysStat:!0,lstat:!0,...t},i=Bq(e,n);return this._streams.add(i),i.once(zq,()=>{i=void 0}),i.once(Kq,()=>{i&&(this._streams.delete(i),i=void 0)}),i}};_g.FSWatcher=Nu;var fU=(r,e)=>{let t=new Nu(e);return t.add(r),t};_g.watch=fU});var KR=O((AK,Tg)=>{"use strict";var yU=Object.prototype.hasOwnProperty,Mt="~";function _a(){}Object.create&&(_a.prototype=Object.create(null),new _a().__proto__||(Mt=!1));function _U(r,e,t){this.fn=r,this.context=e,this.once=t||!1}function zR(r,e,t,n,i){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new _U(t,n||r,i),o=Mt?Mt+e:e;return r._events[o]?r._events[o].fn?r._events[o]=[r._events[o],s]:r._events[o].push(s):(r._events[o]=s,r._eventsCount++),r}function $u(r,e){--r._eventsCount===0?r._events=new _a:delete r._events[e]}function Ct(){this._events=new _a,this._eventsCount=0}Ct.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)yU.call(t,n)&&e.push(Mt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Ct.prototype.listeners=function(e){var t=Mt?Mt+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=new Array(s);i<s;i++)o[i]=n[i].fn;return o};Ct.prototype.listenerCount=function(e){var t=Mt?Mt+e:e,n=this._events[t];return n?n.fn?1:n.length:0};Ct.prototype.emit=function(e,t,n,i,s,o){var a=Mt?Mt+e:e;if(!this._events[a])return!1;var c=this._events[a],u=arguments.length,p,f;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,s),!0;case 6:return c.fn.call(c.context,t,n,i,s,o),!0}for(f=1,p=new Array(u-1);f<u;f++)p[f-1]=arguments[f];c.fn.apply(c.context,p)}else{var m=c.length,y;for(f=0;f<m;f++)switch(c[f].once&&this.removeListener(e,c[f].fn,void 0,!0),u){case 1:c[f].fn.call(c[f].context);break;case 2:c[f].fn.call(c[f].context,t);break;case 3:c[f].fn.call(c[f].context,t,n);break;case 4:c[f].fn.call(c[f].context,t,n,i);break;default:if(!p)for(y=1,p=new Array(u-1);y<u;y++)p[y-1]=arguments[y];c[f].fn.apply(c[f].context,p)}}return!0};Ct.prototype.on=function(e,t,n){return zR(this,e,t,n,!1)};Ct.prototype.once=function(e,t,n){return zR(this,e,t,n,!0)};Ct.prototype.removeListener=function(e,t,n,i){var s=Mt?Mt+e:e;if(!this._events[s])return this;if(!t)return $u(this,s),this;var o=this._events[s];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&$u(this,s);else{for(var a=0,c=[],u=o.length;a<u;a++)(o[a].fn!==t||i&&!o[a].once||n&&o[a].context!==n)&&c.push(o[a]);c.length?this._events[s]=c.length===1?c[0]:c:$u(this,s)}return this};Ct.prototype.removeAllListeners=function(e){var t;return e?(t=Mt?Mt+e:e,this._events[t]&&$u(this,t)):(this._events=new _a,this._eventsCount=0),this};Ct.prototype.off=Ct.prototype.removeListener;Ct.prototype.addListener=Ct.prototype.on;Ct.prefixed=Mt;Ct.EventEmitter=Ct;typeof Tg<"u"&&(Tg.exports=Ct)});var YR=O((RK,VR)=>{"use strict";VR.exports=function(e,t){if(t=t.split(":")[0],e=+e,!e)return!1;switch(t){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}});var qu=O(JR=>{var Tn=JR,bU=require("url"),XR=require("util")._extend,wU=YR(),SU=/(^|,)\s*upgrade\s*($|,)/i,Cg=/^https|wss/;Tn.isSSL=Cg;Tn.setupOutgoing=function(r,e,t,n){r.port=e[n||"target"].port||(Cg.test(e[n||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(a){r[a]=e[n||"target"][a]}),r.method=e.method||t.method,r.headers=XR({},t.headers),e.headers&&XR(r.headers,e.headers),e.auth&&(r.auth=e.auth),e.ca&&(r.ca=e.ca),Cg.test(e[n||"target"].protocol)&&(r.rejectUnauthorized=typeof e.secure>"u"?!0:e.secure),r.agent=e.agent||!1,r.localAddress=e.localAddress,r.agent||(r.headers=r.headers||{},(typeof r.headers.connection!="string"||!SU.test(r.headers.connection))&&(r.headers.connection="close"));var i=e[n||"target"],s=i&&e.prependPath!==!1&&i.path||"",o=e.toProxy?t.url:bU.parse(t.url).path||"";return o=e.ignorePath?"":o,r.path=Tn.urlJoin(s,o),e.changeOrigin&&(r.headers.host=wU(r.port,e[n||"target"].protocol)&&!EU(r.host)?r.host+":"+r.port:r.host),r};Tn.setupSocket=function(r){return r.setTimeout(0),r.setNoDelay(!0),r.setKeepAlive(!0,0),r};Tn.getPort=function(r){var e=r.headers.host?r.headers.host.match(/:(\d+)/):"";return e?e[1]:Tn.hasEncryptedConnection(r)?"443":"80"};Tn.hasEncryptedConnection=function(r){return!!(r.connection.encrypted||r.connection.pair)};Tn.urlJoin=function(){var r=Array.prototype.slice.call(arguments),e=r.length-1,t=r[e],n=t.split("?"),i;return r[e]=n.shift(),i=[r.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")],i.push.apply(i,n),i.join("?")};Tn.rewriteCookieProperty=function r(e,t,n){return Array.isArray(e)?e.map(function(i){return r(i,t,n)}):e.replace(new RegExp("(;\\s*"+n+"=)([^;]+)","i"),function(i,s,o){var a;if(o in t)a=t[o];else if("*"in t)a=t["*"];else return i;return a?s+a:""})};function EU(r){return!!~r.indexOf(":")}});var tk=O((OK,ek)=>{var QR=require("url"),ZR=qu(),TU=/^201|30(1|2|7|8)$/;ek.exports={removeChunked:function(e,t,n){e.httpVersion==="1.0"&&delete n.headers["transfer-encoding"]},setConnection:function(e,t,n){e.httpVersion==="1.0"?n.headers.connection=e.headers.connection||"close":e.httpVersion!=="2.0"&&!n.headers.connection&&(n.headers.connection=e.headers.connection||"keep-alive")},setRedirectHostRewrite:function(e,t,n,i){if((i.hostRewrite||i.autoRewrite||i.protocolRewrite)&&n.headers.location&&TU.test(n.statusCode)){var s=QR.parse(i.target),o=QR.parse(n.headers.location);if(s.host!=o.host)return;i.hostRewrite?o.host=i.hostRewrite:i.autoRewrite&&(o.host=e.headers.host),i.protocolRewrite&&(o.protocol=i.protocolRewrite),n.headers.location=o.format()}},writeHeaders:function(e,t,n,i){var s=i.cookieDomainRewrite,o=i.cookiePathRewrite,a=i.preserveHeaderKeyCase,c,u=function(m,y){y!=null&&(s&&m.toLowerCase()==="set-cookie"&&(y=ZR.rewriteCookieProperty(y,s,"domain")),o&&m.toLowerCase()==="set-cookie"&&(y=ZR.rewriteCookieProperty(y,o,"path")),t.setHeader(String(m).trim(),y))};if(typeof s=="string"&&(s={"*":s}),typeof o=="string"&&(o={"*":o}),a&&n.rawHeaders!=null){c={};for(var p=0;p<n.rawHeaders.length;p+=2){var f=n.rawHeaders[p];c[f.toLowerCase()]=f}}Object.keys(n.headers).forEach(function(m){var y=n.headers[m];a&&c&&(m=c[m]||m),u(m,y)})},writeStatusCode:function(e,t,n){n.statusMessage?(t.statusCode=n.statusCode,t.statusMessage=n.statusMessage):t.statusCode=n.statusCode}}});var nk=O((PK,rk)=>{var ba;rk.exports=function(){if(!ba){try{ba=Ce()("follow-redirects")}catch{}typeof ba!="function"&&(ba=function(){})}ba.apply(null,arguments)}});var ck=O((MK,jg)=>{var Sa=require("url"),wa=Sa.URL,CU=require("http"),AU=require("https"),Pg=require("stream").Writable,Mg=require("assert"),ik=nk();(function(){var e=typeof process<"u",t=typeof window<"u"&&typeof document<"u",n=Ei(Error.captureStackTrace);!e&&(t||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var Ig=!1;try{Mg(new wa(""))}catch(r){Ig=r.code==="ERR_INVALID_URL"}var RU=["Authorization","Proxy-Authorization","Cookie"],kU=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],Ng=["abort","aborted","connect","error","socket","timeout"],Lg=Object.create(null);Ng.forEach(function(r){Lg[r]=function(e,t,n){this._redirectable.emit(r,e,t,n)}});var Rg=Ea("ERR_INVALID_URL","Invalid URL",TypeError),kg=Ea("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),OU=Ea("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",kg),PU=Ea("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),MU=Ea("ERR_STREAM_WRITE_AFTER_END","write after end"),IU=Pg.prototype.destroy||ok;function Wt(r,e){Pg.call(this),this._sanitizeOptions(r),this._options=r,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var t=this;this._onNativeResponse=function(n){try{t._processResponse(n)}catch(i){t.emit("error",i instanceof kg?i:new kg({cause:i}))}},this._headerFilter=new RegExp("^(?:"+RU.concat(r.sensitiveHeaders).map(FU).join("|")+")$","i"),this._performRequest()}Wt.prototype=Object.create(Pg.prototype);Wt.prototype.abort=function(){Bg(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Wt.prototype.destroy=function(r){return Bg(this._currentRequest,r),IU.call(this,r),this};Wt.prototype.write=function(r,e,t){if(this._ending)throw new MU;if(!Si(r)&&!BU(r))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Ei(e)&&(t=e,e=null),r.length===0){t&&t();return}this._requestBodyLength+r.length<=this._options.maxBodyLength?(this._requestBodyLength+=r.length,this._requestBodyBuffers.push({data:r,encoding:e}),this._currentRequest.write(r,e,t)):(this.emit("error",new PU),this.abort())};Wt.prototype.end=function(r,e,t){if(Ei(r)?(t=r,r=e=null):Ei(e)&&(t=e,e=null),!r)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var n=this,i=this._currentRequest;this.write(r,e,function(){n._ended=!0,i.end(null,null,t)}),this._ending=!0}};Wt.prototype.setHeader=function(r,e){this._options.headers[r]=e,this._currentRequest.setHeader(r,e)};Wt.prototype.removeHeader=function(r){delete this._options.headers[r],this._currentRequest.removeHeader(r)};Wt.prototype.setTimeout=function(r,e){var t=this;function n(o){o.setTimeout(r),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function i(o){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),s()},r),n(o)}function s(){t._timeout&&(clearTimeout(t._timeout),t._timeout=null),t.removeListener("abort",s),t.removeListener("error",s),t.removeListener("response",s),t.removeListener("close",s),e&&t.removeListener("timeout",e),t.socket||t._currentRequest.removeListener("socket",i)}return e&&this.on("timeout",e),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",n),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(r){Wt.prototype[r]=function(e,t){return this._currentRequest[r](e,t)}});["aborted","connection","socket"].forEach(function(r){Object.defineProperty(Wt.prototype,r,{get:function(){return this._currentRequest[r]}})});Wt.prototype._sanitizeOptions=function(r){if(r.headers||(r.headers={}),DU(r.sensitiveHeaders)||(r.sensitiveHeaders=[]),r.host&&(r.hostname||(r.hostname=r.host),delete r.host),!r.pathname&&r.path){var e=r.path.indexOf("?");e<0?r.pathname=r.path:(r.pathname=r.path.substring(0,e),r.search=r.path.substring(e))}};Wt.prototype._performRequest=function(){var r=this._options.protocol,e=this._options.nativeProtocols[r];if(!e)throw new TypeError("Unsupported protocol "+r);if(this._options.agents){var t=r.slice(0,-1);this._options.agent=this._options.agents[t]}var n=this._currentRequest=e.request(this._options,this._onNativeResponse);n._redirectable=this;for(var i of Ng)n.on(i,Lg[i]);if(this._currentUrl=/^\//.test(this._options.path)?Sa.format(this._options):this._options.path,this._isRedirect){var s=0,o=this,a=this._requestBodyBuffers;(function c(u){if(n===o._currentRequest)if(u)o.emit("error",u);else if(s<a.length){var p=a[s++];n.finished||n.write(p.data,p.encoding,c)}else o._ended&&n.end()})()}};Wt.prototype._processResponse=function(r){var e=r.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:r.headers,statusCode:e});var t=r.headers.location;if(!t||this._options.followRedirects===!1||e<300||e>=400){r.responseUrl=this._currentUrl,r.redirects=this._redirects,this.emit("response",r),this._requestBodyBuffers=[];return}if(Bg(this._currentRequest),r.destroy(),++this._redirectCount>this._options.maxRedirects)throw new OU;var n,i=this._options.beforeRedirect;i&&(n=Object.assign({Host:r.req.getHeader("host")},this._options.headers));var s=this._options.method;((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Ag(/^content-/i,this._options.headers));var o=Ag(/^host$/i,this._options.headers),a=Dg(this._currentUrl),c=o||a.host,u=/^\w+:/.test(t)?this._currentUrl:Sa.format(Object.assign(a,{host:c})),p=NU(t,u);if(ik("redirecting to",p.href),this._isRedirect=!0,Og(p,this._options),(p.protocol!==a.protocol&&p.protocol!=="https:"||p.host!==c&&!LU(p.host,c))&&Ag(this._headerFilter,this._options.headers),Ei(i)){var f={headers:r.headers,statusCode:e},m={url:u,method:s,headers:n};i(this._options,f,m),this._sanitizeOptions(this._options)}this._performRequest()};function sk(r){var e={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(r).forEach(function(n){var i=n+":",s=t[i]=r[n],o=e[n]=Object.create(s);function a(u,p,f){return jU(u)?u=Og(u):Si(u)?u=Og(Dg(u)):(f=p,p=ak(u),u={protocol:i}),Ei(p)&&(f=p,p=null),p=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},u,p),p.nativeProtocols=t,!Si(p.host)&&!Si(p.hostname)&&(p.hostname="::1"),Mg.equal(p.protocol,i,"protocol mismatch"),ik("options",p),new Wt(p,f)}function c(u,p,f){var m=o.request(u,p,f);return m.end(),m}Object.defineProperties(o,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),e}function ok(){}function Dg(r){var e;if(Ig)e=new wa(r);else if(e=ak(Sa.parse(r)),!Si(e.protocol))throw new Rg({input:r});return e}function NU(r,e){return Ig?new wa(r,e):Dg(Sa.resolve(e,r))}function ak(r){if(/^\[/.test(r.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(r.hostname))throw new Rg({input:r.href||r});if(/^\[/.test(r.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(r.host))throw new Rg({input:r.href||r});return r}function Og(r,e){var t=e||{};for(var n of kU)t[n]=r[n];return t.hostname.startsWith("[")&&(t.hostname=t.hostname.slice(1,-1)),t.port!==""&&(t.port=Number(t.port)),t.path=t.search?t.pathname+t.search:t.pathname,t}function Ag(r,e){var t;for(var n in e)r.test(n)&&(t=e[n],delete e[n]);return t===null||typeof t>"u"?void 0:String(t).trim()}function Ea(r,e,t){function n(i){Ei(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,i||{}),this.code=r,this.message=this.cause?e+": "+this.cause.message:e}return n.prototype=new(t||Error),Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:!1},name:{value:"Error ["+r+"]",enumerable:!1}}),n}function Bg(r,e){for(var t of Ng)r.removeListener(t,Lg[t]);r.on("error",ok),r.destroy(e)}function LU(r,e){Mg(Si(r)&&Si(e));var t=r.length-e.length-1;return t>0&&r[t]==="."&&r.endsWith(e)}function DU(r){return r instanceof Array}function Si(r){return typeof r=="string"||r instanceof String}function Ei(r){return typeof r=="function"}function BU(r){return typeof r=="object"&&"length"in r}function jU(r){return wa&&r instanceof wa}function FU(r){return r.replace(/[\]\\/()*+?.$]/g,"\\$&")}jg.exports=sk({http:CU,https:AU});jg.exports.wrap=sk});var uk=O((IK,lk)=>{var HU=require("http"),$U=require("https"),Ta=tk(),Uu=qu(),qU=ck();Ta=Object.keys(Ta).map(function(r){return Ta[r]});var UU={http:HU,https:$U};lk.exports={deleteLength:function(e,t,n){(e.method==="DELETE"||e.method==="OPTIONS")&&!e.headers["content-length"]&&(e.headers["content-length"]="0",delete e.headers["transfer-encoding"])},timeout:function(e,t,n){n.timeout&&e.socket.setTimeout(n.timeout)},XHeaders:function(e,t,n){if(n.xfwd){var i=e.isSpdy||Uu.hasEncryptedConnection(e),s={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Uu.getPort(e),proto:i?"https":"http"};["for","port","proto"].forEach(function(o){e.headers["x-forwarded-"+o]=(e.headers["x-forwarded-"+o]||"")+(e.headers["x-forwarded-"+o]?",":"")+s[o]}),e.headers["x-forwarded-host"]=e.headers["x-forwarded-host"]||e.headers.host||""}},stream:function(e,t,n,i,s,o){s.emit("start",e,t,n.target||n.forward);var a=n.followRedirects?qU:UU,c=a.http,u=a.https;if(n.forward){var p=(n.forward.protocol==="https:"?u:c).request(Uu.setupOutgoing(n.ssl||{},n,e,"forward")),f=_(p,n.forward);if(e.on("error",f),p.on("error",f),(n.buffer||e).pipe(p),!n.target)return t.end()}var m=(n.target.protocol==="https:"?u:c).request(Uu.setupOutgoing(n.ssl||{},n,e));m.on("socket",function(S){s&&!m.getHeader("expect")&&s.emit("proxyReq",m,e,t,n)}),n.proxyTimeout&&m.setTimeout(n.proxyTimeout,function(){m.abort()}),e.on("aborted",function(){m.abort()});var y=_(m,n.target);e.on("error",y),m.on("error",y);function _(S,A){return function(L){if(e.socket.destroyed&&L.code==="ECONNRESET")return s.emit("econnreset",L,e,t,A),S.abort();o?o(L,e,t,A):s.emit("error",L,e,t,A)}}(n.buffer||e).pipe(m),m.on("response",function(S){if(s&&s.emit("proxyRes",S,e,t),!t.headersSent&&!n.selfHandleResponse)for(var A=0;A<Ta.length&&!Ta[A](e,t,S,n);A++);t.finished?s&&s.emit("end",e,t,S):(S.on("end",function(){s&&s.emit("end",e,t,S)}),n.selfHandleResponse||S.pipe(t))})}}});var fk=O((NK,pk)=>{var WU=require("http"),GU=require("https"),Vs=qu();pk.exports={checkMethodAndHeader:function(e,t){if(e.method!=="GET"||!e.headers.upgrade||e.headers.upgrade.toLowerCase()!=="websocket")return t.destroy(),!0},XHeaders:function(e,t,n){if(n.xfwd){var i={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Vs.getPort(e),proto:Vs.hasEncryptedConnection(e)?"wss":"ws"};["for","port","proto"].forEach(function(s){e.headers["x-forwarded-"+s]=(e.headers["x-forwarded-"+s]||"")+(e.headers["x-forwarded-"+s]?",":"")+i[s]})}},stream:function(e,t,n,i,s,o){var a=function(p,f){return Object.keys(f).reduce(function(m,y){var _=f[y];if(!Array.isArray(_))return m.push(y+": "+_),m;for(var S=0;S<_.length;S++)m.push(y+": "+_[S]);return m},[p]).join(`\r
98
+ `;let c=(0,HF.parseProxyResponse)(i);i.write(`${a}\r
99
+ `);let{connect:u,buffered:p}=await c;if(e.emit("proxyConnect",u),this.emit("proxyConnect",u,e),u.statusCode===200)return e.once("socket",$F),t.secureEndpoint?(Vo("Upgrading socket connection to TLS"),rT.connect({...iT(nT(t),"host","path","port"),socket:i})):i;i.destroy();let f=new su.Socket({writable:!1});return f.readable=!0,e.once("socket",m=>{Vo("Replaying proxy buffer for failed request"),(0,DF.default)(m.listenerCount("data")>0),m.push(p),m.push(null)}),f}};ou.protocols=["http","https"];vr.HttpsProxyAgent=ou;function $F(r){r.resume()}function iT(r,...e){let t={},n;for(n in r)e.includes(n)||(t[n]=r[n]);return t}});var fT=O((KG,pT)=>{"use strict";var lT=require("url"),uT=require("https"),qF=cm(),au=im(),UF=am(),Zt=eu(),WF=rm(),cT=2419200,um="",pm;function Yo(){}Yo.prototype.setGCMAPIKey=function(r){if(r===null){um=null;return}if(typeof r>"u"||typeof r!="string"||r.length===0)throw new Error("The GCM API Key should be a non-empty string or null.");um=r};Yo.prototype.setVapidDetails=function(r,e,t){if(arguments.length===1&&arguments[0]===null){pm=null;return}au.validateSubject(r),au.validatePublicKey(e),au.validatePrivateKey(t),pm={subject:r,publicKey:e,privateKey:t}};Yo.prototype.generateRequestDetails=function(r,e,t){if(!r||!r.endpoint)throw new Error("You must pass in a subscription with at least an endpoint.");if(typeof r.endpoint!="string"||r.endpoint.length===0)throw new Error("The subscription endpoint must be a string with a valid URL.");if(e&&(typeof r!="object"||!r.keys||!r.keys.p256dh||!r.keys.auth))throw new Error("To send a message with a payload, the subscription must have 'auth' and 'p256dh' keys.");let n=um,i=pm,s=cT,o={},a=Zt.supportedContentEncodings.AES_128_GCM,c=Zt.supportedUrgency.NORMAL,u,p,f,m;if(t){let P=["headers","gcmAPIKey","vapidDetails","TTL","contentEncoding","urgency","topic","proxy","agent","timeout"],L=Object.keys(t);for(let N=0;N<L.length;N+=1){let H=L[N];if(!P.includes(H))throw new Error("'"+H+"' is an invalid option. The valid options are ['"+P.join("', '")+"'].")}if(t.headers){o=t.headers;let N=Object.keys(o).filter(function(H){return typeof t[H]<"u"});if(N.length>0)throw new Error("Duplicated headers defined ["+N.join(",")+"]. Please either define the header in thetop level options OR in the 'headers' key.")}if(t.gcmAPIKey&&(n=t.gcmAPIKey),t.vapidDetails!==void 0&&(i=t.vapidDetails),t.TTL!==void 0&&(s=Number(t.TTL),s<0))throw new Error("TTL should be a number and should be at least 0");if(t.contentEncoding)if(t.contentEncoding===Zt.supportedContentEncodings.AES_128_GCM||t.contentEncoding===Zt.supportedContentEncodings.AES_GCM)a=t.contentEncoding;else throw new Error("Unsupported content encoding specified.");if(t.urgency)if(t.urgency===Zt.supportedUrgency.VERY_LOW||t.urgency===Zt.supportedUrgency.LOW||t.urgency===Zt.supportedUrgency.NORMAL||t.urgency===Zt.supportedUrgency.HIGH)c=t.urgency;else throw new Error("Unsupported urgency specified.");if(t.topic){if(!WF.validate(t.topic))throw new Error("Unsupported characters set use the URL or filename-safe Base64 characters set");if(t.topic.length>32)throw new Error("use maximum of 32 characters from the URL or filename-safe Base64 characters set");u=t.topic}t.proxy&&(typeof t.proxy=="string"||typeof t.proxy.host=="string"?p=t.proxy:console.warn("Attempt to use proxy option, but invalid type it should be a string or proxy options object.")),t.agent&&(t.agent instanceof uT.Agent?(p&&console.warn("Agent option will be ignored because proxy option is defined."),f=t.agent):console.warn("Wrong type for the agent option, it should be an instance of https.Agent.")),typeof t.timeout=="number"&&(m=t.timeout)}typeof s>"u"&&(s=cT);let y={method:"POST",headers:{TTL:s}};Object.keys(o).forEach(function(P){y.headers[P]=o[P]});let _=null;if(e){let P=UF.encrypt(r.keys.p256dh,r.keys.auth,e,a);y.headers["Content-Length"]=P.cipherText.length,y.headers["Content-Type"]="application/octet-stream",a===Zt.supportedContentEncodings.AES_128_GCM?y.headers["Content-Encoding"]=Zt.supportedContentEncodings.AES_128_GCM:a===Zt.supportedContentEncodings.AES_GCM&&(y.headers["Content-Encoding"]=Zt.supportedContentEncodings.AES_GCM,y.headers.Encryption="salt="+P.salt,y.headers["Crypto-Key"]="dh="+P.localPublicKey.toString("base64url")),_=P.cipherText}else y.headers["Content-Length"]=0;let S=r.endpoint.startsWith("https://android.googleapis.com/gcm/send"),A=r.endpoint.startsWith("https://fcm.googleapis.com/fcm/send");if(S)n?y.headers.Authorization="key="+n:console.warn("Attempt to send push notification to GCM endpoint, but no GCM key is defined. Please use setGCMApiKey() or add 'gcmAPIKey' as an option.");else if(i){let P=lT.parse(r.endpoint),L=P.protocol+"//"+P.host,N=au.getVapidHeaders(L,i.subject,i.publicKey,i.privateKey,a);y.headers.Authorization=N.Authorization,a===Zt.supportedContentEncodings.AES_GCM&&(y.headers["Crypto-Key"]?y.headers["Crypto-Key"]+=";"+N["Crypto-Key"]:y.headers["Crypto-Key"]=N["Crypto-Key"])}else A&&n&&(y.headers.Authorization="key="+n);return y.headers.Urgency=c,u&&(y.headers.Topic=u),y.body=_,y.endpoint=r.endpoint,p&&(y.proxy=p),f&&(y.agent=f),m&&(y.timeout=m),y};Yo.prototype.sendNotification=function(r,e,t){let n;try{n=this.generateRequestDetails(r,e,t)}catch(i){return Promise.reject(i)}return new Promise(function(i,s){let o={},a=lT.parse(n.endpoint);if(o.hostname=a.hostname,o.port=a.port,o.path=a.path,o.headers=n.headers,o.method=n.method,n.timeout&&(o.timeout=n.timeout),n.agent&&(o.agent=n.agent),n.proxy){let{HttpsProxyAgent:u}=aT();o.agent=new u(n.proxy)}let c=uT.request(o,function(u){let p="";u.on("data",function(f){p+=f}),u.on("end",function(){u.statusCode<200||u.statusCode>299?s(new qF("Received unexpected response code",u.statusCode,u.headers,p,n.endpoint)):i({statusCode:u.statusCode,body:p,headers:u.headers})})});n.timeout&&c.on("timeout",function(){c.destroy(new Error("Socket timeout"))}),c.on("error",function(u){s(u)}),n.body&&c.write(n.body),c.end()})};pT.exports=Yo});var mT=O((VG,hT)=>{"use strict";var dT=im(),GF=am(),zF=fT(),KF=cm(),VF=eu(),Xo=new zF;hT.exports={WebPushError:KF,supportedContentEncodings:VF.supportedContentEncodings,encrypt:GF.encrypt,getVapidHeaders:dT.getVapidHeaders,generateVAPIDKeys:dT.generateVAPIDKeys,setGCMAPIKey:Xo.setGCMAPIKey,setVapidDetails:Xo.setVapidDetails,generateRequestDetails:Xo.generateRequestDetails,sendNotification:Xo.sendNotification.bind(Xo)}});var ta=O((Ez,GT)=>{"use strict";var v3=require("path"),zr="\\\\/",$T=`[^${zr}]`,x3=0,bn="\\.",y3="\\+",_3="\\?",hu="\\/",b3="(?=.)",qT="[^/]",hm=`(?:${hu}|$)`,UT=`(?:^|${hu})`,mm=`${bn}{1,2}${hm}`,w3=`(?!${bn})`,S3=`(?!${UT}${mm})`,E3=`(?!${bn}{0,1}${hm})`,T3=`(?!${mm})`,C3=`[^.${hu}]`,A3=`${qT}*?`,WT={DOT_LITERAL:bn,PLUS_LITERAL:y3,QMARK_LITERAL:_3,SLASH_LITERAL:hu,ONE_CHAR:b3,QMARK:qT,END_ANCHOR:hm,DOTS_SLASH:mm,NO_DOT:w3,NO_DOTS:S3,NO_DOT_SLASH:E3,NO_DOTS_SLASH:T3,QMARK_NO_DOT:C3,STAR:A3,START_ANCHOR:UT},R3={...WT,SLASH_LITERAL:`[${zr}]`,QMARK:$T,STAR:`${$T}*?`,DOTS_SLASH:`${bn}{1,2}(?:[${zr}]|$)`,NO_DOT:`(?!${bn})`,NO_DOTS:`(?!(?:^|[${zr}])${bn}{1,2}(?:[${zr}]|$))`,NO_DOT_SLASH:`(?!${bn}{0,1}(?:[${zr}]|$))`,NO_DOTS_SLASH:`(?!${bn}{1,2}(?:[${zr}]|$))`,QMARK_NO_DOT:`[^.${zr}]`,START_ANCHOR:`(?:^|[${zr}])`,END_ANCHOR:`(?:[${zr}]|$)`},k3={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};GT.exports={DEFAULT_MAX_EXTGLOB_RECURSION:x3,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:k3,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:v3.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?R3:WT}}});var mu=O($t=>{"use strict";var O3=require("path"),P3=process.platform==="win32",{REGEX_BACKSLASH:M3,REGEX_REMOVE_BACKSLASH:I3,REGEX_SPECIAL_CHARS:N3,REGEX_SPECIAL_CHARS_GLOBAL:L3}=ta();$t.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);$t.hasRegexChars=r=>N3.test(r);$t.isRegexChar=r=>r.length===1&&$t.hasRegexChars(r);$t.escapeRegex=r=>r.replace(L3,"\\$1");$t.toPosixSlashes=r=>r.replace(M3,"/");$t.removeBackslashes=r=>r.replace(I3,e=>e==="\\"?"":e);$t.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};$t.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:P3===!0||O3.sep==="\\";$t.escapeLast=(r,e,t)=>{let n=r.lastIndexOf(e,t);return n===-1?r:r[n-1]==="\\"?$t.escapeLast(r,e,n-1):`${r.slice(0,n)}\\${r.slice(n)}`};$t.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};$t.wrapOutput=(r,e={},t={})=>{let n=t.contains?"":"^",i=t.contains?"":"$",s=`${n}(?:${r})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var ZT=O((Cz,QT)=>{"use strict";var zT=mu(),{CHAR_ASTERISK:gm,CHAR_AT:D3,CHAR_BACKWARD_SLASH:ra,CHAR_COMMA:B3,CHAR_DOT:vm,CHAR_EXCLAMATION_MARK:xm,CHAR_FORWARD_SLASH:JT,CHAR_LEFT_CURLY_BRACE:ym,CHAR_LEFT_PARENTHESES:_m,CHAR_LEFT_SQUARE_BRACKET:j3,CHAR_PLUS:F3,CHAR_QUESTION_MARK:KT,CHAR_RIGHT_CURLY_BRACE:H3,CHAR_RIGHT_PARENTHESES:VT,CHAR_RIGHT_SQUARE_BRACKET:$3}=ta(),YT=r=>r===JT||r===ra,XT=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},q3=(r,e)=>{let t=e||{},n=r.length-1,i=t.parts===!0||t.scanToEnd===!0,s=[],o=[],a=[],c=r,u=-1,p=0,f=0,m=!1,y=!1,_=!1,S=!1,A=!1,P=!1,L=!1,N=!1,H=!1,W=!1,U=0,G,M,F={value:"",depth:0,isGlob:!1},T=()=>u>=n,l=()=>c.charCodeAt(u+1),h=()=>(G=M,c.charCodeAt(++u));for(;u<n;){M=h();let C;if(M===ra){L=F.backslashes=!0,M=h(),M===ym&&(P=!0);continue}if(P===!0||M===ym){for(U++;T()!==!0&&(M=h());){if(M===ra){L=F.backslashes=!0,h();continue}if(M===ym){U++;continue}if(P!==!0&&M===vm&&(M=h())===vm){if(m=F.isBrace=!0,_=F.isGlob=!0,W=!0,i===!0)continue;break}if(P!==!0&&M===B3){if(m=F.isBrace=!0,_=F.isGlob=!0,W=!0,i===!0)continue;break}if(M===H3&&(U--,U===0)){P=!1,m=F.isBrace=!0,W=!0;break}}if(i===!0)continue;break}if(M===JT){if(s.push(u),o.push(F),F={value:"",depth:0,isGlob:!1},W===!0)continue;if(G===vm&&u===p+1){p+=2;continue}f=u+1;continue}if(t.noext!==!0&&(M===F3||M===D3||M===gm||M===KT||M===xm)===!0&&l()===_m){if(_=F.isGlob=!0,S=F.isExtglob=!0,W=!0,M===xm&&u===p&&(H=!0),i===!0){for(;T()!==!0&&(M=h());){if(M===ra){L=F.backslashes=!0,M=h();continue}if(M===VT){_=F.isGlob=!0,W=!0;break}}continue}break}if(M===gm){if(G===gm&&(A=F.isGlobstar=!0),_=F.isGlob=!0,W=!0,i===!0)continue;break}if(M===KT){if(_=F.isGlob=!0,W=!0,i===!0)continue;break}if(M===j3){for(;T()!==!0&&(C=h());){if(C===ra){L=F.backslashes=!0,h();continue}if(C===$3){y=F.isBracket=!0,_=F.isGlob=!0,W=!0;break}}if(i===!0)continue;break}if(t.nonegate!==!0&&M===xm&&u===p){N=F.negated=!0,p++;continue}if(t.noparen!==!0&&M===_m){if(_=F.isGlob=!0,i===!0){for(;T()!==!0&&(M=h());){if(M===_m){L=F.backslashes=!0,M=h();continue}if(M===VT){W=!0;break}}continue}break}if(_===!0){if(W=!0,i===!0)continue;break}}t.noext===!0&&(S=!1,_=!1);let x=c,w="",g="";p>0&&(w=c.slice(0,p),c=c.slice(p),f-=p),x&&_===!0&&f>0?(x=c.slice(0,f),g=c.slice(f)):_===!0?(x="",g=c):x=c,x&&x!==""&&x!=="/"&&x!==c&&YT(x.charCodeAt(x.length-1))&&(x=x.slice(0,-1)),t.unescape===!0&&(g&&(g=zT.removeBackslashes(g)),x&&L===!0&&(x=zT.removeBackslashes(x)));let v={prefix:w,input:r,start:p,base:x,glob:g,isBrace:m,isBracket:y,isGlob:_,isExtglob:S,isGlobstar:A,negated:N,negatedExtglob:H};if(t.tokens===!0&&(v.maxDepth=0,YT(M)||o.push(F),v.tokens=o),t.parts===!0||t.tokens===!0){let C;for(let b=0;b<s.length;b++){let d=C?C+1:p,E=s[b],q=r.slice(d,E);t.tokens&&(b===0&&p!==0?(o[b].isPrefix=!0,o[b].value=w):o[b].value=q,XT(o[b]),v.maxDepth+=o[b].depth),(b!==0||q!=="")&&a.push(q),C=E}if(C&&C+1<r.length){let b=r.slice(C+1);a.push(b),t.tokens&&(o[o.length-1].value=b,XT(o[o.length-1]),v.maxDepth+=o[o.length-1].depth)}v.slashes=s,v.parts=a}return v};QT.exports=q3});var iC=O((Az,nC)=>{"use strict";var na=ta(),Tt=mu(),{MAX_LENGTH:gu,POSIX_REGEX_SOURCE:U3,REGEX_NON_SPECIAL_CHARS:W3,REGEX_SPECIAL_CHARS_BACKREF:G3,REPLACEMENTS:eC}=na,z3=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch{return r.map(i=>Tt.escapeRegex(i)).join("..")}return t},Ds=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,tC=r=>{let e=[],t=0,n=0,i=0,s="",o=!1;for(let a of r){if(o===!0){s+=a,o=!1;continue}if(a==="\\"){s+=a,o=!0;continue}if(a==='"'){i=i===1?0:1,s+=a;continue}if(i===0){if(a==="[")t++;else if(a==="]"&&t>0)t--;else if(t===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(s),s="";continue}}}s+=a}return e.push(s),e},K3=r=>{let e=!1;for(let t of r){if(e===!0){e=!1;continue}if(t==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(t))return!1}return!0},rC=r=>{let e=r.trim(),t=!0;for(;t===!0;)t=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),t=!0);if(K3(e))return e.replace(/\\(.)/g,"$1")},V3=r=>{let e=r.map(rC).filter(Boolean);for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let i=e[t],s=e[n],o=i[0];if(!(!o||i!==o.repeat(i.length)||s!==o.repeat(s.length))&&(i===s||i.startsWith(s)||s.startsWith(i)))return!0}return!1},bm=(r,e=!0)=>{if(r[0]!=="+"&&r[0]!=="*"||r[1]!=="(")return;let t=0,n=0,i=0,s=!1;for(let o=1;o<r.length;o++){let a=r[o];if(s===!0){s=!1;continue}if(a==="\\"){s=!0;continue}if(a==='"'){i=i===1?0:1;continue}if(i!==1){if(a==="["){t++;continue}if(a==="]"&&t>0){t--;continue}if(!(t>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&o!==r.length-1?void 0:{type:r[0],body:r.slice(2,o),end:o}}}}},Y3=r=>{let e=0,t=[];for(;e<r.length;){let i=bm(r.slice(e),!1);if(!i||i.type!=="*")return;let s=tC(i.body).map(a=>a.trim());if(s.length!==1)return;let o=rC(s[0]);if(!o||o.length!==1)return;t.push(o),e+=i.end+1}return t.length<1?void 0:`${t.length===1?Tt.escapeRegex(t[0]):`[${t.map(i=>Tt.escapeRegex(i)).join("")}]`}*`},X3=r=>{let e=0,t=r.trim(),n=bm(t);for(;n;)e++,t=n.body.trim(),n=bm(t);return e},J3=(r,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let t=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:na.DEFAULT_MAX_EXTGLOB_RECURSION,n=tC(r).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||V3(n)))return{risky:!0};for(let i of n){let s=Y3(i);if(s)return{risky:!0,safeOutput:s};if(X3(i)>t)return{risky:!0}}return{risky:!1}},wm=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=eC[r]||r;let t={...e},n=typeof t.maxLength=="number"?Math.min(gu,t.maxLength):gu,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:t.prepend||""},o=[s],a=t.capture?"":"?:",c=Tt.isWindows(e),u=na.globChars(c),p=na.extglobChars(u),{DOT_LITERAL:f,PLUS_LITERAL:m,SLASH_LITERAL:y,ONE_CHAR:_,DOTS_SLASH:S,NO_DOT:A,NO_DOT_SLASH:P,NO_DOTS_SLASH:L,QMARK:N,QMARK_NO_DOT:H,STAR:W,START_ANCHOR:U}=u,G=R=>`(${a}(?:(?!${U}${R.dot?S:f}).)*?)`,M=t.dot?"":A,F=t.dot?N:H,T=t.bash===!0?G(t):W;t.capture&&(T=`(${T})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let l={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};r=Tt.removePrefix(r,l),i=r.length;let h=[],x=[],w=[],g=s,v,C=()=>l.index===i-1,b=l.peek=(R=1)=>r[l.index+R],d=l.advance=()=>r[++l.index]||"",E=()=>r.slice(l.index+1),q=(R="",Y=0)=>{l.consumed+=R,l.index+=Y},I=R=>{l.output+=R.output!=null?R.output:R.value,q(R.value)},D=()=>{let R=1;for(;b()==="!"&&(b(2)!=="("||b(3)==="?");)d(),l.start++,R++;return R%2===0?!1:(l.negated=!0,l.start++,!0)},$=R=>{l[R]++,w.push(R)},K=R=>{l[R]--,w.pop()},B=R=>{if(g.type==="globstar"){let Y=l.braces>0&&(R.type==="comma"||R.type==="brace"),k=R.extglob===!0||h.length&&(R.type==="pipe"||R.type==="paren");R.type!=="slash"&&R.type!=="paren"&&!Y&&!k&&(l.output=l.output.slice(0,-g.output.length),g.type="star",g.value="*",g.output=T,l.output+=g.output)}if(h.length&&R.type!=="paren"&&(h[h.length-1].inner+=R.value),(R.value||R.output)&&I(R),g&&g.type==="text"&&R.type==="text"){g.value+=R.value,g.output=(g.output||"")+R.value;return}R.prev=g,o.push(R),g=R},me=(R,Y)=>{let k={...p[Y],conditions:1,inner:""};k.prev=g,k.parens=l.parens,k.output=l.output,k.startIndex=l.index,k.tokensIndex=o.length;let j=(t.capture?"(":"")+k.open;$("parens"),B({type:R,value:Y,output:l.output?"":_}),B({type:"paren",extglob:!0,value:d(),output:j}),h.push(k)},ie=R=>{let Y=r.slice(R.startIndex,l.index+1),k=r.slice(R.startIndex+2,l.index),j=J3(k,t);if((R.type==="plus"||R.type==="star")&&j.risky){let z=j.safeOutput?(R.output?"":_)+(t.capture?`(${j.safeOutput})`:j.safeOutput):void 0,ge=o[R.tokensIndex];ge.type="text",ge.value=Y,ge.output=z||Tt.escapeRegex(Y);for(let re=R.tokensIndex+1;re<o.length;re++)o[re].value="",o[re].output="",delete o[re].suffix;l.output=R.output+ge.output,l.backtrack=!0,B({type:"paren",extglob:!0,value:v,output:""}),K("parens");return}let J=R.close+(t.capture?")":""),V;if(R.type==="negate"){let z=T;if(R.inner&&R.inner.length>1&&R.inner.includes("/")&&(z=G(t)),(z!==T||C()||/^\)+$/.test(E()))&&(J=R.close=`)$))${z}`),R.inner.includes("*")&&(V=E())&&/^\.[^\\/.]+$/.test(V)){let ge=wm(V,{...e,fastpaths:!1}).output;J=R.close=`)${ge})${z})`}R.prev.type==="bos"&&(l.negatedExtglob=!0)}B({type:"paren",extglob:!0,value:v,output:J}),K("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let R=!1,Y=r.replace(G3,(k,j,J,V,z,ge)=>V==="\\"?(R=!0,k):V==="?"?j?j+V+(z?N.repeat(z.length):""):ge===0?F+(z?N.repeat(z.length):""):N.repeat(J.length):V==="."?f.repeat(J.length):V==="*"?j?j+V+(z?T:""):T:j?k:`\\${k}`);return R===!0&&(t.unescape===!0?Y=Y.replace(/\\/g,""):Y=Y.replace(/\\+/g,k=>k.length%2===0?"\\\\":k?"\\":"")),Y===r&&t.contains===!0?(l.output=r,l):(l.output=Tt.wrapOutput(Y,l,e),l)}for(;!C();){if(v=d(),v==="\0")continue;if(v==="\\"){let k=b();if(k==="/"&&t.bash!==!0||k==="."||k===";")continue;if(!k){v+="\\",B({type:"text",value:v});continue}let j=/^\\+/.exec(E()),J=0;if(j&&j[0].length>2&&(J=j[0].length,l.index+=J,J%2!==0&&(v+="\\")),t.unescape===!0?v=d():v+=d(),l.brackets===0){B({type:"text",value:v});continue}}if(l.brackets>0&&(v!=="]"||g.value==="["||g.value==="[^")){if(t.posix!==!1&&v===":"){let k=g.value.slice(1);if(k.includes("[")&&(g.posix=!0,k.includes(":"))){let j=g.value.lastIndexOf("["),J=g.value.slice(0,j),V=g.value.slice(j+2),z=U3[V];if(z){g.value=J+z,l.backtrack=!0,d(),!s.output&&o.indexOf(g)===1&&(s.output=_);continue}}}(v==="["&&b()!==":"||v==="-"&&b()==="]")&&(v=`\\${v}`),v==="]"&&(g.value==="["||g.value==="[^")&&(v=`\\${v}`),t.posix===!0&&v==="!"&&g.value==="["&&(v="^"),g.value+=v,I({value:v});continue}if(l.quotes===1&&v!=='"'){v=Tt.escapeRegex(v),g.value+=v,I({value:v});continue}if(v==='"'){l.quotes=l.quotes===1?0:1,t.keepQuotes===!0&&B({type:"text",value:v});continue}if(v==="("){$("parens"),B({type:"paren",value:v});continue}if(v===")"){if(l.parens===0&&t.strictBrackets===!0)throw new SyntaxError(Ds("opening","("));let k=h[h.length-1];if(k&&l.parens===k.parens+1){ie(h.pop());continue}B({type:"paren",value:v,output:l.parens?")":"\\)"}),K("parens");continue}if(v==="["){if(t.nobracket===!0||!E().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(Ds("closing","]"));v=`\\${v}`}else $("brackets");B({type:"bracket",value:v});continue}if(v==="]"){if(t.nobracket===!0||g&&g.type==="bracket"&&g.value.length===1){B({type:"text",value:v,output:`\\${v}`});continue}if(l.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(Ds("opening","["));B({type:"text",value:v,output:`\\${v}`});continue}K("brackets");let k=g.value.slice(1);if(g.posix!==!0&&k[0]==="^"&&!k.includes("/")&&(v=`/${v}`),g.value+=v,I({value:v}),t.literalBrackets===!1||Tt.hasRegexChars(k))continue;let j=Tt.escapeRegex(g.value);if(l.output=l.output.slice(0,-g.value.length),t.literalBrackets===!0){l.output+=j,g.value=j;continue}g.value=`(${a}${j}|${g.value})`,l.output+=g.value;continue}if(v==="{"&&t.nobrace!==!0){$("braces");let k={type:"brace",value:v,output:"(",outputIndex:l.output.length,tokensIndex:l.tokens.length};x.push(k),B(k);continue}if(v==="}"){let k=x[x.length-1];if(t.nobrace===!0||!k){B({type:"text",value:v,output:v});continue}let j=")";if(k.dots===!0){let J=o.slice(),V=[];for(let z=J.length-1;z>=0&&(o.pop(),J[z].type!=="brace");z--)J[z].type!=="dots"&&V.unshift(J[z].value);j=z3(V,t),l.backtrack=!0}if(k.comma!==!0&&k.dots!==!0){let J=l.output.slice(0,k.outputIndex),V=l.tokens.slice(k.tokensIndex);k.value=k.output="\\{",v=j="\\}",l.output=J;for(let z of V)l.output+=z.output||z.value}B({type:"brace",value:v,output:j}),K("braces"),x.pop();continue}if(v==="|"){h.length>0&&h[h.length-1].conditions++,B({type:"text",value:v});continue}if(v===","){let k=v,j=x[x.length-1];j&&w[w.length-1]==="braces"&&(j.comma=!0,k="|"),B({type:"comma",value:v,output:k});continue}if(v==="/"){if(g.type==="dot"&&l.index===l.start+1){l.start=l.index+1,l.consumed="",l.output="",o.pop(),g=s;continue}B({type:"slash",value:v,output:y});continue}if(v==="."){if(l.braces>0&&g.type==="dot"){g.value==="."&&(g.output=f);let k=x[x.length-1];g.type="dots",g.output+=v,g.value+=v,k.dots=!0;continue}if(l.braces+l.parens===0&&g.type!=="bos"&&g.type!=="slash"){B({type:"text",value:v,output:f});continue}B({type:"dot",value:v,output:f});continue}if(v==="?"){if(!(g&&g.value==="(")&&t.noextglob!==!0&&b()==="("&&b(2)!=="?"){me("qmark",v);continue}if(g&&g.type==="paren"){let j=b(),J=v;if(j==="<"&&!Tt.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(g.value==="("&&!/[!=<:]/.test(j)||j==="<"&&!/<([!=]|\w+>)/.test(E()))&&(J=`\\${v}`),B({type:"text",value:v,output:J});continue}if(t.dot!==!0&&(g.type==="slash"||g.type==="bos")){B({type:"qmark",value:v,output:H});continue}B({type:"qmark",value:v,output:N});continue}if(v==="!"){if(t.noextglob!==!0&&b()==="("&&(b(2)!=="?"||!/[!=<:]/.test(b(3)))){me("negate",v);continue}if(t.nonegate!==!0&&l.index===0){D();continue}}if(v==="+"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){me("plus",v);continue}if(g&&g.value==="("||t.regex===!1){B({type:"plus",value:v,output:m});continue}if(g&&(g.type==="bracket"||g.type==="paren"||g.type==="brace")||l.parens>0){B({type:"plus",value:v});continue}B({type:"plus",value:m});continue}if(v==="@"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){B({type:"at",extglob:!0,value:v,output:""});continue}B({type:"text",value:v});continue}if(v!=="*"){(v==="$"||v==="^")&&(v=`\\${v}`);let k=W3.exec(E());k&&(v+=k[0],l.index+=k[0].length),B({type:"text",value:v});continue}if(g&&(g.type==="globstar"||g.star===!0)){g.type="star",g.star=!0,g.value+=v,g.output=T,l.backtrack=!0,l.globstar=!0,q(v);continue}let R=E();if(t.noextglob!==!0&&/^\([^?]/.test(R)){me("star",v);continue}if(g.type==="star"){if(t.noglobstar===!0){q(v);continue}let k=g.prev,j=k.prev,J=k.type==="slash"||k.type==="bos",V=j&&(j.type==="star"||j.type==="globstar");if(t.bash===!0&&(!J||R[0]&&R[0]!=="/")){B({type:"star",value:v,output:""});continue}let z=l.braces>0&&(k.type==="comma"||k.type==="brace"),ge=h.length&&(k.type==="pipe"||k.type==="paren");if(!J&&k.type!=="paren"&&!z&&!ge){B({type:"star",value:v,output:""});continue}for(;R.slice(0,3)==="/**";){let re=r[l.index+4];if(re&&re!=="/")break;R=R.slice(3),q("/**",3)}if(k.type==="bos"&&C()){g.type="globstar",g.value+=v,g.output=G(t),l.output=g.output,l.globstar=!0,q(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&!V&&C()){l.output=l.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=G(t)+(t.strictSlashes?")":"|$)"),g.value+=v,l.globstar=!0,l.output+=k.output+g.output,q(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&R[0]==="/"){let re=R[1]!==void 0?"|$":"";l.output=l.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=`${G(t)}${y}|${y}${re})`,g.value+=v,l.output+=k.output+g.output,l.globstar=!0,q(v+d()),B({type:"slash",value:"/",output:""});continue}if(k.type==="bos"&&R[0]==="/"){g.type="globstar",g.value+=v,g.output=`(?:^|${y}|${G(t)}${y})`,l.output=g.output,l.globstar=!0,q(v+d()),B({type:"slash",value:"/",output:""});continue}l.output=l.output.slice(0,-g.output.length),g.type="globstar",g.output=G(t),g.value+=v,l.output+=g.output,l.globstar=!0,q(v);continue}let Y={type:"star",value:v,output:T};if(t.bash===!0){Y.output=".*?",(g.type==="bos"||g.type==="slash")&&(Y.output=M+Y.output),B(Y);continue}if(g&&(g.type==="bracket"||g.type==="paren")&&t.regex===!0){Y.output=v,B(Y);continue}(l.index===l.start||g.type==="slash"||g.type==="dot")&&(g.type==="dot"?(l.output+=P,g.output+=P):t.dot===!0?(l.output+=L,g.output+=L):(l.output+=M,g.output+=M),b()!=="*"&&(l.output+=_,g.output+=_)),B(Y)}for(;l.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ds("closing","]"));l.output=Tt.escapeLast(l.output,"["),K("brackets")}for(;l.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ds("closing",")"));l.output=Tt.escapeLast(l.output,"("),K("parens")}for(;l.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ds("closing","}"));l.output=Tt.escapeLast(l.output,"{"),K("braces")}if(t.strictSlashes!==!0&&(g.type==="star"||g.type==="bracket")&&B({type:"maybe_slash",value:"",output:`${y}?`}),l.backtrack===!0){l.output="";for(let R of l.tokens)l.output+=R.output!=null?R.output:R.value,R.suffix&&(l.output+=R.suffix)}return l};wm.fastpaths=(r,e)=>{let t={...e},n=typeof t.maxLength=="number"?Math.min(gu,t.maxLength):gu,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);r=eC[r]||r;let s=Tt.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:p,NO_DOTS:f,NO_DOTS_SLASH:m,STAR:y,START_ANCHOR:_}=na.globChars(s),S=t.dot?f:p,A=t.dot?m:p,P=t.capture?"":"?:",L={negated:!1,prefix:""},N=t.bash===!0?".*?":y;t.capture&&(N=`(${N})`);let H=M=>M.noglobstar===!0?N:`(${P}(?:(?!${_}${M.dot?u:o}).)*?)`,W=M=>{switch(M){case"*":return`${S}${c}${N}`;case".*":return`${o}${c}${N}`;case"*.*":return`${S}${N}${o}${c}${N}`;case"*/*":return`${S}${N}${a}${c}${A}${N}`;case"**":return S+H(t);case"**/*":return`(?:${S}${H(t)}${a})?${A}${c}${N}`;case"**/*.*":return`(?:${S}${H(t)}${a})?${A}${N}${o}${c}${N}`;case"**/.*":return`(?:${S}${H(t)}${a})?${o}${c}${N}`;default:{let F=/^(.*?)\.(\w+)$/.exec(M);if(!F)return;let T=W(F[1]);return T?T+o+F[2]:void 0}}},U=Tt.removePrefix(r,L),G=W(U);return G&&t.strictSlashes!==!0&&(G+=`${a}?`),G};nC.exports=wm});var oC=O((Rz,sC)=>{"use strict";var Q3=require("path"),Z3=ZT(),Sm=iC(),Em=mu(),eH=ta(),tH=r=>r&&typeof r=="object"&&!Array.isArray(r),Oe=(r,e,t=!1)=>{if(Array.isArray(r)){let p=r.map(m=>Oe(m,e,t));return m=>{for(let y of p){let _=y(m);if(_)return _}return!1}}let n=tH(r)&&r.tokens&&r.input;if(r===""||typeof r!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},s=Em.isWindows(e),o=n?Oe.compileRe(r,e):Oe.makeRe(r,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(i.ignore){let p={...e,ignore:null,onMatch:null,onResult:null};c=Oe(i.ignore,p,t)}let u=(p,f=!1)=>{let{isMatch:m,match:y,output:_}=Oe.test(p,o,e,{glob:r,posix:s}),S={glob:r,state:a,regex:o,posix:s,input:p,output:_,match:y,isMatch:m};return typeof i.onResult=="function"&&i.onResult(S),m===!1?(S.isMatch=!1,f?S:!1):c(p)?(typeof i.onIgnore=="function"&&i.onIgnore(S),S.isMatch=!1,f?S:!1):(typeof i.onMatch=="function"&&i.onMatch(S),f?S:!0)};return t&&(u.state=a),u};Oe.test=(r,e,t,{glob:n,posix:i}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};let s=t||{},o=s.format||(i?Em.toPosixSlashes:null),a=r===n,c=a&&o?o(r):r;return a===!1&&(c=o?o(r):r,a=c===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=Oe.matchBase(r,e,t,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Oe.matchBase=(r,e,t,n=Em.isWindows(t))=>(e instanceof RegExp?e:Oe.makeRe(e,t)).test(Q3.basename(r));Oe.isMatch=(r,e,t)=>Oe(e,t)(r);Oe.parse=(r,e)=>Array.isArray(r)?r.map(t=>Oe.parse(t,e)):Sm(r,{...e,fastpaths:!1});Oe.scan=(r,e)=>Z3(r,e);Oe.compileRe=(r,e,t=!1,n=!1)=>{if(t===!0)return r.output;let i=e||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${r.output})${o}`;r&&r.negated===!0&&(a=`^(?!${a}).*$`);let c=Oe.toRegex(a,e);return n===!0&&(c.state=r),c};Oe.makeRe=(r,e={},t=!1,n=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(i.output=Sm.fastpaths(r,e)),i.output||(i=Sm(r,e)),Oe.compileRe(i,e,t,n)};Oe.toRegex=(r,e)=>{try{let t=e||{};return new RegExp(r,t.flags||(t.nocase?"i":""))}catch(t){if(e&&e.debug===!0)throw t;return/$^/}};Oe.constants=eH;sC.exports=Oe});var cC=O((kz,aC)=>{"use strict";aC.exports=oC()});var gC=O((Oz,mC)=>{"use strict";var sa=require("fs"),{Readable:rH}=require("stream"),ia=require("path"),{promisify:_u}=require("util"),Tm=cC(),nH=_u(sa.readdir),iH=_u(sa.stat),lC=_u(sa.lstat),sH=_u(sa.realpath),oH="!",dC="READDIRP_RECURSIVE_ERROR",aH=new Set(["ENOENT","EPERM","EACCES","ELOOP",dC]),Cm="files",hC="directories",xu="files_directories",vu="all",uC=[Cm,hC,xu,vu],cH=r=>aH.has(r.code),[pC,lH]=process.versions.node.split(".").slice(0,2).map(r=>Number.parseInt(r,10)),uH=process.platform==="win32"&&(pC>10||pC===10&&lH>=5),fC=r=>{if(r!==void 0){if(typeof r=="function")return r;if(typeof r=="string"){let e=Tm(r.trim());return t=>e(t.basename)}if(Array.isArray(r)){let e=[],t=[];for(let n of r){let i=n.trim();i.charAt(0)===oH?t.push(Tm(i.slice(1))):e.push(Tm(i))}return t.length>0?e.length>0?n=>e.some(i=>i(n.basename))&&!t.some(i=>i(n.basename)):n=>!t.some(i=>i(n.basename)):n=>e.some(i=>i(n.basename))}}},yu=class r extends rH{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Cm,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let t={...r.defaultOptions,...e},{root:n,type:i}=t;this._fileFilter=fC(t.fileFilter),this._directoryFilter=fC(t.directoryFilter);let s=t.lstat?lC:iH;uH?this._stat=o=>s(o,{bigint:!0}):this._stat=s,this._maxDepth=t.depth,this._wantsDir=[hC,xu,vu].includes(i),this._wantsFile=[Cm,xu,vu].includes(i),this._wantsEverything=i===vu,this._root=ia.resolve(n),this._isDirent="Dirent"in sa&&!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let{path:t,depth:n,files:i=[]}=this.parent||{};if(i.length>0){let s=i.splice(0,e).map(o=>this._formatEntry(o,t));for(let o of await Promise.all(s)){if(this.destroyed)return;let a=await this._getEntryType(o);a==="directory"&&this._directoryFilter(o)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(o.fullPath,n+1)),this._wantsDir&&(this.push(o),e--)):(a==="file"||this._includeAsFile(o))&&this._fileFilter(o)&&this._wantsFile&&(this.push(o),e--)}}else{let s=this.parents.pop();if(!s){this.push(null);break}if(this.parent=await s,this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=!1}}}async _exploreDir(e,t){let n;try{n=await nH(e,this._rdOptions)}catch(i){this._onError(i)}return{files:n,depth:t,path:e}}async _formatEntry(e,t){let n;try{let i=this._isDirent?e.name:e,s=ia.resolve(ia.join(t,i));n={path:ia.relative(this._root,s),fullPath:s,basename:i},n[this._statsProp]=this._isDirent?e:await this._stat(s)}catch(i){this._onError(i)}return n}_onError(e){cH(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){let t=e&&e[this._statsProp];if(t){if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){let n=e.fullPath;try{let i=await sH(n),s=await lC(i);if(s.isFile())return"file";if(s.isDirectory()){let o=i.length;if(n.startsWith(i)&&n.substr(o,1)===ia.sep){let a=new Error(`Circular symlink detected: "${n}" points to "${i}"`);return a.code=dC,this._onError(a)}return"directory"}}catch(i){this._onError(i)}}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}},Bs=(r,e={})=>{let t=e.entryType||e.type;if(t==="both"&&(t=xu),t&&(e.type=t),r){if(typeof r!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(t&&!uC.includes(t))throw new Error(`readdirp: Invalid type passed. Use one of ${uC.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=r,new yu(e)},pH=(r,e={})=>new Promise((t,n)=>{let i=[];Bs(r,e).on("data",s=>i.push(s)).on("end",()=>t(i)).on("error",s=>n(s))});Bs.promise=pH;Bs.ReaddirpStream=yu;Bs.default=Bs;mC.exports=Bs});var oa=O((Pz,bC)=>{"use strict";var fH=require("path"),Kr="\\\\/",vC=`[^${Kr}]`,dH=0,wn="\\.",hH="\\+",mH="\\?",bu="\\/",gH="(?=.)",xC="[^/]",Am=`(?:${bu}|$)`,yC=`(?:^|${bu})`,Rm=`${wn}{1,2}${Am}`,vH=`(?!${wn})`,xH=`(?!${yC}${Rm})`,yH=`(?!${wn}{0,1}${Am})`,_H=`(?!${Rm})`,bH=`[^.${bu}]`,wH=`${xC}*?`,_C={DOT_LITERAL:wn,PLUS_LITERAL:hH,QMARK_LITERAL:mH,SLASH_LITERAL:bu,ONE_CHAR:gH,QMARK:xC,END_ANCHOR:Am,DOTS_SLASH:Rm,NO_DOT:vH,NO_DOTS:xH,NO_DOT_SLASH:yH,NO_DOTS_SLASH:_H,QMARK_NO_DOT:bH,STAR:wH,START_ANCHOR:yC},SH={..._C,SLASH_LITERAL:`[${Kr}]`,QMARK:vC,STAR:`${vC}*?`,DOTS_SLASH:`${wn}{1,2}(?:[${Kr}]|$)`,NO_DOT:`(?!${wn})`,NO_DOTS:`(?!(?:^|[${Kr}])${wn}{1,2}(?:[${Kr}]|$))`,NO_DOT_SLASH:`(?!${wn}{0,1}(?:[${Kr}]|$))`,NO_DOTS_SLASH:`(?!${wn}{1,2}(?:[${Kr}]|$))`,QMARK_NO_DOT:`[^.${Kr}]`,START_ANCHOR:`(?:^|[${Kr}])`,END_ANCHOR:`(?:[${Kr}]|$)`},EH={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};bC.exports={DEFAULT_MAX_EXTGLOB_RECURSION:dH,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:EH,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:fH.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?SH:_C}}});var wu=O(qt=>{"use strict";var TH=require("path"),CH=process.platform==="win32",{REGEX_BACKSLASH:AH,REGEX_REMOVE_BACKSLASH:RH,REGEX_SPECIAL_CHARS:kH,REGEX_SPECIAL_CHARS_GLOBAL:OH}=oa();qt.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);qt.hasRegexChars=r=>kH.test(r);qt.isRegexChar=r=>r.length===1&&qt.hasRegexChars(r);qt.escapeRegex=r=>r.replace(OH,"\\$1");qt.toPosixSlashes=r=>r.replace(AH,"/");qt.removeBackslashes=r=>r.replace(RH,e=>e==="\\"?"":e);qt.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};qt.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:CH===!0||TH.sep==="\\";qt.escapeLast=(r,e,t)=>{let n=r.lastIndexOf(e,t);return n===-1?r:r[n-1]==="\\"?qt.escapeLast(r,e,n-1):`${r.slice(0,n)}\\${r.slice(n)}`};qt.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};qt.wrapOutput=(r,e={},t={})=>{let n=t.contains?"":"^",i=t.contains?"":"$",s=`${n}(?:${r})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var kC=O((Iz,RC)=>{"use strict";var wC=wu(),{CHAR_ASTERISK:km,CHAR_AT:PH,CHAR_BACKWARD_SLASH:aa,CHAR_COMMA:MH,CHAR_DOT:Om,CHAR_EXCLAMATION_MARK:Pm,CHAR_FORWARD_SLASH:AC,CHAR_LEFT_CURLY_BRACE:Mm,CHAR_LEFT_PARENTHESES:Im,CHAR_LEFT_SQUARE_BRACKET:IH,CHAR_PLUS:NH,CHAR_QUESTION_MARK:SC,CHAR_RIGHT_CURLY_BRACE:LH,CHAR_RIGHT_PARENTHESES:EC,CHAR_RIGHT_SQUARE_BRACKET:DH}=oa(),TC=r=>r===AC||r===aa,CC=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},BH=(r,e)=>{let t=e||{},n=r.length-1,i=t.parts===!0||t.scanToEnd===!0,s=[],o=[],a=[],c=r,u=-1,p=0,f=0,m=!1,y=!1,_=!1,S=!1,A=!1,P=!1,L=!1,N=!1,H=!1,W=!1,U=0,G,M,F={value:"",depth:0,isGlob:!1},T=()=>u>=n,l=()=>c.charCodeAt(u+1),h=()=>(G=M,c.charCodeAt(++u));for(;u<n;){M=h();let C;if(M===aa){L=F.backslashes=!0,M=h(),M===Mm&&(P=!0);continue}if(P===!0||M===Mm){for(U++;T()!==!0&&(M=h());){if(M===aa){L=F.backslashes=!0,h();continue}if(M===Mm){U++;continue}if(P!==!0&&M===Om&&(M=h())===Om){if(m=F.isBrace=!0,_=F.isGlob=!0,W=!0,i===!0)continue;break}if(P!==!0&&M===MH){if(m=F.isBrace=!0,_=F.isGlob=!0,W=!0,i===!0)continue;break}if(M===LH&&(U--,U===0)){P=!1,m=F.isBrace=!0,W=!0;break}}if(i===!0)continue;break}if(M===AC){if(s.push(u),o.push(F),F={value:"",depth:0,isGlob:!1},W===!0)continue;if(G===Om&&u===p+1){p+=2;continue}f=u+1;continue}if(t.noext!==!0&&(M===NH||M===PH||M===km||M===SC||M===Pm)===!0&&l()===Im){if(_=F.isGlob=!0,S=F.isExtglob=!0,W=!0,M===Pm&&u===p&&(H=!0),i===!0){for(;T()!==!0&&(M=h());){if(M===aa){L=F.backslashes=!0,M=h();continue}if(M===EC){_=F.isGlob=!0,W=!0;break}}continue}break}if(M===km){if(G===km&&(A=F.isGlobstar=!0),_=F.isGlob=!0,W=!0,i===!0)continue;break}if(M===SC){if(_=F.isGlob=!0,W=!0,i===!0)continue;break}if(M===IH){for(;T()!==!0&&(C=h());){if(C===aa){L=F.backslashes=!0,h();continue}if(C===DH){y=F.isBracket=!0,_=F.isGlob=!0,W=!0;break}}if(i===!0)continue;break}if(t.nonegate!==!0&&M===Pm&&u===p){N=F.negated=!0,p++;continue}if(t.noparen!==!0&&M===Im){if(_=F.isGlob=!0,i===!0){for(;T()!==!0&&(M=h());){if(M===Im){L=F.backslashes=!0,M=h();continue}if(M===EC){W=!0;break}}continue}break}if(_===!0){if(W=!0,i===!0)continue;break}}t.noext===!0&&(S=!1,_=!1);let x=c,w="",g="";p>0&&(w=c.slice(0,p),c=c.slice(p),f-=p),x&&_===!0&&f>0?(x=c.slice(0,f),g=c.slice(f)):_===!0?(x="",g=c):x=c,x&&x!==""&&x!=="/"&&x!==c&&TC(x.charCodeAt(x.length-1))&&(x=x.slice(0,-1)),t.unescape===!0&&(g&&(g=wC.removeBackslashes(g)),x&&L===!0&&(x=wC.removeBackslashes(x)));let v={prefix:w,input:r,start:p,base:x,glob:g,isBrace:m,isBracket:y,isGlob:_,isExtglob:S,isGlobstar:A,negated:N,negatedExtglob:H};if(t.tokens===!0&&(v.maxDepth=0,TC(M)||o.push(F),v.tokens=o),t.parts===!0||t.tokens===!0){let C;for(let b=0;b<s.length;b++){let d=C?C+1:p,E=s[b],q=r.slice(d,E);t.tokens&&(b===0&&p!==0?(o[b].isPrefix=!0,o[b].value=w):o[b].value=q,CC(o[b]),v.maxDepth+=o[b].depth),(b!==0||q!=="")&&a.push(q),C=E}if(C&&C+1<r.length){let b=r.slice(C+1);a.push(b),t.tokens&&(o[o.length-1].value=b,CC(o[o.length-1]),v.maxDepth+=o[o.length-1].depth)}v.slashes=s,v.parts=a}return v};RC.exports=BH});var NC=O((Nz,IC)=>{"use strict";var ca=oa(),Ct=wu(),{MAX_LENGTH:Su,POSIX_REGEX_SOURCE:jH,REGEX_NON_SPECIAL_CHARS:FH,REGEX_SPECIAL_CHARS_BACKREF:HH,REPLACEMENTS:OC}=ca,$H=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch{return r.map(i=>Ct.escapeRegex(i)).join("..")}return t},js=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,PC=r=>{let e=[],t=0,n=0,i=0,s="",o=!1;for(let a of r){if(o===!0){s+=a,o=!1;continue}if(a==="\\"){s+=a,o=!0;continue}if(a==='"'){i=i===1?0:1,s+=a;continue}if(i===0){if(a==="[")t++;else if(a==="]"&&t>0)t--;else if(t===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(s),s="";continue}}}s+=a}return e.push(s),e},qH=r=>{let e=!1;for(let t of r){if(e===!0){e=!1;continue}if(t==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(t))return!1}return!0},MC=r=>{let e=r.trim(),t=!0;for(;t===!0;)t=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),t=!0);if(qH(e))return e.replace(/\\(.)/g,"$1")},UH=r=>{let e=r.map(MC).filter(Boolean);for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let i=e[t],s=e[n],o=i[0];if(!(!o||i!==o.repeat(i.length)||s!==o.repeat(s.length))&&(i===s||i.startsWith(s)||s.startsWith(i)))return!0}return!1},Nm=(r,e=!0)=>{if(r[0]!=="+"&&r[0]!=="*"||r[1]!=="(")return;let t=0,n=0,i=0,s=!1;for(let o=1;o<r.length;o++){let a=r[o];if(s===!0){s=!1;continue}if(a==="\\"){s=!0;continue}if(a==='"'){i=i===1?0:1;continue}if(i!==1){if(a==="["){t++;continue}if(a==="]"&&t>0){t--;continue}if(!(t>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&o!==r.length-1?void 0:{type:r[0],body:r.slice(2,o),end:o}}}}},WH=r=>{let e=0,t=[];for(;e<r.length;){let i=Nm(r.slice(e),!1);if(!i||i.type!=="*")return;let s=PC(i.body).map(a=>a.trim());if(s.length!==1)return;let o=MC(s[0]);if(!o||o.length!==1)return;t.push(o),e+=i.end+1}return t.length<1?void 0:`${t.length===1?Ct.escapeRegex(t[0]):`[${t.map(i=>Ct.escapeRegex(i)).join("")}]`}*`},GH=r=>{let e=0,t=r.trim(),n=Nm(t);for(;n;)e++,t=n.body.trim(),n=Nm(t);return e},zH=(r,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let t=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:ca.DEFAULT_MAX_EXTGLOB_RECURSION,n=PC(r).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||UH(n)))return{risky:!0};for(let i of n){let s=WH(i);if(s)return{risky:!0,safeOutput:s};if(GH(i)>t)return{risky:!0}}return{risky:!1}},Lm=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=OC[r]||r;let t={...e},n=typeof t.maxLength=="number"?Math.min(Su,t.maxLength):Su,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:t.prepend||""},o=[s],a=t.capture?"":"?:",c=Ct.isWindows(e),u=ca.globChars(c),p=ca.extglobChars(u),{DOT_LITERAL:f,PLUS_LITERAL:m,SLASH_LITERAL:y,ONE_CHAR:_,DOTS_SLASH:S,NO_DOT:A,NO_DOT_SLASH:P,NO_DOTS_SLASH:L,QMARK:N,QMARK_NO_DOT:H,STAR:W,START_ANCHOR:U}=u,G=R=>`(${a}(?:(?!${U}${R.dot?S:f}).)*?)`,M=t.dot?"":A,F=t.dot?N:H,T=t.bash===!0?G(t):W;t.capture&&(T=`(${T})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let l={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};r=Ct.removePrefix(r,l),i=r.length;let h=[],x=[],w=[],g=s,v,C=()=>l.index===i-1,b=l.peek=(R=1)=>r[l.index+R],d=l.advance=()=>r[++l.index]||"",E=()=>r.slice(l.index+1),q=(R="",Y=0)=>{l.consumed+=R,l.index+=Y},I=R=>{l.output+=R.output!=null?R.output:R.value,q(R.value)},D=()=>{let R=1;for(;b()==="!"&&(b(2)!=="("||b(3)==="?");)d(),l.start++,R++;return R%2===0?!1:(l.negated=!0,l.start++,!0)},$=R=>{l[R]++,w.push(R)},K=R=>{l[R]--,w.pop()},B=R=>{if(g.type==="globstar"){let Y=l.braces>0&&(R.type==="comma"||R.type==="brace"),k=R.extglob===!0||h.length&&(R.type==="pipe"||R.type==="paren");R.type!=="slash"&&R.type!=="paren"&&!Y&&!k&&(l.output=l.output.slice(0,-g.output.length),g.type="star",g.value="*",g.output=T,l.output+=g.output)}if(h.length&&R.type!=="paren"&&(h[h.length-1].inner+=R.value),(R.value||R.output)&&I(R),g&&g.type==="text"&&R.type==="text"){g.value+=R.value,g.output=(g.output||"")+R.value;return}R.prev=g,o.push(R),g=R},me=(R,Y)=>{let k={...p[Y],conditions:1,inner:""};k.prev=g,k.parens=l.parens,k.output=l.output,k.startIndex=l.index,k.tokensIndex=o.length;let j=(t.capture?"(":"")+k.open;$("parens"),B({type:R,value:Y,output:l.output?"":_}),B({type:"paren",extglob:!0,value:d(),output:j}),h.push(k)},ie=R=>{let Y=r.slice(R.startIndex,l.index+1),k=r.slice(R.startIndex+2,l.index),j=zH(k,t);if((R.type==="plus"||R.type==="star")&&j.risky){let z=j.safeOutput?(R.output?"":_)+(t.capture?`(${j.safeOutput})`:j.safeOutput):void 0,ge=o[R.tokensIndex];ge.type="text",ge.value=Y,ge.output=z||Ct.escapeRegex(Y);for(let re=R.tokensIndex+1;re<o.length;re++)o[re].value="",o[re].output="",delete o[re].suffix;l.output=R.output+ge.output,l.backtrack=!0,B({type:"paren",extglob:!0,value:v,output:""}),K("parens");return}let J=R.close+(t.capture?")":""),V;if(R.type==="negate"){let z=T;if(R.inner&&R.inner.length>1&&R.inner.includes("/")&&(z=G(t)),(z!==T||C()||/^\)+$/.test(E()))&&(J=R.close=`)$))${z}`),R.inner.includes("*")&&(V=E())&&/^\.[^\\/.]+$/.test(V)){let ge=Lm(V,{...e,fastpaths:!1}).output;J=R.close=`)${ge})${z})`}R.prev.type==="bos"&&(l.negatedExtglob=!0)}B({type:"paren",extglob:!0,value:v,output:J}),K("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let R=!1,Y=r.replace(HH,(k,j,J,V,z,ge)=>V==="\\"?(R=!0,k):V==="?"?j?j+V+(z?N.repeat(z.length):""):ge===0?F+(z?N.repeat(z.length):""):N.repeat(J.length):V==="."?f.repeat(J.length):V==="*"?j?j+V+(z?T:""):T:j?k:`\\${k}`);return R===!0&&(t.unescape===!0?Y=Y.replace(/\\/g,""):Y=Y.replace(/\\+/g,k=>k.length%2===0?"\\\\":k?"\\":"")),Y===r&&t.contains===!0?(l.output=r,l):(l.output=Ct.wrapOutput(Y,l,e),l)}for(;!C();){if(v=d(),v==="\0")continue;if(v==="\\"){let k=b();if(k==="/"&&t.bash!==!0||k==="."||k===";")continue;if(!k){v+="\\",B({type:"text",value:v});continue}let j=/^\\+/.exec(E()),J=0;if(j&&j[0].length>2&&(J=j[0].length,l.index+=J,J%2!==0&&(v+="\\")),t.unescape===!0?v=d():v+=d(),l.brackets===0){B({type:"text",value:v});continue}}if(l.brackets>0&&(v!=="]"||g.value==="["||g.value==="[^")){if(t.posix!==!1&&v===":"){let k=g.value.slice(1);if(k.includes("[")&&(g.posix=!0,k.includes(":"))){let j=g.value.lastIndexOf("["),J=g.value.slice(0,j),V=g.value.slice(j+2),z=jH[V];if(z){g.value=J+z,l.backtrack=!0,d(),!s.output&&o.indexOf(g)===1&&(s.output=_);continue}}}(v==="["&&b()!==":"||v==="-"&&b()==="]")&&(v=`\\${v}`),v==="]"&&(g.value==="["||g.value==="[^")&&(v=`\\${v}`),t.posix===!0&&v==="!"&&g.value==="["&&(v="^"),g.value+=v,I({value:v});continue}if(l.quotes===1&&v!=='"'){v=Ct.escapeRegex(v),g.value+=v,I({value:v});continue}if(v==='"'){l.quotes=l.quotes===1?0:1,t.keepQuotes===!0&&B({type:"text",value:v});continue}if(v==="("){$("parens"),B({type:"paren",value:v});continue}if(v===")"){if(l.parens===0&&t.strictBrackets===!0)throw new SyntaxError(js("opening","("));let k=h[h.length-1];if(k&&l.parens===k.parens+1){ie(h.pop());continue}B({type:"paren",value:v,output:l.parens?")":"\\)"}),K("parens");continue}if(v==="["){if(t.nobracket===!0||!E().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(js("closing","]"));v=`\\${v}`}else $("brackets");B({type:"bracket",value:v});continue}if(v==="]"){if(t.nobracket===!0||g&&g.type==="bracket"&&g.value.length===1){B({type:"text",value:v,output:`\\${v}`});continue}if(l.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(js("opening","["));B({type:"text",value:v,output:`\\${v}`});continue}K("brackets");let k=g.value.slice(1);if(g.posix!==!0&&k[0]==="^"&&!k.includes("/")&&(v=`/${v}`),g.value+=v,I({value:v}),t.literalBrackets===!1||Ct.hasRegexChars(k))continue;let j=Ct.escapeRegex(g.value);if(l.output=l.output.slice(0,-g.value.length),t.literalBrackets===!0){l.output+=j,g.value=j;continue}g.value=`(${a}${j}|${g.value})`,l.output+=g.value;continue}if(v==="{"&&t.nobrace!==!0){$("braces");let k={type:"brace",value:v,output:"(",outputIndex:l.output.length,tokensIndex:l.tokens.length};x.push(k),B(k);continue}if(v==="}"){let k=x[x.length-1];if(t.nobrace===!0||!k){B({type:"text",value:v,output:v});continue}let j=")";if(k.dots===!0){let J=o.slice(),V=[];for(let z=J.length-1;z>=0&&(o.pop(),J[z].type!=="brace");z--)J[z].type!=="dots"&&V.unshift(J[z].value);j=$H(V,t),l.backtrack=!0}if(k.comma!==!0&&k.dots!==!0){let J=l.output.slice(0,k.outputIndex),V=l.tokens.slice(k.tokensIndex);k.value=k.output="\\{",v=j="\\}",l.output=J;for(let z of V)l.output+=z.output||z.value}B({type:"brace",value:v,output:j}),K("braces"),x.pop();continue}if(v==="|"){h.length>0&&h[h.length-1].conditions++,B({type:"text",value:v});continue}if(v===","){let k=v,j=x[x.length-1];j&&w[w.length-1]==="braces"&&(j.comma=!0,k="|"),B({type:"comma",value:v,output:k});continue}if(v==="/"){if(g.type==="dot"&&l.index===l.start+1){l.start=l.index+1,l.consumed="",l.output="",o.pop(),g=s;continue}B({type:"slash",value:v,output:y});continue}if(v==="."){if(l.braces>0&&g.type==="dot"){g.value==="."&&(g.output=f);let k=x[x.length-1];g.type="dots",g.output+=v,g.value+=v,k.dots=!0;continue}if(l.braces+l.parens===0&&g.type!=="bos"&&g.type!=="slash"){B({type:"text",value:v,output:f});continue}B({type:"dot",value:v,output:f});continue}if(v==="?"){if(!(g&&g.value==="(")&&t.noextglob!==!0&&b()==="("&&b(2)!=="?"){me("qmark",v);continue}if(g&&g.type==="paren"){let j=b(),J=v;if(j==="<"&&!Ct.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(g.value==="("&&!/[!=<:]/.test(j)||j==="<"&&!/<([!=]|\w+>)/.test(E()))&&(J=`\\${v}`),B({type:"text",value:v,output:J});continue}if(t.dot!==!0&&(g.type==="slash"||g.type==="bos")){B({type:"qmark",value:v,output:H});continue}B({type:"qmark",value:v,output:N});continue}if(v==="!"){if(t.noextglob!==!0&&b()==="("&&(b(2)!=="?"||!/[!=<:]/.test(b(3)))){me("negate",v);continue}if(t.nonegate!==!0&&l.index===0){D();continue}}if(v==="+"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){me("plus",v);continue}if(g&&g.value==="("||t.regex===!1){B({type:"plus",value:v,output:m});continue}if(g&&(g.type==="bracket"||g.type==="paren"||g.type==="brace")||l.parens>0){B({type:"plus",value:v});continue}B({type:"plus",value:m});continue}if(v==="@"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){B({type:"at",extglob:!0,value:v,output:""});continue}B({type:"text",value:v});continue}if(v!=="*"){(v==="$"||v==="^")&&(v=`\\${v}`);let k=FH.exec(E());k&&(v+=k[0],l.index+=k[0].length),B({type:"text",value:v});continue}if(g&&(g.type==="globstar"||g.star===!0)){g.type="star",g.star=!0,g.value+=v,g.output=T,l.backtrack=!0,l.globstar=!0,q(v);continue}let R=E();if(t.noextglob!==!0&&/^\([^?]/.test(R)){me("star",v);continue}if(g.type==="star"){if(t.noglobstar===!0){q(v);continue}let k=g.prev,j=k.prev,J=k.type==="slash"||k.type==="bos",V=j&&(j.type==="star"||j.type==="globstar");if(t.bash===!0&&(!J||R[0]&&R[0]!=="/")){B({type:"star",value:v,output:""});continue}let z=l.braces>0&&(k.type==="comma"||k.type==="brace"),ge=h.length&&(k.type==="pipe"||k.type==="paren");if(!J&&k.type!=="paren"&&!z&&!ge){B({type:"star",value:v,output:""});continue}for(;R.slice(0,3)==="/**";){let re=r[l.index+4];if(re&&re!=="/")break;R=R.slice(3),q("/**",3)}if(k.type==="bos"&&C()){g.type="globstar",g.value+=v,g.output=G(t),l.output=g.output,l.globstar=!0,q(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&!V&&C()){l.output=l.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=G(t)+(t.strictSlashes?")":"|$)"),g.value+=v,l.globstar=!0,l.output+=k.output+g.output,q(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&R[0]==="/"){let re=R[1]!==void 0?"|$":"";l.output=l.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=`${G(t)}${y}|${y}${re})`,g.value+=v,l.output+=k.output+g.output,l.globstar=!0,q(v+d()),B({type:"slash",value:"/",output:""});continue}if(k.type==="bos"&&R[0]==="/"){g.type="globstar",g.value+=v,g.output=`(?:^|${y}|${G(t)}${y})`,l.output=g.output,l.globstar=!0,q(v+d()),B({type:"slash",value:"/",output:""});continue}l.output=l.output.slice(0,-g.output.length),g.type="globstar",g.output=G(t),g.value+=v,l.output+=g.output,l.globstar=!0,q(v);continue}let Y={type:"star",value:v,output:T};if(t.bash===!0){Y.output=".*?",(g.type==="bos"||g.type==="slash")&&(Y.output=M+Y.output),B(Y);continue}if(g&&(g.type==="bracket"||g.type==="paren")&&t.regex===!0){Y.output=v,B(Y);continue}(l.index===l.start||g.type==="slash"||g.type==="dot")&&(g.type==="dot"?(l.output+=P,g.output+=P):t.dot===!0?(l.output+=L,g.output+=L):(l.output+=M,g.output+=M),b()!=="*"&&(l.output+=_,g.output+=_)),B(Y)}for(;l.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(js("closing","]"));l.output=Ct.escapeLast(l.output,"["),K("brackets")}for(;l.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(js("closing",")"));l.output=Ct.escapeLast(l.output,"("),K("parens")}for(;l.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(js("closing","}"));l.output=Ct.escapeLast(l.output,"{"),K("braces")}if(t.strictSlashes!==!0&&(g.type==="star"||g.type==="bracket")&&B({type:"maybe_slash",value:"",output:`${y}?`}),l.backtrack===!0){l.output="";for(let R of l.tokens)l.output+=R.output!=null?R.output:R.value,R.suffix&&(l.output+=R.suffix)}return l};Lm.fastpaths=(r,e)=>{let t={...e},n=typeof t.maxLength=="number"?Math.min(Su,t.maxLength):Su,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);r=OC[r]||r;let s=Ct.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:p,NO_DOTS:f,NO_DOTS_SLASH:m,STAR:y,START_ANCHOR:_}=ca.globChars(s),S=t.dot?f:p,A=t.dot?m:p,P=t.capture?"":"?:",L={negated:!1,prefix:""},N=t.bash===!0?".*?":y;t.capture&&(N=`(${N})`);let H=M=>M.noglobstar===!0?N:`(${P}(?:(?!${_}${M.dot?u:o}).)*?)`,W=M=>{switch(M){case"*":return`${S}${c}${N}`;case".*":return`${o}${c}${N}`;case"*.*":return`${S}${N}${o}${c}${N}`;case"*/*":return`${S}${N}${a}${c}${A}${N}`;case"**":return S+H(t);case"**/*":return`(?:${S}${H(t)}${a})?${A}${c}${N}`;case"**/*.*":return`(?:${S}${H(t)}${a})?${A}${N}${o}${c}${N}`;case"**/.*":return`(?:${S}${H(t)}${a})?${o}${c}${N}`;default:{let F=/^(.*?)\.(\w+)$/.exec(M);if(!F)return;let T=W(F[1]);return T?T+o+F[2]:void 0}}},U=Ct.removePrefix(r,L),G=W(U);return G&&t.strictSlashes!==!0&&(G+=`${a}?`),G};IC.exports=Lm});var DC=O((Lz,LC)=>{"use strict";var KH=require("path"),VH=kC(),Dm=NC(),Bm=wu(),YH=oa(),XH=r=>r&&typeof r=="object"&&!Array.isArray(r),Pe=(r,e,t=!1)=>{if(Array.isArray(r)){let p=r.map(m=>Pe(m,e,t));return m=>{for(let y of p){let _=y(m);if(_)return _}return!1}}let n=XH(r)&&r.tokens&&r.input;if(r===""||typeof r!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},s=Bm.isWindows(e),o=n?Pe.compileRe(r,e):Pe.makeRe(r,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(i.ignore){let p={...e,ignore:null,onMatch:null,onResult:null};c=Pe(i.ignore,p,t)}let u=(p,f=!1)=>{let{isMatch:m,match:y,output:_}=Pe.test(p,o,e,{glob:r,posix:s}),S={glob:r,state:a,regex:o,posix:s,input:p,output:_,match:y,isMatch:m};return typeof i.onResult=="function"&&i.onResult(S),m===!1?(S.isMatch=!1,f?S:!1):c(p)?(typeof i.onIgnore=="function"&&i.onIgnore(S),S.isMatch=!1,f?S:!1):(typeof i.onMatch=="function"&&i.onMatch(S),f?S:!0)};return t&&(u.state=a),u};Pe.test=(r,e,t,{glob:n,posix:i}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};let s=t||{},o=s.format||(i?Bm.toPosixSlashes:null),a=r===n,c=a&&o?o(r):r;return a===!1&&(c=o?o(r):r,a=c===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=Pe.matchBase(r,e,t,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Pe.matchBase=(r,e,t,n=Bm.isWindows(t))=>(e instanceof RegExp?e:Pe.makeRe(e,t)).test(KH.basename(r));Pe.isMatch=(r,e,t)=>Pe(e,t)(r);Pe.parse=(r,e)=>Array.isArray(r)?r.map(t=>Pe.parse(t,e)):Dm(r,{...e,fastpaths:!1});Pe.scan=(r,e)=>VH(r,e);Pe.compileRe=(r,e,t=!1,n=!1)=>{if(t===!0)return r.output;let i=e||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${r.output})${o}`;r&&r.negated===!0&&(a=`^(?!${a}).*$`);let c=Pe.toRegex(a,e);return n===!0&&(c.state=r),c};Pe.makeRe=(r,e={},t=!1,n=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(i.output=Dm.fastpaths(r,e)),i.output||(i=Dm(r,e)),Pe.compileRe(i,e,t,n)};Pe.toRegex=(r,e)=>{try{let t=e||{};return new RegExp(r,t.flags||(t.nocase?"i":""))}catch(t){if(e&&e.debug===!0)throw t;return/$^/}};Pe.constants=YH;LC.exports=Pe});var jC=O((Dz,BC)=>{"use strict";BC.exports=DC()});var jm=O((Bz,FC)=>{FC.exports=function(r,e){if(typeof r!="string")throw new TypeError("expected path to be a string");if(r==="\\"||r==="/")return"/";var t=r.length;if(t<=1)return r;var n="";if(t>4&&r[3]==="\\"){var i=r[2];(i==="?"||i===".")&&r.slice(0,2)==="\\\\"&&(r=r.slice(2),n="//")}var s=r.split(/[/\\]+/);return e!==!1&&s[s.length-1]===""&&s.pop(),n+s.join("/")}});var GC=O((UC,WC)=>{"use strict";Object.defineProperty(UC,"__esModule",{value:!0});var qC=jC(),JH=jm(),HC="!",QH={returnIndex:!1},ZH=r=>Array.isArray(r)?r:[r],e$=(r,e)=>{if(typeof r=="function")return r;if(typeof r=="string"){let t=qC(r,e);return n=>r===n||t(n)}return r instanceof RegExp?t=>r.test(t):t=>!1},$C=(r,e,t,n)=>{let i=Array.isArray(t),s=i?t[0]:t;if(!i&&typeof s!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(s));let o=JH(s,!1);for(let c=0;c<e.length;c++){let u=e[c];if(u(o))return n?-1:!1}let a=i&&[o].concat(t.slice(1));for(let c=0;c<r.length;c++){let u=r[c];if(i?u(...a):u(o))return n?c:!0}return n?-1:!1},Fm=(r,e,t=QH)=>{if(r==null)throw new TypeError("anymatch: specify first argument");let n=typeof t=="boolean"?{returnIndex:t}:t,i=n.returnIndex||!1,s=ZH(r),o=s.filter(c=>typeof c=="string"&&c.charAt(0)===HC).map(c=>c.slice(1)).map(c=>qC(c,n)),a=s.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==HC).map(c=>e$(c,n));return e==null?(c,u=!1)=>$C(a,o,c,typeof u=="boolean"?u:!1):$C(a,o,e,i)};Fm.default=Fm;WC.exports=Fm});var KC=O((jz,zC)=>{zC.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1}});var Hm=O((Fz,YC)=>{var t$=KC(),VC={"{":"}","(":")","[":"]"},r$=function(r){if(r[0]==="!")return!0;for(var e=0,t=-2,n=-2,i=-2,s=-2,o=-2;e<r.length;){if(r[e]==="*"||r[e+1]==="?"&&/[\].+)]/.test(r[e])||n!==-1&&r[e]==="["&&r[e+1]!=="]"&&(n<e&&(n=r.indexOf("]",e)),n>e&&(o===-1||o>n||(o=r.indexOf("\\",e),o===-1||o>n)))||i!==-1&&r[e]==="{"&&r[e+1]!=="}"&&(i=r.indexOf("}",e),i>e&&(o=r.indexOf("\\",e),o===-1||o>i))||s!==-1&&r[e]==="("&&r[e+1]==="?"&&/[:!=]/.test(r[e+2])&&r[e+3]!==")"&&(s=r.indexOf(")",e),s>e&&(o=r.indexOf("\\",e),o===-1||o>s))||t!==-1&&r[e]==="("&&r[e+1]!=="|"&&(t<e&&(t=r.indexOf("|",e)),t!==-1&&r[t+1]!==")"&&(s=r.indexOf(")",t),s>t&&(o=r.indexOf("\\",t),o===-1||o>s))))return!0;if(r[e]==="\\"){var a=r[e+1];e+=2;var c=VC[a];if(c){var u=r.indexOf(c,e);u!==-1&&(e=u+1)}if(r[e]==="!")return!0}else e++}return!1},n$=function(r){if(r[0]==="!")return!0;for(var e=0;e<r.length;){if(/[*?{}()[\]]/.test(r[e]))return!0;if(r[e]==="\\"){var t=r[e+1];e+=2;var n=VC[t];if(n){var i=r.indexOf(n,e);i!==-1&&(e=i+1)}if(r[e]==="!")return!0}else e++}return!1};YC.exports=function(e,t){if(typeof e!="string"||e==="")return!1;if(t$(e))return!0;var n=r$;return t&&t.strict===!1&&(n=n$),n(e)}});var JC=O((Hz,XC)=>{"use strict";var i$=Hm(),s$=require("path").posix.dirname,o$=require("os").platform()==="win32",$m="/",a$=/\\/g,c$=/[\{\[].*[\}\]]$/,l$=/(^|[^\\])([\{\[]|\([^\)]+$)/,u$=/\\([\!\*\?\|\[\]\(\)\{\}])/g;XC.exports=function(e,t){var n=Object.assign({flipBackslashes:!0},t);n.flipBackslashes&&o$&&e.indexOf($m)<0&&(e=e.replace(a$,$m)),c$.test(e)&&(e+=$m),e+="a";do e=s$(e);while(i$(e)||l$.test(e));return e.replace(u$,"$1")}});var Eu=O(xr=>{"use strict";xr.isInteger=r=>typeof r=="number"?Number.isInteger(r):typeof r=="string"&&r.trim()!==""?Number.isInteger(Number(r)):!1;xr.find=(r,e)=>r.nodes.find(t=>t.type===e);xr.exceedsLimit=(r,e,t=1,n)=>n===!1||!xr.isInteger(r)||!xr.isInteger(e)?!1:(Number(e)-Number(r))/Number(t)>=n;xr.escapeNode=(r,e=0,t)=>{let n=r.nodes[e];n&&(t&&n.type===t||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};xr.encloseBrace=r=>r.type!=="brace"?!1:r.commas>>0+r.ranges>>0===0?(r.invalid=!0,!0):!1;xr.isInvalidBrace=r=>r.type!=="brace"?!1:r.invalid===!0||r.dollar?!0:r.commas>>0+r.ranges>>0===0||r.open!==!0||r.close!==!0?(r.invalid=!0,!0):!1;xr.isOpenOrClose=r=>r.type==="open"||r.type==="close"?!0:r.open===!0||r.close===!0;xr.reduce=r=>r.reduce((e,t)=>(t.type==="text"&&e.push(t.value),t.type==="range"&&(t.type="text"),e),[]);xr.flatten=(...r)=>{let e=[],t=n=>{for(let i=0;i<n.length;i++){let s=n[i];if(Array.isArray(s)){t(s);continue}s!==void 0&&e.push(s)}return e};return t(r),e}});var Tu=O((qz,ZC)=>{"use strict";var QC=Eu();ZC.exports=(r,e={})=>{let t=(n,i={})=>{let s=e.escapeInvalid&&QC.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(s||o)&&QC.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)a+=t(c);return a};return t(r)}});var tA=O((Uz,eA)=>{"use strict";eA.exports=function(r){return typeof r=="number"?r-r===0:typeof r=="string"&&r.trim()!==""?Number.isFinite?Number.isFinite(+r):isFinite(+r):!1}});var uA=O((Wz,lA)=>{"use strict";var rA=tA(),yi=(r,e,t)=>{if(rA(r)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||r===e)return String(r);if(rA(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...t};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let i=String(n.relaxZeros),s=String(n.shorthand),o=String(n.capture),a=String(n.wrap),c=r+":"+e+"="+i+s+o+a;if(yi.cache.hasOwnProperty(c))return yi.cache[c].result;let u=Math.min(r,e),p=Math.max(r,e);if(Math.abs(u-p)===1){let S=r+"|"+e;return n.capture?`(${S})`:n.wrap===!1?S:`(?:${S})`}let f=cA(r)||cA(e),m={min:r,max:e,a:u,b:p},y=[],_=[];if(f&&(m.isPadded=f,m.maxLen=String(m.max).length),u<0){let S=p<0?Math.abs(p):1;_=nA(S,Math.abs(u),m,n),u=m.a=0}return p>=0&&(y=nA(u,p,m,n)),m.negatives=_,m.positives=y,m.result=p$(_,y,n),n.capture===!0?m.result=`(${m.result})`:n.wrap!==!1&&y.length+_.length>1&&(m.result=`(?:${m.result})`),yi.cache[c]=m,m.result};function p$(r,e,t){let n=qm(r,e,"-",!1,t)||[],i=qm(e,r,"",!1,t)||[],s=qm(r,e,"-?",!0,t)||[];return n.concat(s).concat(i).join("|")}function f$(r,e){let t=1,n=1,i=sA(r,t),s=new Set([e]);for(;r<=i&&i<=e;)s.add(i),t+=1,i=sA(r,t);for(i=oA(e+1,n)-1;r<i&&i<=e;)s.add(i),n+=1,i=oA(e+1,n)-1;return s=[...s],s.sort(m$),s}function d$(r,e,t){if(r===e)return{pattern:r,count:[],digits:0};let n=h$(r,e),i=n.length,s="",o=0;for(let a=0;a<i;a++){let[c,u]=n[a];c===u?s+=c:c!=="0"||u!=="9"?s+=g$(c,u,t):o++}return o&&(s+=t.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function nA(r,e,t,n){let i=f$(r,e),s=[],o=r,a;for(let c=0;c<i.length;c++){let u=i[c],p=d$(String(o),String(u),n),f="";if(!t.isPadded&&a&&a.pattern===p.pattern){a.count.length>1&&a.count.pop(),a.count.push(p.count[0]),a.string=a.pattern+aA(a.count),o=u+1;continue}t.isPadded&&(f=v$(u,t,n)),p.string=f+p.pattern+aA(p.count),s.push(p),o=u+1,a=p}return s}function qm(r,e,t,n,i){let s=[];for(let o of r){let{string:a}=o;!n&&!iA(e,"string",a)&&s.push(t+a),n&&iA(e,"string",a)&&s.push(t+a)}return s}function h$(r,e){let t=[];for(let n=0;n<r.length;n++)t.push([r[n],e[n]]);return t}function m$(r,e){return r>e?1:e>r?-1:0}function iA(r,e,t){return r.some(n=>n[e]===t)}function sA(r,e){return Number(String(r).slice(0,-e)+"9".repeat(e))}function oA(r,e){return r-r%Math.pow(10,e)}function aA(r){let[e=0,t=""]=r;return t||e>1?`{${e+(t?","+t:"")}}`:""}function g$(r,e,t){return`[${r}${e-r===1?"":"-"}${e}]`}function cA(r){return/^-?(0+)\d/.test(r)}function v$(r,e,t){if(!e.isPadded)return r;let n=Math.abs(e.maxLen-String(r).length),i=t.relaxZeros!==!1;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}yi.cache={};yi.clearCache=()=>yi.cache={};lA.exports=yi});var Gm=O((Gz,vA)=>{"use strict";var x$=require("util"),fA=uA(),pA=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),y$=r=>e=>r===!0?Number(e):String(e),Um=r=>typeof r=="number"||typeof r=="string"&&r!=="",la=r=>Number.isInteger(+r),Wm=r=>{let e=`${r}`,t=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++t]==="0";);return t>0},_$=(r,e,t)=>typeof r=="string"||typeof e=="string"?!0:t.stringify===!0,b$=(r,e,t)=>{if(e>0){let n=r[0]==="-"?"-":"";n&&(r=r.slice(1)),r=n+r.padStart(n?e-1:e,"0")}return t===!1?String(r):r},Au=(r,e)=>{let t=r[0]==="-"?"-":"";for(t&&(r=r.slice(1),e--);r.length<e;)r="0"+r;return t?"-"+r:r},w$=(r,e,t)=>{r.negatives.sort((a,c)=>a<c?-1:a>c?1:0),r.positives.sort((a,c)=>a<c?-1:a>c?1:0);let n=e.capture?"":"?:",i="",s="",o;return r.positives.length&&(i=r.positives.map(a=>Au(String(a),t)).join("|")),r.negatives.length&&(s=`-(${n}${r.negatives.map(a=>Au(String(a),t)).join("|")})`),i&&s?o=`${i}|${s}`:o=i||s,e.wrap?`(${n}${o})`:o},dA=(r,e,t,n)=>{if(t)return fA(r,e,{wrap:!1,...n});let i=String.fromCharCode(r);if(r===e)return i;let s=String.fromCharCode(e);return`[${i}-${s}]`},hA=(r,e,t)=>{if(Array.isArray(r)){let n=t.wrap===!0,i=t.capture?"":"?:";return n?`(${i}${r.join("|")})`:r.join("|")}return fA(r,e,t)},mA=(...r)=>new RangeError("Invalid range arguments: "+x$.inspect(...r)),gA=(r,e,t)=>{if(t.strictRanges===!0)throw mA([r,e]);return[]},S$=(r,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${r}" to be a number`);return[]},E$=(r,e,t=1,n={})=>{let i=Number(r),s=Number(e);if(!Number.isInteger(i)||!Number.isInteger(s)){if(n.strictRanges===!0)throw mA([r,e]);return[]}i===0&&(i=0),s===0&&(s=0);let o=i>s,a=String(r),c=String(e),u=String(t);t=Math.max(Math.abs(t),1);let p=Wm(a)||Wm(c)||Wm(u),f=p?Math.max(a.length,c.length,u.length):0,m=p===!1&&_$(r,e,n)===!1,y=n.transform||y$(m);if(n.toRegex&&t===1)return dA(Au(r,f),Au(e,f),!0,n);let _={negatives:[],positives:[]},S=L=>_[L<0?"negatives":"positives"].push(Math.abs(L)),A=[],P=0;for(;o?i>=s:i<=s;)n.toRegex===!0&&t>1?S(i):A.push(b$(y(i,P),f,m)),i=o?i-t:i+t,P++;return n.toRegex===!0?t>1?w$(_,n,f):hA(A,null,{wrap:!1,...n}):A},T$=(r,e,t=1,n={})=>{if(!la(r)&&r.length>1||!la(e)&&e.length>1)return gA(r,e,n);let i=n.transform||(m=>String.fromCharCode(m)),s=`${r}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=s>o,c=Math.min(s,o),u=Math.max(s,o);if(n.toRegex&&t===1)return dA(c,u,!1,n);let p=[],f=0;for(;a?s>=o:s<=o;)p.push(i(s,f)),s=a?s-t:s+t,f++;return n.toRegex===!0?hA(p,null,{wrap:!1,options:n}):p},Cu=(r,e,t,n={})=>{if(e==null&&Um(r))return[r];if(!Um(r)||!Um(e))return gA(r,e,n);if(typeof t=="function")return Cu(r,e,1,{transform:t});if(pA(t))return Cu(r,e,0,t);let i={...n};return i.capture===!0&&(i.wrap=!0),t=t||i.step||1,la(t)?la(r)&&la(e)?E$(r,e,t,i):T$(r,e,Math.max(Math.abs(t),1),i):t!=null&&!pA(t)?S$(t,i):Cu(r,e,1,t)};vA.exports=Cu});var _A=O((zz,yA)=>{"use strict";var C$=Gm(),xA=Eu(),A$=(r,e={})=>{let t=(n,i={})=>{let s=xA.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a=s===!0||o===!0,c=e.escapeInvalid===!0?"\\":"",u="";if(n.isOpen===!0)return c+n.value;if(n.isClose===!0)return console.log("node.isClose",c,n.value),c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let p=xA.reduce(n.nodes),f=C$(...p,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(f.length!==0)return p.length>1&&f.length>1?`(${f})`:f}if(n.nodes)for(let p of n.nodes)u+=t(p,n);return u};return t(r)};yA.exports=A$});var SA=O((Kz,wA)=>{"use strict";var R$=Gm(),bA=Tu(),Fs=Eu(),_i=(r="",e="",t=!1)=>{let n=[];if(r=[].concat(r),e=[].concat(e),!e.length)return r;if(!r.length)return t?Fs.flatten(e).map(i=>`{${i}}`):e;for(let i of r)if(Array.isArray(i))for(let s of i)n.push(_i(s,e,t));else for(let s of e)t===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?_i(i,s,t):i+s);return Fs.flatten(n)},k$=(r,e={})=>{let t=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(i,s={})=>{i.queue=[];let o=s,a=s.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(i.invalid||i.dollar){a.push(_i(a.pop(),bA(i,e)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(_i(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let f=Fs.reduce(i.nodes);if(Fs.exceedsLimit(...f,e.step,t))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let m=R$(...f,e);m.length===0&&(m=bA(i,e)),a.push(_i(a.pop(),m)),i.nodes=[];return}let c=Fs.encloseBrace(i),u=i.queue,p=i;for(;p.type!=="brace"&&p.type!=="root"&&p.parent;)p=p.parent,u=p.queue;for(let f=0;f<i.nodes.length;f++){let m=i.nodes[f];if(m.type==="comma"&&i.type==="brace"){f===1&&u.push(""),u.push("");continue}if(m.type==="close"){a.push(_i(a.pop(),u,c));continue}if(m.value&&m.type!=="open"){u.push(_i(u.pop(),m.value));continue}m.nodes&&n(m,i)}return u};return Fs.flatten(n(r))};wA.exports=k$});var TA=O((Vz,EA)=>{"use strict";EA.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
100
+ `,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var OA=O((Yz,kA)=>{"use strict";var O$=Tu(),{MAX_LENGTH:CA,CHAR_BACKSLASH:zm,CHAR_BACKTICK:P$,CHAR_COMMA:M$,CHAR_DOT:I$,CHAR_LEFT_PARENTHESES:N$,CHAR_RIGHT_PARENTHESES:L$,CHAR_LEFT_CURLY_BRACE:D$,CHAR_RIGHT_CURLY_BRACE:B$,CHAR_LEFT_SQUARE_BRACKET:AA,CHAR_RIGHT_SQUARE_BRACKET:RA,CHAR_DOUBLE_QUOTE:j$,CHAR_SINGLE_QUOTE:F$,CHAR_NO_BREAK_SPACE:H$,CHAR_ZERO_WIDTH_NOBREAK_SPACE:$$}=TA(),q$=(r,e={})=>{if(typeof r!="string")throw new TypeError("Expected a string");let t=e||{},n=typeof t.maxLength=="number"?Math.min(CA,t.maxLength):CA;if(r.length>n)throw new SyntaxError(`Input length (${r.length}), exceeds max characters (${n})`);let i={type:"root",input:r,nodes:[]},s=[i],o=i,a=i,c=0,u=r.length,p=0,f=0,m,y=()=>r[p++],_=S=>{if(S.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&S.type==="text"){a.value+=S.value;return}return o.nodes.push(S),S.parent=o,S.prev=a,a=S,S};for(_({type:"bos"});p<u;)if(o=s[s.length-1],m=y(),!(m===$$||m===H$)){if(m===zm){_({type:"text",value:(e.keepEscaping?m:"")+y()});continue}if(m===RA){_({type:"text",value:"\\"+m});continue}if(m===AA){c++;let S;for(;p<u&&(S=y());){if(m+=S,S===AA){c++;continue}if(S===zm){m+=y();continue}if(S===RA&&(c--,c===0))break}_({type:"text",value:m});continue}if(m===N$){o=_({type:"paren",nodes:[]}),s.push(o),_({type:"text",value:m});continue}if(m===L$){if(o.type!=="paren"){_({type:"text",value:m});continue}o=s.pop(),_({type:"text",value:m}),o=s[s.length-1];continue}if(m===j$||m===F$||m===P$){let S=m,A;for(e.keepQuotes!==!0&&(m="");p<u&&(A=y());){if(A===zm){m+=A+y();continue}if(A===S){e.keepQuotes===!0&&(m+=A);break}m+=A}_({type:"text",value:m});continue}if(m===D$){f++;let A={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:f,commas:0,ranges:0,nodes:[]};o=_(A),s.push(o),_({type:"open",value:m});continue}if(m===B$){if(o.type!=="brace"){_({type:"text",value:m});continue}let S="close";o=s.pop(),o.close=!0,_({type:S,value:m}),f--,o=s[s.length-1];continue}if(m===M$&&f>0){if(o.ranges>0){o.ranges=0;let S=o.nodes.shift();o.nodes=[S,{type:"text",value:O$(o)}]}_({type:"comma",value:m}),o.commas++;continue}if(m===I$&&f>0&&o.commas===0){let S=o.nodes;if(f===0||S.length===0){_({type:"text",value:m});continue}if(a.type==="dot"){if(o.range=[],a.value+=m,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){S.pop();let A=S[S.length-1];A.value+=a.value+m,a=A,o.ranges--;continue}_({type:"dot",value:m});continue}_({type:"text",value:m})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(P=>{P.nodes||(P.type==="open"&&(P.isOpen=!0),P.type==="close"&&(P.isClose=!0),P.nodes||(P.type="text"),P.invalid=!0)});let S=s[s.length-1],A=S.nodes.indexOf(o);S.nodes.splice(A,1,...o.nodes)}while(s.length>0);return _({type:"eos"}),i};kA.exports=q$});var IA=O((Xz,MA)=>{"use strict";var PA=Tu(),U$=_A(),W$=SA(),G$=OA(),er=(r,e={})=>{let t=[];if(Array.isArray(r))for(let n of r){let i=er.create(n,e);Array.isArray(i)?t.push(...i):t.push(i)}else t=[].concat(er.create(r,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};er.parse=(r,e={})=>G$(r,e);er.stringify=(r,e={})=>PA(typeof r=="string"?er.parse(r,e):r,e);er.compile=(r,e={})=>(typeof r=="string"&&(r=er.parse(r,e)),U$(r,e));er.expand=(r,e={})=>{typeof r=="string"&&(r=er.parse(r,e));let t=W$(r,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};er.create=(r,e={})=>r===""||r.length<3?[r]:e.expand!==!0?er.compile(r,e):er.expand(r,e);MA.exports=er});var NA=O((Jz,z$)=>{z$.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]});var DA=O((Qz,LA)=>{LA.exports=NA()});var jA=O((Zz,BA)=>{"use strict";var K$=require("path"),V$=DA(),Y$=new Set(V$);BA.exports=r=>Y$.has(K$.extname(r).slice(1).toLowerCase())});var Ru=O(Q=>{"use strict";var{sep:X$}=require("path"),{platform:Km}=process,J$=require("os");Q.EV_ALL="all";Q.EV_READY="ready";Q.EV_ADD="add";Q.EV_CHANGE="change";Q.EV_ADD_DIR="addDir";Q.EV_UNLINK="unlink";Q.EV_UNLINK_DIR="unlinkDir";Q.EV_RAW="raw";Q.EV_ERROR="error";Q.STR_DATA="data";Q.STR_END="end";Q.STR_CLOSE="close";Q.FSEVENT_CREATED="created";Q.FSEVENT_MODIFIED="modified";Q.FSEVENT_DELETED="deleted";Q.FSEVENT_MOVED="moved";Q.FSEVENT_CLONED="cloned";Q.FSEVENT_UNKNOWN="unknown";Q.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1;Q.FSEVENT_TYPE_FILE="file";Q.FSEVENT_TYPE_DIRECTORY="directory";Q.FSEVENT_TYPE_SYMLINK="symlink";Q.KEY_LISTENERS="listeners";Q.KEY_ERR="errHandlers";Q.KEY_RAW="rawEmitters";Q.HANDLER_KEYS=[Q.KEY_LISTENERS,Q.KEY_ERR,Q.KEY_RAW];Q.DOT_SLASH=`.${X$}`;Q.BACK_SLASH_RE=/\\/g;Q.DOUBLE_SLASH_RE=/\/\//;Q.SLASH_OR_BACK_SLASH_RE=/[/\\]/;Q.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;Q.REPLACER_RE=/^\.[/\\]/;Q.SLASH="/";Q.SLASH_SLASH="//";Q.BRACE_START="{";Q.BANG="!";Q.ONE_DOT=".";Q.TWO_DOTS="..";Q.STAR="*";Q.GLOBSTAR="**";Q.ROOT_GLOBSTAR="/**/*";Q.SLASH_GLOBSTAR="/**";Q.DIR_SUFFIX="Dir";Q.ANYMATCH_OPTS={dot:!0};Q.STRING_TYPE="string";Q.FUNCTION_TYPE="function";Q.EMPTY_STR="";Q.EMPTY_FN=()=>{};Q.IDENTITY_FN=r=>r;Q.isWindows=Km==="win32";Q.isMacos=Km==="darwin";Q.isLinux=Km==="linux";Q.isIBMi=J$.type()==="OS400"});var WA=O((tK,UA)=>{"use strict";var Sn=require("fs"),mt=require("path"),{promisify:da}=require("util"),Q$=jA(),{isWindows:Z$,isLinux:eq,EMPTY_FN:tq,EMPTY_STR:rq,KEY_LISTENERS:Hs,KEY_ERR:Vm,KEY_RAW:ua,HANDLER_KEYS:nq,EV_CHANGE:Ou,EV_ADD:ku,EV_ADD_DIR:iq,EV_ERROR:HA,STR_DATA:sq,STR_END:oq,BRACE_START:aq,STAR:cq}=Ru(),lq="watch",uq=da(Sn.open),$A=da(Sn.stat),pq=da(Sn.lstat),fq=da(Sn.close),Ym=da(Sn.realpath),dq={lstat:pq,stat:$A},Jm=(r,e)=>{r instanceof Set?r.forEach(e):e(r)},pa=(r,e,t)=>{let n=r[e];n instanceof Set||(r[e]=n=new Set([n])),n.add(t)},hq=r=>e=>{let t=r[e];t instanceof Set?t.clear():delete r[e]},fa=(r,e,t)=>{let n=r[e];n instanceof Set?n.delete(t):n===t&&delete r[e]},qA=r=>r instanceof Set?r.size===0:!r,Pu=new Map;function FA(r,e,t,n,i){let s=(o,a)=>{t(r),i(o,a,{watchedPath:r}),a&&r!==a&&Mu(mt.resolve(r,a),Hs,mt.join(r,a))};try{return Sn.watch(r,e,s)}catch(o){n(o)}}var Mu=(r,e,t,n,i)=>{let s=Pu.get(r);s&&Jm(s[e],o=>{o(t,n,i)})},mq=(r,e,t,n)=>{let{listener:i,errHandler:s,rawEmitter:o}=n,a=Pu.get(e),c;if(!t.persistent)return c=FA(r,t,i,s,o),c.close.bind(c);if(a)pa(a,Hs,i),pa(a,Vm,s),pa(a,ua,o);else{if(c=FA(r,t,Mu.bind(null,e,Hs),s,Mu.bind(null,e,ua)),!c)return;c.on(HA,async u=>{let p=Mu.bind(null,e,Vm);if(a.watcherUnusable=!0,Z$&&u.code==="EPERM")try{let f=await uq(r,"r");await fq(f),p(u)}catch{}else p(u)}),a={listeners:i,errHandlers:s,rawEmitters:o,watcher:c},Pu.set(e,a)}return()=>{fa(a,Hs,i),fa(a,Vm,s),fa(a,ua,o),qA(a.listeners)&&(a.watcher.close(),Pu.delete(e),nq.forEach(hq(a)),a.watcher=void 0,Object.freeze(a))}},Xm=new Map,gq=(r,e,t,n)=>{let{listener:i,rawEmitter:s}=n,o=Xm.get(e),a=new Set,c=new Set,u=o&&o.options;return u&&(u.persistent<t.persistent||u.interval>t.interval)&&(a=o.listeners,c=o.rawEmitters,Sn.unwatchFile(e),o=void 0),o?(pa(o,Hs,i),pa(o,ua,s)):(o={listeners:i,rawEmitters:s,options:t,watcher:Sn.watchFile(e,t,(p,f)=>{Jm(o.rawEmitters,y=>{y(Ou,e,{curr:p,prev:f})});let m=p.mtimeMs;(p.size!==f.size||m>f.mtimeMs||m===0)&&Jm(o.listeners,y=>y(r,p))})},Xm.set(e,o)),()=>{fa(o,Hs,i),fa(o,ua,s),qA(o.listeners)&&(Xm.delete(e),Sn.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o))}},Qm=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let n=this.fsw.options,i=mt.dirname(e),s=mt.basename(e);this.fsw._getWatchedDir(i).add(s);let a=mt.resolve(e),c={persistent:n.persistent};t||(t=tq);let u;return n.usePolling?(c.interval=n.enableBinaryInterval&&Q$(s)?n.binaryInterval:n.interval,u=gq(e,a,c,{listener:t,rawEmitter:this.fsw._emitRaw})):u=mq(e,a,c,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),u}_handleFile(e,t,n){if(this.fsw.closed)return;let i=mt.dirname(e),s=mt.basename(e),o=this.fsw._getWatchedDir(i),a=t;if(o.has(s))return;let c=async(p,f)=>{if(this.fsw._throttle(lq,e,5)){if(!f||f.mtimeMs===0)try{let m=await $A(e);if(this.fsw.closed)return;let y=m.atimeMs,_=m.mtimeMs;(!y||y<=_||_!==a.mtimeMs)&&this.fsw._emit(Ou,e,m),eq&&a.ino!==m.ino?(this.fsw._closeFile(p),a=m,this.fsw._addPathCloser(p,this._watchWithNodeFs(e,c))):a=m}catch{this.fsw._remove(i,s)}else if(o.has(s)){let m=f.atimeMs,y=f.mtimeMs;(!m||m<=y||y!==a.mtimeMs)&&this.fsw._emit(Ou,e,f),a=f}}},u=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(ku,e,0))return;this.fsw._emit(ku,e,t)}return u}async _handleSymlink(e,t,n,i){if(this.fsw.closed)return;let s=e.fullPath,o=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await Ym(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(o.has(i)?this.fsw._symlinkPaths.get(s)!==a&&(this.fsw._symlinkPaths.set(s,a),this.fsw._emit(Ou,n,e.stats)):(o.add(i),this.fsw._symlinkPaths.set(s,a),this.fsw._emit(ku,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(s))return!0;this.fsw._symlinkPaths.set(s,!0)}_handleRead(e,t,n,i,s,o,a){if(e=mt.join(e,rq),!n.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let c=this.fsw._getWatchedDir(n.path),u=new Set,p=this.fsw._readdirp(e,{fileFilter:f=>n.filterPath(f),directoryFilter:f=>n.filterDir(f),depth:0}).on(sq,async f=>{if(this.fsw.closed){p=void 0;return}let m=f.path,y=mt.join(e,m);if(u.add(m),!(f.stats.isSymbolicLink()&&await this._handleSymlink(f,e,y,m))){if(this.fsw.closed){p=void 0;return}(m===i||!i&&!c.has(m))&&(this.fsw._incrReadyCount(),y=mt.join(s,mt.relative(s,y)),this._addToNodeFs(y,t,n,o+1))}}).on(HA,this._boundHandleError);return new Promise(f=>p.once(oq,()=>{if(this.fsw.closed){p=void 0;return}let m=a?a.clear():!1;f(),c.getChildren().filter(y=>y!==e&&!u.has(y)&&(!n.hasGlob||n.filterPath({fullPath:mt.resolve(e,y)}))).forEach(y=>{this.fsw._remove(e,y)}),p=void 0,m&&this._handleRead(e,!1,n,i,s,o,a)}))}async _handleDir(e,t,n,i,s,o,a){let c=this.fsw._getWatchedDir(mt.dirname(e)),u=c.has(mt.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!s&&!u&&(!o.hasGlob||o.globFilter(e))&&this.fsw._emit(iq,e,t),c.add(mt.basename(e)),this.fsw._getWatchedDir(e);let p,f,m=this.fsw.options.depth;if((m==null||i<=m)&&!this.fsw._symlinkPaths.has(a)){if(!s&&(await this._handleRead(e,n,o,s,e,i,p),this.fsw.closed))return;f=this._watchWithNodeFs(e,(y,_)=>{_&&_.mtimeMs===0||this._handleRead(y,!1,o,s,e,i,p)})}return f}async _addToNodeFs(e,t,n,i,s){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let a=this.fsw._getWatchHelpers(e,i);!a.hasGlob&&n&&(a.hasGlob=n.hasGlob,a.globFilter=n.globFilter,a.filterPath=c=>n.filterPath(c),a.filterDir=c=>n.filterDir(c));try{let c=await dq[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return o(),!1;let u=this.fsw.options.followSymlinks&&!e.includes(cq)&&!e.includes(aq),p;if(c.isDirectory()){let f=mt.resolve(e),m=u?await Ym(e):e;if(this.fsw.closed||(p=await this._handleDir(a.watchPath,c,t,i,s,a,m),this.fsw.closed))return;f!==m&&m!==void 0&&this.fsw._symlinkPaths.set(f,m)}else if(c.isSymbolicLink()){let f=u?await Ym(e):e;if(this.fsw.closed)return;let m=mt.dirname(a.watchPath);if(this.fsw._getWatchedDir(m).add(a.watchPath),this.fsw._emit(ku,a.watchPath,c),p=await this._handleDir(m,c,t,i,e,a,f),this.fsw.closed)return;f!==void 0&&this.fsw._symlinkPaths.set(mt.resolve(e),f)}else p=this._handleFile(a.watchPath,c,t);return o(),this.fsw._addPathCloser(e,p),!1}catch(c){if(this.fsw._handleError(c))return o(),e}}};UA.exports=Qm});var JA=O((rK,og)=>{"use strict";var ig=require("fs"),gt=require("path"),{promisify:sg}=require("util"),$s;try{$s=require("fsevents")}catch(r){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(r)}if($s){let r=process.version.match(/v(\d+)\.(\d+)/);if(r&&r[1]&&r[2]){let e=Number.parseInt(r[1],10),t=Number.parseInt(r[2],10);e===8&&t<16&&($s=void 0)}}var{EV_ADD:Zm,EV_CHANGE:vq,EV_ADD_DIR:GA,EV_UNLINK:Iu,EV_ERROR:xq,STR_DATA:yq,STR_END:_q,FSEVENT_CREATED:bq,FSEVENT_MODIFIED:wq,FSEVENT_DELETED:Sq,FSEVENT_MOVED:Eq,FSEVENT_UNKNOWN:Tq,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:Cq,FSEVENT_TYPE_FILE:Aq,FSEVENT_TYPE_DIRECTORY:ha,FSEVENT_TYPE_SYMLINK:XA,ROOT_GLOBSTAR:zA,DIR_SUFFIX:Rq,DOT_SLASH:KA,FUNCTION_TYPE:eg,EMPTY_FN:kq,IDENTITY_FN:Oq}=Ru(),Pq=r=>isNaN(r)?{}:{depth:r},rg=sg(ig.stat),Mq=sg(ig.lstat),VA=sg(ig.realpath),Iq={stat:rg,lstat:Mq},bi=new Map,Nq=10,Lq=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),Dq=(r,e)=>({stop:$s.watch(r,e)});function Bq(r,e,t,n){let i=gt.extname(e)?gt.dirname(e):e,s=gt.dirname(i),o=bi.get(i);jq(s)&&(i=s);let a=gt.resolve(r),c=a!==e,u=(f,m,y)=>{c&&(f=f.replace(e,a)),(f===a||!f.indexOf(a+gt.sep))&&t(f,m,y)},p=!1;for(let f of bi.keys())if(e.indexOf(gt.resolve(f)+gt.sep)===0){i=f,o=bi.get(i),p=!0;break}return o||p?o.listeners.add(u):(o={listeners:new Set([u]),rawEmitter:n,watcher:Dq(i,(f,m)=>{if(!o.listeners.size||m&Cq)return;let y=$s.getInfo(f,m);o.listeners.forEach(_=>{_(f,m,y)}),o.rawEmitter(y.event,f,y)})},bi.set(i,o)),()=>{let f=o.listeners;if(f.delete(u),!f.size&&(bi.delete(i),o.watcher))return o.watcher.stop().then(()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o)})}}var jq=r=>{let e=0;for(let t of bi.keys())if(t.indexOf(r)===0&&(e++,e>=Nq))return!0;return!1},Fq=()=>$s&&bi.size<128,tg=(r,e)=>{let t=0;for(;!r.indexOf(e)&&(r=gt.dirname(r))!==e;)t++;return t},YA=(r,e)=>r.type===ha&&e.isDirectory()||r.type===XA&&e.isSymbolicLink()||r.type===Aq&&e.isFile(),ng=class{constructor(e){this.fsw=e}checkIgnored(e,t){let n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,t))return n.add(e),t&&t.isDirectory()&&n.add(e+zA),!0;n.delete(e),n.delete(e+zA)}addOrChange(e,t,n,i,s,o,a,c){let u=s.has(o)?vq:Zm;this.handleEvent(u,e,t,n,i,s,o,a,c)}async checkExists(e,t,n,i,s,o,a,c){try{let u=await rg(e);if(this.fsw.closed)return;YA(a,u)?this.addOrChange(e,t,n,i,s,o,a,c):this.handleEvent(Iu,e,t,n,i,s,o,a,c)}catch(u){u.code==="EACCES"?this.addOrChange(e,t,n,i,s,o,a,c):this.handleEvent(Iu,e,t,n,i,s,o,a,c)}}handleEvent(e,t,n,i,s,o,a,c,u){if(!(this.fsw.closed||this.checkIgnored(t)))if(e===Iu){let p=c.type===ha;(p||o.has(a))&&this.fsw._remove(s,a,p)}else{if(e===Zm){if(c.type===ha&&this.fsw._getWatchedDir(t),c.type===XA&&u.followSymlinks){let f=u.depth===void 0?void 0:tg(n,i)+1;return this._addToFsEvents(t,!1,!0,f)}this.fsw._getWatchedDir(s).add(a)}let p=c.type===ha?e+Rq:e;this.fsw._emit(p,t),p===GA&&this._addToFsEvents(t,!1,!0)}}_watchWithFsEvents(e,t,n,i){if(this.fsw.closed||this.fsw._isIgnored(e))return;let s=this.fsw.options,a=Bq(e,t,async(c,u,p)=>{if(this.fsw.closed||s.depth!==void 0&&tg(c,t)>s.depth)return;let f=n(gt.join(e,gt.relative(e,c)));if(i&&!i(f))return;let m=gt.dirname(f),y=gt.basename(f),_=this.fsw._getWatchedDir(p.type===ha?f:m);if(Lq.has(u)||p.event===Tq)if(typeof s.ignored===eg){let S;try{S=await rg(f)}catch{}if(this.fsw.closed||this.checkIgnored(f,S))return;YA(p,S)?this.addOrChange(f,c,t,m,_,y,p,s):this.handleEvent(Iu,f,c,t,m,_,y,p,s)}else this.checkExists(f,c,t,m,_,y,p,s);else switch(p.event){case bq:case wq:return this.addOrChange(f,c,t,m,_,y,p,s);case Sq:case Eq:return this.checkExists(f,c,t,m,_,y,p,s)}},this.fsw._emitRaw);return this.fsw._emitReady(),a}async _handleFsEventsSymlink(e,t,n,i){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(t))){this.fsw._symlinkPaths.set(t,!0),this.fsw._incrReadyCount();try{let s=await VA(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(s))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(s||e,o=>{let a=e;return s&&s!==KA?a=o.replace(s,e):o!==KA&&(a=gt.join(e,o)),n(a)},!1,i)}catch(s){if(this.fsw._handleError(s))return this.fsw._emitReady()}}}emitAdd(e,t,n,i,s){let o=n(e),a=t.isDirectory(),c=this.fsw._getWatchedDir(gt.dirname(o)),u=gt.basename(o);a&&this.fsw._getWatchedDir(o),!c.has(u)&&(c.add(u),(!i.ignoreInitial||s===!0)&&this.fsw._emit(a?GA:Zm,o,t))}initWatch(e,t,n,i){if(this.fsw.closed)return;let s=this._watchWithFsEvents(n.watchPath,gt.resolve(e||n.watchPath),i,n.globFilter);this.fsw._addPathCloser(t,s)}async _addToFsEvents(e,t,n,i){if(this.fsw.closed)return;let s=this.fsw.options,o=typeof t===eg?t:Oq,a=this.fsw._getWatchHelpers(e);try{let c=await Iq[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))throw null;if(c.isDirectory()){if(a.globFilter||this.emitAdd(o(e),c,o,s,n),i&&i>s.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:u=>a.filterPath(u),directoryFilter:u=>a.filterDir(u),...Pq(s.depth-(i||0))}).on(yq,u=>{if(this.fsw.closed||u.stats.isDirectory()&&!a.filterPath(u))return;let p=gt.join(a.watchPath,u.path),{fullPath:f}=u;if(a.followSymlinks&&u.stats.isSymbolicLink()){let m=s.depth===void 0?void 0:tg(p,gt.resolve(a.watchPath))+1;this._handleFsEventsSymlink(p,f,o,m)}else this.emitAdd(p,u.stats,o,s,n)}).on(xq,kq).on(_q,()=>{this.fsw._emitReady()})}else this.emitAdd(a.watchPath,c,o,s,n),this.fsw._emitReady()}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(s.persistent&&n!==!0)if(typeof t===eg)this.initWatch(void 0,e,a,o);else{let c;try{c=await VA(a.watchPath)}catch{}this.initWatch(c,e,a,o)}}};og.exports=ng;og.exports.canUse=Fq});var cR=O(bg=>{"use strict";var{EventEmitter:Hq}=require("events"),yg=require("fs"),ce=require("path"),{promisify:iR}=require("util"),$q=gC(),fg=GC().default,qq=JC(),ag=Hm(),Uq=IA(),Wq=jm(),Gq=WA(),QA=JA(),{EV_ALL:cg,EV_READY:zq,EV_ADD:Nu,EV_CHANGE:ma,EV_UNLINK:ZA,EV_ADD_DIR:Kq,EV_UNLINK_DIR:Vq,EV_RAW:Yq,EV_ERROR:lg,STR_CLOSE:Xq,STR_END:Jq,BACK_SLASH_RE:Qq,DOUBLE_SLASH_RE:eR,SLASH_OR_BACK_SLASH_RE:Zq,DOT_RE:eU,REPLACER_RE:tU,SLASH:ug,SLASH_SLASH:rU,BRACE_START:nU,BANG:dg,ONE_DOT:sR,TWO_DOTS:iU,GLOBSTAR:sU,SLASH_GLOBSTAR:pg,ANYMATCH_OPTS:hg,STRING_TYPE:_g,FUNCTION_TYPE:oU,EMPTY_STR:mg,EMPTY_FN:aU,isWindows:cU,isMacos:lU,isIBMi:uU}=Ru(),pU=iR(yg.stat),fU=iR(yg.readdir),gg=(r=[])=>Array.isArray(r)?r:[r],oR=(r,e=[])=>(r.forEach(t=>{Array.isArray(t)?oR(t,e):e.push(t)}),e),tR=r=>{let e=oR(gg(r));if(!e.every(t=>typeof t===_g))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(aR)},rR=r=>{let e=r.replace(Qq,ug),t=!1;for(e.startsWith(rU)&&(t=!0);e.match(eR);)e=e.replace(eR,ug);return t&&(e=ug+e),e},aR=r=>rR(ce.normalize(rR(r))),nR=(r=mg)=>e=>typeof e!==_g?e:aR(ce.isAbsolute(e)?e:ce.join(r,e)),dU=(r,e)=>ce.isAbsolute(r)?r:r.startsWith(dg)?dg+ce.join(e,r.slice(1)):ce.join(e,r),Pr=(r,e)=>r[e]===void 0,vg=class{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==sR&&e!==iU&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let n=this.path;try{await fU(n)}catch{this._removeWatcher&&this._removeWatcher(ce.dirname(n),ce.basename(n))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}},hU="stat",mU="lstat",xg=class{constructor(e,t,n,i){this.fsw=i,this.path=e=e.replace(tU,mg),this.watchPath=t,this.fullWatchPath=ce.resolve(t),this.hasGlob=t!==e,e===mg&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?fg(e,void 0,hg):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(s=>{s.length>1&&s.pop()}),this.followSymlinks=n,this.statMethod=n?hU:mU}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return ce.join(this.watchPath,ce.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===oU?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}getDirParts(e){if(!this.hasGlob)return[];let t=[];return(e.includes(nU)?Uq.expand(e):[e]).forEach(i=>{t.push(ce.relative(this.watchPath,i).split(Zq))}),t}filterDir(e){if(this.hasGlob){let t=this.getDirParts(this.checkGlobSymlink(e)),n=!1;this.unmatchedGlob=!this.dirParts.some(i=>i.every((s,o)=>(s===sU&&(n=!0),n||!t[0][o]||fg(s,t[0][o],hg))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Lu=class extends Hq{constructor(e){super();let t={};e&&Object.assign(t,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,Pr(t,"persistent")&&(t.persistent=!0),Pr(t,"ignoreInitial")&&(t.ignoreInitial=!1),Pr(t,"ignorePermissionErrors")&&(t.ignorePermissionErrors=!1),Pr(t,"interval")&&(t.interval=100),Pr(t,"binaryInterval")&&(t.binaryInterval=300),Pr(t,"disableGlobbing")&&(t.disableGlobbing=!1),t.enableBinaryInterval=t.binaryInterval!==t.interval,Pr(t,"useFsEvents")&&(t.useFsEvents=!t.usePolling),QA.canUse()||(t.useFsEvents=!1),Pr(t,"usePolling")&&!t.useFsEvents&&(t.usePolling=lU),uU&&(t.usePolling=!0);let i=process.env.CHOKIDAR_USEPOLLING;if(i!==void 0){let c=i.toLowerCase();c==="false"||c==="0"?t.usePolling=!1:c==="true"||c==="1"?t.usePolling=!0:t.usePolling=!!c}let s=process.env.CHOKIDAR_INTERVAL;s&&(t.interval=Number.parseInt(s,10)),Pr(t,"atomic")&&(t.atomic=!t.usePolling&&!t.useFsEvents),t.atomic&&(this._pendingUnlinks=new Map),Pr(t,"followSymlinks")&&(t.followSymlinks=!0),Pr(t,"awaitWriteFinish")&&(t.awaitWriteFinish=!1),t.awaitWriteFinish===!0&&(t.awaitWriteFinish={});let o=t.awaitWriteFinish;o&&(o.stabilityThreshold||(o.stabilityThreshold=2e3),o.pollInterval||(o.pollInterval=100),this._pendingWrites=new Map),t.ignored&&(t.ignored=gg(t.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=aU,this._readyEmitted=!0,process.nextTick(()=>this.emit(zq)))},this._emitRaw=(...c)=>this.emit(Yq,...c),this._readyEmitted=!1,this.options=t,t.useFsEvents?this._fsEventsHandler=new QA(this):this._nodeFsHandler=new Gq(this),Object.freeze(t)}add(e,t,n){let{cwd:i,disableGlobbing:s}=this.options;this.closed=!1;let o=tR(e);return i&&(o=o.map(a=>{let c=dU(a,i);return s||!ag(a)?c:Wq(c)})),o=o.filter(a=>a.startsWith(dg)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+pg),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=o.length),this.options.persistent&&(this._readyCount+=o.length),o.forEach(a=>this._fsEventsHandler._addToFsEvents(a))):(this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async a=>{let c=await this._nodeFsHandler._addToNodeFs(a,!n,0,0,t);return c&&this._emitReady(),c})).then(a=>{this.closed||a.filter(c=>c).forEach(c=>{this.add(ce.dirname(c),ce.basename(t||c))})})),this}unwatch(e){if(this.closed)return this;let t=tR(e),{cwd:n}=this.options;return t.forEach(i=>{!ce.isAbsolute(i)&&!this._closers.has(i)&&(n&&(i=ce.join(n,i)),i=ce.resolve(i)),this._closePath(i),this._ignoredPaths.add(i),this._watched.has(i)&&this._ignoredPaths.add(i+pg),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(n=>{let i=n();i instanceof Promise&&e.push(i)})),this._streams.forEach(t=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(t=>t.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(t=>{this[`_${t}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,n)=>{let i=this.options.cwd?ce.relative(this.options.cwd,n):n;e[i||sR]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(...t),e!==lg&&this.emit(cg,...t)}async _emit(e,t,n,i,s){if(this.closed)return;let o=this.options;cU&&(t=ce.normalize(t)),o.cwd&&(t=ce.relative(o.cwd,t));let a=[e,t];s!==void 0?a.push(n,i,s):i!==void 0?a.push(n,i):n!==void 0&&a.push(n);let c=o.awaitWriteFinish,u;if(c&&(u=this._pendingWrites.get(t)))return u.lastChange=new Date,this;if(o.atomic){if(e===ZA)return this._pendingUnlinks.set(t,a),setTimeout(()=>{this._pendingUnlinks.forEach((p,f)=>{this.emit(...p),this.emit(cg,...p),this._pendingUnlinks.delete(f)})},typeof o.atomic=="number"?o.atomic:100),this;e===Nu&&this._pendingUnlinks.has(t)&&(e=a[0]=ma,this._pendingUnlinks.delete(t))}if(c&&(e===Nu||e===ma)&&this._readyEmitted){let p=(f,m)=>{f?(e=a[0]=lg,a[1]=f,this.emitWithAll(e,a)):m&&(a.length>2?a[2]=m:a.push(m),this.emitWithAll(e,a))};return this._awaitWriteFinish(t,c.stabilityThreshold,e,p),this}if(e===ma&&!this._throttle(ma,t,50))return this;if(o.alwaysStat&&n===void 0&&(e===Nu||e===Kq||e===ma)){let p=o.cwd?ce.join(o.cwd,t):t,f;try{f=await pU(p)}catch{}if(!f||this.closed)return;a.push(f)}return this.emitWithAll(e,a),this}_handleError(e){let t=e&&e.code;return e&&t!=="ENOENT"&&t!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||t!=="EPERM"&&t!=="EACCES")&&this.emit(lg,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);let i=this._throttled.get(e),s=i.get(t);if(s)return s.count++,!1;let o,a=()=>{let u=i.get(t),p=u?u.count:0;return i.delete(t),clearTimeout(o),u&&clearTimeout(u.timeoutObject),p};o=setTimeout(a,n);let c={timeoutObject:o,clear:a,count:0};return i.set(t,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,i){let s,o=e;this.options.cwd&&!ce.isAbsolute(e)&&(o=ce.join(this.options.cwd,e));let a=new Date,c=u=>{yg.stat(o,(p,f)=>{if(p||!this._pendingWrites.has(e)){p&&p.code!=="ENOENT"&&i(p);return}let m=Number(new Date);u&&f.size!==u.size&&(this._pendingWrites.get(e).lastChange=m);let y=this._pendingWrites.get(e);m-y.lastChange>=t?(this._pendingWrites.delete(e),i(void 0,f)):s=setTimeout(c,this.options.awaitWriteFinish.pollInterval,f)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:a,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(s),n)}),s=setTimeout(c,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,t){if(this.options.atomic&&eU.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,i=this.options.ignored,s=i&&i.map(nR(n)),o=gg(s).filter(c=>typeof c===_g&&!ag(c)).map(c=>c+pg),a=this._getGlobIgnored().map(nR(n)).concat(s,o);this._userIgnored=fg(a,void 0,hg)}return this._userIgnored([e,t])}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e,t){let n=t||this.options.disableGlobbing||!ag(e)?e:qq(e),i=this.options.followSymlinks;return new xg(e,n,i,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let t=ce.resolve(e);return this._watched.has(t)||this._watched.set(t,new vg(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;let n=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(n.toString(8)[0],10))}_remove(e,t,n){let i=ce.join(e,t),s=ce.resolve(i);if(n=n??(this._watched.has(i)||this._watched.has(s)),!this._throttle("remove",i,100))return;!n&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(i).getChildren().forEach(m=>this._remove(i,m));let c=this._getWatchedDir(e),u=c.has(t);c.remove(t),this._symlinkPaths.has(s)&&this._symlinkPaths.delete(s);let p=i;if(this.options.cwd&&(p=ce.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(p)&&this._pendingWrites.get(p).cancelWait()===Nu)return;this._watched.delete(i),this._watched.delete(s);let f=n?Vq:ZA;u&&!this._isIgnored(i)&&this._emit(f,i),this.options.useFsEvents||this._closePath(i)}_closePath(e){this._closeFile(e);let t=ce.dirname(e);this._getWatchedDir(t).remove(ce.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(n=>n()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(t)}_readdirp(e,t){if(this.closed)return;let n={type:cg,alwaysStat:!0,lstat:!0,...t},i=$q(e,n);return this._streams.add(i),i.once(Xq,()=>{i=void 0}),i.once(Jq,()=>{i&&(this._streams.delete(i),i=void 0)}),i}};bg.FSWatcher=Lu;var gU=(r,e)=>{let t=new Lu(e);return t.add(r),t};bg.watch=gU});var JR=O((PK,Ag)=>{"use strict";var SU=Object.prototype.hasOwnProperty,Mt="~";function ba(){}Object.create&&(ba.prototype=Object.create(null),new ba().__proto__||(Mt=!1));function EU(r,e,t){this.fn=r,this.context=e,this.once=t||!1}function XR(r,e,t,n,i){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new EU(t,n||r,i),o=Mt?Mt+e:e;return r._events[o]?r._events[o].fn?r._events[o]=[r._events[o],s]:r._events[o].push(s):(r._events[o]=s,r._eventsCount++),r}function qu(r,e){--r._eventsCount===0?r._events=new ba:delete r._events[e]}function At(){this._events=new ba,this._eventsCount=0}At.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)SU.call(t,n)&&e.push(Mt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};At.prototype.listeners=function(e){var t=Mt?Mt+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=new Array(s);i<s;i++)o[i]=n[i].fn;return o};At.prototype.listenerCount=function(e){var t=Mt?Mt+e:e,n=this._events[t];return n?n.fn?1:n.length:0};At.prototype.emit=function(e,t,n,i,s,o){var a=Mt?Mt+e:e;if(!this._events[a])return!1;var c=this._events[a],u=arguments.length,p,f;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,s),!0;case 6:return c.fn.call(c.context,t,n,i,s,o),!0}for(f=1,p=new Array(u-1);f<u;f++)p[f-1]=arguments[f];c.fn.apply(c.context,p)}else{var m=c.length,y;for(f=0;f<m;f++)switch(c[f].once&&this.removeListener(e,c[f].fn,void 0,!0),u){case 1:c[f].fn.call(c[f].context);break;case 2:c[f].fn.call(c[f].context,t);break;case 3:c[f].fn.call(c[f].context,t,n);break;case 4:c[f].fn.call(c[f].context,t,n,i);break;default:if(!p)for(y=1,p=new Array(u-1);y<u;y++)p[y-1]=arguments[y];c[f].fn.apply(c[f].context,p)}}return!0};At.prototype.on=function(e,t,n){return XR(this,e,t,n,!1)};At.prototype.once=function(e,t,n){return XR(this,e,t,n,!0)};At.prototype.removeListener=function(e,t,n,i){var s=Mt?Mt+e:e;if(!this._events[s])return this;if(!t)return qu(this,s),this;var o=this._events[s];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&qu(this,s);else{for(var a=0,c=[],u=o.length;a<u;a++)(o[a].fn!==t||i&&!o[a].once||n&&o[a].context!==n)&&c.push(o[a]);c.length?this._events[s]=c.length===1?c[0]:c:qu(this,s)}return this};At.prototype.removeAllListeners=function(e){var t;return e?(t=Mt?Mt+e:e,this._events[t]&&qu(this,t)):(this._events=new ba,this._eventsCount=0),this};At.prototype.off=At.prototype.removeListener;At.prototype.addListener=At.prototype.on;At.prefixed=Mt;At.EventEmitter=At;typeof Ag<"u"&&(Ag.exports=At)});var ZR=O((MK,QR)=>{"use strict";QR.exports=function(e,t){if(t=t.split(":")[0],e=+e,!e)return!1;switch(t){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}});var Uu=O(tk=>{var Cn=tk,TU=require("url"),ek=require("util")._extend,CU=ZR(),AU=/(^|,)\s*upgrade\s*($|,)/i,Rg=/^https|wss/;Cn.isSSL=Rg;Cn.setupOutgoing=function(r,e,t,n){r.port=e[n||"target"].port||(Rg.test(e[n||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(a){r[a]=e[n||"target"][a]}),r.method=e.method||t.method,r.headers=ek({},t.headers),e.headers&&ek(r.headers,e.headers),e.auth&&(r.auth=e.auth),e.ca&&(r.ca=e.ca),Rg.test(e[n||"target"].protocol)&&(r.rejectUnauthorized=typeof e.secure>"u"?!0:e.secure),r.agent=e.agent||!1,r.localAddress=e.localAddress,r.agent||(r.headers=r.headers||{},(typeof r.headers.connection!="string"||!AU.test(r.headers.connection))&&(r.headers.connection="close"));var i=e[n||"target"],s=i&&e.prependPath!==!1&&i.path||"",o=e.toProxy?t.url:TU.parse(t.url).path||"";return o=e.ignorePath?"":o,r.path=Cn.urlJoin(s,o),e.changeOrigin&&(r.headers.host=CU(r.port,e[n||"target"].protocol)&&!RU(r.host)?r.host+":"+r.port:r.host),r};Cn.setupSocket=function(r){return r.setTimeout(0),r.setNoDelay(!0),r.setKeepAlive(!0,0),r};Cn.getPort=function(r){var e=r.headers.host?r.headers.host.match(/:(\d+)/):"";return e?e[1]:Cn.hasEncryptedConnection(r)?"443":"80"};Cn.hasEncryptedConnection=function(r){return!!(r.connection.encrypted||r.connection.pair)};Cn.urlJoin=function(){var r=Array.prototype.slice.call(arguments),e=r.length-1,t=r[e],n=t.split("?"),i;return r[e]=n.shift(),i=[r.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")],i.push.apply(i,n),i.join("?")};Cn.rewriteCookieProperty=function r(e,t,n){return Array.isArray(e)?e.map(function(i){return r(i,t,n)}):e.replace(new RegExp("(;\\s*"+n+"=)([^;]+)","i"),function(i,s,o){var a;if(o in t)a=t[o];else if("*"in t)a=t["*"];else return i;return a?s+a:""})};function RU(r){return!!~r.indexOf(":")}});var sk=O((NK,ik)=>{var rk=require("url"),nk=Uu(),kU=/^201|30(1|2|7|8)$/;ik.exports={removeChunked:function(e,t,n){e.httpVersion==="1.0"&&delete n.headers["transfer-encoding"]},setConnection:function(e,t,n){e.httpVersion==="1.0"?n.headers.connection=e.headers.connection||"close":e.httpVersion!=="2.0"&&!n.headers.connection&&(n.headers.connection=e.headers.connection||"keep-alive")},setRedirectHostRewrite:function(e,t,n,i){if((i.hostRewrite||i.autoRewrite||i.protocolRewrite)&&n.headers.location&&kU.test(n.statusCode)){var s=rk.parse(i.target),o=rk.parse(n.headers.location);if(s.host!=o.host)return;i.hostRewrite?o.host=i.hostRewrite:i.autoRewrite&&(o.host=e.headers.host),i.protocolRewrite&&(o.protocol=i.protocolRewrite),n.headers.location=o.format()}},writeHeaders:function(e,t,n,i){var s=i.cookieDomainRewrite,o=i.cookiePathRewrite,a=i.preserveHeaderKeyCase,c,u=function(m,y){y!=null&&(s&&m.toLowerCase()==="set-cookie"&&(y=nk.rewriteCookieProperty(y,s,"domain")),o&&m.toLowerCase()==="set-cookie"&&(y=nk.rewriteCookieProperty(y,o,"path")),t.setHeader(String(m).trim(),y))};if(typeof s=="string"&&(s={"*":s}),typeof o=="string"&&(o={"*":o}),a&&n.rawHeaders!=null){c={};for(var p=0;p<n.rawHeaders.length;p+=2){var f=n.rawHeaders[p];c[f.toLowerCase()]=f}}Object.keys(n.headers).forEach(function(m){var y=n.headers[m];a&&c&&(m=c[m]||m),u(m,y)})},writeStatusCode:function(e,t,n){n.statusMessage?(t.statusCode=n.statusCode,t.statusMessage=n.statusMessage):t.statusCode=n.statusCode}}});var ak=O((LK,ok)=>{var wa;ok.exports=function(){if(!wa){try{wa=Ae()("follow-redirects")}catch{}typeof wa!="function"&&(wa=function(){})}wa.apply(null,arguments)}});var fk=O((DK,Hg)=>{var Ea=require("url"),Sa=Ea.URL,OU=require("http"),PU=require("https"),Ig=require("stream").Writable,Ng=require("assert"),ck=ak();(function(){var e=typeof process<"u",t=typeof window<"u"&&typeof document<"u",n=Ci(Error.captureStackTrace);!e&&(t||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var Lg=!1;try{Ng(new Sa(""))}catch(r){Lg=r.code==="ERR_INVALID_URL"}var MU=["Authorization","Proxy-Authorization","Cookie"],IU=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],Dg=["abort","aborted","connect","error","socket","timeout"],Bg=Object.create(null);Dg.forEach(function(r){Bg[r]=function(e,t,n){this._redirectable.emit(r,e,t,n)}});var Og=Ta("ERR_INVALID_URL","Invalid URL",TypeError),Pg=Ta("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),NU=Ta("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Pg),LU=Ta("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),DU=Ta("ERR_STREAM_WRITE_AFTER_END","write after end"),BU=Ig.prototype.destroy||uk;function Wt(r,e){Ig.call(this),this._sanitizeOptions(r),this._options=r,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var t=this;this._onNativeResponse=function(n){try{t._processResponse(n)}catch(i){t.emit("error",i instanceof Pg?i:new Pg({cause:i}))}},this._headerFilter=new RegExp("^(?:"+MU.concat(r.sensitiveHeaders).map(UU).join("|")+")$","i"),this._performRequest()}Wt.prototype=Object.create(Ig.prototype);Wt.prototype.abort=function(){Fg(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Wt.prototype.destroy=function(r){return Fg(this._currentRequest,r),BU.call(this,r),this};Wt.prototype.write=function(r,e,t){if(this._ending)throw new DU;if(!Ti(r)&&!$U(r))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Ci(e)&&(t=e,e=null),r.length===0){t&&t();return}this._requestBodyLength+r.length<=this._options.maxBodyLength?(this._requestBodyLength+=r.length,this._requestBodyBuffers.push({data:r,encoding:e}),this._currentRequest.write(r,e,t)):(this.emit("error",new LU),this.abort())};Wt.prototype.end=function(r,e,t){if(Ci(r)?(t=r,r=e=null):Ci(e)&&(t=e,e=null),!r)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var n=this,i=this._currentRequest;this.write(r,e,function(){n._ended=!0,i.end(null,null,t)}),this._ending=!0}};Wt.prototype.setHeader=function(r,e){this._options.headers[r]=e,this._currentRequest.setHeader(r,e)};Wt.prototype.removeHeader=function(r){delete this._options.headers[r],this._currentRequest.removeHeader(r)};Wt.prototype.setTimeout=function(r,e){var t=this;function n(o){o.setTimeout(r),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function i(o){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),s()},r),n(o)}function s(){t._timeout&&(clearTimeout(t._timeout),t._timeout=null),t.removeListener("abort",s),t.removeListener("error",s),t.removeListener("response",s),t.removeListener("close",s),e&&t.removeListener("timeout",e),t.socket||t._currentRequest.removeListener("socket",i)}return e&&this.on("timeout",e),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",n),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(r){Wt.prototype[r]=function(e,t){return this._currentRequest[r](e,t)}});["aborted","connection","socket"].forEach(function(r){Object.defineProperty(Wt.prototype,r,{get:function(){return this._currentRequest[r]}})});Wt.prototype._sanitizeOptions=function(r){if(r.headers||(r.headers={}),HU(r.sensitiveHeaders)||(r.sensitiveHeaders=[]),r.host&&(r.hostname||(r.hostname=r.host),delete r.host),!r.pathname&&r.path){var e=r.path.indexOf("?");e<0?r.pathname=r.path:(r.pathname=r.path.substring(0,e),r.search=r.path.substring(e))}};Wt.prototype._performRequest=function(){var r=this._options.protocol,e=this._options.nativeProtocols[r];if(!e)throw new TypeError("Unsupported protocol "+r);if(this._options.agents){var t=r.slice(0,-1);this._options.agent=this._options.agents[t]}var n=this._currentRequest=e.request(this._options,this._onNativeResponse);n._redirectable=this;for(var i of Dg)n.on(i,Bg[i]);if(this._currentUrl=/^\//.test(this._options.path)?Ea.format(this._options):this._options.path,this._isRedirect){var s=0,o=this,a=this._requestBodyBuffers;(function c(u){if(n===o._currentRequest)if(u)o.emit("error",u);else if(s<a.length){var p=a[s++];n.finished||n.write(p.data,p.encoding,c)}else o._ended&&n.end()})()}};Wt.prototype._processResponse=function(r){var e=r.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:r.headers,statusCode:e});var t=r.headers.location;if(!t||this._options.followRedirects===!1||e<300||e>=400){r.responseUrl=this._currentUrl,r.redirects=this._redirects,this.emit("response",r),this._requestBodyBuffers=[];return}if(Fg(this._currentRequest),r.destroy(),++this._redirectCount>this._options.maxRedirects)throw new NU;var n,i=this._options.beforeRedirect;i&&(n=Object.assign({Host:r.req.getHeader("host")},this._options.headers));var s=this._options.method;((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],kg(/^content-/i,this._options.headers));var o=kg(/^host$/i,this._options.headers),a=jg(this._currentUrl),c=o||a.host,u=/^\w+:/.test(t)?this._currentUrl:Ea.format(Object.assign(a,{host:c})),p=jU(t,u);if(ck("redirecting to",p.href),this._isRedirect=!0,Mg(p,this._options),(p.protocol!==a.protocol&&p.protocol!=="https:"||p.host!==c&&!FU(p.host,c))&&kg(this._headerFilter,this._options.headers),Ci(i)){var f={headers:r.headers,statusCode:e},m={url:u,method:s,headers:n};i(this._options,f,m),this._sanitizeOptions(this._options)}this._performRequest()};function lk(r){var e={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(r).forEach(function(n){var i=n+":",s=t[i]=r[n],o=e[n]=Object.create(s);function a(u,p,f){return qU(u)?u=Mg(u):Ti(u)?u=Mg(jg(u)):(f=p,p=pk(u),u={protocol:i}),Ci(p)&&(f=p,p=null),p=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},u,p),p.nativeProtocols=t,!Ti(p.host)&&!Ti(p.hostname)&&(p.hostname="::1"),Ng.equal(p.protocol,i,"protocol mismatch"),ck("options",p),new Wt(p,f)}function c(u,p,f){var m=o.request(u,p,f);return m.end(),m}Object.defineProperties(o,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),e}function uk(){}function jg(r){var e;if(Lg)e=new Sa(r);else if(e=pk(Ea.parse(r)),!Ti(e.protocol))throw new Og({input:r});return e}function jU(r,e){return Lg?new Sa(r,e):jg(Ea.resolve(e,r))}function pk(r){if(/^\[/.test(r.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(r.hostname))throw new Og({input:r.href||r});if(/^\[/.test(r.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(r.host))throw new Og({input:r.href||r});return r}function Mg(r,e){var t=e||{};for(var n of IU)t[n]=r[n];return t.hostname.startsWith("[")&&(t.hostname=t.hostname.slice(1,-1)),t.port!==""&&(t.port=Number(t.port)),t.path=t.search?t.pathname+t.search:t.pathname,t}function kg(r,e){var t;for(var n in e)r.test(n)&&(t=e[n],delete e[n]);return t===null||typeof t>"u"?void 0:String(t).trim()}function Ta(r,e,t){function n(i){Ci(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,i||{}),this.code=r,this.message=this.cause?e+": "+this.cause.message:e}return n.prototype=new(t||Error),Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:!1},name:{value:"Error ["+r+"]",enumerable:!1}}),n}function Fg(r,e){for(var t of Dg)r.removeListener(t,Bg[t]);r.on("error",uk),r.destroy(e)}function FU(r,e){Ng(Ti(r)&&Ti(e));var t=r.length-e.length-1;return t>0&&r[t]==="."&&r.endsWith(e)}function HU(r){return r instanceof Array}function Ti(r){return typeof r=="string"||r instanceof String}function Ci(r){return typeof r=="function"}function $U(r){return typeof r=="object"&&"length"in r}function qU(r){return Sa&&r instanceof Sa}function UU(r){return r.replace(/[\]\\/()*+?.$]/g,"\\$&")}Hg.exports=lk({http:OU,https:PU});Hg.exports.wrap=lk});var hk=O((BK,dk)=>{var WU=require("http"),GU=require("https"),Ca=sk(),Wu=Uu(),zU=fk();Ca=Object.keys(Ca).map(function(r){return Ca[r]});var KU={http:WU,https:GU};dk.exports={deleteLength:function(e,t,n){(e.method==="DELETE"||e.method==="OPTIONS")&&!e.headers["content-length"]&&(e.headers["content-length"]="0",delete e.headers["transfer-encoding"])},timeout:function(e,t,n){n.timeout&&e.socket.setTimeout(n.timeout)},XHeaders:function(e,t,n){if(n.xfwd){var i=e.isSpdy||Wu.hasEncryptedConnection(e),s={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Wu.getPort(e),proto:i?"https":"http"};["for","port","proto"].forEach(function(o){e.headers["x-forwarded-"+o]=(e.headers["x-forwarded-"+o]||"")+(e.headers["x-forwarded-"+o]?",":"")+s[o]}),e.headers["x-forwarded-host"]=e.headers["x-forwarded-host"]||e.headers.host||""}},stream:function(e,t,n,i,s,o){s.emit("start",e,t,n.target||n.forward);var a=n.followRedirects?zU:KU,c=a.http,u=a.https;if(n.forward){var p=(n.forward.protocol==="https:"?u:c).request(Wu.setupOutgoing(n.ssl||{},n,e,"forward")),f=_(p,n.forward);if(e.on("error",f),p.on("error",f),(n.buffer||e).pipe(p),!n.target)return t.end()}var m=(n.target.protocol==="https:"?u:c).request(Wu.setupOutgoing(n.ssl||{},n,e));m.on("socket",function(S){s&&!m.getHeader("expect")&&s.emit("proxyReq",m,e,t,n)}),n.proxyTimeout&&m.setTimeout(n.proxyTimeout,function(){m.abort()}),e.on("aborted",function(){m.abort()});var y=_(m,n.target);e.on("error",y),m.on("error",y);function _(S,A){return function(L){if(e.socket.destroyed&&L.code==="ECONNRESET")return s.emit("econnreset",L,e,t,A),S.abort();o?o(L,e,t,A):s.emit("error",L,e,t,A)}}(n.buffer||e).pipe(m),m.on("response",function(S){if(s&&s.emit("proxyRes",S,e,t),!t.headersSent&&!n.selfHandleResponse)for(var A=0;A<Ca.length&&!Ca[A](e,t,S,n);A++);t.finished?s&&s.emit("end",e,t,S):(S.on("end",function(){s&&s.emit("end",e,t,S)}),n.selfHandleResponse||S.pipe(t))})}}});var gk=O((jK,mk)=>{var VU=require("http"),YU=require("https"),Vs=Uu();mk.exports={checkMethodAndHeader:function(e,t){if(e.method!=="GET"||!e.headers.upgrade||e.headers.upgrade.toLowerCase()!=="websocket")return t.destroy(),!0},XHeaders:function(e,t,n){if(n.xfwd){var i={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Vs.getPort(e),proto:Vs.hasEncryptedConnection(e)?"wss":"ws"};["for","port","proto"].forEach(function(s){e.headers["x-forwarded-"+s]=(e.headers["x-forwarded-"+s]||"")+(e.headers["x-forwarded-"+s]?",":"")+i[s]})}},stream:function(e,t,n,i,s,o){var a=function(p,f){return Object.keys(f).reduce(function(m,y){var _=f[y];if(!Array.isArray(_))return m.push(y+": "+_),m;for(var S=0;S<_.length;S++)m.push(y+": "+_[S]);return m},[p]).join(`\r
101
101
  `)+`\r
102
102
  \r
103
- `};Vs.setupSocket(t),i&&i.length&&t.unshift(i);var c=(Vs.isSSL.test(n.target.protocol)?GU:WU).request(Vs.setupOutgoing(n.ssl||{},n,e));return s&&s.emit("proxyReqWs",c,e,t,n,i),c.on("error",u),c.on("response",function(p){p.upgrade||(t.write(a("HTTP/"+p.httpVersion+" "+p.statusCode+" "+p.statusMessage,p.headers)),p.pipe(t))}),c.on("upgrade",function(p,f,m){f.on("error",u),f.on("end",function(){s.emit("close",p,f,m)}),t.on("error",function(){f.end()}),Vs.setupSocket(f),m&&m.length&&f.unshift(m),t.write(a("HTTP/1.1 101 Switching Protocols",p.headers)),f.pipe(t).pipe(f),s.emit("open",f),s.emit("proxySocket",f)}),c.end();function u(p){o?o(p,e,t):s.emit("error",p,e,t),t.end()}}}});var yk=O((LK,xk)=>{var gk=xk.exports,dk=require("util")._extend,zU=require("url").parse,vk=KR(),KU=require("http"),VU=require("https"),hk=uk(),mk=fk();gk.Server=Ti;function Fg(r){return function(e){return function(t,n){var i=r==="ws"?this.wsPasses:this.webPasses,s=[].slice.call(arguments),o=s.length-1,a,c;typeof s[o]=="function"&&(c=s[o],o--);var u=e;if(!(s[o]instanceof Buffer)&&s[o]!==n&&(u=dk({},e),dk(u,s[o]),o--),s[o]instanceof Buffer&&(a=s[o]),["target","forward"].forEach(function(f){typeof u[f]=="string"&&(u[f]=zU(u[f]))}),!u.target&&!u.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var p=0;p<i.length&&!i[p](t,n,u,a,this,c);p++);}}}gk.createRightProxy=Fg;function Ti(r){vk.call(this),r=r||{},r.prependPath=r.prependPath!==!1,this.web=this.proxyRequest=Fg("web")(r),this.ws=this.proxyWebsocketRequest=Fg("ws")(r),this.options=r,this.webPasses=Object.keys(hk).map(function(e){return hk[e]}),this.wsPasses=Object.keys(mk).map(function(e){return mk[e]}),this.on("error",this.onError,this)}require("util").inherits(Ti,vk);Ti.prototype.onError=function(r){if(this.listeners("error").length===1)throw r};Ti.prototype.listen=function(r,e){var t=this,n=function(i,s){t.web(i,s)};return this._server=this.options.ssl?VU.createServer(this.options.ssl,n):KU.createServer(n),this.options.ws&&this._server.on("upgrade",function(i,s,o){t.ws(i,s,o)}),this._server.listen(r,e),this};Ti.prototype.close=function(r){var e=this;this._server&&this._server.close(t);function t(){e._server=null,r&&r.apply(null,arguments)}};Ti.prototype.before=function(r,e,t){if(r!=="ws"&&r!=="web")throw new Error("type must be `web` or `ws`");var n=r==="ws"?this.wsPasses:this.webPasses,i=!1;if(n.forEach(function(s,o){s.name===e&&(i=o)}),i===!1)throw new Error("No such pass");n.splice(i,0,t)};Ti.prototype.after=function(r,e,t){if(r!=="ws"&&r!=="web")throw new Error("type must be `web` or `ws`");var n=r==="ws"?this.wsPasses:this.webPasses,i=!1;if(n.forEach(function(s,o){s.name===e&&(i=o)}),i===!1)throw new Error("No such pass");n.splice(i++,0,t)}});var bk=O((DK,_k)=>{var Ca=yk().Server;function Hg(r){return new Ca(r)}Ca.createProxyServer=Hg;Ca.createServer=Hg;Ca.createProxy=Hg;_k.exports=Ca});var Sk=O((BK,wk)=>{wk.exports=bk()});var zk=O((Aa,Ug)=>{(function(r,e){typeof Aa=="object"&&typeof Ug=="object"?Ug.exports=e(require("child_process"),require("crypto")):typeof define=="function"&&define.amd?define(["child_process","crypto"],e):typeof Aa=="object"?Aa["electron-machine-id"]=e(require("child_process"),require("crypto")):r["electron-machine-id"]=e(r.child_process,r.crypto)})(Aa,function(r,e){return(function(t){function n(s){if(i[s])return i[s].exports;var o=i[s]={exports:{},id:s,loaded:!1};return t[s].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var i={};return n.m=t,n.c=i,n.p="",n(0)})([function(t,n,i){t.exports=i(34)},function(t,n,i){var s=i(29)("wks"),o=i(33),a=i(2).Symbol,c=typeof a=="function",u=t.exports=function(p){return s[p]||(s[p]=c&&a[p]||(c?a:o)("Symbol."+p))};u.store=s},function(t,n){var i=t.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=i)},function(t,n,i){var s=i(9);t.exports=function(o){if(!s(o))throw TypeError(o+" is not an object!");return o}},function(t,n,i){t.exports=!i(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(t,n,i){var s=i(12),o=i(17);t.exports=i(4)?function(a,c,u){return s.f(a,c,o(1,u))}:function(a,c,u){return a[c]=u,a}},function(t,n){var i=t.exports={version:"2.4.0"};typeof __e=="number"&&(__e=i)},function(t,n,i){var s=i(14);t.exports=function(o,a,c){if(s(o),a===void 0)return o;switch(c){case 1:return function(u){return o.call(a,u)};case 2:return function(u,p){return o.call(a,u,p)};case 3:return function(u,p,f){return o.call(a,u,p,f)}}return function(){return o.apply(a,arguments)}}},function(t,n){var i={}.hasOwnProperty;t.exports=function(s,o){return i.call(s,o)}},function(t,n){t.exports=function(i){return typeof i=="object"?i!==null:typeof i=="function"}},function(t,n){t.exports={}},function(t,n){var i={}.toString;t.exports=function(s){return i.call(s).slice(8,-1)}},function(t,n,i){var s=i(3),o=i(26),a=i(32),c=Object.defineProperty;n.f=i(4)?Object.defineProperty:function(u,p,f){if(s(u),p=a(p,!0),s(f),o)try{return c(u,p,f)}catch{}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(u[p]=f.value),u}},function(t,n,i){var s=i(42),o=i(15);t.exports=function(a){return s(o(a))}},function(t,n){t.exports=function(i){if(typeof i!="function")throw TypeError(i+" is not a function!");return i}},function(t,n){t.exports=function(i){if(i==null)throw TypeError("Can't call method on "+i);return i}},function(t,n,i){var s=i(9),o=i(2).document,a=s(o)&&s(o.createElement);t.exports=function(c){return a?o.createElement(c):{}}},function(t,n){t.exports=function(i,s){return{enumerable:!(1&i),configurable:!(2&i),writable:!(4&i),value:s}}},function(t,n,i){var s=i(12).f,o=i(8),a=i(1)("toStringTag");t.exports=function(c,u,p){c&&!o(c=p?c:c.prototype,a)&&s(c,a,{configurable:!0,value:u})}},function(t,n,i){var s=i(29)("keys"),o=i(33);t.exports=function(a){return s[a]||(s[a]=o(a))}},function(t,n){var i=Math.ceil,s=Math.floor;t.exports=function(o){return isNaN(o=+o)?0:(o>0?s:i)(o)}},function(t,n,i){var s=i(11),o=i(1)("toStringTag"),a=s((function(){return arguments})())=="Arguments",c=function(u,p){try{return u[p]}catch{}};t.exports=function(u){var p,f,m;return u===void 0?"Undefined":u===null?"Null":typeof(f=c(p=Object(u),o))=="string"?f:a?s(p):(m=s(p))=="Object"&&typeof p.callee=="function"?"Arguments":m}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,i){var s=i(2),o=i(6),a=i(7),c=i(5),u="prototype",p=function(f,m,y){var _,S,A,P=f&p.F,L=f&p.G,N=f&p.S,H=f&p.P,W=f&p.B,U=f&p.W,G=L?o:o[m]||(o[m]={}),M=G[u],F=L?s:N?s[m]:(s[m]||{})[u];L&&(y=m);for(_ in y)S=!P&&F&&F[_]!==void 0,S&&_ in G||(A=S?F[_]:y[_],G[_]=L&&typeof F[_]!="function"?y[_]:W&&S?a(A,s):U&&F[_]==A?(function(T){var l=function(h,x,w){if(this instanceof T){switch(arguments.length){case 0:return new T;case 1:return new T(h);case 2:return new T(h,x)}return new T(h,x,w)}return T.apply(this,arguments)};return l[u]=T[u],l})(A):H&&typeof A=="function"?a(Function.call,A):A,H&&((G.virtual||(G.virtual={}))[_]=A,f&p.R&&M&&!M[_]&&c(M,_,A)))};p.F=1,p.G=2,p.S=4,p.P=8,p.B=16,p.W=32,p.U=64,p.R=128,t.exports=p},function(t,n){t.exports=function(i){try{return!!i()}catch{return!0}}},function(t,n,i){t.exports=i(2).document&&document.documentElement},function(t,n,i){t.exports=!i(4)&&!i(24)(function(){return Object.defineProperty(i(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(t,n,i){"use strict";var s=i(28),o=i(23),a=i(57),c=i(5),u=i(8),p=i(10),f=i(45),m=i(18),y=i(52),_=i(1)("iterator"),S=!([].keys&&"next"in[].keys()),A="@@iterator",P="keys",L="values",N=function(){return this};t.exports=function(H,W,U,G,M,F,T){f(U,W,G);var l,h,x,w=function(D){if(!S&&D in b)return b[D];switch(D){case P:return function(){return new U(this,D)};case L:return function(){return new U(this,D)}}return function(){return new U(this,D)}},g=W+" Iterator",v=M==L,C=!1,b=H.prototype,d=b[_]||b[A]||M&&b[M],E=d||w(M),q=M?v?w("entries"):E:void 0,I=W=="Array"&&b.entries||d;if(I&&(x=y(I.call(new H)),x!==Object.prototype&&(m(x,g,!0),s||u(x,_)||c(x,_,N))),v&&d&&d.name!==L&&(C=!0,E=function(){return d.call(this)}),s&&!T||!S&&!C&&b[_]||c(b,_,E),p[W]=E,p[g]=N,M)if(l={values:v?E:w(L),keys:F?E:w(P),entries:q},T)for(h in l)h in b||a(b,h,l[h]);else o(o.P+o.F*(S||C),W,l);return l}},function(t,n){t.exports=!0},function(t,n,i){var s=i(2),o="__core-js_shared__",a=s[o]||(s[o]={});t.exports=function(c){return a[c]||(a[c]={})}},function(t,n,i){var s,o,a,c=i(7),u=i(41),p=i(25),f=i(16),m=i(2),y=m.process,_=m.setImmediate,S=m.clearImmediate,A=m.MessageChannel,P=0,L={},N="onreadystatechange",H=function(){var U=+this;if(L.hasOwnProperty(U)){var G=L[U];delete L[U],G()}},W=function(U){H.call(U.data)};_&&S||(_=function(U){for(var G=[],M=1;arguments.length>M;)G.push(arguments[M++]);return L[++P]=function(){u(typeof U=="function"?U:Function(U),G)},s(P),P},S=function(U){delete L[U]},i(11)(y)=="process"?s=function(U){y.nextTick(c(H,U,1))}:A?(o=new A,a=o.port2,o.port1.onmessage=W,s=c(a.postMessage,a,1)):m.addEventListener&&typeof postMessage=="function"&&!m.importScripts?(s=function(U){m.postMessage(U+"","*")},m.addEventListener("message",W,!1)):s=N in f("script")?function(U){p.appendChild(f("script"))[N]=function(){p.removeChild(this),H.call(U)}}:function(U){setTimeout(c(H,U,1),0)}),t.exports={set:_,clear:S}},function(t,n,i){var s=i(20),o=Math.min;t.exports=function(a){return a>0?o(s(a),9007199254740991):0}},function(t,n,i){var s=i(9);t.exports=function(o,a){if(!s(o))return o;var c,u;if(a&&typeof(c=o.toString)=="function"&&!s(u=c.call(o))||typeof(c=o.valueOf)=="function"&&!s(u=c.call(o))||!a&&typeof(c=o.toString)=="function"&&!s(u=c.call(o)))return u;throw TypeError("Can't convert object to primitive value")}},function(t,n){var i=0,s=Math.random();t.exports=function(o){return"Symbol(".concat(o===void 0?"":o,")_",(++i+s).toString(36))}},function(t,n,i){"use strict";function s(N){return N&&N.__esModule?N:{default:N}}function o(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function a(N){return(0,_.createHash)("sha256").update(N).digest("hex")}function c(N){switch(A){case"darwin":return N.split("IOPlatformUUID")[1].split(`
104
- `)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return N.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return N.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return N.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function u(N){var H=c((0,y.execSync)(L[A]).toString());return N?H:a(H)}function p(N){return new m.default(function(H,W){return(0,y.exec)(L[A],{},function(U,G,M){if(U)return W(new Error("Error while obtaining machine id: "+U.stack));var F=c(G.toString());return H(N?F:a(F))})})}Object.defineProperty(n,"__esModule",{value:!0});var f=i(35),m=s(f);n.machineIdSync=u,n.machineId=p;var y=i(70),_=i(71),S=process,A=S.platform,P={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},L={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:P[o()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(t,n,i){t.exports={default:i(36),__esModule:!0}},function(t,n,i){i(66),i(68),i(69),i(67),t.exports=i(6).Promise},function(t,n){t.exports=function(){}},function(t,n){t.exports=function(i,s,o,a){if(!(i instanceof s)||a!==void 0&&a in i)throw TypeError(o+": incorrect invocation!");return i}},function(t,n,i){var s=i(13),o=i(31),a=i(62);t.exports=function(c){return function(u,p,f){var m,y=s(u),_=o(y.length),S=a(f,_);if(c&&p!=p){for(;_>S;)if(m=y[S++],m!=m)return!0}else for(;_>S;S++)if((c||S in y)&&y[S]===p)return c||S||0;return!c&&-1}}},function(t,y,i){var s=i(7),o=i(44),a=i(43),c=i(3),u=i(31),p=i(64),f={},m={},y=t.exports=function(_,S,A,P,L){var N,H,W,U,G=L?function(){return _}:p(_),M=s(A,P,S?2:1),F=0;if(typeof G!="function")throw TypeError(_+" is not iterable!");if(a(G)){for(N=u(_.length);N>F;F++)if(U=S?M(c(H=_[F])[0],H[1]):M(_[F]),U===f||U===m)return U}else for(W=G.call(_);!(H=W.next()).done;)if(U=o(W,M,H.value,S),U===f||U===m)return U};y.BREAK=f,y.RETURN=m},function(t,n){t.exports=function(i,s,o){var a=o===void 0;switch(s.length){case 0:return a?i():i.call(o);case 1:return a?i(s[0]):i.call(o,s[0]);case 2:return a?i(s[0],s[1]):i.call(o,s[0],s[1]);case 3:return a?i(s[0],s[1],s[2]):i.call(o,s[0],s[1],s[2]);case 4:return a?i(s[0],s[1],s[2],s[3]):i.call(o,s[0],s[1],s[2],s[3])}return i.apply(o,s)}},function(t,n,i){var s=i(11);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(o){return s(o)=="String"?o.split(""):Object(o)}},function(t,n,i){var s=i(10),o=i(1)("iterator"),a=Array.prototype;t.exports=function(c){return c!==void 0&&(s.Array===c||a[o]===c)}},function(t,n,i){var s=i(3);t.exports=function(o,a,c,u){try{return u?a(s(c)[0],c[1]):a(c)}catch(f){var p=o.return;throw p!==void 0&&s(p.call(o)),f}}},function(t,n,i){"use strict";var s=i(49),o=i(17),a=i(18),c={};i(5)(c,i(1)("iterator"),function(){return this}),t.exports=function(u,p,f){u.prototype=s(c,{next:o(1,f)}),a(u,p+" Iterator")}},function(t,n,i){var s=i(1)("iterator"),o=!1;try{var a=[7][s]();a.return=function(){o=!0},Array.from(a,function(){throw 2})}catch{}t.exports=function(c,u){if(!u&&!o)return!1;var p=!1;try{var f=[7],m=f[s]();m.next=function(){return{done:p=!0}},f[s]=function(){return m},c(f)}catch{}return p}},function(t,n){t.exports=function(i,s){return{value:s,done:!!i}}},function(t,n,i){var s=i(2),o=i(30).set,a=s.MutationObserver||s.WebKitMutationObserver,c=s.process,u=s.Promise,p=i(11)(c)=="process";t.exports=function(){var f,m,y,_=function(){var L,N;for(p&&(L=c.domain)&&L.exit();f;){N=f.fn,f=f.next;try{N()}catch(H){throw f?y():m=void 0,H}}m=void 0,L&&L.enter()};if(p)y=function(){c.nextTick(_)};else if(a){var S=!0,A=document.createTextNode("");new a(_).observe(A,{characterData:!0}),y=function(){A.data=S=!S}}else if(u&&u.resolve){var P=u.resolve();y=function(){P.then(_)}}else y=function(){o.call(s,_)};return function(L){var N={fn:L,next:void 0};m&&(m.next=N),f||(f=N,y()),m=N}}},function(t,n,i){var s=i(3),o=i(50),a=i(22),c=i(19)("IE_PROTO"),u=function(){},p="prototype",f=function(){var m,y=i(16)("iframe"),_=a.length,S=">";for(y.style.display="none",i(25).appendChild(y),y.src="javascript:",m=y.contentWindow.document,m.open(),m.write("<script>document.F=Object</script"+S),m.close(),f=m.F;_--;)delete f[p][a[_]];return f()};t.exports=Object.create||function(m,y){var _;return m!==null?(u[p]=s(m),_=new u,u[p]=null,_[c]=m):_=f(),y===void 0?_:o(_,y)}},function(t,n,i){var s=i(12),o=i(3),a=i(54);t.exports=i(4)?Object.defineProperties:function(c,u){o(c);for(var p,f=a(u),m=f.length,y=0;m>y;)s.f(c,p=f[y++],u[p]);return c}},function(t,n,i){var s=i(55),o=i(17),a=i(13),c=i(32),u=i(8),p=i(26),f=Object.getOwnPropertyDescriptor;n.f=i(4)?f:function(m,y){if(m=a(m),y=c(y,!0),p)try{return f(m,y)}catch{}if(u(m,y))return o(!s.f.call(m,y),m[y])}},function(t,n,i){var s=i(8),o=i(63),a=i(19)("IE_PROTO"),c=Object.prototype;t.exports=Object.getPrototypeOf||function(u){return u=o(u),s(u,a)?u[a]:typeof u.constructor=="function"&&u instanceof u.constructor?u.constructor.prototype:u instanceof Object?c:null}},function(t,n,i){var s=i(8),o=i(13),a=i(39)(!1),c=i(19)("IE_PROTO");t.exports=function(u,p){var f,m=o(u),y=0,_=[];for(f in m)f!=c&&s(m,f)&&_.push(f);for(;p.length>y;)s(m,f=p[y++])&&(~a(_,f)||_.push(f));return _}},function(t,n,i){var s=i(53),o=i(22);t.exports=Object.keys||function(a){return s(a,o)}},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,i){var s=i(5);t.exports=function(o,a,c){for(var u in a)c&&o[u]?o[u]=a[u]:s(o,u,a[u]);return o}},function(t,n,i){t.exports=i(5)},function(t,n,i){var s=i(9),o=i(3),a=function(c,u){if(o(c),!s(u)&&u!==null)throw TypeError(u+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?(function(c,u,p){try{p=i(7)(Function.call,i(51).f(Object.prototype,"__proto__").set,2),p(c,[]),u=!(c instanceof Array)}catch{u=!0}return function(f,m){return a(f,m),u?f.__proto__=m:p(f,m),f}})({},!1):void 0),check:a}},function(t,n,i){"use strict";var s=i(2),o=i(6),a=i(12),c=i(4),u=i(1)("species");t.exports=function(p){var f=typeof o[p]=="function"?o[p]:s[p];c&&f&&!f[u]&&a.f(f,u,{configurable:!0,get:function(){return this}})}},function(t,n,i){var s=i(3),o=i(14),a=i(1)("species");t.exports=function(c,u){var p,f=s(c).constructor;return f===void 0||(p=s(f)[a])==null?u:o(p)}},function(t,n,i){var s=i(20),o=i(15);t.exports=function(a){return function(c,u){var p,f,m=String(o(c)),y=s(u),_=m.length;return y<0||y>=_?a?"":void 0:(p=m.charCodeAt(y),p<55296||p>56319||y+1===_||(f=m.charCodeAt(y+1))<56320||f>57343?a?m.charAt(y):p:a?m.slice(y,y+2):(p-55296<<10)+(f-56320)+65536)}}},function(t,n,i){var s=i(20),o=Math.max,a=Math.min;t.exports=function(c,u){return c=s(c),c<0?o(c+u,0):a(c,u)}},function(t,n,i){var s=i(15);t.exports=function(o){return Object(s(o))}},function(t,n,i){var s=i(21),o=i(1)("iterator"),a=i(10);t.exports=i(6).getIteratorMethod=function(c){if(c!=null)return c[o]||c["@@iterator"]||a[s(c)]}},function(t,n,i){"use strict";var s=i(37),o=i(47),a=i(10),c=i(13);t.exports=i(27)(Array,"Array",function(u,p){this._t=c(u),this._i=0,this._k=p},function(){var u=this._t,p=this._k,f=this._i++;return!u||f>=u.length?(this._t=void 0,o(1)):p=="keys"?o(0,f):p=="values"?o(0,u[f]):o(0,[f,u[f]])},"values"),a.Arguments=a.Array,s("keys"),s("values"),s("entries")},function(t,n){},function(t,n,i){"use strict";var s,o,a,c=i(28),u=i(2),p=i(7),f=i(21),m=i(23),y=i(9),_=(i(3),i(14)),S=i(38),A=i(40),P=(i(58).set,i(60)),L=i(30).set,N=i(48)(),H="Promise",W=u.TypeError,G=u.process,U=u[H],G=u.process,M=f(G)=="process",F=function(){},T=!!(function(){try{var I=U.resolve(1),D=(I.constructor={})[i(1)("species")]=function($){$(F,F)};return(M||typeof PromiseRejectionEvent=="function")&&I.then(F)instanceof D}catch{}})(),l=function(I,D){return I===D||I===U&&D===a},h=function(I){var D;return!(!y(I)||typeof(D=I.then)!="function")&&D},x=function(I){return l(U,I)?new w(I):new o(I)},w=o=function(I){var D,$;this.promise=new I(function(K,B){if(D!==void 0||$!==void 0)throw W("Bad Promise constructor");D=K,$=B}),this.resolve=_(D),this.reject=_($)},g=function(I){try{I()}catch(D){return{error:D}}},v=function(I,D){if(!I._n){I._n=!0;var $=I._c;N(function(){for(var K=I._v,B=I._s==1,me=0,ie=function(R){var Y,k,j=B?R.ok:R.fail,J=R.resolve,V=R.reject,z=R.domain;try{j?(B||(I._h==2&&d(I),I._h=1),j===!0?Y=K:(z&&z.enter(),Y=j(K),z&&z.exit()),Y===R.promise?V(W("Promise-chain cycle")):(k=h(Y))?k.call(Y,J,V):J(Y)):V(K)}catch(ge){V(ge)}};$.length>me;)ie($[me++]);I._c=[],I._n=!1,D&&!I._h&&C(I)})}},C=function(I){L.call(u,function(){var D,$,K,B=I._v;if(b(I)&&(D=g(function(){M?G.emit("unhandledRejection",B,I):($=u.onunhandledrejection)?$({promise:I,reason:B}):(K=u.console)&&K.error&&K.error("Unhandled promise rejection",B)}),I._h=M||b(I)?2:1),I._a=void 0,D)throw D.error})},b=function(I){if(I._h==1)return!1;for(var D,$=I._a||I._c,K=0;$.length>K;)if(D=$[K++],D.fail||!b(D.promise))return!1;return!0},d=function(I){L.call(u,function(){var D;M?G.emit("rejectionHandled",I):(D=u.onrejectionhandled)&&D({promise:I,reason:I._v})})},E=function(I){var D=this;D._d||(D._d=!0,D=D._w||D,D._v=I,D._s=2,D._a||(D._a=D._c.slice()),v(D,!0))},q=function(I){var D,$=this;if(!$._d){$._d=!0,$=$._w||$;try{if($===I)throw W("Promise can't be resolved itself");(D=h(I))?N(function(){var K={_w:$,_d:!1};try{D.call(I,p(q,K,1),p(E,K,1))}catch(B){E.call(K,B)}}):($._v=I,$._s=1,v($,!1))}catch(K){E.call({_w:$,_d:!1},K)}}};T||(U=function(I){S(this,U,H,"_h"),_(I),s.call(this);try{I(p(q,this,1),p(E,this,1))}catch(D){E.call(this,D)}},s=function(I){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},s.prototype=i(56)(U.prototype,{then:function(I,D){var $=x(P(this,U));return $.ok=typeof I!="function"||I,$.fail=typeof D=="function"&&D,$.domain=M?G.domain:void 0,this._c.push($),this._a&&this._a.push($),this._s&&v(this,!1),$.promise},catch:function(I){return this.then(void 0,I)}}),w=function(){var I=new s;this.promise=I,this.resolve=p(q,I,1),this.reject=p(E,I,1)}),m(m.G+m.W+m.F*!T,{Promise:U}),i(18)(U,H),i(59)(H),a=i(6)[H],m(m.S+m.F*!T,H,{reject:function(I){var D=x(this),$=D.reject;return $(I),D.promise}}),m(m.S+m.F*(c||!T),H,{resolve:function(I){if(I instanceof U&&l(I.constructor,this))return I;var D=x(this),$=D.resolve;return $(I),D.promise}}),m(m.S+m.F*!(T&&i(46)(function(I){U.all(I).catch(F)})),H,{all:function(I){var D=this,$=x(D),K=$.resolve,B=$.reject,me=g(function(){var ie=[],R=0,Y=1;A(I,!1,function(k){var j=R++,J=!1;ie.push(void 0),Y++,D.resolve(k).then(function(V){J||(J=!0,ie[j]=V,--Y||K(ie))},B)}),--Y||K(ie)});return me&&B(me.error),$.promise},race:function(I){var D=this,$=x(D),K=$.reject,B=g(function(){A(I,!1,function(me){D.resolve(me).then($.resolve,K)})});return B&&K(B.error),$.promise}})},function(t,n,i){"use strict";var s=i(61)(!0);i(27)(String,"String",function(o){this._t=String(o),this._i=0},function(){var o,a=this._t,c=this._i;return c>=a.length?{value:void 0,done:!0}:(o=s(a,c),this._i+=o.length,{value:o,done:!1})})},function(t,n,i){i(65);for(var s=i(2),o=i(5),a=i(10),c=i(1)("toStringTag"),u=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],p=0;p<5;p++){var f=u[p],m=s[f],y=m&&m.prototype;y&&!y[c]&&o(y,c,f),a[f]=a.Array}},function(t,n){t.exports=require("child_process")},function(t,n){t.exports=require("crypto")}])})});var b4={};Xr(b4,{startServer:()=>EO});module.exports=OO(b4);var zu=require("http"),Ku=require("child_process"),Ci=require("fs"),tr=require("path"),bO=require("url");var av=(r=0)=>e=>`\x1B[${e+r}m`,cv=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,lv=(r=0)=>(e,t,n)=>`\x1B[${38+r};2;${e};${t};${n}m`,ye={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},S4=Object.keys(ye.modifier),PO=Object.keys(ye.color),MO=Object.keys(ye.bgColor),E4=[...PO,...MO];function IO(){let r=new Map;for(let[e,t]of Object.entries(ye)){for(let[n,i]of Object.entries(t))ye[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[n]=ye[n],r.set(i[0],i[1]);Object.defineProperty(ye,e,{value:t,enumerable:!1})}return Object.defineProperty(ye,"codes",{value:r,enumerable:!1}),ye.color.close="\x1B[39m",ye.bgColor.close="\x1B[49m",ye.color.ansi=av(),ye.color.ansi256=cv(),ye.color.ansi16m=lv(),ye.bgColor.ansi=av(10),ye.bgColor.ansi256=cv(10),ye.bgColor.ansi16m=lv(10),Object.defineProperties(ye,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>ye.rgbToAnsi256(...ye.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,i;if(e>=232)t=((e-232)*10+8)/255,n=t,i=t;else{e-=16;let a=e%36;t=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(t,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(t));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>ye.ansi256ToAnsi(ye.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>ye.ansi256ToAnsi(ye.hexToAnsi256(e)),enumerable:!1}}),ye}var NO=IO(),_r=NO;var Pa=X(require("node:process"),1),pv=X(require("node:os"),1),dp=X(require("node:tty"),1);function rr(r,e=globalThis.Deno?globalThis.Deno.args:Pa.default.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:_e}=Pa.default,Oa;rr("no-color")||rr("no-colors")||rr("color=false")||rr("color=never")?Oa=0:(rr("color")||rr("colors")||rr("color=true")||rr("color=always"))&&(Oa=1);function LO(){if("FORCE_COLOR"in _e)return _e.FORCE_COLOR==="true"?1:_e.FORCE_COLOR==="false"?0:_e.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(_e.FORCE_COLOR,10),3)}function DO(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function BO(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let n=LO();n!==void 0&&(Oa=n);let i=t?Oa:n;if(i===0)return 0;if(t){if(rr("color=16m")||rr("color=full")||rr("color=truecolor"))return 3;if(rr("color=256"))return 2}if("TF_BUILD"in _e&&"AGENT_NAME"in _e)return 1;if(r&&!e&&i===void 0)return 0;let s=i||0;if(_e.TERM==="dumb")return s;if(Pa.default.platform==="win32"){let o=pv.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in _e)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in _e)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in _e)||_e.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in _e)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(_e.TEAMCITY_VERSION)?1:0;if(_e.COLORTERM==="truecolor"||_e.TERM==="xterm-kitty"||_e.TERM==="xterm-ghostty"||_e.TERM==="wezterm")return 3;if("TERM_PROGRAM"in _e){let o=Number.parseInt((_e.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(_e.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(_e.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(_e.TERM)||"COLORTERM"in _e?1:s}function uv(r,e={}){let t=BO(r,{streamIsTTY:r&&r.isTTY,...e});return DO(t)}var jO={stdout:uv({isTTY:dp.default.isatty(1)}),stderr:uv({isTTY:dp.default.isatty(2)})},fv=jO;function dv(r,e,t){let n=r.indexOf(e);if(n===-1)return r;let i=e.length,s=0,o="";do o+=r.slice(s,n)+e+t,s=n+i,n=r.indexOf(e,s);while(n!==-1);return o+=r.slice(s),o}function hv(r,e,t,n){let i=0,s="";do{let o=r[n-1]==="\r";s+=r.slice(i,o?n-1:n)+e+(o?`\r
103
+ `};Vs.setupSocket(t),i&&i.length&&t.unshift(i);var c=(Vs.isSSL.test(n.target.protocol)?YU:VU).request(Vs.setupOutgoing(n.ssl||{},n,e));return s&&s.emit("proxyReqWs",c,e,t,n,i),c.on("error",u),c.on("response",function(p){p.upgrade||(t.write(a("HTTP/"+p.httpVersion+" "+p.statusCode+" "+p.statusMessage,p.headers)),p.pipe(t))}),c.on("upgrade",function(p,f,m){f.on("error",u),f.on("end",function(){s.emit("close",p,f,m)}),t.on("error",function(){f.end()}),Vs.setupSocket(f),m&&m.length&&f.unshift(m),t.write(a("HTTP/1.1 101 Switching Protocols",p.headers)),f.pipe(t).pipe(f),s.emit("open",f),s.emit("proxySocket",f)}),c.end();function u(p){o?o(p,e,t):s.emit("error",p,e,t),t.end()}}}});var Sk=O((FK,wk)=>{var _k=wk.exports,vk=require("util")._extend,XU=require("url").parse,bk=JR(),JU=require("http"),QU=require("https"),xk=hk(),yk=gk();_k.Server=Ai;function $g(r){return function(e){return function(t,n){var i=r==="ws"?this.wsPasses:this.webPasses,s=[].slice.call(arguments),o=s.length-1,a,c;typeof s[o]=="function"&&(c=s[o],o--);var u=e;if(!(s[o]instanceof Buffer)&&s[o]!==n&&(u=vk({},e),vk(u,s[o]),o--),s[o]instanceof Buffer&&(a=s[o]),["target","forward"].forEach(function(f){typeof u[f]=="string"&&(u[f]=XU(u[f]))}),!u.target&&!u.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var p=0;p<i.length&&!i[p](t,n,u,a,this,c);p++);}}}_k.createRightProxy=$g;function Ai(r){bk.call(this),r=r||{},r.prependPath=r.prependPath!==!1,this.web=this.proxyRequest=$g("web")(r),this.ws=this.proxyWebsocketRequest=$g("ws")(r),this.options=r,this.webPasses=Object.keys(xk).map(function(e){return xk[e]}),this.wsPasses=Object.keys(yk).map(function(e){return yk[e]}),this.on("error",this.onError,this)}require("util").inherits(Ai,bk);Ai.prototype.onError=function(r){if(this.listeners("error").length===1)throw r};Ai.prototype.listen=function(r,e){var t=this,n=function(i,s){t.web(i,s)};return this._server=this.options.ssl?QU.createServer(this.options.ssl,n):JU.createServer(n),this.options.ws&&this._server.on("upgrade",function(i,s,o){t.ws(i,s,o)}),this._server.listen(r,e),this};Ai.prototype.close=function(r){var e=this;this._server&&this._server.close(t);function t(){e._server=null,r&&r.apply(null,arguments)}};Ai.prototype.before=function(r,e,t){if(r!=="ws"&&r!=="web")throw new Error("type must be `web` or `ws`");var n=r==="ws"?this.wsPasses:this.webPasses,i=!1;if(n.forEach(function(s,o){s.name===e&&(i=o)}),i===!1)throw new Error("No such pass");n.splice(i,0,t)};Ai.prototype.after=function(r,e,t){if(r!=="ws"&&r!=="web")throw new Error("type must be `web` or `ws`");var n=r==="ws"?this.wsPasses:this.webPasses,i=!1;if(n.forEach(function(s,o){s.name===e&&(i=o)}),i===!1)throw new Error("No such pass");n.splice(i++,0,t)}});var Tk=O((HK,Ek)=>{var Aa=Sk().Server;function qg(r){return new Aa(r)}Aa.createProxyServer=qg;Aa.createServer=qg;Aa.createProxy=qg;Ek.exports=Aa});var Ak=O(($K,Ck)=>{Ck.exports=Tk()});var Xk=O((Ra,Gg)=>{(function(r,e){typeof Ra=="object"&&typeof Gg=="object"?Gg.exports=e(require("child_process"),require("crypto")):typeof define=="function"&&define.amd?define(["child_process","crypto"],e):typeof Ra=="object"?Ra["electron-machine-id"]=e(require("child_process"),require("crypto")):r["electron-machine-id"]=e(r.child_process,r.crypto)})(Ra,function(r,e){return(function(t){function n(s){if(i[s])return i[s].exports;var o=i[s]={exports:{},id:s,loaded:!1};return t[s].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var i={};return n.m=t,n.c=i,n.p="",n(0)})([function(t,n,i){t.exports=i(34)},function(t,n,i){var s=i(29)("wks"),o=i(33),a=i(2).Symbol,c=typeof a=="function",u=t.exports=function(p){return s[p]||(s[p]=c&&a[p]||(c?a:o)("Symbol."+p))};u.store=s},function(t,n){var i=t.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=i)},function(t,n,i){var s=i(9);t.exports=function(o){if(!s(o))throw TypeError(o+" is not an object!");return o}},function(t,n,i){t.exports=!i(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(t,n,i){var s=i(12),o=i(17);t.exports=i(4)?function(a,c,u){return s.f(a,c,o(1,u))}:function(a,c,u){return a[c]=u,a}},function(t,n){var i=t.exports={version:"2.4.0"};typeof __e=="number"&&(__e=i)},function(t,n,i){var s=i(14);t.exports=function(o,a,c){if(s(o),a===void 0)return o;switch(c){case 1:return function(u){return o.call(a,u)};case 2:return function(u,p){return o.call(a,u,p)};case 3:return function(u,p,f){return o.call(a,u,p,f)}}return function(){return o.apply(a,arguments)}}},function(t,n){var i={}.hasOwnProperty;t.exports=function(s,o){return i.call(s,o)}},function(t,n){t.exports=function(i){return typeof i=="object"?i!==null:typeof i=="function"}},function(t,n){t.exports={}},function(t,n){var i={}.toString;t.exports=function(s){return i.call(s).slice(8,-1)}},function(t,n,i){var s=i(3),o=i(26),a=i(32),c=Object.defineProperty;n.f=i(4)?Object.defineProperty:function(u,p,f){if(s(u),p=a(p,!0),s(f),o)try{return c(u,p,f)}catch{}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(u[p]=f.value),u}},function(t,n,i){var s=i(42),o=i(15);t.exports=function(a){return s(o(a))}},function(t,n){t.exports=function(i){if(typeof i!="function")throw TypeError(i+" is not a function!");return i}},function(t,n){t.exports=function(i){if(i==null)throw TypeError("Can't call method on "+i);return i}},function(t,n,i){var s=i(9),o=i(2).document,a=s(o)&&s(o.createElement);t.exports=function(c){return a?o.createElement(c):{}}},function(t,n){t.exports=function(i,s){return{enumerable:!(1&i),configurable:!(2&i),writable:!(4&i),value:s}}},function(t,n,i){var s=i(12).f,o=i(8),a=i(1)("toStringTag");t.exports=function(c,u,p){c&&!o(c=p?c:c.prototype,a)&&s(c,a,{configurable:!0,value:u})}},function(t,n,i){var s=i(29)("keys"),o=i(33);t.exports=function(a){return s[a]||(s[a]=o(a))}},function(t,n){var i=Math.ceil,s=Math.floor;t.exports=function(o){return isNaN(o=+o)?0:(o>0?s:i)(o)}},function(t,n,i){var s=i(11),o=i(1)("toStringTag"),a=s((function(){return arguments})())=="Arguments",c=function(u,p){try{return u[p]}catch{}};t.exports=function(u){var p,f,m;return u===void 0?"Undefined":u===null?"Null":typeof(f=c(p=Object(u),o))=="string"?f:a?s(p):(m=s(p))=="Object"&&typeof p.callee=="function"?"Arguments":m}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,i){var s=i(2),o=i(6),a=i(7),c=i(5),u="prototype",p=function(f,m,y){var _,S,A,P=f&p.F,L=f&p.G,N=f&p.S,H=f&p.P,W=f&p.B,U=f&p.W,G=L?o:o[m]||(o[m]={}),M=G[u],F=L?s:N?s[m]:(s[m]||{})[u];L&&(y=m);for(_ in y)S=!P&&F&&F[_]!==void 0,S&&_ in G||(A=S?F[_]:y[_],G[_]=L&&typeof F[_]!="function"?y[_]:W&&S?a(A,s):U&&F[_]==A?(function(T){var l=function(h,x,w){if(this instanceof T){switch(arguments.length){case 0:return new T;case 1:return new T(h);case 2:return new T(h,x)}return new T(h,x,w)}return T.apply(this,arguments)};return l[u]=T[u],l})(A):H&&typeof A=="function"?a(Function.call,A):A,H&&((G.virtual||(G.virtual={}))[_]=A,f&p.R&&M&&!M[_]&&c(M,_,A)))};p.F=1,p.G=2,p.S=4,p.P=8,p.B=16,p.W=32,p.U=64,p.R=128,t.exports=p},function(t,n){t.exports=function(i){try{return!!i()}catch{return!0}}},function(t,n,i){t.exports=i(2).document&&document.documentElement},function(t,n,i){t.exports=!i(4)&&!i(24)(function(){return Object.defineProperty(i(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(t,n,i){"use strict";var s=i(28),o=i(23),a=i(57),c=i(5),u=i(8),p=i(10),f=i(45),m=i(18),y=i(52),_=i(1)("iterator"),S=!([].keys&&"next"in[].keys()),A="@@iterator",P="keys",L="values",N=function(){return this};t.exports=function(H,W,U,G,M,F,T){f(U,W,G);var l,h,x,w=function(D){if(!S&&D in b)return b[D];switch(D){case P:return function(){return new U(this,D)};case L:return function(){return new U(this,D)}}return function(){return new U(this,D)}},g=W+" Iterator",v=M==L,C=!1,b=H.prototype,d=b[_]||b[A]||M&&b[M],E=d||w(M),q=M?v?w("entries"):E:void 0,I=W=="Array"&&b.entries||d;if(I&&(x=y(I.call(new H)),x!==Object.prototype&&(m(x,g,!0),s||u(x,_)||c(x,_,N))),v&&d&&d.name!==L&&(C=!0,E=function(){return d.call(this)}),s&&!T||!S&&!C&&b[_]||c(b,_,E),p[W]=E,p[g]=N,M)if(l={values:v?E:w(L),keys:F?E:w(P),entries:q},T)for(h in l)h in b||a(b,h,l[h]);else o(o.P+o.F*(S||C),W,l);return l}},function(t,n){t.exports=!0},function(t,n,i){var s=i(2),o="__core-js_shared__",a=s[o]||(s[o]={});t.exports=function(c){return a[c]||(a[c]={})}},function(t,n,i){var s,o,a,c=i(7),u=i(41),p=i(25),f=i(16),m=i(2),y=m.process,_=m.setImmediate,S=m.clearImmediate,A=m.MessageChannel,P=0,L={},N="onreadystatechange",H=function(){var U=+this;if(L.hasOwnProperty(U)){var G=L[U];delete L[U],G()}},W=function(U){H.call(U.data)};_&&S||(_=function(U){for(var G=[],M=1;arguments.length>M;)G.push(arguments[M++]);return L[++P]=function(){u(typeof U=="function"?U:Function(U),G)},s(P),P},S=function(U){delete L[U]},i(11)(y)=="process"?s=function(U){y.nextTick(c(H,U,1))}:A?(o=new A,a=o.port2,o.port1.onmessage=W,s=c(a.postMessage,a,1)):m.addEventListener&&typeof postMessage=="function"&&!m.importScripts?(s=function(U){m.postMessage(U+"","*")},m.addEventListener("message",W,!1)):s=N in f("script")?function(U){p.appendChild(f("script"))[N]=function(){p.removeChild(this),H.call(U)}}:function(U){setTimeout(c(H,U,1),0)}),t.exports={set:_,clear:S}},function(t,n,i){var s=i(20),o=Math.min;t.exports=function(a){return a>0?o(s(a),9007199254740991):0}},function(t,n,i){var s=i(9);t.exports=function(o,a){if(!s(o))return o;var c,u;if(a&&typeof(c=o.toString)=="function"&&!s(u=c.call(o))||typeof(c=o.valueOf)=="function"&&!s(u=c.call(o))||!a&&typeof(c=o.toString)=="function"&&!s(u=c.call(o)))return u;throw TypeError("Can't convert object to primitive value")}},function(t,n){var i=0,s=Math.random();t.exports=function(o){return"Symbol(".concat(o===void 0?"":o,")_",(++i+s).toString(36))}},function(t,n,i){"use strict";function s(N){return N&&N.__esModule?N:{default:N}}function o(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function a(N){return(0,_.createHash)("sha256").update(N).digest("hex")}function c(N){switch(A){case"darwin":return N.split("IOPlatformUUID")[1].split(`
104
+ `)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return N.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return N.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return N.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function u(N){var H=c((0,y.execSync)(L[A]).toString());return N?H:a(H)}function p(N){return new m.default(function(H,W){return(0,y.exec)(L[A],{},function(U,G,M){if(U)return W(new Error("Error while obtaining machine id: "+U.stack));var F=c(G.toString());return H(N?F:a(F))})})}Object.defineProperty(n,"__esModule",{value:!0});var f=i(35),m=s(f);n.machineIdSync=u,n.machineId=p;var y=i(70),_=i(71),S=process,A=S.platform,P={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},L={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:P[o()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(t,n,i){t.exports={default:i(36),__esModule:!0}},function(t,n,i){i(66),i(68),i(69),i(67),t.exports=i(6).Promise},function(t,n){t.exports=function(){}},function(t,n){t.exports=function(i,s,o,a){if(!(i instanceof s)||a!==void 0&&a in i)throw TypeError(o+": incorrect invocation!");return i}},function(t,n,i){var s=i(13),o=i(31),a=i(62);t.exports=function(c){return function(u,p,f){var m,y=s(u),_=o(y.length),S=a(f,_);if(c&&p!=p){for(;_>S;)if(m=y[S++],m!=m)return!0}else for(;_>S;S++)if((c||S in y)&&y[S]===p)return c||S||0;return!c&&-1}}},function(t,y,i){var s=i(7),o=i(44),a=i(43),c=i(3),u=i(31),p=i(64),f={},m={},y=t.exports=function(_,S,A,P,L){var N,H,W,U,G=L?function(){return _}:p(_),M=s(A,P,S?2:1),F=0;if(typeof G!="function")throw TypeError(_+" is not iterable!");if(a(G)){for(N=u(_.length);N>F;F++)if(U=S?M(c(H=_[F])[0],H[1]):M(_[F]),U===f||U===m)return U}else for(W=G.call(_);!(H=W.next()).done;)if(U=o(W,M,H.value,S),U===f||U===m)return U};y.BREAK=f,y.RETURN=m},function(t,n){t.exports=function(i,s,o){var a=o===void 0;switch(s.length){case 0:return a?i():i.call(o);case 1:return a?i(s[0]):i.call(o,s[0]);case 2:return a?i(s[0],s[1]):i.call(o,s[0],s[1]);case 3:return a?i(s[0],s[1],s[2]):i.call(o,s[0],s[1],s[2]);case 4:return a?i(s[0],s[1],s[2],s[3]):i.call(o,s[0],s[1],s[2],s[3])}return i.apply(o,s)}},function(t,n,i){var s=i(11);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(o){return s(o)=="String"?o.split(""):Object(o)}},function(t,n,i){var s=i(10),o=i(1)("iterator"),a=Array.prototype;t.exports=function(c){return c!==void 0&&(s.Array===c||a[o]===c)}},function(t,n,i){var s=i(3);t.exports=function(o,a,c,u){try{return u?a(s(c)[0],c[1]):a(c)}catch(f){var p=o.return;throw p!==void 0&&s(p.call(o)),f}}},function(t,n,i){"use strict";var s=i(49),o=i(17),a=i(18),c={};i(5)(c,i(1)("iterator"),function(){return this}),t.exports=function(u,p,f){u.prototype=s(c,{next:o(1,f)}),a(u,p+" Iterator")}},function(t,n,i){var s=i(1)("iterator"),o=!1;try{var a=[7][s]();a.return=function(){o=!0},Array.from(a,function(){throw 2})}catch{}t.exports=function(c,u){if(!u&&!o)return!1;var p=!1;try{var f=[7],m=f[s]();m.next=function(){return{done:p=!0}},f[s]=function(){return m},c(f)}catch{}return p}},function(t,n){t.exports=function(i,s){return{value:s,done:!!i}}},function(t,n,i){var s=i(2),o=i(30).set,a=s.MutationObserver||s.WebKitMutationObserver,c=s.process,u=s.Promise,p=i(11)(c)=="process";t.exports=function(){var f,m,y,_=function(){var L,N;for(p&&(L=c.domain)&&L.exit();f;){N=f.fn,f=f.next;try{N()}catch(H){throw f?y():m=void 0,H}}m=void 0,L&&L.enter()};if(p)y=function(){c.nextTick(_)};else if(a){var S=!0,A=document.createTextNode("");new a(_).observe(A,{characterData:!0}),y=function(){A.data=S=!S}}else if(u&&u.resolve){var P=u.resolve();y=function(){P.then(_)}}else y=function(){o.call(s,_)};return function(L){var N={fn:L,next:void 0};m&&(m.next=N),f||(f=N,y()),m=N}}},function(t,n,i){var s=i(3),o=i(50),a=i(22),c=i(19)("IE_PROTO"),u=function(){},p="prototype",f=function(){var m,y=i(16)("iframe"),_=a.length,S=">";for(y.style.display="none",i(25).appendChild(y),y.src="javascript:",m=y.contentWindow.document,m.open(),m.write("<script>document.F=Object</script"+S),m.close(),f=m.F;_--;)delete f[p][a[_]];return f()};t.exports=Object.create||function(m,y){var _;return m!==null?(u[p]=s(m),_=new u,u[p]=null,_[c]=m):_=f(),y===void 0?_:o(_,y)}},function(t,n,i){var s=i(12),o=i(3),a=i(54);t.exports=i(4)?Object.defineProperties:function(c,u){o(c);for(var p,f=a(u),m=f.length,y=0;m>y;)s.f(c,p=f[y++],u[p]);return c}},function(t,n,i){var s=i(55),o=i(17),a=i(13),c=i(32),u=i(8),p=i(26),f=Object.getOwnPropertyDescriptor;n.f=i(4)?f:function(m,y){if(m=a(m),y=c(y,!0),p)try{return f(m,y)}catch{}if(u(m,y))return o(!s.f.call(m,y),m[y])}},function(t,n,i){var s=i(8),o=i(63),a=i(19)("IE_PROTO"),c=Object.prototype;t.exports=Object.getPrototypeOf||function(u){return u=o(u),s(u,a)?u[a]:typeof u.constructor=="function"&&u instanceof u.constructor?u.constructor.prototype:u instanceof Object?c:null}},function(t,n,i){var s=i(8),o=i(13),a=i(39)(!1),c=i(19)("IE_PROTO");t.exports=function(u,p){var f,m=o(u),y=0,_=[];for(f in m)f!=c&&s(m,f)&&_.push(f);for(;p.length>y;)s(m,f=p[y++])&&(~a(_,f)||_.push(f));return _}},function(t,n,i){var s=i(53),o=i(22);t.exports=Object.keys||function(a){return s(a,o)}},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,i){var s=i(5);t.exports=function(o,a,c){for(var u in a)c&&o[u]?o[u]=a[u]:s(o,u,a[u]);return o}},function(t,n,i){t.exports=i(5)},function(t,n,i){var s=i(9),o=i(3),a=function(c,u){if(o(c),!s(u)&&u!==null)throw TypeError(u+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?(function(c,u,p){try{p=i(7)(Function.call,i(51).f(Object.prototype,"__proto__").set,2),p(c,[]),u=!(c instanceof Array)}catch{u=!0}return function(f,m){return a(f,m),u?f.__proto__=m:p(f,m),f}})({},!1):void 0),check:a}},function(t,n,i){"use strict";var s=i(2),o=i(6),a=i(12),c=i(4),u=i(1)("species");t.exports=function(p){var f=typeof o[p]=="function"?o[p]:s[p];c&&f&&!f[u]&&a.f(f,u,{configurable:!0,get:function(){return this}})}},function(t,n,i){var s=i(3),o=i(14),a=i(1)("species");t.exports=function(c,u){var p,f=s(c).constructor;return f===void 0||(p=s(f)[a])==null?u:o(p)}},function(t,n,i){var s=i(20),o=i(15);t.exports=function(a){return function(c,u){var p,f,m=String(o(c)),y=s(u),_=m.length;return y<0||y>=_?a?"":void 0:(p=m.charCodeAt(y),p<55296||p>56319||y+1===_||(f=m.charCodeAt(y+1))<56320||f>57343?a?m.charAt(y):p:a?m.slice(y,y+2):(p-55296<<10)+(f-56320)+65536)}}},function(t,n,i){var s=i(20),o=Math.max,a=Math.min;t.exports=function(c,u){return c=s(c),c<0?o(c+u,0):a(c,u)}},function(t,n,i){var s=i(15);t.exports=function(o){return Object(s(o))}},function(t,n,i){var s=i(21),o=i(1)("iterator"),a=i(10);t.exports=i(6).getIteratorMethod=function(c){if(c!=null)return c[o]||c["@@iterator"]||a[s(c)]}},function(t,n,i){"use strict";var s=i(37),o=i(47),a=i(10),c=i(13);t.exports=i(27)(Array,"Array",function(u,p){this._t=c(u),this._i=0,this._k=p},function(){var u=this._t,p=this._k,f=this._i++;return!u||f>=u.length?(this._t=void 0,o(1)):p=="keys"?o(0,f):p=="values"?o(0,u[f]):o(0,[f,u[f]])},"values"),a.Arguments=a.Array,s("keys"),s("values"),s("entries")},function(t,n){},function(t,n,i){"use strict";var s,o,a,c=i(28),u=i(2),p=i(7),f=i(21),m=i(23),y=i(9),_=(i(3),i(14)),S=i(38),A=i(40),P=(i(58).set,i(60)),L=i(30).set,N=i(48)(),H="Promise",W=u.TypeError,G=u.process,U=u[H],G=u.process,M=f(G)=="process",F=function(){},T=!!(function(){try{var I=U.resolve(1),D=(I.constructor={})[i(1)("species")]=function($){$(F,F)};return(M||typeof PromiseRejectionEvent=="function")&&I.then(F)instanceof D}catch{}})(),l=function(I,D){return I===D||I===U&&D===a},h=function(I){var D;return!(!y(I)||typeof(D=I.then)!="function")&&D},x=function(I){return l(U,I)?new w(I):new o(I)},w=o=function(I){var D,$;this.promise=new I(function(K,B){if(D!==void 0||$!==void 0)throw W("Bad Promise constructor");D=K,$=B}),this.resolve=_(D),this.reject=_($)},g=function(I){try{I()}catch(D){return{error:D}}},v=function(I,D){if(!I._n){I._n=!0;var $=I._c;N(function(){for(var K=I._v,B=I._s==1,me=0,ie=function(R){var Y,k,j=B?R.ok:R.fail,J=R.resolve,V=R.reject,z=R.domain;try{j?(B||(I._h==2&&d(I),I._h=1),j===!0?Y=K:(z&&z.enter(),Y=j(K),z&&z.exit()),Y===R.promise?V(W("Promise-chain cycle")):(k=h(Y))?k.call(Y,J,V):J(Y)):V(K)}catch(ge){V(ge)}};$.length>me;)ie($[me++]);I._c=[],I._n=!1,D&&!I._h&&C(I)})}},C=function(I){L.call(u,function(){var D,$,K,B=I._v;if(b(I)&&(D=g(function(){M?G.emit("unhandledRejection",B,I):($=u.onunhandledrejection)?$({promise:I,reason:B}):(K=u.console)&&K.error&&K.error("Unhandled promise rejection",B)}),I._h=M||b(I)?2:1),I._a=void 0,D)throw D.error})},b=function(I){if(I._h==1)return!1;for(var D,$=I._a||I._c,K=0;$.length>K;)if(D=$[K++],D.fail||!b(D.promise))return!1;return!0},d=function(I){L.call(u,function(){var D;M?G.emit("rejectionHandled",I):(D=u.onrejectionhandled)&&D({promise:I,reason:I._v})})},E=function(I){var D=this;D._d||(D._d=!0,D=D._w||D,D._v=I,D._s=2,D._a||(D._a=D._c.slice()),v(D,!0))},q=function(I){var D,$=this;if(!$._d){$._d=!0,$=$._w||$;try{if($===I)throw W("Promise can't be resolved itself");(D=h(I))?N(function(){var K={_w:$,_d:!1};try{D.call(I,p(q,K,1),p(E,K,1))}catch(B){E.call(K,B)}}):($._v=I,$._s=1,v($,!1))}catch(K){E.call({_w:$,_d:!1},K)}}};T||(U=function(I){S(this,U,H,"_h"),_(I),s.call(this);try{I(p(q,this,1),p(E,this,1))}catch(D){E.call(this,D)}},s=function(I){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},s.prototype=i(56)(U.prototype,{then:function(I,D){var $=x(P(this,U));return $.ok=typeof I!="function"||I,$.fail=typeof D=="function"&&D,$.domain=M?G.domain:void 0,this._c.push($),this._a&&this._a.push($),this._s&&v(this,!1),$.promise},catch:function(I){return this.then(void 0,I)}}),w=function(){var I=new s;this.promise=I,this.resolve=p(q,I,1),this.reject=p(E,I,1)}),m(m.G+m.W+m.F*!T,{Promise:U}),i(18)(U,H),i(59)(H),a=i(6)[H],m(m.S+m.F*!T,H,{reject:function(I){var D=x(this),$=D.reject;return $(I),D.promise}}),m(m.S+m.F*(c||!T),H,{resolve:function(I){if(I instanceof U&&l(I.constructor,this))return I;var D=x(this),$=D.resolve;return $(I),D.promise}}),m(m.S+m.F*!(T&&i(46)(function(I){U.all(I).catch(F)})),H,{all:function(I){var D=this,$=x(D),K=$.resolve,B=$.reject,me=g(function(){var ie=[],R=0,Y=1;A(I,!1,function(k){var j=R++,J=!1;ie.push(void 0),Y++,D.resolve(k).then(function(V){J||(J=!0,ie[j]=V,--Y||K(ie))},B)}),--Y||K(ie)});return me&&B(me.error),$.promise},race:function(I){var D=this,$=x(D),K=$.reject,B=g(function(){A(I,!1,function(me){D.resolve(me).then($.resolve,K)})});return B&&K(B.error),$.promise}})},function(t,n,i){"use strict";var s=i(61)(!0);i(27)(String,"String",function(o){this._t=String(o),this._i=0},function(){var o,a=this._t,c=this._i;return c>=a.length?{value:void 0,done:!0}:(o=s(a,c),this._i+=o.length,{value:o,done:!1})})},function(t,n,i){i(65);for(var s=i(2),o=i(5),a=i(10),c=i(1)("toStringTag"),u=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],p=0;p<5;p++){var f=u[p],m=s[f],y=m&&m.prototype;y&&!y[c]&&o(y,c,f),a[f]=a.Array}},function(t,n){t.exports=require("child_process")},function(t,n){t.exports=require("crypto")}])})});var T4={};Xr(T4,{startServer:()=>RO});module.exports=NO(T4);var Ku=require("http"),Vu=require("child_process"),Ri=require("fs"),tr=require("path"),TO=require("url");var lv=(r=0)=>e=>`\x1B[${e+r}m`,uv=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,pv=(r=0)=>(e,t,n)=>`\x1B[${38+r};2;${e};${t};${n}m`,ye={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},A4=Object.keys(ye.modifier),LO=Object.keys(ye.color),DO=Object.keys(ye.bgColor),R4=[...LO,...DO];function BO(){let r=new Map;for(let[e,t]of Object.entries(ye)){for(let[n,i]of Object.entries(t))ye[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[n]=ye[n],r.set(i[0],i[1]);Object.defineProperty(ye,e,{value:t,enumerable:!1})}return Object.defineProperty(ye,"codes",{value:r,enumerable:!1}),ye.color.close="\x1B[39m",ye.bgColor.close="\x1B[49m",ye.color.ansi=lv(),ye.color.ansi256=uv(),ye.color.ansi16m=pv(),ye.bgColor.ansi=lv(10),ye.bgColor.ansi256=uv(10),ye.bgColor.ansi16m=pv(10),Object.defineProperties(ye,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>ye.rgbToAnsi256(...ye.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,i;if(e>=232)t=((e-232)*10+8)/255,n=t,i=t;else{e-=16;let a=e%36;t=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(t,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(t));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>ye.ansi256ToAnsi(ye.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>ye.ansi256ToAnsi(ye.hexToAnsi256(e)),enumerable:!1}}),ye}var jO=BO(),_r=jO;var Ma=X(require("node:process"),1),dv=X(require("node:os"),1),hp=X(require("node:tty"),1);function rr(r,e=globalThis.Deno?globalThis.Deno.args:Ma.default.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:_e}=Ma.default,Pa;rr("no-color")||rr("no-colors")||rr("color=false")||rr("color=never")?Pa=0:(rr("color")||rr("colors")||rr("color=true")||rr("color=always"))&&(Pa=1);function FO(){if("FORCE_COLOR"in _e)return _e.FORCE_COLOR==="true"?1:_e.FORCE_COLOR==="false"?0:_e.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(_e.FORCE_COLOR,10),3)}function HO(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function $O(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let n=FO();n!==void 0&&(Pa=n);let i=t?Pa:n;if(i===0)return 0;if(t){if(rr("color=16m")||rr("color=full")||rr("color=truecolor"))return 3;if(rr("color=256"))return 2}if("TF_BUILD"in _e&&"AGENT_NAME"in _e)return 1;if(r&&!e&&i===void 0)return 0;let s=i||0;if(_e.TERM==="dumb")return s;if(Ma.default.platform==="win32"){let o=dv.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in _e)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in _e)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in _e)||_e.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in _e)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(_e.TEAMCITY_VERSION)?1:0;if(_e.COLORTERM==="truecolor"||_e.TERM==="xterm-kitty"||_e.TERM==="xterm-ghostty"||_e.TERM==="wezterm")return 3;if("TERM_PROGRAM"in _e){let o=Number.parseInt((_e.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(_e.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(_e.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(_e.TERM)||"COLORTERM"in _e?1:s}function fv(r,e={}){let t=$O(r,{streamIsTTY:r&&r.isTTY,...e});return HO(t)}var qO={stdout:fv({isTTY:hp.default.isatty(1)}),stderr:fv({isTTY:hp.default.isatty(2)})},hv=qO;function mv(r,e,t){let n=r.indexOf(e);if(n===-1)return r;let i=e.length,s=0,o="";do o+=r.slice(s,n)+e+t,s=n+i,n=r.indexOf(e,s);while(n!==-1);return o+=r.slice(s),o}function gv(r,e,t,n){let i=0,s="";do{let o=r[n-1]==="\r";s+=r.slice(i,o?n-1:n)+e+(o?`\r
105
105
  `:`
106
106
  `)+t,i=n+1,n=r.indexOf(`
107
- `,i)}while(n!==-1);return s+=r.slice(i),s}var{stdout:mv,stderr:gv}=fv,hp=Symbol("GENERATOR"),Ai=Symbol("STYLER"),Xs=Symbol("IS_EMPTY"),vv=["ansi","ansi","ansi256","ansi16m"],Ri=Object.create(null),FO=(r,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=mv?mv.level:0;r.level=e.level===void 0?t:e.level};var HO=r=>{let e=(...t)=>t.join(" ");return FO(e,r),Object.setPrototypeOf(e,Js.prototype),e};function Js(r){return HO(r)}Object.setPrototypeOf(Js.prototype,Function.prototype);for(let[r,e]of Object.entries(_r))Ri[r]={get(){let t=Ma(this,gp(e.open,e.close,this[Ai]),this[Xs]);return Object.defineProperty(this,r,{value:t}),t}};Ri.visible={get(){let r=Ma(this,this[Ai],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var mp=(r,e,t,...n)=>r==="rgb"?e==="ansi16m"?_r[t].ansi16m(...n):e==="ansi256"?_r[t].ansi256(_r.rgbToAnsi256(...n)):_r[t].ansi(_r.rgbToAnsi(...n)):r==="hex"?mp("rgb",e,t,..._r.hexToRgb(...n)):_r[t][r](...n),$O=["rgb","hex","ansi256"];for(let r of $O){Ri[r]={get(){let{level:t}=this;return function(...n){let i=gp(mp(r,vv[t],"color",...n),_r.color.close,this[Ai]);return Ma(this,i,this[Xs])}}};let e="bg"+r[0].toUpperCase()+r.slice(1);Ri[e]={get(){let{level:t}=this;return function(...n){let i=gp(mp(r,vv[t],"bgColor",...n),_r.bgColor.close,this[Ai]);return Ma(this,i,this[Xs])}}}}var qO=Object.defineProperties(()=>{},{...Ri,level:{enumerable:!0,get(){return this[hp].level},set(r){this[hp].level=r}}}),gp=(r,e,t)=>{let n,i;return t===void 0?(n=r,i=e):(n=t.openAll+r,i=e+t.closeAll),{open:r,close:e,openAll:n,closeAll:i,parent:t}},Ma=(r,e,t)=>{let n=(...i)=>UO(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,qO),n[hp]=r,n[Ai]=e,n[Xs]=t,n},UO=(r,e)=>{if(r.level<=0||!e)return r[Xs]?"":e;let t=r[Ai];if(t===void 0)return e;let{openAll:n,closeAll:i}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=dv(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
108
- `);return s!==-1&&(e=hv(e,i,n,s)),n+e+i};Object.defineProperties(Js.prototype,Ri);var WO=Js(),P4=Js({level:gv?gv.level:0});var xv=WO;Gt();gt();Pi();var Ib=X(Mb(),1),{Server:Nb,Namespace:CW,Socket:AW}=Ib.default;var BR=require("fs"),jR=require("path");gt();el();var vt={control:"control",binary:"binary"},ft={idle:"idle",connecting:"connecting",open:"open",degraded:"degraded",closed:"closed"},jb={clientApp:{enabled:["ws","rtc"],channels:{control:{strategy:"priority",prefer:"rtc"},binary:{strategy:"priority",prefer:"rtc"}}},remoteDesktop:{enabled:["ws","rtc"],channels:{control:{strategy:"priority",prefer:"rtc"},binary:{strategy:"priority",prefer:"rtc"}}}};var ps=class{static id="base";static capabilities={control:!1,binary:!1,signaling:"none"};static priority={control:0,binary:0};constructor(){this._listeners=new Map,this._state=ft.idle}get state(){return this._state}get ready(){return this._state===ft.open}supports(e){return!!this.constructor.capabilities[e]}on(e,t){this._listeners.has(e)||this._listeners.set(e,new Set),this._listeners.get(e).add(t)}off(e,t){this._listeners.get(e)?.delete(t)}_emit(e,...t){let n=this._listeners.get(e);if(n)for(let i of n)i(...t)}_setState(e){this._state!==e&&(this._state=e,this._emit("stateChange",e))}connect(e){throw new Error("Not implemented: connect")}disconnect(){throw new Error("Not implemented: disconnect")}send(e,t){throw new Error("Not implemented: send")}};var tl=class extends ps{static id="ws";static capabilities={control:!0,binary:!0,signaling:"ws"};static priority={control:100,binary:10};constructor(){super(),this._socket=null}get socket(){return this._socket}connect(e){this._socket=e.socket,this._setState(e.socket.connected?ft.open:ft.connecting),e.socket.on("connect",()=>this._setState(ft.open)),e.socket.on("disconnect",()=>this._setState(ft.closed)),e.socket.onAny?.((t,n)=>this._emit("message",{event:t,data:n,source:"ws"}))}disconnect(){this._socket=null,this._setState(ft.closed)}send(e,t){if(!this._socket?.connected)return!1;let n=this._socket._rawEmit||this._socket.emit.bind(this._socket);if(e===vt.control){let{event:i,args:s=[]}=t;return n(i,...s),!0}return e===vt.binary?(n("tiles-bin-v2",t),!0):!1}};var Gb=X(require("node-datachannel"),1);function F2(r,e){return e&&typeof e=="object"&&e.type==="Buffer"&&Array.isArray(e.data)?{__b:Buffer.from(e.data).toString("base64")}:e}function H2(r,e){return e&&typeof e=="object"&&typeof e.__b=="string"?Buffer.from(e.__b,"base64"):e}function Fb(r){return JSON.stringify(r,F2)}function Hb(r){return JSON.parse(typeof r=="string"?r:Buffer.from(r).toString("utf8"),H2)}bt();var Ub=X(require("node:dns/promises"),1),$2=3e4,q2=/\s([0-9a-f-]{8,}\.local)\s/i,qb=new Map;async function U2(r){let e=qb.get(r);if(e&&Date.now()-e.ts<$2)return e.ip;try{let{address:t}=await Ub.default.lookup(r);return qb.set(r,{ip:t,ts:Date.now()}),t}catch{return null}}async function Wb(r){let e=r.match(q2);if(!e)return r;let t=await U2(e[1]);return t?r.replace(e[1],t):null}var{PeerConnection:W2}=Gb.default,G2=[{hostname:"stun.l.google.com",port:19302,type:"Stun"},{hostname:"stun1.l.google.com",port:19302,type:"Stun"},{hostname:"stun2.l.google.com",port:19302,type:"Stun"},{hostname:"stun3.l.google.com",port:19302,type:"Stun"},{hostname:"stun4.l.google.com",port:19302,type:"Stun"},{hostname:"global.stun.twilio.com",port:3478,type:"Stun"},{hostname:"stun.cloudflare.com",port:3478,type:"Stun"}];async function z2(r,e){try{let t=await fetch(r,{headers:{"X-API-Key":e}});if(!t.ok)throw new Error(`HTTP ${t.status}`);let{iceServers:n}=await t.json(),i=[];for(let s of n)for(let o of s.urls)if(o.startsWith("stun:")){let a=o.replace("stun:","").split(":")[0],c=parseInt(o.split(":")[2]||"3478");i.push({hostname:a,port:c,type:"Stun"})}else if(o.startsWith("turn:")||o.startsWith("turns:")){let a=o.startsWith("turns:"),u=o.replace(/^turns?:/,"").split("?")[0],p=u.split(":")[0],f=parseInt(u.split(":")[1]||(a?"5349":"3478")),m=o.includes("transport=tcp")?"Tcp":"Udp";i.push({hostname:p,port:f,type:a?"Tls":"Turn",relayType:m,username:s.username,password:s.credential})}return i}catch(t){return console.error("[WebRtcProtocol] TURN fetch failed:",t.message),null}}var nl=class extends ps{static id="rtc";static capabilities={control:!0,binary:!0,signaling:"external"};static priority={control:50,binary:100};constructor(){super(),this._pc=null,this._dcControl=null,this._dcBinary=null,this._iceServers=G2,this._refreshTimer=null,this._remoteSet=!1,this._pendingCandidates=[],this._signaling=null}async connect(e){this._ctx=e,this._setState(ft.connecting);let t=e.profile?.rtc||{};t.enableTurn&&e.auth?.apiKey&&t.turnApiUrl&&await this._refreshTurn(t),this._signaling=e.signaling,this._signaling?.on?.(n=>this._handleSignal(n,t))}disconnect(){clearTimeout(this._refreshTimer),this._signaling?.off?.(),this._signaling=null,this._cleanupPeer(),this._setState(ft.closed)}send(e,t){if(e===vt.control){if(!this._dcControl)return!1;try{return this._dcControl.sendMessage(Fb({event:t.event,args:t.args||[],ackId:t.ackId||null})),!0}catch(n){return console.error("[WebRtcProtocol] send control:",n.message),!1}}if(e===vt.binary){if(!this._dcBinary)return!1;try{let n=Array.isArray(t)?t:[t],i=this._ctx.profile?.rtc?.dcMaxMessageSize??65536;for(let s of n)s.length<=i&&this._dcBinary.sendMessageBinary(s);return!0}catch(n){return console.error("[WebRtcProtocol] send binary:",n.message),!1}}return!1}_handleSignal(e,t){if(e.type==="offer")this._processOffer(e.sdp,t);else if(e.type==="ice"){if(!this._remoteSet||!this._pc){this._pendingCandidates.push({candidate:e.candidate,mid:e.mid||"0"});return}this._addRemoteCandidate(e.candidate,e.mid||"0")}}async _addRemoteCandidate(e,t){try{let n=await Wb(e);if(!n||!this._pc)return;this._pc.addRemoteCandidate(n,t)}catch(n){console.error("[WebRtcProtocol] addRemoteCandidate:",n.message)}}_createPeer(e){try{this._pc?.close()}catch{}this._pc=null,this._dcControl=null,this._dcBinary=null,this._remoteSet=!1,this._pendingCandidates=[];let t=this._ctx?.auth?.socketId||"anon",n=new W2(`peer-${t}`,{iceServers:this._iceServers});n.onDataChannel(i=>{let s=i.getLabel?.()||"",o=()=>{s==="control"?this._dcControl=i:s==="binary"&&(this._dcBinary=i),this._dcControl&&this._dcBinary&&this._setState(ft.open)};i.onOpen(o),i.onClosed(()=>{s==="control"&&(this._dcControl=null),s==="binary"&&(this._dcBinary=null),!this._dcControl&&!this._dcBinary&&this._setState(ft.closed)}),i.onError(a=>console.error(`[WebRtcProtocol] DC[${s}] error:`,a)),i.onMessage(a=>{if(s!=="control")return;let c;try{c=Hb(a)}catch(u){console.error("[WebRtcProtocol] control parse:",u.message);return}try{this._emit("message",{event:c.event,data:c,source:"rtc"})}catch(u){console.error(`[WebRtcProtocol] handler error event=${c.event}:`,u.message)}})}),this._pc=n}_processOffer(e,t){return this._createPeer(t),new Promise((n,i)=>{this._pc.onLocalDescription((o,a)=>{a==="answer"&&(this._signaling?.send?.({type:"answer",sdp:o}),n())}),this._pc.onLocalCandidate((o,a)=>{o&&this._signaling?.send?.({type:"ice",candidate:o,mid:a})});try{this._pc.setRemoteDescription(e,"offer"),this._remoteSet=!0;for(let{candidate:o,mid:a}of this._pendingCandidates)this._addRemoteCandidate(o,a);this._pendingCandidates=[],this._pc.setLocalDescription()}catch(o){this._signaling?.send?.({type:"error",message:o.message}),i(o)}let s=t?.answerTimeout||1e4;setTimeout(()=>i(new Error("Answer timeout")),s)})}_cleanupPeer(){try{this._pc?.close()}catch{}this._pc=null,this._dcControl=null,this._dcBinary=null}async _refreshTurn(e){let t=await z2(e.turnApiUrl,this._ctx.auth.apiKey);t?.length&&(this._iceServers=t,Z.logging?.webrtc&&console.log(`[WebRtcProtocol] TURN credentials loaded (${t.length} servers)`)),clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(()=>this._refreshTurn(e),e.turnRefreshInterval)}};var zb=new Map;function jd(r){if(!r?.id)throw new Error("Adapter missing static id");zb.set(r.id,r)}function Kb(r){return zb.get(r)}$d();jd(tl);jd(nl);var il=class{constructor(e,t){let n=t.enableWebRTC?"remoteDesktop":"clientApp",i={...jb[n]};t.enableWebRTC||(i.enabled=["ws"]),i.rtc={enableTurn:!!(t.apiKey&&t.turnApiUrl),turnApiUrl:t.turnApiUrl||null,turnRefreshInterval:t.turnRefreshInterval,dcMaxMessageSize:t.dcMaxMessageSize,answerTimeout:t.answerTimeout},this._profile=i,this._auth={apiKey:t.apiKey||null,socketId:e.id},this._socket=e,this._wsChunkSize=t.wsChunkSize,this._dcChunkSize=t.dcChunkSize,this._dcMaxTilesPerFrame=t.dcMaxTilesPerFrame,this._adapters=new Map,this._listeners=new Map,this._buffer=[],this._rtcSignalingHandler=null,this._sigListeners=null}get type(){return this._pickAdapter(vt.binary)?.constructor.id==="rtc"?"dc":"ws"}async init(){for(let e of this._profile.enabled){let t=Kb(e);if(!t)continue;let n=new t;n.on("stateChange",s=>this._onAdapterStateChange(e,s)),n.on("message",({event:s,data:o,source:a})=>this._dispatch(s,o,a)),this._adapters.set(e,n);let i=this._buildCtx(e);await n.connect(i)}}setupSignaling(e){this._installSignalingListeners()}emit(e,...t){this._sendControl(e,t)}sendTiles(e,t){let{tiles:n,timestamp:i}=e;if(!n?.length)return;let s=this._pickAdapter(vt.binary),o=i??Date.now();if(s?.constructor.id==="rtc"&&t){let a=[];for(let c=0;c<n.length;c+=this._dcChunkSize)a.push(t(n.slice(c,c+this._dcChunkSize),o));s.send(vt.binary,a);return}this._emitTilesChunked(n,o)}close(){for(let e of this._adapters.values())try{e.disconnect()}catch{}this._adapters.clear(),this._buffer=[]}attachAsBus(e){if(e._rawEmit)return;let t=e.emit.bind(e);e._rawEmit=t;let n=new Set(["error","disconnect","disconnecting","connect","newListener","removeListener"]);e.emit=(i,...s)=>n.has(i)?t(i,...s):(this._sendControl(i,s),!0)}_emitTilesChunked(e,t){let n=this._adapters.get("ws");if(!n?.ready)return;let i=this._wsChunkSize;for(let s=0;s<e.length;s+=i){let o=e.slice(s,s+i);n.send(vt.binary,fs(o,t))}}_buildCtx(e){let t={auth:this._auth,profile:this._profile};return e==="ws"&&(t.socket=this._socket),e==="rtc"&&(t.signaling={send:n=>this._sendSignaling(n),on:n=>{this._rtcSignalingHandler=n,this._installSignalingListeners()},off:()=>{this._rtcSignalingHandler=null,this._removeSignalingListeners()}}),t}_onAdapterStateChange(e,t){t===ft.open&&this._flushBuffer()}_pickAdapter(e){let t=this._profile.channels[e];if(!t)return null;let n=[...this._adapters.values()].filter(i=>i.supports(e)&&i.ready);if(t.prefer){let i=n.find(s=>s.constructor.id===t.prefer);if(i)return i}return n.sort((i,s)=>(s.constructor.priority[e]??0)-(i.constructor.priority[e]??0)),n[0]||null}_sendControl(e,t,n){let i=this._pickAdapter(vt.control);if(!i){this._buffer.push({event:e,args:t,ackId:n});return}i.constructor.id==="rtc"?i.send(vt.control,{event:e,args:t,ackId:n}):i.send(vt.control,{event:e,args:t})}_flushBuffer(){if(!(!this._buffer.length||!this._pickAdapter(vt.control)))for(;this._buffer.length;){let{event:t,args:n,ackId:i}=this._buffer.shift();this._sendControl(t,n,i)}}_dispatch(e,t,n){if(n==="rtc"){let s=Array.isArray(t?.args)?[...t.args]:[],o=t?.ackId;o&&s.push((...u)=>this._sendAck(o,u));let a=this._listeners.get(e);if(a)for(let u of a)u(...s);let c=this._socket.listeners?.(e)||[];for(let u of c)u(...s);return}let i=this._listeners.get(e);if(i)for(let s of i)s(t)}_sendAck(e,t){let n=this._adapters.get("rtc");n?.ready&&n.send(vt.control,{event:"__ack",args:t,ackId:e})}_sendSignaling(e){let t=this._adapters.get("ws");if(t?.ready){t.send(vt.control,{event:this._sigEvent(e.type),args:[this._sigData(e)]});return}console.warn("[ProtocolManager] signaling unavailable (ws down)")}_sigEvent(e){return e==="offer"?"webrtc:offer":e==="answer"?"webrtc:answer":e==="ice"?"webrtc:ice-candidate":"webrtc:error"}_sigData(e){return e.type==="offer"||e.type==="answer"?{sdp:e.sdp}:e.type==="ice"?{candidate:e.candidate,mid:e.mid}:e}_installSignalingListeners(){if(!this._rtcSignalingHandler||this._sigListeners)return;let e=({sdp:n})=>this._rtcSignalingHandler?.({type:"offer",sdp:n}),t=({candidate:n,mid:i})=>this._rtcSignalingHandler?.({type:"ice",candidate:n,mid:i});this._sigListeners={onOffer:e,onIce:t},this._socket.on("webrtc:offer",e),this._socket.on("webrtc:ice-candidate",t)}_removeSignalingListeners(){this._sigListeners&&(this._socket.off("webrtc:offer",this._sigListeners.onOffer),this._socket.off("webrtc:ice-candidate",this._sigListeners.onIce),this._sigListeners=null)}};var qd=new Set;function Yb(r){qd.add(r)}function sl(r){qd.delete(r)}function wt(r,e,t){for(let n of qd)try{n.emit(e,t)}catch{}}bt();var OT=require("path"),PT=require("url");var pl=X(require("net"),1),ae=X(require("fs"),1),pe=X(require("path"),1),ew=X(require("os"),1),tw=require("child_process"),rw=require("url");var Ud={win32:[{id:"cmd",label:"Command Prompt",path:"cmd.exe",args:[]},{id:"powershell",label:"PowerShell",path:"powershell.exe",args:["-NoLogo"]},{id:"pwsh",label:"PowerShell Core",path:"pwsh.exe",args:["-NoLogo"]}],unix:[{id:"bash",label:"Bash",path:"/bin/bash",args:["-l"]},{id:"zsh",label:"Zsh",path:"/bin/zsh",args:["-l"]},{id:"sh",label:"Sh",path:"/bin/sh",args:["-l"]}]};function Xb(){return process.platform==="win32"?Ud.win32:[]}function Jb(r){if(process.platform==="win32"){let n=r?Ud.win32.find(s=>s.id===r):null;if(n)return n;let i=process.env.COMSPEC;return i?{id:"cmd",label:"Command Prompt",path:i,args:[]}:Ud.win32[0]}let e=process.env.SHELL||"/bin/bash",t=e.split("/").pop();return{id:t,label:t,path:e,args:["-l"]}}var Gd=pe.default.dirname((0,rw.fileURLToPath)(__importMetaUrl)),fn=pe.default.join(ew.default.homedir(),".9remote"),Ro=process.platform==="win32"?"\\\\.\\pipe\\9remote-pty":pe.default.join(fn,"pty-daemon.sock"),Qb=pe.default.join(Gd,"ptyDaemon.js"),Zb=pe.default.join(Gd,"ptyDaemon.cjs"),ol=pe.default.join(fn,"daemon");function nw(r,e){if(ae.default.existsSync(r)){ae.default.mkdirSync(e,{recursive:!0});for(let t of ae.default.readdirSync(r,{withFileTypes:!0})){let n=pe.default.join(r,t.name),i=pe.default.join(e,t.name);t.isDirectory()?nw(n,i):t.isFile()&&ae.default.copyFileSync(n,i)}}}function V2(r,e){let t=r;for(let n=0;n<6;n++){let i=pe.default.join(t,"node_modules",e);if(ae.default.existsSync(i))return i;let s=pe.default.dirname(t);if(s===t)break;t=s}return null}var Y2=r=>V2(r,"node-pty");function X2(r){try{if(!ae.default.existsSync(ol))return;let e=pe.default.join(fn,"pids","ptyDaemon.pid"),t=!1;try{let n=parseInt(ae.default.readFileSync(e,"utf8").trim(),10);if(Number.isFinite(n)&&n>0)try{process.kill(n,0),t=!0}catch{}}catch{}if(t)return;for(let n of ae.default.readdirSync(ol))if(n!==`v${r}`)try{ae.default.rmSync(pe.default.join(ol,n),{recursive:!0,force:!0})}catch{}}catch{}}function J2(r){X2("17");let e=pe.default.join(ol,`v${"17"}`),t=r.endsWith(".js"),n=t?pe.default.join(e,"features","terminal"):e,i=pe.default.join(n,pe.default.basename(r)),s=pe.default.join(n,"node_modules","node-pty");if(ae.default.existsSync(i)&&ae.default.existsSync(s))return{script:i,cwd:n};try{if(ae.default.mkdirSync(n,{recursive:!0}),ae.default.copyFileSync(r,i),t){let a=pe.default.dirname(r);ae.default.copyFileSync(pe.default.join(a,"constants.js"),pe.default.join(n,"constants.js"));let c=pe.default.join(e,"lib");ae.default.mkdirSync(c,{recursive:!0}),ae.default.copyFileSync(pe.default.resolve(a,"..","..","lib","constants.js"),pe.default.join(c,"constants.js"))}let o=Y2(pe.default.dirname(r));return o?(nw(o,s),{script:i,cwd:n}):null}catch{return null}}var Fr=null,ds=!1,jn=!1,Wd="",Q2=0,hs=new Map,al=new Map;function Z2(){return++Q2}function fl(r,e){al.has(r)||al.set(r,[]),al.get(r).push(e)}function ll(r,e){let t=al.get(r);if(t)for(let n of t)try{n(e)}catch(i){console.error(`[DaemonClient] Error in ${r} handler:`,i)}}function zd(r){if(!Fr||!ds)return!1;try{return Fr.write(JSON.stringify(r)+`
109
- `),!0}catch(e){return console.error("[DaemonClient] Send error:",e),!1}}function dl(r,e=5e3){return new Promise((t,n)=>{let i=Z2();r.requestId=i;let s=setTimeout(()=>{hs.delete(i),n(new Error("Request timeout"))},e);hs.set(i,{resolve:t,reject:n,timer:s}),zd(r)||(clearTimeout(s),hs.delete(i),n(new Error("Not connected to daemon")))})}function eB(r){let{type:e,requestId:t,...n}=r;if(t&&hs.has(t)){let{resolve:i,timer:s}=hs.get(t);clearTimeout(s),hs.delete(t),i({type:e,...n});return}switch(e){case"output":ll("output",{sessionId:n.sessionId,data:Buffer.from(n.data,"base64")});break;case"sessionClosed":ll("sessionClosed",n.sessionId);break;case"pong":break;default:console.log("[DaemonClient] Unknown message:",e)}}function ul(){return new Promise(r=>{let e=pl.default.connect(Ro),t=setTimeout(()=>{e.destroy(),r(!1)},1e3);e.on("connect",()=>{clearTimeout(t),e.destroy(),r(!0)}),e.on("error",()=>{if(clearTimeout(t),process.platform!=="win32"&&ae.default.existsSync(Ro))try{ae.default.unlinkSync(Ro)}catch{}r(!1)})})}function tB(){ae.default.existsSync(fn)||ae.default.mkdirSync(fn,{recursive:!0});let r=ae.default.existsSync(Qb)?Qb:ae.default.existsSync(Zb)?Zb:null;if(!r)return console.error("[DaemonClient] \u274C Daemon script not found"),null;let e=J2(r);return e||{script:r,cwd:Gd}}async function rB(){if(!ae.default.existsSync(fn))try{ae.default.mkdirSync(fn,{recursive:!0})}catch(a){return console.error("[DaemonClient] Failed to create socket directory:",a.message),!1}let r=tB();if(!r)return!1;let{script:e,cwd:t}=r,n=pe.default.join(fn,"logs");try{ae.default.mkdirSync(n,{recursive:!0})}catch{}let i=pe.default.join(n,"daemon.log"),s;try{s=ae.default.openSync(i,"w")}catch(a){console.error("[DaemonClient] Failed to open log file:",a.message),s="ignore"}if((0,tw.spawn)("node",[e],{detached:!0,stdio:["ignore",s,s],cwd:t}).unref(),typeof s=="number")try{ae.default.closeSync(s)}catch{}for(let a=0;a<20;a++)if(await new Promise(c=>setTimeout(c,100)),await ul())return!0;console.error("[DaemonClient] \u274C Failed to start daemon");try{let a=ae.default.readFileSync(i,"utf8");a.trim()&&(console.error("[DaemonClient] Daemon log:"),console.error(a))}catch{}return!1}function nB(){return new Promise(r=>{let e=pl.default.connect(Ro),t="",n=s=>{try{e.destroy()}catch{}r(s)},i=setTimeout(()=>n(null),2e3);e.on("connect",()=>e.write(JSON.stringify({type:"ping",requestId:-1})+`
107
+ `,i)}while(n!==-1);return s+=r.slice(i),s}var{stdout:vv,stderr:xv}=hv,mp=Symbol("GENERATOR"),ki=Symbol("STYLER"),Xs=Symbol("IS_EMPTY"),yv=["ansi","ansi","ansi256","ansi16m"],Oi=Object.create(null),UO=(r,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=vv?vv.level:0;r.level=e.level===void 0?t:e.level};var WO=r=>{let e=(...t)=>t.join(" ");return UO(e,r),Object.setPrototypeOf(e,Js.prototype),e};function Js(r){return WO(r)}Object.setPrototypeOf(Js.prototype,Function.prototype);for(let[r,e]of Object.entries(_r))Oi[r]={get(){let t=Ia(this,vp(e.open,e.close,this[ki]),this[Xs]);return Object.defineProperty(this,r,{value:t}),t}};Oi.visible={get(){let r=Ia(this,this[ki],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var gp=(r,e,t,...n)=>r==="rgb"?e==="ansi16m"?_r[t].ansi16m(...n):e==="ansi256"?_r[t].ansi256(_r.rgbToAnsi256(...n)):_r[t].ansi(_r.rgbToAnsi(...n)):r==="hex"?gp("rgb",e,t,..._r.hexToRgb(...n)):_r[t][r](...n),GO=["rgb","hex","ansi256"];for(let r of GO){Oi[r]={get(){let{level:t}=this;return function(...n){let i=vp(gp(r,yv[t],"color",...n),_r.color.close,this[ki]);return Ia(this,i,this[Xs])}}};let e="bg"+r[0].toUpperCase()+r.slice(1);Oi[e]={get(){let{level:t}=this;return function(...n){let i=vp(gp(r,yv[t],"bgColor",...n),_r.bgColor.close,this[ki]);return Ia(this,i,this[Xs])}}}}var zO=Object.defineProperties(()=>{},{...Oi,level:{enumerable:!0,get(){return this[mp].level},set(r){this[mp].level=r}}}),vp=(r,e,t)=>{let n,i;return t===void 0?(n=r,i=e):(n=t.openAll+r,i=e+t.closeAll),{open:r,close:e,openAll:n,closeAll:i,parent:t}},Ia=(r,e,t)=>{let n=(...i)=>KO(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,zO),n[mp]=r,n[ki]=e,n[Xs]=t,n},KO=(r,e)=>{if(r.level<=0||!e)return r[Xs]?"":e;let t=r[ki];if(t===void 0)return e;let{openAll:n,closeAll:i}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=mv(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
108
+ `);return s!==-1&&(e=gv(e,i,n,s)),n+e+i};Object.defineProperties(Js.prototype,Oi);var VO=Js(),L4=Js({level:xv?xv.level:0});var _v=VO;Gt();vt();Mi();var Lb=X(Nb(),1),{Server:Db,Namespace:OW,Socket:PW}=Lb.default;var qR=require("fs"),UR=require("path");vt();tl();var xt={control:"control",binary:"binary"},dt={idle:"idle",connecting:"connecting",open:"open",degraded:"degraded",closed:"closed"},Hb={clientApp:{enabled:["ws","rtc"],channels:{control:{strategy:"priority",prefer:"rtc"},binary:{strategy:"priority",prefer:"rtc"}}},remoteDesktop:{enabled:["ws","rtc"],channels:{control:{strategy:"priority",prefer:"rtc"},binary:{strategy:"priority",prefer:"rtc"}}}};var fs=class{static id="base";static capabilities={control:!1,binary:!1,signaling:"none"};static priority={control:0,binary:0};constructor(){this._listeners=new Map,this._state=dt.idle}get state(){return this._state}get ready(){return this._state===dt.open}supports(e){return!!this.constructor.capabilities[e]}on(e,t){this._listeners.has(e)||this._listeners.set(e,new Set),this._listeners.get(e).add(t)}off(e,t){this._listeners.get(e)?.delete(t)}_emit(e,...t){let n=this._listeners.get(e);if(n)for(let i of n)i(...t)}_setState(e){this._state!==e&&(this._state=e,this._emit("stateChange",e))}connect(e){throw new Error("Not implemented: connect")}disconnect(){throw new Error("Not implemented: disconnect")}send(e,t){throw new Error("Not implemented: send")}};var rl=class extends fs{static id="ws";static capabilities={control:!0,binary:!0,signaling:"ws"};static priority={control:100,binary:10};constructor(){super(),this._socket=null}get socket(){return this._socket}connect(e){this._socket=e.socket,this._setState(e.socket.connected?dt.open:dt.connecting),e.socket.on("connect",()=>this._setState(dt.open)),e.socket.on("disconnect",()=>this._setState(dt.closed)),e.socket.onAny?.((t,n)=>this._emit("message",{event:t,data:n,source:"ws"}))}disconnect(){this._socket=null,this._setState(dt.closed)}send(e,t){if(!this._socket?.connected)return!1;let n=this._socket._rawEmit||this._socket.emit.bind(this._socket);if(e===xt.control){let{event:i,args:s=[]}=t;return n(i,...s),!0}return e===xt.binary?(n("tiles-bin-v2",t),!0):!1}};var Kb=X(require("node-datachannel"),1);function U2(r,e){return e&&typeof e=="object"&&e.type==="Buffer"&&Array.isArray(e.data)?{__b:Buffer.from(e.data).toString("base64")}:e}function W2(r,e){return e&&typeof e=="object"&&typeof e.__b=="string"?Buffer.from(e.__b,"base64"):e}function $b(r){return JSON.stringify(r,U2)}function qb(r){return JSON.parse(typeof r=="string"?r:Buffer.from(r).toString("utf8"),W2)}bt();var Gb=X(require("node:dns/promises"),1),G2=3e4,z2=/\s([0-9a-f-]{8,}\.local)\s/i,Wb=new Map;async function K2(r){let e=Wb.get(r);if(e&&Date.now()-e.ts<G2)return e.ip;try{let{address:t}=await Gb.default.lookup(r);return Wb.set(r,{ip:t,ts:Date.now()}),t}catch{return null}}async function zb(r){let e=r.match(z2);if(!e)return r;let t=await K2(e[1]);return t?r.replace(e[1],t):null}var{PeerConnection:V2}=Kb.default,Y2=[{hostname:"stun.l.google.com",port:19302,type:"Stun"},{hostname:"stun1.l.google.com",port:19302,type:"Stun"},{hostname:"stun2.l.google.com",port:19302,type:"Stun"},{hostname:"stun3.l.google.com",port:19302,type:"Stun"},{hostname:"stun4.l.google.com",port:19302,type:"Stun"},{hostname:"global.stun.twilio.com",port:3478,type:"Stun"},{hostname:"stun.cloudflare.com",port:3478,type:"Stun"}];async function X2(r,e){try{let t=await fetch(r,{headers:{"X-API-Key":e}});if(!t.ok)throw new Error(`HTTP ${t.status}`);let{iceServers:n}=await t.json(),i=[];for(let s of n)for(let o of s.urls)if(o.startsWith("stun:")){let a=o.replace("stun:","").split(":")[0],c=parseInt(o.split(":")[2]||"3478");i.push({hostname:a,port:c,type:"Stun"})}else if(o.startsWith("turn:")||o.startsWith("turns:")){let a=o.startsWith("turns:"),u=o.replace(/^turns?:/,"").split("?")[0],p=u.split(":")[0],f=parseInt(u.split(":")[1]||(a?"5349":"3478")),m=o.includes("transport=tcp")?"Tcp":"Udp";i.push({hostname:p,port:f,type:a?"Tls":"Turn",relayType:m,username:s.username,password:s.credential})}return i}catch(t){return console.error("[WebRtcProtocol] TURN fetch failed:",t.message),null}}var il=class extends fs{static id="rtc";static capabilities={control:!0,binary:!0,signaling:"external"};static priority={control:50,binary:100};constructor(){super(),this._pc=null,this._dcControl=null,this._dcBinary=null,this._iceServers=Y2,this._refreshTimer=null,this._remoteSet=!1,this._pendingCandidates=[],this._signaling=null}async connect(e){this._ctx=e,this._setState(dt.connecting);let t=e.profile?.rtc||{};t.enableTurn&&e.auth?.apiKey&&t.turnApiUrl&&await this._refreshTurn(t),this._signaling=e.signaling,this._signaling?.on?.(n=>this._handleSignal(n,t))}disconnect(){clearTimeout(this._refreshTimer),this._signaling?.off?.(),this._signaling=null,this._cleanupPeer(),this._setState(dt.closed)}send(e,t){if(e===xt.control){if(!this._dcControl)return!1;try{return this._dcControl.sendMessage($b({event:t.event,args:t.args||[],ackId:t.ackId||null})),!0}catch(n){return console.error("[WebRtcProtocol] send control:",n.message),!1}}if(e===xt.binary){if(!this._dcBinary)return!1;try{let n=Array.isArray(t)?t:[t],i=this._ctx.profile?.rtc?.dcMaxMessageSize??65536;for(let s of n)s.length<=i&&this._dcBinary.sendMessageBinary(s);return!0}catch(n){return console.error("[WebRtcProtocol] send binary:",n.message),!1}}return!1}_handleSignal(e,t){if(e.type==="offer")this._processOffer(e.sdp,t);else if(e.type==="ice"){if(!this._remoteSet||!this._pc){this._pendingCandidates.push({candidate:e.candidate,mid:e.mid||"0"});return}this._addRemoteCandidate(e.candidate,e.mid||"0")}}async _addRemoteCandidate(e,t){try{let n=await zb(e);if(!n||!this._pc)return;this._pc.addRemoteCandidate(n,t)}catch(n){console.error("[WebRtcProtocol] addRemoteCandidate:",n.message)}}_createPeer(e){try{this._pc?.close()}catch{}this._pc=null,this._dcControl=null,this._dcBinary=null,this._remoteSet=!1,this._pendingCandidates=[];let t=this._ctx?.auth?.socketId||"anon",n=new V2(`peer-${t}`,{iceServers:this._iceServers});n.onDataChannel(i=>{let s=i.getLabel?.()||"",o=()=>{s==="control"?this._dcControl=i:s==="binary"&&(this._dcBinary=i),this._dcControl&&this._dcBinary&&this._setState(dt.open)};i.onOpen(o),i.onClosed(()=>{s==="control"&&(this._dcControl=null),s==="binary"&&(this._dcBinary=null),!this._dcControl&&!this._dcBinary&&this._setState(dt.closed)}),i.onError(a=>console.error(`[WebRtcProtocol] DC[${s}] error:`,a)),i.onMessage(a=>{if(s!=="control")return;let c;try{c=qb(a)}catch(u){console.error("[WebRtcProtocol] control parse:",u.message);return}try{this._emit("message",{event:c.event,data:c,source:"rtc"})}catch(u){console.error(`[WebRtcProtocol] handler error event=${c.event}:`,u.message)}})}),this._pc=n}_processOffer(e,t){return this._createPeer(t),new Promise((n,i)=>{this._pc.onLocalDescription((o,a)=>{a==="answer"&&(this._signaling?.send?.({type:"answer",sdp:o}),n())}),this._pc.onLocalCandidate((o,a)=>{o&&this._signaling?.send?.({type:"ice",candidate:o,mid:a})});try{this._pc.setRemoteDescription(e,"offer"),this._remoteSet=!0;for(let{candidate:o,mid:a}of this._pendingCandidates)this._addRemoteCandidate(o,a);this._pendingCandidates=[],this._pc.setLocalDescription()}catch(o){this._signaling?.send?.({type:"error",message:o.message}),i(o)}let s=t?.answerTimeout||1e4;setTimeout(()=>i(new Error("Answer timeout")),s)})}_cleanupPeer(){try{this._pc?.close()}catch{}this._pc=null,this._dcControl=null,this._dcBinary=null}async _refreshTurn(e){let t=await X2(e.turnApiUrl,this._ctx.auth.apiKey);t?.length&&(this._iceServers=t,Z.logging?.webrtc&&console.log(`[WebRtcProtocol] TURN credentials loaded (${t.length} servers)`)),clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(()=>this._refreshTurn(e),e.turnRefreshInterval)}};var Vb=new Map;function Fd(r){if(!r?.id)throw new Error("Adapter missing static id");Vb.set(r.id,r)}function Yb(r){return Vb.get(r)}qd();Fd(rl);Fd(il);var sl=class{constructor(e,t){let n=t.enableWebRTC?"remoteDesktop":"clientApp",i={...Hb[n]};t.enableWebRTC||(i.enabled=["ws"]),i.rtc={enableTurn:!!(t.apiKey&&t.turnApiUrl),turnApiUrl:t.turnApiUrl||null,turnRefreshInterval:t.turnRefreshInterval,dcMaxMessageSize:t.dcMaxMessageSize,answerTimeout:t.answerTimeout},this._profile=i,this._auth={apiKey:t.apiKey||null,socketId:e.id},this._socket=e,this._wsChunkSize=t.wsChunkSize,this._dcChunkSize=t.dcChunkSize,this._dcMaxTilesPerFrame=t.dcMaxTilesPerFrame,this._adapters=new Map,this._listeners=new Map,this._buffer=[],this._rtcSignalingHandler=null,this._sigListeners=null}get type(){return this._pickAdapter(xt.binary)?.constructor.id==="rtc"?"dc":"ws"}async init(){for(let e of this._profile.enabled){let t=Yb(e);if(!t)continue;let n=new t;n.on("stateChange",s=>this._onAdapterStateChange(e,s)),n.on("message",({event:s,data:o,source:a})=>this._dispatch(s,o,a)),this._adapters.set(e,n);let i=this._buildCtx(e);await n.connect(i)}}setupSignaling(e){this._installSignalingListeners()}emit(e,...t){this._sendControl(e,t)}sendTiles(e,t){let{tiles:n,timestamp:i}=e;if(!n?.length)return;let s=this._pickAdapter(xt.binary),o=i??Date.now();if(s?.constructor.id==="rtc"&&t){let a=[];for(let c=0;c<n.length;c+=this._dcChunkSize)a.push(t(n.slice(c,c+this._dcChunkSize),o));s.send(xt.binary,a);return}this._emitTilesChunked(n,o)}close(){for(let e of this._adapters.values())try{e.disconnect()}catch{}this._adapters.clear(),this._buffer=[]}attachAsBus(e){if(e._rawEmit)return;let t=e.emit.bind(e);e._rawEmit=t;let n=new Set(["error","disconnect","disconnecting","connect","newListener","removeListener"]);e.emit=(i,...s)=>n.has(i)?t(i,...s):(this._sendControl(i,s),!0)}_emitTilesChunked(e,t){let n=this._adapters.get("ws");if(!n?.ready)return;let i=this._wsChunkSize;for(let s=0;s<e.length;s+=i){let o=e.slice(s,s+i);n.send(xt.binary,ds(o,t))}}_buildCtx(e){let t={auth:this._auth,profile:this._profile};return e==="ws"&&(t.socket=this._socket),e==="rtc"&&(t.signaling={send:n=>this._sendSignaling(n),on:n=>{this._rtcSignalingHandler=n,this._installSignalingListeners()},off:()=>{this._rtcSignalingHandler=null,this._removeSignalingListeners()}}),t}_onAdapterStateChange(e,t){t===dt.open&&this._flushBuffer()}_pickAdapter(e){let t=this._profile.channels[e];if(!t)return null;let n=[...this._adapters.values()].filter(i=>i.supports(e)&&i.ready);if(t.prefer){let i=n.find(s=>s.constructor.id===t.prefer);if(i)return i}return n.sort((i,s)=>(s.constructor.priority[e]??0)-(i.constructor.priority[e]??0)),n[0]||null}_sendControl(e,t,n){let i=this._pickAdapter(xt.control);if(!i){this._buffer.push({event:e,args:t,ackId:n});return}i.constructor.id==="rtc"?i.send(xt.control,{event:e,args:t,ackId:n}):i.send(xt.control,{event:e,args:t})}_flushBuffer(){if(!(!this._buffer.length||!this._pickAdapter(xt.control)))for(;this._buffer.length;){let{event:t,args:n,ackId:i}=this._buffer.shift();this._sendControl(t,n,i)}}_dispatch(e,t,n){if(n==="rtc"){let s=Array.isArray(t?.args)?[...t.args]:[],o=t?.ackId;o&&s.push((...u)=>this._sendAck(o,u));let a=this._listeners.get(e);if(a)for(let u of a)u(...s);let c=this._socket.listeners?.(e)||[];for(let u of c)u(...s);return}let i=this._listeners.get(e);if(i)for(let s of i)s(t)}_sendAck(e,t){let n=this._adapters.get("rtc");n?.ready&&n.send(xt.control,{event:"__ack",args:t,ackId:e})}_sendSignaling(e){let t=this._adapters.get("ws");if(t?.ready){t.send(xt.control,{event:this._sigEvent(e.type),args:[this._sigData(e)]});return}console.warn("[ProtocolManager] signaling unavailable (ws down)")}_sigEvent(e){return e==="offer"?"webrtc:offer":e==="answer"?"webrtc:answer":e==="ice"?"webrtc:ice-candidate":"webrtc:error"}_sigData(e){return e.type==="offer"||e.type==="answer"?{sdp:e.sdp}:e.type==="ice"?{candidate:e.candidate,mid:e.mid}:e}_installSignalingListeners(){if(!this._rtcSignalingHandler||this._sigListeners)return;let e=({sdp:n})=>this._rtcSignalingHandler?.({type:"offer",sdp:n}),t=({candidate:n,mid:i})=>this._rtcSignalingHandler?.({type:"ice",candidate:n,mid:i});this._sigListeners={onOffer:e,onIce:t},this._socket.on("webrtc:offer",e),this._socket.on("webrtc:ice-candidate",t)}_removeSignalingListeners(){this._sigListeners&&(this._socket.off("webrtc:offer",this._sigListeners.onOffer),this._socket.off("webrtc:ice-candidate",this._sigListeners.onIce),this._sigListeners=null)}};var Ud=new Set;function Jb(r){Ud.add(r)}function ol(r){Ud.delete(r)}function wt(r,e,t){for(let n of Ud)try{n.emit(e,t)}catch{}}bt();var LT=require("path"),DT=require("url");var fl=X(require("net"),1),ae=X(require("fs"),1),pe=X(require("path"),1),rw=X(require("os"),1),nw=require("child_process"),iw=require("url");var Wd={win32:[{id:"cmd",label:"Command Prompt",path:"cmd.exe",args:[]},{id:"powershell",label:"PowerShell",path:"powershell.exe",args:["-NoLogo"]},{id:"pwsh",label:"PowerShell Core",path:"pwsh.exe",args:["-NoLogo"]}],unix:[{id:"bash",label:"Bash",path:"/bin/bash",args:["-l"]},{id:"zsh",label:"Zsh",path:"/bin/zsh",args:["-l"]},{id:"sh",label:"Sh",path:"/bin/sh",args:["-l"]}]};function Qb(){return process.platform==="win32"?Wd.win32:[]}function Zb(r){if(process.platform==="win32"){let n=r?Wd.win32.find(s=>s.id===r):null;if(n)return n;let i=process.env.COMSPEC;return i?{id:"cmd",label:"Command Prompt",path:i,args:[]}:Wd.win32[0]}let e=process.env.SHELL||"/bin/bash",t=e.split("/").pop();return{id:t,label:t,path:e,args:["-l"]}}var zd=pe.default.dirname((0,iw.fileURLToPath)(__importMetaUrl)),fn=pe.default.join(rw.default.homedir(),".9remote"),Ro=process.platform==="win32"?"\\\\.\\pipe\\9remote-pty":pe.default.join(fn,"pty-daemon.sock"),ew=pe.default.join(zd,"ptyDaemon.js"),tw=pe.default.join(zd,"ptyDaemon.cjs"),al=pe.default.join(fn,"daemon");function sw(r,e){if(ae.default.existsSync(r)){ae.default.mkdirSync(e,{recursive:!0});for(let t of ae.default.readdirSync(r,{withFileTypes:!0})){let n=pe.default.join(r,t.name),i=pe.default.join(e,t.name);t.isDirectory()?sw(n,i):t.isFile()&&ae.default.copyFileSync(n,i)}}}function Q2(r,e){let t=r;for(let n=0;n<6;n++){let i=pe.default.join(t,"node_modules",e);if(ae.default.existsSync(i))return i;let s=pe.default.dirname(t);if(s===t)break;t=s}return null}var Z2=r=>Q2(r,"node-pty");function eB(r){try{if(!ae.default.existsSync(al))return;let e=pe.default.join(fn,"pids","ptyDaemon.pid"),t=!1;try{let n=parseInt(ae.default.readFileSync(e,"utf8").trim(),10);if(Number.isFinite(n)&&n>0)try{process.kill(n,0),t=!0}catch{}}catch{}if(t)return;for(let n of ae.default.readdirSync(al))if(n!==`v${r}`)try{ae.default.rmSync(pe.default.join(al,n),{recursive:!0,force:!0})}catch{}}catch{}}function tB(r){eB("17");let e=pe.default.join(al,`v${"17"}`),t=r.endsWith(".js"),n=t?pe.default.join(e,"features","terminal"):e,i=pe.default.join(n,pe.default.basename(r)),s=pe.default.join(n,"node_modules","node-pty");if(ae.default.existsSync(i)&&ae.default.existsSync(s))return{script:i,cwd:n};try{if(ae.default.mkdirSync(n,{recursive:!0}),ae.default.copyFileSync(r,i),t){let a=pe.default.dirname(r);ae.default.copyFileSync(pe.default.join(a,"constants.js"),pe.default.join(n,"constants.js"));let c=pe.default.join(e,"lib");ae.default.mkdirSync(c,{recursive:!0}),ae.default.copyFileSync(pe.default.resolve(a,"..","..","lib","constants.js"),pe.default.join(c,"constants.js"))}let o=Z2(pe.default.dirname(r));return o?(sw(o,s),{script:i,cwd:n}):null}catch{return null}}var Fr=null,hs=!1,Fn=!1,Gd="",rB=0,ms=new Map,cl=new Map;function nB(){return++rB}function dl(r,e){cl.has(r)||cl.set(r,[]),cl.get(r).push(e)}function ul(r,e){let t=cl.get(r);if(t)for(let n of t)try{n(e)}catch(i){console.error(`[DaemonClient] Error in ${r} handler:`,i)}}function Kd(r){if(!Fr||!hs)return!1;try{return Fr.write(JSON.stringify(r)+`
109
+ `),!0}catch(e){return console.error("[DaemonClient] Send error:",e),!1}}function hl(r,e=5e3){return new Promise((t,n)=>{let i=nB();r.requestId=i;let s=setTimeout(()=>{ms.delete(i),n(new Error("Request timeout"))},e);ms.set(i,{resolve:t,reject:n,timer:s}),Kd(r)||(clearTimeout(s),ms.delete(i),n(new Error("Not connected to daemon")))})}function iB(r){let{type:e,requestId:t,...n}=r;if(t&&ms.has(t)){let{resolve:i,timer:s}=ms.get(t);clearTimeout(s),ms.delete(t),i({type:e,...n});return}switch(e){case"output":ul("output",{sessionId:n.sessionId,data:Buffer.from(n.data,"base64")});break;case"sessionClosed":ul("sessionClosed",n.sessionId);break;case"pong":break;default:console.log("[DaemonClient] Unknown message:",e)}}function pl(){return new Promise(r=>{let e=fl.default.connect(Ro),t=setTimeout(()=>{e.destroy(),r(!1)},1e3);e.on("connect",()=>{clearTimeout(t),e.destroy(),r(!0)}),e.on("error",()=>{if(clearTimeout(t),process.platform!=="win32"&&ae.default.existsSync(Ro))try{ae.default.unlinkSync(Ro)}catch{}r(!1)})})}function sB(){ae.default.existsSync(fn)||ae.default.mkdirSync(fn,{recursive:!0});let r=ae.default.existsSync(ew)?ew:ae.default.existsSync(tw)?tw:null;if(!r)return console.error("[DaemonClient] \u274C Daemon script not found"),null;let e=tB(r);return e||{script:r,cwd:zd}}async function oB(){if(!ae.default.existsSync(fn))try{ae.default.mkdirSync(fn,{recursive:!0})}catch(a){return console.error("[DaemonClient] Failed to create socket directory:",a.message),!1}let r=sB();if(!r)return!1;let{script:e,cwd:t}=r,n=pe.default.join(fn,"logs");try{ae.default.mkdirSync(n,{recursive:!0})}catch{}let i=pe.default.join(n,"daemon.log"),s;try{s=ae.default.openSync(i,"w")}catch(a){console.error("[DaemonClient] Failed to open log file:",a.message),s="ignore"}if((0,nw.spawn)("node",[e],{detached:!0,stdio:["ignore",s,s],cwd:t}).unref(),typeof s=="number")try{ae.default.closeSync(s)}catch{}for(let a=0;a<20;a++)if(await new Promise(c=>setTimeout(c,100)),await pl())return!0;console.error("[DaemonClient] \u274C Failed to start daemon");try{let a=ae.default.readFileSync(i,"utf8");a.trim()&&(console.error("[DaemonClient] Daemon log:"),console.error(a))}catch{}return!1}function aB(){return new Promise(r=>{let e=fl.default.connect(Ro),t="",n=s=>{try{e.destroy()}catch{}r(s)},i=setTimeout(()=>n(null),2e3);e.on("connect",()=>e.write(JSON.stringify({type:"ping",requestId:-1})+`
110
110
  `)),e.on("data",s=>{t+=s.toString();let o=t.indexOf(`
111
- `);if(o!==-1){clearTimeout(i);try{let a=JSON.parse(t.slice(0,o));n(a.version||"unknown")}catch{n(null)}}}),e.on("error",()=>{clearTimeout(i),n(null)})})}async function iB(){try{let r=pe.default.join(fn,"pids","ptyDaemon.pid"),e=parseInt(ae.default.readFileSync(r,"utf8").trim(),10);Number.isFinite(e)&&e>0&&process.kill(e,"SIGTERM")}catch{}for(let r=0;r<20;r++){if(!await ul())return;await new Promise(e=>setTimeout(e,100))}}async function iw(){if(!(ds||jn)){jn=!0;try{if(await ul()){let r=await nB();r!=="17"&&(console.log(`[DaemonClient] Daemon v${r} != v${"17"}, restarting`),await iB())}return!await ul()&&!await rB()?(console.error("[DaemonClient] \u274C Failed to start daemon"),jn=!1,!1):new Promise(r=>{let e=setTimeout(()=>{console.error("[DaemonClient] \u274C Connection timeout after 5s"),Fr&&Fr.destroy(),jn=!1,r(!1)},5e3);Fr=pl.default.connect(Ro),Fr.on("connect",()=>{clearTimeout(e),ds=!0,jn=!1,ll("connected"),r(!0)}),Fr.on("data",t=>{Wd+=t.toString();let n=Wd.split(`
112
- `);Wd=n.pop()||"";for(let i of n)if(i.trim())try{eB(JSON.parse(i))}catch{console.error("[DaemonClient] Invalid message:",i)}}),Fr.on("close",()=>{ds=!1,Fr=null,ll("disconnected"),setTimeout(()=>{!ds&&!jn&&iw()},2e3)}),Fr.on("error",t=>{clearTimeout(e),console.error("[DaemonClient] \u274C Connection error:",t.message),console.error("[DaemonClient] Error code:",t.code),jn=!1,r(!1)})})}catch(r){return console.error("[DaemonClient] \u274C Connect error:",r),jn=!1,!1}}}async function sw(){return iw()}function Cr(){return ds}async function hl(){return(await dl({type:"listSessions"})).sessions||[]}async function Kd(r,e=80,t=24,n=null,i=`session-${Date.now()}`,s=null){return await dl({type:"createSession",sessionId:i,name:r,cols:e,rows:t,shellId:n,cwd:s})}async function ow(r){return await dl({type:"joinSession",sessionId:r})}function Vd(r,e){return zd({type:"input",sessionId:r,data:e})}function aw(r,e,t){return zd({type:"resize",sessionId:r,cols:e,rows:t})}async function ui(r){return await dl({type:"deleteSession",sessionId:r})}Pi();var lw=require("child_process");bt();var sB={darwin:()=>({cmd:"caffeinate",args:["-u","-t",String(Z.displayWake.macDurationSec)]}),linux:()=>({cmd:"xset",args:["dpms","force","on"]}),win32:()=>({cmd:"powershell.exe",args:["-NonInteractive","-NoProfile","-WindowStyle","Hidden","-Command",`Add-Type -Name K -Namespace W -MemberDefinition '[System.Runtime.InteropServices.DllImport("kernel32")]public static extern uint SetThreadExecutionState(uint e);'; [void][W.K]::SetThreadExecutionState(0x80000003)`]})},cw=0;function uw(){let r=Z.displayWake;if(!r?.enabled)return;let e=Date.now();if(e-cw<r.throttleMs)return;cw=e;let t=sB[process.platform];if(t)try{let{cmd:n,args:i}=t(),s=(0,lw.spawn)(n,i,{detached:!0,stdio:"ignore",windowsHide:!0});s.on("error",()=>{}),s.unref()}catch{}}var yS=An("remote"),mn=null;function DB(){return process.env.CODESPACES==="true"||process.env.GITPOD_WORKSPACE_ID||process.platform==="linux"&&!process.env.DISPLAY}async function ES(){if(mn!==null)return mn;if(DB())return mn=!1,yS.info("\u2705 Remote desktop not available (headless environment)"),mn;try{let r=await import("@hurdlegroup/robotjs");(r.default||r).getScreenSize(),mn=!0}catch{mn=!1,yS.info("\u2705 Remote desktop not available (no display or robotjs not installed)")}return mn}function TS(){return mn===!0}var di=null,CS=null,AS=null,RS=null,kS=null,OS=null,PS=null,hn=null,_S=null,bS=null,wS=null,SS=null;async function BB(){if(di)return!0;try{let r=await import("@hurdlegroup/robotjs");di=r.default||r;let{TileManager:e}=await Promise.resolve().then(()=>(lS(),cS)),{ResourceManager:t}=await Promise.resolve().then(()=>(pS(),uS)),{ScreenUpdateHelper:n}=await Promise.resolve().then(()=>(dS(),fS)),{MouseHandler:i}=await Promise.resolve().then(()=>(mS(),hS)),{KeyboardHandler:s}=await Promise.resolve().then(()=>(xS(),vS)),{ScreenHandler:o}=await Promise.resolve().then(()=>($d(),Vb));return CS=e,AS=t,RS=n,kS=i,OS=s,PS=o,di.setMouseDelay(2),di.setKeyboardDelay(2),!0}catch(r){return console.error("\u274C Failed to load remote modules:",r.message),!1}}async function MS(r,e){if(!mn){r.emit("remote:unavailable");return}if(!await BB()){r.emit("remote:unavailable");return}hn||(hn=new AS,_S=new RS(hn),bS=new kS(di,hn),wS=new OS(di,hn),SS=new PS(hn,_S),hn.startResourceMonitoring());let n=r.handshake.auth?.apiKey,i=new CS(di);hn.addClient(r.id,{tileManager:i,screenInterval:null,authenticated:!0,apiKey:n});let s=r.data.protocol;if(!s){r.emit("remote:unavailable");return}r.data.remoteAttached=!0;let o=a=>(...c)=>(uw(),a(...c));bS.setupMouseHandlers(r,o),wS.setupKeyboardHandlers(r,o),SS.setupScreenHandlers(r,o,s),r.on("disconnect",()=>{let a=()=>{hn.removeClient(r.id),s.close(),sl(s)},c=s._adapters?.get("rtc");if(!c?.ready)return a();c.on("stateChange",u=>{u===ft.closed&&a()})}),r.emit("remote:ready")}fi();var $n=X(require("fs"),1),bh=X(require("path"),1),Ml=0,$o=null,jB=6e4,FB={name:"9Remote",postCreateCommand:"npm install -g 9remote@latest",postAttachCommand:"9remote start",forwardPorts:[2208],portsAttributes:{2208:{label:"9Remote Server",onAutoForward:"notify"}}};function gn(){return process.env.CODESPACES==="true"}function IS(){return gn()?{isCodespaces:!0,codespaceName:process.env.CODESPACE_NAME||"unknown",workspacePath:process.env.CODESPACE_VSCODE_FOLDER||process.cwd()}:null}function NS(){Ml++,gn()&&Ml===1&&HB()}function LS(){Ml--,gn()&&Ml===0&&$B()}function HB(){$o||($o=setInterval(()=>{process.memoryUsage()},jB))}function $B(){$o&&(console.log("\u23F8\uFE0F Stopping Codespaces heartbeat"),clearInterval($o),$o=null)}function DS(r){return bh.default.join(r,".devcontainer","devcontainer.json")}function BS(r){try{let e=DS(r);if(!$n.default.existsSync(e))return{enabled:!1,exists:!1};let t=JSON.parse($n.default.readFileSync(e,"utf8"));return{enabled:t.postAttachCommand==="9remote start"||t.postAttachCommand==="9remote",exists:!0}}catch{return{enabled:!1,exists:!1,error:"Failed to read config"}}}function jS(r,e){try{let t=bh.default.join(r,".devcontainer"),n=DS(r);$n.default.existsSync(t)||$n.default.mkdirSync(t,{recursive:!0});let i={...FB};if($n.default.existsSync(n))try{i={...JSON.parse($n.default.readFileSync(n,"utf8"))}}catch{}return e?(i.postAttachCommand="9remote start",i.postCreateCommand||(i.postCreateCommand="npm install -g 9remote@latest")):delete i.postAttachCommand,$n.default.writeFileSync(n,JSON.stringify(i,null,2)),{success:!0,enabled:e}}catch(t){return{success:!1,error:t.message}}}var Il=X(require("os"),1),Re=X(require("fs"),1),qn=X(require("path"),1);gt();var _s=oe.BUFFERS,Nl=qn.default.join(oe.STATE,"sessions.json"),Ll=qn.default.join(oe.STATE,"terminalGroups.json"),Dl="/tmp/9remote-uploads";Re.default.existsSync(Dl)||Re.default.mkdirSync(Dl,{recursive:!0});function wh(){return process.platform==="win32"?process.env.COMSPEC||"powershell.exe":process.env.SHELL||"/bin/zsh"}function Sh(r){return r?"/workspaces":Il.default.homedir()}function Eh(){let r=Il.default.homedir(),e=Il.default.userInfo().username,t=wh(),n={...process.env};if(Object.assign(n,{HOME:r,USER:e,LOGNAME:e,SHELL:t,TERM:"xterm-256color",COLORTERM:"truecolor",LANG:"en_US.UTF-8",LC_ALL:"en_US.UTF-8",LC_CTYPE:"en_US.UTF-8",PWD:r,OLDPWD:r,TMPDIR:n.TMPDIR||(process.platform==="win32"?n.TEMP||n.TMP:"/tmp"),__CF_USER_TEXT_ENCODING:n.__CF_USER_TEXT_ENCODING,XPC_FLAGS:n.XPC_FLAGS,XPC_SERVICE_NAME:n.XPC_SERVICE_NAME,SSH_AUTH_SOCK:n.SSH_AUTH_SOCK,TERM_PROGRAM:"9Remote",TERM_PROGRAM_VERSION:"1.0.0",ITERM_SESSION_ID:`9remote-${Date.now()}`,SHLVL:"1"}),t.includes("bash")){let i=n.PROMPT_COMMAND||"";n.PROMPT_COMMAND=`printf "\\e]7;file://%s\\a" "\${HOSTNAME}\${PWD}"${i?`; ${i}`:""}`}return n}function FS(){Re.default.existsSync(_s)||Re.default.mkdirSync(_s,{recursive:!0})}function Th(r,e,t){if(t==="buffer"){FS();try{Re.default.writeFileSync(qn.default.join(_s,`${r}.buf`),e.join(""),"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to save buffer for ${r}:`,n.message)}}}function HS(r,e){if(e!=="buffer")return null;let t=qn.default.join(_s,`${r}.buf`);try{if(Re.default.existsSync(t))return Re.default.readFileSync(t,"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to load buffer for ${r}:`,n.message)}return null}function Bl(r){let e=qn.default.join(_s,`${r}.buf`);try{Re.default.existsSync(e)&&Re.default.unlinkSync(e)}catch{}}function $S(){FS();try{return Re.default.readdirSync(_s).filter(r=>r.endsWith(".buf")).map(r=>r.replace(".buf",""))}catch{return[]}}function Ch(){try{if(Re.default.existsSync(Nl))return JSON.parse(Re.default.readFileSync(Nl,"utf8"))}catch(r){console.log("\u26A0\uFE0F Failed to load session metadata:",r.message)}return{}}function vn(r){try{let e={};for(let[n,i]of r)e[n]={name:i.name,createdAt:i.createdAt,shellId:i.shellId,cwd:i.cwd};let t=qn.default.dirname(Nl);Re.default.existsSync(t)||Re.default.mkdirSync(t,{recursive:!0}),Re.default.writeFileSync(Nl,JSON.stringify(e,null,2),"utf8")}catch(e){console.log("\u26A0\uFE0F Failed to save session metadata:",e.message)}}function qS(){try{if(Re.default.existsSync(Ll)){let r=JSON.parse(Re.default.readFileSync(Ll,"utf8"));return{groups:r.groups||[],sessionGroups:r.sessionGroups||{}}}}catch(r){console.log("\u26A0\uFE0F Failed to load groups:",r.message)}return{groups:[],sessionGroups:{}}}function US(r,e){try{let t=qn.default.dirname(Ll);Re.default.existsSync(t)||Re.default.mkdirSync(t,{recursive:!0});let n={groups:Array.from(r.values()),sessionGroups:e};Re.default.writeFileSync(Ll,JSON.stringify(n,null,2),"utf8")}catch(t){console.log("\u26A0\uFE0F Failed to save groups:",t.message)}}var Ah=X(require("node-pty"),1);var WS=2*1024*1024,hi="daemon";function GS(r,e,t,n,i){let s=null;r.onData(o=>{t.buffer.push(o),t.buffer.reduce((c,u)=>c+u.length,0)>WS&&(t.buffer=[t.buffer.join("").slice(-WS)]),wt(n,"output",{sessionId:e,data:Buffer.from(o,"utf-8")}),hi==="buffer"&&(s&&clearTimeout(s),s=setTimeout(()=>Th(e,t.buffer,hi),2e3))}),r.onExit(({exitCode:o})=>{console.log(`PTY exited: sessionId=${e}, code=${o}`),hi==="buffer"&&t.buffer.length>0&&Th(e,t.buffer,hi),i.delete(e),Bl(e),wt(n,"sessionClosed",e)})}function zS(r,e,t,n,i){let s=()=>US(n,i);r.on("getSessions",o=>{let a=[];for(let[c,u]of t)a.push({id:c,name:u.name,createdAt:u.createdAt,restored:u.restored||!1,shellId:u.shellId,shellLabel:u.shellLabel,groupId:i[c]||null});o(a)}),r.on("getShells",o=>{o({platform:process.platform,shells:Xb()})}),r.on("getGroups",o=>{o(Array.from(n.values()))}),r.on("createGroup",({name:o},a)=>{let c=`group-${Date.now()}`,u={id:c,name:o||"Group",createdAt:Date.now()};n.set(c,u),s(),wt(e,"groupsChanged"),a({success:!0,group:u})}),r.on("renameGroup",({groupId:o,name:a},c)=>{let u=n.get(o);if(!u)return c({success:!1,error:"Group not found"});u.name=a,s(),wt(e,"groupsChanged"),c({success:!0})}),r.on("deleteGroup",async({groupId:o},a)=>{if(!n.delete(o))return a({success:!1,error:"Group not found"});let c=Object.keys(i).filter(u=>i[u]===o);for(let u of c){let p=t.get(u);if(p){if(p.daemon&&Cr())try{await ui(u)}catch{}else p.pty&&(p.pty.kill(),Bl(u));t.delete(u),wt(e,"sessionClosed",u)}delete i[u]}s(),wt(e,"groupsChanged"),a({success:!0})}),r.on("moveSession",({sessionId:o,groupId:a},c)=>{a&&n.has(a)?i[o]=a:delete i[o],s(),wt(e,"groupsChanged"),c({success:!0})}),r.on("createSession",async({name:o,shellId:a,groupId:c},u)=>{let p=`session-${Date.now()}`,f=Jb(a),m=Eh();m.NINE_REMOTE_SESSION_ID=p;let y=Sh(gn());try{let _=o||`${f.label} ${t.size+1}`;if(hi==="daemon"&&Cr()){let P=await Kd(_,80,24,a,p,y);P.success?(t.set(P.sessionId,{daemon:!0,name:_,createdAt:Date.now(),cwd:P.cwd,shellId:P.shellId,shellLabel:P.shellLabel}),c&&n.has(c)&&(i[P.sessionId]=c,s()),vn(t),u({success:!0,sessionId:P.sessionId,shellLabel:P.shellLabel})):u({success:!1,error:P.error});return}let S=Ah.default.spawn(f.path,f.args,{name:"xterm-256color",cols:80,rows:24,cwd:y,env:m,useConpty:!1}),A={pty:S,name:_,createdAt:Date.now(),buffer:[],cwd:y,shellId:f.id,shellLabel:f.label};GS(S,p,A,e,t),t.set(p,A),c&&n.has(c)&&(i[p]=c,s()),u({success:!0,sessionId:p,shellLabel:f.label})}catch(_){console.error("Failed to create session:",_),u({success:!1,error:_.message})}}),r.on("joinSession",async(o,a)=>{let c=t.get(o);if(!c)return a({success:!1,error:"Session not found"});if(c.daemon&&Cr()){try{if(c.needsRespawn){let p=await Kd(c.name,80,24,c.shellId,o,c.cwd);if(!p.success)return a({success:!1,error:p.error});delete c.needsRespawn,c.cwd=p.cwd,c.shellLabel=p.shellLabel,vn(t)}let u=await ow(o);u.cwd&&u.cwd!==c.cwd&&(c.cwd=u.cwd,vn(t)),a({success:u.success,name:c.name,cwd:u.cwd||c.cwd,error:u.error})}catch(u){a({success:!1,error:u.message})}return}if(c.needsRestore&&hi==="buffer")try{let u=wh(),p=process.platform==="win32"?[]:["-l"],f=Sh(gn()),m=Ah.default.spawn(u,p,{name:"xterm-256color",cols:80,rows:24,cwd:f,env:Eh(),useConpty:!1});c.pty=m,c.needsRestore=!1,c.cwd=f;let y=HS(o,hi);y&&(c.buffer=[y]),GS(m,o,c,e,t),console.log(`\u2705 Restored PTY session: ${o}`)}catch(u){return console.error("Failed to restore session:",u),a({success:!1,error:"Failed to restore session"})}c.buffer?.length>0&&r.emit("output",{sessionId:o,data:Buffer.from(c.buffer.join(""),"utf-8")}),a({success:!0,name:c.name,cwd:c.cwd})}),r.on("deleteSession",async(o,a)=>{let c=t.get(o);if(!c)return a({success:!1,error:"Session not found"});if(c.daemon&&Cr()){try{await ui(o),t.delete(o),i[o]&&(delete i[o],s()),vn(t),a({success:!0})}catch(u){a({success:!1,error:u.message})}return}c.pty&&c.pty.kill(),t.delete(o),i[o]&&(delete i[o],s()),Bl(o),wt(e,"sessionClosed",o),vn(t),a({success:!0})}),r.on("renameSession",async({sessionId:o,name:a},c)=>{let u=t.get(o);if(!u)return c({success:!1,error:"Session not found"});u.name=a,wt(e,"session-renamed",{sessionId:o,name:a}),vn(t),c({success:!0})})}var KS=X(require("fs"),1),VS=X(require("path"),1);function YS(r,e){r.on("input",({sessionId:t,data:n})=>{if(!t)return;let i=e.get(t);if(i){if(i.daemon&&Cr())return Vd(t,n);i.pty&&i.pty.write(Buffer.isBuffer(n)?n.toString("utf-8"):n)}}),r.on("resize",({sessionId:t,cols:n,rows:i})=>{if(!t)return;let s=e.get(t);if(s){if(s.daemon&&Cr())return aw(t,n,i);if(s.pty)try{s.pty.resize(n,i)}catch(o){console.log(`Resize failed for ${t}: ${o.message}`)}}}),r.on("upload-file",({sessionId:t,filename:n,size:i,content:s})=>{if(!t)return;let o=e.get(t);if(o)try{let a=n.replace(/[^a-zA-Z0-9._-]/g,"_"),c=VS.default.join(Dl,`${Date.now()}_${a}`);KS.default.writeFileSync(c,Buffer.from(s,"base64")),console.log(`\u{1F4CE} File uploaded: ${c} (${i} bytes)`),o.daemon&&Cr()?Vd(t,c):o.pty&&o.pty.write(c)}catch(a){console.error("File upload error:",a),r.emit("output",{sessionId:t,data:Buffer.from(`\r
111
+ `);if(o!==-1){clearTimeout(i);try{let a=JSON.parse(t.slice(0,o));n(a.version||"unknown")}catch{n(null)}}}),e.on("error",()=>{clearTimeout(i),n(null)})})}async function cB(){try{let r=pe.default.join(fn,"pids","ptyDaemon.pid"),e=parseInt(ae.default.readFileSync(r,"utf8").trim(),10);Number.isFinite(e)&&e>0&&process.kill(e,"SIGTERM")}catch{}for(let r=0;r<20;r++){if(!await pl())return;await new Promise(e=>setTimeout(e,100))}}async function ow(){if(!(hs||Fn)){Fn=!0;try{if(await pl()){let r=await aB();r!=="17"&&(console.log(`[DaemonClient] Daemon v${r} != v${"17"}, restarting`),await cB())}return!await pl()&&!await oB()?(console.error("[DaemonClient] \u274C Failed to start daemon"),Fn=!1,!1):new Promise(r=>{let e=setTimeout(()=>{console.error("[DaemonClient] \u274C Connection timeout after 5s"),Fr&&Fr.destroy(),Fn=!1,r(!1)},5e3);Fr=fl.default.connect(Ro),Fr.on("connect",()=>{clearTimeout(e),hs=!0,Fn=!1,ul("connected"),r(!0)}),Fr.on("data",t=>{Gd+=t.toString();let n=Gd.split(`
112
+ `);Gd=n.pop()||"";for(let i of n)if(i.trim())try{iB(JSON.parse(i))}catch{console.error("[DaemonClient] Invalid message:",i)}}),Fr.on("close",()=>{hs=!1,Fr=null,ul("disconnected"),setTimeout(()=>{!hs&&!Fn&&ow()},2e3)}),Fr.on("error",t=>{clearTimeout(e),console.error("[DaemonClient] \u274C Connection error:",t.message),console.error("[DaemonClient] Error code:",t.code),Fn=!1,r(!1)})})}catch(r){return console.error("[DaemonClient] \u274C Connect error:",r),Fn=!1,!1}}}async function aw(){return ow()}function Cr(){return hs}async function ml(){return(await hl({type:"listSessions"})).sessions||[]}async function Vd(r,e=80,t=24,n=null,i=`session-${Date.now()}`,s=null){return await hl({type:"createSession",sessionId:i,name:r,cols:e,rows:t,shellId:n,cwd:s})}async function cw(r){return await hl({type:"joinSession",sessionId:r})}function Yd(r,e){return Kd({type:"input",sessionId:r,data:e})}function lw(r,e,t){return Kd({type:"resize",sessionId:r,cols:e,rows:t})}async function fi(r){return await hl({type:"deleteSession",sessionId:r})}Mi();var pw=require("child_process");bt();var lB={darwin:()=>({cmd:"caffeinate",args:["-u","-t",String(Z.displayWake.macDurationSec)]}),linux:()=>({cmd:"xset",args:["dpms","force","on"]}),win32:()=>({cmd:"powershell.exe",args:["-NonInteractive","-NoProfile","-WindowStyle","Hidden","-Command",`Add-Type -Name K -Namespace W -MemberDefinition '[System.Runtime.InteropServices.DllImport("kernel32")]public static extern uint SetThreadExecutionState(uint e);'; [void][W.K]::SetThreadExecutionState(0x80000003)`]})},uw=0;function fw(){let r=Z.displayWake;if(!r?.enabled)return;let e=Date.now();if(e-uw<r.throttleMs)return;uw=e;let t=lB[process.platform];if(t)try{let{cmd:n,args:i}=t(),s=(0,pw.spawn)(n,i,{detached:!0,stdio:"ignore",windowsHide:!0});s.on("error",()=>{}),s.unref()}catch{}}var wS=Rn("remote"),gn=null;function HB(){return process.env.CODESPACES==="true"||process.env.GITPOD_WORKSPACE_ID||process.platform==="linux"&&!process.env.DISPLAY}async function AS(){if(gn!==null)return gn;if(HB())return gn=!1,wS.info("\u2705 Remote desktop not available (headless environment)"),gn;try{let r=await import("@hurdlegroup/robotjs");(r.default||r).getScreenSize(),gn=!0}catch{gn=!1,wS.info("\u2705 Remote desktop not available (no display or robotjs not installed)")}return gn}function RS(){return gn===!0}var hi=null,kS=null,OS=null,PS=null,MS=null,IS=null,NS=null,mn=null,SS=null,ES=null,TS=null,CS=null;async function $B(){if(hi)return!0;try{let r=await import("@hurdlegroup/robotjs");hi=r.default||r;let{TileManager:e}=await Promise.resolve().then(()=>(fS(),pS)),{ResourceManager:t}=await Promise.resolve().then(()=>(hS(),dS)),{ScreenUpdateHelper:n}=await Promise.resolve().then(()=>(gS(),mS)),{MouseHandler:i}=await Promise.resolve().then(()=>(xS(),vS)),{KeyboardHandler:s}=await Promise.resolve().then(()=>(bS(),_S)),{ScreenHandler:o}=await Promise.resolve().then(()=>(qd(),Xb));return kS=e,OS=t,PS=n,MS=i,IS=s,NS=o,hi.setMouseDelay(2),hi.setKeyboardDelay(2),!0}catch(r){return console.error("\u274C Failed to load remote modules:",r.message),!1}}async function LS(r,e){if(!gn){r.emit("remote:unavailable");return}if(!await $B()){r.emit("remote:unavailable");return}mn||(mn=new OS,SS=new PS(mn),ES=new MS(hi,mn),TS=new IS(hi,mn),CS=new NS(mn,SS),mn.startResourceMonitoring());let n=r.handshake.auth?.apiKey,i=new kS(hi);mn.addClient(r.id,{tileManager:i,screenInterval:null,authenticated:!0,apiKey:n});let s=r.data.protocol;if(!s){r.emit("remote:unavailable");return}r.data.remoteAttached=!0;let o=a=>(...c)=>(fw(),a(...c));ES.setupMouseHandlers(r,o),TS.setupKeyboardHandlers(r,o),CS.setupScreenHandlers(r,o,s),r.on("disconnect",()=>{let a=()=>{mn.removeClient(r.id),s.close(),ol(s)},c=s._adapters?.get("rtc");if(!c?.ready)return a();c.on("stateChange",u=>{u===dt.closed&&a()})}),r.emit("remote:ready")}$n();var qn=X(require("fs"),1),wh=X(require("path"),1),Ml=0,qo=null,qB=6e4,UB={name:"9Remote",postCreateCommand:"npm install -g 9remote@latest",postAttachCommand:"9remote start",forwardPorts:[2208],portsAttributes:{2208:{label:"9Remote Server",onAutoForward:"notify"}}};function vn(){return process.env.CODESPACES==="true"}function DS(){return vn()?{isCodespaces:!0,codespaceName:process.env.CODESPACE_NAME||"unknown",workspacePath:process.env.CODESPACE_VSCODE_FOLDER||process.cwd()}:null}function BS(){Ml++,vn()&&Ml===1&&WB()}function jS(){Ml--,vn()&&Ml===0&&GB()}function WB(){qo||(qo=setInterval(()=>{process.memoryUsage()},qB))}function GB(){qo&&(console.log("\u23F8\uFE0F Stopping Codespaces heartbeat"),clearInterval(qo),qo=null)}function FS(r){return wh.default.join(r,".devcontainer","devcontainer.json")}function HS(r){try{let e=FS(r);if(!qn.default.existsSync(e))return{enabled:!1,exists:!1};let t=JSON.parse(qn.default.readFileSync(e,"utf8"));return{enabled:t.postAttachCommand==="9remote start"||t.postAttachCommand==="9remote",exists:!0}}catch{return{enabled:!1,exists:!1,error:"Failed to read config"}}}function $S(r,e){try{let t=wh.default.join(r,".devcontainer"),n=FS(r);qn.default.existsSync(t)||qn.default.mkdirSync(t,{recursive:!0});let i={...UB};if(qn.default.existsSync(n))try{i={...JSON.parse(qn.default.readFileSync(n,"utf8"))}}catch{}return e?(i.postAttachCommand="9remote start",i.postCreateCommand||(i.postCreateCommand="npm install -g 9remote@latest")):delete i.postAttachCommand,qn.default.writeFileSync(n,JSON.stringify(i,null,2)),{success:!0,enabled:e}}catch(t){return{success:!1,error:t.message}}}var Il=X(require("os"),1),ke=X(require("fs"),1),Un=X(require("path"),1);vt();var bs=oe.BUFFERS,Nl=Un.default.join(oe.STATE,"sessions.json"),Ll=Un.default.join(oe.STATE,"terminalGroups.json"),Dl="/tmp/9remote-uploads";ke.default.existsSync(Dl)||ke.default.mkdirSync(Dl,{recursive:!0});function Sh(){return process.platform==="win32"?process.env.COMSPEC||"powershell.exe":process.env.SHELL||"/bin/zsh"}function Eh(r){return r?"/workspaces":Il.default.homedir()}function Th(){let r=Il.default.homedir(),e=Il.default.userInfo().username,t=Sh(),n={...process.env};if(Object.assign(n,{HOME:r,USER:e,LOGNAME:e,SHELL:t,TERM:"xterm-256color",COLORTERM:"truecolor",LANG:"en_US.UTF-8",LC_ALL:"en_US.UTF-8",LC_CTYPE:"en_US.UTF-8",PWD:r,OLDPWD:r,TMPDIR:n.TMPDIR||(process.platform==="win32"?n.TEMP||n.TMP:"/tmp"),__CF_USER_TEXT_ENCODING:n.__CF_USER_TEXT_ENCODING,XPC_FLAGS:n.XPC_FLAGS,XPC_SERVICE_NAME:n.XPC_SERVICE_NAME,SSH_AUTH_SOCK:n.SSH_AUTH_SOCK,TERM_PROGRAM:"9Remote",TERM_PROGRAM_VERSION:"1.0.0",ITERM_SESSION_ID:`9remote-${Date.now()}`,SHLVL:"1"}),t.includes("bash")){let i=n.PROMPT_COMMAND||"";n.PROMPT_COMMAND=`printf "\\e]7;file://%s\\a" "\${HOSTNAME}\${PWD}"${i?`; ${i}`:""}`}return n}function qS(){ke.default.existsSync(bs)||ke.default.mkdirSync(bs,{recursive:!0})}function Ch(r,e,t){if(t==="buffer"){qS();try{ke.default.writeFileSync(Un.default.join(bs,`${r}.buf`),e.join(""),"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to save buffer for ${r}:`,n.message)}}}function US(r,e){if(e!=="buffer")return null;let t=Un.default.join(bs,`${r}.buf`);try{if(ke.default.existsSync(t))return ke.default.readFileSync(t,"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to load buffer for ${r}:`,n.message)}return null}function Bl(r){let e=Un.default.join(bs,`${r}.buf`);try{ke.default.existsSync(e)&&ke.default.unlinkSync(e)}catch{}}function WS(){qS();try{return ke.default.readdirSync(bs).filter(r=>r.endsWith(".buf")).map(r=>r.replace(".buf",""))}catch{return[]}}function Ah(){try{if(ke.default.existsSync(Nl))return JSON.parse(ke.default.readFileSync(Nl,"utf8"))}catch(r){console.log("\u26A0\uFE0F Failed to load session metadata:",r.message)}return{}}function xn(r){try{let e={};for(let[n,i]of r)e[n]={name:i.name,createdAt:i.createdAt,shellId:i.shellId,cwd:i.cwd};let t=Un.default.dirname(Nl);ke.default.existsSync(t)||ke.default.mkdirSync(t,{recursive:!0}),ke.default.writeFileSync(Nl,JSON.stringify(e,null,2),"utf8")}catch(e){console.log("\u26A0\uFE0F Failed to save session metadata:",e.message)}}function GS(){try{if(ke.default.existsSync(Ll)){let r=JSON.parse(ke.default.readFileSync(Ll,"utf8"));return{groups:r.groups||[],sessionGroups:r.sessionGroups||{}}}}catch(r){console.log("\u26A0\uFE0F Failed to load groups:",r.message)}return{groups:[],sessionGroups:{}}}function zS(r,e){try{let t=Un.default.dirname(Ll);ke.default.existsSync(t)||ke.default.mkdirSync(t,{recursive:!0});let n={groups:Array.from(r.values()),sessionGroups:e};ke.default.writeFileSync(Ll,JSON.stringify(n,null,2),"utf8")}catch(t){console.log("\u26A0\uFE0F Failed to save groups:",t.message)}}var Rh=X(require("node-pty"),1);var KS=2*1024*1024,mi="daemon";function VS(r,e,t,n,i){let s=null;r.onData(o=>{t.buffer.push(o),t.buffer.reduce((c,u)=>c+u.length,0)>KS&&(t.buffer=[t.buffer.join("").slice(-KS)]),wt(n,"output",{sessionId:e,data:Buffer.from(o,"utf-8")}),mi==="buffer"&&(s&&clearTimeout(s),s=setTimeout(()=>Ch(e,t.buffer,mi),2e3))}),r.onExit(({exitCode:o})=>{console.log(`PTY exited: sessionId=${e}, code=${o}`),mi==="buffer"&&t.buffer.length>0&&Ch(e,t.buffer,mi),i.delete(e),Bl(e),wt(n,"sessionClosed",e)})}function YS(r,e,t,n,i){let s=()=>zS(n,i);r.on("getSessions",o=>{let a=[];for(let[c,u]of t)a.push({id:c,name:u.name,createdAt:u.createdAt,restored:u.restored||!1,shellId:u.shellId,shellLabel:u.shellLabel,groupId:i[c]||null});o(a)}),r.on("getShells",o=>{o({platform:process.platform,shells:Qb()})}),r.on("getGroups",o=>{o(Array.from(n.values()))}),r.on("createGroup",({name:o},a)=>{let c=`group-${Date.now()}`,u={id:c,name:o||"Group",createdAt:Date.now()};n.set(c,u),s(),wt(e,"groupsChanged"),a({success:!0,group:u})}),r.on("renameGroup",({groupId:o,name:a},c)=>{let u=n.get(o);if(!u)return c({success:!1,error:"Group not found"});u.name=a,s(),wt(e,"groupsChanged"),c({success:!0})}),r.on("deleteGroup",async({groupId:o},a)=>{if(!n.delete(o))return a({success:!1,error:"Group not found"});let c=Object.keys(i).filter(u=>i[u]===o);for(let u of c){let p=t.get(u);if(p){if(p.daemon&&Cr())try{await fi(u)}catch{}else p.pty&&(p.pty.kill(),Bl(u));t.delete(u),wt(e,"sessionClosed",u)}delete i[u]}s(),wt(e,"groupsChanged"),a({success:!0})}),r.on("moveSession",({sessionId:o,groupId:a},c)=>{a&&n.has(a)?i[o]=a:delete i[o],s(),wt(e,"groupsChanged"),c({success:!0})}),r.on("createSession",async({name:o,shellId:a,groupId:c},u)=>{let p=`session-${Date.now()}`,f=Zb(a),m=Th();m.NINE_REMOTE_SESSION_ID=p;let y=Eh(vn());try{let _=o||`${f.label} ${t.size+1}`;if(mi==="daemon"&&Cr()){let P=await Vd(_,80,24,a,p,y);P.success?(t.set(P.sessionId,{daemon:!0,name:_,createdAt:Date.now(),cwd:P.cwd,shellId:P.shellId,shellLabel:P.shellLabel}),c&&n.has(c)&&(i[P.sessionId]=c,s()),xn(t),u({success:!0,sessionId:P.sessionId,shellLabel:P.shellLabel})):u({success:!1,error:P.error});return}let S=Rh.default.spawn(f.path,f.args,{name:"xterm-256color",cols:80,rows:24,cwd:y,env:m,useConpty:!1}),A={pty:S,name:_,createdAt:Date.now(),buffer:[],cwd:y,shellId:f.id,shellLabel:f.label};VS(S,p,A,e,t),t.set(p,A),c&&n.has(c)&&(i[p]=c,s()),u({success:!0,sessionId:p,shellLabel:f.label})}catch(_){console.error("Failed to create session:",_),u({success:!1,error:_.message})}}),r.on("joinSession",async(o,a)=>{let c=t.get(o);if(!c)return a({success:!1,error:"Session not found"});if(c.daemon&&Cr()){try{if(c.needsRespawn){let p=await Vd(c.name,80,24,c.shellId,o,c.cwd);if(!p.success)return a({success:!1,error:p.error});delete c.needsRespawn,c.cwd=p.cwd,c.shellLabel=p.shellLabel,xn(t)}let u=await cw(o);u.cwd&&u.cwd!==c.cwd&&(c.cwd=u.cwd,xn(t)),a({success:u.success,name:c.name,cwd:u.cwd||c.cwd,error:u.error})}catch(u){a({success:!1,error:u.message})}return}if(c.needsRestore&&mi==="buffer")try{let u=Sh(),p=process.platform==="win32"?[]:["-l"],f=Eh(vn()),m=Rh.default.spawn(u,p,{name:"xterm-256color",cols:80,rows:24,cwd:f,env:Th(),useConpty:!1});c.pty=m,c.needsRestore=!1,c.cwd=f;let y=US(o,mi);y&&(c.buffer=[y]),VS(m,o,c,e,t),console.log(`\u2705 Restored PTY session: ${o}`)}catch(u){return console.error("Failed to restore session:",u),a({success:!1,error:"Failed to restore session"})}c.buffer?.length>0&&r.emit("output",{sessionId:o,data:Buffer.from(c.buffer.join(""),"utf-8")}),a({success:!0,name:c.name,cwd:c.cwd})}),r.on("deleteSession",async(o,a)=>{let c=t.get(o);if(!c)return a({success:!1,error:"Session not found"});if(c.daemon&&Cr()){try{await fi(o),t.delete(o),i[o]&&(delete i[o],s()),xn(t),a({success:!0})}catch(u){a({success:!1,error:u.message})}return}c.pty&&c.pty.kill(),t.delete(o),i[o]&&(delete i[o],s()),Bl(o),wt(e,"sessionClosed",o),xn(t),a({success:!0})}),r.on("renameSession",async({sessionId:o,name:a},c)=>{let u=t.get(o);if(!u)return c({success:!1,error:"Session not found"});u.name=a,wt(e,"session-renamed",{sessionId:o,name:a}),xn(t),c({success:!0})})}var XS=X(require("fs"),1),JS=X(require("path"),1);function QS(r,e){r.on("input",({sessionId:t,data:n})=>{if(!t)return;let i=e.get(t);if(i){if(i.daemon&&Cr())return Yd(t,n);i.pty&&i.pty.write(Buffer.isBuffer(n)?n.toString("utf-8"):n)}}),r.on("resize",({sessionId:t,cols:n,rows:i})=>{if(!t)return;let s=e.get(t);if(s){if(s.daemon&&Cr())return lw(t,n,i);if(s.pty)try{s.pty.resize(n,i)}catch(o){console.log(`Resize failed for ${t}: ${o.message}`)}}}),r.on("upload-file",({sessionId:t,filename:n,size:i,content:s})=>{if(!t)return;let o=e.get(t);if(o)try{let a=n.replace(/[^a-zA-Z0-9._-]/g,"_"),c=JS.default.join(Dl,`${Date.now()}_${a}`);XS.default.writeFileSync(c,Buffer.from(s,"base64")),console.log(`\u{1F4CE} File uploaded: ${c} (${i} bytes)`),o.daemon&&Cr()?Yd(t,c):o.pty&&o.pty.write(c)}catch(a){console.error("File upload error:",a),r.emit("output",{sessionId:t,data:Buffer.from(`\r
113
113
  Error uploading file: ${a.message}\r
114
- `,"utf-8")})}})}var Or=X(require("fs"),1),Xo=X(require("path"),1),cu=X(fT(),1);gt();var lu=Xo.default.join(oe.CONFIG,"vapid.json"),uu=Xo.default.join(oe.CONFIG,"push-subscriptions.json"),zG=1800*1e3,Pt=[];function GF(){try{if(Or.default.existsSync(lu))return JSON.parse(Or.default.readFileSync(lu,"utf8"))}catch{}return null}function zF(r){let e=Xo.default.dirname(lu);Or.default.existsSync(e)||Or.default.mkdirSync(e,{recursive:!0}),Or.default.writeFileSync(lu,JSON.stringify(r,null,2),"utf8")}function KF(){let r=GF();if(!r){let e=cu.default.generateVAPIDKeys();r={publicKey:e.publicKey,privateKey:e.privateKey},zF(r)}return cu.default.setVapidDetails("mailto:admin@9remote.cc",r.publicKey,r.privateKey),r}function VF(){try{Or.default.existsSync(uu)&&(Pt=JSON.parse(Or.default.readFileSync(uu,"utf8")))}catch{Pt=[]}}function Jo(){try{let r=Xo.default.dirname(uu);Or.default.existsSync(r)||Or.default.mkdirSync(r,{recursive:!0}),Or.default.writeFileSync(uu,JSON.stringify(Pt,null,2),"utf8")}catch(r){console.error("Failed to save push subscriptions:",r.message)}}function Ns(r){return r.type==="expo"?r.token:r.endpoint}function dT(r,e){let t=Ns(r);Pt=Pt.filter(n=>Ns(n)!==t),Pt.push({...r,socketId:e,lastConnectedAt:Date.now()}),Jo()}function hT(r){Pt=Pt.filter(e=>Ns(e)!==r),Jo()}function mT(r){for(let e of Pt)e.socketId===r&&(e.disconnectedAt=Date.now());Jo()}function gT(r,e){for(let t of Pt)Ns(t)===e&&(t.socketId=r,t.disconnectedAt=null,t.lastConnectedAt=Date.now());Jo()}async function YF(r,e,t){let n={to:r.token,sound:"default",title:t.type==="stop"?`${e} \u2705`:`${e} \u{1F514}`,body:t.type==="stop"?`${e} completed the task`:`${e} needs your input`,data:{url:"/workspace",type:t.type}},s=await(await fetch("https://exp.host/--/api/v2/push/send",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)})).json();if(s.data?.status==="error")throw new Error(s.data.message);console.log(` \u2705 Expo push sent to ${r.token.slice(0,30)}...`)}async function vT(r){let e=Av[r.tool]||"AI";console.log(`\u{1F514} Sending push notification: ${r.type} ${e}`);let t=Pt.reduce((i,s)=>(i?.lastConnectedAt??0)>=(s?.lastConnectedAt??0)?i:s,null);if(!t){console.log("\u{1F4E4} sendPush: no subscriptions");return}let n=Ns(t);console.log(`\u{1F4E4} sendPush: total=${Pt.length} target=${n.slice(0,50)}...`);try{if(t.type==="expo")await YF(t,e,r);else{let i=JSON.stringify({title:r.type==="stop"?`${e} \u2705`:`${e} \u{1F514}`,body:r.type==="stop"?`${e} completed the task`:`${e} needs your input`,data:{url:"/workspace",type:r.type}});await cu.default.sendNotification({endpoint:t.endpoint,keys:t.keys},i),console.log(` \u2705 WebPush sent to ${t.endpoint.slice(0,50)}...`)}}catch(i){console.log(` \u274C Push failed: ${i.statusCode||i.message}`),(i.statusCode===410||i.statusCode===404||i.message?.includes("DeviceNotRegistered"))&&(Pt=Pt.filter(o=>Ns(o)!==n),Jo())}}var XF=KF();VF();function xT(){return XF.publicKey}function yT(){return Pt.some(r=>!r.disconnectedAt)}var pm={};function _T(r,e){pm[r]=e}function pu(r){delete pm[r]}function bT(){return{...pm}}function wT(r){r.on("getNotificationState",()=>{r.emit("notificationState",bT())}),r.on("clearNotification",e=>{e&&(pu(e),r.broadcast.emit("notificationCleared",e))}),r.on("getVapidKey",e=>e(xT())),r.on("pushSubscribe",e=>{let t=e?.type==="expo"?e.token:e?.endpoint;t&&(gT(r.id,t),dT(e,r.id))}),r.on("pushUnsubscribe",e=>{e&&hT(e)}),r.on("getAutoStartStatus",e=>{if(!gn())return e({success:!1,error:"Not in Codespaces"});let t=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();e({success:!0,...BS(t)})}),r.on("setAutoStart",({enabled:e},t)=>{if(!gn())return t({success:!1,error:"Not in Codespaces"});let n=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();t(jS(n,e))})}var Gr=X(require("os"),1),dt=X(require("fs"),1),Ht=X(require("path"),1);gt();var ET=`http://localhost:${Ia}/api/notify`,TT="nineRemoteNotify",JF=Ht.default.join(oe.STATE,"claudeEnvBackup.json"),yn={claude:()=>Ht.default.join(Gr.default.homedir(),".claude","settings.json"),codex:()=>Ht.default.join(Gr.default.homedir(),".codex","config.toml"),gemini:()=>Ht.default.join(Gr.default.homedir(),".gemini","settings.json"),opencode:()=>Ht.default.join(Gr.default.homedir(),".config","opencode","plugin",`${TT}.js`)},QF={claude:()=>Ht.default.join(Gr.default.homedir(),".claude"),codex:()=>Ht.default.join(Gr.default.homedir(),".codex"),gemini:()=>Ht.default.join(Gr.default.homedir(),".gemini"),opencode:()=>[Ht.default.join(Gr.default.homedir(),".config","opencode"),Ht.default.join(Gr.default.homedir(),".opencode")]},Qo=(r,e)=>`command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "${ET}?type=${r}&sessionId=$NINE_REMOTE_SESSION_ID&tool=${e}" > /dev/null 2>&1 & true`;function Zo(r){try{if(dt.default.existsSync(r))return JSON.parse(dt.default.readFileSync(r,"utf8"))}catch{}return{}}function fu(r,e){let t=Ht.default.dirname(r);dt.default.existsSync(t)||dt.default.mkdirSync(t,{recursive:!0}),dt.default.writeFileSync(r,JSON.stringify(e,null,2),"utf8")}function CT(r){let e={},t=r.env||{};for(let n of Object.keys(Zs))e[n]=t[n]??null;fu(JF,e),r.env={...t,...Zs}}function ZF(){let r=yn.claude(),e=Zo(r),t=Qo("stop","claude"),n=Qo("notification","claude");return e.hooks={...e.hooks||{},Stop:[{matcher:"",hooks:[{type:"command",command:t}]}],Notification:[{matcher:"permission_prompt|idle_prompt",hooks:[{type:"command",command:n}]}]},CT(e),fu(r,e),{success:!0}}var e3=/# 9Remote notification\nnotify\s*=.*\n?/g,t3="# 9Remote-saved: ";function r3(r){let e=r.search(/^\[/m);return e===-1?[r,""]:[r.slice(0,e),r.slice(e)]}var ST=/^notify\s*=\s*(\[[^\n]*\])\s*$/m;function n3(){let r=yn.codex(),e=Ht.default.dirname(r);dt.default.existsSync(e)||dt.default.mkdirSync(e,{recursive:!0});let t=dt.default.existsSync(r)?dt.default.readFileSync(r,"utf8"):"";t=t.replace(e3,"");let[n,i]=r3(t),s="",o=n.match(ST);if(o){try{let u=JSON.parse(o[1]);Array.isArray(u)&&u.length&&(s=` ; exec ${u.map(p=>`'${String(p).replace(/'/g,"'\\''")}'`).join(" ")} "$@"`)}catch{}n=n.replace(ST,`${t3}$&`)}let a=`${Qo("stop","codex")}${s}`,c=`# 9Remote notification
114
+ `,"utf-8")})}})}var Or=X(require("fs"),1),Jo=X(require("path"),1),cu=X(mT(),1);vt();$n();var lu=Jo.default.join(oe.CONFIG,"vapid.json"),uu=Jo.default.join(oe.CONFIG,"push-subscriptions.json"),JG=1800*1e3,Et=[];function YF(){try{if(Or.default.existsSync(lu))return JSON.parse(Or.default.readFileSync(lu,"utf8"))}catch{}return null}function XF(r){let e=Jo.default.dirname(lu);Or.default.existsSync(e)||Or.default.mkdirSync(e,{recursive:!0}),Or.default.writeFileSync(lu,JSON.stringify(r,null,2),"utf8")}function JF(){let r=YF();if(!r){let e=cu.default.generateVAPIDKeys();r={publicKey:e.publicKey,privateKey:e.privateKey},XF(r)}return cu.default.setVapidDetails("mailto:admin@9remote.cc",r.publicKey,r.privateKey),r}function QF(){try{Or.default.existsSync(uu)&&(Et=JSON.parse(Or.default.readFileSync(uu,"utf8")))}catch{Et=[]}}function Qo(){try{let r=Jo.default.dirname(uu);Or.default.existsSync(r)||Or.default.mkdirSync(r,{recursive:!0}),Or.default.writeFileSync(uu,JSON.stringify(Et,null,2),"utf8")}catch(r){Te(`Failed to save push subscriptions: ${r.message}`)}}function Ls(r){return r.type==="expo"?r.token:r.endpoint}function gT(r,e){let t=Ls(r);Et=Et.filter(n=>Ls(n)!==t),Et.push({...r,socketId:e,lastConnectedAt:Date.now(),hidden:!1}),Qo()}function vT(r,e){for(let t of Et)t.socketId===r&&(t.hidden=!!e)}function xT(){return!!Et.filter(e=>!e.disconnectedAt).reduce((e,t)=>(e?.lastConnectedAt??0)>=(t?.lastConnectedAt??0)?e:t,null)?.hidden}function yT(r){Et=Et.filter(e=>Ls(e)!==r),Qo()}function _T(r){for(let e of Et)e.socketId===r&&(e.disconnectedAt=Date.now());Qo()}function bT(r,e){for(let t of Et)Ls(t)===e&&(t.socketId=r,t.disconnectedAt=null,t.lastConnectedAt=Date.now());Qo()}async function ZF(r,e,t){let n={to:r.token,sound:"default",title:t.type==="stop"?`${e} \u2705`:`${e} \u{1F514}`,body:t.type==="stop"?`${e} completed the task`:`${e} needs your input`,data:{url:"/workspace",type:t.type}},s=await(await fetch("https://exp.host/--/api/v2/push/send",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)})).json();if(s.data?.status==="error")throw new Error(s.data.message);Te(`Expo push sent to ${r.token.slice(0,30)}...`)}async function wT(r){let e=kv[r.tool]||"AI",t=Et.reduce((i,s)=>(i?.lastConnectedAt??0)>=(s?.lastConnectedAt??0)?i:s,null);if(!t)return;let n=Ls(t);try{if(t.type==="expo")await ZF(t,e,r);else{let i=JSON.stringify({title:r.type==="stop"?`${e} \u2705`:`${e} \u{1F514}`,body:r.type==="stop"?`${e} completed the task`:`${e} needs your input`,data:{url:"/workspace",type:r.type}});await cu.default.sendNotification({endpoint:t.endpoint,keys:t.keys},i),Te(`WebPush sent to ${t.endpoint.slice(0,50)}...`)}}catch(i){Te(`Push failed: ${i.statusCode||i.message}`),(i.statusCode===410||i.statusCode===404||i.message?.includes("DeviceNotRegistered"))&&(Et=Et.filter(o=>Ls(o)!==n),Qo())}}var e3=JF();QF();function ST(){return e3.publicKey}function ET(){return Et.some(r=>!r.disconnectedAt)}var fm={};function TT(r,e){fm[r]=e}function pu(r){delete fm[r]}function CT(){return{...fm}}function AT(r){r.on("getNotificationState",()=>{r.emit("notificationState",CT())}),r.on("clearNotification",e=>{e&&(pu(e),r.broadcast.emit("notificationCleared",e))}),r.on("getVapidKey",e=>e(ST())),r.on("pushSubscribe",e=>{let t=e?.type==="expo"?e.token:e?.endpoint;t&&(bT(r.id,t),gT(e,r.id))}),r.on("pushUnsubscribe",e=>{e&&yT(e)}),r.on("visibilityChange",e=>vT(r.id,e)),r.on("getAutoStartStatus",e=>{if(!vn())return e({success:!1,error:"Not in Codespaces"});let t=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();e({success:!0,...HS(t)})}),r.on("setAutoStart",({enabled:e},t)=>{if(!vn())return t({success:!1,error:"Not in Codespaces"});let n=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();t($S(n,e))})}var Gr=X(require("os"),1),ht=X(require("fs"),1),Ht=X(require("path"),1);vt();var kT=`http://localhost:${Na}/api/notify`,OT="nineRemoteNotify",t3=Ht.default.join(oe.STATE,"claudeEnvBackup.json"),_n={claude:()=>Ht.default.join(Gr.default.homedir(),".claude","settings.json"),codex:()=>Ht.default.join(Gr.default.homedir(),".codex","config.toml"),gemini:()=>Ht.default.join(Gr.default.homedir(),".gemini","settings.json"),opencode:()=>Ht.default.join(Gr.default.homedir(),".config","opencode","plugin",`${OT}.js`)},r3={claude:()=>Ht.default.join(Gr.default.homedir(),".claude"),codex:()=>Ht.default.join(Gr.default.homedir(),".codex"),gemini:()=>Ht.default.join(Gr.default.homedir(),".gemini"),opencode:()=>[Ht.default.join(Gr.default.homedir(),".config","opencode"),Ht.default.join(Gr.default.homedir(),".opencode")]},Zo=(r,e)=>`command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "${kT}?type=${r}&sessionId=$NINE_REMOTE_SESSION_ID&tool=${e}" > /dev/null 2>&1 & true`;function ea(r){try{if(ht.default.existsSync(r))return JSON.parse(ht.default.readFileSync(r,"utf8"))}catch{}return{}}function fu(r,e){let t=Ht.default.dirname(r);ht.default.existsSync(t)||ht.default.mkdirSync(t,{recursive:!0}),ht.default.writeFileSync(r,JSON.stringify(e,null,2),"utf8")}function PT(r){let e={},t=r.env||{};for(let n of Object.keys(Zs))e[n]=t[n]??null;fu(t3,e),r.env={...t,...Zs}}function n3(){let r=_n.claude(),e=ea(r),t=Zo("stop","claude"),n=Zo("notification","claude");return e.hooks={...e.hooks||{},Stop:[{matcher:"",hooks:[{type:"command",command:t}]}],Notification:[{matcher:"permission_prompt|idle_prompt",hooks:[{type:"command",command:n}]}]},PT(e),fu(r,e),{success:!0}}var i3=/# 9Remote notification\nnotify\s*=.*\n?/g,s3="# 9Remote-saved: ";function o3(r){let e=r.search(/^\[/m);return e===-1?[r,""]:[r.slice(0,e),r.slice(e)]}var RT=/^notify\s*=\s*(\[[^\n]*\])\s*$/m;function a3(){let r=_n.codex(),e=Ht.default.dirname(r);ht.default.existsSync(e)||ht.default.mkdirSync(e,{recursive:!0});let t=ht.default.existsSync(r)?ht.default.readFileSync(r,"utf8"):"";t=t.replace(i3,"");let[n,i]=o3(t),s="",o=n.match(RT);if(o){try{let u=JSON.parse(o[1]);Array.isArray(u)&&u.length&&(s=` ; exec ${u.map(p=>`'${String(p).replace(/'/g,"'\\''")}'`).join(" ")} "$@"`)}catch{}n=n.replace(RT,`${s3}$&`)}let a=`${Zo("stop","codex")}${s}`,c=`# 9Remote notification
115
115
  notify = ["bash", "-c", ${JSON.stringify(a)}, "9remote"]
116
116
  `;return n.length&&!n.endsWith(`
117
117
  `)&&(n+=`
118
- `),dt.default.writeFileSync(r,n+c+i,"utf8"),{success:!0}}function i3(){let r=yn.gemini(),e=Zo(r),t=Qo("stop","gemini"),n=Qo("notification","gemini");return e.hooks={...e.hooks||{},enabled:!0,AfterAgent:[{matcher:"",hooks:[{name:"9remote-stop",type:"command",command:t,description:"9Remote stop notify"}]}],Notification:[{matcher:"",hooks:[{name:"9remote-notification",type:"command",command:n,description:"9Remote input-needed notify"}]}]},e.tools={...e.tools||{},enableHooks:!0},fu(r,e),{success:!0}}function s3(){return`// 9Remote OpenCode notify plugin (auto-generated)
119
- const base = ${JSON.stringify(ET)};
118
+ `),ht.default.writeFileSync(r,n+c+i,"utf8"),{success:!0}}function c3(){let r=_n.gemini(),e=ea(r),t=Zo("stop","gemini"),n=Zo("notification","gemini");return e.hooks={...e.hooks||{},enabled:!0,AfterAgent:[{matcher:"",hooks:[{name:"9remote-stop",type:"command",command:t,description:"9Remote stop notify"}]}],Notification:[{matcher:"",hooks:[{name:"9remote-notification",type:"command",command:n,description:"9Remote input-needed notify"}]}]},e.tools={...e.tools||{},enableHooks:!0},fu(r,e),{success:!0}}function l3(){return`// 9Remote OpenCode notify plugin (auto-generated)
119
+ const base = ${JSON.stringify(kT)};
120
120
  const post = (type) => {
121
121
  const sid = process.env.NINE_REMOTE_SESSION_ID || "";
122
122
  if (!sid) return;
123
123
  const url = base + "?type=" + type + "&sessionId=" + encodeURIComponent(sid) + "&tool=opencode";
124
124
  try { fetch(url, { signal: AbortSignal.timeout(2000) }).catch(() => {}); } catch {}
125
125
  };
126
- export const ${TT} = async () => ({
126
+ export const ${OT} = async () => ({
127
127
  event: async ({ event }) => {
128
128
  if (event.type === "session.idle") post("stop");
129
129
  else if (event.type === "permission.asked") post("notification");
130
130
  },
131
131
  });
132
- `}function o3(){let r=yn.opencode(),e=Ht.default.dirname(r);return dt.default.existsSync(e)||dt.default.mkdirSync(e,{recursive:!0}),dt.default.writeFileSync(r,s3(),"utf8"),{success:!0}}function a3(r){switch(r){case"claude":{let e=Zo(yn.claude());return!!(e.hooks?.Stop||e.hooks?.Notification)}case"codex":{let e=yn.codex();return dt.default.existsSync(e)&&dt.default.readFileSync(e,"utf8").includes("# 9Remote notification")}case"gemini":{let e=Zo(yn.gemini());return!!(e.hooks?.AfterAgent||e.hooks?.Notification)}case"opencode":return dt.default.existsSync(yn.opencode());default:return!1}}function c3(r){let e=QF[r]?.();return e?(Array.isArray(e)?e:[e]).some(n=>dt.default.existsSync(n)):!1}var l3={claude:ZF,codex:n3,gemini:i3,opencode:o3};var u3=Cv;function p3(r){return l3[r]?.()||{success:!1,error:"Unknown tool"}}function AT(){let r={};for(let e of u3)if(!(!c3(e)||a3(e)))try{r[e]=p3(e).success}catch{r[e]=!1}return r}function RT(){let r=yn.claude(),e=Zo(r);if(!e.hooks?.Stop&&!e.hooks?.Notification)return;let t=e.env||{};Object.keys(Zs).some(i=>t[i]!==Zs[i])&&(CT(e),fu(r,e))}var gz=(0,OT.dirname)((0,PT.fileURLToPath)(__importMetaUrl)),vz=xv.rgb(230,138,110),fm="daemon",f3="2.0.26",Gn=new Map,MT=new Map,IT={};async function kT(){let r=await hl(),e=new Map(r.map(n=>[n.id,n])),t=Ch();for(let n of r)if(!t[n.id])try{await ui(n.id)}catch{}Gn.clear();for(let[n,i]of Object.entries(t)){let s=e.get(n);Gn.set(n,{daemon:!0,name:i.name,createdAt:i.createdAt,shellId:i.shellId,cwd:s?.cwd||i.cwd,needsRespawn:!s})}vn(Gn)}async function NT(){let r=qS();for(let n of r.groups)MT.set(n.id,n);Object.assign(IT,r.sessionGroups);try{RT()}catch{}try{AT()}catch{}if(fm==="daemon")if(!await sw())console.error("\u274C Failed to connect to PTY daemon, falling back to buffer mode");else{await kT(),fl("connected",()=>{kT().catch(()=>{})});return}console.log("\u{1F4E6} Buffer persistence mode - scrollback enabled");let e=$S(),t=Ch();for(let n of e){let i=t[n]||{};Gn.set(n,{pty:null,name:i.name||`Terminal ${Gn.size+1}`,createdAt:i.createdAt||Date.now(),buffer:[],needsRestore:!0}),console.log(`\u{1F504} Found saved session: ${n}`)}e.length>0&&console.log(`\u2705 Found ${e.length} saved session(s)`)}function LT(r,e){fm==="daemon"&&(fl("output",({sessionId:n,data:i})=>wt(r,"output",{sessionId:n,data:i})),fl("sessionClosed",n=>{Gn.delete(n),pu(n),wt(r,"sessionClosed",n),wt(r,"notificationCleared",n)}));let t=()=>({version:f3,remoteAvailable:xs(),daemonMode:fm==="daemon"&&Cr(),platform:process.platform,...IS()});$w(()=>{let n=t();for(let i of r.sockets.sockets.values())i.data?.approved&&i.emit("serverInfo",n)}),r.on("connection",n=>{NS(),n.emit("serverInfo",t()),zS(n,r,Gn,MT,IT),YS(n,Gn),wT(n),TS()&&MS(n,e).catch(i=>{console.error("\u274C Failed to setup remote handlers:",i.message)}),n.on("disconnect",i=>{mT(n.id),LS()})})}var se=X(require("fs"),1),yr=X(require("path"),1),Vr=X(require("os"),1),qs=require("child_process"),fR=X(nR(),1);var bg=["node_modules",".git","dist","build",".next","coverage","__pycache__",".cache",".vscode",".idea",".turbo",".vercel",".output","out",".nuxt",".svelte-kit","target","vendor",".gradle",".pytest_cache",".mypy_cache",".tox",".venv","venv","env",".DS_Store",".parcel-cache",".rollup.cache"],Lu=[".png",".jpg",".jpeg",".gif",".webp",".ico",".svg",".bmp",".pdf",".zip",".tar",".gz",".rar",".7z",".exe",".dll",".so",".dylib",".mp3",".mp4",".wav",".avi",".mov",".webm",".woff",".woff2",".ttf",".eot",".otf",".sqlite",".db"];var iR=[".ssh",".aws",".gnupg",".kube",".docker",".cargo",".npmrc",".netrc",".pypirc",".config/gh",".config/gcloud"],sR=["/etc/shadow","/etc/sudoers","/etc/ssh","/root","/private/etc/sudoers"];var oR=X(require("fs"),1),ma=X(require("path"),1),aR=X(require("os"),1);var cR=aR.default.homedir();function dU(r){if(!r)return null;let e=r.startsWith("~")?r.replace(/^~/,cR):r;try{return oR.default.realpathSync(e)}catch{return ma.default.resolve(e)}}function Sn(r){let e=dU(r);if(!e)return!1;for(let t of sR)if(e===t||e.startsWith(t+ma.default.sep))return!0;for(let t of iR){let n=ma.default.join(cR,t);if(e===n||e.startsWith(n+ma.default.sep))return!0}return!1}function Du(r){return bg.includes(r)}function Us(r){return Lu.includes(yr.default.extname(r).toLowerCase())}function mU(r,e){return r.isDirectory()?"folder":Us(e)?"binary":"file"}function ga(r){return r<1024?`${r}B`:r<1024*1024?`${(r/1024).toFixed(1)}KB`:`${(r/(1024*1024)).toFixed(1)}MB`}function dR(r,e,t,n=50){if(!(t.length>=n))try{for(let i of se.default.readdirSync(r)){if(t.length>=n)return;if(i.startsWith(".")||Du(i))continue;let s=yr.default.join(r,i);try{let o=se.default.statSync(s);o.isDirectory()?dR(s,e,t,n):i.toLowerCase().includes(e.toLowerCase())&&t.push({name:i,path:s,type:Us(i)?"binary":"file",size:o.size,sizeFormatted:ga(o.size)})}catch{}}}catch{}}function pR(r){if(!r)return null;let e=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"::ANY::").replace(/\*/g,"[^/]*").replace(/::ANY::/g,".*").replace(/\?/g,".");return new RegExp(`^${e}$`)}function hR(r,e,t,n,i,s){if(s.length>=200)return;let o;try{o=se.default.readdirSync(r,{withFileTypes:!0})}catch{return}for(let a of o){if(s.length>=200)return;if(Du(a.name))continue;let c=yr.default.join(r,a.name),u=yr.default.relative(e,c);if(a.isDirectory()){hR(c,e,t,n,i,s);continue}if(a.isFile()&&!Us(a.name)&&!(i&&i.test(u))&&!(n&&!n.test(u)))try{if(se.default.statSync(c).size>512e3)continue;let m=se.default.readFileSync(c,"utf-8").split(`
133
- `),y=[];for(let _=0;_<m.length&&y.length<10;_++){let S=m[_],A=t(S);for(let P of A){if(y.length>=10)break;y.push({line:_+1,column:P.column+1,lineText:S,matchLength:P.length})}}y.length&&s.push({path:c,matches:y})}catch{}}}function mR(r,e,t){let n;try{n=se.default.readdirSync(r,{withFileTypes:!0})}catch{return[]}let i=[];for(let s of n){if(!t&&s.name.startsWith(".")&&s.name!==".env"&&s.name!==".env.example"||Du(s.name))continue;let o=yr.default.join(r,s.name);if(s.isDirectory()){let a={name:s.name,path:o,type:"folder"};e>0&&(a.children=mR(o,e-1,t)),i.push(a)}else s.isFile()&&i.push({name:s.name,path:o,type:Us(s.name)?"binary":"file"})}return i.sort((s,o)=>s.type==="folder"&&o.type!=="folder"?-1:s.type!=="folder"&&o.type==="folder"?1:s.name.localeCompare(o.name)),i}function gU(){if(process.platform!=="win32")return[];try{return(0,qs.execSync)("wmic logicaldisk get name",{encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).split(/\r?\n/).map(e=>e.trim()).filter(e=>/^[A-Z]:$/.test(e)).map(e=>({letter:e[0],path:e+"\\"}))}catch{return"CDEFGHIJ".split("").map(r=>`${r}:\\`).filter(r=>se.default.existsSync(r)).map(r=>({letter:r[0],path:r}))}}function gR(r){r.on("getSystemInfo",t=>{let n=process.platform;t({success:!0,platform:n,isWindows:n==="win32",drives:n==="win32"?gU():[],homedir:Vr.default.homedir()})}),r.on("getFiles",({dirPath:t,showHidden:n},i)=>{try{let s=t||Vr.default.homedir(),o=s.startsWith("~")?s.replace("~",Vr.default.homedir()):s;if(Sn(o))return i({success:!1,error:"Access denied"});if(!se.default.existsSync(o))return i({success:!1,error:"Directory not found"});let a=[];for(let c of se.default.readdirSync(o))if(!(!n&&c.startsWith(".")&&c!==".env"&&c!==".env.example")&&!Du(c))try{let u=yr.default.join(o,c),p=se.default.statSync(u);a.push({name:c,path:u,type:mU(p,c),size:p.isFile()?p.size:null,sizeFormatted:p.isFile()?ga(p.size):null,modified:p.mtime.getTime()})}catch{}a.sort((c,u)=>c.type==="folder"&&u.type!=="folder"?-1:c.type!=="folder"&&u.type==="folder"?1:c.name.localeCompare(u.name)),i({success:!0,files:a,currentPath:o,parentPath:yr.default.dirname(o)})}catch(s){i({success:!1,error:s.message})}}),r.on("searchFiles",({workspace:t,query:n},i)=>{try{if(!n||n.length<2)return i({success:!0,files:[]});let s=(t||Vr.default.homedir()).replace(/^~/,Vr.default.homedir());if(!se.default.existsSync(s))return i({success:!1,error:"Workspace not found"});let o=[];dR(s,n,o,50),o.sort((a,c)=>{let u=a.name.toLowerCase()===n.toLowerCase(),p=c.name.toLowerCase()===n.toLowerCase();return u&&!p?-1:!u&&p?1:a.path.length-c.path.length}),i({success:!0,files:o})}catch(s){i({success:!1,error:s.message})}}),r.on("readFile",({filePath:t},n)=>{try{if(Sn(t))return n({success:!1,error:"Access denied"});if(!se.default.existsSync(t))return n({success:!1,error:"File not found"});let i=se.default.statSync(t);if(i.size>512e3)return n({success:!1,error:`File too large (${ga(i.size)}). Max ${ga(512e3)}`});if(Us(t))return n({success:!1,error:"Cannot open binary file"});n({success:!0,content:se.default.readFileSync(t,"utf-8")})}catch(i){n({success:!1,error:i.message})}}),r.on("readImage",({filePath:t},n)=>{try{if(Sn(t))return n({success:!1,error:"Access denied"});if(!se.default.existsSync(t))return n({success:!1,error:"File not found"});let i=se.default.statSync(t),s=10*1024*1024;if(i.size>s)return n({success:!1,error:`Image too large (${ga(i.size)})`});let o=yr.default.extname(t).toLowerCase().slice(1),c={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",ico:"image/x-icon",bmp:"image/bmp"}[o]||"application/octet-stream",u=se.default.readFileSync(t),p=`data:${c};base64,${u.toString("base64")}`;n({success:!0,dataUrl:p,size:i.size,mime:c})}catch(i){n({success:!1,error:i.message})}}),r.on("writeFile",({filePath:t,content:n},i)=>{try{if(Sn(t))return i({success:!1,error:"Access denied"});se.default.writeFileSync(t,n,"utf-8"),i({success:!0})}catch(s){i({success:!1,error:s.message})}}),r.on("createItem",({itemPath:t,type:n},i)=>{try{if(Sn(t))return i({success:!1,error:"Access denied"});if(se.default.existsSync(t))return i({success:!1,error:"Item already exists"});n==="folder"?se.default.mkdirSync(t,{recursive:!0}):se.default.writeFileSync(t,"","utf-8"),i({success:!0})}catch(s){i({success:!1,error:s.message})}}),r.on("deleteItem",({itemPath:t},n)=>{try{if(Sn(t))return n({success:!1,error:"Access denied"});if(!se.default.existsSync(t))return n({success:!1,error:"Item not found"});se.default.statSync(t).isDirectory()?se.default.rmSync(t,{recursive:!0}):se.default.unlinkSync(t),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("renameItem",({oldPath:t,newPath:n},i)=>{try{if(Sn(t)||Sn(n))return i({success:!1,error:"Access denied"});if(!se.default.existsSync(t))return i({success:!1,error:"Item not found"});if(se.default.existsSync(n))return i({success:!1,error:"Target already exists"});se.default.renameSync(t,n),i({success:!0})}catch(s){i({success:!1,error:s.message})}}),r.on("searchInFiles",({workspace:t,query:n,caseSensitive:i,regex:s,includeGlob:o,excludeGlob:a},c)=>{try{if(!n)return c({success:!0,results:[]});let u=(t||Vr.default.homedir()).replace(/^~/,Vr.default.homedir());if(!se.default.existsSync(u))return c({success:!1,error:"Workspace not found"});let p;if(s){let _;try{_=new RegExp(n,i?"g":"gi")}catch(S){return c({success:!1,error:`Invalid regex: ${S.message}`})}p=S=>{let A=[],P;for(_.lastIndex=0;(P=_.exec(S))!==null;)A.push({column:P.index,length:P[0].length}),P.index===_.lastIndex&&_.lastIndex++;return A}}else{let _=i?n:n.toLowerCase();p=S=>{let A=i?S:S.toLowerCase(),P=[],L=0;for(;(L=A.indexOf(_,L))!==-1;)P.push({column:L,length:_.length}),L+=_.length||1;return P}}let f=pR(o),m=pR(a),y=[];hR(u,u,p,f,m,y),c({success:!0,results:y})}catch(u){c({success:!1,error:u.message})}}),r.on("replaceInFiles",({workspace:t,query:n,replacement:i,caseSensitive:s,regex:o,files:a},c)=>{try{if(!n||!Array.isArray(a)||!a.length)return c({success:!0,replacedCount:0,fileCount:0});let u;if(o){let m;try{m=new RegExp(n,s?"g":"gi")}catch(y){return c({success:!1,error:`Invalid regex: ${y.message}`})}u=y=>{let _=0;return{next:y.replace(m,A=>(_++,i)),count:_}}}else u=m=>{let y=0,_=s?"g":"gi",S=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),A=new RegExp(S,_);return{next:m.replace(A,()=>(y++,i)),count:y}};let p=0,f=0;for(let m of a)try{if(!se.default.existsSync(m)||Us(m))continue;let y=se.default.statSync(m);if(!y.isFile()||y.size>512e3)continue;let _=se.default.readFileSync(m,"utf-8"),{next:S,count:A}=u(_);A>0&&(se.default.writeFileSync(m,S,"utf-8"),p+=A,f++)}catch{}c({success:!0,replacedCount:p,fileCount:f})}catch(u){c({success:!1,error:u.message})}});let e=new Map;r.on("watchDir",({dirPath:t},n)=>{try{if(!t||!se.default.existsSync(t))return n({success:!1,error:"Directory not found"});if(e.has(t))return n({success:!0});let i=fR.default.watch(t,{depth:0,ignoreInitial:!0,persistent:!0,ignored:o=>bg.includes(yr.default.basename(o))}),s=o=>a=>r.emit("fileChange",{type:o,path:a});i.on("add",s("add")).on("change",s("change")).on("unlink",s("unlink")).on("addDir",s("addDir")).on("unlinkDir",s("unlinkDir")),e.set(t,i),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("unwatchDir",({dirPath:t},n)=>{try{let i=e.get(t);i&&(i.close(),e.delete(t)),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.once("disconnect",()=>{for(let t of e.values())try{t.close()}catch{}e.clear()}),r.on("revealInOS",({filePath:t},n)=>{try{if(!t)return n({success:!1,error:"No path"});let i=process.platform,s,o;i==="darwin"?(s="open",o=["-R",t]):i==="win32"?(s="explorer",o=[`/select,${t}`]):(s="xdg-open",o=[yr.default.dirname(t)]);let a=(0,qs.spawn)(s,o,{detached:!0,stdio:"ignore",windowsHide:!0});a.on("error",c=>n({success:!1,error:c.message})),a.unref(),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("openInTerminal",({dirPath:t},n)=>{try{if(!t||!se.default.existsSync(t))return n({success:!1,error:"Directory not found"});let i=process.platform,s,o,a={detached:!0,stdio:"ignore",windowsHide:!0};i==="darwin"?(s="open",o=["-a","Terminal",t]):i==="win32"?(s="cmd",o=["/C","start","cmd","/K",`cd /d "${t}"`],a.shell=!1):(s="gnome-terminal",o=[`--working-directory=${t}`]);let c=(0,qs.spawn)(s,o,a);c.on("error",()=>{if(i==="linux"){let u=(0,qs.spawn)("xterm",["-e",`cd "${t}" && bash`],a);u.on("error",p=>n({success:!1,error:p.message})),u.unref()}else n({success:!1,error:"Failed to open terminal"})}),c.unref(),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("getFileTree",({dirPath:t,depth:n,showHidden:i},s)=>{try{let o=(t||Vr.default.homedir()).replace(/^~/,Vr.default.homedir());if(!se.default.existsSync(o))return s({success:!1,error:"Directory not found"});let c=mR(o,typeof n=="number"?n:3,!!i);s({success:!0,tree:{name:yr.default.basename(o)||o,path:o,type:"folder",children:c}})}catch(o){s({success:!1,error:o.message})}})}var Ut=X(require("fs"),1),wi=X(require("path"),1),Mr=require("child_process");function bi(r,e){return new Promise(t=>{let n=(0,Mr.spawn)("git",r,{cwd:e,windowsHide:!0}),i="",s="";n.stdout.on("data",o=>{i+=o.toString()}),n.stderr.on("data",o=>{s+=o.toString()}),n.on("error",o=>t({code:-1,stdout:i,stderr:o.message})),n.on("close",o=>t({code:o,stdout:i,stderr:s}))})}function vR(r){return Lu.includes(wi.default.extname(r).toLowerCase())}function xR(r){r.on("gitStatus",({repoPath:e},t)=>{try{let n=(0,Mr.execSync)("git status --porcelain",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),i={};try{(0,Mr.execSync)("git diff HEAD --numstat",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).trim().split(`
132
+ `}function u3(){let r=_n.opencode(),e=Ht.default.dirname(r);return ht.default.existsSync(e)||ht.default.mkdirSync(e,{recursive:!0}),ht.default.writeFileSync(r,l3(),"utf8"),{success:!0}}function p3(r){switch(r){case"claude":{let e=ea(_n.claude());return!!(e.hooks?.Stop||e.hooks?.Notification)}case"codex":{let e=_n.codex();return ht.default.existsSync(e)&&ht.default.readFileSync(e,"utf8").includes("# 9Remote notification")}case"gemini":{let e=ea(_n.gemini());return!!(e.hooks?.AfterAgent||e.hooks?.Notification)}case"opencode":return ht.default.existsSync(_n.opencode());default:return!1}}function f3(r){let e=r3[r]?.();return e?(Array.isArray(e)?e:[e]).some(n=>ht.default.existsSync(n)):!1}var d3={claude:n3,codex:a3,gemini:c3,opencode:u3};var h3=Rv;function m3(r){return d3[r]?.()||{success:!1,error:"Unknown tool"}}function MT(){let r={};for(let e of h3)if(!(!f3(e)||p3(e)))try{r[e]=m3(e).success}catch{r[e]=!1}return r}function IT(){let r=_n.claude(),e=ea(r);if(!e.hooks?.Stop&&!e.hooks?.Notification)return;let t=e.env||{};Object.keys(Zs).some(i=>t[i]!==Zs[i])&&(PT(e),fu(r,e))}var bz=(0,LT.dirname)((0,DT.fileURLToPath)(__importMetaUrl)),wz=_v.rgb(230,138,110),dm="daemon",g3="2.0.31",zn=new Map,BT=new Map,jT={};async function NT(){let r=await ml(),e=new Map(r.map(n=>[n.id,n])),t=Ah();for(let n of r)if(!t[n.id])try{await fi(n.id)}catch{}zn.clear();for(let[n,i]of Object.entries(t)){let s=e.get(n);zn.set(n,{daemon:!0,name:i.name,createdAt:i.createdAt,shellId:i.shellId,cwd:s?.cwd||i.cwd,needsRespawn:!s})}xn(zn)}async function FT(){let r=GS();for(let n of r.groups)BT.set(n.id,n);Object.assign(jT,r.sessionGroups);try{IT()}catch{}try{MT()}catch{}if(dm==="daemon")if(!await aw())console.error("\u274C Failed to connect to PTY daemon, falling back to buffer mode");else{await NT(),dl("connected",()=>{NT().catch(()=>{})});return}console.log("\u{1F4E6} Buffer persistence mode - scrollback enabled");let e=WS(),t=Ah();for(let n of e){let i=t[n]||{};zn.set(n,{pty:null,name:i.name||`Terminal ${zn.size+1}`,createdAt:i.createdAt||Date.now(),buffer:[],needsRestore:!0}),console.log(`\u{1F504} Found saved session: ${n}`)}e.length>0&&console.log(`\u2705 Found ${e.length} saved session(s)`)}function du(r,e){dm==="daemon"&&(dl("output",({sessionId:n,data:i})=>wt(r,"output",{sessionId:n,data:i})),dl("sessionClosed",n=>{zn.delete(n),pu(n),wt(r,"sessionClosed",n),wt(r,"notificationCleared",n)}));let t=()=>({version:g3,remoteAvailable:ys(),daemonMode:dm==="daemon"&&Cr(),platform:process.platform,...DS()});Uw(()=>{let n=t();for(let i of r.sockets.sockets.values())i.data?.approved&&i.emit("serverInfo",n)}),du._buildServerInfo=t}async function HT(r,e,t){BS(),r.emit("serverInfo",du._buildServerInfo?.()),YS(r,e,zn,BT,jT),QS(r,zn),AT(r),RS()&&await LS(r,t).catch(n=>{console.error("\u274C Failed to setup remote handlers:",n.message)}),r.on("disconnect",()=>{_T(r.id),jS()})}var se=X(require("fs"),1),yr=X(require("path"),1),Vr=X(require("os"),1),Us=require("child_process"),vR=X(cR(),1);var wg=["node_modules",".git","dist","build",".next","coverage","__pycache__",".cache",".vscode",".idea",".turbo",".vercel",".output","out",".nuxt",".svelte-kit","target","vendor",".gradle",".pytest_cache",".mypy_cache",".tox",".venv","venv","env",".DS_Store",".parcel-cache",".rollup.cache"],Du=[".png",".jpg",".jpeg",".gif",".webp",".ico",".svg",".bmp",".pdf",".zip",".tar",".gz",".rar",".7z",".exe",".dll",".so",".dylib",".mp3",".mp4",".wav",".avi",".mov",".webm",".woff",".woff2",".ttf",".eot",".otf",".sqlite",".db"];var lR=[".ssh",".aws",".gnupg",".kube",".docker",".cargo",".npmrc",".netrc",".pypirc",".config/gh",".config/gcloud"],uR=["/etc/shadow","/etc/sudoers","/etc/ssh","/root","/private/etc/sudoers"];var pR=X(require("fs"),1),ga=X(require("path"),1),fR=X(require("os"),1);var dR=fR.default.homedir();function vU(r){if(!r)return null;let e=r.startsWith("~")?r.replace(/^~/,dR):r;try{return pR.default.realpathSync(e)}catch{return ga.default.resolve(e)}}function En(r){let e=vU(r);if(!e)return!1;for(let t of uR)if(e===t||e.startsWith(t+ga.default.sep))return!0;for(let t of lR){let n=ga.default.join(dR,t);if(e===n||e.startsWith(n+ga.default.sep))return!0}return!1}function Bu(r){return wg.includes(r)}function Ws(r){return Du.includes(yr.default.extname(r).toLowerCase())}function yU(r,e){return r.isDirectory()?"folder":Ws(e)?"binary":"file"}function va(r){return r<1024?`${r}B`:r<1024*1024?`${(r/1024).toFixed(1)}KB`:`${(r/(1024*1024)).toFixed(1)}MB`}function xR(r,e,t,n=50){if(!(t.length>=n))try{for(let i of se.default.readdirSync(r)){if(t.length>=n)return;if(i.startsWith(".")||Bu(i))continue;let s=yr.default.join(r,i);try{let o=se.default.statSync(s);o.isDirectory()?xR(s,e,t,n):i.toLowerCase().includes(e.toLowerCase())&&t.push({name:i,path:s,type:Ws(i)?"binary":"file",size:o.size,sizeFormatted:va(o.size)})}catch{}}}catch{}}function gR(r){if(!r)return null;let e=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"::ANY::").replace(/\*/g,"[^/]*").replace(/::ANY::/g,".*").replace(/\?/g,".");return new RegExp(`^${e}$`)}function yR(r,e,t,n,i,s){if(s.length>=200)return;let o;try{o=se.default.readdirSync(r,{withFileTypes:!0})}catch{return}for(let a of o){if(s.length>=200)return;if(Bu(a.name))continue;let c=yr.default.join(r,a.name),u=yr.default.relative(e,c);if(a.isDirectory()){yR(c,e,t,n,i,s);continue}if(a.isFile()&&!Ws(a.name)&&!(i&&i.test(u))&&!(n&&!n.test(u)))try{if(se.default.statSync(c).size>512e3)continue;let m=se.default.readFileSync(c,"utf-8").split(`
133
+ `),y=[];for(let _=0;_<m.length&&y.length<10;_++){let S=m[_],A=t(S);for(let P of A){if(y.length>=10)break;y.push({line:_+1,column:P.column+1,lineText:S,matchLength:P.length})}}y.length&&s.push({path:c,matches:y})}catch{}}}function _R(r,e,t){let n;try{n=se.default.readdirSync(r,{withFileTypes:!0})}catch{return[]}let i=[];for(let s of n){if(!t&&s.name.startsWith(".")&&s.name!==".env"&&s.name!==".env.example"||Bu(s.name))continue;let o=yr.default.join(r,s.name);if(s.isDirectory()){let a={name:s.name,path:o,type:"folder"};e>0&&(a.children=_R(o,e-1,t)),i.push(a)}else s.isFile()&&i.push({name:s.name,path:o,type:Ws(s.name)?"binary":"file"})}return i.sort((s,o)=>s.type==="folder"&&o.type!=="folder"?-1:s.type!=="folder"&&o.type==="folder"?1:s.name.localeCompare(o.name)),i}function _U(){if(process.platform!=="win32")return[];try{return(0,Us.execSync)("wmic logicaldisk get name",{encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).split(/\r?\n/).map(e=>e.trim()).filter(e=>/^[A-Z]:$/.test(e)).map(e=>({letter:e[0],path:e+"\\"}))}catch{return"CDEFGHIJ".split("").map(r=>`${r}:\\`).filter(r=>se.default.existsSync(r)).map(r=>({letter:r[0],path:r}))}}function bR(r){r.on("getSystemInfo",t=>{let n=process.platform;t({success:!0,platform:n,isWindows:n==="win32",drives:n==="win32"?_U():[],homedir:Vr.default.homedir()})}),r.on("getFiles",({dirPath:t,showHidden:n},i)=>{try{let s=t||Vr.default.homedir(),o=s.startsWith("~")?s.replace("~",Vr.default.homedir()):s;if(En(o))return i({success:!1,error:"Access denied"});if(!se.default.existsSync(o))return i({success:!1,error:"Directory not found"});let a=[];for(let c of se.default.readdirSync(o))if(!(!n&&c.startsWith(".")&&c!==".env"&&c!==".env.example")&&!Bu(c))try{let u=yr.default.join(o,c),p=se.default.statSync(u);a.push({name:c,path:u,type:yU(p,c),size:p.isFile()?p.size:null,sizeFormatted:p.isFile()?va(p.size):null,modified:p.mtime.getTime()})}catch{}a.sort((c,u)=>c.type==="folder"&&u.type!=="folder"?-1:c.type!=="folder"&&u.type==="folder"?1:c.name.localeCompare(u.name)),i({success:!0,files:a,currentPath:o,parentPath:yr.default.dirname(o)})}catch(s){i({success:!1,error:s.message})}}),r.on("searchFiles",({workspace:t,query:n},i)=>{try{if(!n||n.length<2)return i({success:!0,files:[]});let s=(t||Vr.default.homedir()).replace(/^~/,Vr.default.homedir());if(!se.default.existsSync(s))return i({success:!1,error:"Workspace not found"});let o=[];xR(s,n,o,50),o.sort((a,c)=>{let u=a.name.toLowerCase()===n.toLowerCase(),p=c.name.toLowerCase()===n.toLowerCase();return u&&!p?-1:!u&&p?1:a.path.length-c.path.length}),i({success:!0,files:o})}catch(s){i({success:!1,error:s.message})}}),r.on("readFile",({filePath:t},n)=>{try{if(En(t))return n({success:!1,error:"Access denied"});if(!se.default.existsSync(t))return n({success:!1,error:"File not found"});let i=se.default.statSync(t);if(i.size>512e3)return n({success:!1,error:`File too large (${va(i.size)}). Max ${va(512e3)}`});if(Ws(t))return n({success:!1,error:"Cannot open binary file"});n({success:!0,content:se.default.readFileSync(t,"utf-8")})}catch(i){n({success:!1,error:i.message})}}),r.on("readImage",({filePath:t},n)=>{try{if(En(t))return n({success:!1,error:"Access denied"});if(!se.default.existsSync(t))return n({success:!1,error:"File not found"});let i=se.default.statSync(t),s=10*1024*1024;if(i.size>s)return n({success:!1,error:`Image too large (${va(i.size)})`});let o=yr.default.extname(t).toLowerCase().slice(1),c={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",ico:"image/x-icon",bmp:"image/bmp"}[o]||"application/octet-stream",u=se.default.readFileSync(t),p=`data:${c};base64,${u.toString("base64")}`;n({success:!0,dataUrl:p,size:i.size,mime:c})}catch(i){n({success:!1,error:i.message})}}),r.on("writeFile",({filePath:t,content:n},i)=>{try{if(En(t))return i({success:!1,error:"Access denied"});se.default.writeFileSync(t,n,"utf-8"),i({success:!0})}catch(s){i({success:!1,error:s.message})}}),r.on("createItem",({itemPath:t,type:n},i)=>{try{if(En(t))return i({success:!1,error:"Access denied"});if(se.default.existsSync(t))return i({success:!1,error:"Item already exists"});n==="folder"?se.default.mkdirSync(t,{recursive:!0}):se.default.writeFileSync(t,"","utf-8"),i({success:!0})}catch(s){i({success:!1,error:s.message})}}),r.on("deleteItem",({itemPath:t},n)=>{try{if(En(t))return n({success:!1,error:"Access denied"});if(!se.default.existsSync(t))return n({success:!1,error:"Item not found"});se.default.statSync(t).isDirectory()?se.default.rmSync(t,{recursive:!0}):se.default.unlinkSync(t),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("renameItem",({oldPath:t,newPath:n},i)=>{try{if(En(t)||En(n))return i({success:!1,error:"Access denied"});if(!se.default.existsSync(t))return i({success:!1,error:"Item not found"});if(se.default.existsSync(n))return i({success:!1,error:"Target already exists"});se.default.renameSync(t,n),i({success:!0})}catch(s){i({success:!1,error:s.message})}}),r.on("searchInFiles",({workspace:t,query:n,caseSensitive:i,regex:s,includeGlob:o,excludeGlob:a},c)=>{try{if(!n)return c({success:!0,results:[]});let u=(t||Vr.default.homedir()).replace(/^~/,Vr.default.homedir());if(!se.default.existsSync(u))return c({success:!1,error:"Workspace not found"});let p;if(s){let _;try{_=new RegExp(n,i?"g":"gi")}catch(S){return c({success:!1,error:`Invalid regex: ${S.message}`})}p=S=>{let A=[],P;for(_.lastIndex=0;(P=_.exec(S))!==null;)A.push({column:P.index,length:P[0].length}),P.index===_.lastIndex&&_.lastIndex++;return A}}else{let _=i?n:n.toLowerCase();p=S=>{let A=i?S:S.toLowerCase(),P=[],L=0;for(;(L=A.indexOf(_,L))!==-1;)P.push({column:L,length:_.length}),L+=_.length||1;return P}}let f=gR(o),m=gR(a),y=[];yR(u,u,p,f,m,y),c({success:!0,results:y})}catch(u){c({success:!1,error:u.message})}}),r.on("replaceInFiles",({workspace:t,query:n,replacement:i,caseSensitive:s,regex:o,files:a},c)=>{try{if(!n||!Array.isArray(a)||!a.length)return c({success:!0,replacedCount:0,fileCount:0});let u;if(o){let m;try{m=new RegExp(n,s?"g":"gi")}catch(y){return c({success:!1,error:`Invalid regex: ${y.message}`})}u=y=>{let _=0;return{next:y.replace(m,A=>(_++,i)),count:_}}}else u=m=>{let y=0,_=s?"g":"gi",S=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),A=new RegExp(S,_);return{next:m.replace(A,()=>(y++,i)),count:y}};let p=0,f=0;for(let m of a)try{if(!se.default.existsSync(m)||Ws(m))continue;let y=se.default.statSync(m);if(!y.isFile()||y.size>512e3)continue;let _=se.default.readFileSync(m,"utf-8"),{next:S,count:A}=u(_);A>0&&(se.default.writeFileSync(m,S,"utf-8"),p+=A,f++)}catch{}c({success:!0,replacedCount:p,fileCount:f})}catch(u){c({success:!1,error:u.message})}});let e=new Map;r.on("watchDir",({dirPath:t},n)=>{try{if(!t||!se.default.existsSync(t))return n({success:!1,error:"Directory not found"});if(e.has(t))return n({success:!0});let i=vR.default.watch(t,{depth:0,ignoreInitial:!0,persistent:!0,ignored:o=>wg.includes(yr.default.basename(o))}),s=o=>a=>r.emit("fileChange",{type:o,path:a});i.on("add",s("add")).on("change",s("change")).on("unlink",s("unlink")).on("addDir",s("addDir")).on("unlinkDir",s("unlinkDir")),e.set(t,i),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("unwatchDir",({dirPath:t},n)=>{try{let i=e.get(t);i&&(i.close(),e.delete(t)),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.once("disconnect",()=>{for(let t of e.values())try{t.close()}catch{}e.clear()}),r.on("revealInOS",({filePath:t},n)=>{try{if(!t)return n({success:!1,error:"No path"});let i=process.platform,s,o;i==="darwin"?(s="open",o=["-R",t]):i==="win32"?(s="explorer",o=[`/select,${t}`]):(s="xdg-open",o=[yr.default.dirname(t)]);let a=(0,Us.spawn)(s,o,{detached:!0,stdio:"ignore",windowsHide:!0});a.on("error",c=>n({success:!1,error:c.message})),a.unref(),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("openInTerminal",({dirPath:t},n)=>{try{if(!t||!se.default.existsSync(t))return n({success:!1,error:"Directory not found"});let i=process.platform,s,o,a={detached:!0,stdio:"ignore",windowsHide:!0};i==="darwin"?(s="open",o=["-a","Terminal",t]):i==="win32"?(s="cmd",o=["/C","start","cmd","/K",`cd /d "${t}"`],a.shell=!1):(s="gnome-terminal",o=[`--working-directory=${t}`]);let c=(0,Us.spawn)(s,o,a);c.on("error",()=>{if(i==="linux"){let u=(0,Us.spawn)("xterm",["-e",`cd "${t}" && bash`],a);u.on("error",p=>n({success:!1,error:p.message})),u.unref()}else n({success:!1,error:"Failed to open terminal"})}),c.unref(),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("getFileTree",({dirPath:t,depth:n,showHidden:i},s)=>{try{let o=(t||Vr.default.homedir()).replace(/^~/,Vr.default.homedir());if(!se.default.existsSync(o))return s({success:!1,error:"Directory not found"});let c=_R(o,typeof n=="number"?n:3,!!i);s({success:!0,tree:{name:yr.default.basename(o)||o,path:o,type:"folder",children:c}})}catch(o){s({success:!1,error:o.message})}})}var Ut=X(require("fs"),1),Si=X(require("path"),1),Mr=require("child_process");function wi(r,e){return new Promise(t=>{let n=(0,Mr.spawn)("git",r,{cwd:e,windowsHide:!0}),i="",s="";n.stdout.on("data",o=>{i+=o.toString()}),n.stderr.on("data",o=>{s+=o.toString()}),n.on("error",o=>t({code:-1,stdout:i,stderr:o.message})),n.on("close",o=>t({code:o,stdout:i,stderr:s}))})}function wR(r){return Du.includes(Si.default.extname(r).toLowerCase())}function SR(r){r.on("gitStatus",({repoPath:e},t)=>{try{let n=(0,Mr.execSync)("git status --porcelain",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),i={};try{(0,Mr.execSync)("git diff HEAD --numstat",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).trim().split(`
134
134
  `).filter(Boolean).forEach(a=>{let c=a.split(" ");c.length>=3&&(i[c[2]]={added:c[0]==="-"?0:parseInt(c[0],10)||0,deleted:c[1]==="-"?0:parseInt(c[1],10)||0})})}catch{}let s=[];for(let o of n.trim().split(`
135
- `).filter(Boolean)){let a=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!a)continue;let c=a[1],u=a[2];if(!u)continue;let p;c.includes("?")?p="?":c.includes("A")?p="A":c.includes("D")?p="D":c.includes("M")?p="M":c.includes("R")?p="R":p=c.trim()[0]||"?";let f=i[u]||{added:0,deleted:0};if(p==="?")try{let m=wi.default.join(e,u);if(Ut.default.existsSync(m)&&!vR(u)){let y=Ut.default.readFileSync(m,"utf-8");f.added=y.split(`
136
- `).length,f.deleted=0}}catch{}s.push({status:p,path:u,added:f.added,deleted:f.deleted})}t({success:!0,files:s})}catch{t({success:!1,error:"Not a git repository or git not available"})}}),r.on("gitFileStatus",({repoPath:e,filePath:t},n)=>{try{let i=wi.default.relative(e,t),o=(0,Mr.execSync)(`git status --porcelain -- "${i}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).trim();if(!o)return n({success:!0,status:null});let a=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!a)return n({success:!0,status:null});let c=a[1],u;c.includes("?")?u="?":c.includes("A")?u="A":c.includes("D")?u="D":c.includes("M")?u="M":c.includes("R")?u="R":u=c.trim()[0]||"?",n({success:!0,status:u,file:i})}catch{n({success:!0,status:null})}}),r.on("gitDiff",({repoPath:e,file:t,status:n},i)=>{try{let s="";if(t&&n==="?"){let o=wi.default.join(e,t);if(Ut.default.existsSync(o)){let c=Ut.default.readFileSync(o,"utf-8").split(`
135
+ `).filter(Boolean)){let a=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!a)continue;let c=a[1],u=a[2];if(!u)continue;let p;c.includes("?")?p="?":c.includes("A")?p="A":c.includes("D")?p="D":c.includes("M")?p="M":c.includes("R")?p="R":p=c.trim()[0]||"?";let f=i[u]||{added:0,deleted:0};if(p==="?")try{let m=Si.default.join(e,u);if(Ut.default.existsSync(m)&&!wR(u)){let y=Ut.default.readFileSync(m,"utf-8");f.added=y.split(`
136
+ `).length,f.deleted=0}}catch{}s.push({status:p,path:u,added:f.added,deleted:f.deleted})}t({success:!0,files:s})}catch{t({success:!1,error:"Not a git repository or git not available"})}}),r.on("gitFileStatus",({repoPath:e,filePath:t},n)=>{try{let i=Si.default.relative(e,t),o=(0,Mr.execSync)(`git status --porcelain -- "${i}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).trim();if(!o)return n({success:!0,status:null});let a=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!a)return n({success:!0,status:null});let c=a[1],u;c.includes("?")?u="?":c.includes("A")?u="A":c.includes("D")?u="D":c.includes("M")?u="M":c.includes("R")?u="R":u=c.trim()[0]||"?",n({success:!0,status:u,file:i})}catch{n({success:!0,status:null})}}),r.on("gitDiff",({repoPath:e,file:t,status:n},i)=>{try{let s="";if(t&&n==="?"){let o=Si.default.join(e,t);if(Ut.default.existsSync(o)){let c=Ut.default.readFileSync(o,"utf-8").split(`
137
137
  `);s=`diff --git a/${t} b/${t}
138
138
  new file mode 100644
139
139
  --- /dev/null
@@ -141,7 +141,7 @@ new file mode 100644
141
141
  @@ -0,0 +1,${c.length} @@
142
142
  ${c.map(u=>`+${u}`).join(`
143
143
  `)}`}}else if(t)s=(0,Mr.execSync)(`git diff HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0});else{s=(0,Mr.execSync)("git diff HEAD",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0});let a=(0,Mr.execSync)("git status --porcelain",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).trim().split(`
144
- `).filter(c=>c.startsWith("??")).map(c=>c.substring(3));for(let c of a){let u=wi.default.join(e,c);if(Ut.default.existsSync(u)&&!vR(c))try{if(Ut.default.statSync(u).size<=512e3){let m=Ut.default.readFileSync(u,"utf-8").split(`
144
+ `).filter(c=>c.startsWith("??")).map(c=>c.substring(3));for(let c of a){let u=Si.default.join(e,c);if(Ut.default.existsSync(u)&&!wR(c))try{if(Ut.default.statSync(u).size<=512e3){let m=Ut.default.readFileSync(u,"utf-8").split(`
145
145
  `);s+=`
146
146
  diff --git a/${c} b/${c}
147
147
  new file mode 100644
@@ -149,8 +149,8 @@ new file mode 100644
149
149
  +++ b/${c}
150
150
  @@ -0,0 +1,${m.length} @@
151
151
  ${m.map(y=>`+${y}`).join(`
152
- `)}`}}catch{}}}i({success:!0,diff:s})}catch(s){i({success:!1,error:s.message})}}),r.on("gitBranch",async({repoPath:e},t)=>{let n=await bi(["branch","--show-current"],e);if(n.code!==0)return t({success:!1});t({success:!0,branch:n.stdout.trim()})}),r.on("gitAdd",async({repoPath:e,files:t},n)=>{try{let i=Array.isArray(t)&&t.length?t:["."],s=await bi(["add","--",...i],e);if(s.code!==0)return n({success:!1,error:s.stderr.trim()});n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("gitReset",async({repoPath:e,files:t},n)=>{try{let i=Array.isArray(t)&&t.length?t:["."],s=await bi(["reset","HEAD","--",...i],e);n({success:s.code===0,error:s.code===0?void 0:s.stderr.trim()})}catch(i){n({success:!1,error:i.message})}}),r.on("gitCommit",async({repoPath:e,message:t},n)=>{try{if(!t)return n({success:!1,error:"Empty message"});let i=await bi(["commit","-m",t],e),s=(i.stdout+i.stderr).trim();if(i.code!==0)return n({success:!1,output:s,error:i.stderr.trim()});n({success:!0,output:s})}catch(i){n({success:!1,error:i.message})}}),r.on("gitPush",async({repoPath:e},t)=>{try{let n=await bi(["push"],e),i=(n.stdout+n.stderr).trim();if(n.code!==0)return t({success:!1,output:i,error:n.stderr.trim()});t({success:!0,output:i})}catch(n){t({success:!1,error:n.message})}}),r.on("gitPull",async({repoPath:e},t)=>{try{let n=await bi(["pull"],e),i=(n.stdout+n.stderr).trim();if(n.code!==0)return t({success:!1,output:i,error:n.stderr.trim()});t({success:!0,output:i})}catch(n){t({success:!1,error:n.message})}}),r.on("gitLog",async({repoPath:e,limit:t},n)=>{try{let i=typeof t=="number"&&t>0?t:20,s=await bi(["log","-n",String(i),"--pretty=format:%h%x09%s"],e);if(s.code!==0)return n({success:!1,error:s.stderr.trim()});let o=s.stdout.split(`
153
- `).filter(Boolean).map(a=>{let[c,...u]=a.split(" ");return{hash:c,message:u.join(" ")}});n({success:!0,commits:o})}catch(i){n({success:!1,error:i.message})}}),r.on("gitDiscard",({repoPath:e,file:t,status:n},i)=>{try{if(!t)return i({success:!1,error:"No file specified"});let s=wi.default.join(e,t);n==="?"?Ut.default.existsSync(s)&&(Ut.default.statSync(s).isDirectory()?Ut.default.rmSync(s,{recursive:!0}):Ut.default.unlinkSync(s)):n==="A"?((0,Mr.execSync)(`git reset HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),Ut.default.existsSync(s)&&Ut.default.unlinkSync(s)):(0,Mr.execSync)(`git checkout HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),i({success:!0})}catch(s){i({success:!1,error:s.message})}})}function yR(r){r.on("connection",e=>{gR(e),xR(e)})}fi();var En=require("fs"),bR=require("path");gt();oh();var _R=oe.CONFIG,wg=(0,bR.join)(oe.CONFIG,"approvedDevices.json"),Yr=new Map,Ws=!1,va=new Map,Gs=new Map;function wR(){(0,En.existsSync)(_R)||(0,En.mkdirSync)(_R,{recursive:!0})}function SR(){try{if(wR(),(0,En.existsSync)(wg)){let r=JSON.parse((0,En.readFileSync)(wg,"utf8"));Array.isArray(r)?Yr=new Map(r.map(e=>[e,{approvedAt:null}])):Yr=new Map(Object.entries(r))}}catch{Yr=new Map}}function Sg(){try{wR(),(0,En.writeFileSync)(wg,JSON.stringify(Object.fromEntries(Yr),null,2))}catch{}}function ER(r){return r?Yr.has(r):!1}function Bu(r){r&&(Yr.set(r,{approvedAt:new Date().toISOString()}),Sg())}function TR(r){Yr.delete(r),Sg()}function CR(r,e){let t=Yr.get(r);return t?(Yr.set(r,{...t,label:e||""}),Sg(),!0):!1}function AR(){return[...Yr.entries()].map(([r,e])=>({deviceId:r,...e}))}function RR(r,e){va.set(r,e)}function Eg(r){return va.get(r)||null}function ju(r){va.delete(r)}function kR(r){if(!r)return!1;for(let e of va.values())if(e.deviceId===r)return!0;return!1}function OR(){return[...va.entries()].map(([r,e])=>({socketId:r,...e}))}function PR(r,e){r&&Gs.set(r,{...e,rejectedAt:new Date().toISOString()})}function MR(r){return r?Gs.has(r):!1}function IR(r,e,t){let n=Gs.get(r);n&&Gs.set(r,{...n,socketId:e,ip:t})}function NR(){return[...Gs.entries()].map(([r,e])=>({deviceId:r,...e}))}function zs(r){Gs.delete(r)}function LR(){return Ws=!!jo().autoApprove,Ws}function Fu(){return Ws}function DR(r){return Ws=!!r,wl({autoApprove:Ws}),Ws}function FR(){try{let r=(0,jR.join)(oe.ROOT,"keys.json");return JSON.parse((0,BR.readFileSync)(r,"utf8")).key||null}catch{return null}}var Ks=null;function ya(){return Ks}function xa(r){r.handshake.auth?.tempKey&&(xt("One-time key used \u2014 clearing from UI"),Fw()),xU(r)}function xU(r){if(r.data.protocol)return;let{webrtc:e,streaming:t}=Z,n=new il(r,{enableWebRTC:e.enableWebRTC,apiKey:e.enableTurn?FR():null,turnApiUrl:e.enableTurn?e.turnApiUrl:null,turnRefreshInterval:e.turnRefreshInterval,dcMaxMessageSize:e.dcMaxMessageSize,dcChunkSize:e.dcChunkSize,dcMaxTilesPerFrame:e.dcMaxTilesPerFrame,answerTimeout:e.answerTimeout,wsChunkSize:t.chunkSize});r.data.protocol=n,Yb(n),n.init().then(()=>n.setupSignaling(r)).catch(i=>console.error("[transport] pm init failed:",i.message)),n.attachAsBus(r)}function HR(r){let e=Ks;if(!e)return!1;let t=e.sockets.sockets.get(r),n=Eg(r);return!t||!n?!1:(Bu(n.deviceId),ju(r),zs(n.deviceId),t.data.approved=!0,t.emit("device:approved"),xa(t),xt(`Device approved: ${n.deviceId.slice(0,8)}...`),!0)}function $R(r){let e=Ks;if(!e||!r)return!1;Bu(r),zs(r);for(let t of e.sockets.sockets.values())t.handshake.auth?.deviceId===r&&(t.data.approved=!0,t.emit("device:approved"),xa(t));return xt(`Device approved from pending: ${r.slice(0,8)}...`),!0}function Hu(r){let e=Ks;if(!e||!r)return 0;let t=0;for(let n of e.sockets.sockets.values())n.handshake.auth?.deviceId===r&&(n.disconnect(!0),t++);return t&&xt(`Disconnected ${t} socket(s) for device ${r.slice(0,8)}...`),t}function qR(r){let e=Ks;if(!e)return!1;let t=Eg(r),n=e.sockets.sockets.get(r);return ju(r),t?.deviceId&&PR(t.deviceId,{ip:t.ip,socketId:r}),n&&(n.emit("device:rejected"),n.disconnect(!0)),St("deviceApproval",{action:"refresh"}),xt(`Device rejected: ${t?.deviceId?.slice(0,8)||"unknown"}...`),!0}async function UR(r){SR(),LR();let e=new Nb(r,{cors:{origin:"*",methods:["GET","POST"],credentials:!0,allowedHeaders:["*"]},transports:["websocket","polling"],allowEIO3:!0,allowUpgrades:!0,pingTimeout:6e4,pingInterval:25e3,maxHttpBufferSize:1e8}),t=await ES();return Hw(t),e.on("connection",n=>{let i=n.handshake.headers["x-forwarded-for"]||n.handshake.address||"unknown",s=n.handshake.auth?.deviceId||null;n.data.approved=!1,n.use((f,m)=>{if(n.data.approved)return m();let y=f[0];return y==="device:clientReady"||y==="disconnect"?m():m(new Error("Device not approved"))});let o=n.handshake.address||"",a=o==="127.0.0.1"||o==="::1"||o==="::ffff:127.0.0.1",c=!!n.handshake.headers["cf-connecting-ip"],u=n.handshake.headers.origin,p=!u||La.includes(u);if(!c&&a&&p&&Bb(n.handshake.auth?.localToken)){n.data.approved=!0,n.data.localUi=!0,xt("Local UI connected \u2014 trusted (token)"),xa(n);return}if(Uw(n.id,i,s),xt(`Client connected: ${i} (device: ${s?.slice(0,8)||"none"})`),n.on("disconnect",f=>{Ww(n.id),ju(n.id),xt(`Client disconnected: ${i} (${f})`);let m=n.data?.protocol;if(m&&!n.data?.remoteAttached){try{m.close()}catch{}sl(m)}}),s&&ER(s))xt(`Device recognized: ${s.slice(0,8)}...`),n.data.approved=!0,xa(n);else if(s&&MR(s))IR(s,n.id,i),xt(`Rejected device reconnected: ${s.slice(0,8)} \u2014 waiting in Clients list`),n.emit("device:rejected"),St("deviceApproval",{action:"refresh"});else if(s&&Fu())Bu(s),zs(s),n.data.approved=!0,xt(`Auto-approved device: ${s.slice(0,8)}...`),xa(n),n.once("device:clientReady",()=>n.emit("device:approved")),St("deviceApproval",{action:"refresh"});else{if(xt(`Unknown device: ${s?.slice(0,8)||"no-id"} \u2014 waiting for approval`),kR(s)){xt(`Device ${s?.slice(0,8)} already pending, ignoring duplicate`),n.disconnect(!0);return}RR(n.id,{deviceId:s,ip:i}),n.once("device:clientReady",()=>{n.emit("device:pendingApproval"),St("deviceApproval",{socketId:n.id,deviceId:s,ip:i,action:"pending"})})}}),LT(e,FR()),yR(e),Ks=e,e}function WR(r){r.setHeader("Access-Control-Allow-Origin","*"),r.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS"),r.setHeader("Access-Control-Allow-Headers","Authorization, Content-Type"),r.setHeader("Access-Control-Max-Age","86400")}function GR(r,e){return r.method==="OPTIONS"?(e.writeHead(200),e.end(),!0):!1}var Ys=require("zlib"),Ak=X(Sk(),1);var YU=["data:","javascript:","#","mailto:","blob:"],XU=["href","src","action","srcset","poster","data","formaction","data-src","data-href","data-url","data-background"];function Wu(r,e){return!r||YU.some(t=>r.startsWith(t))||r.startsWith("/proxy/")?r:r.startsWith(`http://localhost:${e}`)?r.replace(`http://localhost:${e}`,`/proxy/${e}`):r.startsWith("/")&&!r.startsWith("//")?`/proxy/${e}${r}`:r}function Ek(r,e){let t=`/proxy/${e}`,n=new RegExp(`(${XU.join("|")})=(["'])([^"']*?)\\2`,"gi");return r=r.replace(n,(i,s,o,a)=>{if(s.toLowerCase()==="srcset"){let c=a.split(",").map(u=>{let[p,...f]=u.trim().split(/\s+/),m=Wu(p,e);return f.length?`${m} ${f.join(" ")}`:m}).join(", ");return`${s}=${o}${c}${o}`}return`${s}=${o}${Wu(a,e)}${o}`}),r=r.replace(/url\(\s*(["']?)(\/_next\/[^)"']+)\1\s*\)/gi,(i,s,o)=>`url(${s}${t}${o}${s})`),r=r.replace(/"(\/_next\/[^"]+)"/g,(i,s)=>`"${t}${s}"`),r}function Tk(r){let e=`/proxy/${r}`;return`
152
+ `)}`}}catch{}}}i({success:!0,diff:s})}catch(s){i({success:!1,error:s.message})}}),r.on("gitBranch",async({repoPath:e},t)=>{let n=await wi(["branch","--show-current"],e);if(n.code!==0)return t({success:!1});t({success:!0,branch:n.stdout.trim()})}),r.on("gitAdd",async({repoPath:e,files:t},n)=>{try{let i=Array.isArray(t)&&t.length?t:["."],s=await wi(["add","--",...i],e);if(s.code!==0)return n({success:!1,error:s.stderr.trim()});n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("gitReset",async({repoPath:e,files:t},n)=>{try{let i=Array.isArray(t)&&t.length?t:["."],s=await wi(["reset","HEAD","--",...i],e);n({success:s.code===0,error:s.code===0?void 0:s.stderr.trim()})}catch(i){n({success:!1,error:i.message})}}),r.on("gitCommit",async({repoPath:e,message:t},n)=>{try{if(!t)return n({success:!1,error:"Empty message"});let i=await wi(["commit","-m",t],e),s=(i.stdout+i.stderr).trim();if(i.code!==0)return n({success:!1,output:s,error:i.stderr.trim()});n({success:!0,output:s})}catch(i){n({success:!1,error:i.message})}}),r.on("gitPush",async({repoPath:e},t)=>{try{let n=await wi(["push"],e),i=(n.stdout+n.stderr).trim();if(n.code!==0)return t({success:!1,output:i,error:n.stderr.trim()});t({success:!0,output:i})}catch(n){t({success:!1,error:n.message})}}),r.on("gitPull",async({repoPath:e},t)=>{try{let n=await wi(["pull"],e),i=(n.stdout+n.stderr).trim();if(n.code!==0)return t({success:!1,output:i,error:n.stderr.trim()});t({success:!0,output:i})}catch(n){t({success:!1,error:n.message})}}),r.on("gitLog",async({repoPath:e,limit:t},n)=>{try{let i=typeof t=="number"&&t>0?t:20,s=await wi(["log","-n",String(i),"--pretty=format:%h%x09%s"],e);if(s.code!==0)return n({success:!1,error:s.stderr.trim()});let o=s.stdout.split(`
153
+ `).filter(Boolean).map(a=>{let[c,...u]=a.split(" ");return{hash:c,message:u.join(" ")}});n({success:!0,commits:o})}catch(i){n({success:!1,error:i.message})}}),r.on("gitDiscard",({repoPath:e,file:t,status:n},i)=>{try{if(!t)return i({success:!1,error:"No file specified"});let s=Si.default.join(e,t);n==="?"?Ut.default.existsSync(s)&&(Ut.default.statSync(s).isDirectory()?Ut.default.rmSync(s,{recursive:!0}):Ut.default.unlinkSync(s)):n==="A"?((0,Mr.execSync)(`git reset HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),Ut.default.existsSync(s)&&Ut.default.unlinkSync(s)):(0,Mr.execSync)(`git checkout HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),i({success:!0})}catch(s){i({success:!1,error:s.message})}})}function ER(r){bR(r),SR(r)}$n();var Tn=require("fs"),CR=require("path");vt();ah();var TR=oe.CONFIG,Sg=(0,CR.join)(oe.CONFIG,"approvedDevices.json"),Yr=new Map,Gs=!1,xa=new Map,zs=new Map;function AR(){(0,Tn.existsSync)(TR)||(0,Tn.mkdirSync)(TR,{recursive:!0})}function RR(){try{if(AR(),(0,Tn.existsSync)(Sg)){let r=JSON.parse((0,Tn.readFileSync)(Sg,"utf8"));Array.isArray(r)?Yr=new Map(r.map(e=>[e,{approvedAt:null}])):Yr=new Map(Object.entries(r))}}catch{Yr=new Map}}function Eg(){try{AR(),(0,Tn.writeFileSync)(Sg,JSON.stringify(Object.fromEntries(Yr),null,2))}catch{}}function kR(r){return r?Yr.has(r):!1}function ju(r){r&&(Yr.set(r,{approvedAt:new Date().toISOString()}),Eg())}function OR(r){Yr.delete(r),Eg()}function PR(r,e){let t=Yr.get(r);return t?(Yr.set(r,{...t,label:e||""}),Eg(),!0):!1}function MR(){return[...Yr.entries()].map(([r,e])=>({deviceId:r,...e}))}function IR(r,e){xa.set(r,e)}function Tg(r){return xa.get(r)||null}function Fu(r){xa.delete(r)}function NR(r){if(!r)return!1;for(let e of xa.values())if(e.deviceId===r)return!0;return!1}function LR(){return[...xa.entries()].map(([r,e])=>({socketId:r,...e}))}function DR(r,e){r&&zs.set(r,{...e,rejectedAt:new Date().toISOString()})}function BR(r){return r?zs.has(r):!1}function jR(r,e,t){let n=zs.get(r);n&&zs.set(r,{...n,socketId:e,ip:t})}function FR(){return[...zs.entries()].map(([r,e])=>({deviceId:r,...e}))}function Ks(r){zs.delete(r)}function HR(){return Gs=!!Fo().autoApprove,Gs}function Hu(){return Gs}function $R(r){return Gs=!!r,wl({autoApprove:Gs}),Gs}function Cg(){try{let r=(0,UR.join)(oe.ROOT,"keys.json");return JSON.parse((0,qR.readFileSync)(r,"utf8")).key||null}catch{return null}}var Ei=null;function _a(){return Ei}async function ya(r){r.handshake.auth?.tempKey&&(Te("One-time key used \u2014 clearing from UI"),$w()),await wU(r),ER(r),await HT(r,Ei,Cg())}async function wU(r){if(r.data.protocol)return;let{webrtc:e,streaming:t}=Z,n=new sl(r,{enableWebRTC:e.enableWebRTC,apiKey:e.enableTurn?Cg():null,turnApiUrl:e.enableTurn?e.turnApiUrl:null,turnRefreshInterval:e.turnRefreshInterval,dcMaxMessageSize:e.dcMaxMessageSize,dcChunkSize:e.dcChunkSize,dcMaxTilesPerFrame:e.dcMaxTilesPerFrame,answerTimeout:e.answerTimeout,wsChunkSize:t.chunkSize});r.data.protocol=n,Jb(n),n.attachAsBus(r);try{await n.init(),n.setupSignaling(r)}catch(i){console.error("[transport] pm init failed:",i.message)}}function WR(r){let e=Ei;if(!e)return!1;let t=e.sockets.sockets.get(r),n=Tg(r);return!t||!n?!1:(ju(n.deviceId),Fu(r),Ks(n.deviceId),t.data.approved=!0,t.emit("device:approved"),ya(t),Te(`Device approved: ${n.deviceId.slice(0,8)}...`),!0)}function GR(r){let e=Ei;if(!e||!r)return!1;ju(r),Ks(r);for(let t of e.sockets.sockets.values())t.handshake.auth?.deviceId===r&&(t.data.approved=!0,t.emit("device:approved"),ya(t));return Te(`Device approved from pending: ${r.slice(0,8)}...`),!0}function $u(r){let e=Ei;if(!e||!r)return 0;let t=0;for(let n of e.sockets.sockets.values())n.handshake.auth?.deviceId===r&&(n.disconnect(!0),t++);return t&&Te(`Disconnected ${t} socket(s) for device ${r.slice(0,8)}...`),t}function zR(r){let e=Ei;if(!e)return!1;let t=Tg(r),n=e.sockets.sockets.get(r);return Fu(r),t?.deviceId&&DR(t.deviceId,{ip:t.ip,socketId:r}),n&&(n.emit("device:rejected"),n.disconnect(!0)),St("deviceApproval",{action:"refresh"}),Te(`Device rejected: ${t?.deviceId?.slice(0,8)||"unknown"}...`),!0}async function KR(r){RR(),HR();let e=new Db(r,{cors:{origin:"*",methods:["GET","POST"],credentials:!0,allowedHeaders:["*"]},transports:["websocket","polling"],allowEIO3:!0,allowUpgrades:!0,pingTimeout:6e4,pingInterval:25e3,maxHttpBufferSize:1e8}),t=await AS();return qw(t),e.on("connection",n=>{let i=n.handshake.headers["x-forwarded-for"]||n.handshake.address||"unknown",s=n.handshake.auth?.deviceId||null;n.data.approved=!1,n.use((f,m)=>{if(n.data.approved)return m();let y=f[0];return y==="device:clientReady"||y==="disconnect"?m():m(new Error("Device not approved"))});let o=n.handshake.address||"",a=o==="127.0.0.1"||o==="::1"||o==="::ffff:127.0.0.1",c=!!n.handshake.headers["cf-connecting-ip"],u=n.handshake.headers.origin,p=!u||Da.includes(u);if(!c&&a&&p&&Fb(n.handshake.auth?.localToken)){n.data.approved=!0,n.data.localUi=!0,Te("Local UI connected \u2014 trusted (token)"),ya(n);return}if(Gw(n.id,i,s),Te(`Client connected: ${i} (device: ${s?.slice(0,8)||"none"})`),n.on("disconnect",f=>{zw(n.id),Fu(n.id),Te(`Client disconnected: ${i} (${f})`);let m=n.data?.protocol;if(m&&!n.data?.remoteAttached){try{m.close()}catch{}ol(m)}}),s&&kR(s))Te(`Device recognized: ${s.slice(0,8)}...`),n.data.approved=!0,ya(n);else if(s&&BR(s))jR(s,n.id,i),Te(`Rejected device reconnected: ${s.slice(0,8)} \u2014 waiting in Clients list`),n.emit("device:rejected"),St("deviceApproval",{action:"refresh"});else if(s&&Hu())ju(s),Ks(s),n.data.approved=!0,Te(`Auto-approved device: ${s.slice(0,8)}...`),ya(n),n.once("device:clientReady",()=>n.emit("device:approved")),St("deviceApproval",{action:"refresh"});else{if(Te(`Unknown device: ${s?.slice(0,8)||"no-id"} \u2014 waiting for approval`),NR(s)){Te(`Device ${s?.slice(0,8)} already pending, ignoring duplicate`),n.disconnect(!0);return}IR(n.id,{deviceId:s,ip:i}),n.once("device:clientReady",()=>{n.emit("device:pendingApproval"),St("deviceApproval",{socketId:n.id,deviceId:s,ip:i,action:"pending"})})}}),du(e,Cg()),Ei=e,e}function VR(r){r.setHeader("Access-Control-Allow-Origin","*"),r.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS"),r.setHeader("Access-Control-Allow-Headers","Authorization, Content-Type"),r.setHeader("Access-Control-Max-Age","86400")}function YR(r,e){return r.method==="OPTIONS"?(e.writeHead(200),e.end(),!0):!1}var Ys=require("zlib"),Pk=X(Ak(),1);var ZU=["data:","javascript:","#","mailto:","blob:"],e4=["href","src","action","srcset","poster","data","formaction","data-src","data-href","data-url","data-background"];function Gu(r,e){return!r||ZU.some(t=>r.startsWith(t))||r.startsWith("/proxy/")?r:r.startsWith(`http://localhost:${e}`)?r.replace(`http://localhost:${e}`,`/proxy/${e}`):r.startsWith("/")&&!r.startsWith("//")?`/proxy/${e}${r}`:r}function Rk(r,e){let t=`/proxy/${e}`,n=new RegExp(`(${e4.join("|")})=(["'])([^"']*?)\\2`,"gi");return r=r.replace(n,(i,s,o,a)=>{if(s.toLowerCase()==="srcset"){let c=a.split(",").map(u=>{let[p,...f]=u.trim().split(/\s+/),m=Gu(p,e);return f.length?`${m} ${f.join(" ")}`:m}).join(", ");return`${s}=${o}${c}${o}`}return`${s}=${o}${Gu(a,e)}${o}`}),r=r.replace(/url\(\s*(["']?)(\/_next\/[^)"']+)\1\s*\)/gi,(i,s,o)=>`url(${s}${t}${o}${s})`),r=r.replace(/"(\/_next\/[^"]+)"/g,(i,s)=>`"${t}${s}"`),r}function kk(r){let e=`/proxy/${r}`;return`
154
154
  // Service Worker for 9Remote Proxy - Port ${r}
155
155
  const PROXY_BASE = '${e}';
156
156
  const TARGET_PORT = ${r};
@@ -205,7 +205,7 @@ self.addEventListener('fetch', (event) => {
205
205
 
206
206
  event.respondWith(fetch(new Request(newUrl, requestInit)));
207
207
  });
208
- `}function Ck(r){return`
208
+ `}function Ok(r){return`
209
209
  <script data-proxy-injected="true">
210
210
  (function() {
211
211
  if (window.__proxySwRegistered) return;
@@ -247,7 +247,7 @@ self.addEventListener('fetch', (event) => {
247
247
  });
248
248
  }
249
249
  })();
250
- </script>`}var $g=new Set;function Rk(r){$g.add(String(r))}function kk(r){$g.delete(String(r))}function JU(r){return $g.has(String(r))}function QU(r){switch(r){case"gzip":return(0,Ys.createGunzip)();case"deflate":return(0,Ys.createInflate)();case"br":return(0,Ys.createBrotliDecompress)();default:return null}}function ZU(r,e){if(r.includes("<head>"))return r.replace("<head>","<head>"+e);if(r.includes("<HEAD>"))return r.replace("<HEAD>","<HEAD>"+e);let t=r.match(/<head[^>]*>/i);return t?r.replace(t[0],t[0]+e):e+r}function Ok(){"";let r=Ak.default.createProxyServer({selfHandleResponse:!0});return r.on("proxyRes",(e,t,n)=>{let i=t._proxyTargetPort,s=e.headers["content-type"]||"",o=e.headers["content-encoding"]||"",a=s.includes("text/html"),c={...e.headers};if(c.location&&(c.location=Wu(c.location,i)),s.includes("application/json")||s.includes("text/x-component")){n.writeHead(e.statusCode,c),e.pipe(n);return}if(s.includes("javascript")||s.includes("text/javascript")){n.writeHead(e.statusCode,c),e.pipe(n);return}if(!a){n.writeHead(e.statusCode,c),e.pipe(n);return}delete c["content-length"],delete c["content-encoding"];let f=QU(o),m=f?e.pipe(f):e,y=[];m.on("data",_=>y.push(_)),m.on("error",_=>{console.error("[Proxy] Decompress error:",_.message),n.writeHead(502),n.end("Bad Gateway: Decompression failed")}),m.on("end",()=>{let _=Buffer.concat(y).toString("utf8");_=Ek(_,i);let S=Ck(i);_=ZU(_,S),n.writeHead(e.statusCode,c),n.end(_)})}),r}function Pk(r,e,t,n,i,s){if(i==="/sw.js"){let o=Tk(n);t.writeHead(200,{"Content-Type":"application/javascript; charset=utf-8","Service-Worker-Allowed":"/","Cache-Control":"no-store, no-cache, must-revalidate"}),t.end(o);return}if(!JU(n)){t.writeHead(401,{"Content-Type":"text/html"}),t.end(`
250
+ </script>`}var Ug=new Set;function Mk(r){Ug.add(String(r))}function Ik(r){Ug.delete(String(r))}function t4(r){return Ug.has(String(r))}function r4(r){switch(r){case"gzip":return(0,Ys.createGunzip)();case"deflate":return(0,Ys.createInflate)();case"br":return(0,Ys.createBrotliDecompress)();default:return null}}function n4(r,e){if(r.includes("<head>"))return r.replace("<head>","<head>"+e);if(r.includes("<HEAD>"))return r.replace("<HEAD>","<HEAD>"+e);let t=r.match(/<head[^>]*>/i);return t?r.replace(t[0],t[0]+e):e+r}function Nk(){"";let r=Pk.default.createProxyServer({selfHandleResponse:!0});return r.on("proxyRes",(e,t,n)=>{let i=t._proxyTargetPort,s=e.headers["content-type"]||"",o=e.headers["content-encoding"]||"",a=s.includes("text/html"),c={...e.headers};if(c.location&&(c.location=Gu(c.location,i)),s.includes("application/json")||s.includes("text/x-component")){n.writeHead(e.statusCode,c),e.pipe(n);return}if(s.includes("javascript")||s.includes("text/javascript")){n.writeHead(e.statusCode,c),e.pipe(n);return}if(!a){n.writeHead(e.statusCode,c),e.pipe(n);return}delete c["content-length"],delete c["content-encoding"];let f=r4(o),m=f?e.pipe(f):e,y=[];m.on("data",_=>y.push(_)),m.on("error",_=>{console.error("[Proxy] Decompress error:",_.message),n.writeHead(502),n.end("Bad Gateway: Decompression failed")}),m.on("end",()=>{let _=Buffer.concat(y).toString("utf8");_=Rk(_,i);let S=Ok(i);_=n4(_,S),n.writeHead(e.statusCode,c),n.end(_)})}),r}function Lk(r,e,t,n,i,s){if(i==="/sw.js"){let o=kk(n);t.writeHead(200,{"Content-Type":"application/javascript; charset=utf-8","Service-Worker-Allowed":"/","Cache-Control":"no-store, no-cache, must-revalidate"}),t.end(o);return}if(!t4(n)){t.writeHead(401,{"Content-Type":"text/html"}),t.end(`
251
251
  <!DOCTYPE html>
252
252
  <html>
253
253
  <head><title>Unauthorized</title></head>
@@ -258,8 +258,8 @@ self.addEventListener('fetch', (event) => {
258
258
  </div>
259
259
  </body>
260
260
  </html>
261
- `);return}e._proxyTargetPort=n,e.url=i+(s||""),r.web(e,t,{target:`http://localhost:${n}`,changeOrigin:!0},o=>{t.writeHead(502),t.end(`Bad Gateway: ${o.message}`)})}var Mk=X(require("http"),1),Ik=X(require("https"),1),Nk=require("child_process"),Lk=require("util"),e4=(0,Lk.promisify)(Nk.exec);async function t4(){let r=process.platform,e=new Set([80,443]);try{let t;if(r==="win32")t="netstat -ano | findstr LISTENING";else{let s="/dev/null";t=`lsof -iTCP -sTCP:LISTEN -P -n 2>${s} || netstat -tlnp 2>${s}`}let{stdout:n}=await e4(t),i=n.split(`
262
- `);for(let s of i){let o=s.match(/[:\*\]](\d{2,5})(?:\s|$)/g);if(o)for(let a of o){let c=parseInt(a.replace(/[:\*\]\s]/g,""),10);c>0&&c<=65535&&(c===80||c===443||c>=1024)&&e.add(c)}}return Array.from(e)}catch(t){return console.error("Failed to get listening ports:",t.message),[80,443,3e3,3001,4200,5e3,5173,8e3,8080,9e3]}}function r4(r,e=2e3){return new Promise(t=>{let n=Mk.default.request({host:"localhost",port:r,method:"GET",path:"/",timeout:e},i=>{i.on("data",()=>{}),i.on("end",()=>{}),t({active:!0,protocol:"http",status:i.statusCode})});n.on("error",i=>{t({active:!1,error:i.message})}),n.on("timeout",()=>{n.destroy(),t({active:!1,error:"timeout"})}),n.end()})}function n4(r,e=2e3){return new Promise(t=>{let n=Ik.default.request({host:"localhost",port:r,method:"GET",path:"/",timeout:e,rejectUnauthorized:!1},i=>{i.on("data",()=>{}),i.on("end",()=>{}),t({active:!0,protocol:"https",status:i.statusCode})});n.on("error",i=>{t({active:!1,error:i.message})}),n.on("timeout",()=>{n.destroy(),t({active:!1,error:"timeout"})}),n.end()})}async function i4(r){let[e,t]=await Promise.all([r4(r),n4(r)]);return t.active?{port:r,...t}:e.active?{port:r,...e}:{port:r,active:!1}}async function Dk(){let r=await t4();return(await Promise.all(r.map(t=>i4(t)))).filter(t=>t.active).map(t=>({port:t.port,protocol:t.protocol,url:`${t.protocol}://localhost:${t.port}`,name:`localhost:${t.port}`,status:t.status})).sort((t,n)=>t.port-n.port)}var Bk=X(require("crypto"),1),s4=process.env.API_KEY_SECRET||"9remote-api-key-secret";function o4(){let r="abcdefghijklmnopqrstuvwxyz0123456789",e="";for(let t=0;t<4;t++)e+=r.charAt(Math.floor(Math.random()*r.length));return e}function jk(r,e){return Bk.default.createHmac("sha256",s4).update(r+e).digest("hex").slice(0,6)}function Fk(r){let e=r.slice(0,8),t=o4(),n=jk(e,t);return{key:`sk-${e}-${t}-${n}`,keyId:t}}function a4(r){if(!r||!r.startsWith("sk-"))return null;let e=r.split("-");if(e.length===4){let[,t,n,i]=e,s=jk(t,n);return i!==s?null:{machineId:t,keyId:n}}return null}function Gu(r){return a4(r)!==null}async function Hk(r,e){let t=r.headers.authorization;if(!t||!t.startsWith("Bearer ")){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Missing API key"}));return}let n=t.slice(7);if(!Gu(n)){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Invalid API key"}));return}let i=await Dk();e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify(i))}el();var Uk=require("url");var qg=X(require("path"),1),Wk=X(require("os"),1);gt();var $k=X(require("path"),1),qk=X(require("os"),1);var JK=$k.default.join(qk.default.homedir(),".9remote","pids");var nV=qg.default.dirname((0,Uk.fileURLToPath)(__importMetaUrl)),c4="9remote",iV=`https://registry.npmjs.org/${c4}/latest`;var sV=qg.default.join(Wk.default.homedir(),".9remote","cloudflared.pid");function Gk(r,e){let t=r.split(".").map(Number),n=e.split(".").map(Number);for(let i=0;i<3;i++){if(n[i]>t[i])return!0;if(n[i]<t[i])return!1}return!1}fi();Gt();gt();Mo();var Kk=X(zk(),1),Wg=X(require("crypto"),1),{machineIdSync:l4}=Kk.default;async function Vk(r=null){let e=r||process.env.MACHINE_ID_SALT||"9remote-salt";try{let t=l4();return Wg.default.createHash("sha256").update(t+e).digest("hex").substring(0,16)}catch(t){return console.error("Error getting machine ID:",t),Wg.default.randomUUID().replace(/-/g,"").substring(0,16)}}fi();async function Yk(r,e){let t=jw(),n=t.workerUrl||"https://9remote.cc";if(!t.permanentKey){he(e,400,"No permanent key set");return}try{let s=await(await eo(`${n}/api/temp-key/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t.permanentKey,expiryMinutes:30})})).json(),o=`${n}/login?k=${s.tempKey}`;Hn({oneTimeKey:s.tempKey,oneTimeKeyExpiresAt:s.expiresAt,qrUrl:o}),ee(e,{oneTimeKey:s.tempKey,expiresAt:s.expiresAt,qrUrl:o})}catch(i){he(e,500,i.message)}}async function Xk(r,e){try{let t=await Vk(),{key:n}=Fk(t),i=xw();yw(t,n,i?.name||"Default"),Hn({permanentKey:n}),ee(e,{ok:!0,permanentKey:n})}catch(t){he(e,500,t.message)}}Gt();async function Jk(r,e){let t=await It(r,e);if(!t)return;let n=HR(t.socketId);ee(e,{ok:n})}async function Qk(r,e){let t=await It(r,e);if(!t)return;let n=qR(t.socketId);ee(e,{ok:n})}function Zk(r,e){ee(e,{pending:OR()})}function eO(r,e){ee(e,{devices:AR()})}function tO(r,e){ee(e,{rejected:NR()})}async function rO(r,e){let t=await It(r,e);if(!t)return;let n=$R(t.deviceId);ee(e,{ok:n})}async function nO(r,e){let t=await It(r,e);t&&(Hu(t.deviceId),zs(t.deviceId),ee(e))}async function iO(r,e){let t=await It(r,e);t&&(Hu(t.deviceId),TR(t.deviceId),ee(e))}async function sO(r,e){let t=await It(r,e);if(!t)return;let n=Hu(t.deviceId);ee(e,{disconnected:n})}function oO(r,e){ee(e,{enabled:Fu()})}async function aO(r,e){let t=await It(r,e);if(!t)return;let n=CR(t.deviceId,t.label);ee(e,{ok:n})}async function cO(r,e){let t=await It(r,e);if(!t)return;let n=DR(!!t.enabled);ee(e,{enabled:n})}Gt();var lO={},u4=1e4;function uO(r,e){if(e)return{type:e.type||"stop",sessionId:e.sessionId||"",tool:e.tool||"claude"};let t=JSON.parse(r||"{}");return{type:t.type||"stop",sessionId:t.sessionId||"",tool:t.tool||"claude"}}async function pO(r,e){let t="";await new Promise(n=>{r.on("data",i=>t+=i),r.on("end",n)});try{dO(uO(t,null)),ee(e,{success:!0})}catch{he(e,400,"Invalid JSON")}}function fO(r,e,{query:t}){dO(uO(null,t)),ee(e,{success:!0})}function dO({type:r,sessionId:e,tool:t}){let n=Date.now(),i=ya();if(!i||!e)return;let s={type:r,sessionId:e,tool:t,timestamp:n};if(_T(e,s),wt(i,"chatNotification",s),!yT())return;let o=`${t}:${r}`;n-(lO[o]||0)<u4||(lO[o]=n,i.timeout(5e3).emit("chatNotificationAck",s,(a,c)=>{!a&&c&&c.length>0||vT(s)}))}Gt();Cl();Mo();bt();fi();function hO(){return{mode:ph(),active:uh(),presets:Object.keys(Z.sleepInhibit?.presets||{})}}function mO(r,e){ee(e,hO())}async function gO(r,e){let t=await It(r,e);if(!t)return;let n=Ho(t.mode);vw({sleepInhibitMode:n});let i=hO();St("sleepInhibit",i),ee(e,i)}Gt();async function vO(r,e){try{let t=await hl();ee(e,{sessions:t})}catch(t){he(e,500,t.message)}}async function xO(r,e){let t=await It(r,e);if(t){if(!t.sessionId)return he(e,400,"sessionId required");try{await ui(t.sessionId),ee(e)}catch(n){he(e,500,n.message)}}}Cl();Mo();bt();Ov();var zn=An("server"),Kn=(0,bO.fileURLToPath)(new URL(".",__importMetaUrl)),wO=process.env.NODE_ENV==="development",p4=5173,f4="https://registry.npmjs.org/9remote/latest",Gg=(0,Ci.existsSync)((0,tr.join)(Kn,"ui","dist"))?(0,tr.join)(Kn,"ui","dist"):(0,tr.join)(Kn,"ui"),d4={".html":"text/html",".js":"application/javascript",".css":"text/css",".svg":"image/svg+xml",".png":"image/png",".ico":"image/x-icon",".woff2":"font/woff2",".woff":"font/woff"};function h4(r,e,t){let n=(0,zu.request)({hostname:"localhost",port:p4,path:r.url,method:r.method,headers:r.headers},i=>{e.writeHead(i.statusCode,i.headers),i.pipe(e)});n.on("error",()=>t?t():void(e.writeHead(502),e.end("Vite dev server not ready"))),r.pipe(n)}function yO(r,e){if(!(0,Ci.existsSync)(e))return!1;let t=d4[(0,tr.extname)(e)]||"application/octet-stream";return r.setHeader("Content-Type",t),r.writeHead(200),r.end((0,Ci.readFileSync)(e)),!0}async function m4(r){try{let e=await eo(f4);if(!e.ok)return;let{version:t}=await e.json();t&&Gk(r,t)&&St("updateAvailable",{version:t})}catch{}}function g4(r,e){if(process.env.CODESPACES!=="true"){he(e,400,"Not running on Codespaces");return}let t=process.env.CODESPACE_NAME;if(!t){he(e,400,"Codespace name not found");return}let n=ya();n&&n.emit("codespace:stopping"),ee(e,{success:!0,message:"Stopping codespace..."}),setTimeout(()=>(0,Ku.execFile)("gh",["codespace","stop","-c",t],{windowsHide:!0}),500)}var SO;async function _O(r,e,{pathname:t}){let n=r.headers.authorization;if(!n||!n.startsWith("Bearer ")||!Gu(n.slice(7))){he(e,401,"Unauthorized");return}let{parseJsonBody:i}=await Promise.resolve().then(()=>(Gt(),ki)),s=await i(r,e);if(s){if(!s.port){he(e,400,"Port required");return}t.endsWith("start")?Rk(s.port):kk(s.port),ee(e,{success:!0})}}function v4(r,e,{pathname:t,search:n}){let i=t.match(/^\/proxy\/(\d+)(\/.*)?$/);i?Pk(SO,r,e,i[1],i[2]||"/",n):he(e,404,"Not found")}var x4=[{path:"/api/health",method:"GET",public:!0,handler:(r,e)=>ee(e,{status:"ok",timestamp:Date.now()})},{path:"/api/version",method:"GET",public:!0,handler:(r,e)=>{ee(e,{version:"2.0.26"})}},{path:"/api/notify",method:"POST",public:!0,handler:pO},{path:"/api/notify",method:"GET",public:!0,handler:fO},{path:"/proxy/*",method:"*",public:!0,handler:v4},{path:"/api/ui/events",method:"GET",handler:zw},{path:"/api/local-token",method:"GET",handler:qw},{path:"/api/ui/state",method:"GET",handler:Kw},{path:"/api/ui/state",method:"POST",handler:Vw},{path:"/api/ui/stop",method:"POST",handler:Yw},{path:"/api/ui/start",method:"POST",handler:Xw},{path:"/api/ui/shutdown",method:"POST",handler:Jw},{path:"/api/key/one-time",method:"POST",handler:Yk},{path:"/api/key/regenerate",method:"POST",handler:Xk},{path:"/api/device/approve",method:"POST",handler:Jk},{path:"/api/device/reject",method:"POST",handler:Qk},{path:"/api/device/pending",method:"GET",handler:Zk},{path:"/api/device/approved",method:"GET",handler:eO},{path:"/api/device/rejected",method:"GET",handler:tO},{path:"/api/device/approve-rejected",method:"POST",handler:rO},{path:"/api/device/clear-rejected",method:"POST",handler:nO},{path:"/api/device/remove",method:"POST",handler:iO},{path:"/api/device/label",method:"POST",handler:aO},{path:"/api/device/disconnect",method:"POST",handler:sO},{path:"/api/device/auto-approve",method:"GET",handler:oO},{path:"/api/device/auto-approve",method:"POST",handler:cO},{path:"/api/connections",method:"GET",handler:Qw},{path:"/api/logs",method:"GET",handler:Zw},{path:"/api/permissions",method:"GET",handler:tS},{path:"/api/permissions/request",method:"POST",handler:iS},{path:"/api/desktop/toggle",method:"POST",handler:eS},{path:"/api/autostart",method:"GET",handler:rS},{path:"/api/autostart",method:"POST",handler:nS},{path:"/api/sleep-inhibit",method:"GET",handler:mO},{path:"/api/sleep-inhibit",method:"POST",handler:gO},{path:"/api/sessions",method:"GET",handler:vO},{path:"/api/sessions/delete",method:"POST",handler:xO},{path:"/api/local-sites",method:"*",public:!0,handler:Hk},{path:"/api/codespace/stop",method:"POST",handler:g4},{path:"/api/proxy/start",method:"POST",public:!0,handler:_O},{path:"/api/proxy/end",method:"POST",public:!0,handler:_O}];var y4=parseInt(process.env.PORT||"2208",10),Ra=null;function _4(){if(!wO)return;let r=(0,tr.join)(Kn,"vite.config.js");if(!(0,Ci.existsSync)(r))return;let e=(0,Ci.existsSync)((0,tr.join)(Kn,"node_modules",".bin","vite"))?(0,tr.join)(Kn,"node_modules",".bin","vite"):(0,tr.join)(Kn,"..","node_modules",".bin","vite");Ra=(0,Ku.spawn)("node",[e,"--config",r],{cwd:Kn,stdio:"ignore",detached:!1}),Ra.on("error",()=>{}),Ra.unref()}async function EO(){let r=rh(),e=r.sleepInhibitMode;e||(r.sleepInhibit===!1?e="never":e=Z.sleepInhibit?.defaultMode||"never"),Ho(e),await NT(),SO=Ok(),_4();let n=vp(x4,{fallback:(a,c,{pathname:u})=>{if(u.startsWith("/api/")||u.startsWith("/socket.io")){he(c,404,"Not found");return}let p=!!a.headers["cf-connecting-ip"],f=a.socket.remoteAddress==="127.0.0.1"||a.socket.remoteAddress==="::1";if(p||!f){he(c,403,"Forbidden");return}let m=()=>{let y=u==="/"||u===""?(0,tr.join)(Gg,"index.html"):(0,tr.join)(Gg,u);yO(c,y)||yO(c,(0,tr.join)(Gg,"index.html"))};if(wO){h4(a,c,m);return}m()}}),i=(0,zu.createServer)(async(a,c)=>{WR(c),!GR(a,c)&&await n(a,c)});Bd(),Dw(),Bw(),Rl(),process.platform==="darwin"&&setInterval(Rl,Sv),await UR(i),i.listen(y4,a=>{if(a)throw a;m4("2.0.26")});let s=!1,o=async a=>{if(s)return;s=!0,lh(),zn.info(`\u{1F6D1} Received ${a}, shutting down gracefully...`);let c=setTimeout(()=>{zn.error("\u26A0\uFE0F Forced exit"),process.exit(1)},5e3);try{if(i.close(()=>zn.info("\u2713 HTTP server closed")),Ra)try{Ra.kill()}catch{}let u=ya();u&&(u.emit("server:shutdown"),u.close(()=>zn.info("\u2713 Socket.IO closed"))),await new Promise(p=>setTimeout(p,500)),clearTimeout(c),zn.info("\u2705 Server stopped cleanly"),process.exit(0)}catch(u){zn.error(`\u274C Error during shutdown: ${u?.message||u}`),clearTimeout(c),process.exit(1)}};return process.on("SIGINT",()=>o("SIGINT")),process.on("SIGTERM",()=>o("SIGTERM")),process.platform==="win32"&&process.on("SIGBREAK",()=>o("SIGBREAK")),process.on("uncaughtException",a=>{zn.error(`\u26A0\uFE0F uncaughtException: ${a?.stack||a}`)}),process.on("unhandledRejection",a=>{zn.error(`\u26A0\uFE0F unhandledRejection: ${a?.stack||a}`)}),i}EO();0&&(module.exports={startServer});
261
+ `);return}e._proxyTargetPort=n,e.url=i+(s||""),r.web(e,t,{target:`http://localhost:${n}`,changeOrigin:!0},o=>{t.writeHead(502),t.end(`Bad Gateway: ${o.message}`)})}var Dk=X(require("http"),1),Bk=X(require("https"),1),jk=require("child_process"),Fk=require("util"),i4=(0,Fk.promisify)(jk.exec);async function s4(){let r=process.platform,e=new Set([80,443]);try{let t;if(r==="win32")t="netstat -ano | findstr LISTENING";else{let s="/dev/null";t=`lsof -iTCP -sTCP:LISTEN -P -n 2>${s} || netstat -tlnp 2>${s}`}let{stdout:n}=await i4(t),i=n.split(`
262
+ `);for(let s of i){let o=s.match(/[:\*\]](\d{2,5})(?:\s|$)/g);if(o)for(let a of o){let c=parseInt(a.replace(/[:\*\]\s]/g,""),10);c>0&&c<=65535&&(c===80||c===443||c>=1024)&&e.add(c)}}return Array.from(e)}catch(t){return console.error("Failed to get listening ports:",t.message),[80,443,3e3,3001,4200,5e3,5173,8e3,8080,9e3]}}function o4(r,e=2e3){return new Promise(t=>{let n=Dk.default.request({host:"localhost",port:r,method:"GET",path:"/",timeout:e},i=>{i.on("data",()=>{}),i.on("end",()=>{}),t({active:!0,protocol:"http",status:i.statusCode})});n.on("error",i=>{t({active:!1,error:i.message})}),n.on("timeout",()=>{n.destroy(),t({active:!1,error:"timeout"})}),n.end()})}function a4(r,e=2e3){return new Promise(t=>{let n=Bk.default.request({host:"localhost",port:r,method:"GET",path:"/",timeout:e,rejectUnauthorized:!1},i=>{i.on("data",()=>{}),i.on("end",()=>{}),t({active:!0,protocol:"https",status:i.statusCode})});n.on("error",i=>{t({active:!1,error:i.message})}),n.on("timeout",()=>{n.destroy(),t({active:!1,error:"timeout"})}),n.end()})}async function c4(r){let[e,t]=await Promise.all([o4(r),a4(r)]);return t.active?{port:r,...t}:e.active?{port:r,...e}:{port:r,active:!1}}async function Hk(){let r=await s4();return(await Promise.all(r.map(t=>c4(t)))).filter(t=>t.active).map(t=>({port:t.port,protocol:t.protocol,url:`${t.protocol}://localhost:${t.port}`,name:`localhost:${t.port}`,status:t.status})).sort((t,n)=>t.port-n.port)}var $k=X(require("crypto"),1),l4=process.env.API_KEY_SECRET||"9remote-api-key-secret";function u4(){let r="abcdefghijklmnopqrstuvwxyz0123456789",e="";for(let t=0;t<4;t++)e+=r.charAt(Math.floor(Math.random()*r.length));return e}function qk(r,e){return $k.default.createHmac("sha256",l4).update(r+e).digest("hex").slice(0,6)}function Uk(r){let e=r.slice(0,8),t=u4(),n=qk(e,t);return{key:`sk-${e}-${t}-${n}`,keyId:t}}function p4(r){if(!r||!r.startsWith("sk-"))return null;let e=r.split("-");if(e.length===4){let[,t,n,i]=e,s=qk(t,n);return i!==s?null:{machineId:t,keyId:n}}return null}function zu(r){return p4(r)!==null}async function Wk(r,e){let t=r.headers.authorization;if(!t||!t.startsWith("Bearer ")){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Missing API key"}));return}let n=t.slice(7);if(!zu(n)){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Invalid API key"}));return}let i=await Hk();e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify(i))}tl();var Kk=require("url");var Wg=X(require("path"),1),Vk=X(require("os"),1);vt();var Gk=X(require("path"),1),zk=X(require("os"),1);var tV=Gk.default.join(zk.default.homedir(),".9remote","pids");var aV=Wg.default.dirname((0,Kk.fileURLToPath)(__importMetaUrl)),f4="9remote",cV=`https://registry.npmjs.org/${f4}/latest`;var lV=Wg.default.join(Vk.default.homedir(),".9remote","cloudflared.pid");function Yk(r,e){let t=r.split(".").map(Number),n=e.split(".").map(Number);for(let i=0;i<3;i++){if(n[i]>t[i])return!0;if(n[i]<t[i])return!1}return!1}$n();Gt();vt();Io();var Jk=X(Xk(),1),zg=X(require("crypto"),1),{machineIdSync:d4}=Jk.default;async function Qk(r=null){let e=r||process.env.MACHINE_ID_SALT||"9remote-salt";try{let t=d4();return zg.default.createHash("sha256").update(t+e).digest("hex").substring(0,16)}catch(t){return console.error("Error getting machine ID:",t),zg.default.randomUUID().replace(/-/g,"").substring(0,16)}}$n();async function Zk(r,e){let t=Hw(),n=t.workerUrl||"https://9remote.cc";if(!t.permanentKey){he(e,400,"No permanent key set");return}try{let s=await(await eo(`${n}/api/temp-key/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t.permanentKey,expiryMinutes:30})})).json(),o=`${n}/login?k=${s.tempKey}`;hn({oneTimeKey:s.tempKey,oneTimeKeyExpiresAt:s.expiresAt,qrUrl:o}),ee(e,{oneTimeKey:s.tempKey,expiresAt:s.expiresAt,qrUrl:o})}catch(i){he(e,500,i.message)}}async function eO(r,e){try{let t=await Qk(),{key:n}=Uk(t),i=_w();bw(t,n,i?.name||"Default"),hn({permanentKey:n}),ee(e,{ok:!0,permanentKey:n})}catch(t){he(e,500,t.message)}}Gt();async function tO(r,e){let t=await It(r,e);if(!t)return;let n=WR(t.socketId);ee(e,{ok:n})}async function rO(r,e){let t=await It(r,e);if(!t)return;let n=zR(t.socketId);ee(e,{ok:n})}function nO(r,e){ee(e,{pending:LR()})}function iO(r,e){ee(e,{devices:MR()})}function sO(r,e){ee(e,{rejected:FR()})}async function oO(r,e){let t=await It(r,e);if(!t)return;let n=GR(t.deviceId);ee(e,{ok:n})}async function aO(r,e){let t=await It(r,e);t&&($u(t.deviceId),Ks(t.deviceId),ee(e))}async function cO(r,e){let t=await It(r,e);t&&($u(t.deviceId),OR(t.deviceId),ee(e))}async function lO(r,e){let t=await It(r,e);if(!t)return;let n=$u(t.deviceId);ee(e,{disconnected:n})}function uO(r,e){ee(e,{enabled:Hu()})}async function pO(r,e){let t=await It(r,e);if(!t)return;let n=PR(t.deviceId,t.label);ee(e,{ok:n})}async function fO(r,e){let t=await It(r,e);if(!t)return;let n=$R(!!t.enabled);ee(e,{enabled:n})}Gt();var dO={},h4=1e4;function hO(r,e){if(e)return{type:e.type||"stop",sessionId:e.sessionId||"",tool:e.tool||"claude"};let t=JSON.parse(r||"{}");return{type:t.type||"stop",sessionId:t.sessionId||"",tool:t.tool||"claude"}}async function mO(r,e){let t="";await new Promise(n=>{r.on("data",i=>t+=i),r.on("end",n)});try{vO(hO(t,null)),ee(e,{success:!0})}catch{he(e,400,"Invalid JSON")}}function gO(r,e,{query:t}){vO(hO(null,t)),ee(e,{success:!0})}function vO({type:r,sessionId:e,tool:t}){let n=Date.now(),i=_a();if(!i||!e)return;let s={type:r,sessionId:e,tool:t,timestamp:n};if(TT(e,s),wt(i,"chatNotification",s),!ET()||!xT())return;let o=`${t}:${r}`;n-(dO[o]||0)<h4||(dO[o]=n,wT(s))}Gt();Cl();Io();bt();$n();function xO(){return{mode:fh(),active:ph(),presets:Object.keys(Z.sleepInhibit?.presets||{})}}function yO(r,e){ee(e,xO())}async function _O(r,e){let t=await It(r,e);if(!t)return;let n=$o(t.mode);yw({sleepInhibitMode:n});let i=xO();St("sleepInhibit",i),ee(e,i)}Gt();async function bO(r,e){try{let t=await ml();ee(e,{sessions:t})}catch(t){he(e,500,t.message)}}async function wO(r,e){let t=await It(r,e);if(t){if(!t.sessionId)return he(e,400,"sessionId required");try{await fi(t.sessionId),ee(e)}catch(n){he(e,500,n.message)}}}Cl();Io();bt();Mv();var Kn=Rn("server"),Vn=(0,TO.fileURLToPath)(new URL(".",__importMetaUrl)),CO=process.env.NODE_ENV==="development",m4=5173,g4="https://registry.npmjs.org/9remote/latest",Kg=(0,Ri.existsSync)((0,tr.join)(Vn,"ui","dist"))?(0,tr.join)(Vn,"ui","dist"):(0,tr.join)(Vn,"ui"),v4={".html":"text/html",".js":"application/javascript",".css":"text/css",".svg":"image/svg+xml",".png":"image/png",".ico":"image/x-icon",".woff2":"font/woff2",".woff":"font/woff"};function x4(r,e,t){let n=(0,Ku.request)({hostname:"localhost",port:m4,path:r.url,method:r.method,headers:r.headers},i=>{e.writeHead(i.statusCode,i.headers),i.pipe(e)});n.on("error",()=>t?t():void(e.writeHead(502),e.end("Vite dev server not ready"))),r.pipe(n)}function SO(r,e){if(!(0,Ri.existsSync)(e))return!1;let t=v4[(0,tr.extname)(e)]||"application/octet-stream";return r.setHeader("Content-Type",t),r.writeHead(200),r.end((0,Ri.readFileSync)(e)),!0}async function y4(r){try{let e=await eo(g4);if(!e.ok)return;let{version:t}=await e.json();t&&Yk(r,t)&&St("updateAvailable",{version:t})}catch{}}function _4(r,e){if(process.env.CODESPACES!=="true"){he(e,400,"Not running on Codespaces");return}let t=process.env.CODESPACE_NAME;if(!t){he(e,400,"Codespace name not found");return}let n=_a();n&&n.emit("codespace:stopping"),ee(e,{success:!0,message:"Stopping codespace..."}),setTimeout(()=>(0,Vu.execFile)("gh",["codespace","stop","-c",t],{windowsHide:!0}),500)}var AO;async function EO(r,e,{pathname:t}){let n=r.headers.authorization;if(!n||!n.startsWith("Bearer ")||!zu(n.slice(7))){he(e,401,"Unauthorized");return}let{parseJsonBody:i}=await Promise.resolve().then(()=>(Gt(),Pi)),s=await i(r,e);if(s){if(!s.port){he(e,400,"Port required");return}t.endsWith("start")?Mk(s.port):Ik(s.port),ee(e,{success:!0})}}function b4(r,e,{pathname:t,search:n}){let i=t.match(/^\/proxy\/(\d+)(\/.*)?$/);i?Lk(AO,r,e,i[1],i[2]||"/",n):he(e,404,"Not found")}var w4=[{path:"/api/health",method:"GET",public:!0,handler:(r,e)=>ee(e,{status:"ok",timestamp:Date.now()})},{path:"/api/version",method:"GET",public:!0,handler:(r,e)=>{ee(e,{version:"2.0.31"})}},{path:"/api/notify",method:"POST",public:!0,handler:mO},{path:"/api/notify",method:"GET",public:!0,handler:gO},{path:"/proxy/*",method:"*",public:!0,handler:b4},{path:"/api/ui/events",method:"GET",handler:Vw},{path:"/api/local-token",method:"GET",handler:Ww},{path:"/api/ui/state",method:"GET",handler:Yw},{path:"/api/ui/state",method:"POST",handler:Xw},{path:"/api/ui/stop",method:"POST",handler:Jw},{path:"/api/ui/start",method:"POST",handler:Qw},{path:"/api/ui/stop-tunnel",method:"POST",handler:Zw},{path:"/api/ui/shutdown",method:"POST",handler:eS},{path:"/api/key/one-time",method:"POST",handler:Zk},{path:"/api/key/regenerate",method:"POST",handler:eO},{path:"/api/device/approve",method:"POST",handler:tO},{path:"/api/device/reject",method:"POST",handler:rO},{path:"/api/device/pending",method:"GET",handler:nO},{path:"/api/device/approved",method:"GET",handler:iO},{path:"/api/device/rejected",method:"GET",handler:sO},{path:"/api/device/approve-rejected",method:"POST",handler:oO},{path:"/api/device/clear-rejected",method:"POST",handler:aO},{path:"/api/device/remove",method:"POST",handler:cO},{path:"/api/device/label",method:"POST",handler:pO},{path:"/api/device/disconnect",method:"POST",handler:lO},{path:"/api/device/auto-approve",method:"GET",handler:uO},{path:"/api/device/auto-approve",method:"POST",handler:fO},{path:"/api/connections",method:"GET",handler:tS},{path:"/api/logs",method:"GET",handler:rS},{path:"/api/permissions",method:"GET",handler:iS},{path:"/api/permissions/request",method:"POST",handler:aS},{path:"/api/desktop/toggle",method:"POST",handler:nS},{path:"/api/autostart",method:"GET",handler:sS},{path:"/api/autostart",method:"POST",handler:oS},{path:"/api/sleep-inhibit",method:"GET",handler:yO},{path:"/api/sleep-inhibit",method:"POST",handler:_O},{path:"/api/sessions",method:"GET",handler:bO},{path:"/api/sessions/delete",method:"POST",handler:wO},{path:"/api/local-sites",method:"*",public:!0,handler:Wk},{path:"/api/codespace/stop",method:"POST",handler:_4},{path:"/api/proxy/start",method:"POST",public:!0,handler:EO},{path:"/api/proxy/end",method:"POST",public:!0,handler:EO}];var S4=parseInt(process.env.PORT||"2208",10),ka=null;function E4(){if(!CO)return;let r=(0,tr.join)(Vn,"vite.config.js");if(!(0,Ri.existsSync)(r))return;let e=(0,Ri.existsSync)((0,tr.join)(Vn,"node_modules",".bin","vite"))?(0,tr.join)(Vn,"node_modules",".bin","vite"):(0,tr.join)(Vn,"..","node_modules",".bin","vite");ka=(0,Vu.spawn)("node",[e,"--config",r],{cwd:Vn,stdio:"ignore",detached:!1}),ka.on("error",()=>{}),ka.unref()}async function RO(){let r=nh(),e=r.sleepInhibitMode;e||(r.sleepInhibit===!1?e="never":e=Z.sleepInhibit?.defaultMode||"never"),$o(e),await FT(),AO=Nk(),E4();let n=xp(w4,{fallback:(a,c,{pathname:u})=>{if(u.startsWith("/api/")||u.startsWith("/socket.io")){he(c,404,"Not found");return}let p=!!a.headers["cf-connecting-ip"],f=a.socket.remoteAddress==="127.0.0.1"||a.socket.remoteAddress==="::1";if(p||!f){he(c,403,"Forbidden");return}let m=()=>{let y=u==="/"||u===""?(0,tr.join)(Kg,"index.html"):(0,tr.join)(Kg,u);SO(c,y)||SO(c,(0,tr.join)(Kg,"index.html"))};if(CO){x4(a,c,m);return}m()}}),i=(0,Ku.createServer)(async(a,c)=>{VR(c),!YR(a,c)&&await n(a,c)});jd(),jw(),Fw(),Rl(),process.platform==="darwin"&&setInterval(Rl,Tv),await KR(i),i.listen(S4,a=>{if(a)throw a;y4("2.0.31")});let s=!1,o=async a=>{if(s)return;s=!0,uh(),Kn.info(`\u{1F6D1} Received ${a}, shutting down gracefully...`);let c=setTimeout(()=>{Kn.error("\u26A0\uFE0F Forced exit"),process.exit(1)},5e3);try{if(i.close(()=>Kn.info("\u2713 HTTP server closed")),ka)try{ka.kill()}catch{}let u=_a();u&&(u.emit("server:shutdown"),u.close(()=>Kn.info("\u2713 Socket.IO closed"))),await new Promise(p=>setTimeout(p,500)),clearTimeout(c),Kn.info("\u2705 Server stopped cleanly"),process.exit(0)}catch(u){Kn.error(`\u274C Error during shutdown: ${u?.message||u}`),clearTimeout(c),process.exit(1)}};return process.on("SIGINT",()=>o("SIGINT")),process.on("SIGTERM",()=>o("SIGTERM")),process.platform==="win32"&&process.on("SIGBREAK",()=>o("SIGBREAK")),process.on("uncaughtException",a=>{Kn.error(`\u26A0\uFE0F uncaughtException: ${a?.stack||a}`)}),process.on("unhandledRejection",a=>{Kn.error(`\u26A0\uFE0F unhandledRejection: ${a?.stack||a}`)}),i}RO();0&&(module.exports={startServer});
263
263
  /*! Bundled license information:
264
264
 
265
265
  negotiator/index.js: