9remote 0.1.39 → 0.1.41
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/cli.cjs +3 -3
- package/dist/server.cjs +39 -39
- package/index.js +3 -1
- package/package.json +1 -1
package/dist/server.cjs
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
1
|
const __importMetaUrl = require('url').pathToFileURL(__filename).href;
|
|
2
|
-
var Px=Object.create;var Cs=Object.defineProperty;var Bx=Object.getOwnPropertyDescriptor;var jx=Object.getOwnPropertyNames;var Nx=Object.getPrototypeOf,Ix=Object.prototype.hasOwnProperty;var yi=(i,e)=>()=>(i&&(e=i(i=0)),e);var T=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),bi=(i,e)=>{for(var t in e)Cs(i,t,{get:e[t],enumerable:!0})},Ru=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of jx(e))!Ix.call(i,s)&&s!==t&&Cs(i,s,{get:()=>e[s],enumerable:!(n=Bx(e,s))||n.enumerable});return i};var F=(i,e,t)=>(t=i!=null?Px(Nx(i)):{},Ru(e||!i||!i.__esModule?Cs(t,"default",{value:i,enumerable:!0}):t,i)),Dx=i=>Ru(Cs({},"__esModule",{value:!0}),i);var Nu=T((Z2,Yo)=>{"use strict";Yo.exports=ju;Yo.exports.preferredCharsets=ju;var qx=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function Lx(i){for(var e=i.split(","),t=0,n=0;t<e.length;t++){var s=Fx(e[t].trim(),t);s&&(e[n++]=s)}return e.length=n,e}function Fx(i,e){var t=qx.exec(i);if(!t)return null;var n=t[1],s=1;if(t[2])for(var r=t[2].split(";"),o=0;o<r.length;o++){var a=r[o].trim().split("=");if(a[0]==="q"){s=parseFloat(a[1]);break}}return{charset:n,q:s,i:e}}function Ux(i,e,t){for(var n={o:-1,q:0,s:0},s=0;s<e.length;s++){var r=Hx(i,e[s],t);r&&(n.s-r.s||n.q-r.q||n.o-r.o)<0&&(n=r)}return n}function Hx(i,e,t){var n=0;if(e.charset.toLowerCase()===i.toLowerCase())n|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function ju(i,e){var t=Lx(i===void 0?"*":i||"");if(!e)return t.filter(Bu).sort(Pu).map(zx);var n=e.map(function(r,o){return Ux(r,t,o)});return n.filter(Bu).sort(Pu).map(function(r){return e[n.indexOf(r)]})}function Pu(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function zx(i){return i.charset}function Bu(i){return i.q>0}});var Fu=T((Q2,Jo)=>{"use strict";Jo.exports=Lu;Jo.exports.preferredEncodings=Lu;var $x=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function Wx(i){for(var e=i.split(","),t=!1,n=1,s=0,r=0;s<e.length;s++){var o=Vx(e[s].trim(),s);o&&(e[r++]=o,t=t||qu("identity",o),n=Math.min(n,o.q||1))}return t||(e[r++]={encoding:"identity",q:n,i:s}),e.length=r,e}function Vx(i,e){var t=$x.exec(i);if(!t)return null;var n=t[1],s=1;if(t[2])for(var r=t[2].split(";"),o=0;o<r.length;o++){var a=r[o].trim().split("=");if(a[0]==="q"){s=parseFloat(a[1]);break}}return{encoding:n,q:s,i:e}}function Kx(i,e,t){for(var n={o:-1,q:0,s:0},s=0;s<e.length;s++){var r=qu(i,e[s],t);r&&(n.s-r.s||n.q-r.q||n.o-r.o)<0&&(n=r)}return n}function qu(i,e,t){var n=0;if(e.encoding.toLowerCase()===i.toLowerCase())n|=1;else if(e.encoding!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function Lu(i,e){var t=Wx(i||"");if(!e)return t.filter(Du).sort(Iu).map(Gx);var n=e.map(function(r,o){return Kx(r,t,o)});return n.filter(Du).sort(Iu).map(function(r){return e[n.indexOf(r)]})}function Iu(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function Gx(i){return i.encoding}function Du(i){return i.q>0}});var Wu=T((eC,Xo)=>{"use strict";Xo.exports=$u;Xo.exports.preferredLanguages=$u;var Yx=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function Jx(i){for(var e=i.split(","),t=0,n=0;t<e.length;t++){var s=zu(e[t].trim(),t);s&&(e[n++]=s)}return e.length=n,e}function zu(i,e){var t=Yx.exec(i);if(!t)return null;var n=t[1],s=t[2],r=n;s&&(r+="-"+s);var o=1;if(t[3])for(var a=t[3].split(";"),l=0;l<a.length;l++){var p=a[l].split("=");p[0]==="q"&&(o=parseFloat(p[1]))}return{prefix:n,suffix:s,q:o,i:e,full:r}}function Xx(i,e,t){for(var n={o:-1,q:0,s:0},s=0;s<e.length;s++){var r=Zx(i,e[s],t);r&&(n.s-r.s||n.q-r.q||n.o-r.o)<0&&(n=r)}return n}function Zx(i,e,t){var n=zu(i);if(!n)return null;var s=0;if(e.full.toLowerCase()===n.full.toLowerCase())s|=4;else if(e.prefix.toLowerCase()===n.full.toLowerCase())s|=2;else if(e.full.toLowerCase()===n.prefix.toLowerCase())s|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s}}function $u(i,e){var t=Jx(i===void 0?"*":i||"");if(!e)return t.filter(Hu).sort(Uu).map(Qx);var n=e.map(function(r,o){return Xx(r,t,o)});return n.filter(Hu).sort(Uu).map(function(r){return e[n.indexOf(r)]})}function Uu(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function Qx(i){return i.full}function Hu(i){return i.q>0}});var Xu=T((tC,Zo)=>{"use strict";Zo.exports=Yu;Zo.exports.preferredMediaTypes=Yu;var ey=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function ty(i){for(var e=oy(i),t=0,n=0;t<e.length;t++){var s=Gu(e[t].trim(),t);s&&(e[n++]=s)}return e.length=n,e}function Gu(i,e){var t=ey.exec(i);if(!t)return null;var n=Object.create(null),s=1,r=t[2],o=t[1];if(t[3])for(var a=ay(t[3]).map(ry),l=0;l<a.length;l++){var p=a[l],f=p[0].toLowerCase(),v=p[1],_=v&&v[0]==='"'&&v[v.length-1]==='"'?v.substr(1,v.length-2):v;if(f==="q"){s=parseFloat(_);break}n[f]=_}return{type:o,subtype:r,params:n,q:s,i:e}}function iy(i,e,t){for(var n={o:-1,q:0,s:0},s=0;s<e.length;s++){var r=ny(i,e[s],t);r&&(n.s-r.s||n.q-r.q||n.o-r.o)<0&&(n=r)}return n}function ny(i,e,t){var n=Gu(i),s=0;if(!n)return null;if(e.type.toLowerCase()==n.type.toLowerCase())s|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==n.subtype.toLowerCase())s|=2;else if(e.subtype!="*")return null;var r=Object.keys(e.params);if(r.length>0)if(r.every(function(o){return e.params[o]=="*"||(e.params[o]||"").toLowerCase()==(n.params[o]||"").toLowerCase()}))s|=1;else return null;return{i:t,o:e.i,q:e.q,s}}function Yu(i,e){var t=ty(i===void 0?"*/*":i||"");if(!e)return t.filter(Ku).sort(Vu).map(sy);var n=e.map(function(r,o){return iy(r,t,o)});return n.filter(Ku).sort(Vu).map(function(r){return e[n.indexOf(r)]})}function Vu(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function sy(i){return i.type+"/"+i.subtype}function Ku(i){return i.q>0}function Ju(i){for(var e=0,t=0;(t=i.indexOf('"',t))!==-1;)e++,t++;return e}function ry(i){var e=i.indexOf("="),t,n;return e===-1?t=i:(t=i.substr(0,e),n=i.substr(e+1)),[t,n]}function oy(i){for(var e=i.split(","),t=1,n=0;t<e.length;t++)Ju(e[n])%2==0?e[++n]=e[t]:e[n]+=","+e[t];return e.length=n+1,e}function ay(i){for(var e=i.split(";"),t=1,n=0;t<e.length;t++)Ju(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 Zu=T((iC,Qo)=>{"use strict";var cy=Nu(),ly=Fu(),uy=Wu(),py=Xu();Qo.exports=$;Qo.exports.Negotiator=$;function $(i){if(!(this instanceof $))return new $(i);this.request=i}$.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]};$.prototype.charsets=function(e){return cy(this.request.headers["accept-charset"],e)};$.prototype.encoding=function(e){var t=this.encodings(e);return t&&t[0]};$.prototype.encodings=function(e){return ly(this.request.headers["accept-encoding"],e)};$.prototype.language=function(e){var t=this.languages(e);return t&&t[0]};$.prototype.languages=function(e){return uy(this.request.headers["accept-language"],e)};$.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]};$.prototype.mediaTypes=function(e){return py(this.request.headers.accept,e)};$.prototype.preferredCharset=$.prototype.charset;$.prototype.preferredCharsets=$.prototype.charsets;$.prototype.preferredEncoding=$.prototype.encoding;$.prototype.preferredEncodings=$.prototype.encodings;$.prototype.preferredLanguage=$.prototype.language;$.prototype.preferredLanguages=$.prototype.languages;$.prototype.preferredMediaType=$.prototype.mediaType;$.prototype.preferredMediaTypes=$.prototype.mediaTypes});var Qu=T((nC,dy)=>{dy.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 tp=T((sC,ep)=>{ep.exports=Qu()});var sp=T(it=>{"use strict";var Ts=tp(),fy=require("path").extname,ip=/^\s*([^;\s]*)(?:;|\s|$)/,hy=/^text\//i;it.charset=np;it.charsets={lookup:np};it.contentType=my;it.extension=vy;it.extensions=Object.create(null);it.lookup=gy;it.types=Object.create(null);xy(it.extensions,it.types);function np(i){if(!i||typeof i!="string")return!1;var e=ip.exec(i),t=e&&Ts[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&hy.test(e[1])?"UTF-8":!1}function my(i){if(!i||typeof i!="string")return!1;var e=i.indexOf("/")===-1?it.lookup(i):i;if(!e)return!1;if(e.indexOf("charset")===-1){var t=it.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function vy(i){if(!i||typeof i!="string")return!1;var e=ip.exec(i),t=e&&it.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function gy(i){if(!i||typeof i!="string")return!1;var e=fy("x."+i).toLowerCase().substr(1);return e&&it.types[e]||!1}function xy(i,e){var t=["nginx","apache",void 0,"iana"];Object.keys(Ts).forEach(function(s){var r=Ts[s],o=r.extensions;if(!(!o||!o.length)){i[s]=o;for(var a=0;a<o.length;a++){var l=o[a];if(e[l]){var p=t.indexOf(Ts[e[l]].source),f=t.indexOf(r.source);if(e[l]!=="application/octet-stream"&&(p>f||p===f&&e[l].substr(0,12)==="application/"))continue}e[l]=s}}})}});var Ms=T((oC,rp)=>{"use strict";var yy=Zu(),by=sp();rp.exports=ct;function ct(i){if(!(this instanceof ct))return new ct(i);this.headers=i.headers,this.negotiator=new yy(i)}ct.prototype.type=ct.prototype.types=function(i){var e=i;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(wy),s=this.negotiator.mediaTypes(n.filter(_y)),r=s[0];return r?e[n.indexOf(r)]:!1};ct.prototype.encoding=ct.prototype.encodings=function(i){var e=i;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};ct.prototype.charset=ct.prototype.charsets=function(i){var e=i;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};ct.prototype.lang=ct.prototype.langs=ct.prototype.language=ct.prototype.languages=function(i){var e=i;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 wy(i){return i.indexOf("/")===-1?by.lookup(i):i}function _y(i){return typeof i=="string"}});var ta=T((op,ap)=>{var Un=require("crypto"),ea=function(){};ea.prototype.getRandomBytes=function(i){var e=4096,t=this;if(i=i||12,i>e)return Un.randomBytes(i);var n=parseInt(e/i),s=parseInt(n*.85);if(!s||(this.bytesBufferIndex==null&&(this.bytesBufferIndex=-1),this.bytesBufferIndex==n&&(this.bytesBuffer=null,this.bytesBufferIndex=-1),(this.bytesBufferIndex==-1||this.bytesBufferIndex>s)&&(this.isGeneratingBytes||(this.isGeneratingBytes=!0,Un.randomBytes(e,function(o,a){t.bytesBuffer=a,t.bytesBufferIndex=0,t.isGeneratingBytes=!1})),this.bytesBufferIndex==-1)))return Un.randomBytes(i);var r=this.bytesBuffer.slice(i*this.bytesBufferIndex,i*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,r};ea.prototype.generateId=function(){var i=Buffer.alloc(15);return i.writeInt32BE?(this.sequenceNumber=this.sequenceNumber+1|0,i.writeInt32BE(this.sequenceNumber,11),Un.randomBytes?this.getRandomBytes(12).copy(i):[0,4,8].forEach(function(e){i.writeInt32BE(Math.random()*Math.pow(2,32)|0,e)}),i.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()};op=ap.exports=new ea});var Os=T(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.ERROR_PACKET=ri.PACKET_TYPES_REVERSE=ri.PACKET_TYPES=void 0;var Dt=Object.create(null);ri.PACKET_TYPES=Dt;Dt.open="0";Dt.close="1";Dt.ping="2";Dt.pong="3";Dt.message="4";Dt.upgrade="5";Dt.noop="6";var cp=Object.create(null);ri.PACKET_TYPES_REVERSE=cp;Object.keys(Dt).forEach(i=>{cp[Dt[i]]=i});var Sy={type:"error",data:"parser error"};ri.ERROR_PACKET=Sy});var up=T(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.encodePacket=void 0;Fi.encodePacketToBinary=Cy;var Ey=Os(),ky=({type:i,data:e},t,n)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?n(t?e:"b"+lp(e,!0).toString("base64")):n(Ey.PACKET_TYPES[i]+(e||""));Fi.encodePacket=ky;var lp=(i,e)=>Buffer.isBuffer(i)||i instanceof Uint8Array&&!e?i:i instanceof ArrayBuffer?Buffer.from(i):Buffer.from(i.buffer,i.byteOffset,i.byteLength),ia;function Cy(i,e){if(i.data instanceof ArrayBuffer||ArrayBuffer.isView(i.data))return e(lp(i.data,!1));(0,Fi.encodePacket)(i,!0,t=>{ia||(ia=new TextEncoder),e(ia.encode(t))})}});var dp=T(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.decodePacket=void 0;var As=Os(),Ty=(i,e)=>{if(typeof i!="string")return{type:"message",data:pp(i,e)};let t=i.charAt(0);if(t==="b"){let n=Buffer.from(i.substring(1),"base64");return{type:"message",data:pp(n,e)}}return As.PACKET_TYPES_REVERSE[t]?i.length>1?{type:As.PACKET_TYPES_REVERSE[t],data:i.substring(1)}:{type:As.PACKET_TYPES_REVERSE[t]}:As.ERROR_PACKET};Rs.decodePacket=Ty;var pp=(i,e)=>e==="arraybuffer"?i instanceof ArrayBuffer?i:Buffer.isBuffer(i)?i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength):i.buffer:Buffer.isBuffer(i)?i:Buffer.from(i)});var Hn=T(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.decodePayload=nt.decodePacket=nt.encodePayload=nt.encodePacket=nt.protocol=void 0;nt.createPacketEncoderStream=Ay;nt.createPacketDecoderStream=Ry;var sa=up();Object.defineProperty(nt,"encodePacket",{enumerable:!0,get:function(){return sa.encodePacket}});var ra=dp();Object.defineProperty(nt,"decodePacket",{enumerable:!0,get:function(){return ra.decodePacket}});var fp=Os(),hp="",My=(i,e)=>{let t=i.length,n=new Array(t),s=0;i.forEach((r,o)=>{(0,sa.encodePacket)(r,!1,a=>{n[o]=a,++s===t&&e(n.join(hp))})})};nt.encodePayload=My;var Oy=(i,e)=>{let t=i.split(hp),n=[];for(let s=0;s<t.length;s++){let r=(0,ra.decodePacket)(t[s],e);if(n.push(r),r.type==="error")break}return n};nt.decodePayload=Oy;function Ay(){return new TransformStream({transform(i,e){(0,sa.encodePacketToBinary)(i,t=>{let n=t.length,s;if(n<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,n);else if(n<65536){s=new Uint8Array(3);let r=new DataView(s.buffer);r.setUint8(0,126),r.setUint16(1,n)}else{s=new Uint8Array(9);let r=new DataView(s.buffer);r.setUint8(0,127),r.setBigUint64(1,BigInt(n))}i.data&&typeof i.data!="string"&&(s[0]|=128),e.enqueue(s),e.enqueue(t)})}})}var na;function Ps(i){return i.reduce((e,t)=>e+t.length,0)}function Bs(i,e){if(i[0].length===e)return i.shift();let t=new Uint8Array(e),n=0;for(let s=0;s<e;s++)t[s]=i[0][n++],n===i[0].length&&(i.shift(),n=0);return i.length&&n<i[0].length&&(i[0]=i[0].slice(n)),t}function Ry(i,e){na||(na=new TextDecoder);let t=[],n=0,s=-1,r=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(n===0){if(Ps(t)<1)break;let l=Bs(t,1);r=(l[0]&128)===128,s=l[0]&127,s<126?n=3:s===126?n=1:n=2}else if(n===1){if(Ps(t)<2)break;let l=Bs(t,2);s=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),n=3}else if(n===2){if(Ps(t)<8)break;let l=Bs(t,8),p=new DataView(l.buffer,l.byteOffset,l.length),f=p.getUint32(0);if(f>Math.pow(2,21)-1){a.enqueue(fp.ERROR_PACKET);break}s=f*Math.pow(2,32)+p.getUint32(4),n=3}else{if(Ps(t)<s)break;let l=Bs(t,s);a.enqueue((0,ra.decodePacket)(r?l:na.decode(l),e)),n=0}if(s===0||s>i){a.enqueue(fp.ERROR_PACKET);break}}}})}nt.protocol=4});var xp=T((pC,gp)=>{var oi=String.fromCharCode;function mp(i){for(var e=[],t=0,n=i.length,s,r;t<n;)s=i.charCodeAt(t++),s>=55296&&s<=56319&&t<n?(r=i.charCodeAt(t++),(r&64512)==56320?e.push(((s&1023)<<10)+(r&1023)+65536):(e.push(s),t--)):e.push(s);return e}function Py(i){for(var e=i.length,t=-1,n,s="";++t<e;)n=i[t],n>65535&&(n-=65536,s+=oi(n>>>10&1023|55296),n=56320|n&1023),s+=oi(n);return s}function vp(i,e){if(i>=55296&&i<=57343){if(e)throw Error("Lone surrogate U+"+i.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function oa(i,e){return oi(i>>e&63|128)}function By(i,e){if((i&4294967168)==0)return oi(i);var t="";return(i&4294965248)==0?t=oi(i>>6&31|192):(i&4294901760)==0?(vp(i,e)||(i=65533),t=oi(i>>12&15|224),t+=oa(i,6)):(i&4292870144)==0&&(t=oi(i>>18&7|240),t+=oa(i,12),t+=oa(i,6)),t+=oi(i&63|128),t}function jy(i,e){e=e||{};for(var t=e.strict!==!1,n=mp(i),s=n.length,r=-1,o,a="";++r<s;)o=n[r],a+=By(o,t);return a}function Ui(){if(ai>=Ns)throw Error("Invalid byte index");var i=js[ai]&255;if(ai++,(i&192)==128)return i&63;throw Error("Invalid continuation byte")}function Ny(i){var e,t,n,s,r;if(ai>Ns)throw Error("Invalid byte index");if(ai==Ns)return!1;if(e=js[ai]&255,ai++,(e&128)==0)return e;if((e&224)==192){if(t=Ui(),r=(e&31)<<6|t,r>=128)return r;throw Error("Invalid continuation byte")}if((e&240)==224){if(t=Ui(),n=Ui(),r=(e&15)<<12|t<<6|n,r>=2048)return vp(r,i)?r:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(t=Ui(),n=Ui(),s=Ui(),r=(e&7)<<18|t<<12|n<<6|s,r>=65536&&r<=1114111))return r;throw Error("Invalid UTF-8 detected")}var js,Ns,ai;function Iy(i,e){e=e||{};var t=e.strict!==!1;js=mp(i),Ns=js.length,ai=0;for(var n=[],s;(s=Ny(t))!==!1;)n.push(s);return Py(n)}gp.exports={version:"2.1.2",encode:jy,decode:Iy}});var Cp=T(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.packets=Fe.protocol=void 0;Fe.encodePacket=aa;Fe.encodeBase64Packet=wp;Fe.decodePacket=ca;Fe.decodeBase64Packet=_p;Fe.encodePayload=Fy;Fe.decodePayload=Hy;Fe.encodePayloadAsBinary=Ep;Fe.decodePayloadAsBinary=kp;var bp=xp();Fe.protocol=3;var Dy=i=>{for(let e of i)if(e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data))return!0;return!1};Fe.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Hi=Object.keys(Fe.packets),At={type:"error",data:"parser error"},qy=Buffer.concat([]);function aa(i,e,t,n){if(typeof e=="function"&&(n=e,e=null),typeof t=="function"&&(n=t,t=null),Buffer.isBuffer(i.data))return yp(i,e,n);if(i.data&&(i.data.buffer||i.data)instanceof ArrayBuffer)return yp({type:i.type,data:la(i.data)},e,n);var s=Fe.packets[i.type];return i.data!==void 0&&(s+=t?bp.encode(String(i.data),{strict:!1}):String(i.data)),n(""+s)}function yp(i,e,t){if(!e)return wp(i,t);var n=i.data,s=Buffer.allocUnsafe(1);return s[0]=Fe.packets[i.type],t(Buffer.concat([s,n]))}function wp(i,e){var t=Buffer.isBuffer(i.data)?i.data:la(i.data),n="b"+Fe.packets[i.type];return n+=t.toString("base64"),e(n)}function ca(i,e,t){if(i===void 0)return At;let n;if(typeof i=="string")return n=i.charAt(0),n==="b"?_p(i.slice(1),e):t&&(i=Ly(i),i===!1)||Number(n)!=n||!Hi[n]?At:i.length>1?{type:Hi[n],data:i.slice(1)}:{type:Hi[n]};if(e==="arraybuffer"){var s=new Uint8Array(i);return n=s[0],{type:Hi[n],data:s.buffer.slice(1)}}return i instanceof ArrayBuffer&&(i=la(i)),n=i[0],{type:Hi[n],data:i.slice(1)}}function Ly(i){try{i=bp.decode(i,{strict:!1})}catch{return!1}return i}function _p(i,e){var t=Hi[i.charAt(0)],n=Buffer.from(i.slice(1),"base64");if(e==="arraybuffer"){for(var s=new Uint8Array(n.length),r=0;r<s.length;r++)s[r]=n[r];n=s.buffer}return{type:t,data:n}}function Fy(i,e,t){if(typeof e=="function"&&(t=e,e=null),e&&Dy(i))return Ep(i,t);if(!i.length)return t("0:");function n(s,r){aa(s,e,!1,function(o){r(null,Uy(o))})}Sp(i,n,function(s,r){return t(r.join(""))})}function Uy(i){return i.length+":"+i}function Sp(i,e,t){let n=new Array(i.length),s=0;for(let r=0;r<i.length;r++)e(i[r],(o,a)=>{n[r]=a,++s===i.length&&t(null,n)})}function Hy(i,e,t){if(typeof i!="string")return kp(i,e,t);if(typeof e=="function"&&(t=e,e=null),i==="")return t(At,0,1);for(var n="",s,r,o,a=0,l=i.length;a<l;a++){var p=i.charAt(a);if(p!==":"){n+=p;continue}if(n===""||n!=(s=Number(n))||(r=i.slice(a+1,a+1+s),n!=r.length))return t(At,0,1);if(r.length){if(o=ca(r,e,!1),At.type===o.type&&At.data===o.data)return t(At,0,1);var f=t(o,a+s,l);if(f===!1)return}a+=s,n=""}if(n!=="")return t(At,0,1)}function zy(i){for(var e="",t=0,n=i.length;t<n;t++)e+=String.fromCharCode(i[t]);return e}function $y(i){for(var e=Buffer.allocUnsafe(i.length),t=0,n=i.length;t<n;t++)e.writeUInt8(i.charCodeAt(t),t);return e}function la(i){var e=i.byteLength||i.length,t=i.byteOffset||0;return Buffer.from(i.buffer||i,t,e)}function Ep(i,e){if(!i.length)return e(qy);Sp(i,Wy,function(t,n){return e(Buffer.concat(n))})}function Wy(i,e){function t(n){var s=""+n.length,r;if(typeof n=="string"){r=Buffer.allocUnsafe(s.length+2),r[0]=0;for(var o=0;o<s.length;o++)r[o+1]=parseInt(s[o],10);return r[r.length-1]=255,e(null,Buffer.concat([r,$y(n)]))}r=Buffer.allocUnsafe(s.length+2),r[0]=1;for(var o=0;o<s.length;o++)r[o+1]=parseInt(s[o],10);r[r.length-1]=255,e(null,Buffer.concat([r,n]))}aa(i,!0,!0,t)}function kp(i,e,t){typeof e=="function"&&(t=e,e=null);for(var n=i,s=[],r;n.length>0;){var o="",a=n[0]===0;for(r=1;n[r]!==255;r++){if(o.length>310)return t(At,0,1);o+=""+n[r]}n=n.slice(o.length+1);var l=parseInt(o,10),p=n.slice(1,l+1);a&&(p=zy(p)),s.push(p),n=n.slice(l+1)}var f=s.length;for(r=0;r<f;r++){var v=s[r];t(ca(v,e,!0),r,f)}}});var Mp=T((fC,Tp)=>{var zi=1e3,$i=zi*60,Wi=$i*60,wi=Wi*24,Vy=wi*7,Ky=wi*365.25;Tp.exports=function(i,e){e=e||{};var t=typeof i;if(t==="string"&&i.length>0)return Gy(i);if(t==="number"&&isFinite(i))return e.long?Jy(i):Yy(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function Gy(i){if(i=String(i),!(i.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(i);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*Ky;case"weeks":case"week":case"w":return t*Vy;case"days":case"day":case"d":return t*wi;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Wi;case"minutes":case"minute":case"mins":case"min":case"m":return t*$i;case"seconds":case"second":case"secs":case"sec":case"s":return t*zi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Yy(i){var e=Math.abs(i);return e>=wi?Math.round(i/wi)+"d":e>=Wi?Math.round(i/Wi)+"h":e>=$i?Math.round(i/$i)+"m":e>=zi?Math.round(i/zi)+"s":i+"ms"}function Jy(i){var e=Math.abs(i);return e>=wi?Is(i,e,wi,"day"):e>=Wi?Is(i,e,Wi,"hour"):e>=$i?Is(i,e,$i,"minute"):e>=zi?Is(i,e,zi,"second"):i+" ms"}function Is(i,e,t,n){var s=e>=t*1.5;return Math.round(i/t)+" "+n+(s?"s":"")}});var ua=T((hC,Op)=>{function Xy(i){t.debug=t,t.default=t,t.coerce=l,t.disable=o,t.enable=s,t.enabled=a,t.humanize=Mp(),t.destroy=p,Object.keys(i).forEach(f=>{t[f]=i[f]}),t.names=[],t.skips=[],t.formatters={};function e(f){let v=0;for(let _=0;_<f.length;_++)v=(v<<5)-v+f.charCodeAt(_),v|=0;return t.colors[Math.abs(v)%t.colors.length]}t.selectColor=e;function t(f){let v,_=null,E,C;function k(...M){if(!k.enabled)return;let O=k,A=Number(new Date),N=A-(v||A);O.diff=N,O.prev=v,O.curr=A,v=A,M[0]=t.coerce(M[0]),typeof M[0]!="string"&&M.unshift("%O");let U=0;M[0]=M[0].replace(/%([a-zA-Z%])/g,(te,qe)=>{if(te==="%%")return"%";U++;let H=t.formatters[qe];if(typeof H=="function"){let Le=M[U];te=H.call(O,Le),M.splice(U,1),U--}return te}),t.formatArgs.call(O,M),(O.log||t.log).apply(O,M)}return k.namespace=f,k.useColors=t.useColors(),k.color=t.selectColor(f),k.extend=n,k.destroy=t.destroy,Object.defineProperty(k,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(E!==t.namespaces&&(E=t.namespaces,C=t.enabled(f)),C),set:M=>{_=M}}),typeof t.init=="function"&&t.init(k),k}function n(f,v){let _=t(this.namespace+(typeof v>"u"?":":v)+f);return _.log=this.log,_}function s(f){t.save(f),t.namespaces=f,t.names=[],t.skips=[];let v=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let _ of v)_[0]==="-"?t.skips.push(_.slice(1)):t.names.push(_)}function r(f,v){let _=0,E=0,C=-1,k=0;for(;_<f.length;)if(E<v.length&&(v[E]===f[_]||v[E]==="*"))v[E]==="*"?(C=E,k=_,E++):(_++,E++);else if(C!==-1)E=C+1,k++,_=k;else return!1;for(;E<v.length&&v[E]==="*";)E++;return E===v.length}function o(){let f=[...t.names,...t.skips.map(v=>"-"+v)].join(",");return t.enable(""),f}function a(f){for(let v of t.skips)if(r(f,v))return!1;for(let v of t.names)if(r(f,v))return!0;return!1}function l(f){return f instanceof Error?f.stack||f.message:f}function p(){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}Op.exports=Xy});var Ap=T((st,Ds)=>{st.formatArgs=Qy;st.save=eb;st.load=tb;st.useColors=Zy;st.storage=ib();st.destroy=(()=>{let i=!1;return()=>{i||(i=!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`."))}})();st.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 Zy(){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 i;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&&(i=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(i[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Qy(i){if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+Ds.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;i.splice(1,0,e,"color: inherit");let t=0,n=0;i[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(t++,s==="%c"&&(n=t))}),i.splice(n,0,e)}st.log=console.debug||console.log||(()=>{});function eb(i){try{i?st.storage.setItem("debug",i):st.storage.removeItem("debug")}catch{}}function tb(){let i;try{i=st.storage.getItem("debug")||st.storage.getItem("DEBUG")}catch{}return!i&&typeof process<"u"&&"env"in process&&(i=process.env.DEBUG),i}function ib(){try{return localStorage}catch{}}Ds.exports=ua()(st);var{formatters:nb}=Ds.exports;nb.j=function(i){try{return JSON.stringify(i)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Pp=T((mC,Rp)=>{"use strict";Rp.exports=(i,e=process.argv)=>{let t=i.startsWith("-")?"":i.length===1?"-":"--",n=e.indexOf(t+i),s=e.indexOf("--");return n!==-1&&(s===-1||n<s)}});var fa=T((vC,jp)=>{"use strict";var sb=require("os"),Bp=require("tty"),mt=Pp(),{env:Ue}=process,ci;mt("no-color")||mt("no-colors")||mt("color=false")||mt("color=never")?ci=0:(mt("color")||mt("colors")||mt("color=true")||mt("color=always"))&&(ci=1);"FORCE_COLOR"in Ue&&(Ue.FORCE_COLOR==="true"?ci=1:Ue.FORCE_COLOR==="false"?ci=0:ci=Ue.FORCE_COLOR.length===0?1:Math.min(parseInt(Ue.FORCE_COLOR,10),3));function pa(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function da(i,e){if(ci===0)return 0;if(mt("color=16m")||mt("color=full")||mt("color=truecolor"))return 3;if(mt("color=256"))return 2;if(i&&!e&&ci===void 0)return 0;let t=ci||0;if(Ue.TERM==="dumb")return t;if(process.platform==="win32"){let n=sb.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in Ue)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in Ue)||Ue.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in Ue)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ue.TEAMCITY_VERSION)?1:0;if(Ue.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Ue){let n=parseInt((Ue.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ue.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ue.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ue.TERM)||"COLORTERM"in Ue?1:t}function rb(i){let e=da(i,i&&i.isTTY);return pa(e)}jp.exports={supportsColor:rb,stdout:pa(da(!0,Bp.isatty(1))),stderr:pa(da(!0,Bp.isatty(2)))}});var Ip=T((He,Ls)=>{var ob=require("tty"),qs=require("util");He.init=fb;He.log=ub;He.formatArgs=cb;He.save=pb;He.load=db;He.useColors=ab;He.destroy=qs.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");He.colors=[6,2,3,4,5,1];try{let i=fa();i&&(i.stderr||i).level>=2&&(He.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{}He.inspectOpts=Object.keys(process.env).filter(i=>/^debug_/i.test(i)).reduce((i,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,r)=>r.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),i[t]=n,i},{});function ab(){return"colors"in He.inspectOpts?!!He.inspectOpts.colors:ob.isatty(process.stderr.fd)}function cb(i){let{namespace:e,useColors:t}=this;if(t){let n=this.color,s="\x1B[3"+(n<8?n:"8;5;"+n),r=` ${s};1m${e} \x1B[0m`;i[0]=r+i[0].split(`
|
|
2
|
+
var iy=Object.create;var Ar=Object.defineProperty;var ny=Object.getOwnPropertyDescriptor;var ry=Object.getOwnPropertyNames;var sy=Object.getPrototypeOf,oy=Object.prototype.hasOwnProperty;var _i=(i,e)=>()=>(i&&(e=i(i=0)),e);var C=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),Si=(i,e)=>{for(var t in e)Ar(i,t,{get:e[t],enumerable:!0})},Fu=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ry(e))!oy.call(i,r)&&r!==t&&Ar(i,r,{get:()=>e[r],enumerable:!(n=ny(e,r))||n.enumerable});return i};var L=(i,e,t)=>(t=i!=null?iy(sy(i)):{},Fu(e||!i||!i.__esModule?Ar(t,"default",{value:i,enumerable:!0}):t,i)),ay=i=>Fu(Ar({},"__esModule",{value:!0}),i);var $u=C((iT,ra)=>{"use strict";ra.exports=zu;ra.exports.preferredCharsets=zu;var cy=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function ly(i){for(var e=i.split(","),t=0,n=0;t<e.length;t++){var r=uy(e[t].trim(),t);r&&(e[n++]=r)}return e.length=n,e}function uy(i,e){var t=cy.exec(i);if(!t)return null;var n=t[1],r=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"){r=parseFloat(a[1]);break}}return{charset:n,q:r,i:e}}function py(i,e,t){for(var n={o:-1,q:0,s:0},r=0;r<e.length;r++){var s=dy(i,e[r],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function dy(i,e,t){var n=0;if(e.charset.toLowerCase()===i.toLowerCase())n|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function zu(i,e){var t=ly(i===void 0?"*":i||"");if(!e)return t.filter(Hu).sort(Uu).map(fy);var n=e.map(function(s,o){return py(s,t,o)});return n.filter(Hu).sort(Uu).map(function(s){return e[n.indexOf(s)]})}function Uu(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function fy(i){return i.charset}function Hu(i){return i.q>0}});var Yu=C((nT,sa)=>{"use strict";sa.exports=Gu;sa.exports.preferredEncodings=Gu;var hy=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function my(i){for(var e=i.split(","),t=!1,n=1,r=0,s=0;r<e.length;r++){var o=vy(e[r].trim(),r);o&&(e[s++]=o,t=t||Ku("identity",o),n=Math.min(n,o.q||1))}return t||(e[s++]={encoding:"identity",q:n,i:r}),e.length=s,e}function vy(i,e){var t=hy.exec(i);if(!t)return null;var n=t[1],r=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"){r=parseFloat(a[1]);break}}return{encoding:n,q:r,i:e}}function gy(i,e,t){for(var n={o:-1,q:0,s:0},r=0;r<e.length;r++){var s=Ku(i,e[r],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function Ku(i,e,t){var n=0;if(e.encoding.toLowerCase()===i.toLowerCase())n|=1;else if(e.encoding!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function Gu(i,e){var t=my(i||"");if(!e)return t.filter(Vu).sort(Wu).map(xy);var n=e.map(function(s,o){return gy(s,t,o)});return n.filter(Vu).sort(Wu).map(function(s){return e[n.indexOf(s)]})}function Wu(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function xy(i){return i.encoding}function Vu(i){return i.q>0}});var ep=C((rT,oa)=>{"use strict";oa.exports=Qu;oa.exports.preferredLanguages=Qu;var yy=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function by(i){for(var e=i.split(","),t=0,n=0;t<e.length;t++){var r=Zu(e[t].trim(),t);r&&(e[n++]=r)}return e.length=n,e}function Zu(i,e){var t=yy.exec(i);if(!t)return null;var n=t[1],r=t[2],s=n;r&&(s+="-"+r);var o=1;if(t[3])for(var a=t[3].split(";"),l=0;l<a.length;l++){var p=a[l].split("=");p[0]==="q"&&(o=parseFloat(p[1]))}return{prefix:n,suffix:r,q:o,i:e,full:s}}function wy(i,e,t){for(var n={o:-1,q:0,s:0},r=0;r<e.length;r++){var s=_y(i,e[r],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function _y(i,e,t){var n=Zu(i);if(!n)return null;var r=0;if(e.full.toLowerCase()===n.full.toLowerCase())r|=4;else if(e.prefix.toLowerCase()===n.full.toLowerCase())r|=2;else if(e.full.toLowerCase()===n.prefix.toLowerCase())r|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s:r}}function Qu(i,e){var t=by(i===void 0?"*":i||"");if(!e)return t.filter(Xu).sort(Ju).map(Sy);var n=e.map(function(s,o){return wy(s,t,o)});return n.filter(Xu).sort(Ju).map(function(s){return e[n.indexOf(s)]})}function Ju(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function Sy(i){return i.full}function Xu(i){return i.q>0}});var op=C((sT,aa)=>{"use strict";aa.exports=rp;aa.exports.preferredMediaTypes=rp;var Ey=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function ky(i){for(var e=Ay(i),t=0,n=0;t<e.length;t++){var r=np(e[t].trim(),t);r&&(e[n++]=r)}return e.length=n,e}function np(i,e){var t=Ey.exec(i);if(!t)return null;var n=Object.create(null),r=1,s=t[2],o=t[1];if(t[3])for(var a=Ry(t[3]).map(Oy),l=0;l<a.length;l++){var p=a[l],f=p[0].toLowerCase(),m=p[1],_=m&&m[0]==='"'&&m[m.length-1]==='"'?m.substr(1,m.length-2):m;if(f==="q"){r=parseFloat(_);break}n[f]=_}return{type:o,subtype:s,params:n,q:r,i:e}}function Cy(i,e,t){for(var n={o:-1,q:0,s:0},r=0;r<e.length;r++){var s=Ty(i,e[r],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function Ty(i,e,t){var n=np(i),r=0;if(!n)return null;if(e.type.toLowerCase()==n.type.toLowerCase())r|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==n.subtype.toLowerCase())r|=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()}))r|=1;else return null;return{i:t,o:e.i,q:e.q,s:r}}function rp(i,e){var t=ky(i===void 0?"*/*":i||"");if(!e)return t.filter(ip).sort(tp).map(My);var n=e.map(function(s,o){return Cy(s,t,o)});return n.filter(ip).sort(tp).map(function(s){return e[n.indexOf(s)]})}function tp(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function My(i){return i.type+"/"+i.subtype}function ip(i){return i.q>0}function sp(i){for(var e=0,t=0;(t=i.indexOf('"',t))!==-1;)e++,t++;return e}function Oy(i){var e=i.indexOf("="),t,n;return e===-1?t=i:(t=i.substr(0,e),n=i.substr(e+1)),[t,n]}function Ay(i){for(var e=i.split(","),t=1,n=0;t<e.length;t++)sp(e[n])%2==0?e[++n]=e[t]:e[n]+=","+e[t];return e.length=n+1,e}function Ry(i){for(var e=i.split(";"),t=1,n=0;t<e.length;t++)sp(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 ap=C((oT,ca)=>{"use strict";var Py=$u(),By=Yu(),jy=ep(),Ny=op();ca.exports=W;ca.exports.Negotiator=W;function W(i){if(!(this instanceof W))return new W(i);this.request=i}W.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]};W.prototype.charsets=function(e){return Py(this.request.headers["accept-charset"],e)};W.prototype.encoding=function(e){var t=this.encodings(e);return t&&t[0]};W.prototype.encodings=function(e){return By(this.request.headers["accept-encoding"],e)};W.prototype.language=function(e){var t=this.languages(e);return t&&t[0]};W.prototype.languages=function(e){return jy(this.request.headers["accept-language"],e)};W.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]};W.prototype.mediaTypes=function(e){return Ny(this.request.headers.accept,e)};W.prototype.preferredCharset=W.prototype.charset;W.prototype.preferredCharsets=W.prototype.charsets;W.prototype.preferredEncoding=W.prototype.encoding;W.prototype.preferredEncodings=W.prototype.encodings;W.prototype.preferredLanguage=W.prototype.language;W.prototype.preferredLanguages=W.prototype.languages;W.prototype.preferredMediaType=W.prototype.mediaType;W.prototype.preferredMediaTypes=W.prototype.mediaTypes});var cp=C((aT,Dy)=>{Dy.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 up=C((cT,lp)=>{lp.exports=cp()});var fp=C(nt=>{"use strict";var Rr=up(),Iy=require("path").extname,pp=/^\s*([^;\s]*)(?:;|\s|$)/,qy=/^text\//i;nt.charset=dp;nt.charsets={lookup:dp};nt.contentType=Ly;nt.extension=Fy;nt.extensions=Object.create(null);nt.lookup=Uy;nt.types=Object.create(null);Hy(nt.extensions,nt.types);function dp(i){if(!i||typeof i!="string")return!1;var e=pp.exec(i),t=e&&Rr[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&qy.test(e[1])?"UTF-8":!1}function Ly(i){if(!i||typeof i!="string")return!1;var e=i.indexOf("/")===-1?nt.lookup(i):i;if(!e)return!1;if(e.indexOf("charset")===-1){var t=nt.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function Fy(i){if(!i||typeof i!="string")return!1;var e=pp.exec(i),t=e&&nt.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function Uy(i){if(!i||typeof i!="string")return!1;var e=Iy("x."+i).toLowerCase().substr(1);return e&&nt.types[e]||!1}function Hy(i,e){var t=["nginx","apache",void 0,"iana"];Object.keys(Rr).forEach(function(r){var s=Rr[r],o=s.extensions;if(!(!o||!o.length)){i[r]=o;for(var a=0;a<o.length;a++){var l=o[a];if(e[l]){var p=t.indexOf(Rr[e[l]].source),f=t.indexOf(s.source);if(e[l]!=="application/octet-stream"&&(p>f||p===f&&e[l].substr(0,12)==="application/"))continue}e[l]=r}}})}});var Pr=C((uT,hp)=>{"use strict";var zy=ap(),$y=fp();hp.exports=lt;function lt(i){if(!(this instanceof lt))return new lt(i);this.headers=i.headers,this.negotiator=new zy(i)}lt.prototype.type=lt.prototype.types=function(i){var e=i;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(Wy),r=this.negotiator.mediaTypes(n.filter(Vy)),s=r[0];return s?e[n.indexOf(s)]:!1};lt.prototype.encoding=lt.prototype.encodings=function(i){var e=i;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};lt.prototype.charset=lt.prototype.charsets=function(i){var e=i;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};lt.prototype.lang=lt.prototype.langs=lt.prototype.language=lt.prototype.languages=function(i){var e=i;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 Wy(i){return i.indexOf("/")===-1?$y.lookup(i):i}function Vy(i){return typeof i=="string"}});var ua=C((mp,vp)=>{var Vn=require("crypto"),la=function(){};la.prototype.getRandomBytes=function(i){var e=4096,t=this;if(i=i||12,i>e)return Vn.randomBytes(i);var n=parseInt(e/i),r=parseInt(n*.85);if(!r||(this.bytesBufferIndex==null&&(this.bytesBufferIndex=-1),this.bytesBufferIndex==n&&(this.bytesBuffer=null,this.bytesBufferIndex=-1),(this.bytesBufferIndex==-1||this.bytesBufferIndex>r)&&(this.isGeneratingBytes||(this.isGeneratingBytes=!0,Vn.randomBytes(e,function(o,a){t.bytesBuffer=a,t.bytesBufferIndex=0,t.isGeneratingBytes=!1})),this.bytesBufferIndex==-1)))return Vn.randomBytes(i);var s=this.bytesBuffer.slice(i*this.bytesBufferIndex,i*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,s};la.prototype.generateId=function(){var i=Buffer.alloc(15);return i.writeInt32BE?(this.sequenceNumber=this.sequenceNumber+1|0,i.writeInt32BE(this.sequenceNumber,11),Vn.randomBytes?this.getRandomBytes(12).copy(i):[0,4,8].forEach(function(e){i.writeInt32BE(Math.random()*Math.pow(2,32)|0,e)}),i.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()};mp=vp.exports=new la});var Br=C(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.ERROR_PACKET=ai.PACKET_TYPES_REVERSE=ai.PACKET_TYPES=void 0;var qt=Object.create(null);ai.PACKET_TYPES=qt;qt.open="0";qt.close="1";qt.ping="2";qt.pong="3";qt.message="4";qt.upgrade="5";qt.noop="6";var gp=Object.create(null);ai.PACKET_TYPES_REVERSE=gp;Object.keys(qt).forEach(i=>{gp[qt[i]]=i});var Ky={type:"error",data:"parser error"};ai.ERROR_PACKET=Ky});var yp=C(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.encodePacket=void 0;zi.encodePacketToBinary=Jy;var Gy=Br(),Yy=({type:i,data:e},t,n)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?n(t?e:"b"+xp(e,!0).toString("base64")):n(Gy.PACKET_TYPES[i]+(e||""));zi.encodePacket=Yy;var xp=(i,e)=>Buffer.isBuffer(i)||i instanceof Uint8Array&&!e?i:i instanceof ArrayBuffer?Buffer.from(i):Buffer.from(i.buffer,i.byteOffset,i.byteLength),pa;function Jy(i,e){if(i.data instanceof ArrayBuffer||ArrayBuffer.isView(i.data))return e(xp(i.data,!1));(0,zi.encodePacket)(i,!0,t=>{pa||(pa=new TextEncoder),e(pa.encode(t))})}});var wp=C(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.decodePacket=void 0;var jr=Br(),Xy=(i,e)=>{if(typeof i!="string")return{type:"message",data:bp(i,e)};let t=i.charAt(0);if(t==="b"){let n=Buffer.from(i.substring(1),"base64");return{type:"message",data:bp(n,e)}}return jr.PACKET_TYPES_REVERSE[t]?i.length>1?{type:jr.PACKET_TYPES_REVERSE[t],data:i.substring(1)}:{type:jr.PACKET_TYPES_REVERSE[t]}:jr.ERROR_PACKET};Nr.decodePacket=Xy;var bp=(i,e)=>e==="arraybuffer"?i instanceof ArrayBuffer?i:Buffer.isBuffer(i)?i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength):i.buffer:Buffer.isBuffer(i)?i:Buffer.from(i)});var Kn=C(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.decodePayload=rt.decodePacket=rt.encodePayload=rt.encodePacket=rt.protocol=void 0;rt.createPacketEncoderStream=eb;rt.createPacketDecoderStream=tb;var fa=yp();Object.defineProperty(rt,"encodePacket",{enumerable:!0,get:function(){return fa.encodePacket}});var ha=wp();Object.defineProperty(rt,"decodePacket",{enumerable:!0,get:function(){return ha.decodePacket}});var _p=Br(),Sp="",Zy=(i,e)=>{let t=i.length,n=new Array(t),r=0;i.forEach((s,o)=>{(0,fa.encodePacket)(s,!1,a=>{n[o]=a,++r===t&&e(n.join(Sp))})})};rt.encodePayload=Zy;var Qy=(i,e)=>{let t=i.split(Sp),n=[];for(let r=0;r<t.length;r++){let s=(0,ha.decodePacket)(t[r],e);if(n.push(s),s.type==="error")break}return n};rt.decodePayload=Qy;function eb(){return new TransformStream({transform(i,e){(0,fa.encodePacketToBinary)(i,t=>{let n=t.length,r;if(n<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,n);else if(n<65536){r=new Uint8Array(3);let s=new DataView(r.buffer);s.setUint8(0,126),s.setUint16(1,n)}else{r=new Uint8Array(9);let s=new DataView(r.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(n))}i.data&&typeof i.data!="string"&&(r[0]|=128),e.enqueue(r),e.enqueue(t)})}})}var da;function Dr(i){return i.reduce((e,t)=>e+t.length,0)}function Ir(i,e){if(i[0].length===e)return i.shift();let t=new Uint8Array(e),n=0;for(let r=0;r<e;r++)t[r]=i[0][n++],n===i[0].length&&(i.shift(),n=0);return i.length&&n<i[0].length&&(i[0]=i[0].slice(n)),t}function tb(i,e){da||(da=new TextDecoder);let t=[],n=0,r=-1,s=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(n===0){if(Dr(t)<1)break;let l=Ir(t,1);s=(l[0]&128)===128,r=l[0]&127,r<126?n=3:r===126?n=1:n=2}else if(n===1){if(Dr(t)<2)break;let l=Ir(t,2);r=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),n=3}else if(n===2){if(Dr(t)<8)break;let l=Ir(t,8),p=new DataView(l.buffer,l.byteOffset,l.length),f=p.getUint32(0);if(f>Math.pow(2,21)-1){a.enqueue(_p.ERROR_PACKET);break}r=f*Math.pow(2,32)+p.getUint32(4),n=3}else{if(Dr(t)<r)break;let l=Ir(t,r);a.enqueue((0,ha.decodePacket)(s?l:da.decode(l),e)),n=0}if(r===0||r>i){a.enqueue(_p.ERROR_PACKET);break}}}})}rt.protocol=4});var Tp=C((mT,Cp)=>{var ci=String.fromCharCode;function Ep(i){for(var e=[],t=0,n=i.length,r,s;t<n;)r=i.charCodeAt(t++),r>=55296&&r<=56319&&t<n?(s=i.charCodeAt(t++),(s&64512)==56320?e.push(((r&1023)<<10)+(s&1023)+65536):(e.push(r),t--)):e.push(r);return e}function ib(i){for(var e=i.length,t=-1,n,r="";++t<e;)n=i[t],n>65535&&(n-=65536,r+=ci(n>>>10&1023|55296),n=56320|n&1023),r+=ci(n);return r}function kp(i,e){if(i>=55296&&i<=57343){if(e)throw Error("Lone surrogate U+"+i.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function ma(i,e){return ci(i>>e&63|128)}function nb(i,e){if((i&4294967168)==0)return ci(i);var t="";return(i&4294965248)==0?t=ci(i>>6&31|192):(i&4294901760)==0?(kp(i,e)||(i=65533),t=ci(i>>12&15|224),t+=ma(i,6)):(i&4292870144)==0&&(t=ci(i>>18&7|240),t+=ma(i,12),t+=ma(i,6)),t+=ci(i&63|128),t}function rb(i,e){e=e||{};for(var t=e.strict!==!1,n=Ep(i),r=n.length,s=-1,o,a="";++s<r;)o=n[s],a+=nb(o,t);return a}function $i(){if(li>=Lr)throw Error("Invalid byte index");var i=qr[li]&255;if(li++,(i&192)==128)return i&63;throw Error("Invalid continuation byte")}function sb(i){var e,t,n,r,s;if(li>Lr)throw Error("Invalid byte index");if(li==Lr)return!1;if(e=qr[li]&255,li++,(e&128)==0)return e;if((e&224)==192){if(t=$i(),s=(e&31)<<6|t,s>=128)return s;throw Error("Invalid continuation byte")}if((e&240)==224){if(t=$i(),n=$i(),s=(e&15)<<12|t<<6|n,s>=2048)return kp(s,i)?s:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(t=$i(),n=$i(),r=$i(),s=(e&7)<<18|t<<12|n<<6|r,s>=65536&&s<=1114111))return s;throw Error("Invalid UTF-8 detected")}var qr,Lr,li;function ob(i,e){e=e||{};var t=e.strict!==!1;qr=Ep(i),Lr=qr.length,li=0;for(var n=[],r;(r=sb(t))!==!1;)n.push(r);return ib(n)}Cp.exports={version:"2.1.2",encode:rb,decode:ob}});var Np=C(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.packets=He.protocol=void 0;He.encodePacket=va;He.encodeBase64Packet=Ap;He.decodePacket=ga;He.decodeBase64Packet=Rp;He.encodePayload=ub;He.decodePayload=db;He.encodePayloadAsBinary=Bp;He.decodePayloadAsBinary=jp;var Op=Tp();He.protocol=3;var ab=i=>{for(let e of i)if(e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data))return!0;return!1};He.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Wi=Object.keys(He.packets),Rt={type:"error",data:"parser error"},cb=Buffer.concat([]);function va(i,e,t,n){if(typeof e=="function"&&(n=e,e=null),typeof t=="function"&&(n=t,t=null),Buffer.isBuffer(i.data))return Mp(i,e,n);if(i.data&&(i.data.buffer||i.data)instanceof ArrayBuffer)return Mp({type:i.type,data:xa(i.data)},e,n);var r=He.packets[i.type];return i.data!==void 0&&(r+=t?Op.encode(String(i.data),{strict:!1}):String(i.data)),n(""+r)}function Mp(i,e,t){if(!e)return Ap(i,t);var n=i.data,r=Buffer.allocUnsafe(1);return r[0]=He.packets[i.type],t(Buffer.concat([r,n]))}function Ap(i,e){var t=Buffer.isBuffer(i.data)?i.data:xa(i.data),n="b"+He.packets[i.type];return n+=t.toString("base64"),e(n)}function ga(i,e,t){if(i===void 0)return Rt;let n;if(typeof i=="string")return n=i.charAt(0),n==="b"?Rp(i.slice(1),e):t&&(i=lb(i),i===!1)||Number(n)!=n||!Wi[n]?Rt:i.length>1?{type:Wi[n],data:i.slice(1)}:{type:Wi[n]};if(e==="arraybuffer"){var r=new Uint8Array(i);return n=r[0],{type:Wi[n],data:r.buffer.slice(1)}}return i instanceof ArrayBuffer&&(i=xa(i)),n=i[0],{type:Wi[n],data:i.slice(1)}}function lb(i){try{i=Op.decode(i,{strict:!1})}catch{return!1}return i}function Rp(i,e){var t=Wi[i.charAt(0)],n=Buffer.from(i.slice(1),"base64");if(e==="arraybuffer"){for(var r=new Uint8Array(n.length),s=0;s<r.length;s++)r[s]=n[s];n=r.buffer}return{type:t,data:n}}function ub(i,e,t){if(typeof e=="function"&&(t=e,e=null),e&&ab(i))return Bp(i,t);if(!i.length)return t("0:");function n(r,s){va(r,e,!1,function(o){s(null,pb(o))})}Pp(i,n,function(r,s){return t(s.join(""))})}function pb(i){return i.length+":"+i}function Pp(i,e,t){let n=new Array(i.length),r=0;for(let s=0;s<i.length;s++)e(i[s],(o,a)=>{n[s]=a,++r===i.length&&t(null,n)})}function db(i,e,t){if(typeof i!="string")return jp(i,e,t);if(typeof e=="function"&&(t=e,e=null),i==="")return t(Rt,0,1);for(var n="",r,s,o,a=0,l=i.length;a<l;a++){var p=i.charAt(a);if(p!==":"){n+=p;continue}if(n===""||n!=(r=Number(n))||(s=i.slice(a+1,a+1+r),n!=s.length))return t(Rt,0,1);if(s.length){if(o=ga(s,e,!1),Rt.type===o.type&&Rt.data===o.data)return t(Rt,0,1);var f=t(o,a+r,l);if(f===!1)return}a+=r,n=""}if(n!=="")return t(Rt,0,1)}function fb(i){for(var e="",t=0,n=i.length;t<n;t++)e+=String.fromCharCode(i[t]);return e}function hb(i){for(var e=Buffer.allocUnsafe(i.length),t=0,n=i.length;t<n;t++)e.writeUInt8(i.charCodeAt(t),t);return e}function xa(i){var e=i.byteLength||i.length,t=i.byteOffset||0;return Buffer.from(i.buffer||i,t,e)}function Bp(i,e){if(!i.length)return e(cb);Pp(i,mb,function(t,n){return e(Buffer.concat(n))})}function mb(i,e){function t(n){var r=""+n.length,s;if(typeof n=="string"){s=Buffer.allocUnsafe(r.length+2),s[0]=0;for(var o=0;o<r.length;o++)s[o+1]=parseInt(r[o],10);return s[s.length-1]=255,e(null,Buffer.concat([s,hb(n)]))}s=Buffer.allocUnsafe(r.length+2),s[0]=1;for(var o=0;o<r.length;o++)s[o+1]=parseInt(r[o],10);s[s.length-1]=255,e(null,Buffer.concat([s,n]))}va(i,!0,!0,t)}function jp(i,e,t){typeof e=="function"&&(t=e,e=null);for(var n=i,r=[],s;n.length>0;){var o="",a=n[0]===0;for(s=1;n[s]!==255;s++){if(o.length>310)return t(Rt,0,1);o+=""+n[s]}n=n.slice(o.length+1);var l=parseInt(o,10),p=n.slice(1,l+1);a&&(p=fb(p)),r.push(p),n=n.slice(l+1)}var f=r.length;for(s=0;s<f;s++){var m=r[s];t(ga(m,e,!0),s,f)}}});var Ip=C((gT,Dp)=>{var Vi=1e3,Ki=Vi*60,Gi=Ki*60,Ei=Gi*24,vb=Ei*7,gb=Ei*365.25;Dp.exports=function(i,e){e=e||{};var t=typeof i;if(t==="string"&&i.length>0)return xb(i);if(t==="number"&&isFinite(i))return e.long?bb(i):yb(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function xb(i){if(i=String(i),!(i.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(i);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*gb;case"weeks":case"week":case"w":return t*vb;case"days":case"day":case"d":return t*Ei;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Gi;case"minutes":case"minute":case"mins":case"min":case"m":return t*Ki;case"seconds":case"second":case"secs":case"sec":case"s":return t*Vi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function yb(i){var e=Math.abs(i);return e>=Ei?Math.round(i/Ei)+"d":e>=Gi?Math.round(i/Gi)+"h":e>=Ki?Math.round(i/Ki)+"m":e>=Vi?Math.round(i/Vi)+"s":i+"ms"}function bb(i){var e=Math.abs(i);return e>=Ei?Fr(i,e,Ei,"day"):e>=Gi?Fr(i,e,Gi,"hour"):e>=Ki?Fr(i,e,Ki,"minute"):e>=Vi?Fr(i,e,Vi,"second"):i+" ms"}function Fr(i,e,t,n){var r=e>=t*1.5;return Math.round(i/t)+" "+n+(r?"s":"")}});var ya=C((xT,qp)=>{function wb(i){t.debug=t,t.default=t,t.coerce=l,t.disable=o,t.enable=r,t.enabled=a,t.humanize=Ip(),t.destroy=p,Object.keys(i).forEach(f=>{t[f]=i[f]}),t.names=[],t.skips=[],t.formatters={};function e(f){let m=0;for(let _=0;_<f.length;_++)m=(m<<5)-m+f.charCodeAt(_),m|=0;return t.colors[Math.abs(m)%t.colors.length]}t.selectColor=e;function t(f){let m,_=null,E,k;function T(...M){if(!T.enabled)return;let O=T,A=Number(new Date),D=A-(m||A);O.diff=D,O.prev=m,O.curr=A,m=A,M[0]=t.coerce(M[0]),typeof M[0]!="string"&&M.unshift("%O");let U=0;M[0]=M[0].replace(/%([a-zA-Z%])/g,(z,re)=>{if(z==="%%")return"%";U++;let H=t.formatters[re];if(typeof H=="function"){let ae=M[U];z=H.call(O,ae),M.splice(U,1),U--}return z}),t.formatArgs.call(O,M),(O.log||t.log).apply(O,M)}return T.namespace=f,T.useColors=t.useColors(),T.color=t.selectColor(f),T.extend=n,T.destroy=t.destroy,Object.defineProperty(T,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(E!==t.namespaces&&(E=t.namespaces,k=t.enabled(f)),k),set:M=>{_=M}}),typeof t.init=="function"&&t.init(T),T}function n(f,m){let _=t(this.namespace+(typeof m>"u"?":":m)+f);return _.log=this.log,_}function r(f){t.save(f),t.namespaces=f,t.names=[],t.skips=[];let m=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let _ of m)_[0]==="-"?t.skips.push(_.slice(1)):t.names.push(_)}function s(f,m){let _=0,E=0,k=-1,T=0;for(;_<f.length;)if(E<m.length&&(m[E]===f[_]||m[E]==="*"))m[E]==="*"?(k=E,T=_,E++):(_++,E++);else if(k!==-1)E=k+1,T++,_=T;else return!1;for(;E<m.length&&m[E]==="*";)E++;return E===m.length}function o(){let f=[...t.names,...t.skips.map(m=>"-"+m)].join(",");return t.enable(""),f}function a(f){for(let m of t.skips)if(s(f,m))return!1;for(let m of t.names)if(s(f,m))return!0;return!1}function l(f){return f instanceof Error?f.stack||f.message:f}function p(){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}qp.exports=wb});var Lp=C((st,Ur)=>{st.formatArgs=Sb;st.save=Eb;st.load=kb;st.useColors=_b;st.storage=Cb();st.destroy=(()=>{let i=!1;return()=>{i||(i=!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`."))}})();st.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 _b(){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 i;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&&(i=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(i[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Sb(i){if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+Ur.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;i.splice(1,0,e,"color: inherit");let t=0,n=0;i[0].replace(/%[a-zA-Z%]/g,r=>{r!=="%%"&&(t++,r==="%c"&&(n=t))}),i.splice(n,0,e)}st.log=console.debug||console.log||(()=>{});function Eb(i){try{i?st.storage.setItem("debug",i):st.storage.removeItem("debug")}catch{}}function kb(){let i;try{i=st.storage.getItem("debug")||st.storage.getItem("DEBUG")}catch{}return!i&&typeof process<"u"&&"env"in process&&(i=process.env.DEBUG),i}function Cb(){try{return localStorage}catch{}}Ur.exports=ya()(st);var{formatters:Tb}=Ur.exports;Tb.j=function(i){try{return JSON.stringify(i)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Up=C((yT,Fp)=>{"use strict";Fp.exports=(i,e=process.argv)=>{let t=i.startsWith("-")?"":i.length===1?"-":"--",n=e.indexOf(t+i),r=e.indexOf("--");return n!==-1&&(r===-1||n<r)}});var _a=C((bT,zp)=>{"use strict";var Mb=require("os"),Hp=require("tty"),vt=Up(),{env:ze}=process,ui;vt("no-color")||vt("no-colors")||vt("color=false")||vt("color=never")?ui=0:(vt("color")||vt("colors")||vt("color=true")||vt("color=always"))&&(ui=1);"FORCE_COLOR"in ze&&(ze.FORCE_COLOR==="true"?ui=1:ze.FORCE_COLOR==="false"?ui=0:ui=ze.FORCE_COLOR.length===0?1:Math.min(parseInt(ze.FORCE_COLOR,10),3));function ba(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function wa(i,e){if(ui===0)return 0;if(vt("color=16m")||vt("color=full")||vt("color=truecolor"))return 3;if(vt("color=256"))return 2;if(i&&!e&&ui===void 0)return 0;let t=ui||0;if(ze.TERM==="dumb")return t;if(process.platform==="win32"){let n=Mb.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in ze)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in ze)||ze.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in ze)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ze.TEAMCITY_VERSION)?1:0;if(ze.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in ze){let n=parseInt((ze.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ze.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ze.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ze.TERM)||"COLORTERM"in ze?1:t}function Ob(i){let e=wa(i,i&&i.isTTY);return ba(e)}zp.exports={supportsColor:Ob,stdout:ba(wa(!0,Hp.isatty(1))),stderr:ba(wa(!0,Hp.isatty(2)))}});var Wp=C(($e,zr)=>{var Ab=require("tty"),Hr=require("util");$e.init=Ib;$e.log=jb;$e.formatArgs=Pb;$e.save=Nb;$e.load=Db;$e.useColors=Rb;$e.destroy=Hr.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");$e.colors=[6,2,3,4,5,1];try{let i=_a();i&&(i.stderr||i).level>=2&&($e.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{}$e.inspectOpts=Object.keys(process.env).filter(i=>/^debug_/i.test(i)).reduce((i,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(r,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),i[t]=n,i},{});function Rb(){return"colors"in $e.inspectOpts?!!$e.inspectOpts.colors:Ab.isatty(process.stderr.fd)}function Pb(i){let{namespace:e,useColors:t}=this;if(t){let n=this.color,r="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${r};1m${e} \x1B[0m`;i[0]=s+i[0].split(`
|
|
3
3
|
`).join(`
|
|
4
|
-
`+
|
|
5
|
-
`)}function
|
|
6
|
-
`).map(e=>e.trim()).join(" ")}
|
|
7
|
-
`}),super.onData(e.replace(kb,"\\n")))}doWrite(e,t,n){let s=JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");e=this.head+s+this.foot,super.doWrite(e,t,n)}};zs.JSONP=ga});var Up=T($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.WebSocket=void 0;var Tb=_i(),Mb=ie(),Fp=(0,Mb.default)("engine:ws"),xa=class extends Tb.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 s=n?t:t.toString();Fp('received "%s"',s),super.onData(s)}),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],s=t+1===e.length;this._canSendPreEncodedFrame(n)?this.socket._sender.sendFrame(n.options.wsPreEncodedFrame,s?this._onSentLast:this._onSent):this.parser.encodePacket(n,this.supportsBinary,s?this._doSendLast:this._doSend)}}_canSendPreEncodedFrame(e){var t,n,s;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"&&((s=e.options)===null||s===void 0?void 0:s.wsPreEncodedFrame)!==void 0}doClose(e){Fp("closing"),this.socket.close(),e&&e()}};$s.WebSocket=xa});var ba=T(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.WebTransport=void 0;var Ob=_i(),Ab=ie(),Rb=Hn(),Vi=(0,Ab.default)("engine:webtransport"),ya=class extends Ob.Transport{constructor(e,t,n){super({_query:{EIO:"4"}}),this.session=e;let s=(0,Rb.createPacketEncoderStream)();s.readable.pipeTo(t.writable).catch(()=>{Vi("the stream was closed")}),this.writer=s.writable.getWriter(),(async()=>{try{for(;;){let{value:r,done:o}=await n.read();if(o){Vi("session is closed");break}Vi("received chunk: %o",r),this.onPacket(r)}}catch(r){Vi("error while reading: %s",r.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){Vi("error while writing: %s",t.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(e){Vi("closing WebTransport session"),this.session.close(),e&&e()}};Ws.WebTransport=ya});var _a=T(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});var Pb=va(),Bb=Lp(),jb=Up(),Nb=ba();wa.default={polling:Hp,websocket:jb.WebSocket,webtransport:Nb.WebTransport};function Hp(i){return typeof i._query.j=="string"?new Bb.JSONP(i):new Pb.Polling(i)}Hp.upgradesTo=["websocket","webtransport"]});var Ea=T(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.Socket=void 0;var Ib=require("events"),Db=ie(),Kt=require("timers"),ne=(0,Db.default)("engine:socket"),Sa=class extends Ib.EventEmitter{get readyState(){return this._readyState}set readyState(e){ne("readyState updated from %s to %s",this._readyState,e),this._readyState=e}constructor(e,t,n,s,r){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=s,this.protocol=r,s&&(s.websocket&&s.websocket._socket?this.remoteAddress=s.websocket._socket.remoteAddress:this.remoteAddress=s.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 ne("packet received with closed socket");switch(ne(`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}ne("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}ne("got pong"),(0,Kt.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){ne("transport error"),this.onClose("transport error",e)}schedulePing(){this.pingIntervalTimer=(0,Kt.setTimeout)(()=>{ne("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){(0,Kt.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,Kt.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(),s=this.onPacket.bind(this),r=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",s),this.transport.on("drain",r),this.transport.once("close",o),this.cleanupFn.push(function(){e.removeListener("error",t),e.removeListener("ready",n),e.removeListener("packet",s),e.removeListener("drain",r),e.removeListener("close",o)})}onDrain(){if(this.sentCallbackFn.length>0){ne("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){ne('might upgrade socket transport from "%s" to "%s"',this.transport.name,e.name),this.upgrading=!0;let t=(0,Kt.setTimeout)(()=>{ne("client did not complete upgrade - closing transport"),o(),e.readyState==="open"&&e.close()},this.server.opts.upgradeTimeout),n,s=f=>{f.type==="ping"&&f.data==="probe"?(ne("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(n),n=setInterval(r,100)):f.type==="upgrade"&&this.readyState!=="closed"?(ne("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())},r=()=>{this.transport.name==="polling"&&this.transport.writable&&(ne("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}]))},o=()=>{this.upgrading=!1,clearInterval(n),(0,Kt.clearTimeout)(t),e.removeListener("packet",s),e.removeListener("close",l),e.removeListener("error",a),this.removeListener("close",p)},a=f=>{ne("client did not complete upgrade - %s",f),o(),e.close(),e=null},l=()=>{a("transport closed")},p=()=>{a("socket closed")};e.on("packet",s),e.once("close",l),e.once("error",a),this.once("close",p)}clearTransport(){let e,t=this.cleanupFn.length;for(let n=0;n<t;n++)e=this.cleanupFn.shift(),e();this.transport.on("error",function(){ne("error triggered by discarded transport")}),this.transport.close(),(0,Kt.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){this.readyState!=="closed"&&(this.readyState="closed",(0,Kt.clearTimeout)(this.pingIntervalTimer),(0,Kt.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={},s){if(typeof n=="function"&&(s=n,n={}),this.readyState!=="closing"&&this.readyState!=="closed"){ne('sending packet "%s" (%s)',e,t),n.compress=n.compress!==!1;let r={type:e,options:n};t&&(r.data=t),this.emit("packetCreate",r),this.writeBuffer.push(r),typeof s=="function"&&this.packetsFn.push(s),this.flush()}}flush(){if(this.readyState!=="closed"&&this.transport.writable&&this.writeBuffer.length){ne("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 s=t[n];this.server.opts.transports.indexOf(s)!==-1&&e.push(s)}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){ne("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{ne("all packets have been sent, closing the transport"),this.closeTransport(e)});return}ne("the buffer is empty, closing the transport right away"),this.closeTransport(e)}}closeTransport(e){ne("closing the transport (discard? %s)",!!e),e&&this.transport.discard(),this.transport.close(this.onClose.bind(this,"forced close"))}};Vs.Socket=Sa});var Wp=T(ka=>{"use strict";ka.parse=$b;ka.serialize=Wb;var qb=Object.prototype.toString,Lb=Object.prototype.hasOwnProperty,Fb=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Ub=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,Hb=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,zb=/^[\u0020-\u003A\u003D-\u007E]*$/;function $b(i,e){if(typeof i!="string")throw new TypeError("argument str must be a string");var t={},n=i.length;if(n<2)return t;var s=e&&e.decode||Vb,r=0,o=0,a=0;do{if(o=i.indexOf("=",r),o===-1)break;if(a=i.indexOf(";",r),a===-1)a=n;else if(o>a){r=i.lastIndexOf(";",o-1)+1;continue}var l=zp(i,r,o),p=$p(i,o,l),f=i.slice(l,p);if(!Lb.call(t,f)){var v=zp(i,o+1,a),_=$p(i,a,v);i.charCodeAt(v)===34&&i.charCodeAt(_-1)===34&&(v++,_--);var E=i.slice(v,_);t[f]=Gb(E,s)}r=a+1}while(r<n);return t}function zp(i,e,t){do{var n=i.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<t);return t}function $p(i,e,t){for(;e>t;){var n=i.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return t}function Wb(i,e,t){var n=t&&t.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!Fb.test(i))throw new TypeError("argument name is invalid");var s=n(e);if(!Ub.test(s))throw new TypeError("argument val is invalid");var r=i+"="+s;if(!t)return r;if(t.maxAge!=null){var o=Math.floor(t.maxAge);if(!isFinite(o))throw new TypeError("option maxAge is invalid");r+="; Max-Age="+o}if(t.domain){if(!Hb.test(t.domain))throw new TypeError("option domain is invalid");r+="; Domain="+t.domain}if(t.path){if(!zb.test(t.path))throw new TypeError("option path is invalid");r+="; Path="+t.path}if(t.expires){var a=t.expires;if(!Kb(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");r+="; Expires="+a.toUTCString()}if(t.httpOnly&&(r+="; HttpOnly"),t.secure&&(r+="; Secure"),t.partitioned&&(r+="; Partitioned"),t.priority){var l=typeof t.priority=="string"?t.priority.toLowerCase():t.priority;switch(l){case"low":r+="; Priority=Low";break;case"medium":r+="; Priority=Medium";break;case"high":r+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(t.sameSite){var p=typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite;switch(p){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return r}function Vb(i){return i.indexOf("%")!==-1?decodeURIComponent(i):i}function Kb(i){return qb.call(i)==="[object Date]"}function Gb(i,e){try{return e(i)}catch{return i}}});var Gt=T((CC,Gp)=>{"use strict";var Vp=["nodebuffer","arraybuffer","fragments"],Kp=typeof Blob<"u";Kp&&Vp.push("blob");Gp.exports={BINARY_TYPES:Vp,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Kp,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var ud=T((TC,ld)=>{var Zp=require("fs"),Yt=require("path"),Qp=require("os"),ed=typeof __webpack_require__=="function"?__non_webpack_require__:require,Yb=process.config&&process.config.variables||{},Jb=!!process.env.PREBUILDS_ONLY,Yp=process.versions.modules,Ca=Qb()?"electron":Zb()?"node-webkit":"node",Ta=process.env.npm_config_arch||Qp.arch(),Ma=process.env.npm_config_platform||Qp.platform(),td=process.env.LIBC||(ew(Ma)?"musl":"glibc"),Oa=process.env.ARM_VERSION||(Ta==="arm64"?"8":Yb.arm_version)||"",id=(process.versions.uv||"").split(".")[0];ld.exports=qt;function qt(i){return ed(qt.resolve(i))}qt.resolve=qt.path=function(i){i=Yt.resolve(i||".");try{var e=ed(Yt.join(i,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(i=process.env[e+"_PREBUILD"])}catch{}if(!Jb){var t=Jp(Yt.join(i,"build/Release"),Xp);if(t)return t;var n=Jp(Yt.join(i,"build/Debug"),Xp);if(n)return n}var s=a(i);if(s)return s;var r=a(Yt.dirname(process.execPath));if(r)return r;var o=["platform="+Ma,"arch="+Ta,"runtime="+Ca,"abi="+Yp,"uv="+id,Oa?"armv="+Oa:"","libc="+td,"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+`
|
|
4
|
+
`+s),i.push(r+"m+"+zr.exports.humanize(this.diff)+"\x1B[0m")}else i[0]=Bb()+e+" "+i[0]}function Bb(){return $e.inspectOpts.hideDate?"":new Date().toISOString()+" "}function jb(...i){return process.stderr.write(Hr.formatWithOptions($e.inspectOpts,...i)+`
|
|
5
|
+
`)}function Nb(i){i?process.env.DEBUG=i:delete process.env.DEBUG}function Db(){return process.env.DEBUG}function Ib(i){i.inspectOpts={};let e=Object.keys($e.inspectOpts);for(let t=0;t<e.length;t++)i.inspectOpts[e[t]]=$e.inspectOpts[e[t]]}zr.exports=ya()($e);var{formatters:$p}=zr.exports;$p.o=function(i){return this.inspectOpts.colors=this.useColors,Hr.inspect(i,this.inspectOpts).split(`
|
|
6
|
+
`).map(e=>e.trim()).join(" ")};$p.O=function(i){return this.inspectOpts.colors=this.useColors,Hr.inspect(i,this.inspectOpts)}});var se=C((wT,Sa)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Sa.exports=Lp():Sa.exports=Wp()});var ki=C(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.Transport=void 0;var qb=require("events"),Lb=Kn(),Fb=Np(),Ub=se(),Vp=(0,Ub.default)("engine:transport");function Hb(){}var $r=class extends qb.EventEmitter{get readyState(){return this._readyState}set readyState(e){Vp("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?Lb:Fb,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||Hb))}onError(e,t){if(this.listeners("error").length){let n=new Error(e);n.type="TransportError",n.description=t,this.emit("error",n)}else Vp("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")}};Wr.Transport=$r;$r.upgradesTo=[]});var ka=C(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.Polling=void 0;var zb=ki(),Kp=require("zlib"),$b=Pr(),Wb=se(),ut=(0,Wb.default)("engine:polling"),Vb={gzip:Kp.createGzip,deflate:Kp.createDeflate},Ea=class extends zb.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){ut("request overlap"),this.onError("overlap from client"),t.writeHead(400),t.end();return}ut("setting request"),this.req=e,this.res=t;let n=()=>{this.onError("poll connection closed prematurely")},r=()=>{e.removeListener("close",n),this.req=this.res=null};e.cleanup=r,e.on("close",n),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose&&(ut("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 r=n?Buffer.concat([]):"",s=()=>{e.removeListener("data",a),e.removeListener("end",l),e.removeListener("close",o),this.dataReq=this.dataRes=r=null},o=()=>{s(),this.onError("data request connection closed prematurely")},a=p=>{let f;n?(r=Buffer.concat([r,p]),f=r.length):(r+=p,f=Buffer.byteLength(r)),f>this.maxHttpBufferSize&&(t.writeHead(413).end(),s())},l=()=>{this.onData(r);let p={"Content-Type":"text/html","Content-Length":"2"};t.writeHead(200,this.headers(e,p)),t.end("ok"),s()};e.on("close",o),n||e.setEncoding("utf8"),e.on("data",a),e.on("end",l)}onData(e){ut('received "%s"',e);let t=n=>{if(n.type==="close")return ut("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&&(ut("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=n=>{let r=e.some(s=>s.options&&s.options.compress);this.write(n,{compress:r})};this.protocol===3?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){ut('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,n){let r=typeof e=="string",o={"Content-Type":r?"text/plain; charset=UTF-8":"application/octet-stream"},a=f=>{o["Content-Length"]=typeof f=="string"?Buffer.byteLength(f):f.length,this.res.writeHead(200,this.headers(this.req,o)),this.res.end(f),n()};if(!this.httpCompression||!t.compress){a(e);return}if((r?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let p=$b(this.req).encodings(["gzip","deflate"]);if(!p){a(e);return}this.compress(e,p,(f,m)=>{if(f){this.res.writeHead(500),this.res.end(),n(f);return}o["Content-Encoding"]=p,a(m)})}compress(e,t,n){ut("compressing");let r=[],s=0;Vb[t](this.httpCompression).on("error",n).on("data",function(o){r.push(o),s+=o.length}).on("end",function(){n(null,Buffer.concat(r,s))}).end(e)}doClose(e){ut("closing");let t;this.dataReq&&(ut("aborting ongoing data request"),this.dataReq.destroy());let n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(ut("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(ut("transport discarded - closing right away"),n()):(ut("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}};Vr.Polling=Ea});var Gp=C(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.JSONP=void 0;var Kb=ka(),Gb=require("querystring"),Yb=/\\\\n/g,Jb=/(\\)?\\n/g,Ca=class extends Kb.Polling{constructor(e){super(e),this.head="___eio["+(e._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(e){e=Gb.parse(e).d,typeof e=="string"&&(e=e.replace(Jb,function(t,n){return n?t:`
|
|
7
|
+
`}),super.onData(e.replace(Yb,"\\n")))}doWrite(e,t,n){let r=JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");e=this.head+r+this.foot,super.doWrite(e,t,n)}};Kr.JSONP=Ca});var Jp=C(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.WebSocket=void 0;var Xb=ki(),Zb=se(),Yp=(0,Zb.default)("engine:ws"),Ta=class extends Xb.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 r=n?t:t.toString();Yp('received "%s"',r),super.onData(r)}),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],r=t+1===e.length;this._canSendPreEncodedFrame(n)?this.socket._sender.sendFrame(n.options.wsPreEncodedFrame,r?this._onSentLast:this._onSent):this.parser.encodePacket(n,this.supportsBinary,r?this._doSendLast:this._doSend)}}_canSendPreEncodedFrame(e){var t,n,r;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"&&((r=e.options)===null||r===void 0?void 0:r.wsPreEncodedFrame)!==void 0}doClose(e){Yp("closing"),this.socket.close(),e&&e()}};Gr.WebSocket=Ta});var Oa=C(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.WebTransport=void 0;var Qb=ki(),ew=se(),tw=Kn(),Yi=(0,ew.default)("engine:webtransport"),Ma=class extends Qb.Transport{constructor(e,t,n){super({_query:{EIO:"4"}}),this.session=e;let r=(0,tw.createPacketEncoderStream)();r.readable.pipeTo(t.writable).catch(()=>{Yi("the stream was closed")}),this.writer=r.writable.getWriter(),(async()=>{try{for(;;){let{value:s,done:o}=await n.read();if(o){Yi("session is closed");break}Yi("received chunk: %o",s),this.onPacket(s)}}catch(s){Yi("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){Yi("error while writing: %s",t.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(e){Yi("closing WebTransport session"),this.session.close(),e&&e()}};Yr.WebTransport=Ma});var Ra=C(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});var iw=ka(),nw=Gp(),rw=Jp(),sw=Oa();Aa.default={polling:Xp,websocket:rw.WebSocket,webtransport:sw.WebTransport};function Xp(i){return typeof i._query.j=="string"?new nw.JSONP(i):new iw.Polling(i)}Xp.upgradesTo=["websocket","webtransport"]});var Ba=C(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.Socket=void 0;var ow=require("events"),aw=se(),Gt=require("timers"),oe=(0,aw.default)("engine:socket"),Pa=class extends ow.EventEmitter{get readyState(){return this._readyState}set readyState(e){oe("readyState updated from %s to %s",this._readyState,e),this._readyState=e}constructor(e,t,n,r,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=r,this.protocol=s,r&&(r.websocket&&r.websocket._socket?this.remoteAddress=r.websocket._socket.remoteAddress:this.remoteAddress=r.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 oe("packet received with closed socket");switch(oe(`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}oe("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}oe("got pong"),(0,Gt.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){oe("transport error"),this.onClose("transport error",e)}schedulePing(){this.pingIntervalTimer=(0,Gt.setTimeout)(()=>{oe("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){(0,Gt.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,Gt.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(),r=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",r),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",r),e.removeListener("drain",s),e.removeListener("close",o)})}onDrain(){if(this.sentCallbackFn.length>0){oe("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){oe('might upgrade socket transport from "%s" to "%s"',this.transport.name,e.name),this.upgrading=!0;let t=(0,Gt.setTimeout)(()=>{oe("client did not complete upgrade - closing transport"),o(),e.readyState==="open"&&e.close()},this.server.opts.upgradeTimeout),n,r=f=>{f.type==="ping"&&f.data==="probe"?(oe("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(n),n=setInterval(s,100)):f.type==="upgrade"&&this.readyState!=="closed"?(oe("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&&(oe("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}]))},o=()=>{this.upgrading=!1,clearInterval(n),(0,Gt.clearTimeout)(t),e.removeListener("packet",r),e.removeListener("close",l),e.removeListener("error",a),this.removeListener("close",p)},a=f=>{oe("client did not complete upgrade - %s",f),o(),e.close(),e=null},l=()=>{a("transport closed")},p=()=>{a("socket closed")};e.on("packet",r),e.once("close",l),e.once("error",a),this.once("close",p)}clearTransport(){let e,t=this.cleanupFn.length;for(let n=0;n<t;n++)e=this.cleanupFn.shift(),e();this.transport.on("error",function(){oe("error triggered by discarded transport")}),this.transport.close(),(0,Gt.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){this.readyState!=="closed"&&(this.readyState="closed",(0,Gt.clearTimeout)(this.pingIntervalTimer),(0,Gt.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={},r){if(typeof n=="function"&&(r=n,n={}),this.readyState!=="closing"&&this.readyState!=="closed"){oe('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 r=="function"&&this.packetsFn.push(r),this.flush()}}flush(){if(this.readyState!=="closed"&&this.transport.writable&&this.writeBuffer.length){oe("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 r=t[n];this.server.opts.transports.indexOf(r)!==-1&&e.push(r)}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){oe("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{oe("all packets have been sent, closing the transport"),this.closeTransport(e)});return}oe("the buffer is empty, closing the transport right away"),this.closeTransport(e)}}closeTransport(e){oe("closing the transport (discard? %s)",!!e),e&&this.transport.discard(),this.transport.close(this.onClose.bind(this,"forced close"))}};Jr.Socket=Pa});var ed=C(ja=>{"use strict";ja.parse=hw;ja.serialize=mw;var cw=Object.prototype.toString,lw=Object.prototype.hasOwnProperty,uw=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,pw=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,dw=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,fw=/^[\u0020-\u003A\u003D-\u007E]*$/;function hw(i,e){if(typeof i!="string")throw new TypeError("argument str must be a string");var t={},n=i.length;if(n<2)return t;var r=e&&e.decode||vw,s=0,o=0,a=0;do{if(o=i.indexOf("=",s),o===-1)break;if(a=i.indexOf(";",s),a===-1)a=n;else if(o>a){s=i.lastIndexOf(";",o-1)+1;continue}var l=Zp(i,s,o),p=Qp(i,o,l),f=i.slice(l,p);if(!lw.call(t,f)){var m=Zp(i,o+1,a),_=Qp(i,a,m);i.charCodeAt(m)===34&&i.charCodeAt(_-1)===34&&(m++,_--);var E=i.slice(m,_);t[f]=xw(E,r)}s=a+1}while(s<n);return t}function Zp(i,e,t){do{var n=i.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<t);return t}function Qp(i,e,t){for(;e>t;){var n=i.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return t}function mw(i,e,t){var n=t&&t.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!uw.test(i))throw new TypeError("argument name is invalid");var r=n(e);if(!pw.test(r))throw new TypeError("argument val is invalid");var s=i+"="+r;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(!dw.test(t.domain))throw new TypeError("option domain is invalid");s+="; Domain="+t.domain}if(t.path){if(!fw.test(t.path))throw new TypeError("option path is invalid");s+="; Path="+t.path}if(t.expires){var a=t.expires;if(!gw(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 l=typeof t.priority=="string"?t.priority.toLowerCase():t.priority;switch(l){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 p=typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite;switch(p){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 vw(i){return i.indexOf("%")!==-1?decodeURIComponent(i):i}function gw(i){return cw.call(i)==="[object Date]"}function xw(i,e){try{return e(i)}catch{return i}}});var Yt=C((AT,nd)=>{"use strict";var td=["nodebuffer","arraybuffer","fragments"],id=typeof Blob<"u";id&&td.push("blob");nd.exports={BINARY_TYPES:td,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:id,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var yd=C((RT,xd)=>{var ad=require("fs"),Jt=require("path"),cd=require("os"),ld=typeof __webpack_require__=="function"?__non_webpack_require__:require,yw=process.config&&process.config.variables||{},bw=!!process.env.PREBUILDS_ONLY,rd=process.versions.modules,Na=Sw()?"electron":_w()?"node-webkit":"node",Da=process.env.npm_config_arch||cd.arch(),Ia=process.env.npm_config_platform||cd.platform(),ud=process.env.LIBC||(Ew(Ia)?"musl":"glibc"),qa=process.env.ARM_VERSION||(Da==="arm64"?"8":yw.arm_version)||"",pd=(process.versions.uv||"").split(".")[0];xd.exports=Lt;function Lt(i){return ld(Lt.resolve(i))}Lt.resolve=Lt.path=function(i){i=Jt.resolve(i||".");try{var e=ld(Jt.join(i,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(i=process.env[e+"_PREBUILD"])}catch{}if(!bw){var t=sd(Jt.join(i,"build/Release"),od);if(t)return t;var n=sd(Jt.join(i,"build/Debug"),od);if(n)return n}var r=a(i);if(r)return r;var s=a(Jt.dirname(process.execPath));if(s)return s;var o=["platform="+Ia,"arch="+Da,"runtime="+Na,"abi="+rd,"uv="+pd,qa?"armv="+qa:"","libc="+ud,"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+`
|
|
8
8
|
loaded from: `+i+`
|
|
9
|
-
`);function a(l){var p=Aa(Yt.join(l,"prebuilds")).map(nd),f=p.filter(sd(Ma,Ta)).sort(rd)[0];if(f){var v=Yt.join(l,"prebuilds",f.name),_=Aa(v).map(od),E=_.filter(ad(Ca,Yp)),C=E.sort(cd(Ca))[0];if(C)return Yt.join(v,C.file)}}};function Aa(i){try{return Zp.readdirSync(i)}catch{return[]}}function Jp(i,e){var t=Aa(i).filter(e);return t[0]&&Yt.join(i,t[0])}function Xp(i){return/\.node$/.test(i)}function nd(i){var e=i.split("-");if(e.length===2){var t=e[0],n=e[1].split("+");if(t&&n.length&&n.every(Boolean))return{name:i,platform:t,architectures:n}}}function sd(i,e){return function(t){return t==null||t.platform!==i?!1:t.architectures.includes(e)}}function rd(i,e){return i.architectures.length-e.architectures.length}function od(i){var e=i.split("."),t=e.pop(),n={file:i,specificity:0};if(t==="node"){for(var s=0;s<e.length;s++){var r=e[s];if(r==="node"||r==="electron"||r==="node-webkit")n.runtime=r;else if(r==="napi")n.napi=!0;else if(r.slice(0,3)==="abi")n.abi=r.slice(3);else if(r.slice(0,2)==="uv")n.uv=r.slice(2);else if(r.slice(0,4)==="armv")n.armv=r.slice(4);else if(r==="glibc"||r==="musl")n.libc=r;else continue;n.specificity++}return n}}function ad(i,e){return function(t){return!(t==null||t.runtime&&t.runtime!==i&&!Xb(t)||t.abi&&t.abi!==e&&!t.napi||t.uv&&t.uv!==id||t.armv&&t.armv!==Oa||t.libc&&t.libc!==td)}}function Xb(i){return i.runtime==="node"&&i.napi}function cd(i){return function(e,t){return e.runtime!==t.runtime?e.runtime===i?-1:1:e.abi!==t.abi?e.abi?-1:1:e.specificity!==t.specificity?e.specificity>t.specificity?-1:1:0}}function Zb(){return!!(process.versions&&process.versions.nw)}function Qb(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function ew(i){return i==="linux"&&Zp.existsSync("/etc/alpine-release")}qt.parseTags=od;qt.matchTags=ad;qt.compareTags=cd;qt.parseTuple=nd;qt.matchTuple=sd;qt.compareTuples=rd});var Ba=T((MC,Pa)=>{var Ra=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof Ra.addon=="function"?Pa.exports=Ra.addon.bind(Ra):Pa.exports=ud()});var dd=T((OC,pd)=>{"use strict";var tw=(i,e,t,n,s)=>{for(var r=0;r<s;r++)t[n+r]=i[r]^e[r&3]},iw=(i,e)=>{let t=i.length;for(var n=0;n<t;n++)i[n]^=e[n&3]};pd.exports={mask:tw,unmask:iw}});var fd=T((AC,ja)=>{"use strict";try{ja.exports=Ba()(__dirname)}catch{ja.exports=dd()}});var zn=T((RC,Ks)=>{"use strict";var{EMPTY_BUFFER:nw}=Gt(),Na=Buffer[Symbol.species];function sw(i,e){if(i.length===0)return nw;if(i.length===1)return i[0];let t=Buffer.allocUnsafe(e),n=0;for(let s=0;s<i.length;s++){let r=i[s];t.set(r,n),n+=r.length}return n<e?new Na(t.buffer,t.byteOffset,n):t}function hd(i,e,t,n,s){for(let r=0;r<s;r++)t[n+r]=i[r]^e[r&3]}function md(i,e){for(let t=0;t<i.length;t++)i[t]^=e[t&3]}function rw(i){return i.length===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.length)}function Ia(i){if(Ia.readOnly=!0,Buffer.isBuffer(i))return i;let e;return i instanceof ArrayBuffer?e=new Na(i):ArrayBuffer.isView(i)?e=new Na(i.buffer,i.byteOffset,i.byteLength):(e=Buffer.from(i),Ia.readOnly=!1),e}Ks.exports={concat:sw,mask:hd,toArrayBuffer:rw,toBuffer:Ia,unmask:md};if(!process.env.WS_NO_BUFFER_UTIL)try{let i=fd();Ks.exports.mask=function(e,t,n,s,r){r<48?hd(e,t,n,s,r):i.mask(e,t,n,s,r)},Ks.exports.unmask=function(e,t){e.length<32?md(e,t):i.unmask(e,t)}}catch{}});var xd=T((PC,gd)=>{"use strict";var vd=Symbol("kDone"),Da=Symbol("kRun"),qa=class{constructor(e){this[vd]=()=>{this.pending--,this[Da]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Da]()}[Da](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[vd])}}};gd.exports=qa});var Wn=T((BC,_d)=>{"use strict";var $n=require("zlib"),yd=zn(),ow=xd(),{kStatusCode:bd}=Gt(),aw=Buffer[Symbol.species],cw=Buffer.from([0,0,255,255]),Ys=Symbol("permessage-deflate"),Jt=Symbol("total-length"),Ki=Symbol("callback"),li=Symbol("buffers"),Gi=Symbol("error"),Gs,La=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,!Gs){let s=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Gs=new ow(s)}}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[Ki];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(s=>!(t.serverNoContextTakeover===!1&&s.server_no_context_takeover||s.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>s.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!s.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 s=t[n];if(s.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(s=s[0],n==="client_max_window_bits"){if(s!==!0){let r=+s;if(!Number.isInteger(r)||r<8||r>15)throw new TypeError(`Invalid value for parameter "${n}": ${s}`);s=r}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${s}`)}else if(n==="server_max_window_bits"){let r=+s;if(!Number.isInteger(r)||r<8||r>15)throw new TypeError(`Invalid value for parameter "${n}": ${s}`);s=r}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(s!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${s}`)}else throw new Error(`Unknown parameter "${n}"`);t[n]=s})}),e}decompress(e,t,n){Gs.add(s=>{this._decompress(e,t,(r,o)=>{s(),n(r,o)})})}compress(e,t,n){Gs.add(s=>{this._compress(e,t,(r,o)=>{s(),n(r,o)})})}_decompress(e,t,n){let s=this._isServer?"client":"server";if(!this._inflate){let r=`${s}_max_window_bits`,o=typeof this.params[r]!="number"?$n.Z_DEFAULT_WINDOWBITS:this.params[r];this._inflate=$n.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[Ys]=this,this._inflate[Jt]=0,this._inflate[li]=[],this._inflate.on("error",uw),this._inflate.on("data",wd)}this._inflate[Ki]=n,this._inflate.write(e),t&&this._inflate.write(cw),this._inflate.flush(()=>{let r=this._inflate[Gi];if(r){this._inflate.close(),this._inflate=null,n(r);return}let o=yd.concat(this._inflate[li],this._inflate[Jt]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Jt]=0,this._inflate[li]=[],t&&this.params[`${s}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(e,t,n){let s=this._isServer?"server":"client";if(!this._deflate){let r=`${s}_max_window_bits`,o=typeof this.params[r]!="number"?$n.Z_DEFAULT_WINDOWBITS:this.params[r];this._deflate=$n.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[Jt]=0,this._deflate[li]=[],this._deflate.on("data",lw)}this._deflate[Ki]=n,this._deflate.write(e),this._deflate.flush($n.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let r=yd.concat(this._deflate[li],this._deflate[Jt]);t&&(r=new aw(r.buffer,r.byteOffset,r.length-4)),this._deflate[Ki]=null,this._deflate[Jt]=0,this._deflate[li]=[],t&&this.params[`${s}_no_context_takeover`]&&this._deflate.reset(),n(null,r)})}};_d.exports=La;function lw(i){this[li].push(i),this[Jt]+=i.length}function wd(i){if(this[Jt]+=i.length,this[Ys]._maxPayload<1||this[Jt]<=this[Ys]._maxPayload){this[li].push(i);return}this[Gi]=new RangeError("Max payload size exceeded"),this[Gi].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Gi][bd]=1009,this.removeListener("data",wd),this.reset()}function uw(i){if(this[Ys]._inflate=null,this[Gi]){this[Ki](this[Gi]);return}i[bd]=1007,this[Ki](i)}});var Ed=T((jC,Sd)=>{"use strict";function pw(i){let e=i.length,t=0;for(;t<e;)if((i[t]&128)===0)t++;else if((i[t]&224)===192){if(t+1===e||(i[t+1]&192)!==128||(i[t]&254)===192)return!1;t+=2}else if((i[t]&240)===224){if(t+2>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||i[t]===224&&(i[t+1]&224)===128||i[t]===237&&(i[t+1]&224)===160)return!1;t+=3}else if((i[t]&248)===240){if(t+3>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||(i[t+3]&192)!==128||i[t]===240&&(i[t+1]&240)===128||i[t]===244&&i[t+1]>143||i[t]>244)return!1;t+=4}else return!1;return!0}Sd.exports=pw});var kd=T((NC,Fa)=>{"use strict";try{Fa.exports=Ba()(__dirname)}catch{Fa.exports=Ed()}});var Yi=T((IC,Js)=>{"use strict";var{isUtf8:Cd}=require("buffer"),{hasBlob:dw}=Gt(),fw=[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 hw(i){return i>=1e3&&i<=1014&&i!==1004&&i!==1005&&i!==1006||i>=3e3&&i<=4999}function Ua(i){let e=i.length,t=0;for(;t<e;)if((i[t]&128)===0)t++;else if((i[t]&224)===192){if(t+1===e||(i[t+1]&192)!==128||(i[t]&254)===192)return!1;t+=2}else if((i[t]&240)===224){if(t+2>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||i[t]===224&&(i[t+1]&224)===128||i[t]===237&&(i[t+1]&224)===160)return!1;t+=3}else if((i[t]&248)===240){if(t+3>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||(i[t+3]&192)!==128||i[t]===240&&(i[t+1]&240)===128||i[t]===244&&i[t+1]>143||i[t]>244)return!1;t+=4}else return!1;return!0}function mw(i){return dw&&typeof i=="object"&&typeof i.arrayBuffer=="function"&&typeof i.type=="string"&&typeof i.stream=="function"&&(i[Symbol.toStringTag]==="Blob"||i[Symbol.toStringTag]==="File")}Js.exports={isBlob:mw,isValidStatusCode:hw,isValidUTF8:Ua,tokenChars:fw};if(Cd)Js.exports.isValidUTF8=function(i){return i.length<24?Ua(i):Cd(i)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let i=kd();Js.exports.isValidUTF8=function(e){return e.length<32?Ua(e):i(e)}}catch{}});var Va=T((DC,Bd)=>{"use strict";var{Writable:vw}=require("stream"),Td=Wn(),{BINARY_TYPES:gw,EMPTY_BUFFER:Md,kStatusCode:xw,kWebSocket:yw}=Gt(),{concat:Ha,toArrayBuffer:bw,unmask:ww}=zn(),{isValidStatusCode:_w,isValidUTF8:Od}=Yi(),Xs=Buffer[Symbol.species],vt=0,Ad=1,Rd=2,Pd=3,za=4,$a=5,Zs=6,Wa=class extends vw{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||gw[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[yw]=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=vt}_write(e,t,n){if(this._opcode===8&&this._state==vt)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 Xs(n.buffer,n.byteOffset+e,n.length-e),new Xs(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],s=t.length-e;e>=n.length?t.set(this._buffers.shift(),s):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),s),this._buffers[0]=new Xs(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 vt:this.getInfo(e);break;case Ad:this.getPayloadLength16(e);break;case Rd:this.getPayloadLength64(e);break;case Pd:this.getMask();break;case za:this.getData(e);break;case $a:case Zs: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 s=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(s);return}let n=(t[0]&64)===64;if(n&&!this._extensions[Td.extensionName]){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(s);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(s);return}if(!this._fragmented){let s=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(s);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let s=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(s);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let s=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(s);return}if(n){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(s);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let s=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(s);return}}else{let s=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(s);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let s=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(s);return}}else if(this._masked){let s=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(s);return}this._payloadLength===126?this._state=Ad:this._payloadLength===127?this._state=Rd: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 s=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(s);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=Pd:this._state=za}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=za}getData(e){let t=Md;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&&ww(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=$a,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[Td.extensionName].decompress(e,this._fin,(s,r)=>{if(s)return t(s);if(r.length){if(this._messageLength+=r.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(r)}this.dataMessage(t),this._state===vt&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=vt;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let s;this._binaryType==="nodebuffer"?s=Ha(n,t):this._binaryType==="arraybuffer"?s=bw(Ha(n,t)):this._binaryType==="blob"?s=new Blob(n):s=n,this._allowSynchronousEvents?(this.emit("message",s,!0),this._state=vt):(this._state=Zs,setImmediate(()=>{this.emit("message",s,!0),this._state=vt,this.startLoop(e)}))}else{let s=Ha(n,t);if(!this._skipUTF8Validation&&!Od(s)){let r=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(r);return}this._state===$a||this._allowSynchronousEvents?(this.emit("message",s,!1),this._state=vt):(this._state=Zs,setImmediate(()=>{this.emit("message",s,!1),this._state=vt,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,Md),this.end();else{let n=e.readUInt16BE(0);if(!_w(n)){let r=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(r);return}let s=new Xs(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Od(s)){let r=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(r);return}this._loop=!1,this.emit("conclude",n,s),this.end()}this._state=vt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=vt):(this._state=Zs,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=vt,this.startLoop(t)}))}createError(e,t,n,s,r){this._loop=!1,this._errored=!0;let o=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=r,o[xw]=s,o}};Bd.exports=Wa});var Ya=T((LC,Id)=>{"use strict";var{Duplex:qC}=require("stream"),{randomFillSync:Sw}=require("crypto"),jd=Wn(),{EMPTY_BUFFER:Ew,kWebSocket:kw,NOOP:Cw}=Gt(),{isBlob:Ji,isValidStatusCode:Tw}=Yi(),{mask:Nd,toBuffer:Si}=zn(),gt=Symbol("kByteLength"),Mw=Buffer.alloc(4),Qs=8*1024,Ei,Xi=Qs,Rt=0,Ow=1,Aw=2,Ka=class i{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=Rt,this.onerror=Cw,this[kw]=void 0}static frame(e,t){let n,s=!1,r=2,o=!1;t.mask&&(n=t.maskBuffer||Mw,t.generateMask?t.generateMask(n):(Xi===Qs&&(Ei===void 0&&(Ei=Buffer.alloc(Qs)),Sw(Ei,0,Qs),Xi=0),n[0]=Ei[Xi++],n[1]=Ei[Xi++],n[2]=Ei[Xi++],n[3]=Ei[Xi++]),o=(n[0]|n[1]|n[2]|n[3])===0,r=6);let a;typeof e=="string"?(!t.mask||o)&&t[gt]!==void 0?a=t[gt]:(e=Buffer.from(e),a=e.length):(a=e.length,s=t.mask&&t.readOnly&&!o);let l=a;a>=65536?(r+=8,l=127):a>125&&(r+=2,l=126);let p=Buffer.allocUnsafe(s?a+r:r);return p[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(p[0]|=64),p[1]=l,l===126?p.writeUInt16BE(a,2):l===127&&(p[2]=p[3]=0,p.writeUIntBE(a,4,6)),t.mask?(p[1]|=128,p[r-4]=n[0],p[r-3]=n[1],p[r-2]=n[2],p[r-1]=n[3],o?[p,e]:s?(Nd(e,n,p,r,a),[p]):(Nd(e,n,e,0,a),[p,e])):[p,e]}close(e,t,n,s){let r;if(e===void 0)r=Ew;else{if(typeof e!="number"||!Tw(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)r=Buffer.allocUnsafe(2),r.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");r=Buffer.allocUnsafe(2+a),r.writeUInt16BE(e,0),typeof t=="string"?r.write(t,2):r.set(t,2)}}let o={[gt]:r.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Rt?this.enqueue([this.dispatch,r,!1,o,s]):this.sendFrame(i.frame(r,o),s)}ping(e,t,n){let s,r;if(typeof e=="string"?(s=Buffer.byteLength(e),r=!1):Ji(e)?(s=e.size,r=!1):(e=Si(e),s=e.length,r=Si.readOnly),s>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[gt]:s,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:r,rsv1:!1};Ji(e)?this._state!==Rt?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Rt?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(i.frame(e,o),n)}pong(e,t,n){let s,r;if(typeof e=="string"?(s=Buffer.byteLength(e),r=!1):Ji(e)?(s=e.size,r=!1):(e=Si(e),s=e.length,r=Si.readOnly),s>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[gt]:s,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:r,rsv1:!1};Ji(e)?this._state!==Rt?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Rt?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(i.frame(e,o),n)}send(e,t,n){let s=this._extensions[jd.extensionName],r=t.binary?2:1,o=t.compress,a,l;typeof e=="string"?(a=Buffer.byteLength(e),l=!1):Ji(e)?(a=e.size,l=!1):(e=Si(e),a=e.length,l=Si.readOnly),this._firstFragment?(this._firstFragment=!1,o&&s&&s.params[s._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=s._threshold),this._compress=o):(o=!1,r=0),t.fin&&(this._firstFragment=!0);let p={[gt]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:r,readOnly:l,rsv1:o};Ji(e)?this._state!==Rt?this.enqueue([this.getBlobData,e,this._compress,p,n]):this.getBlobData(e,this._compress,p,n):this._state!==Rt?this.enqueue([this.dispatch,e,this._compress,p,n]):this.dispatch(e,this._compress,p,n)}getBlobData(e,t,n,s){this._bufferedBytes+=n[gt],this._state=Aw,e.arrayBuffer().then(r=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Ga,this,a,s);return}this._bufferedBytes-=n[gt];let o=Si(r);t?this.dispatch(o,t,n,s):(this._state=Rt,this.sendFrame(i.frame(o,n),s),this.dequeue())}).catch(r=>{process.nextTick(Rw,this,r,s)})}dispatch(e,t,n,s){if(!t){this.sendFrame(i.frame(e,n),s);return}let r=this._extensions[jd.extensionName];this._bufferedBytes+=n[gt],this._state=Ow,r.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let l=new Error("The socket was closed while data was being compressed");Ga(this,l,s);return}this._bufferedBytes-=n[gt],this._state=Rt,n.readOnly=!1,this.sendFrame(i.frame(a,n),s),this.dequeue()})}dequeue(){for(;this._state===Rt&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][gt],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][gt],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)}};Id.exports=Ka;function Ga(i,e,t){typeof t=="function"&&t(e);for(let n=0;n<i._queue.length;n++){let s=i._queue[n],r=s[s.length-1];typeof r=="function"&&r(e)}}function Rw(i,e,t){Ga(i,e,t),i.onerror(e)}});var Wd=T((FC,$d)=>{"use strict";var{kForOnEventAttribute:Vn,kListener:Ja}=Gt(),Dd=Symbol("kCode"),qd=Symbol("kData"),Ld=Symbol("kError"),Fd=Symbol("kMessage"),Ud=Symbol("kReason"),Zi=Symbol("kTarget"),Hd=Symbol("kType"),zd=Symbol("kWasClean"),Xt=class{constructor(e){this[Zi]=null,this[Hd]=e}get target(){return this[Zi]}get type(){return this[Hd]}};Object.defineProperty(Xt.prototype,"target",{enumerable:!0});Object.defineProperty(Xt.prototype,"type",{enumerable:!0});var ki=class extends Xt{constructor(e,t={}){super(e),this[Dd]=t.code===void 0?0:t.code,this[Ud]=t.reason===void 0?"":t.reason,this[zd]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[Dd]}get reason(){return this[Ud]}get wasClean(){return this[zd]}};Object.defineProperty(ki.prototype,"code",{enumerable:!0});Object.defineProperty(ki.prototype,"reason",{enumerable:!0});Object.defineProperty(ki.prototype,"wasClean",{enumerable:!0});var Qi=class extends Xt{constructor(e,t={}){super(e),this[Ld]=t.error===void 0?null:t.error,this[Fd]=t.message===void 0?"":t.message}get error(){return this[Ld]}get message(){return this[Fd]}};Object.defineProperty(Qi.prototype,"error",{enumerable:!0});Object.defineProperty(Qi.prototype,"message",{enumerable:!0});var Kn=class extends Xt{constructor(e,t={}){super(e),this[qd]=t.data===void 0?null:t.data}get data(){return this[qd]}};Object.defineProperty(Kn.prototype,"data",{enumerable:!0});var Pw={addEventListener(i,e,t={}){for(let s of this.listeners(i))if(!t[Vn]&&s[Ja]===e&&!s[Vn])return;let n;if(i==="message")n=function(r,o){let a=new Kn("message",{data:o?r:r.toString()});a[Zi]=this,er(e,this,a)};else if(i==="close")n=function(r,o){let a=new ki("close",{code:r,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[Zi]=this,er(e,this,a)};else if(i==="error")n=function(r){let o=new Qi("error",{error:r,message:r.message});o[Zi]=this,er(e,this,o)};else if(i==="open")n=function(){let r=new Xt("open");r[Zi]=this,er(e,this,r)};else return;n[Vn]=!!t[Vn],n[Ja]=e,t.once?this.once(i,n):this.on(i,n)},removeEventListener(i,e){for(let t of this.listeners(i))if(t[Ja]===e&&!t[Vn]){this.removeListener(i,t);break}}};$d.exports={CloseEvent:ki,ErrorEvent:Qi,Event:Xt,EventTarget:Pw,MessageEvent:Kn};function er(i,e,t){typeof i=="object"&&i.handleEvent?i.handleEvent.call(i,t):i.call(e,t)}});var Xa=T((UC,Vd)=>{"use strict";var{tokenChars:Gn}=Yi();function Lt(i,e,t){i[e]===void 0?i[e]=[t]:i[e].push(t)}function Bw(i){let e=Object.create(null),t=Object.create(null),n=!1,s=!1,r=!1,o,a,l=-1,p=-1,f=-1,v=0;for(;v<i.length;v++)if(p=i.charCodeAt(v),o===void 0)if(f===-1&&Gn[p]===1)l===-1&&(l=v);else if(v!==0&&(p===32||p===9))f===-1&&l!==-1&&(f=v);else if(p===59||p===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${v}`);f===-1&&(f=v);let E=i.slice(l,f);p===44?(Lt(e,E,t),t=Object.create(null)):o=E,l=f=-1}else throw new SyntaxError(`Unexpected character at index ${v}`);else if(a===void 0)if(f===-1&&Gn[p]===1)l===-1&&(l=v);else if(p===32||p===9)f===-1&&l!==-1&&(f=v);else if(p===59||p===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${v}`);f===-1&&(f=v),Lt(t,i.slice(l,f),!0),p===44&&(Lt(e,o,t),t=Object.create(null),o=void 0),l=f=-1}else if(p===61&&l!==-1&&f===-1)a=i.slice(l,v),l=f=-1;else throw new SyntaxError(`Unexpected character at index ${v}`);else if(s){if(Gn[p]!==1)throw new SyntaxError(`Unexpected character at index ${v}`);l===-1?l=v:n||(n=!0),s=!1}else if(r)if(Gn[p]===1)l===-1&&(l=v);else if(p===34&&l!==-1)r=!1,f=v;else if(p===92)s=!0;else throw new SyntaxError(`Unexpected character at index ${v}`);else if(p===34&&i.charCodeAt(v-1)===61)r=!0;else if(f===-1&&Gn[p]===1)l===-1&&(l=v);else if(l!==-1&&(p===32||p===9))f===-1&&(f=v);else if(p===59||p===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${v}`);f===-1&&(f=v);let E=i.slice(l,f);n&&(E=E.replace(/\\/g,""),n=!1),Lt(t,a,E),p===44&&(Lt(e,o,t),t=Object.create(null),o=void 0),a=void 0,l=f=-1}else throw new SyntaxError(`Unexpected character at index ${v}`);if(l===-1||r||p===32||p===9)throw new SyntaxError("Unexpected end of input");f===-1&&(f=v);let _=i.slice(l,f);return o===void 0?Lt(e,_,t):(a===void 0?Lt(t,_,!0):n?Lt(t,a,_.replace(/\\/g,"")):Lt(t,a,_),Lt(e,o,t)),e}function jw(i){return Object.keys(i).map(e=>{let t=i[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(s=>{let r=n[s];return Array.isArray(r)||(r=[r]),r.map(o=>o===!0?s:`${s}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Vd.exports={format:jw,parse:Bw}});var sr=T(($C,rf)=>{"use strict";var Nw=require("events"),Iw=require("https"),Dw=require("http"),Yd=require("net"),qw=require("tls"),{randomBytes:Lw,createHash:Fw}=require("crypto"),{Duplex:HC,Readable:zC}=require("stream"),{URL:Za}=require("url"),ui=Wn(),Uw=Va(),Hw=Ya(),{isBlob:zw}=Yi(),{BINARY_TYPES:Kd,EMPTY_BUFFER:tr,GUID:$w,kForOnEventAttribute:Qa,kListener:Ww,kStatusCode:Vw,kWebSocket:ze,NOOP:Jd}=Gt(),{EventTarget:{addEventListener:Kw,removeEventListener:Gw}}=Wd(),{format:Yw,parse:Jw}=Xa(),{toBuffer:Xw}=zn(),Zw=30*1e3,Xd=Symbol("kAborted"),ec=[8,13],Zt=["CONNECTING","OPEN","CLOSING","CLOSED"],Qw=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Z=class i extends Nw{constructor(e,t,n){super(),this._binaryType=Kd[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=tr,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=i.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]),Zd(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Kd.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 s=new Uw({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),r=new Hw(e,this._extensions,n.generateMask);this._receiver=s,this._sender=r,this._socket=e,s[ze]=this,r[ze]=this,e[ze]=this,s.on("conclude",i1),s.on("drain",n1),s.on("error",s1),s.on("message",r1),s.on("ping",o1),s.on("pong",a1),r.onerror=c1,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",tf),e.on("data",nr),e.on("end",nf),e.on("error",sf),this._readyState=i.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=i.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[ui.extensionName]&&this._extensions[ui.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=i.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==i.CLOSED){if(this.readyState===i.CONNECTING){ut(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===i.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=i.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),ef(this)}}pause(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===i.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!==i.OPEN){tc(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||tr,t,n)}pong(e,t,n){if(this.readyState===i.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!==i.OPEN){tc(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||tr,t,n)}resume(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===i.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!==i.OPEN){tc(this,e,n);return}let s={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[ui.extensionName]||(s.compress=!1),this._sender.send(e||tr,s,n)}terminate(){if(this.readyState!==i.CLOSED){if(this.readyState===i.CONNECTING){ut(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=i.CLOSING,this._socket.destroy())}}};Object.defineProperty(Z,"CONNECTING",{enumerable:!0,value:Zt.indexOf("CONNECTING")});Object.defineProperty(Z.prototype,"CONNECTING",{enumerable:!0,value:Zt.indexOf("CONNECTING")});Object.defineProperty(Z,"OPEN",{enumerable:!0,value:Zt.indexOf("OPEN")});Object.defineProperty(Z.prototype,"OPEN",{enumerable:!0,value:Zt.indexOf("OPEN")});Object.defineProperty(Z,"CLOSING",{enumerable:!0,value:Zt.indexOf("CLOSING")});Object.defineProperty(Z.prototype,"CLOSING",{enumerable:!0,value:Zt.indexOf("CLOSING")});Object.defineProperty(Z,"CLOSED",{enumerable:!0,value:Zt.indexOf("CLOSED")});Object.defineProperty(Z.prototype,"CLOSED",{enumerable:!0,value:Zt.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(i=>{Object.defineProperty(Z.prototype,i,{enumerable:!0})});["open","error","close","message"].forEach(i=>{Object.defineProperty(Z.prototype,`on${i}`,{enumerable:!0,get(){for(let e of this.listeners(i))if(e[Qa])return e[Ww];return null},set(e){for(let t of this.listeners(i))if(t[Qa]){this.removeListener(i,t);break}typeof e=="function"&&this.addEventListener(i,e,{[Qa]:!0})}})});Z.prototype.addEventListener=Kw;Z.prototype.removeEventListener=Gw;rf.exports=Z;function Zd(i,e,t,n){let s={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:ec[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(i._autoPong=s.autoPong,!ec.includes(s.protocolVersion))throw new RangeError(`Unsupported protocol version: ${s.protocolVersion} (supported versions: ${ec.join(", ")})`);let r;if(e instanceof Za)r=e;else try{r=new Za(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}r.protocol==="http:"?r.protocol="ws:":r.protocol==="https:"&&(r.protocol="wss:"),i._url=r.href;let o=r.protocol==="wss:",a=r.protocol==="ws+unix:",l;if(r.protocol!=="ws:"&&!o&&!a?l=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!r.pathname?l="The URL's pathname is empty":r.hash&&(l="The URL contains a fragment identifier"),l){let k=new SyntaxError(l);if(i._redirects===0)throw k;ir(i,k);return}let p=o?443:80,f=Lw(16).toString("base64"),v=o?Iw.request:Dw.request,_=new Set,E;if(s.createConnection=s.createConnection||(o?t1:e1),s.defaultPort=s.defaultPort||p,s.port=r.port||p,s.host=r.hostname.startsWith("[")?r.hostname.slice(1,-1):r.hostname,s.headers={...s.headers,"Sec-WebSocket-Version":s.protocolVersion,"Sec-WebSocket-Key":f,Connection:"Upgrade",Upgrade:"websocket"},s.path=r.pathname+r.search,s.timeout=s.handshakeTimeout,s.perMessageDeflate&&(E=new ui(s.perMessageDeflate!==!0?s.perMessageDeflate:{},!1,s.maxPayload),s.headers["Sec-WebSocket-Extensions"]=Yw({[ui.extensionName]:E.offer()})),t.length){for(let k of t){if(typeof k!="string"||!Qw.test(k)||_.has(k))throw new SyntaxError("An invalid or duplicated subprotocol was specified");_.add(k)}s.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(s.origin&&(s.protocolVersion<13?s.headers["Sec-WebSocket-Origin"]=s.origin:s.headers.Origin=s.origin),(r.username||r.password)&&(s.auth=`${r.username}:${r.password}`),a){let k=s.path.split(":");s.socketPath=k[0],s.path=k[1]}let C;if(s.followRedirects){if(i._redirects===0){i._originalIpc=a,i._originalSecure=o,i._originalHostOrSocketPath=a?s.socketPath:r.host;let k=n&&n.headers;if(n={...n,headers:{}},k)for(let[M,O]of Object.entries(k))n.headers[M.toLowerCase()]=O}else if(i.listenerCount("redirect")===0){let k=a?i._originalIpc?s.socketPath===i._originalHostOrSocketPath:!1:i._originalIpc?!1:r.host===i._originalHostOrSocketPath;(!k||i._originalSecure&&!o)&&(delete s.headers.authorization,delete s.headers.cookie,k||delete s.headers.host,s.auth=void 0)}s.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(s.auth).toString("base64")),C=i._req=v(s),i._redirects&&i.emit("redirect",i.url,C)}else C=i._req=v(s);s.timeout&&C.on("timeout",()=>{ut(i,C,"Opening handshake has timed out")}),C.on("error",k=>{C===null||C[Xd]||(C=i._req=null,ir(i,k))}),C.on("response",k=>{let M=k.headers.location,O=k.statusCode;if(M&&s.followRedirects&&O>=300&&O<400){if(++i._redirects>s.maxRedirects){ut(i,C,"Maximum redirects exceeded");return}C.abort();let A;try{A=new Za(M,e)}catch{let U=new SyntaxError(`Invalid URL: ${M}`);ir(i,U);return}Zd(i,A,t,n)}else i.emit("unexpected-response",C,k)||ut(i,C,`Unexpected server response: ${k.statusCode}`)}),C.on("upgrade",(k,M,O)=>{if(i.emit("upgrade",k),i.readyState!==Z.CONNECTING)return;C=i._req=null;let A=k.headers.upgrade;if(A===void 0||A.toLowerCase()!=="websocket"){ut(i,M,"Invalid Upgrade header");return}let N=Fw("sha1").update(f+$w).digest("base64");if(k.headers["sec-websocket-accept"]!==N){ut(i,M,"Invalid Sec-WebSocket-Accept header");return}let U=k.headers["sec-websocket-protocol"],We;if(U!==void 0?_.size?_.has(U)||(We="Server sent an invalid subprotocol"):We="Server sent a subprotocol but none was requested":_.size&&(We="Server sent no subprotocol"),We){ut(i,M,We);return}U&&(i._protocol=U);let te=k.headers["sec-websocket-extensions"];if(te!==void 0){if(!E){ut(i,M,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let qe;try{qe=Jw(te)}catch{ut(i,M,"Invalid Sec-WebSocket-Extensions header");return}let H=Object.keys(qe);if(H.length!==1||H[0]!==ui.extensionName){ut(i,M,"Server indicated an extension that was not requested");return}try{E.accept(qe[ui.extensionName])}catch{ut(i,M,"Invalid Sec-WebSocket-Extensions header");return}i._extensions[ui.extensionName]=E}i.setSocket(M,O,{allowSynchronousEvents:s.allowSynchronousEvents,generateMask:s.generateMask,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation})}),s.finishRequest?s.finishRequest(C,i):C.end()}function ir(i,e){i._readyState=Z.CLOSING,i._errorEmitted=!0,i.emit("error",e),i.emitClose()}function e1(i){return i.path=i.socketPath,Yd.connect(i)}function t1(i){return i.path=void 0,!i.servername&&i.servername!==""&&(i.servername=Yd.isIP(i.host)?"":i.host),qw.connect(i)}function ut(i,e,t){i._readyState=Z.CLOSING;let n=new Error(t);Error.captureStackTrace(n,ut),e.setHeader?(e[Xd]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(ir,i,n)):(e.destroy(n),e.once("error",i.emit.bind(i,"error")),e.once("close",i.emitClose.bind(i)))}function tc(i,e,t){if(e){let n=zw(e)?e.size:Xw(e).length;i._socket?i._sender._bufferedBytes+=n:i._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${i.readyState} (${Zt[i.readyState]})`);process.nextTick(t,n)}}function i1(i,e){let t=this[ze];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=i,t._socket[ze]!==void 0&&(t._socket.removeListener("data",nr),process.nextTick(Qd,t._socket),i===1005?t.close():t.close(i,e))}function n1(){let i=this[ze];i.isPaused||i._socket.resume()}function s1(i){let e=this[ze];e._socket[ze]!==void 0&&(e._socket.removeListener("data",nr),process.nextTick(Qd,e._socket),e.close(i[Vw])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",i))}function Gd(){this[ze].emitClose()}function r1(i,e){this[ze].emit("message",i,e)}function o1(i){let e=this[ze];e._autoPong&&e.pong(i,!this._isServer,Jd),e.emit("ping",i)}function a1(i){this[ze].emit("pong",i)}function Qd(i){i.resume()}function c1(i){let e=this[ze];e.readyState!==Z.CLOSED&&(e.readyState===Z.OPEN&&(e._readyState=Z.CLOSING,ef(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",i)))}function ef(i){i._closeTimer=setTimeout(i._socket.destroy.bind(i._socket),Zw)}function tf(){let i=this[ze];this.removeListener("close",tf),this.removeListener("data",nr),this.removeListener("end",nf),i._readyState=Z.CLOSING;let e;!this._readableState.endEmitted&&!i._closeFrameReceived&&!i._receiver._writableState.errorEmitted&&(e=i._socket.read())!==null&&i._receiver.write(e),i._receiver.end(),this[ze]=void 0,clearTimeout(i._closeTimer),i._receiver._writableState.finished||i._receiver._writableState.errorEmitted?i.emitClose():(i._receiver.on("error",Gd),i._receiver.on("finish",Gd))}function nr(i){this[ze]._receiver.write(i)||this.pause()}function nf(){let i=this[ze];i._readyState=Z.CLOSING,i._receiver.end(),this.end()}function sf(){let i=this[ze];this.removeListener("error",sf),this.on("error",Jd),i&&(i._readyState=Z.CLOSING,this.destroy())}});var lf=T((VC,cf)=>{"use strict";var WC=sr(),{Duplex:l1}=require("stream");function of(i){i.emit("close")}function u1(){!this.destroyed&&this._writableState.finished&&this.destroy()}function af(i){this.removeListener("error",af),this.destroy(),this.listenerCount("error")===0&&this.emit("error",i)}function p1(i,e){let t=!0,n=new l1({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return i.on("message",function(r,o){let a=!o&&n._readableState.objectMode?r.toString():r;n.push(a)||i.pause()}),i.once("error",function(r){n.destroyed||(t=!1,n.destroy(r))}),i.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(s,r){if(i.readyState===i.CLOSED){r(s),process.nextTick(of,n);return}let o=!1;i.once("error",function(l){o=!0,r(l)}),i.once("close",function(){o||r(s),process.nextTick(of,n)}),t&&i.terminate()},n._final=function(s){if(i.readyState===i.CONNECTING){i.once("open",function(){n._final(s)});return}i._socket!==null&&(i._socket._writableState.finished?(s(),n._readableState.endEmitted&&n.destroy()):(i._socket.once("finish",function(){s()}),i.close()))},n._read=function(){i.isPaused&&i.resume()},n._write=function(s,r,o){if(i.readyState===i.CONNECTING){i.once("open",function(){n._write(s,r,o)});return}i.send(s,o)},n.on("end",u1),n.on("error",af),n}cf.exports=p1});var pf=T((KC,uf)=>{"use strict";var{tokenChars:d1}=Yi();function f1(i){let e=new Set,t=-1,n=-1,s=0;for(s;s<i.length;s++){let o=i.charCodeAt(s);if(n===-1&&d1[o]===1)t===-1&&(t=s);else if(s!==0&&(o===32||o===9))n===-1&&t!==-1&&(n=s);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${s}`);n===-1&&(n=s);let a=i.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 ${s}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let r=i.slice(t,s);if(e.has(r))throw new SyntaxError(`The "${r}" subprotocol is duplicated`);return e.add(r),e}uf.exports={parse:f1}});var xf=T((YC,gf)=>{"use strict";var h1=require("events"),rr=require("http"),{Duplex:GC}=require("stream"),{createHash:m1}=require("crypto"),df=Xa(),Ci=Wn(),v1=pf(),g1=sr(),{GUID:x1,kWebSocket:y1}=Gt(),b1=/^[+/0-9A-Za-z]{22}==$/,ff=0,hf=1,vf=2,ic=class extends h1{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:g1,...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=rr.createServer((n,s)=>{let r=rr.STATUS_CODES[426];s.writeHead(426,{"Content-Length":r.length,"Content-Type":"text/plain"}),s.end(r)}),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=w1(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(s,r,o)=>{this.handleUpgrade(s,r,o,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=ff}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===vf){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Yn,this);return}if(e&&this.once("close",e),this._state!==hf)if(this._state=hf,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(Yn,this):process.nextTick(Yn,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{Yn(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,s){t.on("error",mf);let r=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){Ti(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){Ti(this,e,t,400,"Invalid Upgrade header");return}if(r===void 0||!b1.test(r)){Ti(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){Ti(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Jn(t,400);return}let l=e.headers["sec-websocket-protocol"],p=new Set;if(l!==void 0)try{p=v1.parse(l)}catch{Ti(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let f=e.headers["sec-websocket-extensions"],v={};if(this.options.perMessageDeflate&&f!==void 0){let _=new Ci(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let E=df.parse(f);E[Ci.extensionName]&&(_.accept(E[Ci.extensionName]),v[Ci.extensionName]=_)}catch{Ti(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let _={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(_,(E,C,k,M)=>{if(!E)return Jn(t,C||401,k,M);this.completeUpgrade(v,r,p,e,t,n,s)});return}if(!this.options.verifyClient(_))return Jn(t,401)}this.completeUpgrade(v,r,p,e,t,n,s)}completeUpgrade(e,t,n,s,r,o,a){if(!r.readable||!r.writable)return r.destroy();if(r[y1])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>ff)return Jn(r,503);let p=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${m1("sha1").update(t+x1).digest("base64")}`],f=new this.options.WebSocket(null,void 0,this.options);if(n.size){let v=this.options.handleProtocols?this.options.handleProtocols(n,s):n.values().next().value;v&&(p.push(`Sec-WebSocket-Protocol: ${v}`),f._protocol=v)}if(e[Ci.extensionName]){let v=e[Ci.extensionName].params,_=df.format({[Ci.extensionName]:[v]});p.push(`Sec-WebSocket-Extensions: ${_}`),f._extensions=e}this.emit("headers",p,s),r.write(p.concat(`\r
|
|
9
|
+
`);function a(l){var p=La(Jt.join(l,"prebuilds")).map(dd),f=p.filter(fd(Ia,Da)).sort(hd)[0];if(f){var m=Jt.join(l,"prebuilds",f.name),_=La(m).map(md),E=_.filter(vd(Na,rd)),k=E.sort(gd(Na))[0];if(k)return Jt.join(m,k.file)}}};function La(i){try{return ad.readdirSync(i)}catch{return[]}}function sd(i,e){var t=La(i).filter(e);return t[0]&&Jt.join(i,t[0])}function od(i){return/\.node$/.test(i)}function dd(i){var e=i.split("-");if(e.length===2){var t=e[0],n=e[1].split("+");if(t&&n.length&&n.every(Boolean))return{name:i,platform:t,architectures:n}}}function fd(i,e){return function(t){return t==null||t.platform!==i?!1:t.architectures.includes(e)}}function hd(i,e){return i.architectures.length-e.architectures.length}function md(i){var e=i.split("."),t=e.pop(),n={file:i,specificity:0};if(t==="node"){for(var r=0;r<e.length;r++){var s=e[r];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 vd(i,e){return function(t){return!(t==null||t.runtime&&t.runtime!==i&&!ww(t)||t.abi&&t.abi!==e&&!t.napi||t.uv&&t.uv!==pd||t.armv&&t.armv!==qa||t.libc&&t.libc!==ud)}}function ww(i){return i.runtime==="node"&&i.napi}function gd(i){return function(e,t){return e.runtime!==t.runtime?e.runtime===i?-1:1:e.abi!==t.abi?e.abi?-1:1:e.specificity!==t.specificity?e.specificity>t.specificity?-1:1:0}}function _w(){return!!(process.versions&&process.versions.nw)}function Sw(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function Ew(i){return i==="linux"&&ad.existsSync("/etc/alpine-release")}Lt.parseTags=md;Lt.matchTags=vd;Lt.compareTags=gd;Lt.parseTuple=dd;Lt.matchTuple=fd;Lt.compareTuples=hd});var Ha=C((PT,Ua)=>{var Fa=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof Fa.addon=="function"?Ua.exports=Fa.addon.bind(Fa):Ua.exports=yd()});var wd=C((BT,bd)=>{"use strict";var kw=(i,e,t,n,r)=>{for(var s=0;s<r;s++)t[n+s]=i[s]^e[s&3]},Cw=(i,e)=>{let t=i.length;for(var n=0;n<t;n++)i[n]^=e[n&3]};bd.exports={mask:kw,unmask:Cw}});var _d=C((jT,za)=>{"use strict";try{za.exports=Ha()(__dirname)}catch{za.exports=wd()}});var Gn=C((NT,Xr)=>{"use strict";var{EMPTY_BUFFER:Tw}=Yt(),$a=Buffer[Symbol.species];function Mw(i,e){if(i.length===0)return Tw;if(i.length===1)return i[0];let t=Buffer.allocUnsafe(e),n=0;for(let r=0;r<i.length;r++){let s=i[r];t.set(s,n),n+=s.length}return n<e?new $a(t.buffer,t.byteOffset,n):t}function Sd(i,e,t,n,r){for(let s=0;s<r;s++)t[n+s]=i[s]^e[s&3]}function Ed(i,e){for(let t=0;t<i.length;t++)i[t]^=e[t&3]}function Ow(i){return i.length===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.length)}function Wa(i){if(Wa.readOnly=!0,Buffer.isBuffer(i))return i;let e;return i instanceof ArrayBuffer?e=new $a(i):ArrayBuffer.isView(i)?e=new $a(i.buffer,i.byteOffset,i.byteLength):(e=Buffer.from(i),Wa.readOnly=!1),e}Xr.exports={concat:Mw,mask:Sd,toArrayBuffer:Ow,toBuffer:Wa,unmask:Ed};if(!process.env.WS_NO_BUFFER_UTIL)try{let i=_d();Xr.exports.mask=function(e,t,n,r,s){s<48?Sd(e,t,n,r,s):i.mask(e,t,n,r,s)},Xr.exports.unmask=function(e,t){e.length<32?Ed(e,t):i.unmask(e,t)}}catch{}});var Td=C((DT,Cd)=>{"use strict";var kd=Symbol("kDone"),Va=Symbol("kRun"),Ka=class{constructor(e){this[kd]=()=>{this.pending--,this[Va]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Va]()}[Va](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[kd])}}};Cd.exports=Ka});var Jn=C((IT,Rd)=>{"use strict";var Yn=require("zlib"),Md=Gn(),Aw=Td(),{kStatusCode:Od}=Yt(),Rw=Buffer[Symbol.species],Pw=Buffer.from([0,0,255,255]),Qr=Symbol("permessage-deflate"),Xt=Symbol("total-length"),Ji=Symbol("callback"),pi=Symbol("buffers"),Xi=Symbol("error"),Zr,Ga=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,!Zr){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Zr=new Aw(r)}}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[Ji];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(r=>!(t.serverNoContextTakeover===!1&&r.server_no_context_takeover||r.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>r.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!r.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 r=t[n];if(r.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(r=r[0],n==="client_max_window_bits"){if(r!==!0){let s=+r;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${r}`);r=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${r}`)}else if(n==="server_max_window_bits"){let s=+r;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${r}`);r=s}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(r!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${r}`)}else throw new Error(`Unknown parameter "${n}"`);t[n]=r})}),e}decompress(e,t,n){Zr.add(r=>{this._decompress(e,t,(s,o)=>{r(),n(s,o)})})}compress(e,t,n){Zr.add(r=>{this._compress(e,t,(s,o)=>{r(),n(s,o)})})}_decompress(e,t,n){let r=this._isServer?"client":"server";if(!this._inflate){let s=`${r}_max_window_bits`,o=typeof this.params[s]!="number"?Yn.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=Yn.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[Qr]=this,this._inflate[Xt]=0,this._inflate[pi]=[],this._inflate.on("error",jw),this._inflate.on("data",Ad)}this._inflate[Ji]=n,this._inflate.write(e),t&&this._inflate.write(Pw),this._inflate.flush(()=>{let s=this._inflate[Xi];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=Md.concat(this._inflate[pi],this._inflate[Xt]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Xt]=0,this._inflate[pi]=[],t&&this.params[`${r}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(e,t,n){let r=this._isServer?"server":"client";if(!this._deflate){let s=`${r}_max_window_bits`,o=typeof this.params[s]!="number"?Yn.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=Yn.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[Xt]=0,this._deflate[pi]=[],this._deflate.on("data",Bw)}this._deflate[Ji]=n,this._deflate.write(e),this._deflate.flush(Yn.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=Md.concat(this._deflate[pi],this._deflate[Xt]);t&&(s=new Rw(s.buffer,s.byteOffset,s.length-4)),this._deflate[Ji]=null,this._deflate[Xt]=0,this._deflate[pi]=[],t&&this.params[`${r}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};Rd.exports=Ga;function Bw(i){this[pi].push(i),this[Xt]+=i.length}function Ad(i){if(this[Xt]+=i.length,this[Qr]._maxPayload<1||this[Xt]<=this[Qr]._maxPayload){this[pi].push(i);return}this[Xi]=new RangeError("Max payload size exceeded"),this[Xi].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Xi][Od]=1009,this.removeListener("data",Ad),this.reset()}function jw(i){if(this[Qr]._inflate=null,this[Xi]){this[Ji](this[Xi]);return}i[Od]=1007,this[Ji](i)}});var Bd=C((qT,Pd)=>{"use strict";function Nw(i){let e=i.length,t=0;for(;t<e;)if((i[t]&128)===0)t++;else if((i[t]&224)===192){if(t+1===e||(i[t+1]&192)!==128||(i[t]&254)===192)return!1;t+=2}else if((i[t]&240)===224){if(t+2>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||i[t]===224&&(i[t+1]&224)===128||i[t]===237&&(i[t+1]&224)===160)return!1;t+=3}else if((i[t]&248)===240){if(t+3>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||(i[t+3]&192)!==128||i[t]===240&&(i[t+1]&240)===128||i[t]===244&&i[t+1]>143||i[t]>244)return!1;t+=4}else return!1;return!0}Pd.exports=Nw});var jd=C((LT,Ya)=>{"use strict";try{Ya.exports=Ha()(__dirname)}catch{Ya.exports=Bd()}});var Zi=C((FT,es)=>{"use strict";var{isUtf8:Nd}=require("buffer"),{hasBlob:Dw}=Yt(),Iw=[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 qw(i){return i>=1e3&&i<=1014&&i!==1004&&i!==1005&&i!==1006||i>=3e3&&i<=4999}function Ja(i){let e=i.length,t=0;for(;t<e;)if((i[t]&128)===0)t++;else if((i[t]&224)===192){if(t+1===e||(i[t+1]&192)!==128||(i[t]&254)===192)return!1;t+=2}else if((i[t]&240)===224){if(t+2>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||i[t]===224&&(i[t+1]&224)===128||i[t]===237&&(i[t+1]&224)===160)return!1;t+=3}else if((i[t]&248)===240){if(t+3>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||(i[t+3]&192)!==128||i[t]===240&&(i[t+1]&240)===128||i[t]===244&&i[t+1]>143||i[t]>244)return!1;t+=4}else return!1;return!0}function Lw(i){return Dw&&typeof i=="object"&&typeof i.arrayBuffer=="function"&&typeof i.type=="string"&&typeof i.stream=="function"&&(i[Symbol.toStringTag]==="Blob"||i[Symbol.toStringTag]==="File")}es.exports={isBlob:Lw,isValidStatusCode:qw,isValidUTF8:Ja,tokenChars:Iw};if(Nd)es.exports.isValidUTF8=function(i){return i.length<24?Ja(i):Nd(i)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let i=jd();es.exports.isValidUTF8=function(e){return e.length<32?Ja(e):i(e)}}catch{}});var tc=C((UT,Hd)=>{"use strict";var{Writable:Fw}=require("stream"),Dd=Jn(),{BINARY_TYPES:Uw,EMPTY_BUFFER:Id,kStatusCode:Hw,kWebSocket:zw}=Yt(),{concat:Xa,toArrayBuffer:$w,unmask:Ww}=Gn(),{isValidStatusCode:Vw,isValidUTF8:qd}=Zi(),ts=Buffer[Symbol.species],gt=0,Ld=1,Fd=2,Ud=3,Za=4,Qa=5,is=6,ec=class extends Fw{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||Uw[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[zw]=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=gt}_write(e,t,n){if(this._opcode===8&&this._state==gt)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 ts(n.buffer,n.byteOffset+e,n.length-e),new ts(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],r=t.length-e;e>=n.length?t.set(this._buffers.shift(),r):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),r),this._buffers[0]=new ts(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 gt:this.getInfo(e);break;case Ld:this.getPayloadLength16(e);break;case Fd:this.getPayloadLength64(e);break;case Ud:this.getMask();break;case Za:this.getData(e);break;case Qa:case is: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 r=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(r);return}let n=(t[0]&64)===64;if(n&&!this._extensions[Dd.extensionName]){let r=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(r);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let r=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(r);return}if(!this._fragmented){let r=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(r);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let r=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(r);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let r=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(r);return}if(n){let r=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(r);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let r=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(r);return}}else{let r=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(r);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let r=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(r);return}}else if(this._masked){let r=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(r);return}this._payloadLength===126?this._state=Ld:this._payloadLength===127?this._state=Fd: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 r=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(r);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=Ud:this._state=Za}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Za}getData(e){let t=Id;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&&Ww(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=Qa,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[Dd.extensionName].decompress(e,this._fin,(r,s)=>{if(r)return t(r);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===gt&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=gt;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let r;this._binaryType==="nodebuffer"?r=Xa(n,t):this._binaryType==="arraybuffer"?r=$w(Xa(n,t)):this._binaryType==="blob"?r=new Blob(n):r=n,this._allowSynchronousEvents?(this.emit("message",r,!0),this._state=gt):(this._state=is,setImmediate(()=>{this.emit("message",r,!0),this._state=gt,this.startLoop(e)}))}else{let r=Xa(n,t);if(!this._skipUTF8Validation&&!qd(r)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===Qa||this._allowSynchronousEvents?(this.emit("message",r,!1),this._state=gt):(this._state=is,setImmediate(()=>{this.emit("message",r,!1),this._state=gt,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,Id),this.end();else{let n=e.readUInt16BE(0);if(!Vw(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let r=new ts(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!qd(r)){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,r),this.end()}this._state=gt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=gt):(this._state=is,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=gt,this.startLoop(t)}))}createError(e,t,n,r,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[Hw]=r,o}};Hd.exports=ec});var rc=C((zT,Wd)=>{"use strict";var{Duplex:HT}=require("stream"),{randomFillSync:Kw}=require("crypto"),zd=Jn(),{EMPTY_BUFFER:Gw,kWebSocket:Yw,NOOP:Jw}=Yt(),{isBlob:Qi,isValidStatusCode:Xw}=Zi(),{mask:$d,toBuffer:Ci}=Gn(),xt=Symbol("kByteLength"),Zw=Buffer.alloc(4),ns=8*1024,Ti,en=ns,Pt=0,Qw=1,e1=2,ic=class i{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=Pt,this.onerror=Jw,this[Yw]=void 0}static frame(e,t){let n,r=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||Zw,t.generateMask?t.generateMask(n):(en===ns&&(Ti===void 0&&(Ti=Buffer.alloc(ns)),Kw(Ti,0,ns),en=0),n[0]=Ti[en++],n[1]=Ti[en++],n[2]=Ti[en++],n[3]=Ti[en++]),o=(n[0]|n[1]|n[2]|n[3])===0,s=6);let a;typeof e=="string"?(!t.mask||o)&&t[xt]!==void 0?a=t[xt]:(e=Buffer.from(e),a=e.length):(a=e.length,r=t.mask&&t.readOnly&&!o);let l=a;a>=65536?(s+=8,l=127):a>125&&(s+=2,l=126);let p=Buffer.allocUnsafe(r?a+s:s);return p[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(p[0]|=64),p[1]=l,l===126?p.writeUInt16BE(a,2):l===127&&(p[2]=p[3]=0,p.writeUIntBE(a,4,6)),t.mask?(p[1]|=128,p[s-4]=n[0],p[s-3]=n[1],p[s-2]=n[2],p[s-1]=n[3],o?[p,e]:r?($d(e,n,p,s,a),[p]):($d(e,n,e,0,a),[p,e])):[p,e]}close(e,t,n,r){let s;if(e===void 0)s=Gw;else{if(typeof e!="number"||!Xw(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={[xt]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Pt?this.enqueue([this.dispatch,s,!1,o,r]):this.sendFrame(i.frame(s,o),r)}ping(e,t,n){let r,s;if(typeof e=="string"?(r=Buffer.byteLength(e),s=!1):Qi(e)?(r=e.size,s=!1):(e=Ci(e),r=e.length,s=Ci.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[xt]:r,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};Qi(e)?this._state!==Pt?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Pt?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(i.frame(e,o),n)}pong(e,t,n){let r,s;if(typeof e=="string"?(r=Buffer.byteLength(e),s=!1):Qi(e)?(r=e.size,s=!1):(e=Ci(e),r=e.length,s=Ci.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[xt]:r,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};Qi(e)?this._state!==Pt?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Pt?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(i.frame(e,o),n)}send(e,t,n){let r=this._extensions[zd.extensionName],s=t.binary?2:1,o=t.compress,a,l;typeof e=="string"?(a=Buffer.byteLength(e),l=!1):Qi(e)?(a=e.size,l=!1):(e=Ci(e),a=e.length,l=Ci.readOnly),this._firstFragment?(this._firstFragment=!1,o&&r&&r.params[r._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=r._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0);let p={[xt]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:l,rsv1:o};Qi(e)?this._state!==Pt?this.enqueue([this.getBlobData,e,this._compress,p,n]):this.getBlobData(e,this._compress,p,n):this._state!==Pt?this.enqueue([this.dispatch,e,this._compress,p,n]):this.dispatch(e,this._compress,p,n)}getBlobData(e,t,n,r){this._bufferedBytes+=n[xt],this._state=e1,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(nc,this,a,r);return}this._bufferedBytes-=n[xt];let o=Ci(s);t?this.dispatch(o,t,n,r):(this._state=Pt,this.sendFrame(i.frame(o,n),r),this.dequeue())}).catch(s=>{process.nextTick(t1,this,s,r)})}dispatch(e,t,n,r){if(!t){this.sendFrame(i.frame(e,n),r);return}let s=this._extensions[zd.extensionName];this._bufferedBytes+=n[xt],this._state=Qw,s.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let l=new Error("The socket was closed while data was being compressed");nc(this,l,r);return}this._bufferedBytes-=n[xt],this._state=Pt,n.readOnly=!1,this.sendFrame(i.frame(a,n),r),this.dequeue()})}dequeue(){for(;this._state===Pt&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][xt],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][xt],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)}};Wd.exports=ic;function nc(i,e,t){typeof t=="function"&&t(e);for(let n=0;n<i._queue.length;n++){let r=i._queue[n],s=r[r.length-1];typeof s=="function"&&s(e)}}function t1(i,e,t){nc(i,e,t),i.onerror(e)}});var ef=C(($T,Qd)=>{"use strict";var{kForOnEventAttribute:Xn,kListener:sc}=Yt(),Vd=Symbol("kCode"),Kd=Symbol("kData"),Gd=Symbol("kError"),Yd=Symbol("kMessage"),Jd=Symbol("kReason"),tn=Symbol("kTarget"),Xd=Symbol("kType"),Zd=Symbol("kWasClean"),Zt=class{constructor(e){this[tn]=null,this[Xd]=e}get target(){return this[tn]}get type(){return this[Xd]}};Object.defineProperty(Zt.prototype,"target",{enumerable:!0});Object.defineProperty(Zt.prototype,"type",{enumerable:!0});var Mi=class extends Zt{constructor(e,t={}){super(e),this[Vd]=t.code===void 0?0:t.code,this[Jd]=t.reason===void 0?"":t.reason,this[Zd]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[Vd]}get reason(){return this[Jd]}get wasClean(){return this[Zd]}};Object.defineProperty(Mi.prototype,"code",{enumerable:!0});Object.defineProperty(Mi.prototype,"reason",{enumerable:!0});Object.defineProperty(Mi.prototype,"wasClean",{enumerable:!0});var nn=class extends Zt{constructor(e,t={}){super(e),this[Gd]=t.error===void 0?null:t.error,this[Yd]=t.message===void 0?"":t.message}get error(){return this[Gd]}get message(){return this[Yd]}};Object.defineProperty(nn.prototype,"error",{enumerable:!0});Object.defineProperty(nn.prototype,"message",{enumerable:!0});var Zn=class extends Zt{constructor(e,t={}){super(e),this[Kd]=t.data===void 0?null:t.data}get data(){return this[Kd]}};Object.defineProperty(Zn.prototype,"data",{enumerable:!0});var i1={addEventListener(i,e,t={}){for(let r of this.listeners(i))if(!t[Xn]&&r[sc]===e&&!r[Xn])return;let n;if(i==="message")n=function(s,o){let a=new Zn("message",{data:o?s:s.toString()});a[tn]=this,rs(e,this,a)};else if(i==="close")n=function(s,o){let a=new Mi("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[tn]=this,rs(e,this,a)};else if(i==="error")n=function(s){let o=new nn("error",{error:s,message:s.message});o[tn]=this,rs(e,this,o)};else if(i==="open")n=function(){let s=new Zt("open");s[tn]=this,rs(e,this,s)};else return;n[Xn]=!!t[Xn],n[sc]=e,t.once?this.once(i,n):this.on(i,n)},removeEventListener(i,e){for(let t of this.listeners(i))if(t[sc]===e&&!t[Xn]){this.removeListener(i,t);break}}};Qd.exports={CloseEvent:Mi,ErrorEvent:nn,Event:Zt,EventTarget:i1,MessageEvent:Zn};function rs(i,e,t){typeof i=="object"&&i.handleEvent?i.handleEvent.call(i,t):i.call(e,t)}});var oc=C((WT,tf)=>{"use strict";var{tokenChars:Qn}=Zi();function Ft(i,e,t){i[e]===void 0?i[e]=[t]:i[e].push(t)}function n1(i){let e=Object.create(null),t=Object.create(null),n=!1,r=!1,s=!1,o,a,l=-1,p=-1,f=-1,m=0;for(;m<i.length;m++)if(p=i.charCodeAt(m),o===void 0)if(f===-1&&Qn[p]===1)l===-1&&(l=m);else if(m!==0&&(p===32||p===9))f===-1&&l!==-1&&(f=m);else if(p===59||p===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${m}`);f===-1&&(f=m);let E=i.slice(l,f);p===44?(Ft(e,E,t),t=Object.create(null)):o=E,l=f=-1}else throw new SyntaxError(`Unexpected character at index ${m}`);else if(a===void 0)if(f===-1&&Qn[p]===1)l===-1&&(l=m);else if(p===32||p===9)f===-1&&l!==-1&&(f=m);else if(p===59||p===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${m}`);f===-1&&(f=m),Ft(t,i.slice(l,f),!0),p===44&&(Ft(e,o,t),t=Object.create(null),o=void 0),l=f=-1}else if(p===61&&l!==-1&&f===-1)a=i.slice(l,m),l=f=-1;else throw new SyntaxError(`Unexpected character at index ${m}`);else if(r){if(Qn[p]!==1)throw new SyntaxError(`Unexpected character at index ${m}`);l===-1?l=m:n||(n=!0),r=!1}else if(s)if(Qn[p]===1)l===-1&&(l=m);else if(p===34&&l!==-1)s=!1,f=m;else if(p===92)r=!0;else throw new SyntaxError(`Unexpected character at index ${m}`);else if(p===34&&i.charCodeAt(m-1)===61)s=!0;else if(f===-1&&Qn[p]===1)l===-1&&(l=m);else if(l!==-1&&(p===32||p===9))f===-1&&(f=m);else if(p===59||p===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${m}`);f===-1&&(f=m);let E=i.slice(l,f);n&&(E=E.replace(/\\/g,""),n=!1),Ft(t,a,E),p===44&&(Ft(e,o,t),t=Object.create(null),o=void 0),a=void 0,l=f=-1}else throw new SyntaxError(`Unexpected character at index ${m}`);if(l===-1||s||p===32||p===9)throw new SyntaxError("Unexpected end of input");f===-1&&(f=m);let _=i.slice(l,f);return o===void 0?Ft(e,_,t):(a===void 0?Ft(t,_,!0):n?Ft(t,a,_.replace(/\\/g,"")):Ft(t,a,_),Ft(e,o,t)),e}function r1(i){return Object.keys(i).map(e=>{let t=i[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(r=>{let s=n[r];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?r:`${r}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}tf.exports={format:r1,parse:n1}});var cs=C((GT,hf)=>{"use strict";var s1=require("events"),o1=require("https"),a1=require("http"),sf=require("net"),c1=require("tls"),{randomBytes:l1,createHash:u1}=require("crypto"),{Duplex:VT,Readable:KT}=require("stream"),{URL:ac}=require("url"),di=Jn(),p1=tc(),d1=rc(),{isBlob:f1}=Zi(),{BINARY_TYPES:nf,EMPTY_BUFFER:ss,GUID:h1,kForOnEventAttribute:cc,kListener:m1,kStatusCode:v1,kWebSocket:We,NOOP:of}=Yt(),{EventTarget:{addEventListener:g1,removeEventListener:x1}}=ef(),{format:y1,parse:b1}=oc(),{toBuffer:w1}=Gn(),_1=30*1e3,af=Symbol("kAborted"),lc=[8,13],Qt=["CONNECTING","OPEN","CLOSING","CLOSED"],S1=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,ee=class i extends s1{constructor(e,t,n){super(),this._binaryType=nf[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=ss,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=i.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]),cf(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){nf.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 r=new p1({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new d1(e,this._extensions,n.generateMask);this._receiver=r,this._sender=s,this._socket=e,r[We]=this,s[We]=this,e[We]=this,r.on("conclude",C1),r.on("drain",T1),r.on("error",M1),r.on("message",O1),r.on("ping",A1),r.on("pong",R1),s.onerror=P1,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",pf),e.on("data",as),e.on("end",df),e.on("error",ff),this._readyState=i.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=i.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[di.extensionName]&&this._extensions[di.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=i.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==i.CLOSED){if(this.readyState===i.CONNECTING){pt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===i.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=i.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),uf(this)}}pause(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===i.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!==i.OPEN){uc(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||ss,t,n)}pong(e,t,n){if(this.readyState===i.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!==i.OPEN){uc(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||ss,t,n)}resume(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===i.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!==i.OPEN){uc(this,e,n);return}let r={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[di.extensionName]||(r.compress=!1),this._sender.send(e||ss,r,n)}terminate(){if(this.readyState!==i.CLOSED){if(this.readyState===i.CONNECTING){pt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=i.CLOSING,this._socket.destroy())}}};Object.defineProperty(ee,"CONNECTING",{enumerable:!0,value:Qt.indexOf("CONNECTING")});Object.defineProperty(ee.prototype,"CONNECTING",{enumerable:!0,value:Qt.indexOf("CONNECTING")});Object.defineProperty(ee,"OPEN",{enumerable:!0,value:Qt.indexOf("OPEN")});Object.defineProperty(ee.prototype,"OPEN",{enumerable:!0,value:Qt.indexOf("OPEN")});Object.defineProperty(ee,"CLOSING",{enumerable:!0,value:Qt.indexOf("CLOSING")});Object.defineProperty(ee.prototype,"CLOSING",{enumerable:!0,value:Qt.indexOf("CLOSING")});Object.defineProperty(ee,"CLOSED",{enumerable:!0,value:Qt.indexOf("CLOSED")});Object.defineProperty(ee.prototype,"CLOSED",{enumerable:!0,value:Qt.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(i=>{Object.defineProperty(ee.prototype,i,{enumerable:!0})});["open","error","close","message"].forEach(i=>{Object.defineProperty(ee.prototype,`on${i}`,{enumerable:!0,get(){for(let e of this.listeners(i))if(e[cc])return e[m1];return null},set(e){for(let t of this.listeners(i))if(t[cc]){this.removeListener(i,t);break}typeof e=="function"&&this.addEventListener(i,e,{[cc]:!0})}})});ee.prototype.addEventListener=g1;ee.prototype.removeEventListener=x1;hf.exports=ee;function cf(i,e,t,n){let r={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:lc[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(i._autoPong=r.autoPong,!lc.includes(r.protocolVersion))throw new RangeError(`Unsupported protocol version: ${r.protocolVersion} (supported versions: ${lc.join(", ")})`);let s;if(e instanceof ac)s=e;else try{s=new ac(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),i._url=s.href;let o=s.protocol==="wss:",a=s.protocol==="ws+unix:",l;if(s.protocol!=="ws:"&&!o&&!a?l=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!s.pathname?l="The URL's pathname is empty":s.hash&&(l="The URL contains a fragment identifier"),l){let T=new SyntaxError(l);if(i._redirects===0)throw T;os(i,T);return}let p=o?443:80,f=l1(16).toString("base64"),m=o?o1.request:a1.request,_=new Set,E;if(r.createConnection=r.createConnection||(o?k1:E1),r.defaultPort=r.defaultPort||p,r.port=s.port||p,r.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,r.headers={...r.headers,"Sec-WebSocket-Version":r.protocolVersion,"Sec-WebSocket-Key":f,Connection:"Upgrade",Upgrade:"websocket"},r.path=s.pathname+s.search,r.timeout=r.handshakeTimeout,r.perMessageDeflate&&(E=new di(r.perMessageDeflate!==!0?r.perMessageDeflate:{},!1,r.maxPayload),r.headers["Sec-WebSocket-Extensions"]=y1({[di.extensionName]:E.offer()})),t.length){for(let T of t){if(typeof T!="string"||!S1.test(T)||_.has(T))throw new SyntaxError("An invalid or duplicated subprotocol was specified");_.add(T)}r.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(r.origin&&(r.protocolVersion<13?r.headers["Sec-WebSocket-Origin"]=r.origin:r.headers.Origin=r.origin),(s.username||s.password)&&(r.auth=`${s.username}:${s.password}`),a){let T=r.path.split(":");r.socketPath=T[0],r.path=T[1]}let k;if(r.followRedirects){if(i._redirects===0){i._originalIpc=a,i._originalSecure=o,i._originalHostOrSocketPath=a?r.socketPath:s.host;let T=n&&n.headers;if(n={...n,headers:{}},T)for(let[M,O]of Object.entries(T))n.headers[M.toLowerCase()]=O}else if(i.listenerCount("redirect")===0){let T=a?i._originalIpc?r.socketPath===i._originalHostOrSocketPath:!1:i._originalIpc?!1:s.host===i._originalHostOrSocketPath;(!T||i._originalSecure&&!o)&&(delete r.headers.authorization,delete r.headers.cookie,T||delete r.headers.host,r.auth=void 0)}r.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(r.auth).toString("base64")),k=i._req=m(r),i._redirects&&i.emit("redirect",i.url,k)}else k=i._req=m(r);r.timeout&&k.on("timeout",()=>{pt(i,k,"Opening handshake has timed out")}),k.on("error",T=>{k===null||k[af]||(k=i._req=null,os(i,T))}),k.on("response",T=>{let M=T.headers.location,O=T.statusCode;if(M&&r.followRedirects&&O>=300&&O<400){if(++i._redirects>r.maxRedirects){pt(i,k,"Maximum redirects exceeded");return}k.abort();let A;try{A=new ac(M,e)}catch{let U=new SyntaxError(`Invalid URL: ${M}`);os(i,U);return}cf(i,A,t,n)}else i.emit("unexpected-response",k,T)||pt(i,k,`Unexpected server response: ${T.statusCode}`)}),k.on("upgrade",(T,M,O)=>{if(i.emit("upgrade",T),i.readyState!==ee.CONNECTING)return;k=i._req=null;let A=T.headers.upgrade;if(A===void 0||A.toLowerCase()!=="websocket"){pt(i,M,"Invalid Upgrade header");return}let D=u1("sha1").update(f+h1).digest("base64");if(T.headers["sec-websocket-accept"]!==D){pt(i,M,"Invalid Sec-WebSocket-Accept header");return}let U=T.headers["sec-websocket-protocol"],te;if(U!==void 0?_.size?_.has(U)||(te="Server sent an invalid subprotocol"):te="Server sent a subprotocol but none was requested":_.size&&(te="Server sent no subprotocol"),te){pt(i,M,te);return}U&&(i._protocol=U);let z=T.headers["sec-websocket-extensions"];if(z!==void 0){if(!E){pt(i,M,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let re;try{re=b1(z)}catch{pt(i,M,"Invalid Sec-WebSocket-Extensions header");return}let H=Object.keys(re);if(H.length!==1||H[0]!==di.extensionName){pt(i,M,"Server indicated an extension that was not requested");return}try{E.accept(re[di.extensionName])}catch{pt(i,M,"Invalid Sec-WebSocket-Extensions header");return}i._extensions[di.extensionName]=E}i.setSocket(M,O,{allowSynchronousEvents:r.allowSynchronousEvents,generateMask:r.generateMask,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation})}),r.finishRequest?r.finishRequest(k,i):k.end()}function os(i,e){i._readyState=ee.CLOSING,i._errorEmitted=!0,i.emit("error",e),i.emitClose()}function E1(i){return i.path=i.socketPath,sf.connect(i)}function k1(i){return i.path=void 0,!i.servername&&i.servername!==""&&(i.servername=sf.isIP(i.host)?"":i.host),c1.connect(i)}function pt(i,e,t){i._readyState=ee.CLOSING;let n=new Error(t);Error.captureStackTrace(n,pt),e.setHeader?(e[af]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(os,i,n)):(e.destroy(n),e.once("error",i.emit.bind(i,"error")),e.once("close",i.emitClose.bind(i)))}function uc(i,e,t){if(e){let n=f1(e)?e.size:w1(e).length;i._socket?i._sender._bufferedBytes+=n:i._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${i.readyState} (${Qt[i.readyState]})`);process.nextTick(t,n)}}function C1(i,e){let t=this[We];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=i,t._socket[We]!==void 0&&(t._socket.removeListener("data",as),process.nextTick(lf,t._socket),i===1005?t.close():t.close(i,e))}function T1(){let i=this[We];i.isPaused||i._socket.resume()}function M1(i){let e=this[We];e._socket[We]!==void 0&&(e._socket.removeListener("data",as),process.nextTick(lf,e._socket),e.close(i[v1])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",i))}function rf(){this[We].emitClose()}function O1(i,e){this[We].emit("message",i,e)}function A1(i){let e=this[We];e._autoPong&&e.pong(i,!this._isServer,of),e.emit("ping",i)}function R1(i){this[We].emit("pong",i)}function lf(i){i.resume()}function P1(i){let e=this[We];e.readyState!==ee.CLOSED&&(e.readyState===ee.OPEN&&(e._readyState=ee.CLOSING,uf(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",i)))}function uf(i){i._closeTimer=setTimeout(i._socket.destroy.bind(i._socket),_1)}function pf(){let i=this[We];this.removeListener("close",pf),this.removeListener("data",as),this.removeListener("end",df),i._readyState=ee.CLOSING;let e;!this._readableState.endEmitted&&!i._closeFrameReceived&&!i._receiver._writableState.errorEmitted&&(e=i._socket.read())!==null&&i._receiver.write(e),i._receiver.end(),this[We]=void 0,clearTimeout(i._closeTimer),i._receiver._writableState.finished||i._receiver._writableState.errorEmitted?i.emitClose():(i._receiver.on("error",rf),i._receiver.on("finish",rf))}function as(i){this[We]._receiver.write(i)||this.pause()}function df(){let i=this[We];i._readyState=ee.CLOSING,i._receiver.end(),this.end()}function ff(){let i=this[We];this.removeListener("error",ff),this.on("error",of),i&&(i._readyState=ee.CLOSING,this.destroy())}});var xf=C((JT,gf)=>{"use strict";var YT=cs(),{Duplex:B1}=require("stream");function mf(i){i.emit("close")}function j1(){!this.destroyed&&this._writableState.finished&&this.destroy()}function vf(i){this.removeListener("error",vf),this.destroy(),this.listenerCount("error")===0&&this.emit("error",i)}function N1(i,e){let t=!0,n=new B1({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return i.on("message",function(s,o){let a=!o&&n._readableState.objectMode?s.toString():s;n.push(a)||i.pause()}),i.once("error",function(s){n.destroyed||(t=!1,n.destroy(s))}),i.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(r,s){if(i.readyState===i.CLOSED){s(r),process.nextTick(mf,n);return}let o=!1;i.once("error",function(l){o=!0,s(l)}),i.once("close",function(){o||s(r),process.nextTick(mf,n)}),t&&i.terminate()},n._final=function(r){if(i.readyState===i.CONNECTING){i.once("open",function(){n._final(r)});return}i._socket!==null&&(i._socket._writableState.finished?(r(),n._readableState.endEmitted&&n.destroy()):(i._socket.once("finish",function(){r()}),i.close()))},n._read=function(){i.isPaused&&i.resume()},n._write=function(r,s,o){if(i.readyState===i.CONNECTING){i.once("open",function(){n._write(r,s,o)});return}i.send(r,o)},n.on("end",j1),n.on("error",vf),n}gf.exports=N1});var bf=C((XT,yf)=>{"use strict";var{tokenChars:D1}=Zi();function I1(i){let e=new Set,t=-1,n=-1,r=0;for(r;r<i.length;r++){let o=i.charCodeAt(r);if(n===-1&&D1[o]===1)t===-1&&(t=r);else if(r!==0&&(o===32||o===9))n===-1&&t!==-1&&(n=r);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${r}`);n===-1&&(n=r);let a=i.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 ${r}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=i.slice(t,r);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}yf.exports={parse:I1}});var Tf=C((QT,Cf)=>{"use strict";var q1=require("events"),ls=require("http"),{Duplex:ZT}=require("stream"),{createHash:L1}=require("crypto"),wf=oc(),Oi=Jn(),F1=bf(),U1=cs(),{GUID:H1,kWebSocket:z1}=Yt(),$1=/^[+/0-9A-Za-z]{22}==$/,_f=0,Sf=1,kf=2,pc=class extends q1{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:U1,...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=ls.createServer((n,r)=>{let s=ls.STATUS_CODES[426];r.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),r.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=W1(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(r,s,o)=>{this.handleUpgrade(r,s,o,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=_f}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===kf){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(er,this);return}if(e&&this.once("close",e),this._state!==Sf)if(this._state=Sf,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(er,this):process.nextTick(er,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{er(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,r){t.on("error",Ef);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){Ai(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){Ai(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!$1.test(s)){Ai(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){Ai(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){tr(t,400);return}let l=e.headers["sec-websocket-protocol"],p=new Set;if(l!==void 0)try{p=F1.parse(l)}catch{Ai(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let f=e.headers["sec-websocket-extensions"],m={};if(this.options.perMessageDeflate&&f!==void 0){let _=new Oi(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let E=wf.parse(f);E[Oi.extensionName]&&(_.accept(E[Oi.extensionName]),m[Oi.extensionName]=_)}catch{Ai(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let _={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(_,(E,k,T,M)=>{if(!E)return tr(t,k||401,T,M);this.completeUpgrade(m,s,p,e,t,n,r)});return}if(!this.options.verifyClient(_))return tr(t,401)}this.completeUpgrade(m,s,p,e,t,n,r)}completeUpgrade(e,t,n,r,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[z1])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>_f)return tr(s,503);let p=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${L1("sha1").update(t+H1).digest("base64")}`],f=new this.options.WebSocket(null,void 0,this.options);if(n.size){let m=this.options.handleProtocols?this.options.handleProtocols(n,r):n.values().next().value;m&&(p.push(`Sec-WebSocket-Protocol: ${m}`),f._protocol=m)}if(e[Oi.extensionName]){let m=e[Oi.extensionName].params,_=wf.format({[Oi.extensionName]:[m]});p.push(`Sec-WebSocket-Extensions: ${_}`),f._extensions=e}this.emit("headers",p,r),s.write(p.concat(`\r
|
|
10
10
|
`).join(`\r
|
|
11
|
-
`)),
|
|
12
|
-
`+Object.keys(n).map(
|
|
11
|
+
`)),s.removeListener("error",Ef),f.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(f),f.on("close",()=>{this.clients.delete(f),this._shouldEmitClose&&!this.clients.size&&process.nextTick(er,this)})),a(f,r)}};Cf.exports=pc;function W1(i,e){for(let t of Object.keys(e))i.on(t,e[t]);return function(){for(let n of Object.keys(e))i.removeListener(n,e[n])}}function er(i){i._state=kf,i.emit("close")}function Ef(){this.destroy()}function tr(i,e,t,n){t=t||ls.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...n},i.once("finish",i.destroy),i.end(`HTTP/1.1 ${e} ${ls.STATUS_CODES[e]}\r
|
|
12
|
+
`+Object.keys(n).map(r=>`${r}: ${n[r]}`).join(`\r
|
|
13
13
|
`)+`\r
|
|
14
14
|
\r
|
|
15
|
-
`+t)}function Ti(i,e,t,n,s,r){if(i.listenerCount("wsClientError")){let o=new Error(s);Error.captureStackTrace(o,Ti),i.emit("wsClientError",o,t,e)}else Jn(t,n,s,r)}});var nc=T((JC,yf)=>{"use strict";var Qt=sr();Qt.createWebSocketStream=lf();Qt.Server=xf();Qt.Receiver=Va();Qt.Sender=Ya();Qt.WebSocket=Qt;Qt.WebSocketServer=Qt.Server;yf.exports=Qt});var _f=T((XC,wf)=>{"use strict";var bf=Object.getOwnPropertySymbols,_1=Object.prototype.hasOwnProperty,S1=Object.prototype.propertyIsEnumerable;function E1(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function k1(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(e).map(function(r){return e[r]});if(n.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(r){s[r]=r}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}wf.exports=k1()?Object.assign:function(i,e){for(var t,n=E1(i),s,r=1;r<arguments.length;r++){t=Object(arguments[r]);for(var o in t)_1.call(t,o)&&(n[o]=t[o]);if(bf){s=bf(t);for(var a=0;a<s.length;a++)S1.call(t,s[a])&&(n[s[a]]=t[s[a]])}}return n}});var kf=T((ZC,sc)=>{"use strict";sc.exports=T1;sc.exports.append=Ef;var C1=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Ef(i,e){if(typeof i!="string")throw new TypeError("header argument is required");if(!e)throw new TypeError("field argument is required");for(var t=Array.isArray(e)?e:Sf(String(e)),n=0;n<t.length;n++)if(!C1.test(t[n]))throw new TypeError("field argument contains an invalid header name");if(i==="*")return i;var s=i,r=Sf(i.toLowerCase());if(t.indexOf("*")!==-1||r.indexOf("*")!==-1)return"*";for(var o=0;o<t.length;o++){var a=t[o].toLowerCase();r.indexOf(a)===-1&&(r.push(a),s=s?s+", "+t[o]:t[o])}return s}function Sf(i){for(var e=0,t=[],n=0,s=0,r=i.length;s<r;s++)switch(i.charCodeAt(s)){case 32:n===e&&(n=e=s+1);break;case 44:t.push(i.substring(n,e)),n=e=s+1;break;default:e=s+1;break}return t.push(i.substring(n,e)),t}function T1(i,e){if(!i||!i.getHeader||!i.setHeader)throw new TypeError("res argument is required");var t=i.getHeader("Vary")||"",n=Array.isArray(t)?t.join(", "):String(t);(t=Ef(n,e))&&i.setHeader("Vary",t)}});var rc=T((QC,Cf)=>{(function(){"use strict";var i=_f(),e=kf(),t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function n(C){return typeof C=="string"||C instanceof String}function s(C,k){if(Array.isArray(k)){for(var M=0;M<k.length;++M)if(s(C,k[M]))return!0;return!1}else return n(k)?C===k:k instanceof RegExp?k.test(C):!!k}function r(C,k){var M=k.headers.origin,O=[],A;return!C.origin||C.origin==="*"?O.push([{key:"Access-Control-Allow-Origin",value:"*"}]):n(C.origin)?(O.push([{key:"Access-Control-Allow-Origin",value:C.origin}]),O.push([{key:"Vary",value:"Origin"}])):(A=s(M,C.origin),O.push([{key:"Access-Control-Allow-Origin",value:A?M:!1}]),O.push([{key:"Vary",value:"Origin"}])),O}function o(C){var k=C.methods;return k.join&&(k=C.methods.join(",")),{key:"Access-Control-Allow-Methods",value:k}}function a(C){return C.credentials===!0?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function l(C,k){var M=C.allowedHeaders||C.headers,O=[];return M?M.join&&(M=M.join(",")):(M=k.headers["access-control-request-headers"],O.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),M&&M.length&&O.push([{key:"Access-Control-Allow-Headers",value:M}]),O}function p(C){var k=C.exposedHeaders;if(k)k.join&&(k=k.join(","));else return null;return k&&k.length?{key:"Access-Control-Expose-Headers",value:k}:null}function f(C){var k=(typeof C.maxAge=="number"||C.maxAge)&&C.maxAge.toString();return k&&k.length?{key:"Access-Control-Max-Age",value:k}:null}function v(C,k){for(var M=0,O=C.length;M<O;M++){var A=C[M];A&&(Array.isArray(A)?v(A,k):A.key==="Vary"&&A.value?e(k,A.value):A.value&&k.setHeader(A.key,A.value))}}function _(C,k,M,O){var A=[],N=k.method&&k.method.toUpperCase&&k.method.toUpperCase();N==="OPTIONS"?(A.push(r(C,k)),A.push(a(C)),A.push(o(C)),A.push(l(C,k)),A.push(f(C)),A.push(p(C)),v(A,M),C.preflightContinue?O():(M.statusCode=C.optionsSuccessStatus,M.setHeader("Content-Length","0"),M.end())):(A.push(r(C,k)),A.push(a(C)),A.push(p(C)),v(A,M),O())}function E(C){var k=null;return typeof C=="function"?k=C:k=function(M,O){O(null,C)},function(O,A,N){k(O,function(U,We){if(U)N(U);else{var te=i({},t,We),qe=null;te.origin&&typeof te.origin=="function"?qe=te.origin:te.origin&&(qe=function(H,Le){Le(null,te.origin)}),qe?qe(O.headers.origin,function(H,Le){H||!Le?N(H):(te.origin=Le,_(te,O,A,N))}):N()}})}}Cf.exports=E})()});var ac=T(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.Server=nn.BaseServer=void 0;var Tf=ta(),or=_a(),M1=require("events"),Mf=Ea(),O1=ie(),A1=Wp(),R1=nc(),Of=ba(),P1=Hn(),q=(0,O1.default)("engine"),en=Symbol("responseHeaders");function B1(i){try{let e=JSON.parse(i);if(typeof e.sid=="string")return e.sid}catch{}}var tn=class extends M1.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:R1.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(rc()(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?or.default[e].upgradesTo||[]:[]}verify(e,t,n){let s=e._query.transport;if(!~this.opts.transports.indexOf(s)||s==="webtransport")return q('unknown transport "%s"',s),n(J.errors.UNKNOWN_TRANSPORT,{transport:s});if(j1(e.headers.origin)){let a=e.headers.origin;return e.headers.origin=null,q("origin header invalid"),n(J.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:a})}let o=e._query.sid;if(o){if(!this.clients.hasOwnProperty(o))return q('unknown sid "%s"',o),n(J.errors.UNKNOWN_SID,{sid:o});let a=this.clients[o].transport.name;if(!t&&a!==s)return q("bad request: unexpected transport without upgrade"),n(J.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:s,previousTransport:a})}else return e.method!=="GET"?n(J.errors.BAD_HANDSHAKE_METHOD,{method:e.method}):s==="websocket"&&!t?(q("invalid transport upgrade"),n(J.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"})):this.opts.allowRequest?this.opts.allowRequest(e,(a,l)=>{if(!l)return n(J.errors.FORBIDDEN,{message:a});n()}):n();n()}use(e){this.middlewares.push(e)}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return q("no middleware to apply, skipping"),n();let s=r=>{q("applying middleware n\xB0%d",r+1),this.middlewares[r](e,t,o=>{if(o)return n(o);r+1<this.middlewares.length?s(r+1):n()})};s(0)}close(){q("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 Tf.generateId()}async handshake(e,t,n){let s=t._query.EIO==="4"?4:3;if(s===3&&!this.opts.allowEIO3){q("unsupported protocol version"),this.emit("connection_error",{req:t,code:J.errors.UNSUPPORTED_PROTOCOL_VERSION,message:J.errorMessages[J.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:s}}),n(J.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let r;try{r=await this.generateId(t)}catch(l){q("error while generating an id"),this.emit("connection_error",{req:t,code:J.errors.BAD_REQUEST,message:J.errorMessages[J.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:l}}),n(J.errors.BAD_REQUEST);return}q('handshaking client "%s"',r);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(l){q('error handshaking to transport "%s"',e),this.emit("connection_error",{req:t,code:J.errors.BAD_REQUEST,message:J.errorMessages[J.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:l}}),n(J.errors.BAD_REQUEST);return}let a=new Mf.Socket(r,this,o,t,s);return o.on("headers",(l,p)=>{!p._query.sid&&(this.opts.cookie&&(l["Set-Cookie"]=[(0,A1.serialize)(this.opts.cookie.name,r,this.opts.cookie)]),this.emit("initial_headers",l,p)),this.emit("headers",l,p)}),o.onRequest(t),this.clients[r]=a,this.clientsCount++,a.once("close",()=>{delete this.clients[r],this.clientsCount--}),this.emit("connection",a),o}async onWebTransportSession(e){let t=setTimeout(()=>{q("the client failed to establish a bidirectional stream in the given period"),e.close()},this.opts.upgradeTimeout),s=await e.incomingBidirectionalStreams.getReader().read();if(s.done){q("session is closed");return}let r=s.value,o=(0,P1.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),a=r.readable.pipeThrough(o).getReader(),{value:l,done:p}=await a.read();if(p){q("stream is closed");return}if(clearTimeout(t),l.type!=="open")return q("invalid WebTransport handshake"),e.close();if(l.data===void 0){let _=new Of.WebTransport(e,r,a),E=Tf.generateId();q('handshaking client "%s" (WebTransport)',E);let C=new Mf.Socket(E,this,_,null,4);this.clients[E]=C,this.clientsCount++,C.once("close",()=>{delete this.clients[E],this.clientsCount--}),this.emit("connection",C);return}let f=B1(l.data);if(!f)return q("invalid WebTransport handshake"),e.close();let v=this.clients[f];if(!v)q("upgrade attempt for closed client"),e.close();else if(v.upgrading)q("transport has already been trying to upgrade"),e.close();else if(v.upgraded)q("transport had already been upgraded"),e.close();else{q("upgrading existing transport");let _=new Of.WebTransport(e,r,a);v._maybeUpgrade(_)}}};nn.BaseServer=tn;tn.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};tn.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};var oc=class{constructor(e,t){this.req=e,this.socket=t,e[en]={}}setHeader(e,t){this.req[en][e]=t}getHeader(e){return this.req[en][e]}removeHeader(e){delete this.req[en][e]}write(){}writeHead(){}end(){this.socket.destroy()}},J=class i extends tn{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[en]||{};delete t[en],!t._query.sid&&this.emit("initial_headers",n,t),this.emit("headers",n,t),q("writing headers: %j",n),Object.keys(n).forEach(r=>{e.push(`${r}: ${n[r]}`)})}))}cleanup(){this.ws&&(q("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 or.default[e](t)}handleRequest(e,t){q('handling "%s" http request "%s"',e.method,e.url),this.prepare(e),e.res=t;let n=(s,r)=>{if(s!==void 0){this.emit("connection_error",{req:e,code:s,message:i.errorMessages[s],context:r}),Af(t,s,r);return}if(e._query.sid)q("setting new request for existing client"),this.clients[e._query.sid].transport.onRequest(e);else{let o=(a,l)=>Af(t,a,l);this.handshake(e._query.transport,e,o)}};this._applyMiddlewares(e,t,s=>{s?n(i.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!1,n)})}handleUpgrade(e,t,n){this.prepare(e);let s=new oc(e,t),r=(o,a)=>{if(o!==void 0){this.emit("connection_error",{req:e,code:o,message:i.errorMessages[o],context:a}),Rf(t,o,a);return}let l=Buffer.from(n);n=null,s.writeHead(),this.ws.handleUpgrade(e,t,l,p=>{this.onWebSocket(e,t,p)})};this._applyMiddlewares(e,s,o=>{o?r(i.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!0,r)})}onWebSocket(e,t,n){if(n.on("error",r),or.default[e._query.transport]!==void 0&&!or.default[e._query.transport].prototype.handlesUpgrades){q("transport doesnt handle upgraded requests"),n.close();return}let s=e._query.sid;if(e.websocket=n,s){let o=this.clients[s];if(!o)q("upgrade attempt for closed client"),n.close();else if(o.upgrading)q("transport has already been trying to upgrade"),n.close();else if(o.upgraded)q("transport had already been upgraded"),n.close();else{q("upgrading existing transport"),n.removeListener("error",r);let a=this.createTransport(e._query.transport,e);a.perMessageDeflate=this.opts.perMessageDeflate,o._maybeUpgrade(a)}}else{let o=(a,l)=>Rf(t,a,l);this.handshake(e._query.transport,e,o)}function r(){q("websocket error before upgrade")}}attach(e,t={}){let n=this._computePath(t),s=t.destroyUpgradeTimeout||1e3;function r(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,l)=>{if(r(a))q('intercepting request for path "%s"',n),this.handleRequest(a,l);else{let p=0,f=o.length;for(;p<f;p++)o[p].call(e,a,l)}}),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",(a,l,p)=>{r(a)?this.handleUpgrade(a,l,p):t.destroyUpgrade!==!1&&setTimeout(function(){if(l.writable&&l.bytesWritten<=0)return l.on("error",f=>{q("error while destroying upgrade: %s",f.message)}),l.end()},s)})}};nn.Server=J;function Af(i,e,t){let n=e===J.errors.FORBIDDEN?403:400,s=t&&t.message?t.message:J.errorMessages[e];i.writeHead(n,{"Content-Type":"application/json"}),i.end(JSON.stringify({code:e,message:s}))}function Rf(i,e,t={}){if(i.on("error",()=>{q("ignoring error from closed connection")}),i.writable){let n=t.message||J.errorMessages[e],s=Buffer.byteLength(n);i.write(`HTTP/1.1 400 Bad Request\r
|
|
15
|
+
`+t)}function Ai(i,e,t,n,r,s){if(i.listenerCount("wsClientError")){let o=new Error(r);Error.captureStackTrace(o,Ai),i.emit("wsClientError",o,t,e)}else tr(t,n,r,s)}});var dc=C((eM,Mf)=>{"use strict";var ei=cs();ei.createWebSocketStream=xf();ei.Server=Tf();ei.Receiver=tc();ei.Sender=rc();ei.WebSocket=ei;ei.WebSocketServer=ei.Server;Mf.exports=ei});var Rf=C((tM,Af)=>{"use strict";var Of=Object.getOwnPropertySymbols,V1=Object.prototype.hasOwnProperty,K1=Object.prototype.propertyIsEnumerable;function G1(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function Y1(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[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 r={};return"abcdefghijklmnopqrst".split("").forEach(function(s){r[s]=s}),Object.keys(Object.assign({},r)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Af.exports=Y1()?Object.assign:function(i,e){for(var t,n=G1(i),r,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var o in t)V1.call(t,o)&&(n[o]=t[o]);if(Of){r=Of(t);for(var a=0;a<r.length;a++)K1.call(t,r[a])&&(n[r[a]]=t[r[a]])}}return n}});var jf=C((iM,fc)=>{"use strict";fc.exports=X1;fc.exports.append=Bf;var J1=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Bf(i,e){if(typeof i!="string")throw new TypeError("header argument is required");if(!e)throw new TypeError("field argument is required");for(var t=Array.isArray(e)?e:Pf(String(e)),n=0;n<t.length;n++)if(!J1.test(t[n]))throw new TypeError("field argument contains an invalid header name");if(i==="*")return i;var r=i,s=Pf(i.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),r=r?r+", "+t[o]:t[o])}return r}function Pf(i){for(var e=0,t=[],n=0,r=0,s=i.length;r<s;r++)switch(i.charCodeAt(r)){case 32:n===e&&(n=e=r+1);break;case 44:t.push(i.substring(n,e)),n=e=r+1;break;default:e=r+1;break}return t.push(i.substring(n,e)),t}function X1(i,e){if(!i||!i.getHeader||!i.setHeader)throw new TypeError("res argument is required");var t=i.getHeader("Vary")||"",n=Array.isArray(t)?t.join(", "):String(t);(t=Bf(n,e))&&i.setHeader("Vary",t)}});var hc=C((nM,Nf)=>{(function(){"use strict";var i=Rf(),e=jf(),t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function n(k){return typeof k=="string"||k instanceof String}function r(k,T){if(Array.isArray(T)){for(var M=0;M<T.length;++M)if(r(k,T[M]))return!0;return!1}else return n(T)?k===T:T instanceof RegExp?T.test(k):!!T}function s(k,T){var M=T.headers.origin,O=[],A;return!k.origin||k.origin==="*"?O.push([{key:"Access-Control-Allow-Origin",value:"*"}]):n(k.origin)?(O.push([{key:"Access-Control-Allow-Origin",value:k.origin}]),O.push([{key:"Vary",value:"Origin"}])):(A=r(M,k.origin),O.push([{key:"Access-Control-Allow-Origin",value:A?M:!1}]),O.push([{key:"Vary",value:"Origin"}])),O}function o(k){var T=k.methods;return T.join&&(T=k.methods.join(",")),{key:"Access-Control-Allow-Methods",value:T}}function a(k){return k.credentials===!0?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function l(k,T){var M=k.allowedHeaders||k.headers,O=[];return M?M.join&&(M=M.join(",")):(M=T.headers["access-control-request-headers"],O.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),M&&M.length&&O.push([{key:"Access-Control-Allow-Headers",value:M}]),O}function p(k){var T=k.exposedHeaders;if(T)T.join&&(T=T.join(","));else return null;return T&&T.length?{key:"Access-Control-Expose-Headers",value:T}:null}function f(k){var T=(typeof k.maxAge=="number"||k.maxAge)&&k.maxAge.toString();return T&&T.length?{key:"Access-Control-Max-Age",value:T}:null}function m(k,T){for(var M=0,O=k.length;M<O;M++){var A=k[M];A&&(Array.isArray(A)?m(A,T):A.key==="Vary"&&A.value?e(T,A.value):A.value&&T.setHeader(A.key,A.value))}}function _(k,T,M,O){var A=[],D=T.method&&T.method.toUpperCase&&T.method.toUpperCase();D==="OPTIONS"?(A.push(s(k,T)),A.push(a(k)),A.push(o(k)),A.push(l(k,T)),A.push(f(k)),A.push(p(k)),m(A,M),k.preflightContinue?O():(M.statusCode=k.optionsSuccessStatus,M.setHeader("Content-Length","0"),M.end())):(A.push(s(k,T)),A.push(a(k)),A.push(p(k)),m(A,M),O())}function E(k){var T=null;return typeof k=="function"?T=k:T=function(M,O){O(null,k)},function(O,A,D){T(O,function(U,te){if(U)D(U);else{var z=i({},t,te),re=null;z.origin&&typeof z.origin=="function"?re=z.origin:z.origin&&(re=function(H,ae){ae(null,z.origin)}),re?re(O.headers.origin,function(H,ae){H||!ae?D(H):(z.origin=ae,_(z,O,A,D))}):D()}})}}Nf.exports=E})()});var vc=C(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.Server=on.BaseServer=void 0;var Df=ua(),us=Ra(),Z1=require("events"),If=Ba(),Q1=se(),e_=ed(),t_=dc(),qf=Oa(),i_=Kn(),q=(0,Q1.default)("engine"),rn=Symbol("responseHeaders");function n_(i){try{let e=JSON.parse(i);if(typeof e.sid=="string")return e.sid}catch{}}var sn=class extends Z1.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:t_.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(hc()(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?us.default[e].upgradesTo||[]:[]}verify(e,t,n){let r=e._query.transport;if(!~this.opts.transports.indexOf(r)||r==="webtransport")return q('unknown transport "%s"',r),n(X.errors.UNKNOWN_TRANSPORT,{transport:r});if(r_(e.headers.origin)){let a=e.headers.origin;return e.headers.origin=null,q("origin header invalid"),n(X.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:a})}let o=e._query.sid;if(o){if(!this.clients.hasOwnProperty(o))return q('unknown sid "%s"',o),n(X.errors.UNKNOWN_SID,{sid:o});let a=this.clients[o].transport.name;if(!t&&a!==r)return q("bad request: unexpected transport without upgrade"),n(X.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:r,previousTransport:a})}else return e.method!=="GET"?n(X.errors.BAD_HANDSHAKE_METHOD,{method:e.method}):r==="websocket"&&!t?(q("invalid transport upgrade"),n(X.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"})):this.opts.allowRequest?this.opts.allowRequest(e,(a,l)=>{if(!l)return n(X.errors.FORBIDDEN,{message:a});n()}):n();n()}use(e){this.middlewares.push(e)}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return q("no middleware to apply, skipping"),n();let r=s=>{q("applying middleware n\xB0%d",s+1),this.middlewares[s](e,t,o=>{if(o)return n(o);s+1<this.middlewares.length?r(s+1):n()})};r(0)}close(){q("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 Df.generateId()}async handshake(e,t,n){let r=t._query.EIO==="4"?4:3;if(r===3&&!this.opts.allowEIO3){q("unsupported protocol version"),this.emit("connection_error",{req:t,code:X.errors.UNSUPPORTED_PROTOCOL_VERSION,message:X.errorMessages[X.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:r}}),n(X.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let s;try{s=await this.generateId(t)}catch(l){q("error while generating an id"),this.emit("connection_error",{req:t,code:X.errors.BAD_REQUEST,message:X.errorMessages[X.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:l}}),n(X.errors.BAD_REQUEST);return}q('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(l){q('error handshaking to transport "%s"',e),this.emit("connection_error",{req:t,code:X.errors.BAD_REQUEST,message:X.errorMessages[X.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:l}}),n(X.errors.BAD_REQUEST);return}let a=new If.Socket(s,this,o,t,r);return o.on("headers",(l,p)=>{!p._query.sid&&(this.opts.cookie&&(l["Set-Cookie"]=[(0,e_.serialize)(this.opts.cookie.name,s,this.opts.cookie)]),this.emit("initial_headers",l,p)),this.emit("headers",l,p)}),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(()=>{q("the client failed to establish a bidirectional stream in the given period"),e.close()},this.opts.upgradeTimeout),r=await e.incomingBidirectionalStreams.getReader().read();if(r.done){q("session is closed");return}let s=r.value,o=(0,i_.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),a=s.readable.pipeThrough(o).getReader(),{value:l,done:p}=await a.read();if(p){q("stream is closed");return}if(clearTimeout(t),l.type!=="open")return q("invalid WebTransport handshake"),e.close();if(l.data===void 0){let _=new qf.WebTransport(e,s,a),E=Df.generateId();q('handshaking client "%s" (WebTransport)',E);let k=new If.Socket(E,this,_,null,4);this.clients[E]=k,this.clientsCount++,k.once("close",()=>{delete this.clients[E],this.clientsCount--}),this.emit("connection",k);return}let f=n_(l.data);if(!f)return q("invalid WebTransport handshake"),e.close();let m=this.clients[f];if(!m)q("upgrade attempt for closed client"),e.close();else if(m.upgrading)q("transport has already been trying to upgrade"),e.close();else if(m.upgraded)q("transport had already been upgraded"),e.close();else{q("upgrading existing transport");let _=new qf.WebTransport(e,s,a);m._maybeUpgrade(_)}}};on.BaseServer=sn;sn.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};sn.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};var mc=class{constructor(e,t){this.req=e,this.socket=t,e[rn]={}}setHeader(e,t){this.req[rn][e]=t}getHeader(e){return this.req[rn][e]}removeHeader(e){delete this.req[rn][e]}write(){}writeHead(){}end(){this.socket.destroy()}},X=class i extends sn{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[rn]||{};delete t[rn],!t._query.sid&&this.emit("initial_headers",n,t),this.emit("headers",n,t),q("writing headers: %j",n),Object.keys(n).forEach(s=>{e.push(`${s}: ${n[s]}`)})}))}cleanup(){this.ws&&(q("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 us.default[e](t)}handleRequest(e,t){q('handling "%s" http request "%s"',e.method,e.url),this.prepare(e),e.res=t;let n=(r,s)=>{if(r!==void 0){this.emit("connection_error",{req:e,code:r,message:i.errorMessages[r],context:s}),Lf(t,r,s);return}if(e._query.sid)q("setting new request for existing client"),this.clients[e._query.sid].transport.onRequest(e);else{let o=(a,l)=>Lf(t,a,l);this.handshake(e._query.transport,e,o)}};this._applyMiddlewares(e,t,r=>{r?n(i.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!1,n)})}handleUpgrade(e,t,n){this.prepare(e);let r=new mc(e,t),s=(o,a)=>{if(o!==void 0){this.emit("connection_error",{req:e,code:o,message:i.errorMessages[o],context:a}),Ff(t,o,a);return}let l=Buffer.from(n);n=null,r.writeHead(),this.ws.handleUpgrade(e,t,l,p=>{this.onWebSocket(e,t,p)})};this._applyMiddlewares(e,r,o=>{o?s(i.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!0,s)})}onWebSocket(e,t,n){if(n.on("error",s),us.default[e._query.transport]!==void 0&&!us.default[e._query.transport].prototype.handlesUpgrades){q("transport doesnt handle upgraded requests"),n.close();return}let r=e._query.sid;if(e.websocket=n,r){let o=this.clients[r];if(!o)q("upgrade attempt for closed client"),n.close();else if(o.upgrading)q("transport has already been trying to upgrade"),n.close();else if(o.upgraded)q("transport had already been upgraded"),n.close();else{q("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,l)=>Ff(t,a,l);this.handshake(e._query.transport,e,o)}function s(){q("websocket error before upgrade")}}attach(e,t={}){let n=this._computePath(t),r=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,l)=>{if(s(a))q('intercepting request for path "%s"',n),this.handleRequest(a,l);else{let p=0,f=o.length;for(;p<f;p++)o[p].call(e,a,l)}}),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",(a,l,p)=>{s(a)?this.handleUpgrade(a,l,p):t.destroyUpgrade!==!1&&setTimeout(function(){if(l.writable&&l.bytesWritten<=0)return l.on("error",f=>{q("error while destroying upgrade: %s",f.message)}),l.end()},r)})}};on.Server=X;function Lf(i,e,t){let n=e===X.errors.FORBIDDEN?403:400,r=t&&t.message?t.message:X.errorMessages[e];i.writeHead(n,{"Content-Type":"application/json"}),i.end(JSON.stringify({code:e,message:r}))}function Ff(i,e,t={}){if(i.on("error",()=>{q("ignoring error from closed connection")}),i.writable){let n=t.message||X.errorMessages[e],r=Buffer.byteLength(n);i.write(`HTTP/1.1 400 Bad Request\r
|
|
16
16
|
Connection: close\r
|
|
17
17
|
Content-type: text/html\r
|
|
18
|
-
Content-Length: `+
|
|
18
|
+
Content-Length: `+r+`\r
|
|
19
19
|
\r
|
|
20
|
-
`+n)}i.destroy()}var Xn=[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 j1(i){if(i+="",i.length<1)return!1;if(!Xn[i.charCodeAt(0)])return q('invalid header, index 0, char "%s"',i.charCodeAt(0)),!0;if(i.length<2)return!1;if(!Xn[i.charCodeAt(1)])return q('invalid header, index 1, char "%s"',i.charCodeAt(1)),!0;if(i.length<3)return!1;if(!Xn[i.charCodeAt(2)])return q('invalid header, index 2, char "%s"',i.charCodeAt(2)),!0;if(i.length<4)return!1;if(!Xn[i.charCodeAt(3)])return q('invalid header, index 3, char "%s"',i.charCodeAt(3)),!0;for(let e=4;e<i.length;++e)if(!Xn[i.charCodeAt(e)])return q('invalid header, index "%i", char "%s"',e,i.charCodeAt(e)),!0;return!1}});var Bf=T(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.Polling=void 0;var N1=_i(),Pf=require("zlib"),I1=Ms(),D1=ie(),xt=(0,D1.default)("engine:polling"),q1={gzip:Pf.createGzip,deflate:Pf.createDeflate},cc=class extends N1.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){xt("request overlap"),this.onError("overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}xt("setting request"),this.req=e,this.res=t;let n=()=>{this.writable=!1,this.onError("poll connection closed prematurely")},s=()=>{this.req=this.res=null};e.cleanup=s,t.onAborted(n),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose&&(xt("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 r,o=0,a={"Content-Type":"text/html"};this.headers(e,a);for(let p in a)t.writeHeader(p,String(a[p]));let l=p=>{this.onData(p.toString()),this.onDataRequestCleanup(),t.cork(()=>{t.end("ok")})};t.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),t.onData((p,f)=>{let v=o+p.byteLength;if(v>n){this.onError("content-length mismatch"),t.close();return}if(!r){if(f){l(Buffer.from(p));return}r=Buffer.allocUnsafe(n)}if(Buffer.from(p).copy(r,o),f){if(v!=n){this.onError("content-length mismatch"),t.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}l(r);return}o=v})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(e){xt('received "%s"',e);let t=n=>{if(n.type==="close")return xt("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&&(xt("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=n=>{let s=e.some(r=>r.options&&r.options.compress);this.write(n,{compress:s})};this.protocol===3?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){xt('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,n){let s=typeof e=="string",o={"Content-Type":s?"text/plain; charset=UTF-8":"application/octet-stream"},a=f=>{this.headers(this.req,o),this.res.cork(()=>{Object.keys(o).forEach(v=>{this.res.writeHeader(v,String(o[v]))}),this.res.end(f)}),n()};if(!this.httpCompression||!t.compress){a(e);return}if((s?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let p=I1(this.req).encodings(["gzip","deflate"]);if(!p){a(e);return}this.compress(e,p,(f,v)=>{if(f){this.res.writeStatus("500 Internal Server Error"),this.res.end(),n(f);return}o["Content-Encoding"]=p,a(v)})}compress(e,t,n){xt("compressing");let s=[],r=0;q1[t](this.httpCompression).on("error",n).on("data",function(o){s.push(o),r+=o.length}).on("end",function(){n(null,Buffer.concat(s,r))}).end(e)}doClose(e){xt("closing");let t,n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(xt("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(xt("transport discarded - closing right away"),n()):(xt("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}};ar.Polling=cc});var Nf=T(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.WebSocket=void 0;var L1=_i(),F1=ie(),jf=(0,F1.default)("engine:ws"),lc=class extends L1.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],s=t+1===e.length,r=o=>{let a=typeof o!="string",l=this.perMessageDeflate&&Buffer.byteLength(o)>this.perMessageDeflate.threshold;jf('writing "%s"',o),this.socket.send(o,a,l),s&&(this.emit("drain"),this.writable=!0,this.emit("ready"))};n.options&&typeof n.options.wsPreEncoded=="string"?r(n.options.wsPreEncoded):this.parser.encodePacket(n,this.supportsBinary,r)}}doClose(e){jf("closing"),e&&e(),this.socket.end()}};cr.WebSocket=lc});var If=T(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});var U1=Bf(),H1=Nf();uc.default={polling:U1.Polling,websocket:H1.WebSocket}});var Df=T(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.uServer=void 0;var z1=ie(),Mi=ac(),$1=If(),pi=(0,z1.default)("engine:uws"),pc=class extends Mi.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((s,r)=>{e.headers[s]=r}),e.connection={remoteAddress:Buffer.from(t.getRemoteAddressAsText()).toString()},t.onAborted(()=>{pi("response has been aborted")})}createTransport(e,t){return new $1.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:s=>{let r=s.getUserData().transport;r.socket=s,r.writable=!0,r.emit("ready")},message:(s,r,o)=>{s.getUserData().transport.onData(o?r:Buffer.from(r).toString())},close:(s,r,o)=>{s.getUserData().transport.onClose(r,o)}})}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return n();e.res=new dc(t),super._applyMiddlewares(e,e.res,s=>{e.res.writeHead(),n(s)})}handleRequest(e,t){pi('handling "%s" http request "%s"',t.getMethod(),t.getUrl()),this.prepare(t,e),t.res=e;let n=(s,r)=>{if(s!==void 0){this.emit("connection_error",{req:t,code:s,message:Mi.Server.errorMessages[s],context:r}),this.abortRequest(t.res,s,r);return}if(t._query.sid)pi("setting new request for existing client"),this.clients[t._query.sid].transport.onRequest(t);else{let o=(a,l)=>this.abortRequest(e,a,l);this.handshake(t._query.transport,t,o)}};this._applyMiddlewares(t,e,s=>{s?n(Mi.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,n)})}handleUpgrade(e,t,n){pi("on upgrade"),this.prepare(t,e),t.res=e;let s=async(r,o)=>{if(r!==void 0){this.emit("connection_error",{req:t,code:r,message:Mi.Server.errorMessages[r],context:o}),this.abortRequest(e,r,o);return}let a=t._query.sid,l;if(a){let p=this.clients[a];if(p){if(p.upgrading)return pi("transport has already been trying to upgrade"),e.close();if(p.upgraded)return pi("transport had already been upgraded"),e.close();pi("upgrading existing transport"),l=this.createTransport(t._query.transport,t),p._maybeUpgrade(l)}else return pi("upgrade attempt for closed client"),e.close()}else if(l=await this.handshake(t._query.transport,t,(p,f)=>this.abortRequest(e,p,f)),!l)return;t.res.writeStatus("101 Switching Protocols"),e.upgrade({transport:l},t.getHeader("sec-websocket-key"),t.getHeader("sec-websocket-protocol"),t.getHeader("sec-websocket-extensions"),n)};this._applyMiddlewares(t,e,r=>{r?s(Mi.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,s)})}abortRequest(e,t,n){let s=t===Mi.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",r=n&&n.message?n.message:Mi.Server.errorMessages[t];e.writeStatus(s),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:r}))}};lr.uServer=pc;var dc=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 Uf=T($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.protocol=$e.Transport=$e.Socket=$e.uServer=$e.parser=$e.transports=$e.Server=void 0;$e.listen=J1;$e.attach=Ff;var W1=require("http"),qf=ac();Object.defineProperty($e,"Server",{enumerable:!0,get:function(){return qf.Server}});var V1=_a();$e.transports=V1.default;var Lf=Hn();$e.parser=Lf;var K1=Df();Object.defineProperty($e,"uServer",{enumerable:!0,get:function(){return K1.uServer}});var G1=Ea();Object.defineProperty($e,"Socket",{enumerable:!0,get:function(){return G1.Socket}});var Y1=_i();Object.defineProperty($e,"Transport",{enumerable:!0,get:function(){return Y1.Transport}});$e.protocol=Lf.protocol;function J1(i,e,t){typeof e=="function"&&(t=e,e={});let n=(0,W1.createServer)(function(r,o){o.writeHead(501),o.end("Not Implemented")}),s=Ff(n,e);return s.httpServer=n,n.listen(i,t),s}function Ff(i,e){let t=new qf.Server(e);return t.attach(i,e),t}});var zf=T(Hf=>{Hf.Emitter=Xe;function Xe(i){if(i)return X1(i)}function X1(i){for(var e in Xe.prototype)i[e]=Xe.prototype[e];return i}Xe.prototype.on=Xe.prototype.addEventListener=function(i,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(e),this};Xe.prototype.once=function(i,e){function t(){this.off(i,t),e.apply(this,arguments)}return t.fn=e,this.on(i,t),this};Xe.prototype.off=Xe.prototype.removeListener=Xe.prototype.removeAllListeners=Xe.prototype.removeEventListener=function(i,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+i];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+i],this;for(var n,s=0;s<t.length;s++)if(n=t[s],n===e||n.fn===e){t.splice(s,1);break}return t.length===0&&delete this._callbacks["$"+i],this};Xe.prototype.emit=function(i){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+i],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,s=t.length;n<s;++n)t[n].apply(this,e)}return this};Xe.prototype.emitReserved=Xe.prototype.emit;Xe.prototype.listeners=function(i){return this._callbacks=this._callbacks||{},this._callbacks["$"+i]||[]};Xe.prototype.hasListeners=function(i){return!!this.listeners(i).length}});var fc=T(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.isBinary=Wf;pr.hasBinary=ur;var Z1=typeof ArrayBuffer=="function",Q1=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i.buffer instanceof ArrayBuffer,$f=Object.prototype.toString,e_=typeof Blob=="function"||typeof Blob<"u"&&$f.call(Blob)==="[object BlobConstructor]",t_=typeof File=="function"||typeof File<"u"&&$f.call(File)==="[object FileConstructor]";function Wf(i){return Z1&&(i instanceof ArrayBuffer||Q1(i))||e_&&i instanceof Blob||t_&&i instanceof File}function ur(i,e){if(!i||typeof i!="object")return!1;if(Array.isArray(i)){for(let t=0,n=i.length;t<n;t++)if(ur(i[t]))return!0;return!1}if(Wf(i))return!0;if(i.toJSON&&typeof i.toJSON=="function"&&arguments.length===1)return ur(i.toJSON(),!0);for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)&&ur(i[t]))return!0;return!1}});var Vf=T(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.deconstructPacket=n_;dr.reconstructPacket=s_;var i_=fc();function n_(i){let e=[],t=i.data,n=i;return n.data=hc(t,e),n.attachments=e.length,{packet:n,buffers:e}}function hc(i,e){if(!i)return i;if((0,i_.isBinary)(i)){let t={_placeholder:!0,num:e.length};return e.push(i),t}else if(Array.isArray(i)){let t=new Array(i.length);for(let n=0;n<i.length;n++)t[n]=hc(i[n],e);return t}else if(typeof i=="object"&&!(i instanceof Date)){let t={};for(let n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=hc(i[n],e));return t}return i}function s_(i,e){return i.data=mc(i.data,e),delete i.attachments,i}function mc(i,e){if(!i)return i;if(i&&i._placeholder===!0){if(typeof i.num=="number"&&i.num>=0&&i.num<e.length)return e[i.num];throw new Error("illegal attachments")}else if(Array.isArray(i))for(let t=0;t<i.length;t++)i[t]=mc(i[t],e);else if(typeof i=="object")for(let t in i)Object.prototype.hasOwnProperty.call(i,t)&&(i[t]=mc(i[t],e));return i}});var Zn=T(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.Decoder=Pt.Encoder=Pt.PacketType=Pt.protocol=void 0;Pt.isPacketValid=p_;var r_=zf(),Kf=Vf(),Gf=fc(),o_=ie(),vc=(0,o_.default)("socket.io-parser"),Yf=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];Pt.protocol=5;var W;(function(i){i[i.CONNECT=0]="CONNECT",i[i.DISCONNECT=1]="DISCONNECT",i[i.EVENT=2]="EVENT",i[i.ACK=3]="ACK",i[i.CONNECT_ERROR=4]="CONNECT_ERROR",i[i.BINARY_EVENT=5]="BINARY_EVENT",i[i.BINARY_ACK=6]="BINARY_ACK"})(W||(Pt.PacketType=W={}));var gc=class{constructor(e){this.replacer=e}encode(e){return vc("encoding packet %j",e),(e.type===W.EVENT||e.type===W.ACK)&&(0,Gf.hasBinary)(e)?this.encodeAsBinary({type:e.type===W.EVENT?W.BINARY_EVENT:W.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===W.BINARY_EVENT||e.type===W.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)),vc("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,Kf.deconstructPacket)(e),n=this.encodeAsString(t.packet),s=t.buffers;return s.unshift(n),s}};Pt.Encoder=gc;var xc=class i extends r_.Emitter{constructor(e){super(),this.reviver=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===W.BINARY_EVENT;n||t.type===W.BINARY_ACK?(t.type=n?W.EVENT:W.ACK,this.reconstructor=new yc(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,Gf.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(W[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===W.BINARY_EVENT||n.type===W.BINARY_ACK){let r=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(r,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");n.attachments=Number(o)}if(e.charAt(t+1)==="/"){let r=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(r,t)}else n.nsp="/";let s=e.charAt(t+1);if(s!==""&&Number(s)==s){let r=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(r,t+1))}if(e.charAt(++t)){let r=this.tryParse(e.substr(t));if(i.isPayloadValid(n.type,r))n.data=r;else throw new Error("invalid payload")}return vc("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case W.CONNECT:return fr(t);case W.DISCONNECT:return t===void 0;case W.CONNECT_ERROR:return typeof t=="string"||fr(t);case W.EVENT:case W.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&Yf.indexOf(t[0])===-1);case W.ACK:case W.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};Pt.Decoder=xc;var yc=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,Kf.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function a_(i){return typeof i=="string"}var c_=Number.isInteger||function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i};function l_(i){return i===void 0||c_(i)}function fr(i){return Object.prototype.toString.call(i)==="[object Object]"}function u_(i,e){switch(i){case W.CONNECT:return e===void 0||fr(e);case W.DISCONNECT:return e===void 0;case W.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&Yf.indexOf(e[0])===-1);case W.ACK:return Array.isArray(e);case W.CONNECT_ERROR:return typeof e=="string"||fr(e);default:return!1}}function p_(i){return a_(i.nsp)&&l_(i.id)&&u_(i.type,i.data)}});var Jf=T(sn=>{"use strict";var d_=sn&&sn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(sn,"__esModule",{value:!0});sn.Client=void 0;var hr=Zn(),f_=d_(ie()),Bt=(0,f_.default)("socket.io:client"),bc=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?(Bt("no namespace joined yet, close the client"),this.close()):Bt("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return Bt("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,n=>{n?this.doConnect(e,t):(Bt("creation of namespace %s was denied",e),this._packet({type:hr.PacketType.CONNECT_ERROR,nsp:e,data:{message:"Invalid namespace"}}))})}doConnect(e,t){let n=this.server.of(e);n._add(this,t,s=>{this.sockets.set(s.id,s),this.nsps.set(n.name,s),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 Bt("ignoring remove for %s",e.id)}close(){this.conn.readyState==="open"&&(Bt("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if(this.conn.readyState!=="open"){Bt("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){Bt("volatile packet is discarded since the transport is not currently writable");return}let n=Array.isArray(e)?e:[e];for(let s of n)this.conn.write(s,t)}ondata(e){try{this.decoder.add(e)}catch(t){Bt("invalid packet format"),this.onerror(t)}}ondecoded(e){let{namespace:t,authPayload:n}=this._parseNamespace(e),s=this.nsps.get(t);!s&&e.type===hr.PacketType.CONNECT?this.connect(t,n):s&&e.type!==hr.PacketType.CONNECT&&e.type!==hr.PacketType.CONNECT_ERROR?process.nextTick(function(){s._onpacket(e)}):(Bt("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){Bt("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)}};sn.Client=bc});var vr=T(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.StrictEventEmitter=void 0;var h_=require("events"),wc=class extends h_.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)}};mr.StrictEventEmitter=wc});var _c=T(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.RESERVED_EVENTS=void 0;gr.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var Sc=T(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.RemoteSocket=rn.BroadcastOperator=void 0;var m_=_c(),v_=Zn(),xr=class i{constructor(e,t=new Set,n=new Set,s={}){this.adapter=e,this.rooms=t,this.exceptRooms=n,this.flags=s}to(e){let t=new Set(this.rooms);return Array.isArray(e)?e.forEach(n=>t.add(n)):t.add(e),new i(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 i(this.adapter,this.rooms,t,this.flags)}compress(e){let t=Object.assign({},this.flags,{compress:e});return new i(this.adapter,this.rooms,this.exceptRooms,t)}get volatile(){let e=Object.assign({},this.flags,{volatile:!0});return new i(this.adapter,this.rooms,this.exceptRooms,e)}get local(){let e=Object.assign({},this.flags,{local:!0});return new i(this.adapter,this.rooms,this.exceptRooms,e)}timeout(e){let t=Object.assign({},this.flags,{timeout:e});return new i(this.adapter,this.rooms,this.exceptRooms,t)}emit(e,...t){if(m_.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],s={type:v_.PacketType.EVENT,data:n};if(!(typeof n[n.length-1]=="function"))return this.adapter.broadcast(s,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let o=n.pop(),a=!1,l=[],p=setTimeout(()=>{a=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:l])},this.flags.timeout),f=-1,v=0,_=0,E=()=>{!a&&f===v&&l.length===_&&(clearTimeout(p),o.apply(this,[null,this.flags.expectSingleResponse?l[0]:l]))};return this.adapter.broadcastWithAck(s,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},C=>{_+=C,v++,E()},C=>{l.push(C),E()}),this.adapter.serverCount().then(C=>{f=C,E()}),!0}emitWithAck(e,...t){return new Promise((n,s)=>{t.push((r,o)=>r?(r.responses=o,s(r)):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 yr(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)}};rn.BroadcastOperator=xr;var yr=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 xr(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}};rn.RemoteSocket=yr});var kc=T(on=>{"use strict";var Qf=on&&on.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(on,"__esModule",{value:!0});on.Socket=void 0;var yt=Zn(),g_=Qf(ie()),x_=vr(),Xf=Qf(ta()),y_=Sc(),b_=_c(),Ke=(0,g_.default)("socket.io:socket"),w_=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function Zf(){}var Ec=class extends x_.StrictEventEmitter{constructor(e,t,n,s){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,s?(this.id=s.sid,this.pid=s.pid,s.rooms.forEach(r=>this.join(r)),this.data=s.data,s.missedPackets.forEach(r=>{this.packet({type:yt.PacketType.EVENT,data:r})}),this.recovered=!0):(t.conn.protocol===3?this.id=e.name!=="/"?e.name+"#"+t.id:t.id:this.id=Xf.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=Xf.default.generateId())),this.handshake=this.buildHandshake(n),this.on("error",Zf)}buildHandshake(e){var t,n,s,r;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:(s=this.request)===null||s===void 0?void 0:s.url,query:((r=this.request)===null||r===void 0?void 0:r._query)||{},auth:e}}emit(e,...t){if(b_.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],s={type:yt.PacketType.EVENT,data:n};if(typeof n[n.length-1]=="function"){let o=this.nsp._ids++;Ke("emitting packet with ack id %d",o),this.registerAckCallback(o,n.pop()),s.id=o}let r=Object.assign({},this.flags);return this.flags={},this.nsp.server.opts.connectionStateRecovery?this.adapter.broadcast(s,{rooms:new Set([this.id]),except:new Set,flags:r}):(this.notifyOutgoingListeners(s),this.packet(s,r)),!0}emitWithAck(e,...t){let n=this.flags.timeout!==void 0;return new Promise((s,r)=>{t.push((o,a)=>n?o?r(o):s(a):s(o)),this.emit(e,...t)})}registerAckCallback(e,t){let n=this.flags.timeout;if(n===void 0){this.acks.set(e,t);return}let s=setTimeout(()=>{Ke("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,(...r)=>{clearTimeout(s),t.apply(this,[null,...r])})}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 Ke("join room %s",e),this.adapter.addAll(this.id,new Set(Array.isArray(e)?e:[e]))}leave(e){return Ke("leave room %s",e),this.adapter.del(this.id,e)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){Ke("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3?this.packet({type:yt.PacketType.CONNECT}):this.packet({type:yt.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(Ke("got packet %j",e),e.type){case yt.PacketType.EVENT:this.onevent(e);break;case yt.PacketType.BINARY_EVENT:this.onevent(e);break;case yt.PacketType.ACK:this.onack(e);break;case yt.PacketType.BINARY_ACK:this.onack(e);break;case yt.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(e){let t=e.data||[];if(Ke("emitting event %j",t),e.id!=null&&(Ke("attaching ack callback to event"),t.push(this.ack(e.id))),this._anyListeners&&this._anyListeners.length){let n=this._anyListeners.slice();for(let s of n)s.apply(this,t)}this.dispatch(t)}ack(e){let t=this,n=!1;return function(){if(n)return;let s=Array.prototype.slice.call(arguments);Ke("sending ack %j",s),t.packet({id:e,type:yt.PacketType.ACK,data:s}),n=!0}}onack(e){let t=this.acks.get(e.id);typeof t=="function"?(Ke("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),this.acks.delete(e.id)):Ke("bad ack %s",e.id)}ondisconnect(){Ke("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(e){this.emitReserved("error",e)}_onclose(e,t){if(!this.connected)return this;Ke("closing socket - reason %s",e),this.emitReserved("disconnecting",e,t),this.server._opts.connectionStateRecovery&&w_.has(e)&&(Ke("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=Zf}_error(e){this.packet({type:yt.PacketType.CONNECT_ERROR,data:e})}disconnect(e=!1){return this.connected?(e?this.client._disconnect():(this.packet({type:yt.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){Ke("dispatching an event %j",e),this.run(e,t=>{process.nextTick(()=>{if(t)return this._onerror(t);this.connected?super.emitUntyped.apply(this,e):Ke("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 s(r){n[r](e,o=>{if(o)return t(o);if(!n[r+1])return t();s(r+1)})}s(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 y_.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}};on.Socket=Ec});var Tc=T(ei=>{"use strict";var __=ei&&ei.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ei,"__esModule",{value:!0});ei.Namespace=ei.RESERVED_EVENTS=void 0;var eh=kc(),S_=vr(),E_=__(ie()),pt=Sc(),an=(0,E_.default)("socket.io:namespace");ei.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);var Cc=class extends S_.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=>{an("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 s(r){n[r](e,o=>{if(o)return t(o);if(!n[r+1])return t();s(r+1)})}s(0)}to(e){return new pt.BroadcastOperator(this.adapter).to(e)}in(e){return new pt.BroadcastOperator(this.adapter).in(e)}except(e){return new pt.BroadcastOperator(this.adapter).except(e)}async _add(e,t,n){var s;an("adding socket to nsp %s",this.name);let r=await this._createSocket(e,t);if(this._preConnectSockets.set(r.id,r),!((s=this.server.opts.connectionStateRecovery)===null||s===void 0)&&s.skipMiddlewares&&r.recovered&&e.conn.readyState==="open")return this._doConnect(r,n);this.run(r,o=>{process.nextTick(()=>{if(e.conn.readyState!=="open"){an("next called after client was closed - ignoring socket"),r._cleanup();return}if(o)return an("middleware error, sending CONNECT_ERROR packet to the client"),r._cleanup(),e.conn.protocol===3?r._error(o.data||o.message):r._error({message:o.message,data:o.data});this._doConnect(r,n)})})}async _createSocket(e,t){let n=t.pid,s=t.offset;if(this.server.opts.connectionStateRecovery&&typeof n=="string"&&typeof s=="string"){let r;try{r=await this.adapter.restoreSession(n,s)}catch(o){an("error while restoring session: %s",o)}if(r)return an("connection state recovered for sid %s",r.sid),new eh.Socket(this,e,t,r)}return new eh.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 pt.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(ei.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,s)=>{t.push((r,o)=>r?(r.responses=o,s(r)):n(o)),this.serverSideEmit(e,...t)})}_onServerSideEmit(e){super.emitUntyped.apply(this,e)}allSockets(){return new pt.BroadcastOperator(this.adapter).allSockets()}compress(e){return new pt.BroadcastOperator(this.adapter).compress(e)}get volatile(){return new pt.BroadcastOperator(this.adapter).volatile}get local(){return new pt.BroadcastOperator(this.adapter).local}timeout(e){return new pt.BroadcastOperator(this.adapter).timeout(e)}fetchSockets(){return new pt.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(e){return new pt.BroadcastOperator(this.adapter).socketsJoin(e)}socketsLeave(e){return new pt.BroadcastOperator(this.adapter).socketsLeave(e)}disconnectSockets(e=!1){return new pt.BroadcastOperator(this.adapter).disconnectSockets(e)}};ei.Namespace=Cc});var rh=T(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.encode=Mc;Qn.decode=k_;Qn.yeast=C_;var nh="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),br=64,sh={},th=0,di=0,ih;function Mc(i){let e="";do e=nh[i%br]+e,i=Math.floor(i/br);while(i>0);return e}function k_(i){let e=0;for(di=0;di<i.length;di++)e=e*br+sh[i.charAt(di)];return e}function C_(){let i=Mc(+new Date);return i!==ih?(th=0,ih=i):i+"."+Mc(th++)}for(;di<br;di++)sh[nh[di]]=di});var Rc=T(cn=>{"use strict";var Oc;Object.defineProperty(cn,"__esModule",{value:!0});cn.SessionAwareAdapter=cn.Adapter=void 0;var T_=require("events"),M_=rh(),wr=nc(),O_=typeof((Oc=wr?.Sender)===null||Oc===void 0?void 0:Oc.frame)=="function",_r=class extends T_.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||{},s={preEncoded:!0,volatile:n.volatile,compress:n.compress};e.nsp=this.nsp.name;let r=this._encode(e,s);this.apply(t,o=>{typeof o.notifyOutgoingListeners=="function"&&o.notifyOutgoingListeners(e),o.client.writeToEngine(r,s)})}broadcastWithAck(e,t,n,s){let r=t.flags||{},o={preEncoded:!0,volatile:r.volatile,compress:r.compress};e.nsp=this.nsp.name,e.id=this.nsp._ids++;let a=this._encode(e,o),l=0;this.apply(t,p=>{l++,p.acks.set(e.id,s),typeof p.notifyOutgoingListeners=="function"&&p.notifyOutgoingListeners(e),p.client.writeToEngine(a,o)}),n(l)}_encode(e,t){let n=this.encoder.encode(e);if(O_&&n.length===1&&typeof n[0]=="string"){let s=Buffer.from("4"+n[0]);t.wsPreEncodedFrame=wr.Sender.frame(s,{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(s=>n.leave(s))})}disconnectSockets(e,t){this.apply(e,n=>{n.disconnect(t)})}apply(e,t){let n=e.rooms,s=this.computeExceptSids(e.except);if(n.size){let r=new Set;for(let o of n)if(this.rooms.has(o))for(let a of this.rooms.get(o)){if(r.has(a)||s.has(a))continue;let l=this.nsp.sockets.get(a);l&&(t(l),r.add(a))}}else for(let[r]of this.sids){if(s.has(r))continue;let o=this.nsp.sockets.get(r);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(s=>t.add(s));return t}serverSideEmit(e){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(e){}restoreSession(e,t){return null}};cn.Adapter=_r;var Ac=class extends _r{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((s,r)=>{s.disconnectedAt<n&&this.sessions.delete(r)});for(let s=this.packets.length-1;s>=0;s--)if(this.packets[s].emittedAt<n){this.packets.splice(0,s+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 r=this.packets.findIndex(a=>a.id===t);if(r===-1)return null;let o=[];for(let a=r+1;a<this.packets.length;a++){let l=this.packets[a];A_(n.rooms,l.opts)&&o.push(l.data)}return Promise.resolve(Object.assign(Object.assign({},n),{missedPackets:o}))}broadcast(e,t){var n;let s=e.type===2,r=e.id===void 0,o=((n=t.flags)===null||n===void 0?void 0:n.volatile)===void 0;if(s&&r&&o){let a=(0,M_.yeast)();e.data.push(a),this.packets.push({id:a,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};cn.SessionAwareAdapter=Ac;function A_(i,e){let t=e.rooms.size===0||i.some(s=>e.rooms.has(s)),n=i.every(s=>!e.except.has(s));return t&&n}});var oh=T(Ft=>{"use strict";var R_=Ft&&Ft.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.ClusterAdapterWithHeartbeat=Ft.ClusterAdapter=Ft.MessageType=void 0;var P_=Rc(),B_=ie(),j_=require("crypto"),Q=(0,B_.debug)("socket.io-adapter"),N_="emitter",Sr=5e3;function un(){return(0,j_.randomBytes)(8).toString("hex")}var I;(function(i){i[i.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",i[i.HEARTBEAT=2]="HEARTBEAT",i[i.BROADCAST=3]="BROADCAST",i[i.SOCKETS_JOIN=4]="SOCKETS_JOIN",i[i.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",i[i.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",i[i.FETCH_SOCKETS=7]="FETCH_SOCKETS",i[i.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",i[i.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",i[i.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",i[i.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",i[i.BROADCAST_ACK=12]="BROADCAST_ACK",i[i.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"})(I||(Ft.MessageType=I={}));function Oi(i){return{rooms:[...i.rooms],except:[...i.except],flags:i.flags}}function ln(i){return{rooms:new Set(i.rooms),except:new Set(i.except),flags:i.flags}}var Er=class extends P_.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=un()}onMessage(e,t){if(e.uid===this.uid)return Q("[%s] ignore message from self",this.uid);if(e.nsp!==this.nsp.name)return Q("[%s] ignore message from another namespace (%s)",this.uid,e.nsp);switch(Q("[%s] new event of type %d from %s",this.uid,e.type,e.uid),e.type){case I.BROADCAST:{if(e.data.requestId!==void 0)super.broadcastWithAck(e.data.packet,ln(e.data.opts),s=>{Q("[%s] waiting for %d client acknowledgements",this.uid,s),this.publishResponse(e.uid,{type:I.BROADCAST_CLIENT_COUNT,data:{requestId:e.data.requestId,clientCount:s}})},s=>{Q("[%s] received acknowledgement with value %j",this.uid,s),this.publishResponse(e.uid,{type:I.BROADCAST_ACK,data:{requestId:e.data.requestId,packet:s}})});else{let s=e.data.packet,r=ln(e.data.opts);this.addOffsetIfNecessary(s,r,t),super.broadcast(s,r)}break}case I.SOCKETS_JOIN:super.addSockets(ln(e.data.opts),e.data.rooms);break;case I.SOCKETS_LEAVE:super.delSockets(ln(e.data.opts),e.data.rooms);break;case I.DISCONNECT_SOCKETS:super.disconnectSockets(ln(e.data.opts),e.data.close);break;case I.FETCH_SOCKETS:{Q("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(ln(e.data.opts)).then(n=>{this.publishResponse(e.uid,{type:I.FETCH_SOCKETS_RESPONSE,data:{requestId:e.data.requestId,sockets:n.map(s=>{let r=s.handshake,{sessionStore:o}=r,a=R_(r,["sessionStore"]);return{id:s.id,handshake:a,rooms:[...s.rooms],data:s.data}})}})});break}case I.SERVER_SIDE_EMIT:{let n=e.data.packet;if(!(e.data.requestId!==void 0)){this.nsp._onServerSideEmit(n);return}let r=!1,o=a=>{r||(r=!0,Q("[%s] calling acknowledgement with %j",this.uid,a),this.publishResponse(e.uid,{type:I.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:e.data.requestId,packet:a}}))};this.nsp._onServerSideEmit([...n,o]);break}case I.BROADCAST_CLIENT_COUNT:case I.BROADCAST_ACK:case I.FETCH_SOCKETS_RESPONSE:case I.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(e);break;default:Q("[%s] unknown message type: %s",this.uid,e.type)}}onResponse(e){var t,n;let s=e.data.requestId;switch(Q("[%s] received response %s to request %s",this.uid,e.type,s),e.type){case I.BROADCAST_CLIENT_COUNT:{(t=this.ackRequests.get(s))===null||t===void 0||t.clientCountCallback(e.data.clientCount);break}case I.BROADCAST_ACK:{(n=this.ackRequests.get(s))===null||n===void 0||n.ack(e.data.packet);break}case I.FETCH_SOCKETS_RESPONSE:{let r=this.requests.get(s);if(!r)return;r.current++,e.data.sockets.forEach(o=>r.responses.push(o)),r.current===r.expected&&(clearTimeout(r.timeout),r.resolve(r.responses),this.requests.delete(s));break}case I.SERVER_SIDE_EMIT_RESPONSE:{let r=this.requests.get(s);if(!r)return;r.current++,r.responses.push(e.data.packet),r.current===r.expected&&(clearTimeout(r.timeout),r.resolve(null,r.responses),this.requests.delete(s));break}default:Q("[%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 r=await this.publishAndReturnOffset({type:I.BROADCAST,data:{packet:e,opts:Oi(t)}});this.addOffsetIfNecessary(e,t,r)}catch(r){return Q("[%s] error while broadcasting message: %s",this.uid,r.message)}super.broadcast(e,t)}addOffsetIfNecessary(e,t,n){var s;if(!this.nsp.server.opts.connectionStateRecovery)return;let r=e.type===2,o=e.id===void 0,a=((s=t.flags)===null||s===void 0?void 0:s.volatile)===void 0;r&&o&&a&&e.data.push(n)}broadcastWithAck(e,t,n,s){var r;if(!((r=t?.flags)===null||r===void 0?void 0:r.local)){let a=un();this.ackRequests.set(a,{clientCountCallback:n,ack:s}),this.publish({type:I.BROADCAST,data:{packet:e,requestId:a,opts:Oi(t)}}),setTimeout(()=>{this.ackRequests.delete(a)},t.flags.timeout)}super.broadcastWithAck(e,t,n,s)}async addSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:I.SOCKETS_JOIN,data:{opts:Oi(e),rooms:t}})}catch(r){Q("[%s] error while publishing message: %s",this.uid,r.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:I.SOCKETS_LEAVE,data:{opts:Oi(e),rooms:t}})}catch(r){Q("[%s] error while publishing message: %s",this.uid,r.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:I.DISCONNECT_SOCKETS,data:{opts:Oi(e),close:t}})}catch(r){Q("[%s] error while publishing message: %s",this.uid,r.message)}super.disconnectSockets(e,t)}async fetchSockets(e){var t;let[n,s]=await Promise.all([super.fetchSockets(e),this.serverCount()]),r=s-1;if(!((t=e.flags)===null||t===void 0)&&t.local||r<=0)return n;let o=un();return new Promise((a,l)=>{let p=setTimeout(()=>{let v=this.requests.get(o);v&&(l(new Error(`timeout reached: only ${v.current} responses received out of ${v.expected}`)),this.requests.delete(o))},e.flags.timeout||Sr),f={type:I.FETCH_SOCKETS,resolve:a,timeout:p,current:0,expected:r,responses:n};this.requests.set(o,f),this.publish({type:I.FETCH_SOCKETS,data:{opts:Oi(e),requestId:o}})})}async serverSideEmit(e){if(!(typeof e[e.length-1]=="function"))return this.publish({type:I.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),s=await this.serverCount()-1;if(Q('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,s),s<=0)return n(null,[]);let r=un(),o=setTimeout(()=>{let l=this.requests.get(r);l&&(n(new Error(`timeout reached: only ${l.current} responses received out of ${l.expected}`),l.responses),this.requests.delete(r))},Sr),a={type:I.SERVER_SIDE_EMIT,resolve:n,timeout:o,current:0,expected:s,responses:[]};this.requests.set(r,a),this.publish({type:I.SERVER_SIDE_EMIT,data:{requestId:r,packet:e}})}publish(e){Q("[%s] sending message %s",this.uid,e.type),this.publishAndReturnOffset(e).catch(t=>{Q("[%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,Q("[%s] sending response %s to %s",this.uid,t.type,e),this.doPublishResponse(e,t).catch(n=>{Q("[%s] error while publishing response: %s",this.uid,n)})}};Ft.ClusterAdapter=Er;var Pc=class extends Er{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((s,r)=>{n-s>this._opts.heartbeatTimeout&&(Q("[%s] node %s seems down",this.uid,r),this.removeNode(r))})},1e3)}init(){this.publish({type:I.INITIAL_HEARTBEAT})}scheduleHeartbeat(){this.heartbeatTimer?this.heartbeatTimer.refresh():this.heartbeatTimer=setTimeout(()=>{this.publish({type:I.HEARTBEAT})},this._opts.heartbeatInterval)}close(){this.publish({type:I.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer&&clearInterval(this.cleanupTimer)}onMessage(e,t){if(e.uid===this.uid)return Q("[%s] ignore message from self",this.uid);switch(e.uid&&e.uid!==N_&&this.nodesMap.set(e.uid,Date.now()),e.type){case I.INITIAL_HEARTBEAT:this.publish({type:I.HEARTBEAT});break;case I.HEARTBEAT:break;case I.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:I.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),s=this.nodesMap.size;if(Q('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,s),s<=0)return n(null,[]);let r=un(),o=setTimeout(()=>{let l=this.customRequests.get(r);l&&(n(new Error(`timeout reached: missing ${l.missingUids.size} responses`),l.responses),this.customRequests.delete(r))},Sr),a={type:I.SERVER_SIDE_EMIT,resolve:n,timeout:o,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(r,a),this.publish({type:I.SERVER_SIDE_EMIT,data:{requestId:r,packet:e}})}async fetchSockets(e){var t;let[n,s]=await Promise.all([super.fetchSockets({rooms:e.rooms,except:e.except,flags:{local:!0}}),this.serverCount()]),r=s-1;if(!((t=e.flags)===null||t===void 0)&&t.local||r<=0)return n;let o=un();return new Promise((a,l)=>{let p=setTimeout(()=>{let v=this.customRequests.get(o);v&&(l(new Error(`timeout reached: missing ${v.missingUids.size} responses`)),this.customRequests.delete(o))},e.flags.timeout||Sr),f={type:I.FETCH_SOCKETS,resolve:a,timeout:p,missingUids:new Set([...this.nodesMap.keys()]),responses:n};this.customRequests.set(o,f),this.publish({type:I.FETCH_SOCKETS,data:{opts:Oi(e),requestId:o}})})}onResponse(e){let t=e.data.requestId;switch(Q("[%s] received response %s to request %s",this.uid,e.type,t),e.type){case I.FETCH_SOCKETS_RESPONSE:{let n=this.customRequests.get(t);if(!n)return;e.data.sockets.forEach(s=>n.responses.push(s)),n.missingUids.delete(e.uid),n.missingUids.size===0&&(clearTimeout(n.timeout),n.resolve(n.responses),this.customRequests.delete(t));break}case I.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===I.FETCH_SOCKETS?t.resolve(t.responses):t.type===I.SERVER_SIDE_EMIT&&t.resolve(null,t.responses),this.customRequests.delete(n))}),this.nodesMap.delete(e)}};Ft.ClusterAdapterWithHeartbeat=Pc});var kr=T(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.MessageType=bt.ClusterAdapterWithHeartbeat=bt.ClusterAdapter=bt.SessionAwareAdapter=bt.Adapter=void 0;var ah=Rc();Object.defineProperty(bt,"Adapter",{enumerable:!0,get:function(){return ah.Adapter}});Object.defineProperty(bt,"SessionAwareAdapter",{enumerable:!0,get:function(){return ah.SessionAwareAdapter}});var Bc=oh();Object.defineProperty(bt,"ClusterAdapter",{enumerable:!0,get:function(){return Bc.ClusterAdapter}});Object.defineProperty(bt,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return Bc.ClusterAdapterWithHeartbeat}});Object.defineProperty(bt,"MessageType",{enumerable:!0,get:function(){return Bc.MessageType}})});var uh=T(pn=>{"use strict";var I_=pn&&pn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(pn,"__esModule",{value:!0});pn.ParentNamespace=void 0;var ch=Tc(),D_=kr(),q_=I_(ie()),lh=(0,q_.default)("socket.io:parent-namespace"),Cr=class i extends ch.Namespace{constructor(e){super(e,"/_"+i.count++),this.children=new Set}_initAdapter(){this.adapter=new jc(this)}emit(e,...t){return this.children.forEach(n=>{n.emit(e,...t)}),!0}createChild(e){lh("creating child namespace %s",e);let t=new ch.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=s=>{n.call(t,s),t.sockets.size===0&&(lh("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")}};pn.ParentNamespace=Cr;Cr.count=0;var jc=class extends D_.Adapter{broadcast(e,t){this.nsp.children.forEach(n=>{n.adapter.broadcast(e,t)})}}});var vh=T(Ri=>{"use strict";var L_=Ri&&Ri.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.patchAdapter=U_;Ri.restoreAdapter=H_;Ri.serveFile=$_;var Ai=kr(),ph=require("fs"),F_=L_(ie()),Tr=(0,F_.default)("socket.io:adapter-uws"),Nc="",{addAll:fh,del:hh,broadcast:mh}=Ai.Adapter.prototype;function U_(i){Ai.Adapter.prototype.addAll=function(e,t){let n=!this.sids.has(e);fh.call(this,e,t);let s=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(s){if(s.conn.transport.name==="websocket"){dh(this.nsp.name,s,n,t);return}n&&s.conn.on("upgrade",()=>{let r=this.sids.get(e);r&&dh(this.nsp.name,s,n,r)})}},Ai.Adapter.prototype.del=function(e,t){hh.call(this,e,t);let n=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(n&&n.conn.transport.name==="websocket"){let s=n.conn.id,r=n.conn.transport.socket,o=`${this.nsp.name}${Nc}${t}`;Tr("unsubscribe connection %s from topic %s",s,o),r.unsubscribe(o)}},Ai.Adapter.prototype.broadcast=function(e,t){if(!(t.rooms.size<=1&&t.except.size===0)){mh.call(this,e,t);return}let s=t.flags||{},r={preEncoded:!0,volatile:s.volatile,compress:s.compress};e.nsp=this.nsp.name;let o=this.encoder.encode(e),a=t.rooms.size===0?this.nsp.name:`${this.nsp.name}${Nc}${t.rooms.keys().next().value}`;Tr("fast publish to %s",a),o.forEach(l=>{let p=typeof l!="string";i.publish(a,p?l:"4"+l,p)}),this.apply(t,l=>{l.conn.transport.name!=="websocket"&&l.client.writeToEngine(o,r)})}}function dh(i,e,t,n){let s=e.conn.id,r=e.conn.transport.socket;t&&(Tr("subscribe connection %s to topic %s",s,i),r.subscribe(i)),n.forEach(o=>{let a=`${i}${Nc}${o}`;Tr("subscribe connection %s to topic %s",s,a),r.subscribe(a)})}function H_(){Ai.Adapter.prototype.addAll=fh,Ai.Adapter.prototype.del=hh,Ai.Adapter.prototype.broadcast=mh}var z_=i=>{let{buffer:e,byteOffset:t,byteLength:n}=i;return e.slice(t,t+n)};function $_(i,e){let{size:t}=(0,ph.statSync)(e),n=(0,ph.createReadStream)(e),s=()=>!n.destroyed&&n.destroy(),r=a=>{throw s(),a},o=a=>{let l=z_(a);i.cork(()=>{let p=i.getWriteOffset(),[f,v]=i.tryEnd(l,t);!v&&!f&&(n.pause(),i.onWritable(_=>{let[E,C]=i.tryEnd(l.slice(_-p),t);return!C&&E&&n.resume(),E}))})};i.onAborted(s),n.on("data",o).on("error",r).on("end",s)}});var gh=T((_T,W_)=>{W_.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 kh=T((Ge,es)=>{"use strict";var V_=Ge&&Ge.__createBinding||(Object.create?(function(i,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,s)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),K_=Ge&&Ge.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),G_=Ge&&Ge.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&V_(e,i,t);return K_(e,i),e},qc=Ge&&Ge.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.Namespace=Ge.Socket=Ge.Server=void 0;var Y_=qc(require("http")),J_=require("fs"),Ic=require("zlib"),X_=Ms(),Mr=require("stream"),xh=require("path"),yh=Uf(),Z_=Jf(),bh=require("events"),Lc=Tc();Object.defineProperty(Ge,"Namespace",{enumerable:!0,get:function(){return Lc.Namespace}});var Q_=uh(),wh=kr(),eS=G_(Zn()),tS=qc(ie()),Eh=kc();Object.defineProperty(Ge,"Socket",{enumerable:!0,get:function(){return Eh.Socket}});var iS=vr(),Dc=vh(),nS=qc(rc()),Ze=(0,tS.default)("socket.io:server"),_h=gh().version,Sh=/\.map/,dn=class i extends iS.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||eS,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||wh.SessionAwareAdapter)):this.adapter(t.adapter||wh.Adapter),t.cleanupEmptyChildNamespaces=!!t.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),(e||typeof e=="number")&&this.attach(e),this.opts.cors&&(this._corsMiddleware=(0,nS.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 s=this.parentNsps.keys(),r=()=>{let o=s.next();if(o.done)return n(!1);o.value(e,t,(a,l)=>{if(a||!l)return r();if(this._nsps.has(e))return Ze("dynamic namespace %s already exists",e),n(this._nsps.get(e));let p=this.parentNsps.get(o.value).createChild(e);Ze("dynamic namespace %s was created",e),n(p)})};r()}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"){Ze("creating http server and binding to %d",e);let n=e;e=Y_.default.createServer((s,r)=>{r.writeHead(404),r.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,Ze("creating uWebSockets.js-based engine with opts %j",t);let n=new yh.uServer(t);n.attach(e,t),this.bind(n),this._serveClient&&e.get(`${this._path}/*`,(s,r)=>{if(!this.clientPathRegex.test(r.getUrl())){r.setYield(!0);return}let o=r.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),a=Sh.test(o),l=a?"map":"source",p='"'+_h+'"',f="W/"+p,v=r.getHeader("if-none-match");if(v&&(p===v||f===v)){Ze("serve client %s 304",l),s.writeStatus("304 Not Modified"),s.end();return}Ze("serve client %s",l),s.writeHeader("cache-control","public, max-age=0"),s.writeHeader("content-type","application/"+(a?"json":"javascript")+"; charset=utf-8"),s.writeHeader("etag",p);let _=xh.join(__dirname,"../client-dist/",o);(0,Dc.serveFile)(s,_)}),(0,Dc.patchAdapter)(e)}initEngine(e,t){Ze("creating engine.io instance with opts %j",t),this.eio=(0,yh.attach)(e,t),this._serveClient&&this.attachServe(e),this.httpServer=e,this.bind(this.eio)}attachServe(e){Ze("attaching client serving req handler");let t=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("request",(n,s)=>{if(this.clientPathRegex.test(n.url))this._corsMiddleware?this._corsMiddleware(n,s,()=>{this.serve(n,s)}):this.serve(n,s);else for(let r=0;r<t.length;r++)t[r].call(e,n,s)})}serve(e,t){let n=e.url.replace(this._path,"").replace(/\?.*$/,""),s=Sh.test(n),r=s?"map":"source",o='"'+_h+'"',a="W/"+o,l=e.headers["if-none-match"];if(l&&(o===l||a===l)){Ze("serve client %s 304",r),t.writeHead(304),t.end();return}Ze("serve client %s",r),t.setHeader("Cache-Control","public, max-age=0"),t.setHeader("Content-Type","application/"+(s?"json":"javascript")+"; charset=utf-8"),t.setHeader("ETag",o),i.sendFile(n,e,t)}static sendFile(e,t,n){let s=(0,J_.createReadStream)(xh.join(__dirname,"../client-dist/",e)),r=X_(t).encodings(["br","gzip","deflate"]),o=a=>{a&&n.end()};switch(r){case"br":n.writeHead(200,{"content-encoding":"br"}),(0,Mr.pipeline)(s,(0,Ic.createBrotliCompress)(),n,o);break;case"gzip":n.writeHead(200,{"content-encoding":"gzip"}),(0,Mr.pipeline)(s,(0,Ic.createGzip)(),n,o);break;case"deflate":n.writeHead(200,{"content-encoding":"deflate"}),(0,Mr.pipeline)(s,(0,Ic.createDeflate)(),n,o);break;default:n.writeHead(200),(0,Mr.pipeline)(s,n,o)}}bind(e){return this.engine=e,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(e){Ze("incoming connection with id %s",e.id);let t=new Z_.Client(this,e);return e.protocol===3&&t.connect("/"),this}of(e,t){if(typeof e=="function"||e instanceof RegExp){let s=new Q_.ParentNamespace(this);return Ze("initializing parent namespace %s",s.name),typeof e=="function"?this.parentNsps.set(e,s):(this.parentNsps.set((r,o,a)=>a(null,e.test(r)),s),this.parentNamespacesFromRegExp.set(e,s)),t&&s.on("connect",t),s}String(e)[0]!=="/"&&(e="/"+e);let n=this._nsps.get(e);if(!n){for(let[s,r]of this.parentNamespacesFromRegExp)if(s.test(e))return Ze("attaching namespace %s to parent namespace %s",e,s),r.createChild(e);Ze("initializing namespace %s",e),n=new Lc.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,Dc.restoreAdapter)(),this.httpServer)return new Promise(t=>{this.httpServer.close(n=>{e&&e(n),n&&Ze("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)}};Ge.Server=dn;var sS=Object.keys(bh.EventEmitter.prototype).filter(function(i){return typeof bh.EventEmitter.prototype[i]=="function"});sS.forEach(function(i){dn.prototype[i]=function(){return this.sockets[i].apply(this.sockets,arguments)}});es.exports=(i,e)=>new dn(i,e);es.exports.Server=dn;es.exports.Namespace=Lc.Namespace;es.exports.Socket=Eh.Socket});var Oh=T((CT,Mh)=>{"use strict";Mh.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Fc=T((TT,Rh)=>{var ts=Oh(),Ah={};for(let i of Object.keys(ts))Ah[ts[i]]=i;var R={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Rh.exports=R;for(let i of Object.keys(R)){if(!("channels"in R[i]))throw new Error("missing channels property: "+i);if(!("labels"in R[i]))throw new Error("missing channel labels property: "+i);if(R[i].labels.length!==R[i].channels)throw new Error("channel and label counts mismatch: "+i);let{channels:e,labels:t}=R[i];delete R[i].channels,delete R[i].labels,Object.defineProperty(R[i],"channels",{value:e}),Object.defineProperty(R[i],"labels",{value:t})}R.rgb.hsl=function(i){let e=i[0]/255,t=i[1]/255,n=i[2]/255,s=Math.min(e,t,n),r=Math.max(e,t,n),o=r-s,a,l;r===s?a=0:e===r?a=(t-n)/o:t===r?a=2+(n-e)/o:n===r&&(a=4+(e-t)/o),a=Math.min(a*60,360),a<0&&(a+=360);let p=(s+r)/2;return r===s?l=0:p<=.5?l=o/(r+s):l=o/(2-r-s),[a,l*100,p*100]};R.rgb.hsv=function(i){let e,t,n,s,r,o=i[0]/255,a=i[1]/255,l=i[2]/255,p=Math.max(o,a,l),f=p-Math.min(o,a,l),v=function(_){return(p-_)/6/f+1/2};return f===0?(s=0,r=0):(r=f/p,e=v(o),t=v(a),n=v(l),o===p?s=n-t:a===p?s=1/3+e-n:l===p&&(s=2/3+t-e),s<0?s+=1:s>1&&(s-=1)),[s*360,r*100,p*100]};R.rgb.hwb=function(i){let e=i[0],t=i[1],n=i[2],s=R.rgb.hsl(i)[0],r=1/255*Math.min(e,Math.min(t,n));return n=1-1/255*Math.max(e,Math.max(t,n)),[s,r*100,n*100]};R.rgb.cmyk=function(i){let e=i[0]/255,t=i[1]/255,n=i[2]/255,s=Math.min(1-e,1-t,1-n),r=(1-e-s)/(1-s)||0,o=(1-t-s)/(1-s)||0,a=(1-n-s)/(1-s)||0;return[r*100,o*100,a*100,s*100]};function rS(i,e){return(i[0]-e[0])**2+(i[1]-e[1])**2+(i[2]-e[2])**2}R.rgb.keyword=function(i){let e=Ah[i];if(e)return e;let t=1/0,n;for(let s of Object.keys(ts)){let r=ts[s],o=rS(i,r);o<t&&(t=o,n=s)}return n};R.keyword.rgb=function(i){return ts[i]};R.rgb.xyz=function(i){let e=i[0]/255,t=i[1]/255,n=i[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let s=e*.4124+t*.3576+n*.1805,r=e*.2126+t*.7152+n*.0722,o=e*.0193+t*.1192+n*.9505;return[s*100,r*100,o*100]};R.rgb.lab=function(i){let e=R.rgb.xyz(i),t=e[0],n=e[1],s=e[2];t/=95.047,n/=100,s/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,s=s>.008856?s**(1/3):7.787*s+16/116;let r=116*n-16,o=500*(t-n),a=200*(n-s);return[r,o,a]};R.hsl.rgb=function(i){let e=i[0]/360,t=i[1]/100,n=i[2]/100,s,r,o;if(t===0)return o=n*255,[o,o,o];n<.5?s=n*(1+t):s=n+t-n*t;let a=2*n-s,l=[0,0,0];for(let p=0;p<3;p++)r=e+1/3*-(p-1),r<0&&r++,r>1&&r--,6*r<1?o=a+(s-a)*6*r:2*r<1?o=s:3*r<2?o=a+(s-a)*(2/3-r)*6:o=a,l[p]=o*255;return l};R.hsl.hsv=function(i){let e=i[0],t=i[1]/100,n=i[2]/100,s=t,r=Math.max(n,.01);n*=2,t*=n<=1?n:2-n,s*=r<=1?r:2-r;let o=(n+t)/2,a=n===0?2*s/(r+s):2*t/(n+t);return[e,a*100,o*100]};R.hsv.rgb=function(i){let e=i[0]/60,t=i[1]/100,n=i[2]/100,s=Math.floor(e)%6,r=e-Math.floor(e),o=255*n*(1-t),a=255*n*(1-t*r),l=255*n*(1-t*(1-r));switch(n*=255,s){case 0:return[n,l,o];case 1:return[a,n,o];case 2:return[o,n,l];case 3:return[o,a,n];case 4:return[l,o,n];case 5:return[n,o,a]}};R.hsv.hsl=function(i){let e=i[0],t=i[1]/100,n=i[2]/100,s=Math.max(n,.01),r,o;o=(2-t)*n;let a=(2-t)*s;return r=t*s,r/=a<=1?a:2-a,r=r||0,o/=2,[e,r*100,o*100]};R.hwb.rgb=function(i){let e=i[0]/360,t=i[1]/100,n=i[2]/100,s=t+n,r;s>1&&(t/=s,n/=s);let o=Math.floor(6*e),a=1-n;r=6*e-o,(o&1)!==0&&(r=1-r);let l=t+r*(a-t),p,f,v;switch(o){default:case 6:case 0:p=a,f=l,v=t;break;case 1:p=l,f=a,v=t;break;case 2:p=t,f=a,v=l;break;case 3:p=t,f=l,v=a;break;case 4:p=l,f=t,v=a;break;case 5:p=a,f=t,v=l;break}return[p*255,f*255,v*255]};R.cmyk.rgb=function(i){let e=i[0]/100,t=i[1]/100,n=i[2]/100,s=i[3]/100,r=1-Math.min(1,e*(1-s)+s),o=1-Math.min(1,t*(1-s)+s),a=1-Math.min(1,n*(1-s)+s);return[r*255,o*255,a*255]};R.xyz.rgb=function(i){let e=i[0]/100,t=i[1]/100,n=i[2]/100,s,r,o;return s=e*3.2406+t*-1.5372+n*-.4986,r=e*-.9689+t*1.8758+n*.0415,o=e*.0557+t*-.204+n*1.057,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,r=r>.0031308?1.055*r**(1/2.4)-.055:r*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=Math.min(Math.max(0,s),1),r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),[s*255,r*255,o*255]};R.xyz.lab=function(i){let e=i[0],t=i[1],n=i[2];e/=95.047,t/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let s=116*t-16,r=500*(e-t),o=200*(t-n);return[s,r,o]};R.lab.xyz=function(i){let e=i[0],t=i[1],n=i[2],s,r,o;r=(e+16)/116,s=t/500+r,o=r-n/200;let a=r**3,l=s**3,p=o**3;return r=a>.008856?a:(r-16/116)/7.787,s=l>.008856?l:(s-16/116)/7.787,o=p>.008856?p:(o-16/116)/7.787,s*=95.047,r*=100,o*=108.883,[s,r,o]};R.lab.lch=function(i){let e=i[0],t=i[1],n=i[2],s;s=Math.atan2(n,t)*360/2/Math.PI,s<0&&(s+=360);let o=Math.sqrt(t*t+n*n);return[e,o,s]};R.lch.lab=function(i){let e=i[0],t=i[1],s=i[2]/360*2*Math.PI,r=t*Math.cos(s),o=t*Math.sin(s);return[e,r,o]};R.rgb.ansi16=function(i,e=null){let[t,n,s]=i,r=e===null?R.rgb.hsv(i)[2]:e;if(r=Math.round(r/50),r===0)return 30;let o=30+(Math.round(s/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return r===2&&(o+=60),o};R.hsv.ansi16=function(i){return R.rgb.ansi16(R.hsv.rgb(i),i[2])};R.rgb.ansi256=function(i){let e=i[0],t=i[1],n=i[2];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)};R.ansi16.rgb=function(i){let e=i%10;if(e===0||e===7)return i>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let t=(~~(i>50)+1)*.5,n=(e&1)*t*255,s=(e>>1&1)*t*255,r=(e>>2&1)*t*255;return[n,s,r]};R.ansi256.rgb=function(i){if(i>=232){let r=(i-232)*10+8;return[r,r,r]}i-=16;let e,t=Math.floor(i/36)/5*255,n=Math.floor((e=i%36)/6)/5*255,s=e%6/5*255;return[t,n,s]};R.rgb.hex=function(i){let t=(((Math.round(i[0])&255)<<16)+((Math.round(i[1])&255)<<8)+(Math.round(i[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t};R.hex.rgb=function(i){let e=i.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let t=e[0];e[0].length===3&&(t=t.split("").map(a=>a+a).join(""));let n=parseInt(t,16),s=n>>16&255,r=n>>8&255,o=n&255;return[s,r,o]};R.rgb.hcg=function(i){let e=i[0]/255,t=i[1]/255,n=i[2]/255,s=Math.max(Math.max(e,t),n),r=Math.min(Math.min(e,t),n),o=s-r,a,l;return o<1?a=r/(1-o):a=0,o<=0?l=0:s===e?l=(t-n)/o%6:s===t?l=2+(n-e)/o:l=4+(e-t)/o,l/=6,l%=1,[l*360,o*100,a*100]};R.hsl.hcg=function(i){let e=i[1]/100,t=i[2]/100,n=t<.5?2*e*t:2*e*(1-t),s=0;return n<1&&(s=(t-.5*n)/(1-n)),[i[0],n*100,s*100]};R.hsv.hcg=function(i){let e=i[1]/100,t=i[2]/100,n=e*t,s=0;return n<1&&(s=(t-n)/(1-n)),[i[0],n*100,s*100]};R.hcg.rgb=function(i){let e=i[0]/360,t=i[1]/100,n=i[2]/100;if(t===0)return[n*255,n*255,n*255];let s=[0,0,0],r=e%1*6,o=r%1,a=1-o,l=0;switch(Math.floor(r)){case 0:s[0]=1,s[1]=o,s[2]=0;break;case 1:s[0]=a,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=o;break;case 3:s[0]=0,s[1]=a,s[2]=1;break;case 4:s[0]=o,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=a}return l=(1-t)*n,[(t*s[0]+l)*255,(t*s[1]+l)*255,(t*s[2]+l)*255]};R.hcg.hsv=function(i){let e=i[1]/100,t=i[2]/100,n=e+t*(1-e),s=0;return n>0&&(s=e/n),[i[0],s*100,n*100]};R.hcg.hsl=function(i){let e=i[1]/100,n=i[2]/100*(1-e)+.5*e,s=0;return n>0&&n<.5?s=e/(2*n):n>=.5&&n<1&&(s=e/(2*(1-n))),[i[0],s*100,n*100]};R.hcg.hwb=function(i){let e=i[1]/100,t=i[2]/100,n=e+t*(1-e);return[i[0],(n-e)*100,(1-n)*100]};R.hwb.hcg=function(i){let e=i[1]/100,n=1-i[2]/100,s=n-e,r=0;return s<1&&(r=(n-s)/(1-s)),[i[0],s*100,r*100]};R.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]};R.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]};R.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]};R.gray.hsl=function(i){return[0,0,i[0]]};R.gray.hsv=R.gray.hsl;R.gray.hwb=function(i){return[0,100,i[0]]};R.gray.cmyk=function(i){return[0,0,0,i[0]]};R.gray.lab=function(i){return[i[0],0,0]};R.gray.hex=function(i){let e=Math.round(i[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};R.rgb.gray=function(i){return[(i[0]+i[1]+i[2])/3/255*100]}});var Bh=T((MT,Ph)=>{var Or=Fc();function oS(){let i={},e=Object.keys(Or);for(let t=e.length,n=0;n<t;n++)i[e[n]]={distance:-1,parent:null};return i}function aS(i){let e=oS(),t=[i];for(e[i].distance=0;t.length;){let n=t.pop(),s=Object.keys(Or[n]);for(let r=s.length,o=0;o<r;o++){let a=s[o],l=e[a];l.distance===-1&&(l.distance=e[n].distance+1,l.parent=n,t.unshift(a))}}return e}function cS(i,e){return function(t){return e(i(t))}}function lS(i,e){let t=[e[i].parent,i],n=Or[e[i].parent][i],s=e[i].parent;for(;e[s].parent;)t.unshift(e[s].parent),n=cS(Or[e[s].parent][s],n),s=e[s].parent;return n.conversion=t,n}Ph.exports=function(i){let e=aS(i),t={},n=Object.keys(e);for(let s=n.length,r=0;r<s;r++){let o=n[r];e[o].parent!==null&&(t[o]=lS(o,e))}return t}});var Nh=T((OT,jh)=>{var Uc=Fc(),uS=Bh(),fn={},pS=Object.keys(Uc);function dS(i){let e=function(...t){let n=t[0];return n==null?n:(n.length>1&&(t=n),i(t))};return"conversion"in i&&(e.conversion=i.conversion),e}function fS(i){let e=function(...t){let n=t[0];if(n==null)return n;n.length>1&&(t=n);let s=i(t);if(typeof s=="object")for(let r=s.length,o=0;o<r;o++)s[o]=Math.round(s[o]);return s};return"conversion"in i&&(e.conversion=i.conversion),e}pS.forEach(i=>{fn[i]={},Object.defineProperty(fn[i],"channels",{value:Uc[i].channels}),Object.defineProperty(fn[i],"labels",{value:Uc[i].labels});let e=uS(i);Object.keys(e).forEach(n=>{let s=e[n];fn[i][n]=fS(s),fn[i][n].raw=dS(s)})});jh.exports=fn});var Uh=T((AT,Fh)=>{"use strict";var Ih=(i,e)=>(...t)=>`\x1B[${i(...t)+e}m`,Dh=(i,e)=>(...t)=>{let n=i(...t);return`\x1B[${38+e};5;${n}m`},qh=(i,e)=>(...t)=>{let n=i(...t);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},Ar=i=>i,Lh=(i,e,t)=>[i,e,t],hn=(i,e,t)=>{Object.defineProperty(i,e,{get:()=>{let n=t();return Object.defineProperty(i,e,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},Hc,mn=(i,e,t,n)=>{Hc===void 0&&(Hc=Nh());let s=n?10:0,r={};for(let[o,a]of Object.entries(Hc)){let l=o==="ansi16"?"ansi":o;o===e?r[l]=i(t,s):typeof a=="object"&&(r[l]=i(a[e],s))}return r};function hS(){let i=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[t,n]of Object.entries(e)){for(let[s,r]of Object.entries(n))e[s]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[s]=e[s],i.set(r[0],r[1]);Object.defineProperty(e,t,{value:n,enumerable:!1})}return Object.defineProperty(e,"codes",{value:i,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",hn(e.color,"ansi",()=>mn(Ih,"ansi16",Ar,!1)),hn(e.color,"ansi256",()=>mn(Dh,"ansi256",Ar,!1)),hn(e.color,"ansi16m",()=>mn(qh,"rgb",Lh,!1)),hn(e.bgColor,"ansi",()=>mn(Ih,"ansi16",Ar,!0)),hn(e.bgColor,"ansi256",()=>mn(Dh,"ansi256",Ar,!0)),hn(e.bgColor,"ansi16m",()=>mn(qh,"rgb",Lh,!0)),e}Object.defineProperty(Fh,"exports",{enumerable:!0,get:hS})});var zh=T((RT,Hh)=>{"use strict";var mS=(i,e,t)=>{let n=i.indexOf(e);if(n===-1)return i;let s=e.length,r=0,o="";do o+=i.substr(r,n-r)+e+t,r=n+s,n=i.indexOf(e,r);while(n!==-1);return o+=i.substr(r),o},vS=(i,e,t,n)=>{let s=0,r="";do{let o=i[n-1]==="\r";r+=i.substr(s,(o?n-1:n)-s)+e+(o?`\r
|
|
20
|
+
`+n)}i.destroy()}var ir=[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 r_(i){if(i+="",i.length<1)return!1;if(!ir[i.charCodeAt(0)])return q('invalid header, index 0, char "%s"',i.charCodeAt(0)),!0;if(i.length<2)return!1;if(!ir[i.charCodeAt(1)])return q('invalid header, index 1, char "%s"',i.charCodeAt(1)),!0;if(i.length<3)return!1;if(!ir[i.charCodeAt(2)])return q('invalid header, index 2, char "%s"',i.charCodeAt(2)),!0;if(i.length<4)return!1;if(!ir[i.charCodeAt(3)])return q('invalid header, index 3, char "%s"',i.charCodeAt(3)),!0;for(let e=4;e<i.length;++e)if(!ir[i.charCodeAt(e)])return q('invalid header, index "%i", char "%s"',e,i.charCodeAt(e)),!0;return!1}});var Hf=C(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.Polling=void 0;var s_=ki(),Uf=require("zlib"),o_=Pr(),a_=se(),yt=(0,a_.default)("engine:polling"),c_={gzip:Uf.createGzip,deflate:Uf.createDeflate},gc=class extends s_.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){yt("request overlap"),this.onError("overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}yt("setting request"),this.req=e,this.res=t;let n=()=>{this.writable=!1,this.onError("poll connection closed prematurely")},r=()=>{this.req=this.res=null};e.cleanup=r,t.onAborted(n),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose&&(yt("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 p in a)t.writeHeader(p,String(a[p]));let l=p=>{this.onData(p.toString()),this.onDataRequestCleanup(),t.cork(()=>{t.end("ok")})};t.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),t.onData((p,f)=>{let m=o+p.byteLength;if(m>n){this.onError("content-length mismatch"),t.close();return}if(!s){if(f){l(Buffer.from(p));return}s=Buffer.allocUnsafe(n)}if(Buffer.from(p).copy(s,o),f){if(m!=n){this.onError("content-length mismatch"),t.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}l(s);return}o=m})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(e){yt('received "%s"',e);let t=n=>{if(n.type==="close")return yt("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&&(yt("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=n=>{let r=e.some(s=>s.options&&s.options.compress);this.write(n,{compress:r})};this.protocol===3?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){yt('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,n){let r=typeof e=="string",o={"Content-Type":r?"text/plain; charset=UTF-8":"application/octet-stream"},a=f=>{this.headers(this.req,o),this.res.cork(()=>{Object.keys(o).forEach(m=>{this.res.writeHeader(m,String(o[m]))}),this.res.end(f)}),n()};if(!this.httpCompression||!t.compress){a(e);return}if((r?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let p=o_(this.req).encodings(["gzip","deflate"]);if(!p){a(e);return}this.compress(e,p,(f,m)=>{if(f){this.res.writeStatus("500 Internal Server Error"),this.res.end(),n(f);return}o["Content-Encoding"]=p,a(m)})}compress(e,t,n){yt("compressing");let r=[],s=0;c_[t](this.httpCompression).on("error",n).on("data",function(o){r.push(o),s+=o.length}).on("end",function(){n(null,Buffer.concat(r,s))}).end(e)}doClose(e){yt("closing");let t,n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(yt("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(yt("transport discarded - closing right away"),n()):(yt("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}};ps.Polling=gc});var $f=C(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.WebSocket=void 0;var l_=ki(),u_=se(),zf=(0,u_.default)("engine:ws"),xc=class extends l_.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],r=t+1===e.length,s=o=>{let a=typeof o!="string",l=this.perMessageDeflate&&Buffer.byteLength(o)>this.perMessageDeflate.threshold;zf('writing "%s"',o),this.socket.send(o,a,l),r&&(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){zf("closing"),e&&e(),this.socket.end()}};ds.WebSocket=xc});var Wf=C(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});var p_=Hf(),d_=$f();yc.default={polling:p_.Polling,websocket:d_.WebSocket}});var Vf=C(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.uServer=void 0;var f_=se(),Ri=vc(),h_=Wf(),fi=(0,f_.default)("engine:uws"),bc=class extends Ri.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((r,s)=>{e.headers[r]=s}),e.connection={remoteAddress:Buffer.from(t.getRemoteAddressAsText()).toString()},t.onAborted(()=>{fi("response has been aborted")})}createTransport(e,t){return new h_.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:r=>{let s=r.getUserData().transport;s.socket=r,s.writable=!0,s.emit("ready")},message:(r,s,o)=>{r.getUserData().transport.onData(o?s:Buffer.from(s).toString())},close:(r,s,o)=>{r.getUserData().transport.onClose(s,o)}})}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return n();e.res=new wc(t),super._applyMiddlewares(e,e.res,r=>{e.res.writeHead(),n(r)})}handleRequest(e,t){fi('handling "%s" http request "%s"',t.getMethod(),t.getUrl()),this.prepare(t,e),t.res=e;let n=(r,s)=>{if(r!==void 0){this.emit("connection_error",{req:t,code:r,message:Ri.Server.errorMessages[r],context:s}),this.abortRequest(t.res,r,s);return}if(t._query.sid)fi("setting new request for existing client"),this.clients[t._query.sid].transport.onRequest(t);else{let o=(a,l)=>this.abortRequest(e,a,l);this.handshake(t._query.transport,t,o)}};this._applyMiddlewares(t,e,r=>{r?n(Ri.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,n)})}handleUpgrade(e,t,n){fi("on upgrade"),this.prepare(t,e),t.res=e;let r=async(s,o)=>{if(s!==void 0){this.emit("connection_error",{req:t,code:s,message:Ri.Server.errorMessages[s],context:o}),this.abortRequest(e,s,o);return}let a=t._query.sid,l;if(a){let p=this.clients[a];if(p){if(p.upgrading)return fi("transport has already been trying to upgrade"),e.close();if(p.upgraded)return fi("transport had already been upgraded"),e.close();fi("upgrading existing transport"),l=this.createTransport(t._query.transport,t),p._maybeUpgrade(l)}else return fi("upgrade attempt for closed client"),e.close()}else if(l=await this.handshake(t._query.transport,t,(p,f)=>this.abortRequest(e,p,f)),!l)return;t.res.writeStatus("101 Switching Protocols"),e.upgrade({transport:l},t.getHeader("sec-websocket-key"),t.getHeader("sec-websocket-protocol"),t.getHeader("sec-websocket-extensions"),n)};this._applyMiddlewares(t,e,s=>{s?r(Ri.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,r)})}abortRequest(e,t,n){let r=t===Ri.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",s=n&&n.message?n.message:Ri.Server.errorMessages[t];e.writeStatus(r),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:s}))}};fs.uServer=bc;var wc=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 Jf=C(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.protocol=Ve.Transport=Ve.Socket=Ve.uServer=Ve.parser=Ve.transports=Ve.Server=void 0;Ve.listen=b_;Ve.attach=Yf;var m_=require("http"),Kf=vc();Object.defineProperty(Ve,"Server",{enumerable:!0,get:function(){return Kf.Server}});var v_=Ra();Ve.transports=v_.default;var Gf=Kn();Ve.parser=Gf;var g_=Vf();Object.defineProperty(Ve,"uServer",{enumerable:!0,get:function(){return g_.uServer}});var x_=Ba();Object.defineProperty(Ve,"Socket",{enumerable:!0,get:function(){return x_.Socket}});var y_=ki();Object.defineProperty(Ve,"Transport",{enumerable:!0,get:function(){return y_.Transport}});Ve.protocol=Gf.protocol;function b_(i,e,t){typeof e=="function"&&(t=e,e={});let n=(0,m_.createServer)(function(s,o){o.writeHead(501),o.end("Not Implemented")}),r=Yf(n,e);return r.httpServer=n,n.listen(i,t),r}function Yf(i,e){let t=new Kf.Server(e);return t.attach(i,e),t}});var Zf=C(Xf=>{Xf.Emitter=Qe;function Qe(i){if(i)return w_(i)}function w_(i){for(var e in Qe.prototype)i[e]=Qe.prototype[e];return i}Qe.prototype.on=Qe.prototype.addEventListener=function(i,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(e),this};Qe.prototype.once=function(i,e){function t(){this.off(i,t),e.apply(this,arguments)}return t.fn=e,this.on(i,t),this};Qe.prototype.off=Qe.prototype.removeListener=Qe.prototype.removeAllListeners=Qe.prototype.removeEventListener=function(i,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+i];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+i],this;for(var n,r=0;r<t.length;r++)if(n=t[r],n===e||n.fn===e){t.splice(r,1);break}return t.length===0&&delete this._callbacks["$"+i],this};Qe.prototype.emit=function(i){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+i],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,r=t.length;n<r;++n)t[n].apply(this,e)}return this};Qe.prototype.emitReserved=Qe.prototype.emit;Qe.prototype.listeners=function(i){return this._callbacks=this._callbacks||{},this._callbacks["$"+i]||[]};Qe.prototype.hasListeners=function(i){return!!this.listeners(i).length}});var _c=C(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.isBinary=eh;ms.hasBinary=hs;var __=typeof ArrayBuffer=="function",S_=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i.buffer instanceof ArrayBuffer,Qf=Object.prototype.toString,E_=typeof Blob=="function"||typeof Blob<"u"&&Qf.call(Blob)==="[object BlobConstructor]",k_=typeof File=="function"||typeof File<"u"&&Qf.call(File)==="[object FileConstructor]";function eh(i){return __&&(i instanceof ArrayBuffer||S_(i))||E_&&i instanceof Blob||k_&&i instanceof File}function hs(i,e){if(!i||typeof i!="object")return!1;if(Array.isArray(i)){for(let t=0,n=i.length;t<n;t++)if(hs(i[t]))return!0;return!1}if(eh(i))return!0;if(i.toJSON&&typeof i.toJSON=="function"&&arguments.length===1)return hs(i.toJSON(),!0);for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)&&hs(i[t]))return!0;return!1}});var th=C(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.deconstructPacket=T_;vs.reconstructPacket=M_;var C_=_c();function T_(i){let e=[],t=i.data,n=i;return n.data=Sc(t,e),n.attachments=e.length,{packet:n,buffers:e}}function Sc(i,e){if(!i)return i;if((0,C_.isBinary)(i)){let t={_placeholder:!0,num:e.length};return e.push(i),t}else if(Array.isArray(i)){let t=new Array(i.length);for(let n=0;n<i.length;n++)t[n]=Sc(i[n],e);return t}else if(typeof i=="object"&&!(i instanceof Date)){let t={};for(let n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=Sc(i[n],e));return t}return i}function M_(i,e){return i.data=Ec(i.data,e),delete i.attachments,i}function Ec(i,e){if(!i)return i;if(i&&i._placeholder===!0){if(typeof i.num=="number"&&i.num>=0&&i.num<e.length)return e[i.num];throw new Error("illegal attachments")}else if(Array.isArray(i))for(let t=0;t<i.length;t++)i[t]=Ec(i[t],e);else if(typeof i=="object")for(let t in i)Object.prototype.hasOwnProperty.call(i,t)&&(i[t]=Ec(i[t],e));return i}});var nr=C(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.Decoder=Bt.Encoder=Bt.PacketType=Bt.protocol=void 0;Bt.isPacketValid=N_;var O_=Zf(),ih=th(),nh=_c(),A_=se(),kc=(0,A_.default)("socket.io-parser"),rh=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];Bt.protocol=5;var V;(function(i){i[i.CONNECT=0]="CONNECT",i[i.DISCONNECT=1]="DISCONNECT",i[i.EVENT=2]="EVENT",i[i.ACK=3]="ACK",i[i.CONNECT_ERROR=4]="CONNECT_ERROR",i[i.BINARY_EVENT=5]="BINARY_EVENT",i[i.BINARY_ACK=6]="BINARY_ACK"})(V||(Bt.PacketType=V={}));var Cc=class{constructor(e){this.replacer=e}encode(e){return kc("encoding packet %j",e),(e.type===V.EVENT||e.type===V.ACK)&&(0,nh.hasBinary)(e)?this.encodeAsBinary({type:e.type===V.EVENT?V.BINARY_EVENT:V.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===V.BINARY_EVENT||e.type===V.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)),kc("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,ih.deconstructPacket)(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}};Bt.Encoder=Cc;var Tc=class i extends O_.Emitter{constructor(e){super(),this.reviver=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===V.BINARY_EVENT;n||t.type===V.BINARY_ACK?(t.type=n?V.EVENT:V.ACK,this.reconstructor=new Mc(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,nh.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(V[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===V.BINARY_EVENT||n.type===V.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");n.attachments=Number(o)}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 r=e.charAt(t+1);if(r!==""&&Number(r)==r){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(i.isPayloadValid(n.type,s))n.data=s;else throw new Error("invalid payload")}return kc("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case V.CONNECT:return gs(t);case V.DISCONNECT:return t===void 0;case V.CONNECT_ERROR:return typeof t=="string"||gs(t);case V.EVENT:case V.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&rh.indexOf(t[0])===-1);case V.ACK:case V.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};Bt.Decoder=Tc;var Mc=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,ih.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function R_(i){return typeof i=="string"}var P_=Number.isInteger||function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i};function B_(i){return i===void 0||P_(i)}function gs(i){return Object.prototype.toString.call(i)==="[object Object]"}function j_(i,e){switch(i){case V.CONNECT:return e===void 0||gs(e);case V.DISCONNECT:return e===void 0;case V.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&rh.indexOf(e[0])===-1);case V.ACK:return Array.isArray(e);case V.CONNECT_ERROR:return typeof e=="string"||gs(e);default:return!1}}function N_(i){return R_(i.nsp)&&B_(i.id)&&j_(i.type,i.data)}});var sh=C(an=>{"use strict";var D_=an&&an.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(an,"__esModule",{value:!0});an.Client=void 0;var xs=nr(),I_=D_(se()),jt=(0,I_.default)("socket.io:client"),Oc=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?(jt("no namespace joined yet, close the client"),this.close()):jt("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return jt("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,n=>{n?this.doConnect(e,t):(jt("creation of namespace %s was denied",e),this._packet({type:xs.PacketType.CONNECT_ERROR,nsp:e,data:{message:"Invalid namespace"}}))})}doConnect(e,t){let n=this.server.of(e);n._add(this,t,r=>{this.sockets.set(r.id,r),this.nsps.set(n.name,r),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 jt("ignoring remove for %s",e.id)}close(){this.conn.readyState==="open"&&(jt("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if(this.conn.readyState!=="open"){jt("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){jt("volatile packet is discarded since the transport is not currently writable");return}let n=Array.isArray(e)?e:[e];for(let r of n)this.conn.write(r,t)}ondata(e){try{this.decoder.add(e)}catch(t){jt("invalid packet format"),this.onerror(t)}}ondecoded(e){let{namespace:t,authPayload:n}=this._parseNamespace(e),r=this.nsps.get(t);!r&&e.type===xs.PacketType.CONNECT?this.connect(t,n):r&&e.type!==xs.PacketType.CONNECT&&e.type!==xs.PacketType.CONNECT_ERROR?process.nextTick(function(){r._onpacket(e)}):(jt("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){jt("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)}};an.Client=Oc});var bs=C(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.StrictEventEmitter=void 0;var q_=require("events"),Ac=class extends q_.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)}};ys.StrictEventEmitter=Ac});var Rc=C(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.RESERVED_EVENTS=void 0;ws.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var Pc=C(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.RemoteSocket=cn.BroadcastOperator=void 0;var L_=Rc(),F_=nr(),_s=class i{constructor(e,t=new Set,n=new Set,r={}){this.adapter=e,this.rooms=t,this.exceptRooms=n,this.flags=r}to(e){let t=new Set(this.rooms);return Array.isArray(e)?e.forEach(n=>t.add(n)):t.add(e),new i(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 i(this.adapter,this.rooms,t,this.flags)}compress(e){let t=Object.assign({},this.flags,{compress:e});return new i(this.adapter,this.rooms,this.exceptRooms,t)}get volatile(){let e=Object.assign({},this.flags,{volatile:!0});return new i(this.adapter,this.rooms,this.exceptRooms,e)}get local(){let e=Object.assign({},this.flags,{local:!0});return new i(this.adapter,this.rooms,this.exceptRooms,e)}timeout(e){let t=Object.assign({},this.flags,{timeout:e});return new i(this.adapter,this.rooms,this.exceptRooms,t)}emit(e,...t){if(L_.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],r={type:F_.PacketType.EVENT,data:n};if(!(typeof n[n.length-1]=="function"))return this.adapter.broadcast(r,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let o=n.pop(),a=!1,l=[],p=setTimeout(()=>{a=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:l])},this.flags.timeout),f=-1,m=0,_=0,E=()=>{!a&&f===m&&l.length===_&&(clearTimeout(p),o.apply(this,[null,this.flags.expectSingleResponse?l[0]:l]))};return this.adapter.broadcastWithAck(r,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},k=>{_+=k,m++,E()},k=>{l.push(k),E()}),this.adapter.serverCount().then(k=>{f=k,E()}),!0}emitWithAck(e,...t){return new Promise((n,r)=>{t.push((s,o)=>s?(s.responses=o,r(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 Ss(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)}};cn.BroadcastOperator=_s;var Ss=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 _s(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}};cn.RemoteSocket=Ss});var jc=C(ln=>{"use strict";var ch=ln&&ln.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ln,"__esModule",{value:!0});ln.Socket=void 0;var bt=nr(),U_=ch(se()),H_=bs(),oh=ch(ua()),z_=Pc(),$_=Rc(),Ye=(0,U_.default)("socket.io:socket"),W_=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function ah(){}var Bc=class extends H_.StrictEventEmitter{constructor(e,t,n,r){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,r?(this.id=r.sid,this.pid=r.pid,r.rooms.forEach(s=>this.join(s)),this.data=r.data,r.missedPackets.forEach(s=>{this.packet({type:bt.PacketType.EVENT,data:s})}),this.recovered=!0):(t.conn.protocol===3?this.id=e.name!=="/"?e.name+"#"+t.id:t.id:this.id=oh.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=oh.default.generateId())),this.handshake=this.buildHandshake(n),this.on("error",ah)}buildHandshake(e){var t,n,r,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:(r=this.request)===null||r===void 0?void 0:r.url,query:((s=this.request)===null||s===void 0?void 0:s._query)||{},auth:e}}emit(e,...t){if($_.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],r={type:bt.PacketType.EVENT,data:n};if(typeof n[n.length-1]=="function"){let o=this.nsp._ids++;Ye("emitting packet with ack id %d",o),this.registerAckCallback(o,n.pop()),r.id=o}let s=Object.assign({},this.flags);return this.flags={},this.nsp.server.opts.connectionStateRecovery?this.adapter.broadcast(r,{rooms:new Set([this.id]),except:new Set,flags:s}):(this.notifyOutgoingListeners(r),this.packet(r,s)),!0}emitWithAck(e,...t){let n=this.flags.timeout!==void 0;return new Promise((r,s)=>{t.push((o,a)=>n?o?s(o):r(a):r(o)),this.emit(e,...t)})}registerAckCallback(e,t){let n=this.flags.timeout;if(n===void 0){this.acks.set(e,t);return}let r=setTimeout(()=>{Ye("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(r),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 Ye("join room %s",e),this.adapter.addAll(this.id,new Set(Array.isArray(e)?e:[e]))}leave(e){return Ye("leave room %s",e),this.adapter.del(this.id,e)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){Ye("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3?this.packet({type:bt.PacketType.CONNECT}):this.packet({type:bt.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(Ye("got packet %j",e),e.type){case bt.PacketType.EVENT:this.onevent(e);break;case bt.PacketType.BINARY_EVENT:this.onevent(e);break;case bt.PacketType.ACK:this.onack(e);break;case bt.PacketType.BINARY_ACK:this.onack(e);break;case bt.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(e){let t=e.data||[];if(Ye("emitting event %j",t),e.id!=null&&(Ye("attaching ack callback to event"),t.push(this.ack(e.id))),this._anyListeners&&this._anyListeners.length){let n=this._anyListeners.slice();for(let r of n)r.apply(this,t)}this.dispatch(t)}ack(e){let t=this,n=!1;return function(){if(n)return;let r=Array.prototype.slice.call(arguments);Ye("sending ack %j",r),t.packet({id:e,type:bt.PacketType.ACK,data:r}),n=!0}}onack(e){let t=this.acks.get(e.id);typeof t=="function"?(Ye("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),this.acks.delete(e.id)):Ye("bad ack %s",e.id)}ondisconnect(){Ye("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(e){this.emitReserved("error",e)}_onclose(e,t){if(!this.connected)return this;Ye("closing socket - reason %s",e),this.emitReserved("disconnecting",e,t),this.server._opts.connectionStateRecovery&&W_.has(e)&&(Ye("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=ah}_error(e){this.packet({type:bt.PacketType.CONNECT_ERROR,data:e})}disconnect(e=!1){return this.connected?(e?this.client._disconnect():(this.packet({type:bt.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){Ye("dispatching an event %j",e),this.run(e,t=>{process.nextTick(()=>{if(t)return this._onerror(t);this.connected?super.emitUntyped.apply(this,e):Ye("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 r(s){n[s](e,o=>{if(o)return t(o);if(!n[s+1])return t();r(s+1)})}r(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 z_.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}};ln.Socket=Bc});var Dc=C(ti=>{"use strict";var V_=ti&&ti.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ti,"__esModule",{value:!0});ti.Namespace=ti.RESERVED_EVENTS=void 0;var lh=jc(),K_=bs(),G_=V_(se()),dt=Pc(),un=(0,G_.default)("socket.io:namespace");ti.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);var Nc=class extends K_.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=>{un("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 r(s){n[s](e,o=>{if(o)return t(o);if(!n[s+1])return t();r(s+1)})}r(0)}to(e){return new dt.BroadcastOperator(this.adapter).to(e)}in(e){return new dt.BroadcastOperator(this.adapter).in(e)}except(e){return new dt.BroadcastOperator(this.adapter).except(e)}async _add(e,t,n){var r;un("adding socket to nsp %s",this.name);let s=await this._createSocket(e,t);if(this._preConnectSockets.set(s.id,s),!((r=this.server.opts.connectionStateRecovery)===null||r===void 0)&&r.skipMiddlewares&&s.recovered&&e.conn.readyState==="open")return this._doConnect(s,n);this.run(s,o=>{process.nextTick(()=>{if(e.conn.readyState!=="open"){un("next called after client was closed - ignoring socket"),s._cleanup();return}if(o)return un("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,r=t.offset;if(this.server.opts.connectionStateRecovery&&typeof n=="string"&&typeof r=="string"){let s;try{s=await this.adapter.restoreSession(n,r)}catch(o){un("error while restoring session: %s",o)}if(s)return un("connection state recovered for sid %s",s.sid),new lh.Socket(this,e,t,s)}return new lh.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 dt.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(ti.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,r)=>{t.push((s,o)=>s?(s.responses=o,r(s)):n(o)),this.serverSideEmit(e,...t)})}_onServerSideEmit(e){super.emitUntyped.apply(this,e)}allSockets(){return new dt.BroadcastOperator(this.adapter).allSockets()}compress(e){return new dt.BroadcastOperator(this.adapter).compress(e)}get volatile(){return new dt.BroadcastOperator(this.adapter).volatile}get local(){return new dt.BroadcastOperator(this.adapter).local}timeout(e){return new dt.BroadcastOperator(this.adapter).timeout(e)}fetchSockets(){return new dt.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(e){return new dt.BroadcastOperator(this.adapter).socketsJoin(e)}socketsLeave(e){return new dt.BroadcastOperator(this.adapter).socketsLeave(e)}disconnectSockets(e=!1){return new dt.BroadcastOperator(this.adapter).disconnectSockets(e)}};ti.Namespace=Nc});var hh=C(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.encode=Ic;rr.decode=Y_;rr.yeast=J_;var dh="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Es=64,fh={},uh=0,hi=0,ph;function Ic(i){let e="";do e=dh[i%Es]+e,i=Math.floor(i/Es);while(i>0);return e}function Y_(i){let e=0;for(hi=0;hi<i.length;hi++)e=e*Es+fh[i.charAt(hi)];return e}function J_(){let i=Ic(+new Date);return i!==ph?(uh=0,ph=i):i+"."+Ic(uh++)}for(;hi<Es;hi++)fh[dh[hi]]=hi});var Fc=C(pn=>{"use strict";var qc;Object.defineProperty(pn,"__esModule",{value:!0});pn.SessionAwareAdapter=pn.Adapter=void 0;var X_=require("events"),Z_=hh(),ks=dc(),Q_=typeof((qc=ks?.Sender)===null||qc===void 0?void 0:qc.frame)=="function",Cs=class extends X_.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||{},r={preEncoded:!0,volatile:n.volatile,compress:n.compress};e.nsp=this.nsp.name;let s=this._encode(e,r);this.apply(t,o=>{typeof o.notifyOutgoingListeners=="function"&&o.notifyOutgoingListeners(e),o.client.writeToEngine(s,r)})}broadcastWithAck(e,t,n,r){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),l=0;this.apply(t,p=>{l++,p.acks.set(e.id,r),typeof p.notifyOutgoingListeners=="function"&&p.notifyOutgoingListeners(e),p.client.writeToEngine(a,o)}),n(l)}_encode(e,t){let n=this.encoder.encode(e);if(Q_&&n.length===1&&typeof n[0]=="string"){let r=Buffer.from("4"+n[0]);t.wsPreEncodedFrame=ks.Sender.frame(r,{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(r=>n.leave(r))})}disconnectSockets(e,t){this.apply(e,n=>{n.disconnect(t)})}apply(e,t){let n=e.rooms,r=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)||r.has(a))continue;let l=this.nsp.sockets.get(a);l&&(t(l),s.add(a))}}else for(let[s]of this.sids){if(r.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(r=>t.add(r));return t}serverSideEmit(e){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(e){}restoreSession(e,t){return null}};pn.Adapter=Cs;var Lc=class extends Cs{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((r,s)=>{r.disconnectedAt<n&&this.sessions.delete(s)});for(let r=this.packets.length-1;r>=0;r--)if(this.packets[r].emittedAt<n){this.packets.splice(0,r+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 l=this.packets[a];eS(n.rooms,l.opts)&&o.push(l.data)}return Promise.resolve(Object.assign(Object.assign({},n),{missedPackets:o}))}broadcast(e,t){var n;let r=e.type===2,s=e.id===void 0,o=((n=t.flags)===null||n===void 0?void 0:n.volatile)===void 0;if(r&&s&&o){let a=(0,Z_.yeast)();e.data.push(a),this.packets.push({id:a,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};pn.SessionAwareAdapter=Lc;function eS(i,e){let t=e.rooms.size===0||i.some(r=>e.rooms.has(r)),n=i.every(r=>!e.except.has(r));return t&&n}});var mh=C(Ut=>{"use strict";var tS=Ut&&Ut.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(i,n[r])&&(t[n[r]]=i[n[r]]);return t};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.ClusterAdapterWithHeartbeat=Ut.ClusterAdapter=Ut.MessageType=void 0;var iS=Fc(),nS=se(),rS=require("crypto"),ie=(0,nS.debug)("socket.io-adapter"),sS="emitter",Ts=5e3;function fn(){return(0,rS.randomBytes)(8).toString("hex")}var N;(function(i){i[i.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",i[i.HEARTBEAT=2]="HEARTBEAT",i[i.BROADCAST=3]="BROADCAST",i[i.SOCKETS_JOIN=4]="SOCKETS_JOIN",i[i.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",i[i.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",i[i.FETCH_SOCKETS=7]="FETCH_SOCKETS",i[i.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",i[i.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",i[i.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",i[i.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",i[i.BROADCAST_ACK=12]="BROADCAST_ACK",i[i.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"})(N||(Ut.MessageType=N={}));function Pi(i){return{rooms:[...i.rooms],except:[...i.except],flags:i.flags}}function dn(i){return{rooms:new Set(i.rooms),except:new Set(i.except),flags:i.flags}}var Ms=class extends iS.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=fn()}onMessage(e,t){if(e.uid===this.uid)return ie("[%s] ignore message from self",this.uid);if(e.nsp!==this.nsp.name)return ie("[%s] ignore message from another namespace (%s)",this.uid,e.nsp);switch(ie("[%s] new event of type %d from %s",this.uid,e.type,e.uid),e.type){case N.BROADCAST:{if(e.data.requestId!==void 0)super.broadcastWithAck(e.data.packet,dn(e.data.opts),r=>{ie("[%s] waiting for %d client acknowledgements",this.uid,r),this.publishResponse(e.uid,{type:N.BROADCAST_CLIENT_COUNT,data:{requestId:e.data.requestId,clientCount:r}})},r=>{ie("[%s] received acknowledgement with value %j",this.uid,r),this.publishResponse(e.uid,{type:N.BROADCAST_ACK,data:{requestId:e.data.requestId,packet:r}})});else{let r=e.data.packet,s=dn(e.data.opts);this.addOffsetIfNecessary(r,s,t),super.broadcast(r,s)}break}case N.SOCKETS_JOIN:super.addSockets(dn(e.data.opts),e.data.rooms);break;case N.SOCKETS_LEAVE:super.delSockets(dn(e.data.opts),e.data.rooms);break;case N.DISCONNECT_SOCKETS:super.disconnectSockets(dn(e.data.opts),e.data.close);break;case N.FETCH_SOCKETS:{ie("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(dn(e.data.opts)).then(n=>{this.publishResponse(e.uid,{type:N.FETCH_SOCKETS_RESPONSE,data:{requestId:e.data.requestId,sockets:n.map(r=>{let s=r.handshake,{sessionStore:o}=s,a=tS(s,["sessionStore"]);return{id:r.id,handshake:a,rooms:[...r.rooms],data:r.data}})}})});break}case N.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,ie("[%s] calling acknowledgement with %j",this.uid,a),this.publishResponse(e.uid,{type:N.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:e.data.requestId,packet:a}}))};this.nsp._onServerSideEmit([...n,o]);break}case N.BROADCAST_CLIENT_COUNT:case N.BROADCAST_ACK:case N.FETCH_SOCKETS_RESPONSE:case N.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(e);break;default:ie("[%s] unknown message type: %s",this.uid,e.type)}}onResponse(e){var t,n;let r=e.data.requestId;switch(ie("[%s] received response %s to request %s",this.uid,e.type,r),e.type){case N.BROADCAST_CLIENT_COUNT:{(t=this.ackRequests.get(r))===null||t===void 0||t.clientCountCallback(e.data.clientCount);break}case N.BROADCAST_ACK:{(n=this.ackRequests.get(r))===null||n===void 0||n.ack(e.data.packet);break}case N.FETCH_SOCKETS_RESPONSE:{let s=this.requests.get(r);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(r));break}case N.SERVER_SIDE_EMIT_RESPONSE:{let s=this.requests.get(r);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(r));break}default:ie("[%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:N.BROADCAST,data:{packet:e,opts:Pi(t)}});this.addOffsetIfNecessary(e,t,s)}catch(s){return ie("[%s] error while broadcasting message: %s",this.uid,s.message)}super.broadcast(e,t)}addOffsetIfNecessary(e,t,n){var r;if(!this.nsp.server.opts.connectionStateRecovery)return;let s=e.type===2,o=e.id===void 0,a=((r=t.flags)===null||r===void 0?void 0:r.volatile)===void 0;s&&o&&a&&e.data.push(n)}broadcastWithAck(e,t,n,r){var s;if(!((s=t?.flags)===null||s===void 0?void 0:s.local)){let a=fn();this.ackRequests.set(a,{clientCountCallback:n,ack:r}),this.publish({type:N.BROADCAST,data:{packet:e,requestId:a,opts:Pi(t)}}),setTimeout(()=>{this.ackRequests.delete(a)},t.flags.timeout)}super.broadcastWithAck(e,t,n,r)}async addSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:N.SOCKETS_JOIN,data:{opts:Pi(e),rooms:t}})}catch(s){ie("[%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:N.SOCKETS_LEAVE,data:{opts:Pi(e),rooms:t}})}catch(s){ie("[%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:N.DISCONNECT_SOCKETS,data:{opts:Pi(e),close:t}})}catch(s){ie("[%s] error while publishing message: %s",this.uid,s.message)}super.disconnectSockets(e,t)}async fetchSockets(e){var t;let[n,r]=await Promise.all([super.fetchSockets(e),this.serverCount()]),s=r-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return n;let o=fn();return new Promise((a,l)=>{let p=setTimeout(()=>{let m=this.requests.get(o);m&&(l(new Error(`timeout reached: only ${m.current} responses received out of ${m.expected}`)),this.requests.delete(o))},e.flags.timeout||Ts),f={type:N.FETCH_SOCKETS,resolve:a,timeout:p,current:0,expected:s,responses:n};this.requests.set(o,f),this.publish({type:N.FETCH_SOCKETS,data:{opts:Pi(e),requestId:o}})})}async serverSideEmit(e){if(!(typeof e[e.length-1]=="function"))return this.publish({type:N.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),r=await this.serverCount()-1;if(ie('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,r),r<=0)return n(null,[]);let s=fn(),o=setTimeout(()=>{let l=this.requests.get(s);l&&(n(new Error(`timeout reached: only ${l.current} responses received out of ${l.expected}`),l.responses),this.requests.delete(s))},Ts),a={type:N.SERVER_SIDE_EMIT,resolve:n,timeout:o,current:0,expected:r,responses:[]};this.requests.set(s,a),this.publish({type:N.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}publish(e){ie("[%s] sending message %s",this.uid,e.type),this.publishAndReturnOffset(e).catch(t=>{ie("[%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,ie("[%s] sending response %s to %s",this.uid,t.type,e),this.doPublishResponse(e,t).catch(n=>{ie("[%s] error while publishing response: %s",this.uid,n)})}};Ut.ClusterAdapter=Ms;var Uc=class extends Ms{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((r,s)=>{n-r>this._opts.heartbeatTimeout&&(ie("[%s] node %s seems down",this.uid,s),this.removeNode(s))})},1e3)}init(){this.publish({type:N.INITIAL_HEARTBEAT})}scheduleHeartbeat(){this.heartbeatTimer?this.heartbeatTimer.refresh():this.heartbeatTimer=setTimeout(()=>{this.publish({type:N.HEARTBEAT})},this._opts.heartbeatInterval)}close(){this.publish({type:N.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer&&clearInterval(this.cleanupTimer)}onMessage(e,t){if(e.uid===this.uid)return ie("[%s] ignore message from self",this.uid);switch(e.uid&&e.uid!==sS&&this.nodesMap.set(e.uid,Date.now()),e.type){case N.INITIAL_HEARTBEAT:this.publish({type:N.HEARTBEAT});break;case N.HEARTBEAT:break;case N.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:N.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),r=this.nodesMap.size;if(ie('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,r),r<=0)return n(null,[]);let s=fn(),o=setTimeout(()=>{let l=this.customRequests.get(s);l&&(n(new Error(`timeout reached: missing ${l.missingUids.size} responses`),l.responses),this.customRequests.delete(s))},Ts),a={type:N.SERVER_SIDE_EMIT,resolve:n,timeout:o,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(s,a),this.publish({type:N.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}async fetchSockets(e){var t;let[n,r]=await Promise.all([super.fetchSockets({rooms:e.rooms,except:e.except,flags:{local:!0}}),this.serverCount()]),s=r-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return n;let o=fn();return new Promise((a,l)=>{let p=setTimeout(()=>{let m=this.customRequests.get(o);m&&(l(new Error(`timeout reached: missing ${m.missingUids.size} responses`)),this.customRequests.delete(o))},e.flags.timeout||Ts),f={type:N.FETCH_SOCKETS,resolve:a,timeout:p,missingUids:new Set([...this.nodesMap.keys()]),responses:n};this.customRequests.set(o,f),this.publish({type:N.FETCH_SOCKETS,data:{opts:Pi(e),requestId:o}})})}onResponse(e){let t=e.data.requestId;switch(ie("[%s] received response %s to request %s",this.uid,e.type,t),e.type){case N.FETCH_SOCKETS_RESPONSE:{let n=this.customRequests.get(t);if(!n)return;e.data.sockets.forEach(r=>n.responses.push(r)),n.missingUids.delete(e.uid),n.missingUids.size===0&&(clearTimeout(n.timeout),n.resolve(n.responses),this.customRequests.delete(t));break}case N.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===N.FETCH_SOCKETS?t.resolve(t.responses):t.type===N.SERVER_SIDE_EMIT&&t.resolve(null,t.responses),this.customRequests.delete(n))}),this.nodesMap.delete(e)}};Ut.ClusterAdapterWithHeartbeat=Uc});var Os=C(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.MessageType=wt.ClusterAdapterWithHeartbeat=wt.ClusterAdapter=wt.SessionAwareAdapter=wt.Adapter=void 0;var vh=Fc();Object.defineProperty(wt,"Adapter",{enumerable:!0,get:function(){return vh.Adapter}});Object.defineProperty(wt,"SessionAwareAdapter",{enumerable:!0,get:function(){return vh.SessionAwareAdapter}});var Hc=mh();Object.defineProperty(wt,"ClusterAdapter",{enumerable:!0,get:function(){return Hc.ClusterAdapter}});Object.defineProperty(wt,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return Hc.ClusterAdapterWithHeartbeat}});Object.defineProperty(wt,"MessageType",{enumerable:!0,get:function(){return Hc.MessageType}})});var yh=C(hn=>{"use strict";var oS=hn&&hn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(hn,"__esModule",{value:!0});hn.ParentNamespace=void 0;var gh=Dc(),aS=Os(),cS=oS(se()),xh=(0,cS.default)("socket.io:parent-namespace"),As=class i extends gh.Namespace{constructor(e){super(e,"/_"+i.count++),this.children=new Set}_initAdapter(){this.adapter=new zc(this)}emit(e,...t){return this.children.forEach(n=>{n.emit(e,...t)}),!0}createChild(e){xh("creating child namespace %s",e);let t=new gh.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=r=>{n.call(t,r),t.sockets.size===0&&(xh("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")}};hn.ParentNamespace=As;As.count=0;var zc=class extends aS.Adapter{broadcast(e,t){this.nsp.children.forEach(n=>{n.adapter.broadcast(e,t)})}}});var kh=C(ji=>{"use strict";var lS=ji&&ji.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ji,"__esModule",{value:!0});ji.patchAdapter=pS;ji.restoreAdapter=dS;ji.serveFile=hS;var Bi=Os(),bh=require("fs"),uS=lS(se()),Rs=(0,uS.default)("socket.io:adapter-uws"),$c="",{addAll:_h,del:Sh,broadcast:Eh}=Bi.Adapter.prototype;function pS(i){Bi.Adapter.prototype.addAll=function(e,t){let n=!this.sids.has(e);_h.call(this,e,t);let r=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(r){if(r.conn.transport.name==="websocket"){wh(this.nsp.name,r,n,t);return}n&&r.conn.on("upgrade",()=>{let s=this.sids.get(e);s&&wh(this.nsp.name,r,n,s)})}},Bi.Adapter.prototype.del=function(e,t){Sh.call(this,e,t);let n=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(n&&n.conn.transport.name==="websocket"){let r=n.conn.id,s=n.conn.transport.socket,o=`${this.nsp.name}${$c}${t}`;Rs("unsubscribe connection %s from topic %s",r,o),s.unsubscribe(o)}},Bi.Adapter.prototype.broadcast=function(e,t){if(!(t.rooms.size<=1&&t.except.size===0)){Eh.call(this,e,t);return}let r=t.flags||{},s={preEncoded:!0,volatile:r.volatile,compress:r.compress};e.nsp=this.nsp.name;let o=this.encoder.encode(e),a=t.rooms.size===0?this.nsp.name:`${this.nsp.name}${$c}${t.rooms.keys().next().value}`;Rs("fast publish to %s",a),o.forEach(l=>{let p=typeof l!="string";i.publish(a,p?l:"4"+l,p)}),this.apply(t,l=>{l.conn.transport.name!=="websocket"&&l.client.writeToEngine(o,s)})}}function wh(i,e,t,n){let r=e.conn.id,s=e.conn.transport.socket;t&&(Rs("subscribe connection %s to topic %s",r,i),s.subscribe(i)),n.forEach(o=>{let a=`${i}${$c}${o}`;Rs("subscribe connection %s to topic %s",r,a),s.subscribe(a)})}function dS(){Bi.Adapter.prototype.addAll=_h,Bi.Adapter.prototype.del=Sh,Bi.Adapter.prototype.broadcast=Eh}var fS=i=>{let{buffer:e,byteOffset:t,byteLength:n}=i;return e.slice(t,t+n)};function hS(i,e){let{size:t}=(0,bh.statSync)(e),n=(0,bh.createReadStream)(e),r=()=>!n.destroyed&&n.destroy(),s=a=>{throw r(),a},o=a=>{let l=fS(a);i.cork(()=>{let p=i.getWriteOffset(),[f,m]=i.tryEnd(l,t);!m&&!f&&(n.pause(),i.onWritable(_=>{let[E,k]=i.tryEnd(l.slice(_-p),t);return!k&&E&&n.resume(),E}))})};i.onAborted(r),n.on("data",o).on("error",s).on("end",r)}});var Ch=C((CM,mS)=>{mS.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 jh=C((Je,sr)=>{"use strict";var vS=Je&&Je.__createBinding||(Object.create?(function(i,e,t,n){n===void 0&&(n=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,r)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),gS=Je&&Je.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),xS=Je&&Je.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&vS(e,i,t);return gS(e,i),e},Kc=Je&&Je.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Je,"__esModule",{value:!0});Je.Namespace=Je.Socket=Je.Server=void 0;var yS=Kc(require("http")),bS=require("fs"),Wc=require("zlib"),wS=Pr(),Ps=require("stream"),Th=require("path"),Mh=Jf(),_S=sh(),Oh=require("events"),Gc=Dc();Object.defineProperty(Je,"Namespace",{enumerable:!0,get:function(){return Gc.Namespace}});var SS=yh(),Ah=Os(),ES=xS(nr()),kS=Kc(se()),Bh=jc();Object.defineProperty(Je,"Socket",{enumerable:!0,get:function(){return Bh.Socket}});var CS=bs(),Vc=kh(),TS=Kc(hc()),et=(0,kS.default)("socket.io:server"),Rh=Ch().version,Ph=/\.map/,mn=class i extends CS.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||ES,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||Ah.SessionAwareAdapter)):this.adapter(t.adapter||Ah.Adapter),t.cleanupEmptyChildNamespaces=!!t.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),(e||typeof e=="number")&&this.attach(e),this.opts.cors&&(this._corsMiddleware=(0,TS.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 r=this.parentNsps.keys(),s=()=>{let o=r.next();if(o.done)return n(!1);o.value(e,t,(a,l)=>{if(a||!l)return s();if(this._nsps.has(e))return et("dynamic namespace %s already exists",e),n(this._nsps.get(e));let p=this.parentNsps.get(o.value).createChild(e);et("dynamic namespace %s was created",e),n(p)})};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"){et("creating http server and binding to %d",e);let n=e;e=yS.default.createServer((r,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,et("creating uWebSockets.js-based engine with opts %j",t);let n=new Mh.uServer(t);n.attach(e,t),this.bind(n),this._serveClient&&e.get(`${this._path}/*`,(r,s)=>{if(!this.clientPathRegex.test(s.getUrl())){s.setYield(!0);return}let o=s.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),a=Ph.test(o),l=a?"map":"source",p='"'+Rh+'"',f="W/"+p,m=s.getHeader("if-none-match");if(m&&(p===m||f===m)){et("serve client %s 304",l),r.writeStatus("304 Not Modified"),r.end();return}et("serve client %s",l),r.writeHeader("cache-control","public, max-age=0"),r.writeHeader("content-type","application/"+(a?"json":"javascript")+"; charset=utf-8"),r.writeHeader("etag",p);let _=Th.join(__dirname,"../client-dist/",o);(0,Vc.serveFile)(r,_)}),(0,Vc.patchAdapter)(e)}initEngine(e,t){et("creating engine.io instance with opts %j",t),this.eio=(0,Mh.attach)(e,t),this._serveClient&&this.attachServe(e),this.httpServer=e,this.bind(this.eio)}attachServe(e){et("attaching client serving req handler");let t=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("request",(n,r)=>{if(this.clientPathRegex.test(n.url))this._corsMiddleware?this._corsMiddleware(n,r,()=>{this.serve(n,r)}):this.serve(n,r);else for(let s=0;s<t.length;s++)t[s].call(e,n,r)})}serve(e,t){let n=e.url.replace(this._path,"").replace(/\?.*$/,""),r=Ph.test(n),s=r?"map":"source",o='"'+Rh+'"',a="W/"+o,l=e.headers["if-none-match"];if(l&&(o===l||a===l)){et("serve client %s 304",s),t.writeHead(304),t.end();return}et("serve client %s",s),t.setHeader("Cache-Control","public, max-age=0"),t.setHeader("Content-Type","application/"+(r?"json":"javascript")+"; charset=utf-8"),t.setHeader("ETag",o),i.sendFile(n,e,t)}static sendFile(e,t,n){let r=(0,bS.createReadStream)(Th.join(__dirname,"../client-dist/",e)),s=wS(t).encodings(["br","gzip","deflate"]),o=a=>{a&&n.end()};switch(s){case"br":n.writeHead(200,{"content-encoding":"br"}),(0,Ps.pipeline)(r,(0,Wc.createBrotliCompress)(),n,o);break;case"gzip":n.writeHead(200,{"content-encoding":"gzip"}),(0,Ps.pipeline)(r,(0,Wc.createGzip)(),n,o);break;case"deflate":n.writeHead(200,{"content-encoding":"deflate"}),(0,Ps.pipeline)(r,(0,Wc.createDeflate)(),n,o);break;default:n.writeHead(200),(0,Ps.pipeline)(r,n,o)}}bind(e){return this.engine=e,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(e){et("incoming connection with id %s",e.id);let t=new _S.Client(this,e);return e.protocol===3&&t.connect("/"),this}of(e,t){if(typeof e=="function"||e instanceof RegExp){let r=new SS.ParentNamespace(this);return et("initializing parent namespace %s",r.name),typeof e=="function"?this.parentNsps.set(e,r):(this.parentNsps.set((s,o,a)=>a(null,e.test(s)),r),this.parentNamespacesFromRegExp.set(e,r)),t&&r.on("connect",t),r}String(e)[0]!=="/"&&(e="/"+e);let n=this._nsps.get(e);if(!n){for(let[r,s]of this.parentNamespacesFromRegExp)if(r.test(e))return et("attaching namespace %s to parent namespace %s",e,r),s.createChild(e);et("initializing namespace %s",e),n=new Gc.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,Vc.restoreAdapter)(),this.httpServer)return new Promise(t=>{this.httpServer.close(n=>{e&&e(n),n&&et("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)}};Je.Server=mn;var MS=Object.keys(Oh.EventEmitter.prototype).filter(function(i){return typeof Oh.EventEmitter.prototype[i]=="function"});MS.forEach(function(i){mn.prototype[i]=function(){return this.sockets[i].apply(this.sockets,arguments)}});sr.exports=(i,e)=>new mn(i,e);sr.exports.Server=mn;sr.exports.Namespace=Gc.Namespace;sr.exports.Socket=Bh.Socket});var qh=C((AM,Ih)=>{"use strict";Ih.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Yc=C((RM,Fh)=>{var or=qh(),Lh={};for(let i of Object.keys(or))Lh[or[i]]=i;var R={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Fh.exports=R;for(let i of Object.keys(R)){if(!("channels"in R[i]))throw new Error("missing channels property: "+i);if(!("labels"in R[i]))throw new Error("missing channel labels property: "+i);if(R[i].labels.length!==R[i].channels)throw new Error("channel and label counts mismatch: "+i);let{channels:e,labels:t}=R[i];delete R[i].channels,delete R[i].labels,Object.defineProperty(R[i],"channels",{value:e}),Object.defineProperty(R[i],"labels",{value:t})}R.rgb.hsl=function(i){let e=i[0]/255,t=i[1]/255,n=i[2]/255,r=Math.min(e,t,n),s=Math.max(e,t,n),o=s-r,a,l;s===r?a=0:e===s?a=(t-n)/o:t===s?a=2+(n-e)/o:n===s&&(a=4+(e-t)/o),a=Math.min(a*60,360),a<0&&(a+=360);let p=(r+s)/2;return s===r?l=0:p<=.5?l=o/(s+r):l=o/(2-s-r),[a,l*100,p*100]};R.rgb.hsv=function(i){let e,t,n,r,s,o=i[0]/255,a=i[1]/255,l=i[2]/255,p=Math.max(o,a,l),f=p-Math.min(o,a,l),m=function(_){return(p-_)/6/f+1/2};return f===0?(r=0,s=0):(s=f/p,e=m(o),t=m(a),n=m(l),o===p?r=n-t:a===p?r=1/3+e-n:l===p&&(r=2/3+t-e),r<0?r+=1:r>1&&(r-=1)),[r*360,s*100,p*100]};R.rgb.hwb=function(i){let e=i[0],t=i[1],n=i[2],r=R.rgb.hsl(i)[0],s=1/255*Math.min(e,Math.min(t,n));return n=1-1/255*Math.max(e,Math.max(t,n)),[r,s*100,n*100]};R.rgb.cmyk=function(i){let e=i[0]/255,t=i[1]/255,n=i[2]/255,r=Math.min(1-e,1-t,1-n),s=(1-e-r)/(1-r)||0,o=(1-t-r)/(1-r)||0,a=(1-n-r)/(1-r)||0;return[s*100,o*100,a*100,r*100]};function OS(i,e){return(i[0]-e[0])**2+(i[1]-e[1])**2+(i[2]-e[2])**2}R.rgb.keyword=function(i){let e=Lh[i];if(e)return e;let t=1/0,n;for(let r of Object.keys(or)){let s=or[r],o=OS(i,s);o<t&&(t=o,n=r)}return n};R.keyword.rgb=function(i){return or[i]};R.rgb.xyz=function(i){let e=i[0]/255,t=i[1]/255,n=i[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let r=e*.4124+t*.3576+n*.1805,s=e*.2126+t*.7152+n*.0722,o=e*.0193+t*.1192+n*.9505;return[r*100,s*100,o*100]};R.rgb.lab=function(i){let e=R.rgb.xyz(i),t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let s=116*n-16,o=500*(t-n),a=200*(n-r);return[s,o,a]};R.hsl.rgb=function(i){let e=i[0]/360,t=i[1]/100,n=i[2]/100,r,s,o;if(t===0)return o=n*255,[o,o,o];n<.5?r=n*(1+t):r=n+t-n*t;let a=2*n-r,l=[0,0,0];for(let p=0;p<3;p++)s=e+1/3*-(p-1),s<0&&s++,s>1&&s--,6*s<1?o=a+(r-a)*6*s:2*s<1?o=r:3*s<2?o=a+(r-a)*(2/3-s)*6:o=a,l[p]=o*255;return l};R.hsl.hsv=function(i){let e=i[0],t=i[1]/100,n=i[2]/100,r=t,s=Math.max(n,.01);n*=2,t*=n<=1?n:2-n,r*=s<=1?s:2-s;let o=(n+t)/2,a=n===0?2*r/(s+r):2*t/(n+t);return[e,a*100,o*100]};R.hsv.rgb=function(i){let e=i[0]/60,t=i[1]/100,n=i[2]/100,r=Math.floor(e)%6,s=e-Math.floor(e),o=255*n*(1-t),a=255*n*(1-t*s),l=255*n*(1-t*(1-s));switch(n*=255,r){case 0:return[n,l,o];case 1:return[a,n,o];case 2:return[o,n,l];case 3:return[o,a,n];case 4:return[l,o,n];case 5:return[n,o,a]}};R.hsv.hsl=function(i){let e=i[0],t=i[1]/100,n=i[2]/100,r=Math.max(n,.01),s,o;o=(2-t)*n;let a=(2-t)*r;return s=t*r,s/=a<=1?a:2-a,s=s||0,o/=2,[e,s*100,o*100]};R.hwb.rgb=function(i){let e=i[0]/360,t=i[1]/100,n=i[2]/100,r=t+n,s;r>1&&(t/=r,n/=r);let o=Math.floor(6*e),a=1-n;s=6*e-o,(o&1)!==0&&(s=1-s);let l=t+s*(a-t),p,f,m;switch(o){default:case 6:case 0:p=a,f=l,m=t;break;case 1:p=l,f=a,m=t;break;case 2:p=t,f=a,m=l;break;case 3:p=t,f=l,m=a;break;case 4:p=l,f=t,m=a;break;case 5:p=a,f=t,m=l;break}return[p*255,f*255,m*255]};R.cmyk.rgb=function(i){let e=i[0]/100,t=i[1]/100,n=i[2]/100,r=i[3]/100,s=1-Math.min(1,e*(1-r)+r),o=1-Math.min(1,t*(1-r)+r),a=1-Math.min(1,n*(1-r)+r);return[s*255,o*255,a*255]};R.xyz.rgb=function(i){let e=i[0]/100,t=i[1]/100,n=i[2]/100,r,s,o;return r=e*3.2406+t*-1.5372+n*-.4986,s=e*-.9689+t*1.8758+n*.0415,o=e*.0557+t*-.204+n*1.057,r=r>.0031308?1.055*r**(1/2.4)-.055:r*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,r=Math.min(Math.max(0,r),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[r*255,s*255,o*255]};R.xyz.lab=function(i){let e=i[0],t=i[1],n=i[2];e/=95.047,t/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let r=116*t-16,s=500*(e-t),o=200*(t-n);return[r,s,o]};R.lab.xyz=function(i){let e=i[0],t=i[1],n=i[2],r,s,o;s=(e+16)/116,r=t/500+s,o=s-n/200;let a=s**3,l=r**3,p=o**3;return s=a>.008856?a:(s-16/116)/7.787,r=l>.008856?l:(r-16/116)/7.787,o=p>.008856?p:(o-16/116)/7.787,r*=95.047,s*=100,o*=108.883,[r,s,o]};R.lab.lch=function(i){let e=i[0],t=i[1],n=i[2],r;r=Math.atan2(n,t)*360/2/Math.PI,r<0&&(r+=360);let o=Math.sqrt(t*t+n*n);return[e,o,r]};R.lch.lab=function(i){let e=i[0],t=i[1],r=i[2]/360*2*Math.PI,s=t*Math.cos(r),o=t*Math.sin(r);return[e,s,o]};R.rgb.ansi16=function(i,e=null){let[t,n,r]=i,s=e===null?R.rgb.hsv(i)[2]:e;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return s===2&&(o+=60),o};R.hsv.ansi16=function(i){return R.rgb.ansi16(R.hsv.rgb(i),i[2])};R.rgb.ansi256=function(i){let e=i[0],t=i[1],n=i[2];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)};R.ansi16.rgb=function(i){let e=i%10;if(e===0||e===7)return i>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let t=(~~(i>50)+1)*.5,n=(e&1)*t*255,r=(e>>1&1)*t*255,s=(e>>2&1)*t*255;return[n,r,s]};R.ansi256.rgb=function(i){if(i>=232){let s=(i-232)*10+8;return[s,s,s]}i-=16;let e,t=Math.floor(i/36)/5*255,n=Math.floor((e=i%36)/6)/5*255,r=e%6/5*255;return[t,n,r]};R.rgb.hex=function(i){let t=(((Math.round(i[0])&255)<<16)+((Math.round(i[1])&255)<<8)+(Math.round(i[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t};R.hex.rgb=function(i){let e=i.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let t=e[0];e[0].length===3&&(t=t.split("").map(a=>a+a).join(""));let n=parseInt(t,16),r=n>>16&255,s=n>>8&255,o=n&255;return[r,s,o]};R.rgb.hcg=function(i){let e=i[0]/255,t=i[1]/255,n=i[2]/255,r=Math.max(Math.max(e,t),n),s=Math.min(Math.min(e,t),n),o=r-s,a,l;return o<1?a=s/(1-o):a=0,o<=0?l=0:r===e?l=(t-n)/o%6:r===t?l=2+(n-e)/o:l=4+(e-t)/o,l/=6,l%=1,[l*360,o*100,a*100]};R.hsl.hcg=function(i){let e=i[1]/100,t=i[2]/100,n=t<.5?2*e*t:2*e*(1-t),r=0;return n<1&&(r=(t-.5*n)/(1-n)),[i[0],n*100,r*100]};R.hsv.hcg=function(i){let e=i[1]/100,t=i[2]/100,n=e*t,r=0;return n<1&&(r=(t-n)/(1-n)),[i[0],n*100,r*100]};R.hcg.rgb=function(i){let e=i[0]/360,t=i[1]/100,n=i[2]/100;if(t===0)return[n*255,n*255,n*255];let r=[0,0,0],s=e%1*6,o=s%1,a=1-o,l=0;switch(Math.floor(s)){case 0:r[0]=1,r[1]=o,r[2]=0;break;case 1:r[0]=a,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=o;break;case 3:r[0]=0,r[1]=a,r[2]=1;break;case 4:r[0]=o,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=a}return l=(1-t)*n,[(t*r[0]+l)*255,(t*r[1]+l)*255,(t*r[2]+l)*255]};R.hcg.hsv=function(i){let e=i[1]/100,t=i[2]/100,n=e+t*(1-e),r=0;return n>0&&(r=e/n),[i[0],r*100,n*100]};R.hcg.hsl=function(i){let e=i[1]/100,n=i[2]/100*(1-e)+.5*e,r=0;return n>0&&n<.5?r=e/(2*n):n>=.5&&n<1&&(r=e/(2*(1-n))),[i[0],r*100,n*100]};R.hcg.hwb=function(i){let e=i[1]/100,t=i[2]/100,n=e+t*(1-e);return[i[0],(n-e)*100,(1-n)*100]};R.hwb.hcg=function(i){let e=i[1]/100,n=1-i[2]/100,r=n-e,s=0;return r<1&&(s=(n-r)/(1-r)),[i[0],r*100,s*100]};R.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]};R.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]};R.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]};R.gray.hsl=function(i){return[0,0,i[0]]};R.gray.hsv=R.gray.hsl;R.gray.hwb=function(i){return[0,100,i[0]]};R.gray.cmyk=function(i){return[0,0,0,i[0]]};R.gray.lab=function(i){return[i[0],0,0]};R.gray.hex=function(i){let e=Math.round(i[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};R.rgb.gray=function(i){return[(i[0]+i[1]+i[2])/3/255*100]}});var Hh=C((PM,Uh)=>{var Bs=Yc();function AS(){let i={},e=Object.keys(Bs);for(let t=e.length,n=0;n<t;n++)i[e[n]]={distance:-1,parent:null};return i}function RS(i){let e=AS(),t=[i];for(e[i].distance=0;t.length;){let n=t.pop(),r=Object.keys(Bs[n]);for(let s=r.length,o=0;o<s;o++){let a=r[o],l=e[a];l.distance===-1&&(l.distance=e[n].distance+1,l.parent=n,t.unshift(a))}}return e}function PS(i,e){return function(t){return e(i(t))}}function BS(i,e){let t=[e[i].parent,i],n=Bs[e[i].parent][i],r=e[i].parent;for(;e[r].parent;)t.unshift(e[r].parent),n=PS(Bs[e[r].parent][r],n),r=e[r].parent;return n.conversion=t,n}Uh.exports=function(i){let e=RS(i),t={},n=Object.keys(e);for(let r=n.length,s=0;s<r;s++){let o=n[s];e[o].parent!==null&&(t[o]=BS(o,e))}return t}});var $h=C((BM,zh)=>{var Jc=Yc(),jS=Hh(),vn={},NS=Object.keys(Jc);function DS(i){let e=function(...t){let n=t[0];return n==null?n:(n.length>1&&(t=n),i(t))};return"conversion"in i&&(e.conversion=i.conversion),e}function IS(i){let e=function(...t){let n=t[0];if(n==null)return n;n.length>1&&(t=n);let r=i(t);if(typeof r=="object")for(let s=r.length,o=0;o<s;o++)r[o]=Math.round(r[o]);return r};return"conversion"in i&&(e.conversion=i.conversion),e}NS.forEach(i=>{vn[i]={},Object.defineProperty(vn[i],"channels",{value:Jc[i].channels}),Object.defineProperty(vn[i],"labels",{value:Jc[i].labels});let e=jS(i);Object.keys(e).forEach(n=>{let r=e[n];vn[i][n]=IS(r),vn[i][n].raw=DS(r)})});zh.exports=vn});var Jh=C((jM,Yh)=>{"use strict";var Wh=(i,e)=>(...t)=>`\x1B[${i(...t)+e}m`,Vh=(i,e)=>(...t)=>{let n=i(...t);return`\x1B[${38+e};5;${n}m`},Kh=(i,e)=>(...t)=>{let n=i(...t);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},js=i=>i,Gh=(i,e,t)=>[i,e,t],gn=(i,e,t)=>{Object.defineProperty(i,e,{get:()=>{let n=t();return Object.defineProperty(i,e,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},Xc,xn=(i,e,t,n)=>{Xc===void 0&&(Xc=$h());let r=n?10:0,s={};for(let[o,a]of Object.entries(Xc)){let l=o==="ansi16"?"ansi":o;o===e?s[l]=i(t,r):typeof a=="object"&&(s[l]=i(a[e],r))}return s};function qS(){let i=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[t,n]of Object.entries(e)){for(let[r,s]of Object.entries(n))e[r]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},n[r]=e[r],i.set(s[0],s[1]);Object.defineProperty(e,t,{value:n,enumerable:!1})}return Object.defineProperty(e,"codes",{value:i,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",gn(e.color,"ansi",()=>xn(Wh,"ansi16",js,!1)),gn(e.color,"ansi256",()=>xn(Vh,"ansi256",js,!1)),gn(e.color,"ansi16m",()=>xn(Kh,"rgb",Gh,!1)),gn(e.bgColor,"ansi",()=>xn(Wh,"ansi16",js,!0)),gn(e.bgColor,"ansi256",()=>xn(Vh,"ansi256",js,!0)),gn(e.bgColor,"ansi16m",()=>xn(Kh,"rgb",Gh,!0)),e}Object.defineProperty(Yh,"exports",{enumerable:!0,get:qS})});var Zh=C((NM,Xh)=>{"use strict";var LS=(i,e,t)=>{let n=i.indexOf(e);if(n===-1)return i;let r=e.length,s=0,o="";do o+=i.substr(s,n-s)+e+t,s=n+r,n=i.indexOf(e,s);while(n!==-1);return o+=i.substr(s),o},FS=(i,e,t,n)=>{let r=0,s="";do{let o=i[n-1]==="\r";s+=i.substr(r,(o?n-1:n)-r)+e+(o?`\r
|
|
21
21
|
`:`
|
|
22
|
-
`)+t,
|
|
23
|
-
`,
|
|
24
|
-
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function
|
|
25
|
-
`);return r!==-1&&(e=ES(e,s,n,r)),n+e+s},zc,Qh=(i,...e)=>{let[t]=e;if(!Rr(t)||!Rr(t.raw))return e.join(" ");let n=e.slice(1),s=[t.raw[0]];for(let r=1;r<t.length;r++)s.push(String(n[r-1]).replace(/[{}\\]/g,"\\$&"),String(t.raw[r]));return zc===void 0&&(zc=Gh()),zc(i,s.join(""))};Object.defineProperties(Pr.prototype,vn);var jr=Pr();jr.supportsColor=$c;jr.stderr=Pr({level:Wc?Wc.level:0});jr.stderr.supportsColor=Wc;em.exports=jr});var im={};bi(im,{TileManager:()=>Yc});var Nr,gn,Ir,tm,TS,MS,Yc,nm=yi(()=>{Nr=F(require("sharp"),1),gn=F(require("fs"),1),Ir=F(require("path"),1),tm=require("url"),TS=(0,tm.fileURLToPath)(__importMetaUrl),MS=Ir.default.dirname(TS),Yc=class{constructor(e){this.robot=e,this.tileSize=100,this.lastTileChecksums=new Map,this.screenWidth=0,this.screenHeight=0,this.tilesPerRow=0,this.tilesPerColumn=0,this.totalTiles=0,this.frameCount=0,this.tempDir=Ir.default.join(MS,"../../temp"),this.compressionQuality=1,this.changeThreshold=1,this.scaleFactor=.99,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,gn.default.existsSync(this.tempDir)||gn.default.mkdirSync(this.tempDir,{recursive:!0}),this.initializeScreenDimensions()}initializeScreenDimensions(){try{let{width:e,height:t}=this.robot.getScreenSize();this.screenWidth=e,this.screenHeight=t,this.detectDpiScale(),this.scaledWidth=Math.floor(e*this.scaleFactor),this.scaledHeight=Math.floor(t*this.scaleFactor),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 s=Math.ceil(Math.sqrt(this.scaledWidth*this.scaledHeight/n));this.tileSize=Math.max(s,120),this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}console.log(`\u{1F5A5}\uFE0F TileManager: ${e}x${t} (DPI ${this.dpiScale}x) -> ${this.totalTiles} tiles`)}catch(e){console.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(){let e=Math.min(100,this.screenWidth),t=Math.min(100,this.screenHeight),n=this.robot.screen.capture(0,0,e,t),r=n.byteWidth/n.bytesPerPixel/e;r>=1.9&&r<=2.1?this.dpiScale=2:this.dpiScale=1,this.captureWidth=Math.floor(this.screenWidth*this.dpiScale),this.captureHeight=Math.floor(this.screenHeight*this.dpiScale)}async captureFullScreen(){let e=this.robot.screen.capture(0,0,this.captureWidth,this.captureHeight),t=Buffer.from(e.image),n=new Uint32Array(t.buffer,t.byteOffset,t.length>>2);for(let p=0;p<n.length;p++){let f=n[p];n[p]=f&4278255360|(f&16711680)>>16|(f&255)<<16}let s=e.byteWidth/e.bytesPerPixel,r=e.height,o=t,a=s,l=r;if(this.dpiScale>1||this.scaleFactor<1){let p=Math.floor(this.screenWidth*this.scaleFactor),f=Math.floor(this.screenHeight*this.scaleFactor);o=await(0,Nr.default)(t,{raw:{width:s,height:r,channels:e.bytesPerPixel}}).resize(p,f,{kernel:Nr.default.kernel.nearest,fit:"fill"}).raw().toBuffer(),a=p,l=f}return{buffer:o,width:a,height:l,channels:e.bytesPerPixel}}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;try{let e=await this.getSharedScreenCapture(),t=[],n=[],s=new Map;this.frameCount++;for(let a=0;a<this.totalTiles;a++){let l=this.calculateTileChecksumDirect(e,a);s.set(a,l)}let r=Array.from(s.values());if(this.lastTileChecksums.size===0){let a=[];for(let p=0;p<this.totalTiles;p++)this.lastTileChecksums.set(p,s.get(p)),a.push(this.processTileAsync(e,p));let l=await Promise.all(a);return t.push(...l),{tiles:t,currentHashes:r}}for(let a=0;a<this.totalTiles;a++){let l=s.get(a),p=this.lastTileChecksums.get(a);l!==p&&(n.push(a),this.lastTileChecksums.set(a,l))}if(n.length/this.totalTiles>this.changeThreshold){let a=[];for(let p=0;p<this.totalTiles;p++)a.push(this.processTileAsync(e,p));let l=await Promise.all(a);t.push(...l.map(p=>({...p,fullRefresh:!0})))}else if(n.length>0){let a=n.map(p=>this.processTileAsync(e,p)),l=await Promise.all(a);t.push(...l)}return{tiles:t,currentHashes:r}}finally{this.isProcessing=!1}}async processTileAsync(e,t,n=null){let s=n||this.extractTile(e,t),r=await this.compressTileImage(s.buffer,s.width,s.height),{row:o,col:a}=this.getTilePosition(t);return{type:"tile-update",tileIndex:t,x:a*this.tileSize,y:o*this.tileSize,width:s.width,height:s.height,imageBuffer:r,timestamp:Date.now(),frameCount:this.frameCount}}calculateTileChecksum(e){let t=0;for(let n=0;n<e.length;n+=64)t+=e[n]||0,t^=e[n+1]||0,t+=(e[n+2]||0)<<1,t^=(e[n+3]||0)<<2;return t>>>0}calculateTileChecksumDirect(e,t){let{row:n,col:s}=this.getTilePosition(t),r=s*this.tileSize,o=n*this.tileSize,a=Math.min(r+this.tileSize,e.width),l=Math.min(o+this.tileSize,e.height),p=a-r,f=l-o,v=e.channels,_=e.width*v,E=0,C=16;for(let k=0;k<f;k+=4){let M=(o+k)*_+r*v;for(let O=0;O<p;O+=C){let A=M+O*v;E+=e.buffer[A]||0,E^=e.buffer[A+1]||0,E+=(e.buffer[A+2]||0)<<1,E^=(e.buffer[A+3]||0)<<2}}return E>>>0}getTilePosition(e){return{row:Math.floor(e/this.tilesPerRow),col:e%this.tilesPerRow}}extractTile(e,t){let{row:n,col:s}=this.getTilePosition(t),r=s*this.tileSize,o=n*this.tileSize,a=Math.min(r+this.tileSize,e.width),l=Math.min(o+this.tileSize,e.height),p=a-r,f=l-o,v=e.channels,_=p*v,E=Buffer.alloc(p*f*v);for(let C=0;C<f;C++){let k=((o+C)*e.width+r)*v,M=C*_;e.buffer.copy(E,M,k,k+_)}return{buffer:E,width:p,height:f,channels:v,tileIndex:t,x:r,y:o}}async compressTileImage(e,t,n){return(0,Nr.default)(e,{raw:{width:t,height:n,channels:4}}).jpeg({quality:80}).toBuffer()}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){console.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=[],s=[];this.frameCount++;let r=new Map;for(let a=0;a<this.totalTiles;a++){let l=this.calculateTileChecksumDirect(t,a);r.set(a,l),this.lastTileChecksums.set(a,l)}if(!e||e.length===0){let a=[];for(let p=0;p<this.totalTiles;p++)a.push(this.processTileAsync(t,p));let l=await Promise.all(a);return n.push(...l),{tiles:n,currentHashes:Array.from(r.values())}}for(let a=0;a<this.totalTiles;a++)e[a]!==r.get(a)&&s.push(a);if(s.length/this.totalTiles>this.changeThreshold){let a=[];for(let p=0;p<this.totalTiles;p++)a.push(this.processTileAsync(t,p));let l=await Promise.all(a);n.push(...l.map(p=>({...p,fullRefresh:!0})))}else if(s.length>0){let a=s.map(p=>this.processTileAsync(t,p)),l=await Promise.all(a);n.push(...l)}return{tiles:n,currentHashes:Array.from(r.values()),changedIndices:s}}finally{this.isProcessing=!1}}clearMemory(){this.sharedScreenCache=null,this.lastCaptureTime=0,this.lastTileChecksums.clear()}reset(){this.lastTileChecksums.clear(),this.frameCount=0}cleanup(){try{gn.default.existsSync(this.tempDir)&&gn.default.readdirSync(this.tempDir).forEach(t=>gn.default.unlinkSync(Ir.default.join(this.tempDir,t)))}catch(e){console.warn("Cleanup error:",e)}}}});var Qe,ns=yi(()=>{Qe={robotSettings:{mouseDelay:2,keyboardDelay:2},throttling:{mouseThrottle:8,keyThrottle:25,typeTextThrottle:100,maxTextLength:1e3},resourceManagement:{inactiveTimeout:12e4,memoryCheckInterval:6e4,memoryWarningThreshold:1e3,maxTimersPerClient:100,maxChunkTimersPerClient:50},streaming:{activeInterval:80,idleInterval:400,idleThreshold:3,actionCaptureDelay:50,chunkSize:32,chunkDelay:5}}});var sm={};bi(sm,{ResourceManager:()=>Jc});var Jc,rm=yi(()=>{ns();Jc=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>Qe.resourceManagement.memoryWarningThreshold&&(console.warn(`\u26A0\uFE0F High memory: ${t}MB`),this.cleanupInactiveClients())},Qe.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=Qe.resourceManagement.inactiveTimeout;for(let[n,s]of this.activeClients.entries())e-s.lastActivity>t&&(console.log(`\u{1F9F9} Cleaning inactive client: ${n}`),this.cleanupClientResources(n,s),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(r=>clearTimeout(r)),this.activeTimers.delete(e));let s=this.chunkTimers.get(e);s&&(s.forEach(r=>clearTimeout(r)),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 Qe.streaming}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 om={};bi(om,{ScreenUpdateHelper:()=>Xc});var Xc,am=yi(()=>{ns();Xc=class{constructor(e){this.resourceManager=e}async sendTilesInChunks(e,t,n,s=!1){if(!t||t.length===0)return;let r=Qe.streaming.chunkSize,o=[];for(let l=0;l<t.length;l+=r)o.push(t.slice(l,l+r));let a=this.resourceManager.getChunkTimers(e.id);for(let l=0;l<o.length;l++){let p=o[l],f=l===o.length-1,v=setTimeout(()=>{a.delete(v),e.connected&&e.emit("tiles-data",{tiles:p,timestamp:n,forceRefresh:!1,userAction:s,chunkInfo:{chunkIndex:l,totalChunks:o.length,isLastChunk:f}})},l*Qe.streaming.chunkDelay);a.add(v)}}}});var cm={};bi(cm,{MouseHandler:()=>Zc});var Zc,lm=yi(()=>{ns();Zc=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(s=>{let r=Date.now();if(!(r-this.lastMouseMove<Qe.throttling.mouseThrottle)){this.lastMouseMove=r;try{let o=n.getScreenSize(),a=Math.round(s.x/100*o.width),l=Math.round(s.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),f=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,f),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Mouse move error:",o.message)}}})),e.on("mouse-click",t(async s=>{try{let r=this.resourceManager.getClient(e.id);if(!r)return;let o=n.getScreenSize(),a=Math.round(s.x/100*o.width),l=Math.round(s.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),f=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,f),n.mouseClick(s.button||"left",s.double||!1),r.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(r){console.error("Mouse click error:",r.message)}})),e.on("mouse-press",t(async s=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(s.x/100*o.width),l=Math.round(s.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),f=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,f),n.mouseToggle("down",s.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(r){console.error("Mouse press error:",r.message)}})),e.on("mouse-release",t(async s=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(s.x/100*o.width),l=Math.round(s.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),f=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,f),n.mouseToggle("up",s.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(r){console.error("Mouse release error:",r.message)}})),e.on("scroll",t(async s=>{try{let{direction:r,amount:o=60,horizontal:a=!1}=s,l=this.resourceManager.getClient(e.id);if(!l)return;let p=0,f=0;a||r==="left"||r==="right"?p=r==="right"?o:-o:f=r==="down"?-o:o,n.scrollMouse(p,f),l.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(r){console.error("Scroll error:",r.message)}})),e.on("mouse-drag-select",t(s=>{try{let{startX:r,startY:o,endX:a,endY:l}=s,p=n.getScreenSize(),f=Math.round(r/100*p.width),v=Math.round(o/100*p.height),_=Math.round(a/100*p.width),E=Math.round(l/100*p.height),C=Math.max(0,Math.min(p.width-1,f)),k=Math.max(0,Math.min(p.height-1,v)),M=Math.max(0,Math.min(p.width-1,_)),O=Math.max(0,Math.min(p.height-1,E));n.moveMouse(C,k),n.mouseToggle("down","left"),n.dragMouse(M,O),n.mouseToggle("up","left"),this.resourceManager.updateClientActivity(e.id)}catch(r){console.error("Drag selection error:",r.message)}}))}}});var um={};bi(um,{KeyboardHandler:()=>Qc});var Qc,pm=yi(()=>{ns();Qc=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(s=>{let r=Date.now();if(!(r-this.lastKeyPress<Qe.throttling.keyThrottle)){this.lastKeyPress=r;try{if(!s.key||typeof s.key!="string")return;let o=this.resourceManager.getClient(e.id),a=s.key;if(a.length===1){n.keyTap(a,s.modifier||[]);for(let l of s.modifier||[])n.keyToggle(l,"up")}else switch(a.toLowerCase()){case"enter":case"return":n.keyTap("enter");break;case"space":n.keyTap(" ");break;case"backspace":n.keyTap("backspace");break;case"tab":n.keyTap("tab");break;case"escape":n.keyTap("escape");break;default:n.keyTap(a,s.modifier||[])}o&&(o.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Key press error:",o.message)}}})),e.on("type-text",t(s=>{let r=Date.now();if(!(r-this.lastTypeText<Qe.throttling.typeTextThrottle)){this.lastTypeText=r;try{if(!s.text||typeof s.text!="string")return;let o=s.text;o.length>Qe.throttling.maxTextLength&&(o=o.substring(0,Qe.throttling.maxTextLength));let a=o.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,""),l=this.resourceManager.getClient(e.id);setTimeout(()=>{try{n.typeString(a),this.resourceManager.updateClientActivity(e.id),l&&(l.idleFrameCount=0,l.tileManager&&l.tileManager.clearScreenCache())}catch(p){console.error("Robot typeString error:",p.message)}},10)}catch(o){console.error("Type text error:",o.message)}}}))}}});var dm={};bi(dm,{ScreenHandler:()=>el});var el,fm=yi(()=>{el=class{constructor(e,t){this.resourceManager=e,this.screenUpdateHelper=t}setupScreenHandlers(e,t){e.on("request-screen",t(async()=>{let n=this.resourceManager.getClient(e.id);if(n)try{let s=await n.tileManager.detectChangedTiles();s.length>0&&e.emit("tiles-data",{tiles:s,timestamp:Date.now()}),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Tile capture error:",s),e.emit("screen-error",{error:s.message})}})),e.on("request-screen-with-hashes",t(async n=>{let s=this.resourceManager.getClient(e.id);if(s)try{let r=n.tileHashes||[],o=await s.tileManager.compareClientTileHashes(r);o?.tiles?.length>0?e.emit("tiles-data",{tiles:o.tiles,timestamp:Date.now(),currentHashes:o.currentHashes,changedIndices:o.changedIndices}):e.emit("tiles-data",{tiles:[],timestamp:Date.now(),currentHashes:o.currentHashes,changedIndices:[]}),this.resourceManager.updateClientActivity(e.id)}catch(r){console.error("Tile capture with hashes error:",r),e.emit("screen-error",{error:r.message})}})),e.on("start-streaming",t(()=>{let n=this.resourceManager.getClient(e.id);if(!n)return;n.streamingTimeout&&(clearTimeout(n.streamingTimeout),n.streamingTimeout=null),console.log("\u{1F680} Remote streaming started"),n.idleFrameCount=0,n.isStreaming=!0;let s=async()=>{if(!e.connected||!n.isStreaming){n.streamingTimeout=null;return}try{let r=performance.now(),o=await n.tileManager.detectChangedTilesWithHashes();o.tiles.length>0&&e.connected?(e.emit("tiles-data",{tiles:o.tiles,timestamp:Date.now(),currentHashes:o.currentHashes}),n.idleFrameCount=0):n.idleFrameCount++;let{activeInterval:l,idleInterval:p,idleThreshold:f}=this.resourceManager.getStreamingConfig(),v=n.idleFrameCount>=f?p:l,_=Math.max(0,v-(performance.now()-r));n.streamingTimeout=setTimeout(s,_)}catch(r){console.error("Auto streaming error:",r),n.streamingTimeout=setTimeout(s,200)}};s()})),e.on("stop-streaming",()=>{let n=this.resourceManager.getClient(e.id);n&&(n.isStreaming=!1,n.streamingTimeout&&(clearTimeout(n.streamingTimeout),n.streamingTimeout=null),console.log("\u23F9\uFE0F Remote streaming stopped"))}),e.on("get-screen-dimensions",t(async()=>{let n=this.resourceManager.getClient(e.id);if(n)try{let s=await n.tileManager.getScreenDimensions();e.emit("screen-dimensions",s)}catch(s){console.error("Get dimensions error:",s),e.emit("screen-error",{error:s.message})}})),e.on("boost-stream",t(()=>{let n=this.resourceManager.getClient(e.id);n&&(n.idleFrameCount=0)}))}}});var ol=T((jm,rl)=>{(function(i,e){"use strict";function t(b,c){if(!b)throw new Error(c||"Assertion failed")}function n(b,c){b.super_=c;var d=function(){};d.prototype=c.prototype,b.prototype=new d,b.prototype.constructor=b}function s(b,c,d){if(s.isBN(b))return b;this.negative=0,this.words=null,this.length=0,this.red=null,b!==null&&((c==="le"||c==="be")&&(d=c,c=10),this._init(b||0,c||10,d||"be"))}typeof i=="object"?i.exports=s:e.BN=s,s.BN=s,s.wordSize=26;var r;try{typeof window<"u"&&typeof window.Buffer<"u"?r=window.Buffer:r=require("buffer").Buffer}catch{}s.isBN=function(c){return c instanceof s?!0:c!==null&&typeof c=="object"&&c.constructor.wordSize===s.wordSize&&Array.isArray(c.words)},s.max=function(c,d){return c.cmp(d)>0?c:d},s.min=function(c,d){return c.cmp(d)<0?c:d},s.prototype._init=function(c,d,h){if(typeof c=="number")return this._initNumber(c,d,h);if(typeof c=="object")return this._initArray(c,d,h);d==="hex"&&(d=16),t(d===(d|0)&&d>=2&&d<=36),c=c.toString().replace(/\s+/g,"");var m=0;c[0]==="-"&&(m++,this.negative=1),m<c.length&&(d===16?this._parseHex(c,m,h):(this._parseBase(c,d,m),h==="le"&&this._initArray(this.toArray(),d,h)))},s.prototype._initNumber=function(c,d,h){c<0&&(this.negative=1,c=-c),c<67108864?(this.words=[c&67108863],this.length=1):c<4503599627370496?(this.words=[c&67108863,c/67108864&67108863],this.length=2):(t(c<9007199254740992),this.words=[c&67108863,c/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),d,h)},s.prototype._initArray=function(c,d,h){if(t(typeof c.length=="number"),c.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(c.length/3),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var y,w,S=0;if(h==="be")for(m=c.length-1,y=0;m>=0;m-=3)w=c[m]|c[m-1]<<8|c[m-2]<<16,this.words[y]|=w<<S&67108863,this.words[y+1]=w>>>26-S&67108863,S+=24,S>=26&&(S-=26,y++);else if(h==="le")for(m=0,y=0;m<c.length;m+=3)w=c[m]|c[m+1]<<8|c[m+2]<<16,this.words[y]|=w<<S&67108863,this.words[y+1]=w>>>26-S&67108863,S+=24,S>=26&&(S-=26,y++);return this.strip()};function o(b,c){var d=b.charCodeAt(c);return d>=65&&d<=70?d-55:d>=97&&d<=102?d-87:d-48&15}function a(b,c,d){var h=o(b,d);return d-1>=c&&(h|=o(b,d-1)<<4),h}s.prototype._parseHex=function(c,d,h){this.length=Math.ceil((c.length-d)/6),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var y=0,w=0,S;if(h==="be")for(m=c.length-1;m>=d;m-=2)S=a(c,d,m)<<y,this.words[w]|=S&67108863,y>=18?(y-=18,w+=1,this.words[w]|=S>>>26):y+=8;else{var g=c.length-d;for(m=g%2===0?d+1:d;m<c.length;m+=2)S=a(c,d,m)<<y,this.words[w]|=S&67108863,y>=18?(y-=18,w+=1,this.words[w]|=S>>>26):y+=8}this.strip()};function l(b,c,d,h){for(var m=0,y=Math.min(b.length,d),w=c;w<y;w++){var S=b.charCodeAt(w)-48;m*=h,S>=49?m+=S-49+10:S>=17?m+=S-17+10:m+=S}return m}s.prototype._parseBase=function(c,d,h){this.words=[0],this.length=1;for(var m=0,y=1;y<=67108863;y*=d)m++;m--,y=y/d|0;for(var w=c.length-h,S=w%m,g=Math.min(w,w-S)+h,u=0,x=h;x<g;x+=m)u=l(c,x,x+m,d),this.imuln(y),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(S!==0){var P=1;for(u=l(c,x,c.length,d),x=0;x<S;x++)P*=d;this.imuln(P),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},s.prototype.copy=function(c){c.words=new Array(this.length);for(var d=0;d<this.length;d++)c.words[d]=this.words[d];c.length=this.length,c.negative=this.negative,c.red=this.red},s.prototype.clone=function(){var c=new s(null);return this.copy(c),c},s.prototype._expand=function(c){for(;this.length<c;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var p=["","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"],f=[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],v=[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];s.prototype.toString=function(c,d){c=c||10,d=d|0||1;var h;if(c===16||c==="hex"){h="";for(var m=0,y=0,w=0;w<this.length;w++){var S=this.words[w],g=((S<<m|y)&16777215).toString(16);y=S>>>24-m&16777215,m+=2,m>=26&&(m-=26,w--),y!==0||w!==this.length-1?h=p[6-g.length]+g+h:h=g+h}for(y!==0&&(h=y.toString(16)+h);h.length%d!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(c===(c|0)&&c>=2&&c<=36){var u=f[c],x=v[c];h="";var P=this.clone();for(P.negative=0;!P.isZero();){var B=P.modn(x).toString(c);P=P.idivn(x),P.isZero()?h=B+h:h=p[u-B.length]+B+h}for(this.isZero()&&(h="0"+h);h.length%d!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}t(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var c=this.words[0];return this.length===2?c+=this.words[1]*67108864:this.length===3&&this.words[2]===1?c+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-c:c},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(c,d){return t(typeof r<"u"),this.toArrayLike(r,c,d)},s.prototype.toArray=function(c,d){return this.toArrayLike(Array,c,d)},s.prototype.toArrayLike=function(c,d,h){var m=this.byteLength(),y=h||Math.max(1,m);t(m<=y,"byte array longer than desired length"),t(y>0,"Requested array length <= 0"),this.strip();var w=d==="le",S=new c(y),g,u,x=this.clone();if(w){for(u=0;!x.isZero();u++)g=x.andln(255),x.iushrn(8),S[u]=g;for(;u<y;u++)S[u]=0}else{for(u=0;u<y-m;u++)S[u]=0;for(u=0;!x.isZero();u++)g=x.andln(255),x.iushrn(8),S[y-u-1]=g}return S},Math.clz32?s.prototype._countBits=function(c){return 32-Math.clz32(c)}:s.prototype._countBits=function(c){var d=c,h=0;return d>=4096&&(h+=13,d>>>=13),d>=64&&(h+=7,d>>>=7),d>=8&&(h+=4,d>>>=4),d>=2&&(h+=2,d>>>=2),h+d},s.prototype._zeroBits=function(c){if(c===0)return 26;var d=c,h=0;return(d&8191)===0&&(h+=13,d>>>=13),(d&127)===0&&(h+=7,d>>>=7),(d&15)===0&&(h+=4,d>>>=4),(d&3)===0&&(h+=2,d>>>=2),(d&1)===0&&h++,h},s.prototype.bitLength=function(){var c=this.words[this.length-1],d=this._countBits(c);return(this.length-1)*26+d};function _(b){for(var c=new Array(b.bitLength()),d=0;d<c.length;d++){var h=d/26|0,m=d%26;c[d]=(b.words[h]&1<<m)>>>m}return c}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var c=0,d=0;d<this.length;d++){var h=this._zeroBits(this.words[d]);if(c+=h,h!==26)break}return c},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(c){return this.negative!==0?this.abs().inotn(c).iaddn(1):this.clone()},s.prototype.fromTwos=function(c){return this.testn(c-1)?this.notn(c).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(c){for(;this.length<c.length;)this.words[this.length++]=0;for(var d=0;d<c.length;d++)this.words[d]=this.words[d]|c.words[d];return this.strip()},s.prototype.ior=function(c){return t((this.negative|c.negative)===0),this.iuor(c)},s.prototype.or=function(c){return this.length>c.length?this.clone().ior(c):c.clone().ior(this)},s.prototype.uor=function(c){return this.length>c.length?this.clone().iuor(c):c.clone().iuor(this)},s.prototype.iuand=function(c){var d;this.length>c.length?d=c:d=this;for(var h=0;h<d.length;h++)this.words[h]=this.words[h]&c.words[h];return this.length=d.length,this.strip()},s.prototype.iand=function(c){return t((this.negative|c.negative)===0),this.iuand(c)},s.prototype.and=function(c){return this.length>c.length?this.clone().iand(c):c.clone().iand(this)},s.prototype.uand=function(c){return this.length>c.length?this.clone().iuand(c):c.clone().iuand(this)},s.prototype.iuxor=function(c){var d,h;this.length>c.length?(d=this,h=c):(d=c,h=this);for(var m=0;m<h.length;m++)this.words[m]=d.words[m]^h.words[m];if(this!==d)for(;m<d.length;m++)this.words[m]=d.words[m];return this.length=d.length,this.strip()},s.prototype.ixor=function(c){return t((this.negative|c.negative)===0),this.iuxor(c)},s.prototype.xor=function(c){return this.length>c.length?this.clone().ixor(c):c.clone().ixor(this)},s.prototype.uxor=function(c){return this.length>c.length?this.clone().iuxor(c):c.clone().iuxor(this)},s.prototype.inotn=function(c){t(typeof c=="number"&&c>=0);var d=Math.ceil(c/26)|0,h=c%26;this._expand(d),h>0&&d--;for(var m=0;m<d;m++)this.words[m]=~this.words[m]&67108863;return h>0&&(this.words[m]=~this.words[m]&67108863>>26-h),this.strip()},s.prototype.notn=function(c){return this.clone().inotn(c)},s.prototype.setn=function(c,d){t(typeof c=="number"&&c>=0);var h=c/26|0,m=c%26;return this._expand(h+1),d?this.words[h]=this.words[h]|1<<m:this.words[h]=this.words[h]&~(1<<m),this.strip()},s.prototype.iadd=function(c){var d;if(this.negative!==0&&c.negative===0)return this.negative=0,d=this.isub(c),this.negative^=1,this._normSign();if(this.negative===0&&c.negative!==0)return c.negative=0,d=this.isub(c),c.negative=1,d._normSign();var h,m;this.length>c.length?(h=this,m=c):(h=c,m=this);for(var y=0,w=0;w<m.length;w++)d=(h.words[w]|0)+(m.words[w]|0)+y,this.words[w]=d&67108863,y=d>>>26;for(;y!==0&&w<h.length;w++)d=(h.words[w]|0)+y,this.words[w]=d&67108863,y=d>>>26;if(this.length=h.length,y!==0)this.words[this.length]=y,this.length++;else if(h!==this)for(;w<h.length;w++)this.words[w]=h.words[w];return this},s.prototype.add=function(c){var d;return c.negative!==0&&this.negative===0?(c.negative=0,d=this.sub(c),c.negative^=1,d):c.negative===0&&this.negative!==0?(this.negative=0,d=c.sub(this),this.negative=1,d):this.length>c.length?this.clone().iadd(c):c.clone().iadd(this)},s.prototype.isub=function(c){if(c.negative!==0){c.negative=0;var d=this.iadd(c);return c.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(c),this.negative=1,this._normSign();var h=this.cmp(c);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,y;h>0?(m=this,y=c):(m=c,y=this);for(var w=0,S=0;S<y.length;S++)d=(m.words[S]|0)-(y.words[S]|0)+w,w=d>>26,this.words[S]=d&67108863;for(;w!==0&&S<m.length;S++)d=(m.words[S]|0)+w,w=d>>26,this.words[S]=d&67108863;if(w===0&&S<m.length&&m!==this)for(;S<m.length;S++)this.words[S]=m.words[S];return this.length=Math.max(this.length,S),m!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(c){return this.clone().isub(c)};function E(b,c,d){d.negative=c.negative^b.negative;var h=b.length+c.length|0;d.length=h,h=h-1|0;var m=b.words[0]|0,y=c.words[0]|0,w=m*y,S=w&67108863,g=w/67108864|0;d.words[0]=S;for(var u=1;u<h;u++){for(var x=g>>>26,P=g&67108863,B=Math.min(u,c.length-1),j=Math.max(0,u-b.length+1);j<=B;j++){var D=u-j|0;m=b.words[D]|0,y=c.words[j]|0,w=m*y+P,x+=w/67108864|0,P=w&67108863}d.words[u]=P|0,g=x|0}return g!==0?d.words[u]=g|0:d.length--,d.strip()}var C=function(c,d,h){var m=c.words,y=d.words,w=h.words,S=0,g,u,x,P=m[0]|0,B=P&8191,j=P>>>13,D=m[1]|0,z=D&8191,G=D>>>13,si=m[2]|0,Y=si&8191,X=si>>>13,hu=m[3]|0,se=hu&8191,re=hu>>>13,mu=m[4]|0,oe=mu&8191,ae=mu>>>13,vu=m[5]|0,ce=vu&8191,le=vu>>>13,gu=m[6]|0,ue=gu&8191,pe=gu>>>13,xu=m[7]|0,de=xu&8191,fe=xu>>>13,yu=m[8]|0,he=yu&8191,me=yu>>>13,bu=m[9]|0,ve=bu&8191,ge=bu>>>13,wu=y[0]|0,xe=wu&8191,ye=wu>>>13,_u=y[1]|0,be=_u&8191,we=_u>>>13,Su=y[2]|0,_e=Su&8191,Se=Su>>>13,Eu=y[3]|0,Ee=Eu&8191,ke=Eu>>>13,ku=y[4]|0,Ce=ku&8191,Te=ku>>>13,Cu=y[5]|0,Me=Cu&8191,Oe=Cu>>>13,Tu=y[6]|0,Ae=Tu&8191,Re=Tu>>>13,Mu=y[7]|0,Pe=Mu&8191,Be=Mu>>>13,Ou=y[8]|0,je=Ou&8191,Ne=Ou>>>13,Au=y[9]|0,Ie=Au&8191,De=Au>>>13;h.negative=c.negative^d.negative,h.length=19,g=Math.imul(B,xe),u=Math.imul(B,ye),u=u+Math.imul(j,xe)|0,x=Math.imul(j,ye);var Ao=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Ao>>>26)|0,Ao&=67108863,g=Math.imul(z,xe),u=Math.imul(z,ye),u=u+Math.imul(G,xe)|0,x=Math.imul(G,ye),g=g+Math.imul(B,be)|0,u=u+Math.imul(B,we)|0,u=u+Math.imul(j,be)|0,x=x+Math.imul(j,we)|0;var Ro=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Ro>>>26)|0,Ro&=67108863,g=Math.imul(Y,xe),u=Math.imul(Y,ye),u=u+Math.imul(X,xe)|0,x=Math.imul(X,ye),g=g+Math.imul(z,be)|0,u=u+Math.imul(z,we)|0,u=u+Math.imul(G,be)|0,x=x+Math.imul(G,we)|0,g=g+Math.imul(B,_e)|0,u=u+Math.imul(B,Se)|0,u=u+Math.imul(j,_e)|0,x=x+Math.imul(j,Se)|0;var Po=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Po>>>26)|0,Po&=67108863,g=Math.imul(se,xe),u=Math.imul(se,ye),u=u+Math.imul(re,xe)|0,x=Math.imul(re,ye),g=g+Math.imul(Y,be)|0,u=u+Math.imul(Y,we)|0,u=u+Math.imul(X,be)|0,x=x+Math.imul(X,we)|0,g=g+Math.imul(z,_e)|0,u=u+Math.imul(z,Se)|0,u=u+Math.imul(G,_e)|0,x=x+Math.imul(G,Se)|0,g=g+Math.imul(B,Ee)|0,u=u+Math.imul(B,ke)|0,u=u+Math.imul(j,Ee)|0,x=x+Math.imul(j,ke)|0;var Bo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,g=Math.imul(oe,xe),u=Math.imul(oe,ye),u=u+Math.imul(ae,xe)|0,x=Math.imul(ae,ye),g=g+Math.imul(se,be)|0,u=u+Math.imul(se,we)|0,u=u+Math.imul(re,be)|0,x=x+Math.imul(re,we)|0,g=g+Math.imul(Y,_e)|0,u=u+Math.imul(Y,Se)|0,u=u+Math.imul(X,_e)|0,x=x+Math.imul(X,Se)|0,g=g+Math.imul(z,Ee)|0,u=u+Math.imul(z,ke)|0,u=u+Math.imul(G,Ee)|0,x=x+Math.imul(G,ke)|0,g=g+Math.imul(B,Ce)|0,u=u+Math.imul(B,Te)|0,u=u+Math.imul(j,Ce)|0,x=x+Math.imul(j,Te)|0;var jo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(jo>>>26)|0,jo&=67108863,g=Math.imul(ce,xe),u=Math.imul(ce,ye),u=u+Math.imul(le,xe)|0,x=Math.imul(le,ye),g=g+Math.imul(oe,be)|0,u=u+Math.imul(oe,we)|0,u=u+Math.imul(ae,be)|0,x=x+Math.imul(ae,we)|0,g=g+Math.imul(se,_e)|0,u=u+Math.imul(se,Se)|0,u=u+Math.imul(re,_e)|0,x=x+Math.imul(re,Se)|0,g=g+Math.imul(Y,Ee)|0,u=u+Math.imul(Y,ke)|0,u=u+Math.imul(X,Ee)|0,x=x+Math.imul(X,ke)|0,g=g+Math.imul(z,Ce)|0,u=u+Math.imul(z,Te)|0,u=u+Math.imul(G,Ce)|0,x=x+Math.imul(G,Te)|0,g=g+Math.imul(B,Me)|0,u=u+Math.imul(B,Oe)|0,u=u+Math.imul(j,Me)|0,x=x+Math.imul(j,Oe)|0;var No=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(No>>>26)|0,No&=67108863,g=Math.imul(ue,xe),u=Math.imul(ue,ye),u=u+Math.imul(pe,xe)|0,x=Math.imul(pe,ye),g=g+Math.imul(ce,be)|0,u=u+Math.imul(ce,we)|0,u=u+Math.imul(le,be)|0,x=x+Math.imul(le,we)|0,g=g+Math.imul(oe,_e)|0,u=u+Math.imul(oe,Se)|0,u=u+Math.imul(ae,_e)|0,x=x+Math.imul(ae,Se)|0,g=g+Math.imul(se,Ee)|0,u=u+Math.imul(se,ke)|0,u=u+Math.imul(re,Ee)|0,x=x+Math.imul(re,ke)|0,g=g+Math.imul(Y,Ce)|0,u=u+Math.imul(Y,Te)|0,u=u+Math.imul(X,Ce)|0,x=x+Math.imul(X,Te)|0,g=g+Math.imul(z,Me)|0,u=u+Math.imul(z,Oe)|0,u=u+Math.imul(G,Me)|0,x=x+Math.imul(G,Oe)|0,g=g+Math.imul(B,Ae)|0,u=u+Math.imul(B,Re)|0,u=u+Math.imul(j,Ae)|0,x=x+Math.imul(j,Re)|0;var Io=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Io>>>26)|0,Io&=67108863,g=Math.imul(de,xe),u=Math.imul(de,ye),u=u+Math.imul(fe,xe)|0,x=Math.imul(fe,ye),g=g+Math.imul(ue,be)|0,u=u+Math.imul(ue,we)|0,u=u+Math.imul(pe,be)|0,x=x+Math.imul(pe,we)|0,g=g+Math.imul(ce,_e)|0,u=u+Math.imul(ce,Se)|0,u=u+Math.imul(le,_e)|0,x=x+Math.imul(le,Se)|0,g=g+Math.imul(oe,Ee)|0,u=u+Math.imul(oe,ke)|0,u=u+Math.imul(ae,Ee)|0,x=x+Math.imul(ae,ke)|0,g=g+Math.imul(se,Ce)|0,u=u+Math.imul(se,Te)|0,u=u+Math.imul(re,Ce)|0,x=x+Math.imul(re,Te)|0,g=g+Math.imul(Y,Me)|0,u=u+Math.imul(Y,Oe)|0,u=u+Math.imul(X,Me)|0,x=x+Math.imul(X,Oe)|0,g=g+Math.imul(z,Ae)|0,u=u+Math.imul(z,Re)|0,u=u+Math.imul(G,Ae)|0,x=x+Math.imul(G,Re)|0,g=g+Math.imul(B,Pe)|0,u=u+Math.imul(B,Be)|0,u=u+Math.imul(j,Pe)|0,x=x+Math.imul(j,Be)|0;var Do=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Do>>>26)|0,Do&=67108863,g=Math.imul(he,xe),u=Math.imul(he,ye),u=u+Math.imul(me,xe)|0,x=Math.imul(me,ye),g=g+Math.imul(de,be)|0,u=u+Math.imul(de,we)|0,u=u+Math.imul(fe,be)|0,x=x+Math.imul(fe,we)|0,g=g+Math.imul(ue,_e)|0,u=u+Math.imul(ue,Se)|0,u=u+Math.imul(pe,_e)|0,x=x+Math.imul(pe,Se)|0,g=g+Math.imul(ce,Ee)|0,u=u+Math.imul(ce,ke)|0,u=u+Math.imul(le,Ee)|0,x=x+Math.imul(le,ke)|0,g=g+Math.imul(oe,Ce)|0,u=u+Math.imul(oe,Te)|0,u=u+Math.imul(ae,Ce)|0,x=x+Math.imul(ae,Te)|0,g=g+Math.imul(se,Me)|0,u=u+Math.imul(se,Oe)|0,u=u+Math.imul(re,Me)|0,x=x+Math.imul(re,Oe)|0,g=g+Math.imul(Y,Ae)|0,u=u+Math.imul(Y,Re)|0,u=u+Math.imul(X,Ae)|0,x=x+Math.imul(X,Re)|0,g=g+Math.imul(z,Pe)|0,u=u+Math.imul(z,Be)|0,u=u+Math.imul(G,Pe)|0,x=x+Math.imul(G,Be)|0,g=g+Math.imul(B,je)|0,u=u+Math.imul(B,Ne)|0,u=u+Math.imul(j,je)|0,x=x+Math.imul(j,Ne)|0;var qo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(qo>>>26)|0,qo&=67108863,g=Math.imul(ve,xe),u=Math.imul(ve,ye),u=u+Math.imul(ge,xe)|0,x=Math.imul(ge,ye),g=g+Math.imul(he,be)|0,u=u+Math.imul(he,we)|0,u=u+Math.imul(me,be)|0,x=x+Math.imul(me,we)|0,g=g+Math.imul(de,_e)|0,u=u+Math.imul(de,Se)|0,u=u+Math.imul(fe,_e)|0,x=x+Math.imul(fe,Se)|0,g=g+Math.imul(ue,Ee)|0,u=u+Math.imul(ue,ke)|0,u=u+Math.imul(pe,Ee)|0,x=x+Math.imul(pe,ke)|0,g=g+Math.imul(ce,Ce)|0,u=u+Math.imul(ce,Te)|0,u=u+Math.imul(le,Ce)|0,x=x+Math.imul(le,Te)|0,g=g+Math.imul(oe,Me)|0,u=u+Math.imul(oe,Oe)|0,u=u+Math.imul(ae,Me)|0,x=x+Math.imul(ae,Oe)|0,g=g+Math.imul(se,Ae)|0,u=u+Math.imul(se,Re)|0,u=u+Math.imul(re,Ae)|0,x=x+Math.imul(re,Re)|0,g=g+Math.imul(Y,Pe)|0,u=u+Math.imul(Y,Be)|0,u=u+Math.imul(X,Pe)|0,x=x+Math.imul(X,Be)|0,g=g+Math.imul(z,je)|0,u=u+Math.imul(z,Ne)|0,u=u+Math.imul(G,je)|0,x=x+Math.imul(G,Ne)|0,g=g+Math.imul(B,Ie)|0,u=u+Math.imul(B,De)|0,u=u+Math.imul(j,Ie)|0,x=x+Math.imul(j,De)|0;var Lo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,g=Math.imul(ve,be),u=Math.imul(ve,we),u=u+Math.imul(ge,be)|0,x=Math.imul(ge,we),g=g+Math.imul(he,_e)|0,u=u+Math.imul(he,Se)|0,u=u+Math.imul(me,_e)|0,x=x+Math.imul(me,Se)|0,g=g+Math.imul(de,Ee)|0,u=u+Math.imul(de,ke)|0,u=u+Math.imul(fe,Ee)|0,x=x+Math.imul(fe,ke)|0,g=g+Math.imul(ue,Ce)|0,u=u+Math.imul(ue,Te)|0,u=u+Math.imul(pe,Ce)|0,x=x+Math.imul(pe,Te)|0,g=g+Math.imul(ce,Me)|0,u=u+Math.imul(ce,Oe)|0,u=u+Math.imul(le,Me)|0,x=x+Math.imul(le,Oe)|0,g=g+Math.imul(oe,Ae)|0,u=u+Math.imul(oe,Re)|0,u=u+Math.imul(ae,Ae)|0,x=x+Math.imul(ae,Re)|0,g=g+Math.imul(se,Pe)|0,u=u+Math.imul(se,Be)|0,u=u+Math.imul(re,Pe)|0,x=x+Math.imul(re,Be)|0,g=g+Math.imul(Y,je)|0,u=u+Math.imul(Y,Ne)|0,u=u+Math.imul(X,je)|0,x=x+Math.imul(X,Ne)|0,g=g+Math.imul(z,Ie)|0,u=u+Math.imul(z,De)|0,u=u+Math.imul(G,Ie)|0,x=x+Math.imul(G,De)|0;var Fo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Fo>>>26)|0,Fo&=67108863,g=Math.imul(ve,_e),u=Math.imul(ve,Se),u=u+Math.imul(ge,_e)|0,x=Math.imul(ge,Se),g=g+Math.imul(he,Ee)|0,u=u+Math.imul(he,ke)|0,u=u+Math.imul(me,Ee)|0,x=x+Math.imul(me,ke)|0,g=g+Math.imul(de,Ce)|0,u=u+Math.imul(de,Te)|0,u=u+Math.imul(fe,Ce)|0,x=x+Math.imul(fe,Te)|0,g=g+Math.imul(ue,Me)|0,u=u+Math.imul(ue,Oe)|0,u=u+Math.imul(pe,Me)|0,x=x+Math.imul(pe,Oe)|0,g=g+Math.imul(ce,Ae)|0,u=u+Math.imul(ce,Re)|0,u=u+Math.imul(le,Ae)|0,x=x+Math.imul(le,Re)|0,g=g+Math.imul(oe,Pe)|0,u=u+Math.imul(oe,Be)|0,u=u+Math.imul(ae,Pe)|0,x=x+Math.imul(ae,Be)|0,g=g+Math.imul(se,je)|0,u=u+Math.imul(se,Ne)|0,u=u+Math.imul(re,je)|0,x=x+Math.imul(re,Ne)|0,g=g+Math.imul(Y,Ie)|0,u=u+Math.imul(Y,De)|0,u=u+Math.imul(X,Ie)|0,x=x+Math.imul(X,De)|0;var Uo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,g=Math.imul(ve,Ee),u=Math.imul(ve,ke),u=u+Math.imul(ge,Ee)|0,x=Math.imul(ge,ke),g=g+Math.imul(he,Ce)|0,u=u+Math.imul(he,Te)|0,u=u+Math.imul(me,Ce)|0,x=x+Math.imul(me,Te)|0,g=g+Math.imul(de,Me)|0,u=u+Math.imul(de,Oe)|0,u=u+Math.imul(fe,Me)|0,x=x+Math.imul(fe,Oe)|0,g=g+Math.imul(ue,Ae)|0,u=u+Math.imul(ue,Re)|0,u=u+Math.imul(pe,Ae)|0,x=x+Math.imul(pe,Re)|0,g=g+Math.imul(ce,Pe)|0,u=u+Math.imul(ce,Be)|0,u=u+Math.imul(le,Pe)|0,x=x+Math.imul(le,Be)|0,g=g+Math.imul(oe,je)|0,u=u+Math.imul(oe,Ne)|0,u=u+Math.imul(ae,je)|0,x=x+Math.imul(ae,Ne)|0,g=g+Math.imul(se,Ie)|0,u=u+Math.imul(se,De)|0,u=u+Math.imul(re,Ie)|0,x=x+Math.imul(re,De)|0;var Ho=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Ho>>>26)|0,Ho&=67108863,g=Math.imul(ve,Ce),u=Math.imul(ve,Te),u=u+Math.imul(ge,Ce)|0,x=Math.imul(ge,Te),g=g+Math.imul(he,Me)|0,u=u+Math.imul(he,Oe)|0,u=u+Math.imul(me,Me)|0,x=x+Math.imul(me,Oe)|0,g=g+Math.imul(de,Ae)|0,u=u+Math.imul(de,Re)|0,u=u+Math.imul(fe,Ae)|0,x=x+Math.imul(fe,Re)|0,g=g+Math.imul(ue,Pe)|0,u=u+Math.imul(ue,Be)|0,u=u+Math.imul(pe,Pe)|0,x=x+Math.imul(pe,Be)|0,g=g+Math.imul(ce,je)|0,u=u+Math.imul(ce,Ne)|0,u=u+Math.imul(le,je)|0,x=x+Math.imul(le,Ne)|0,g=g+Math.imul(oe,Ie)|0,u=u+Math.imul(oe,De)|0,u=u+Math.imul(ae,Ie)|0,x=x+Math.imul(ae,De)|0;var zo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(zo>>>26)|0,zo&=67108863,g=Math.imul(ve,Me),u=Math.imul(ve,Oe),u=u+Math.imul(ge,Me)|0,x=Math.imul(ge,Oe),g=g+Math.imul(he,Ae)|0,u=u+Math.imul(he,Re)|0,u=u+Math.imul(me,Ae)|0,x=x+Math.imul(me,Re)|0,g=g+Math.imul(de,Pe)|0,u=u+Math.imul(de,Be)|0,u=u+Math.imul(fe,Pe)|0,x=x+Math.imul(fe,Be)|0,g=g+Math.imul(ue,je)|0,u=u+Math.imul(ue,Ne)|0,u=u+Math.imul(pe,je)|0,x=x+Math.imul(pe,Ne)|0,g=g+Math.imul(ce,Ie)|0,u=u+Math.imul(ce,De)|0,u=u+Math.imul(le,Ie)|0,x=x+Math.imul(le,De)|0;var $o=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+($o>>>26)|0,$o&=67108863,g=Math.imul(ve,Ae),u=Math.imul(ve,Re),u=u+Math.imul(ge,Ae)|0,x=Math.imul(ge,Re),g=g+Math.imul(he,Pe)|0,u=u+Math.imul(he,Be)|0,u=u+Math.imul(me,Pe)|0,x=x+Math.imul(me,Be)|0,g=g+Math.imul(de,je)|0,u=u+Math.imul(de,Ne)|0,u=u+Math.imul(fe,je)|0,x=x+Math.imul(fe,Ne)|0,g=g+Math.imul(ue,Ie)|0,u=u+Math.imul(ue,De)|0,u=u+Math.imul(pe,Ie)|0,x=x+Math.imul(pe,De)|0;var Wo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Wo>>>26)|0,Wo&=67108863,g=Math.imul(ve,Pe),u=Math.imul(ve,Be),u=u+Math.imul(ge,Pe)|0,x=Math.imul(ge,Be),g=g+Math.imul(he,je)|0,u=u+Math.imul(he,Ne)|0,u=u+Math.imul(me,je)|0,x=x+Math.imul(me,Ne)|0,g=g+Math.imul(de,Ie)|0,u=u+Math.imul(de,De)|0,u=u+Math.imul(fe,Ie)|0,x=x+Math.imul(fe,De)|0;var Vo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Vo>>>26)|0,Vo&=67108863,g=Math.imul(ve,je),u=Math.imul(ve,Ne),u=u+Math.imul(ge,je)|0,x=Math.imul(ge,Ne),g=g+Math.imul(he,Ie)|0,u=u+Math.imul(he,De)|0,u=u+Math.imul(me,Ie)|0,x=x+Math.imul(me,De)|0;var Ko=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Ko>>>26)|0,Ko&=67108863,g=Math.imul(ve,Ie),u=Math.imul(ve,De),u=u+Math.imul(ge,Ie)|0,x=Math.imul(ge,De);var Go=(S+g|0)+((u&8191)<<13)|0;return S=(x+(u>>>13)|0)+(Go>>>26)|0,Go&=67108863,w[0]=Ao,w[1]=Ro,w[2]=Po,w[3]=Bo,w[4]=jo,w[5]=No,w[6]=Io,w[7]=Do,w[8]=qo,w[9]=Lo,w[10]=Fo,w[11]=Uo,w[12]=Ho,w[13]=zo,w[14]=$o,w[15]=Wo,w[16]=Vo,w[17]=Ko,w[18]=Go,S!==0&&(w[19]=S,h.length++),h};Math.imul||(C=E);function k(b,c,d){d.negative=c.negative^b.negative,d.length=b.length+c.length;for(var h=0,m=0,y=0;y<d.length-1;y++){var w=m;m=0;for(var S=h&67108863,g=Math.min(y,c.length-1),u=Math.max(0,y-b.length+1);u<=g;u++){var x=y-u,P=b.words[x]|0,B=c.words[u]|0,j=P*B,D=j&67108863;w=w+(j/67108864|0)|0,D=D+S|0,S=D&67108863,w=w+(D>>>26)|0,m+=w>>>26,w&=67108863}d.words[y]=S,h=w,w=m}return h!==0?d.words[y]=h:d.length--,d.strip()}function M(b,c,d){var h=new O;return h.mulp(b,c,d)}s.prototype.mulTo=function(c,d){var h,m=this.length+c.length;return this.length===10&&c.length===10?h=C(this,c,d):m<63?h=E(this,c,d):m<1024?h=k(this,c,d):h=M(this,c,d),h};function O(b,c){this.x=b,this.y=c}O.prototype.makeRBT=function(c){for(var d=new Array(c),h=s.prototype._countBits(c)-1,m=0;m<c;m++)d[m]=this.revBin(m,h,c);return d},O.prototype.revBin=function(c,d,h){if(c===0||c===h-1)return c;for(var m=0,y=0;y<d;y++)m|=(c&1)<<d-y-1,c>>=1;return m},O.prototype.permute=function(c,d,h,m,y,w){for(var S=0;S<w;S++)m[S]=d[c[S]],y[S]=h[c[S]]},O.prototype.transform=function(c,d,h,m,y,w){this.permute(w,c,d,h,m,y);for(var S=1;S<y;S<<=1)for(var g=S<<1,u=Math.cos(2*Math.PI/g),x=Math.sin(2*Math.PI/g),P=0;P<y;P+=g)for(var B=u,j=x,D=0;D<S;D++){var z=h[P+D],G=m[P+D],si=h[P+D+S],Y=m[P+D+S],X=B*si-j*Y;Y=B*Y+j*si,si=X,h[P+D]=z+si,m[P+D]=G+Y,h[P+D+S]=z-si,m[P+D+S]=G-Y,D!==g&&(X=u*B-x*j,j=u*j+x*B,B=X)}},O.prototype.guessLen13b=function(c,d){var h=Math.max(d,c)|1,m=h&1,y=0;for(h=h/2|0;h;h=h>>>1)y++;return 1<<y+1+m},O.prototype.conjugate=function(c,d,h){if(!(h<=1))for(var m=0;m<h/2;m++){var y=c[m];c[m]=c[h-m-1],c[h-m-1]=y,y=d[m],d[m]=-d[h-m-1],d[h-m-1]=-y}},O.prototype.normalize13b=function(c,d){for(var h=0,m=0;m<d/2;m++){var y=Math.round(c[2*m+1]/d)*8192+Math.round(c[2*m]/d)+h;c[m]=y&67108863,y<67108864?h=0:h=y/67108864|0}return c},O.prototype.convert13b=function(c,d,h,m){for(var y=0,w=0;w<d;w++)y=y+(c[w]|0),h[2*w]=y&8191,y=y>>>13,h[2*w+1]=y&8191,y=y>>>13;for(w=2*d;w<m;++w)h[w]=0;t(y===0),t((y&-8192)===0)},O.prototype.stub=function(c){for(var d=new Array(c),h=0;h<c;h++)d[h]=0;return d},O.prototype.mulp=function(c,d,h){var m=2*this.guessLen13b(c.length,d.length),y=this.makeRBT(m),w=this.stub(m),S=new Array(m),g=new Array(m),u=new Array(m),x=new Array(m),P=new Array(m),B=new Array(m),j=h.words;j.length=m,this.convert13b(c.words,c.length,S,m),this.convert13b(d.words,d.length,x,m),this.transform(S,w,g,u,m,y),this.transform(x,w,P,B,m,y);for(var D=0;D<m;D++){var z=g[D]*P[D]-u[D]*B[D];u[D]=g[D]*B[D]+u[D]*P[D],g[D]=z}return this.conjugate(g,u,m),this.transform(g,u,j,w,m,y),this.conjugate(j,w,m),this.normalize13b(j,m),h.negative=c.negative^d.negative,h.length=c.length+d.length,h.strip()},s.prototype.mul=function(c){var d=new s(null);return d.words=new Array(this.length+c.length),this.mulTo(c,d)},s.prototype.mulf=function(c){var d=new s(null);return d.words=new Array(this.length+c.length),M(this,c,d)},s.prototype.imul=function(c){return this.clone().mulTo(c,this)},s.prototype.imuln=function(c){t(typeof c=="number"),t(c<67108864);for(var d=0,h=0;h<this.length;h++){var m=(this.words[h]|0)*c,y=(m&67108863)+(d&67108863);d>>=26,d+=m/67108864|0,d+=y>>>26,this.words[h]=y&67108863}return d!==0&&(this.words[h]=d,this.length++),this.length=c===0?1:this.length,this},s.prototype.muln=function(c){return this.clone().imuln(c)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(c){var d=_(c);if(d.length===0)return new s(1);for(var h=this,m=0;m<d.length&&d[m]===0;m++,h=h.sqr());if(++m<d.length)for(var y=h.sqr();m<d.length;m++,y=y.sqr())d[m]!==0&&(h=h.mul(y));return h},s.prototype.iushln=function(c){t(typeof c=="number"&&c>=0);var d=c%26,h=(c-d)/26,m=67108863>>>26-d<<26-d,y;if(d!==0){var w=0;for(y=0;y<this.length;y++){var S=this.words[y]&m,g=(this.words[y]|0)-S<<d;this.words[y]=g|w,w=S>>>26-d}w&&(this.words[y]=w,this.length++)}if(h!==0){for(y=this.length-1;y>=0;y--)this.words[y+h]=this.words[y];for(y=0;y<h;y++)this.words[y]=0;this.length+=h}return this.strip()},s.prototype.ishln=function(c){return t(this.negative===0),this.iushln(c)},s.prototype.iushrn=function(c,d,h){t(typeof c=="number"&&c>=0);var m;d?m=(d-d%26)/26:m=0;var y=c%26,w=Math.min((c-y)/26,this.length),S=67108863^67108863>>>y<<y,g=h;if(m-=w,m=Math.max(0,m),g){for(var u=0;u<w;u++)g.words[u]=this.words[u];g.length=w}if(w!==0)if(this.length>w)for(this.length-=w,u=0;u<this.length;u++)this.words[u]=this.words[u+w];else this.words[0]=0,this.length=1;var x=0;for(u=this.length-1;u>=0&&(x!==0||u>=m);u--){var P=this.words[u]|0;this.words[u]=x<<26-y|P>>>y,x=P&S}return g&&x!==0&&(g.words[g.length++]=x),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(c,d,h){return t(this.negative===0),this.iushrn(c,d,h)},s.prototype.shln=function(c){return this.clone().ishln(c)},s.prototype.ushln=function(c){return this.clone().iushln(c)},s.prototype.shrn=function(c){return this.clone().ishrn(c)},s.prototype.ushrn=function(c){return this.clone().iushrn(c)},s.prototype.testn=function(c){t(typeof c=="number"&&c>=0);var d=c%26,h=(c-d)/26,m=1<<d;if(this.length<=h)return!1;var y=this.words[h];return!!(y&m)},s.prototype.imaskn=function(c){t(typeof c=="number"&&c>=0);var d=c%26,h=(c-d)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(d!==0&&h++,this.length=Math.min(h,this.length),d!==0){var m=67108863^67108863>>>d<<d;this.words[this.length-1]&=m}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.maskn=function(c){return this.clone().imaskn(c)},s.prototype.iaddn=function(c){return t(typeof c=="number"),t(c<67108864),c<0?this.isubn(-c):this.negative!==0?this.length===1&&(this.words[0]|0)<c?(this.words[0]=c-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(c),this.negative=1,this):this._iaddn(c)},s.prototype._iaddn=function(c){this.words[0]+=c;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},s.prototype.isubn=function(c){if(t(typeof c=="number"),t(c<67108864),c<0)return this.iaddn(-c);if(this.negative!==0)return this.negative=0,this.iaddn(c),this.negative=1,this;if(this.words[0]-=c,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this.strip()},s.prototype.addn=function(c){return this.clone().iaddn(c)},s.prototype.subn=function(c){return this.clone().isubn(c)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(c,d,h){var m=c.length+h,y;this._expand(m);var w,S=0;for(y=0;y<c.length;y++){w=(this.words[y+h]|0)+S;var g=(c.words[y]|0)*d;w-=g&67108863,S=(w>>26)-(g/67108864|0),this.words[y+h]=w&67108863}for(;y<this.length-h;y++)w=(this.words[y+h]|0)+S,S=w>>26,this.words[y+h]=w&67108863;if(S===0)return this.strip();for(t(S===-1),S=0,y=0;y<this.length;y++)w=-(this.words[y]|0)+S,S=w>>26,this.words[y]=w&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(c,d){var h=this.length-c.length,m=this.clone(),y=c,w=y.words[y.length-1]|0,S=this._countBits(w);h=26-S,h!==0&&(y=y.ushln(h),m.iushln(h),w=y.words[y.length-1]|0);var g=m.length-y.length,u;if(d!=="mod"){u=new s(null),u.length=g+1,u.words=new Array(u.length);for(var x=0;x<u.length;x++)u.words[x]=0}var P=m.clone()._ishlnsubmul(y,1,g);P.negative===0&&(m=P,u&&(u.words[g]=1));for(var B=g-1;B>=0;B--){var j=(m.words[y.length+B]|0)*67108864+(m.words[y.length+B-1]|0);for(j=Math.min(j/w|0,67108863),m._ishlnsubmul(y,j,B);m.negative!==0;)j--,m.negative=0,m._ishlnsubmul(y,1,B),m.isZero()||(m.negative^=1);u&&(u.words[B]=j)}return u&&u.strip(),m.strip(),d!=="div"&&h!==0&&m.iushrn(h),{div:u||null,mod:m}},s.prototype.divmod=function(c,d,h){if(t(!c.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var m,y,w;return this.negative!==0&&c.negative===0?(w=this.neg().divmod(c,d),d!=="mod"&&(m=w.div.neg()),d!=="div"&&(y=w.mod.neg(),h&&y.negative!==0&&y.iadd(c)),{div:m,mod:y}):this.negative===0&&c.negative!==0?(w=this.divmod(c.neg(),d),d!=="mod"&&(m=w.div.neg()),{div:m,mod:w.mod}):(this.negative&c.negative)!==0?(w=this.neg().divmod(c.neg(),d),d!=="div"&&(y=w.mod.neg(),h&&y.negative!==0&&y.isub(c)),{div:w.div,mod:y}):c.length>this.length||this.cmp(c)<0?{div:new s(0),mod:this}:c.length===1?d==="div"?{div:this.divn(c.words[0]),mod:null}:d==="mod"?{div:null,mod:new s(this.modn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new s(this.modn(c.words[0]))}:this._wordDiv(c,d)},s.prototype.div=function(c){return this.divmod(c,"div",!1).div},s.prototype.mod=function(c){return this.divmod(c,"mod",!1).mod},s.prototype.umod=function(c){return this.divmod(c,"mod",!0).mod},s.prototype.divRound=function(c){var d=this.divmod(c);if(d.mod.isZero())return d.div;var h=d.div.negative!==0?d.mod.isub(c):d.mod,m=c.ushrn(1),y=c.andln(1),w=h.cmp(m);return w<0||y===1&&w===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},s.prototype.modn=function(c){t(c<=67108863);for(var d=(1<<26)%c,h=0,m=this.length-1;m>=0;m--)h=(d*h+(this.words[m]|0))%c;return h},s.prototype.idivn=function(c){t(c<=67108863);for(var d=0,h=this.length-1;h>=0;h--){var m=(this.words[h]|0)+d*67108864;this.words[h]=m/c|0,d=m%c}return this.strip()},s.prototype.divn=function(c){return this.clone().idivn(c)},s.prototype.egcd=function(c){t(c.negative===0),t(!c.isZero());var d=this,h=c.clone();d.negative!==0?d=d.umod(c):d=d.clone();for(var m=new s(1),y=new s(0),w=new s(0),S=new s(1),g=0;d.isEven()&&h.isEven();)d.iushrn(1),h.iushrn(1),++g;for(var u=h.clone(),x=d.clone();!d.isZero();){for(var P=0,B=1;(d.words[0]&B)===0&&P<26;++P,B<<=1);if(P>0)for(d.iushrn(P);P-- >0;)(m.isOdd()||y.isOdd())&&(m.iadd(u),y.isub(x)),m.iushrn(1),y.iushrn(1);for(var j=0,D=1;(h.words[0]&D)===0&&j<26;++j,D<<=1);if(j>0)for(h.iushrn(j);j-- >0;)(w.isOdd()||S.isOdd())&&(w.iadd(u),S.isub(x)),w.iushrn(1),S.iushrn(1);d.cmp(h)>=0?(d.isub(h),m.isub(w),y.isub(S)):(h.isub(d),w.isub(m),S.isub(y))}return{a:w,b:S,gcd:h.iushln(g)}},s.prototype._invmp=function(c){t(c.negative===0),t(!c.isZero());var d=this,h=c.clone();d.negative!==0?d=d.umod(c):d=d.clone();for(var m=new s(1),y=new s(0),w=h.clone();d.cmpn(1)>0&&h.cmpn(1)>0;){for(var S=0,g=1;(d.words[0]&g)===0&&S<26;++S,g<<=1);if(S>0)for(d.iushrn(S);S-- >0;)m.isOdd()&&m.iadd(w),m.iushrn(1);for(var u=0,x=1;(h.words[0]&x)===0&&u<26;++u,x<<=1);if(u>0)for(h.iushrn(u);u-- >0;)y.isOdd()&&y.iadd(w),y.iushrn(1);d.cmp(h)>=0?(d.isub(h),m.isub(y)):(h.isub(d),y.isub(m))}var P;return d.cmpn(1)===0?P=m:P=y,P.cmpn(0)<0&&P.iadd(c),P},s.prototype.gcd=function(c){if(this.isZero())return c.abs();if(c.isZero())return this.abs();var d=this.clone(),h=c.clone();d.negative=0,h.negative=0;for(var m=0;d.isEven()&&h.isEven();m++)d.iushrn(1),h.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;h.isEven();)h.iushrn(1);var y=d.cmp(h);if(y<0){var w=d;d=h,h=w}else if(y===0||h.cmpn(1)===0)break;d.isub(h)}while(!0);return h.iushln(m)},s.prototype.invm=function(c){return this.egcd(c).a.umod(c)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(c){return this.words[0]&c},s.prototype.bincn=function(c){t(typeof c=="number");var d=c%26,h=(c-d)/26,m=1<<d;if(this.length<=h)return this._expand(h+1),this.words[h]|=m,this;for(var y=m,w=h;y!==0&&w<this.length;w++){var S=this.words[w]|0;S+=y,y=S>>>26,S&=67108863,this.words[w]=S}return y!==0&&(this.words[w]=y,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(c){var d=c<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this.strip();var h;if(this.length>1)h=1;else{d&&(c=-c),t(c<=67108863,"Number is too big");var m=this.words[0]|0;h=m===c?0:m<c?-1:1}return this.negative!==0?-h|0:h},s.prototype.cmp=function(c){if(this.negative!==0&&c.negative===0)return-1;if(this.negative===0&&c.negative!==0)return 1;var d=this.ucmp(c);return this.negative!==0?-d|0:d},s.prototype.ucmp=function(c){if(this.length>c.length)return 1;if(this.length<c.length)return-1;for(var d=0,h=this.length-1;h>=0;h--){var m=this.words[h]|0,y=c.words[h]|0;if(m!==y){m<y?d=-1:m>y&&(d=1);break}}return d},s.prototype.gtn=function(c){return this.cmpn(c)===1},s.prototype.gt=function(c){return this.cmp(c)===1},s.prototype.gten=function(c){return this.cmpn(c)>=0},s.prototype.gte=function(c){return this.cmp(c)>=0},s.prototype.ltn=function(c){return this.cmpn(c)===-1},s.prototype.lt=function(c){return this.cmp(c)===-1},s.prototype.lten=function(c){return this.cmpn(c)<=0},s.prototype.lte=function(c){return this.cmp(c)<=0},s.prototype.eqn=function(c){return this.cmpn(c)===0},s.prototype.eq=function(c){return this.cmp(c)===0},s.red=function(c){return new H(c)},s.prototype.toRed=function(c){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),c.convertTo(this)._forceRed(c)},s.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(c){return this.red=c,this},s.prototype.forceRed=function(c){return t(!this.red,"Already a number in reduction context"),this._forceRed(c)},s.prototype.redAdd=function(c){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,c)},s.prototype.redIAdd=function(c){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,c)},s.prototype.redSub=function(c){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,c)},s.prototype.redISub=function(c){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,c)},s.prototype.redShl=function(c){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,c)},s.prototype.redMul=function(c){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.mul(this,c)},s.prototype.redIMul=function(c){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.imul(this,c)},s.prototype.redSqr=function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(c){return t(this.red&&!c.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,c)};var A={k256:null,p224:null,p192:null,p25519:null};function N(b,c){this.name=b,this.p=new s(c,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}N.prototype._tmp=function(){var c=new s(null);return c.words=new Array(Math.ceil(this.n/13)),c},N.prototype.ireduce=function(c){var d=c,h;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),h=d.bitLength();while(h>this.n);var m=h<this.n?-1:d.ucmp(this.p);return m===0?(d.words[0]=0,d.length=1):m>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},N.prototype.split=function(c,d){c.iushrn(this.n,0,d)},N.prototype.imulK=function(c){return c.imul(this.k)};function U(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(U,N),U.prototype.split=function(c,d){for(var h=4194303,m=Math.min(c.length,9),y=0;y<m;y++)d.words[y]=c.words[y];if(d.length=m,c.length<=9){c.words[0]=0,c.length=1;return}var w=c.words[9];for(d.words[d.length++]=w&h,y=10;y<c.length;y++){var S=c.words[y]|0;c.words[y-10]=(S&h)<<4|w>>>22,w=S}w>>>=22,c.words[y-10]=w,w===0&&c.length>10?c.length-=10:c.length-=9},U.prototype.imulK=function(c){c.words[c.length]=0,c.words[c.length+1]=0,c.length+=2;for(var d=0,h=0;h<c.length;h++){var m=c.words[h]|0;d+=m*977,c.words[h]=d&67108863,d=m*64+(d/67108864|0)}return c.words[c.length-1]===0&&(c.length--,c.words[c.length-1]===0&&c.length--),c};function We(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(We,N);function te(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(te,N);function qe(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(qe,N),qe.prototype.imulK=function(c){for(var d=0,h=0;h<c.length;h++){var m=(c.words[h]|0)*19+d,y=m&67108863;m>>>=26,c.words[h]=y,d=m}return d!==0&&(c.words[c.length++]=d),c},s._prime=function(c){if(A[c])return A[c];var d;if(c==="k256")d=new U;else if(c==="p224")d=new We;else if(c==="p192")d=new te;else if(c==="p25519")d=new qe;else throw new Error("Unknown prime "+c);return A[c]=d,d};function H(b){if(typeof b=="string"){var c=s._prime(b);this.m=c.p,this.prime=c}else t(b.gtn(1),"modulus must be greater than 1"),this.m=b,this.prime=null}H.prototype._verify1=function(c){t(c.negative===0,"red works only with positives"),t(c.red,"red works only with red numbers")},H.prototype._verify2=function(c,d){t((c.negative|d.negative)===0,"red works only with positives"),t(c.red&&c.red===d.red,"red works only with red numbers")},H.prototype.imod=function(c){return this.prime?this.prime.ireduce(c)._forceRed(this):c.umod(this.m)._forceRed(this)},H.prototype.neg=function(c){return c.isZero()?c.clone():this.m.sub(c)._forceRed(this)},H.prototype.add=function(c,d){this._verify2(c,d);var h=c.add(d);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},H.prototype.iadd=function(c,d){this._verify2(c,d);var h=c.iadd(d);return h.cmp(this.m)>=0&&h.isub(this.m),h},H.prototype.sub=function(c,d){this._verify2(c,d);var h=c.sub(d);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},H.prototype.isub=function(c,d){this._verify2(c,d);var h=c.isub(d);return h.cmpn(0)<0&&h.iadd(this.m),h},H.prototype.shl=function(c,d){return this._verify1(c),this.imod(c.ushln(d))},H.prototype.imul=function(c,d){return this._verify2(c,d),this.imod(c.imul(d))},H.prototype.mul=function(c,d){return this._verify2(c,d),this.imod(c.mul(d))},H.prototype.isqr=function(c){return this.imul(c,c.clone())},H.prototype.sqr=function(c){return this.mul(c,c)},H.prototype.sqrt=function(c){if(c.isZero())return c.clone();var d=this.m.andln(3);if(t(d%2===1),d===3){var h=this.m.add(new s(1)).iushrn(2);return this.pow(c,h)}for(var m=this.m.subn(1),y=0;!m.isZero()&&m.andln(1)===0;)y++,m.iushrn(1);t(!m.isZero());var w=new s(1).toRed(this),S=w.redNeg(),g=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new s(2*u*u).toRed(this);this.pow(u,g).cmp(S)!==0;)u.redIAdd(S);for(var x=this.pow(u,m),P=this.pow(c,m.addn(1).iushrn(1)),B=this.pow(c,m),j=y;B.cmp(w)!==0;){for(var D=B,z=0;D.cmp(w)!==0;z++)D=D.redSqr();t(z<j);var G=this.pow(x,new s(1).iushln(j-z-1));P=P.redMul(G),x=G.redSqr(),B=B.redMul(x),j=z}return P},H.prototype.invm=function(c){var d=c._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},H.prototype.pow=function(c,d){if(d.isZero())return new s(1).toRed(this);if(d.cmpn(1)===0)return c.clone();var h=4,m=new Array(1<<h);m[0]=new s(1).toRed(this),m[1]=c;for(var y=2;y<m.length;y++)m[y]=this.mul(m[y-1],c);var w=m[0],S=0,g=0,u=d.bitLength()%26;for(u===0&&(u=26),y=d.length-1;y>=0;y--){for(var x=d.words[y],P=u-1;P>=0;P--){var B=x>>P&1;if(w!==m[0]&&(w=this.sqr(w)),B===0&&S===0){g=0;continue}S<<=1,S|=B,g++,!(g!==h&&(y!==0||P!==0))&&(w=this.mul(w,m[S]),g=0,S=0)}u=26}return w},H.prototype.convertTo=function(c){var d=c.umod(this.m);return d===c?d.clone():d},H.prototype.convertFrom=function(c){var d=c.clone();return d.red=null,d},s.mont=function(c){return new Le(c)};function Le(b){H.call(this,b),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(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(Le,H),Le.prototype.convertTo=function(c){return this.imod(c.ushln(this.shift))},Le.prototype.convertFrom=function(c){var d=this.imod(c.mul(this.rinv));return d.red=null,d},Le.prototype.imul=function(c,d){if(c.isZero()||d.isZero())return c.words[0]=0,c.length=1,c;var h=c.imul(d),m=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=h.isub(m).iushrn(this.shift),w=y;return y.cmp(this.m)>=0?w=y.isub(this.m):y.cmpn(0)<0&&(w=y.iadd(this.m)),w._forceRed(this)},Le.prototype.mul=function(c,d){if(c.isZero()||d.isZero())return new s(0)._forceRed(this);var h=c.mul(d),m=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=h.isub(m).iushrn(this.shift),w=y;return y.cmp(this.m)>=0?w=y.isub(this.m):y.cmpn(0)<0&&(w=y.iadd(this.m)),w._forceRed(this)},Le.prototype.invm=function(c){var d=this.imod(c._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(typeof rl>"u"||rl,jm)});var Nm=T((UT,al)=>{typeof Object.create=="function"?al.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:al.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 mi=T((HT,ll)=>{try{if(cl=require("util"),typeof cl.inherits!="function")throw"";ll.exports=cl.inherits}catch{ll.exports=Nm()}var cl});var Kr=T((zT,Im)=>{"use strict";var Vr=require("buffer"),Sn=Vr.Buffer,_t={},St;for(St in Vr)Vr.hasOwnProperty(St)&&(St==="SlowBuffer"||St==="Buffer"||(_t[St]=Vr[St]));var En=_t.Buffer={};for(St in Sn)Sn.hasOwnProperty(St)&&(St==="allocUnsafe"||St==="allocUnsafeSlow"||(En[St]=Sn[St]));_t.Buffer.prototype=Sn.prototype;(!En.from||En.from===Uint8Array.from)&&(En.from=function(i,e,t){if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof i);if(i&&typeof i.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);return Sn(i,e,t)});En.alloc||(En.alloc=function(i,e,t){if(typeof i!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof i);if(i<0||i>=2*(1<<30))throw new RangeError('The value "'+i+'" is invalid for option "size"');var n=Sn(i);return!e||e.length===0?n.fill(0):typeof t=="string"?n.fill(e,t):n.fill(e),n});if(!_t.kStringMaxLength)try{_t.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}_t.constants||(_t.constants={MAX_LENGTH:_t.kMaxLength},_t.kStringMaxLength&&(_t.constants.MAX_STRING_LENGTH=_t.kStringMaxLength));Im.exports=_t});var Gr=T(Dm=>{"use strict";var $S=mi();function Et(i){this._reporterState={obj:null,path:[],options:i||{},errors:[]}}Dm.Reporter=Et;Et.prototype.isError=function(e){return e instanceof kn};Et.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};Et.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)};Et.prototype.enterKey=function(e){return this._reporterState.path.push(e)};Et.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)};Et.prototype.leaveKey=function(e,t,n){let s=this._reporterState;this.exitKey(e),s.obj!==null&&(s.obj[t]=n)};Et.prototype.path=function(){return this._reporterState.path.join("/")};Et.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t};Et.prototype.leaveObject=function(e){let t=this._reporterState,n=t.obj;return t.obj=e,n};Et.prototype.error=function(e){let t,n=this._reporterState,s=e instanceof kn;if(s?t=e:t=new kn(n.path.map(function(r){return"["+JSON.stringify(r)+"]"}).join(""),e.message||e,e.stack),!n.options.partial)throw t;return s||n.errors.push(t),t};Et.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};function kn(i,e){this.path=i,this.rethrow(e)}$S(kn,Error);kn.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,kn),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}});var Mn=T(ul=>{"use strict";var WS=mi(),Yr=Gr().Reporter,Cn=Kr().Buffer;function kt(i,e){if(Yr.call(this,e),!Cn.isBuffer(i)){this.error("Input not Buffer");return}this.base=i,this.offset=0,this.length=i.length}WS(kt,Yr);ul.DecoderBuffer=kt;kt.isDecoderBuffer=function(e){return e instanceof kt?!0:typeof e=="object"&&Cn.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"};kt.prototype.save=function(){return{offset:this.offset,reporter:Yr.prototype.save.call(this)}};kt.prototype.restore=function(e){let t=new kt(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,Yr.prototype.restore.call(this,e.reporter),t};kt.prototype.isEmpty=function(){return this.offset===this.length};kt.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};kt.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");let n=new kt(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n};kt.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function Tn(i,e){if(Array.isArray(i))this.length=0,this.value=i.map(function(t){return Tn.isEncoderBuffer(t)||(t=new Tn(t,e)),this.length+=t.length,t},this);else if(typeof i=="number"){if(!(0<=i&&i<=255))return e.error("non-byte EncoderBuffer value");this.value=i,this.length=1}else if(typeof i=="string")this.value=i,this.length=Cn.byteLength(i);else if(Cn.isBuffer(i))this.value=i,this.length=i.length;else return e.error("Unsupported type: "+typeof i)}ul.EncoderBuffer=Tn;Tn.isEncoderBuffer=function(e){return e instanceof Tn?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};Tn.prototype.join=function(e,t){return e||(e=Cn.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):Cn.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}});var Fm=T((VT,Lm)=>{Lm.exports=qm;function qm(i,e){if(!i)throw new Error(e||"Assertion failed")}qm.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}});var Jr=T((KT,Hm)=>{"use strict";var VS=Gr().Reporter,KS=Mn().EncoderBuffer,GS=Mn().DecoderBuffer,et=Fm(),Um=["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"],YS=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(Um),JS=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function V(i,e,t){let n={};this._baseState=n,n.name=t,n.enc=i,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())}Hm.exports=V;var XS=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];V.prototype.clone=function(){let e=this._baseState,t={};XS.forEach(function(s){t[s]=e[s]});let n=new this.constructor(t.parent);return n._baseState=t,n};V.prototype._wrap=function(){let e=this._baseState;YS.forEach(function(t){this[t]=function(){let s=new this.constructor(this);return e.children.push(s),s[t].apply(s,arguments)}},this)};V.prototype._init=function(e){let t=this._baseState;et(t.parent===null),e.call(this),t.children=t.children.filter(function(n){return n._baseState.parent===this},this),et.equal(t.children.length,1,"Root node can have only one child")};V.prototype._useArgs=function(e){let t=this._baseState,n=e.filter(function(s){return s instanceof this.constructor},this);e=e.filter(function(s){return!(s instanceof this.constructor)},this),n.length!==0&&(et(t.children===null),t.children=n,n.forEach(function(s){s._baseState.parent=this},this)),e.length!==0&&(et(t.args===null),t.args=e,t.reverseArgs=e.map(function(s){if(typeof s!="object"||s.constructor!==Object)return s;let r={};return Object.keys(s).forEach(function(o){o==(o|0)&&(o|=0);let a=s[o];r[a]=o}),r}))};JS.forEach(function(i){V.prototype[i]=function(){let t=this._baseState;throw new Error(i+" not implemented for encoding: "+t.enc)}});Um.forEach(function(i){V.prototype[i]=function(){let t=this._baseState,n=Array.prototype.slice.call(arguments);return et(t.tag===null),t.tag=i,this._useArgs(n),this}});V.prototype.use=function(e){et(e);let t=this._baseState;return et(t.use===null),t.use=e,this};V.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};V.prototype.def=function(e){let t=this._baseState;return et(t.default===null),t.default=e,t.optional=!0,this};V.prototype.explicit=function(e){let t=this._baseState;return et(t.explicit===null&&t.implicit===null),t.explicit=e,this};V.prototype.implicit=function(e){let t=this._baseState;return et(t.explicit===null&&t.implicit===null),t.implicit=e,this};V.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this};V.prototype.key=function(e){let t=this._baseState;return et(t.key===null),t.key=e,this};V.prototype.any=function(){let e=this._baseState;return e.any=!0,this};V.prototype.choice=function(e){let t=this._baseState;return et(t.choice===null),t.choice=e,this._useArgs(Object.keys(e).map(function(n){return e[n]})),this};V.prototype.contains=function(e){let t=this._baseState;return et(t.use===null),t.contains=e,this};V.prototype._decode=function(e,t){let n=this._baseState;if(n.parent===null)return e.wrapResult(n.children[0]._decode(e,t));let s=n.default,r=!0,o=null;if(n.key!==null&&(o=e.enterKey(n.key)),n.optional){let l=null;if(n.explicit!==null?l=n.explicit:n.implicit!==null?l=n.implicit:n.tag!==null&&(l=n.tag),l===null&&!n.any){let p=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),r=!0}catch{r=!1}e.restore(p)}else if(r=this._peekTag(e,l,n.any),e.isError(r))return r}let a;if(n.obj&&r&&(a=e.enterObject()),r){if(n.explicit!==null){let p=this._decodeTag(e,n.explicit);if(e.isError(p))return p;e=p}let l=e.offset;if(n.use===null&&n.choice===null){let p;n.any&&(p=e.save());let f=this._decodeTag(e,n.implicit!==null?n.implicit:n.tag,n.any);if(e.isError(f))return f;n.any?s=e.raw(p):e=f}if(t&&t.track&&n.tag!==null&&t.track(e.path(),l,e.length,"tagged"),t&&t.track&&n.tag!==null&&t.track(e.path(),e.offset,e.length,"content"),n.any||(n.choice===null?s=this._decodeGeneric(n.tag,e,t):s=this._decodeChoice(e,t)),e.isError(s))return s;if(!n.any&&n.choice===null&&n.children!==null&&n.children.forEach(function(f){f._decode(e,t)}),n.contains&&(n.tag==="octstr"||n.tag==="bitstr")){let p=new GS(s);s=this._getUse(n.contains,e._reporterState.obj)._decode(p,t)}}return n.obj&&r&&(s=e.leaveObject(a)),n.key!==null&&(s!==null||r===!0)?e.leaveKey(o,n.key,s):o!==null&&e.exitKey(o),s};V.prototype._decodeGeneric=function(e,t,n){let s=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(t,e,s.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):e==="objid"&&s.args?this._decodeObjid(t,s.args[0],s.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,s.args&&s.args[0],n):s.use!==null?this._getUse(s.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)};V.prototype._getUse=function(e,t){let n=this._baseState;return n.useDecoder=this._use(e,t),et(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};V.prototype._decodeChoice=function(e,t){let n=this._baseState,s=null,r=!1;return Object.keys(n.choice).some(function(o){let a=e.save(),l=n.choice[o];try{let p=l._decode(e,t);if(e.isError(p))return!1;s={type:o,value:p},r=!0}catch{return e.restore(a),!1}return!0},this),r?s:e.error("Choice not matched")};V.prototype._createEncoderBuffer=function(e){return new KS(e,this.reporter)};V.prototype._encode=function(e,t,n){let s=this._baseState;if(s.default!==null&&s.default===e)return;let r=this._encodeValue(e,t,n);if(r!==void 0&&!this._skipDefault(r,t,n))return r};V.prototype._encodeValue=function(e,t,n){let s=this._baseState;if(s.parent===null)return s.children[0]._encode(e,t||new VS);let r=null;if(this.reporter=t,s.optional&&e===void 0)if(s.default!==null)e=s.default;else return;let o=null,a=!1;if(s.any)r=this._createEncoderBuffer(e);else if(s.choice)r=this._encodeChoice(e,t);else if(s.contains)o=this._getUse(s.contains,n)._encode(e,t),a=!0;else if(s.children)o=s.children.map(function(l){if(l._baseState.tag==="null_")return l._encode(null,t,e);if(l._baseState.key===null)return t.error("Child should have a key");let p=t.enterKey(l._baseState.key);if(typeof e!="object")return t.error("Child expected, but input is not object");let f=l._encode(e[l._baseState.key],t,e);return t.leaveKey(p),f},this).filter(function(l){return l}),o=this._createEncoderBuffer(o);else if(s.tag==="seqof"||s.tag==="setof"){if(!(s.args&&s.args.length===1))return t.error("Too many args for : "+s.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");let l=this.clone();l._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(p){let f=this._baseState;return this._getUse(f.args[0],e)._encode(p,t)},l))}else s.use!==null?r=this._getUse(s.use,n)._encode(e,t):(o=this._encodePrimitive(s.tag,e),a=!0);if(!s.any&&s.choice===null){let l=s.implicit!==null?s.implicit:s.tag,p=s.implicit===null?"universal":"context";l===null?s.use===null&&t.error("Tag could be omitted only for .use()"):s.use===null&&(r=this._encodeComposite(l,a,p,o))}return s.explicit!==null&&(r=this._encodeComposite(s.explicit,!1,"context",r)),r};V.prototype._encodeChoice=function(e,t){let n=this._baseState,s=n.choice[e.type];return s||et(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),s._encode(e.value,t)};V.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)};V.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};V.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var Xr=T(Bi=>{"use strict";function zm(i){let e={};return Object.keys(i).forEach(function(t){(t|0)==t&&(t=t|0);let n=i[t];e[n]=t}),e}Bi.tagClass={0:"universal",1:"application",2:"context",3:"private"};Bi.tagClassByName=zm(Bi.tagClass);Bi.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"};Bi.tagByName=zm(Bi.tag)});var dl=T((YT,Vm)=>{"use strict";var ZS=mi(),ii=Kr().Buffer,$m=Jr(),pl=Xr();function Wm(i){this.enc="der",this.name=i.name,this.entity=i,this.tree=new jt,this.tree._init(i.body)}Vm.exports=Wm;Wm.prototype.encode=function(e,t){return this.tree._encode(e,t).join()};function jt(i){$m.call(this,"der",i)}ZS(jt,$m);jt.prototype._encodeComposite=function(e,t,n,s){let r=QS(e,t,n,this.reporter);if(s.length<128){let l=ii.alloc(2);return l[0]=r,l[1]=s.length,this._createEncoderBuffer([l,s])}let o=1;for(let l=s.length;l>=256;l>>=8)o++;let a=ii.alloc(2+o);a[0]=r,a[1]=128|o;for(let l=1+o,p=s.length;p>0;l--,p>>=8)a[l]=p&255;return this._createEncoderBuffer([a,s])};jt.prototype._encodeStr=function(e,t){if(t==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(t==="bmpstr"){let n=ii.alloc(e.length*2);for(let s=0;s<e.length;s++)n.writeUInt16BE(e.charCodeAt(s),s*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")};jt.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 s=0;for(let a=0;a<e.length;a++){let l=e[a];for(s++;l>=128;l>>=7)s++}let r=ii.alloc(s),o=r.length-1;for(let a=e.length-1;a>=0;a--){let l=e[a];for(r[o--]=l&127;(l>>=7)>0;)r[o--]=128|l&127}return this._createEncoderBuffer(r)};function Ct(i){return i<10?"0"+i:i}jt.prototype._encodeTime=function(e,t){let n,s=new Date(e);return t==="gentime"?n=[Ct(s.getUTCFullYear()),Ct(s.getUTCMonth()+1),Ct(s.getUTCDate()),Ct(s.getUTCHours()),Ct(s.getUTCMinutes()),Ct(s.getUTCSeconds()),"Z"].join(""):t==="utctime"?n=[Ct(s.getUTCFullYear()%100),Ct(s.getUTCMonth()+1),Ct(s.getUTCDate()),Ct(s.getUTCHours()),Ct(s.getUTCMinutes()),Ct(s.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")};jt.prototype._encodeNull=function(){return this._createEncoderBuffer("")};jt.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"&&!ii.isBuffer(e)){let r=e.toArray();!e.sign&&r[0]&128&&r.unshift(0),e=ii.from(r)}if(ii.isBuffer(e)){let r=e.length;e.length===0&&r++;let o=ii.alloc(r);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 r=e;r>=256;r>>=8)n++;let s=new Array(n);for(let r=s.length-1;r>=0;r--)s[r]=e&255,e>>=8;return s[0]&128&&s.unshift(0),this._createEncoderBuffer(ii.from(s))};jt.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};jt.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getEncoder("der").tree};jt.prototype._skipDefault=function(e,t,n){let s=this._baseState,r;if(s.default===null)return!1;let o=e.join();if(s.defaultBuffer===void 0&&(s.defaultBuffer=this._encodeValue(s.default,t,n).join()),o.length!==s.defaultBuffer.length)return!1;for(r=0;r<o.length;r++)if(o[r]!==s.defaultBuffer[r])return!1;return!0};function QS(i,e,t,n){let s;if(i==="seqof"?i="seq":i==="setof"&&(i="set"),pl.tagByName.hasOwnProperty(i))s=pl.tagByName[i];else if(typeof i=="number"&&(i|0)===i)s=i;else return n.error("Unknown tag: "+i);return s>=31?n.error("Multi-octet tag encoding unsupported"):(e||(s|=32),s|=pl.tagClassByName[t||"universal"]<<6,s)}});var Gm=T((JT,Km)=>{"use strict";var eE=mi(),fl=dl();function hl(i){fl.call(this,i),this.enc="pem"}eE(hl,fl);Km.exports=hl;hl.prototype.encode=function(e,t){let s=fl.prototype.encode.call(this,e).toString("base64"),r=["-----BEGIN "+t.label+"-----"];for(let o=0;o<s.length;o+=64)r.push(s.slice(o,o+64));return r.push("-----END "+t.label+"-----"),r.join(`
|
|
26
|
-
`)}});var ml=T(Jm=>{"use strict";var Ym=Jm;Ym.der=dl();Ym.pem=Gm()});var gl=T((ZT,iv)=>{"use strict";var tE=mi(),iE=ol(),Xm=Mn().DecoderBuffer,Qm=Jr(),Zm=Xr();function ev(i){this.enc="der",this.name=i.name,this.entity=i,this.tree=new dt,this.tree._init(i.body)}iv.exports=ev;ev.prototype.decode=function(e,t){return Xm.isDecoderBuffer(e)||(e=new Xm(e,t)),this.tree._decode(e,t)};function dt(i){Qm.call(this,"der",i)}tE(dt,Qm);dt.prototype._peekTag=function(e,t,n){if(e.isEmpty())return!1;let s=e.save(),r=vl(e,'Failed to peek tag: "'+t+'"');return e.isError(r)?r:(e.restore(s),r.tag===t||r.tagStr===t||r.tagStr+"of"===t||n)};dt.prototype._decodeTag=function(e,t,n){let s=vl(e,'Failed to decode tag of "'+t+'"');if(e.isError(s))return s;let r=tv(e,s.primitive,'Failed to get length of "'+t+'"');if(e.isError(r))return r;if(!n&&s.tag!==t&&s.tagStr!==t&&s.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(s.primitive||r!==null)return e.skip(r,'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:(r=e.offset-o.offset,e.restore(o),e.skip(r,'Failed to match body of: "'+t+'"'))};dt.prototype._skipUntilEnd=function(e,t){for(;;){let n=vl(e,t);if(e.isError(n))return n;let s=tv(e,n.primitive,t);if(e.isError(s))return s;let r;if(n.primitive||s!==null?r=e.skip(s):r=this._skipUntilEnd(e,t),e.isError(r))return r;if(n.tagStr==="end")break}};dt.prototype._decodeList=function(e,t,n,s){let r=[];for(;!e.isEmpty();){let o=this._peekTag(e,"end");if(e.isError(o))return o;let a=n.decode(e,"der",s);if(e.isError(a)&&o)break;r.push(a)}return r};dt.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 s="";for(let r=0;r<n.length/2;r++)s+=String.fromCharCode(n.readUInt16BE(r*2));return s}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")}};dt.prototype._decodeObjid=function(e,t,n){let s,r=[],o=0,a=0;for(;!e.isEmpty();)a=e.readUInt8(),o<<=7,o|=a&127,(a&128)===0&&(r.push(o),o=0);a&128&&r.push(o);let l=r[0]/40|0,p=r[0]%40;if(n?s=r:s=[l,p].concat(r.slice(1)),t){let f=t[s.join(" ")];f===void 0&&(f=t[s.join(".")]),f!==void 0&&(s=f)}return s};dt.prototype._decodeTime=function(e,t){let n=e.raw().toString(),s,r,o,a,l,p;if(t==="gentime")s=n.slice(0,4)|0,r=n.slice(4,6)|0,o=n.slice(6,8)|0,a=n.slice(8,10)|0,l=n.slice(10,12)|0,p=n.slice(12,14)|0;else if(t==="utctime")s=n.slice(0,2)|0,r=n.slice(2,4)|0,o=n.slice(4,6)|0,a=n.slice(6,8)|0,l=n.slice(8,10)|0,p=n.slice(10,12)|0,s<70?s=2e3+s:s=1900+s;else return e.error("Decoding "+t+" time is not supported yet");return Date.UTC(s,r-1,o,a,l,p,0)};dt.prototype._decodeNull=function(){return null};dt.prototype._decodeBool=function(e){let t=e.readUInt8();return e.isError(t)?t:t!==0};dt.prototype._decodeInt=function(e,t){let n=e.raw(),s=new iE(n);return t&&(s=t[s.toString(10)]||s),s};dt.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getDecoder("der").tree};function vl(i,e){let t=i.readUInt8(e);if(i.isError(t))return t;let n=Zm.tagClass[t>>6],s=(t&32)===0;if((t&31)===31){let o=t;for(t=0;(o&128)===128;){if(o=i.readUInt8(e),i.isError(o))return o;t<<=7,t|=o&127}}else t&=31;let r=Zm.tag[t];return{cls:n,primitive:s,tag:t,tagStr:r}}function tv(i,e,t){let n=i.readUInt8(t);if(i.isError(n))return n;if(!e&&n===128)return null;if((n&128)===0)return n;let s=n&127;if(s>4)return i.error("length octect is too long");n=0;for(let r=0;r<s;r++){n<<=8;let o=i.readUInt8(t);if(i.isError(o))return o;n|=o}return n}});var sv=T((QT,nv)=>{"use strict";var nE=mi(),sE=Kr().Buffer,xl=gl();function yl(i){xl.call(this,i),this.enc="pem"}nE(yl,xl);nv.exports=yl;yl.prototype.decode=function(e,t){let n=e.toString().split(/[\r\n]+/g),s=t.label.toUpperCase(),r=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,a=-1;for(let f=0;f<n.length;f++){let v=n[f].match(r);if(v!==null&&v[2]===s)if(o===-1){if(v[1]!=="BEGIN")break;o=f}else{if(v[1]!=="END")break;a=f;break}}if(o===-1||a===-1)throw new Error("PEM section not found for: "+s);let l=n.slice(o+1,a).join("");l.replace(/[^a-z0-9+/=]+/gi,"");let p=sE.from(l,"base64");return xl.prototype.decode.call(this,p,t)}});var bl=T(ov=>{"use strict";var rv=ov;rv.der=gl();rv.pem=sv()});var cv=T(av=>{"use strict";var rE=ml(),oE=bl(),aE=mi(),cE=av;cE.define=function(e,t){return new On(e,t)};function On(i,e){this.name=i,this.body=e,this.decoders={},this.encoders={}}On.prototype._createNamed=function(e){let t=this.name;function n(s){this._initNamed(s,t)}return aE(n,e),n.prototype._initNamed=function(r,o){e.call(this,r,o)},new n(this)};On.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(oE[e])),this.decoders[e]};On.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)};On.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(rE[e])),this.encoders[e]};On.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}});var uv=T(lv=>{"use strict";var Zr=lv;Zr.Reporter=Gr().Reporter;Zr.DecoderBuffer=Mn().DecoderBuffer;Zr.EncoderBuffer=Mn().EncoderBuffer;Zr.Node=Jr()});var fv=T(dv=>{"use strict";var pv=dv;pv._reverse=function(e){let t={};return Object.keys(e).forEach(function(n){(n|0)==n&&(n=n|0);let s=e[n];t[s]=n}),t};pv.der=Xr()});var mv=T(hv=>{"use strict";var An=hv;An.bignum=ol();An.define=cv().define;An.base=uv();An.constants=fv();An.decoders=bl();An.encoders=ml()});var Rn=T((wl,gv)=>{var Qr=require("buffer"),Ht=Qr.Buffer;function vv(i,e){for(var t in i)e[t]=i[t]}Ht.from&&Ht.alloc&&Ht.allocUnsafe&&Ht.allocUnsafeSlow?gv.exports=Qr:(vv(Qr,wl),wl.Buffer=ji);function ji(i,e,t){return Ht(i,e,t)}ji.prototype=Object.create(Ht.prototype);vv(Ht,ji);ji.from=function(i,e,t){if(typeof i=="number")throw new TypeError("Argument must not be a number");return Ht(i,e,t)};ji.alloc=function(i,e,t){if(typeof i!="number")throw new TypeError("Argument must be a number");var n=Ht(i);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n};ji.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return Ht(i)};ji.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return Qr.SlowBuffer(i)}});var _l=T((rM,xv)=>{var eo=Rn().Buffer,lE=require("stream"),uE=require("util");function to(i){if(this.buffer=null,this.writable=!0,this.readable=!0,!i)return this.buffer=eo.alloc(0),this;if(typeof i.pipe=="function")return this.buffer=eo.alloc(0),i.pipe(this),this;if(i.length||typeof i=="object")return this.buffer=i,this.writable=!1,process.nextTick(function(){this.emit("end",i),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof i+")")}uE.inherits(to,lE);to.prototype.write=function(e){this.buffer=eo.concat([this.buffer,eo.from(e)]),this.emit("data",e)};to.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};xv.exports=to});var bv=T((oM,yv)=>{"use strict";function Sl(i){var e=(i/8|0)+(i%8===0?0:1);return e}var pE={ES256:Sl(256),ES384:Sl(384),ES512:Sl(521)};function dE(i){var e=pE[i];if(e)return e;throw new Error('Unknown algorithm "'+i+'"')}yv.exports=dE});var Tv=T((aM,Cv)=>{"use strict";var io=Rn().Buffer,_v=bv(),no=128,Sv=0,fE=32,hE=16,mE=2,Ev=hE|fE|Sv<<6,so=mE|Sv<<6;function vE(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function kv(i){if(io.isBuffer(i))return i;if(typeof i=="string")return io.from(i,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function gE(i,e){i=kv(i);var t=_v(e),n=t+1,s=i.length,r=0;if(i[r++]!==Ev)throw new Error('Could not find expected "seq"');var o=i[r++];if(o===(no|1)&&(o=i[r++]),s-r<o)throw new Error('"seq" specified length of "'+o+'", only "'+(s-r)+'" remaining');if(i[r++]!==so)throw new Error('Could not find expected "int" for "r"');var a=i[r++];if(s-r-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(s-r-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var l=r;if(r+=a,i[r++]!==so)throw new Error('Could not find expected "int" for "s"');var p=i[r++];if(s-r!==p)throw new Error('"s" specified length of "'+p+'", expected "'+(s-r)+'"');if(n<p)throw new Error('"s" specified length of "'+p+'", max of "'+n+'" is acceptable');var f=r;if(r+=p,r!==s)throw new Error('Expected to consume entire buffer, but "'+(s-r)+'" bytes remain');var v=t-a,_=t-p,E=io.allocUnsafe(v+a+_+p);for(r=0;r<v;++r)E[r]=0;i.copy(E,r,l+Math.max(-v,0),l+a),r=t;for(var C=r;r<C+_;++r)E[r]=0;return i.copy(E,r,f+Math.max(-_,0),f+p),E=E.toString("base64"),E=vE(E),E}function wv(i,e,t){for(var n=0;e+n<t&&i[e+n]===0;)++n;var s=i[e+n]>=no;return s&&--n,n}function xE(i,e){i=kv(i);var t=_v(e),n=i.length;if(n!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+n+'"');var s=wv(i,0,t),r=wv(i,t,i.length),o=t-s,a=t-r,l=2+o+1+1+a,p=l<no,f=io.allocUnsafe((p?2:3)+l),v=0;return f[v++]=Ev,p?f[v++]=l:(f[v++]=no|1,f[v++]=l&255),f[v++]=so,f[v++]=o,s<0?(f[v++]=0,v+=i.copy(f,v,0,t)):v+=i.copy(f,v,s,t),f[v++]=so,f[v++]=a,r<0?(f[v++]=0,i.copy(f,v,t)):i.copy(f,v,t+r),f}Cv.exports={derToJose:gE,joseToDer:xE}});var Ov=T((cM,Mv)=>{"use strict";var os=require("buffer").Buffer,El=require("buffer").SlowBuffer;Mv.exports=ro;function ro(i,e){if(!os.isBuffer(i)||!os.isBuffer(e)||i.length!==e.length)return!1;for(var t=0,n=0;n<i.length;n++)t|=i[n]^e[n];return t===0}ro.install=function(){os.prototype.equal=El.prototype.equal=function(e){return ro(this,e)}};var yE=os.prototype.equal,bE=El.prototype.equal;ro.restore=function(){os.prototype.equal=yE,El.prototype.equal=bE}});var Ml=T((lM,qv)=>{var Bn=Rn().Buffer,Tt=require("crypto"),Rv=Tv(),Av=require("util"),wE=`"%s" is not a valid algorithm.
|
|
22
|
+
`)+t,r=n+1,n=i.indexOf(`
|
|
23
|
+
`,r)}while(n!==-1);return s+=i.substr(r),s};Xh.exports={stringReplaceAll:LS,stringEncaseCRLFWithFirstIndex:FS}});var nm=C((DM,im)=>{"use strict";var US=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Qh=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,HS=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,zS=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,$S=new Map([["n",`
|
|
24
|
+
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function tm(i){let e=i[0]==="u",t=i[1]==="{";return e&&!t&&i.length===5||i[0]==="x"&&i.length===3?String.fromCharCode(parseInt(i.slice(1),16)):e&&t?String.fromCodePoint(parseInt(i.slice(2,-1),16)):$S.get(i)||i}function WS(i,e){let t=[],n=e.trim().split(/\s*,\s*/g),r;for(let s of n){let o=Number(s);if(!Number.isNaN(o))t.push(o);else if(r=s.match(HS))t.push(r[2].replace(zS,(a,l,p)=>l?tm(l):p));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${i}')`)}return t}function VS(i){Qh.lastIndex=0;let e=[],t;for(;(t=Qh.exec(i))!==null;){let n=t[1];if(t[2]){let r=WS(n,t[2]);e.push([n].concat(r))}else e.push([n])}return e}function em(i,e){let t={};for(let r of e)for(let s of r.styles)t[s[0]]=r.inverse?null:s.slice(1);let n=i;for(let[r,s]of Object.entries(t))if(Array.isArray(s)){if(!(r in n))throw new Error(`Unknown Chalk style: ${r}`);n=s.length>0?n[r](...s):n[r]}return n}im.exports=(i,e)=>{let t=[],n=[],r=[];if(e.replace(US,(s,o,a,l,p,f)=>{if(o)r.push(tm(o));else if(l){let m=r.join("");r=[],n.push(t.length===0?m:em(i,t)(m)),t.push({inverse:a,styles:VS(l)})}else if(p){if(t.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(em(i,t)(r.join(""))),r=[],t.pop()}else r.push(f)}),n.push(r.join("")),t.length>0){let s=`Chalk template literal is missing ${t.length} closing bracket${t.length===1?"":"s"} (\`}\`)`;throw new Error(s)}return n.join("")}});var nl=C((IM,lm)=>{"use strict";var ar=Jh(),{stdout:Qc,stderr:el}=_a(),{stringReplaceAll:KS,stringEncaseCRLFWithFirstIndex:GS}=Zh(),{isArray:Ns}=Array,sm=["ansi","ansi","ansi256","ansi16m"],yn=Object.create(null),YS=(i,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=Qc?Qc.level:0;i.level=e.level===void 0?t:e.level},tl=class{constructor(e){return om(e)}},om=i=>{let e={};return YS(e,i),e.template=(...t)=>cm(e.template,...t),Object.setPrototypeOf(e,Ds.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=tl,e.template};function Ds(i){return om(i)}for(let[i,e]of Object.entries(ar))yn[i]={get(){let t=Is(this,il(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,i,{value:t}),t}};yn.visible={get(){let i=Is(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:i}),i}};var am=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let i of am)yn[i]={get(){let{level:e}=this;return function(...t){let n=il(ar.color[sm[e]][i](...t),ar.color.close,this._styler);return Is(this,n,this._isEmpty)}}};for(let i of am){let e="bg"+i[0].toUpperCase()+i.slice(1);yn[e]={get(){let{level:t}=this;return function(...n){let r=il(ar.bgColor[sm[t]][i](...n),ar.bgColor.close,this._styler);return Is(this,r,this._isEmpty)}}}}var JS=Object.defineProperties(()=>{},{...yn,level:{enumerable:!0,get(){return this._generator.level},set(i){this._generator.level=i}}}),il=(i,e,t)=>{let n,r;return t===void 0?(n=i,r=e):(n=t.openAll+i,r=e+t.closeAll),{open:i,close:e,openAll:n,closeAll:r,parent:t}},Is=(i,e,t)=>{let n=(...r)=>Ns(r[0])&&Ns(r[0].raw)?rm(n,cm(n,...r)):rm(n,r.length===1?""+r[0]:r.join(" "));return Object.setPrototypeOf(n,JS),n._generator=i,n._styler=e,n._isEmpty=t,n},rm=(i,e)=>{if(i.level<=0||!e)return i._isEmpty?"":e;let t=i._styler;if(t===void 0)return e;let{openAll:n,closeAll:r}=t;if(e.indexOf("\x1B")!==-1)for(;t!==void 0;)e=KS(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
|
|
25
|
+
`);return s!==-1&&(e=GS(e,r,n,s)),n+e+r},Zc,cm=(i,...e)=>{let[t]=e;if(!Ns(t)||!Ns(t.raw))return e.join(" ");let n=e.slice(1),r=[t.raw[0]];for(let s=1;s<t.length;s++)r.push(String(n[s-1]).replace(/[{}\\]/g,"\\$&"),String(t.raw[s]));return Zc===void 0&&(Zc=nm()),Zc(i,r.join(""))};Object.defineProperties(Ds.prototype,yn);var qs=Ds();qs.supportsColor=Qc;qs.stderr=Ds({level:el?el.level:0});qs.stderr.supportsColor=el;lm.exports=qs});var Ke,wn=_i(()=>{Ke={webrtc:{enableWebRTC:!0,enableTurn:!1},robotSettings:{mouseDelay:2,keyboardDelay:2},throttling:{mouseThrottle:8,keyThrottle:25,typeTextThrottle:100,maxTextLength:1e3},resourceManagement:{inactiveTimeout:12e4,memoryCheckInterval:6e4,memoryWarningThreshold:1e3,maxTimersPerClient:100,maxChunkTimersPerClient:50},streaming:{activeInterval:80,idleInterval:400,idleThreshold:3,actionCaptureDelay:50,chunkSize:32,chunkDelay:5}}});var Sm={};Si(Sm,{TileManager:()=>rl});var zs,_n,$s,_m,ME,OE,rl,Em=_i(()=>{zs=L(require("sharp"),1),_n=L(require("fs"),1),$s=L(require("path"),1),_m=require("url"),ME=(0,_m.fileURLToPath)(__importMetaUrl),OE=$s.default.dirname(ME),rl=class{constructor(e){this.robot=e,this.tileSize=100,this.lastTileChecksums=new Map,this.screenWidth=0,this.screenHeight=0,this.tilesPerRow=0,this.tilesPerColumn=0,this.totalTiles=0,this.frameCount=0,this.tempDir=$s.default.join(OE,"../../temp"),this.compressionQuality=1,this.changeThreshold=1,this.scaleFactor=.99,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,_n.default.existsSync(this.tempDir)||_n.default.mkdirSync(this.tempDir,{recursive:!0}),this.initializeScreenDimensions()}initializeScreenDimensions(){try{let{width:e,height:t}=this.robot.getScreenSize();this.screenWidth=e,this.screenHeight=t,this.detectDpiScale(),this.scaledWidth=Math.floor(e*this.scaleFactor),this.scaledHeight=Math.floor(t*this.scaleFactor),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 r=Math.ceil(Math.sqrt(this.scaledWidth*this.scaledHeight/n));this.tileSize=Math.max(r,120),this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}console.log(`\u{1F5A5}\uFE0F TileManager: ${e}x${t} (DPI ${this.dpiScale}x) -> ${this.totalTiles} tiles`)}catch(e){console.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(){let e=Math.min(100,this.screenWidth),t=Math.min(100,this.screenHeight),n=this.robot.screen.capture(0,0,e,t),s=n.byteWidth/n.bytesPerPixel/e;s>=1.9&&s<=2.1?this.dpiScale=2:this.dpiScale=1,this.captureWidth=Math.floor(this.screenWidth*this.dpiScale),this.captureHeight=Math.floor(this.screenHeight*this.dpiScale)}async captureFullScreen(){let e=this.robot.screen.capture(0,0,this.captureWidth,this.captureHeight),t=Buffer.from(e.image),n=new Uint32Array(t.buffer,t.byteOffset,t.length>>2);for(let p=0;p<n.length;p++){let f=n[p];n[p]=f&4278255360|(f&16711680)>>16|(f&255)<<16}let r=e.byteWidth/e.bytesPerPixel,s=e.height,o=t,a=r,l=s;if(this.dpiScale>1||this.scaleFactor<1){let p=Math.floor(this.screenWidth*this.scaleFactor),f=Math.floor(this.screenHeight*this.scaleFactor);o=await(0,zs.default)(t,{raw:{width:r,height:s,channels:e.bytesPerPixel}}).resize(p,f,{kernel:zs.default.kernel.nearest,fit:"fill"}).raw().toBuffer(),a=p,l=f}return{buffer:o,width:a,height:l,channels:e.bytesPerPixel}}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;try{let e=await this.getSharedScreenCapture(),t=[],n=[],r=new Map;this.frameCount++;for(let a=0;a<this.totalTiles;a++){let l=this.calculateTileChecksumDirect(e,a);r.set(a,l)}let s=Array.from(r.values());if(this.lastTileChecksums.size===0){let a=[];for(let p=0;p<this.totalTiles;p++)this.lastTileChecksums.set(p,r.get(p)),a.push(this.processTileAsync(e,p));let l=await Promise.all(a);return t.push(...l),{tiles:t,currentHashes:s}}for(let a=0;a<this.totalTiles;a++){let l=r.get(a),p=this.lastTileChecksums.get(a);l!==p&&(n.push(a),this.lastTileChecksums.set(a,l))}if(n.length/this.totalTiles>this.changeThreshold){let a=[];for(let p=0;p<this.totalTiles;p++)a.push(this.processTileAsync(e,p));let l=await Promise.all(a);t.push(...l.map(p=>({...p,fullRefresh:!0})))}else if(n.length>0){let a=n.map(p=>this.processTileAsync(e,p)),l=await Promise.all(a);t.push(...l)}return{tiles:t,currentHashes:s}}finally{this.isProcessing=!1}}async processTileAsync(e,t,n=null){let r=n||this.extractTile(e,t),s=await this.compressTileImage(r.buffer,r.width,r.height),{row:o,col:a}=this.getTilePosition(t);return{type:"tile-update",tileIndex:t,x:a*this.tileSize,y:o*this.tileSize,width:r.width,height:r.height,imageBuffer:s,timestamp:Date.now(),frameCount:this.frameCount}}calculateTileChecksum(e){let t=0;for(let n=0;n<e.length;n+=64)t+=e[n]||0,t^=e[n+1]||0,t+=(e[n+2]||0)<<1,t^=(e[n+3]||0)<<2;return t>>>0}calculateTileChecksumDirect(e,t){let{row:n,col:r}=this.getTilePosition(t),s=r*this.tileSize,o=n*this.tileSize,a=Math.min(s+this.tileSize,e.width),l=Math.min(o+this.tileSize,e.height),p=a-s,f=l-o,m=e.channels,_=e.width*m,E=0,k=16;for(let T=0;T<f;T+=4){let M=(o+T)*_+s*m;for(let O=0;O<p;O+=k){let A=M+O*m;E+=e.buffer[A]||0,E^=e.buffer[A+1]||0,E+=(e.buffer[A+2]||0)<<1,E^=(e.buffer[A+3]||0)<<2}}return E>>>0}getTilePosition(e){return{row:Math.floor(e/this.tilesPerRow),col:e%this.tilesPerRow}}extractTile(e,t){let{row:n,col:r}=this.getTilePosition(t),s=r*this.tileSize,o=n*this.tileSize,a=Math.min(s+this.tileSize,e.width),l=Math.min(o+this.tileSize,e.height),p=a-s,f=l-o,m=e.channels,_=p*m,E=Buffer.alloc(p*f*m);for(let k=0;k<f;k++){let T=((o+k)*e.width+s)*m,M=k*_;e.buffer.copy(E,M,T,T+_)}return{buffer:E,width:p,height:f,channels:m,tileIndex:t,x:s,y:o}}async compressTileImage(e,t,n){return(0,zs.default)(e,{raw:{width:t,height:n,channels:4}}).jpeg({quality:85}).toBuffer()}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){console.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=[],r=[];this.frameCount++;let s=new Map;for(let a=0;a<this.totalTiles;a++){let l=this.calculateTileChecksumDirect(t,a);s.set(a,l),this.lastTileChecksums.set(a,l)}if(!e||e.length===0){let a=[];for(let p=0;p<this.totalTiles;p++)a.push(this.processTileAsync(t,p));let l=await Promise.all(a);return n.push(...l),{tiles:n,currentHashes:Array.from(s.values())}}for(let a=0;a<this.totalTiles;a++)e[a]!==s.get(a)&&r.push(a);if(r.length/this.totalTiles>this.changeThreshold){let a=[];for(let p=0;p<this.totalTiles;p++)a.push(this.processTileAsync(t,p));let l=await Promise.all(a);n.push(...l.map(p=>({...p,fullRefresh:!0})))}else if(r.length>0){let a=r.map(p=>this.processTileAsync(t,p)),l=await Promise.all(a);n.push(...l)}return{tiles:n,currentHashes:Array.from(s.values()),changedIndices:r}}finally{this.isProcessing=!1}}clearMemory(){this.sharedScreenCache=null,this.lastCaptureTime=0,this.lastTileChecksums.clear()}reset(){this.lastTileChecksums.clear(),this.frameCount=0}cleanup(){try{_n.default.existsSync(this.tempDir)&&_n.default.readdirSync(this.tempDir).forEach(t=>_n.default.unlinkSync($s.default.join(this.tempDir,t)))}catch(e){console.warn("Cleanup error:",e)}}}});var km={};Si(km,{ResourceManager:()=>sl});var sl,Cm=_i(()=>{wn();sl=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>Ke.resourceManagement.memoryWarningThreshold&&(console.warn(`\u26A0\uFE0F High memory: ${t}MB`),this.cleanupInactiveClients())},Ke.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=Ke.resourceManagement.inactiveTimeout;for(let[n,r]of this.activeClients.entries())e-r.lastActivity>t&&(console.log(`\u{1F9F9} Cleaning inactive client: ${n}`),this.cleanupClientResources(n,r),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 r=this.chunkTimers.get(e);r&&(r.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 Ke.streaming}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 Tm={};Si(Tm,{ScreenUpdateHelper:()=>ol});var ol,Mm=_i(()=>{wn();ol=class{constructor(e){this.resourceManager=e}async sendTilesInChunks(e,t,n,r=!1){if(!t||t.length===0)return;let s=Ke.streaming.chunkSize,o=[];for(let l=0;l<t.length;l+=s)o.push(t.slice(l,l+s));let a=this.resourceManager.getChunkTimers(e.id);for(let l=0;l<o.length;l++){let p=o[l],f=l===o.length-1,m=setTimeout(()=>{a.delete(m),e.connected&&e.emit("tiles-data",{tiles:p,timestamp:n,forceRefresh:!1,userAction:r,chunkInfo:{chunkIndex:l,totalChunks:o.length,isLastChunk:f}})},l*Ke.streaming.chunkDelay);a.add(m)}}}});var Om={};Si(Om,{MouseHandler:()=>al});var al,Am=_i(()=>{wn();al=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(r=>{let s=Date.now();if(!(s-this.lastMouseMove<Ke.throttling.mouseThrottle)){this.lastMouseMove=s;try{let o=n.getScreenSize(),a=Math.round(r.x/100*o.width),l=Math.round(r.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),f=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,f),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Mouse move error:",o.message)}}})),e.on("mouse-click",t(async r=>{try{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=n.getScreenSize(),a=Math.round(r.x/100*o.width),l=Math.round(r.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),f=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,f),n.mouseClick(r.button||"left",r.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 r=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(r.x/100*o.width),l=Math.round(r.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),f=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,f),n.mouseToggle("down",r.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse press error:",s.message)}})),e.on("mouse-release",t(async r=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(r.x/100*o.width),l=Math.round(r.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),f=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,f),n.mouseToggle("up",r.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse release error:",s.message)}})),e.on("scroll",t(async r=>{try{let{direction:s,amount:o=60,horizontal:a=!1}=r,l=this.resourceManager.getClient(e.id);if(!l)return;let p=0,f=0;a||s==="left"||s==="right"?p=s==="right"?o:-o:f=s==="down"?-o:o,n.scrollMouse(p,f),l.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Scroll error:",s.message)}})),e.on("mouse-drag-select",t(r=>{try{let{startX:s,startY:o,endX:a,endY:l}=r,p=n.getScreenSize(),f=Math.round(s/100*p.width),m=Math.round(o/100*p.height),_=Math.round(a/100*p.width),E=Math.round(l/100*p.height),k=Math.max(0,Math.min(p.width-1,f)),T=Math.max(0,Math.min(p.height-1,m)),M=Math.max(0,Math.min(p.width-1,_)),O=Math.max(0,Math.min(p.height-1,E));n.moveMouse(k,T),n.mouseToggle("down","left"),n.dragMouse(M,O),n.mouseToggle("up","left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Drag selection error:",s.message)}}))}}});var Rm={};Si(Rm,{KeyboardHandler:()=>cl});var cl,Pm=_i(()=>{wn();cl=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(r=>{let s=Date.now();if(!(s-this.lastKeyPress<Ke.throttling.keyThrottle)){this.lastKeyPress=s;try{if(!r.key||typeof r.key!="string")return;let o=this.resourceManager.getClient(e.id),a=r.key;if(a.length===1){n.keyTap(a,r.modifier||[]);for(let l of r.modifier||[])n.keyToggle(l,"up")}else switch(a.toLowerCase()){case"enter":case"return":n.keyTap("enter");break;case"space":n.keyTap(" ");break;case"backspace":n.keyTap("backspace");break;case"tab":n.keyTap("tab");break;case"escape":n.keyTap("escape");break;default:n.keyTap(a,r.modifier||[])}o&&(o.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Key press error:",o.message)}}})),e.on("type-text",t(r=>{let s=Date.now();if(!(s-this.lastTypeText<Ke.throttling.typeTextThrottle)){this.lastTypeText=s;try{if(!r.text||typeof r.text!="string")return;let o=r.text;o.length>Ke.throttling.maxTextLength&&(o=o.substring(0,Ke.throttling.maxTextLength));let a=o.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,""),l=this.resourceManager.getClient(e.id);setTimeout(()=>{try{n.typeString(a),this.resourceManager.updateClientActivity(e.id),l&&(l.idleFrameCount=0,l.tileManager&&l.tileManager.clearScreenCache())}catch(p){console.error("Robot typeString error:",p.message)}},10)}catch(o){console.error("Type text error:",o.message)}}}))}}});var Bm={};Si(Bm,{ScreenHandler:()=>ll});function AE(i){let e=Buffer.alloc(20);return e.writeUInt32LE(i.tileIndex,0),e.writeUInt32LE(i.x,4),e.writeUInt32LE(i.y,8),e.writeUInt32LE(i.width,12),e.writeUInt32LE(i.height,16),Buffer.concat([e,i.imageBuffer])}var ll,jm=_i(()=>{ll=class{constructor(e,t,n=null){this.resourceManager=e,this.screenUpdateHelper=t,this.webrtcManager=n}_sendTiles(e,t){if(this.webrtcManager?.isReady(e.id)&&t.tiles?.length>0){let n=!0;for(let r of t.tiles){let s=AE(r);if(!this.webrtcManager.sendTile(e.id,s)){n=!1;break}}if(n)return}e.emit("tiles-data",t)}setupScreenHandlers(e,t){e.on("request-screen",t(async()=>{let n=this.resourceManager.getClient(e.id);if(n)try{let r=await n.tileManager.detectChangedTiles();r.length>0&&this._sendTiles(e,{tiles:r,timestamp:Date.now()}),this.resourceManager.updateClientActivity(e.id)}catch(r){console.error("Tile capture error:",r),e.emit("screen-error",{error:r.message})}})),e.on("request-screen-with-hashes",t(async n=>{let r=this.resourceManager.getClient(e.id);if(r)try{let s=n.tileHashes||[],o=await r.tileManager.compareClientTileHashes(s);o?.tiles?.length>0?this._sendTiles(e,{tiles:o.tiles,timestamp:Date.now(),currentHashes:o.currentHashes,changedIndices:o.changedIndices}):e.emit("tiles-data",{tiles:[],timestamp:Date.now(),currentHashes:o.currentHashes,changedIndices:[]}),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Tile capture with hashes error:",s),e.emit("screen-error",{error:s.message})}})),e.on("start-streaming",t(()=>{let n=this.resourceManager.getClient(e.id);if(!n)return;n.streamingTimeout&&(clearTimeout(n.streamingTimeout),n.streamingTimeout=null),console.log("\u{1F680} Remote streaming started"),n.idleFrameCount=0,n.isStreaming=!0;let r=async()=>{if(!e.connected||!n.isStreaming){n.streamingTimeout=null;return}try{let s=performance.now(),o=await n.tileManager.detectChangedTilesWithHashes();o.tiles.length>0&&e.connected?(this._sendTiles(e,{tiles:o.tiles,timestamp:Date.now(),currentHashes:o.currentHashes}),n.idleFrameCount=0):n.idleFrameCount++;let{activeInterval:l,idleInterval:p,idleThreshold:f}=this.resourceManager.getStreamingConfig(),m=n.idleFrameCount>=f?p:l,_=Math.max(0,m-(performance.now()-s));n.streamingTimeout=setTimeout(r,_)}catch(s){console.error("Auto streaming error:",s),n.streamingTimeout=setTimeout(r,200)}};r()})),e.on("stop-streaming",()=>{let n=this.resourceManager.getClient(e.id);n&&(n.isStreaming=!1,n.streamingTimeout&&(clearTimeout(n.streamingTimeout),n.streamingTimeout=null),console.log("\u23F9\uFE0F Remote streaming stopped"))}),e.on("get-screen-dimensions",t(async()=>{let n=this.resourceManager.getClient(e.id);if(n)try{let r=await n.tileManager.getScreenDimensions();e.emit("screen-dimensions",r)}catch(r){console.error("Get dimensions error:",r),e.emit("screen-error",{error:r.message})}})),e.on("boost-stream",t(()=>{let n=this.resourceManager.getClient(e.id);n&&(n.idleFrameCount=0)}))}}});var ml=C((tv,hl)=>{(function(i,e){"use strict";function t(b,c){if(!b)throw new Error(c||"Assertion failed")}function n(b,c){b.super_=c;var d=function(){};d.prototype=c.prototype,b.prototype=new d,b.prototype.constructor=b}function r(b,c,d){if(r.isBN(b))return b;this.negative=0,this.words=null,this.length=0,this.red=null,b!==null&&((c==="le"||c==="be")&&(d=c,c=10),this._init(b||0,c||10,d||"be"))}typeof i=="object"?i.exports=r:e.BN=r,r.BN=r,r.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=require("buffer").Buffer}catch{}r.isBN=function(c){return c instanceof r?!0:c!==null&&typeof c=="object"&&c.constructor.wordSize===r.wordSize&&Array.isArray(c.words)},r.max=function(c,d){return c.cmp(d)>0?c:d},r.min=function(c,d){return c.cmp(d)<0?c:d},r.prototype._init=function(c,d,h){if(typeof c=="number")return this._initNumber(c,d,h);if(typeof c=="object")return this._initArray(c,d,h);d==="hex"&&(d=16),t(d===(d|0)&&d>=2&&d<=36),c=c.toString().replace(/\s+/g,"");var v=0;c[0]==="-"&&(v++,this.negative=1),v<c.length&&(d===16?this._parseHex(c,v,h):(this._parseBase(c,d,v),h==="le"&&this._initArray(this.toArray(),d,h)))},r.prototype._initNumber=function(c,d,h){c<0&&(this.negative=1,c=-c),c<67108864?(this.words=[c&67108863],this.length=1):c<4503599627370496?(this.words=[c&67108863,c/67108864&67108863],this.length=2):(t(c<9007199254740992),this.words=[c&67108863,c/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),d,h)},r.prototype._initArray=function(c,d,h){if(t(typeof c.length=="number"),c.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(c.length/3),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var y,w,S=0;if(h==="be")for(v=c.length-1,y=0;v>=0;v-=3)w=c[v]|c[v-1]<<8|c[v-2]<<16,this.words[y]|=w<<S&67108863,this.words[y+1]=w>>>26-S&67108863,S+=24,S>=26&&(S-=26,y++);else if(h==="le")for(v=0,y=0;v<c.length;v+=3)w=c[v]|c[v+1]<<8|c[v+2]<<16,this.words[y]|=w<<S&67108863,this.words[y+1]=w>>>26-S&67108863,S+=24,S>=26&&(S-=26,y++);return this.strip()};function o(b,c){var d=b.charCodeAt(c);return d>=65&&d<=70?d-55:d>=97&&d<=102?d-87:d-48&15}function a(b,c,d){var h=o(b,d);return d-1>=c&&(h|=o(b,d-1)<<4),h}r.prototype._parseHex=function(c,d,h){this.length=Math.ceil((c.length-d)/6),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var y=0,w=0,S;if(h==="be")for(v=c.length-1;v>=d;v-=2)S=a(c,d,v)<<y,this.words[w]|=S&67108863,y>=18?(y-=18,w+=1,this.words[w]|=S>>>26):y+=8;else{var g=c.length-d;for(v=g%2===0?d+1:d;v<c.length;v+=2)S=a(c,d,v)<<y,this.words[w]|=S&67108863,y>=18?(y-=18,w+=1,this.words[w]|=S>>>26):y+=8}this.strip()};function l(b,c,d,h){for(var v=0,y=Math.min(b.length,d),w=c;w<y;w++){var S=b.charCodeAt(w)-48;v*=h,S>=49?v+=S-49+10:S>=17?v+=S-17+10:v+=S}return v}r.prototype._parseBase=function(c,d,h){this.words=[0],this.length=1;for(var v=0,y=1;y<=67108863;y*=d)v++;v--,y=y/d|0;for(var w=c.length-h,S=w%v,g=Math.min(w,w-S)+h,u=0,x=h;x<g;x+=v)u=l(c,x,x+v,d),this.imuln(y),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(S!==0){var P=1;for(u=l(c,x,c.length,d),x=0;x<S;x++)P*=d;this.imuln(P),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},r.prototype.copy=function(c){c.words=new Array(this.length);for(var d=0;d<this.length;d++)c.words[d]=this.words[d];c.length=this.length,c.negative=this.negative,c.red=this.red},r.prototype.clone=function(){var c=new r(null);return this.copy(c),c},r.prototype._expand=function(c){for(;this.length<c;)this.words[this.length++]=0;return this},r.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},r.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},r.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var p=["","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"],f=[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],m=[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];r.prototype.toString=function(c,d){c=c||10,d=d|0||1;var h;if(c===16||c==="hex"){h="";for(var v=0,y=0,w=0;w<this.length;w++){var S=this.words[w],g=((S<<v|y)&16777215).toString(16);y=S>>>24-v&16777215,v+=2,v>=26&&(v-=26,w--),y!==0||w!==this.length-1?h=p[6-g.length]+g+h:h=g+h}for(y!==0&&(h=y.toString(16)+h);h.length%d!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(c===(c|0)&&c>=2&&c<=36){var u=f[c],x=m[c];h="";var P=this.clone();for(P.negative=0;!P.isZero();){var B=P.modn(x).toString(c);P=P.idivn(x),P.isZero()?h=B+h:h=p[u-B.length]+B+h}for(this.isZero()&&(h="0"+h);h.length%d!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}t(!1,"Base should be between 2 and 36")},r.prototype.toNumber=function(){var c=this.words[0];return this.length===2?c+=this.words[1]*67108864:this.length===3&&this.words[2]===1?c+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-c:c},r.prototype.toJSON=function(){return this.toString(16)},r.prototype.toBuffer=function(c,d){return t(typeof s<"u"),this.toArrayLike(s,c,d)},r.prototype.toArray=function(c,d){return this.toArrayLike(Array,c,d)},r.prototype.toArrayLike=function(c,d,h){var v=this.byteLength(),y=h||Math.max(1,v);t(v<=y,"byte array longer than desired length"),t(y>0,"Requested array length <= 0"),this.strip();var w=d==="le",S=new c(y),g,u,x=this.clone();if(w){for(u=0;!x.isZero();u++)g=x.andln(255),x.iushrn(8),S[u]=g;for(;u<y;u++)S[u]=0}else{for(u=0;u<y-v;u++)S[u]=0;for(u=0;!x.isZero();u++)g=x.andln(255),x.iushrn(8),S[y-u-1]=g}return S},Math.clz32?r.prototype._countBits=function(c){return 32-Math.clz32(c)}:r.prototype._countBits=function(c){var d=c,h=0;return d>=4096&&(h+=13,d>>>=13),d>=64&&(h+=7,d>>>=7),d>=8&&(h+=4,d>>>=4),d>=2&&(h+=2,d>>>=2),h+d},r.prototype._zeroBits=function(c){if(c===0)return 26;var d=c,h=0;return(d&8191)===0&&(h+=13,d>>>=13),(d&127)===0&&(h+=7,d>>>=7),(d&15)===0&&(h+=4,d>>>=4),(d&3)===0&&(h+=2,d>>>=2),(d&1)===0&&h++,h},r.prototype.bitLength=function(){var c=this.words[this.length-1],d=this._countBits(c);return(this.length-1)*26+d};function _(b){for(var c=new Array(b.bitLength()),d=0;d<c.length;d++){var h=d/26|0,v=d%26;c[d]=(b.words[h]&1<<v)>>>v}return c}r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var c=0,d=0;d<this.length;d++){var h=this._zeroBits(this.words[d]);if(c+=h,h!==26)break}return c},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(c){return this.negative!==0?this.abs().inotn(c).iaddn(1):this.clone()},r.prototype.fromTwos=function(c){return this.testn(c-1)?this.notn(c).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return this.negative!==0},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(c){for(;this.length<c.length;)this.words[this.length++]=0;for(var d=0;d<c.length;d++)this.words[d]=this.words[d]|c.words[d];return this.strip()},r.prototype.ior=function(c){return t((this.negative|c.negative)===0),this.iuor(c)},r.prototype.or=function(c){return this.length>c.length?this.clone().ior(c):c.clone().ior(this)},r.prototype.uor=function(c){return this.length>c.length?this.clone().iuor(c):c.clone().iuor(this)},r.prototype.iuand=function(c){var d;this.length>c.length?d=c:d=this;for(var h=0;h<d.length;h++)this.words[h]=this.words[h]&c.words[h];return this.length=d.length,this.strip()},r.prototype.iand=function(c){return t((this.negative|c.negative)===0),this.iuand(c)},r.prototype.and=function(c){return this.length>c.length?this.clone().iand(c):c.clone().iand(this)},r.prototype.uand=function(c){return this.length>c.length?this.clone().iuand(c):c.clone().iuand(this)},r.prototype.iuxor=function(c){var d,h;this.length>c.length?(d=this,h=c):(d=c,h=this);for(var v=0;v<h.length;v++)this.words[v]=d.words[v]^h.words[v];if(this!==d)for(;v<d.length;v++)this.words[v]=d.words[v];return this.length=d.length,this.strip()},r.prototype.ixor=function(c){return t((this.negative|c.negative)===0),this.iuxor(c)},r.prototype.xor=function(c){return this.length>c.length?this.clone().ixor(c):c.clone().ixor(this)},r.prototype.uxor=function(c){return this.length>c.length?this.clone().iuxor(c):c.clone().iuxor(this)},r.prototype.inotn=function(c){t(typeof c=="number"&&c>=0);var d=Math.ceil(c/26)|0,h=c%26;this._expand(d),h>0&&d--;for(var v=0;v<d;v++)this.words[v]=~this.words[v]&67108863;return h>0&&(this.words[v]=~this.words[v]&67108863>>26-h),this.strip()},r.prototype.notn=function(c){return this.clone().inotn(c)},r.prototype.setn=function(c,d){t(typeof c=="number"&&c>=0);var h=c/26|0,v=c%26;return this._expand(h+1),d?this.words[h]=this.words[h]|1<<v:this.words[h]=this.words[h]&~(1<<v),this.strip()},r.prototype.iadd=function(c){var d;if(this.negative!==0&&c.negative===0)return this.negative=0,d=this.isub(c),this.negative^=1,this._normSign();if(this.negative===0&&c.negative!==0)return c.negative=0,d=this.isub(c),c.negative=1,d._normSign();var h,v;this.length>c.length?(h=this,v=c):(h=c,v=this);for(var y=0,w=0;w<v.length;w++)d=(h.words[w]|0)+(v.words[w]|0)+y,this.words[w]=d&67108863,y=d>>>26;for(;y!==0&&w<h.length;w++)d=(h.words[w]|0)+y,this.words[w]=d&67108863,y=d>>>26;if(this.length=h.length,y!==0)this.words[this.length]=y,this.length++;else if(h!==this)for(;w<h.length;w++)this.words[w]=h.words[w];return this},r.prototype.add=function(c){var d;return c.negative!==0&&this.negative===0?(c.negative=0,d=this.sub(c),c.negative^=1,d):c.negative===0&&this.negative!==0?(this.negative=0,d=c.sub(this),this.negative=1,d):this.length>c.length?this.clone().iadd(c):c.clone().iadd(this)},r.prototype.isub=function(c){if(c.negative!==0){c.negative=0;var d=this.iadd(c);return c.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(c),this.negative=1,this._normSign();var h=this.cmp(c);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var v,y;h>0?(v=this,y=c):(v=c,y=this);for(var w=0,S=0;S<y.length;S++)d=(v.words[S]|0)-(y.words[S]|0)+w,w=d>>26,this.words[S]=d&67108863;for(;w!==0&&S<v.length;S++)d=(v.words[S]|0)+w,w=d>>26,this.words[S]=d&67108863;if(w===0&&S<v.length&&v!==this)for(;S<v.length;S++)this.words[S]=v.words[S];return this.length=Math.max(this.length,S),v!==this&&(this.negative=1),this.strip()},r.prototype.sub=function(c){return this.clone().isub(c)};function E(b,c,d){d.negative=c.negative^b.negative;var h=b.length+c.length|0;d.length=h,h=h-1|0;var v=b.words[0]|0,y=c.words[0]|0,w=v*y,S=w&67108863,g=w/67108864|0;d.words[0]=S;for(var u=1;u<h;u++){for(var x=g>>>26,P=g&67108863,B=Math.min(u,c.length-1),j=Math.max(0,u-b.length+1);j<=B;j++){var I=u-j|0;v=b.words[I]|0,y=c.words[j]|0,w=v*y+P,x+=w/67108864|0,P=w&67108863}d.words[u]=P|0,g=x|0}return g!==0?d.words[u]=g|0:d.length--,d.strip()}var k=function(c,d,h){var v=c.words,y=d.words,w=h.words,S=0,g,u,x,P=v[0]|0,B=P&8191,j=P>>>13,I=v[1]|0,$=I&8191,Y=I>>>13,oi=v[2]|0,J=oi&8191,Q=oi>>>13,Su=v[3]|0,ce=Su&8191,le=Su>>>13,Eu=v[4]|0,ue=Eu&8191,pe=Eu>>>13,ku=v[5]|0,de=ku&8191,fe=ku>>>13,Cu=v[6]|0,he=Cu&8191,me=Cu>>>13,Tu=v[7]|0,ve=Tu&8191,ge=Tu>>>13,Mu=v[8]|0,xe=Mu&8191,ye=Mu>>>13,Ou=v[9]|0,be=Ou&8191,we=Ou>>>13,Au=y[0]|0,_e=Au&8191,Se=Au>>>13,Ru=y[1]|0,Ee=Ru&8191,ke=Ru>>>13,Pu=y[2]|0,Ce=Pu&8191,Te=Pu>>>13,Bu=y[3]|0,Me=Bu&8191,Oe=Bu>>>13,ju=y[4]|0,Ae=ju&8191,Re=ju>>>13,Nu=y[5]|0,Pe=Nu&8191,Be=Nu>>>13,Du=y[6]|0,je=Du&8191,Ne=Du>>>13,Iu=y[7]|0,De=Iu&8191,Ie=Iu>>>13,qu=y[8]|0,qe=qu&8191,Le=qu>>>13,Lu=y[9]|0,Fe=Lu&8191,Ue=Lu>>>13;h.negative=c.negative^d.negative,h.length=19,g=Math.imul(B,_e),u=Math.imul(B,Se),u=u+Math.imul(j,_e)|0,x=Math.imul(j,Se);var Lo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,g=Math.imul($,_e),u=Math.imul($,Se),u=u+Math.imul(Y,_e)|0,x=Math.imul(Y,Se),g=g+Math.imul(B,Ee)|0,u=u+Math.imul(B,ke)|0,u=u+Math.imul(j,Ee)|0,x=x+Math.imul(j,ke)|0;var Fo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Fo>>>26)|0,Fo&=67108863,g=Math.imul(J,_e),u=Math.imul(J,Se),u=u+Math.imul(Q,_e)|0,x=Math.imul(Q,Se),g=g+Math.imul($,Ee)|0,u=u+Math.imul($,ke)|0,u=u+Math.imul(Y,Ee)|0,x=x+Math.imul(Y,ke)|0,g=g+Math.imul(B,Ce)|0,u=u+Math.imul(B,Te)|0,u=u+Math.imul(j,Ce)|0,x=x+Math.imul(j,Te)|0;var Uo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,g=Math.imul(ce,_e),u=Math.imul(ce,Se),u=u+Math.imul(le,_e)|0,x=Math.imul(le,Se),g=g+Math.imul(J,Ee)|0,u=u+Math.imul(J,ke)|0,u=u+Math.imul(Q,Ee)|0,x=x+Math.imul(Q,ke)|0,g=g+Math.imul($,Ce)|0,u=u+Math.imul($,Te)|0,u=u+Math.imul(Y,Ce)|0,x=x+Math.imul(Y,Te)|0,g=g+Math.imul(B,Me)|0,u=u+Math.imul(B,Oe)|0,u=u+Math.imul(j,Me)|0,x=x+Math.imul(j,Oe)|0;var Ho=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Ho>>>26)|0,Ho&=67108863,g=Math.imul(ue,_e),u=Math.imul(ue,Se),u=u+Math.imul(pe,_e)|0,x=Math.imul(pe,Se),g=g+Math.imul(ce,Ee)|0,u=u+Math.imul(ce,ke)|0,u=u+Math.imul(le,Ee)|0,x=x+Math.imul(le,ke)|0,g=g+Math.imul(J,Ce)|0,u=u+Math.imul(J,Te)|0,u=u+Math.imul(Q,Ce)|0,x=x+Math.imul(Q,Te)|0,g=g+Math.imul($,Me)|0,u=u+Math.imul($,Oe)|0,u=u+Math.imul(Y,Me)|0,x=x+Math.imul(Y,Oe)|0,g=g+Math.imul(B,Ae)|0,u=u+Math.imul(B,Re)|0,u=u+Math.imul(j,Ae)|0,x=x+Math.imul(j,Re)|0;var zo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(zo>>>26)|0,zo&=67108863,g=Math.imul(de,_e),u=Math.imul(de,Se),u=u+Math.imul(fe,_e)|0,x=Math.imul(fe,Se),g=g+Math.imul(ue,Ee)|0,u=u+Math.imul(ue,ke)|0,u=u+Math.imul(pe,Ee)|0,x=x+Math.imul(pe,ke)|0,g=g+Math.imul(ce,Ce)|0,u=u+Math.imul(ce,Te)|0,u=u+Math.imul(le,Ce)|0,x=x+Math.imul(le,Te)|0,g=g+Math.imul(J,Me)|0,u=u+Math.imul(J,Oe)|0,u=u+Math.imul(Q,Me)|0,x=x+Math.imul(Q,Oe)|0,g=g+Math.imul($,Ae)|0,u=u+Math.imul($,Re)|0,u=u+Math.imul(Y,Ae)|0,x=x+Math.imul(Y,Re)|0,g=g+Math.imul(B,Pe)|0,u=u+Math.imul(B,Be)|0,u=u+Math.imul(j,Pe)|0,x=x+Math.imul(j,Be)|0;var $o=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+($o>>>26)|0,$o&=67108863,g=Math.imul(he,_e),u=Math.imul(he,Se),u=u+Math.imul(me,_e)|0,x=Math.imul(me,Se),g=g+Math.imul(de,Ee)|0,u=u+Math.imul(de,ke)|0,u=u+Math.imul(fe,Ee)|0,x=x+Math.imul(fe,ke)|0,g=g+Math.imul(ue,Ce)|0,u=u+Math.imul(ue,Te)|0,u=u+Math.imul(pe,Ce)|0,x=x+Math.imul(pe,Te)|0,g=g+Math.imul(ce,Me)|0,u=u+Math.imul(ce,Oe)|0,u=u+Math.imul(le,Me)|0,x=x+Math.imul(le,Oe)|0,g=g+Math.imul(J,Ae)|0,u=u+Math.imul(J,Re)|0,u=u+Math.imul(Q,Ae)|0,x=x+Math.imul(Q,Re)|0,g=g+Math.imul($,Pe)|0,u=u+Math.imul($,Be)|0,u=u+Math.imul(Y,Pe)|0,x=x+Math.imul(Y,Be)|0,g=g+Math.imul(B,je)|0,u=u+Math.imul(B,Ne)|0,u=u+Math.imul(j,je)|0,x=x+Math.imul(j,Ne)|0;var Wo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Wo>>>26)|0,Wo&=67108863,g=Math.imul(ve,_e),u=Math.imul(ve,Se),u=u+Math.imul(ge,_e)|0,x=Math.imul(ge,Se),g=g+Math.imul(he,Ee)|0,u=u+Math.imul(he,ke)|0,u=u+Math.imul(me,Ee)|0,x=x+Math.imul(me,ke)|0,g=g+Math.imul(de,Ce)|0,u=u+Math.imul(de,Te)|0,u=u+Math.imul(fe,Ce)|0,x=x+Math.imul(fe,Te)|0,g=g+Math.imul(ue,Me)|0,u=u+Math.imul(ue,Oe)|0,u=u+Math.imul(pe,Me)|0,x=x+Math.imul(pe,Oe)|0,g=g+Math.imul(ce,Ae)|0,u=u+Math.imul(ce,Re)|0,u=u+Math.imul(le,Ae)|0,x=x+Math.imul(le,Re)|0,g=g+Math.imul(J,Pe)|0,u=u+Math.imul(J,Be)|0,u=u+Math.imul(Q,Pe)|0,x=x+Math.imul(Q,Be)|0,g=g+Math.imul($,je)|0,u=u+Math.imul($,Ne)|0,u=u+Math.imul(Y,je)|0,x=x+Math.imul(Y,Ne)|0,g=g+Math.imul(B,De)|0,u=u+Math.imul(B,Ie)|0,u=u+Math.imul(j,De)|0,x=x+Math.imul(j,Ie)|0;var Vo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Vo>>>26)|0,Vo&=67108863,g=Math.imul(xe,_e),u=Math.imul(xe,Se),u=u+Math.imul(ye,_e)|0,x=Math.imul(ye,Se),g=g+Math.imul(ve,Ee)|0,u=u+Math.imul(ve,ke)|0,u=u+Math.imul(ge,Ee)|0,x=x+Math.imul(ge,ke)|0,g=g+Math.imul(he,Ce)|0,u=u+Math.imul(he,Te)|0,u=u+Math.imul(me,Ce)|0,x=x+Math.imul(me,Te)|0,g=g+Math.imul(de,Me)|0,u=u+Math.imul(de,Oe)|0,u=u+Math.imul(fe,Me)|0,x=x+Math.imul(fe,Oe)|0,g=g+Math.imul(ue,Ae)|0,u=u+Math.imul(ue,Re)|0,u=u+Math.imul(pe,Ae)|0,x=x+Math.imul(pe,Re)|0,g=g+Math.imul(ce,Pe)|0,u=u+Math.imul(ce,Be)|0,u=u+Math.imul(le,Pe)|0,x=x+Math.imul(le,Be)|0,g=g+Math.imul(J,je)|0,u=u+Math.imul(J,Ne)|0,u=u+Math.imul(Q,je)|0,x=x+Math.imul(Q,Ne)|0,g=g+Math.imul($,De)|0,u=u+Math.imul($,Ie)|0,u=u+Math.imul(Y,De)|0,x=x+Math.imul(Y,Ie)|0,g=g+Math.imul(B,qe)|0,u=u+Math.imul(B,Le)|0,u=u+Math.imul(j,qe)|0,x=x+Math.imul(j,Le)|0;var Ko=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Ko>>>26)|0,Ko&=67108863,g=Math.imul(be,_e),u=Math.imul(be,Se),u=u+Math.imul(we,_e)|0,x=Math.imul(we,Se),g=g+Math.imul(xe,Ee)|0,u=u+Math.imul(xe,ke)|0,u=u+Math.imul(ye,Ee)|0,x=x+Math.imul(ye,ke)|0,g=g+Math.imul(ve,Ce)|0,u=u+Math.imul(ve,Te)|0,u=u+Math.imul(ge,Ce)|0,x=x+Math.imul(ge,Te)|0,g=g+Math.imul(he,Me)|0,u=u+Math.imul(he,Oe)|0,u=u+Math.imul(me,Me)|0,x=x+Math.imul(me,Oe)|0,g=g+Math.imul(de,Ae)|0,u=u+Math.imul(de,Re)|0,u=u+Math.imul(fe,Ae)|0,x=x+Math.imul(fe,Re)|0,g=g+Math.imul(ue,Pe)|0,u=u+Math.imul(ue,Be)|0,u=u+Math.imul(pe,Pe)|0,x=x+Math.imul(pe,Be)|0,g=g+Math.imul(ce,je)|0,u=u+Math.imul(ce,Ne)|0,u=u+Math.imul(le,je)|0,x=x+Math.imul(le,Ne)|0,g=g+Math.imul(J,De)|0,u=u+Math.imul(J,Ie)|0,u=u+Math.imul(Q,De)|0,x=x+Math.imul(Q,Ie)|0,g=g+Math.imul($,qe)|0,u=u+Math.imul($,Le)|0,u=u+Math.imul(Y,qe)|0,x=x+Math.imul(Y,Le)|0,g=g+Math.imul(B,Fe)|0,u=u+Math.imul(B,Ue)|0,u=u+Math.imul(j,Fe)|0,x=x+Math.imul(j,Ue)|0;var Go=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Go>>>26)|0,Go&=67108863,g=Math.imul(be,Ee),u=Math.imul(be,ke),u=u+Math.imul(we,Ee)|0,x=Math.imul(we,ke),g=g+Math.imul(xe,Ce)|0,u=u+Math.imul(xe,Te)|0,u=u+Math.imul(ye,Ce)|0,x=x+Math.imul(ye,Te)|0,g=g+Math.imul(ve,Me)|0,u=u+Math.imul(ve,Oe)|0,u=u+Math.imul(ge,Me)|0,x=x+Math.imul(ge,Oe)|0,g=g+Math.imul(he,Ae)|0,u=u+Math.imul(he,Re)|0,u=u+Math.imul(me,Ae)|0,x=x+Math.imul(me,Re)|0,g=g+Math.imul(de,Pe)|0,u=u+Math.imul(de,Be)|0,u=u+Math.imul(fe,Pe)|0,x=x+Math.imul(fe,Be)|0,g=g+Math.imul(ue,je)|0,u=u+Math.imul(ue,Ne)|0,u=u+Math.imul(pe,je)|0,x=x+Math.imul(pe,Ne)|0,g=g+Math.imul(ce,De)|0,u=u+Math.imul(ce,Ie)|0,u=u+Math.imul(le,De)|0,x=x+Math.imul(le,Ie)|0,g=g+Math.imul(J,qe)|0,u=u+Math.imul(J,Le)|0,u=u+Math.imul(Q,qe)|0,x=x+Math.imul(Q,Le)|0,g=g+Math.imul($,Fe)|0,u=u+Math.imul($,Ue)|0,u=u+Math.imul(Y,Fe)|0,x=x+Math.imul(Y,Ue)|0;var Yo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Yo>>>26)|0,Yo&=67108863,g=Math.imul(be,Ce),u=Math.imul(be,Te),u=u+Math.imul(we,Ce)|0,x=Math.imul(we,Te),g=g+Math.imul(xe,Me)|0,u=u+Math.imul(xe,Oe)|0,u=u+Math.imul(ye,Me)|0,x=x+Math.imul(ye,Oe)|0,g=g+Math.imul(ve,Ae)|0,u=u+Math.imul(ve,Re)|0,u=u+Math.imul(ge,Ae)|0,x=x+Math.imul(ge,Re)|0,g=g+Math.imul(he,Pe)|0,u=u+Math.imul(he,Be)|0,u=u+Math.imul(me,Pe)|0,x=x+Math.imul(me,Be)|0,g=g+Math.imul(de,je)|0,u=u+Math.imul(de,Ne)|0,u=u+Math.imul(fe,je)|0,x=x+Math.imul(fe,Ne)|0,g=g+Math.imul(ue,De)|0,u=u+Math.imul(ue,Ie)|0,u=u+Math.imul(pe,De)|0,x=x+Math.imul(pe,Ie)|0,g=g+Math.imul(ce,qe)|0,u=u+Math.imul(ce,Le)|0,u=u+Math.imul(le,qe)|0,x=x+Math.imul(le,Le)|0,g=g+Math.imul(J,Fe)|0,u=u+Math.imul(J,Ue)|0,u=u+Math.imul(Q,Fe)|0,x=x+Math.imul(Q,Ue)|0;var Jo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Jo>>>26)|0,Jo&=67108863,g=Math.imul(be,Me),u=Math.imul(be,Oe),u=u+Math.imul(we,Me)|0,x=Math.imul(we,Oe),g=g+Math.imul(xe,Ae)|0,u=u+Math.imul(xe,Re)|0,u=u+Math.imul(ye,Ae)|0,x=x+Math.imul(ye,Re)|0,g=g+Math.imul(ve,Pe)|0,u=u+Math.imul(ve,Be)|0,u=u+Math.imul(ge,Pe)|0,x=x+Math.imul(ge,Be)|0,g=g+Math.imul(he,je)|0,u=u+Math.imul(he,Ne)|0,u=u+Math.imul(me,je)|0,x=x+Math.imul(me,Ne)|0,g=g+Math.imul(de,De)|0,u=u+Math.imul(de,Ie)|0,u=u+Math.imul(fe,De)|0,x=x+Math.imul(fe,Ie)|0,g=g+Math.imul(ue,qe)|0,u=u+Math.imul(ue,Le)|0,u=u+Math.imul(pe,qe)|0,x=x+Math.imul(pe,Le)|0,g=g+Math.imul(ce,Fe)|0,u=u+Math.imul(ce,Ue)|0,u=u+Math.imul(le,Fe)|0,x=x+Math.imul(le,Ue)|0;var Xo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Xo>>>26)|0,Xo&=67108863,g=Math.imul(be,Ae),u=Math.imul(be,Re),u=u+Math.imul(we,Ae)|0,x=Math.imul(we,Re),g=g+Math.imul(xe,Pe)|0,u=u+Math.imul(xe,Be)|0,u=u+Math.imul(ye,Pe)|0,x=x+Math.imul(ye,Be)|0,g=g+Math.imul(ve,je)|0,u=u+Math.imul(ve,Ne)|0,u=u+Math.imul(ge,je)|0,x=x+Math.imul(ge,Ne)|0,g=g+Math.imul(he,De)|0,u=u+Math.imul(he,Ie)|0,u=u+Math.imul(me,De)|0,x=x+Math.imul(me,Ie)|0,g=g+Math.imul(de,qe)|0,u=u+Math.imul(de,Le)|0,u=u+Math.imul(fe,qe)|0,x=x+Math.imul(fe,Le)|0,g=g+Math.imul(ue,Fe)|0,u=u+Math.imul(ue,Ue)|0,u=u+Math.imul(pe,Fe)|0,x=x+Math.imul(pe,Ue)|0;var Zo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Zo>>>26)|0,Zo&=67108863,g=Math.imul(be,Pe),u=Math.imul(be,Be),u=u+Math.imul(we,Pe)|0,x=Math.imul(we,Be),g=g+Math.imul(xe,je)|0,u=u+Math.imul(xe,Ne)|0,u=u+Math.imul(ye,je)|0,x=x+Math.imul(ye,Ne)|0,g=g+Math.imul(ve,De)|0,u=u+Math.imul(ve,Ie)|0,u=u+Math.imul(ge,De)|0,x=x+Math.imul(ge,Ie)|0,g=g+Math.imul(he,qe)|0,u=u+Math.imul(he,Le)|0,u=u+Math.imul(me,qe)|0,x=x+Math.imul(me,Le)|0,g=g+Math.imul(de,Fe)|0,u=u+Math.imul(de,Ue)|0,u=u+Math.imul(fe,Fe)|0,x=x+Math.imul(fe,Ue)|0;var Qo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Qo>>>26)|0,Qo&=67108863,g=Math.imul(be,je),u=Math.imul(be,Ne),u=u+Math.imul(we,je)|0,x=Math.imul(we,Ne),g=g+Math.imul(xe,De)|0,u=u+Math.imul(xe,Ie)|0,u=u+Math.imul(ye,De)|0,x=x+Math.imul(ye,Ie)|0,g=g+Math.imul(ve,qe)|0,u=u+Math.imul(ve,Le)|0,u=u+Math.imul(ge,qe)|0,x=x+Math.imul(ge,Le)|0,g=g+Math.imul(he,Fe)|0,u=u+Math.imul(he,Ue)|0,u=u+Math.imul(me,Fe)|0,x=x+Math.imul(me,Ue)|0;var ea=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(ea>>>26)|0,ea&=67108863,g=Math.imul(be,De),u=Math.imul(be,Ie),u=u+Math.imul(we,De)|0,x=Math.imul(we,Ie),g=g+Math.imul(xe,qe)|0,u=u+Math.imul(xe,Le)|0,u=u+Math.imul(ye,qe)|0,x=x+Math.imul(ye,Le)|0,g=g+Math.imul(ve,Fe)|0,u=u+Math.imul(ve,Ue)|0,u=u+Math.imul(ge,Fe)|0,x=x+Math.imul(ge,Ue)|0;var ta=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(ta>>>26)|0,ta&=67108863,g=Math.imul(be,qe),u=Math.imul(be,Le),u=u+Math.imul(we,qe)|0,x=Math.imul(we,Le),g=g+Math.imul(xe,Fe)|0,u=u+Math.imul(xe,Ue)|0,u=u+Math.imul(ye,Fe)|0,x=x+Math.imul(ye,Ue)|0;var ia=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(ia>>>26)|0,ia&=67108863,g=Math.imul(be,Fe),u=Math.imul(be,Ue),u=u+Math.imul(we,Fe)|0,x=Math.imul(we,Ue);var na=(S+g|0)+((u&8191)<<13)|0;return S=(x+(u>>>13)|0)+(na>>>26)|0,na&=67108863,w[0]=Lo,w[1]=Fo,w[2]=Uo,w[3]=Ho,w[4]=zo,w[5]=$o,w[6]=Wo,w[7]=Vo,w[8]=Ko,w[9]=Go,w[10]=Yo,w[11]=Jo,w[12]=Xo,w[13]=Zo,w[14]=Qo,w[15]=ea,w[16]=ta,w[17]=ia,w[18]=na,S!==0&&(w[19]=S,h.length++),h};Math.imul||(k=E);function T(b,c,d){d.negative=c.negative^b.negative,d.length=b.length+c.length;for(var h=0,v=0,y=0;y<d.length-1;y++){var w=v;v=0;for(var S=h&67108863,g=Math.min(y,c.length-1),u=Math.max(0,y-b.length+1);u<=g;u++){var x=y-u,P=b.words[x]|0,B=c.words[u]|0,j=P*B,I=j&67108863;w=w+(j/67108864|0)|0,I=I+S|0,S=I&67108863,w=w+(I>>>26)|0,v+=w>>>26,w&=67108863}d.words[y]=S,h=w,w=v}return h!==0?d.words[y]=h:d.length--,d.strip()}function M(b,c,d){var h=new O;return h.mulp(b,c,d)}r.prototype.mulTo=function(c,d){var h,v=this.length+c.length;return this.length===10&&c.length===10?h=k(this,c,d):v<63?h=E(this,c,d):v<1024?h=T(this,c,d):h=M(this,c,d),h};function O(b,c){this.x=b,this.y=c}O.prototype.makeRBT=function(c){for(var d=new Array(c),h=r.prototype._countBits(c)-1,v=0;v<c;v++)d[v]=this.revBin(v,h,c);return d},O.prototype.revBin=function(c,d,h){if(c===0||c===h-1)return c;for(var v=0,y=0;y<d;y++)v|=(c&1)<<d-y-1,c>>=1;return v},O.prototype.permute=function(c,d,h,v,y,w){for(var S=0;S<w;S++)v[S]=d[c[S]],y[S]=h[c[S]]},O.prototype.transform=function(c,d,h,v,y,w){this.permute(w,c,d,h,v,y);for(var S=1;S<y;S<<=1)for(var g=S<<1,u=Math.cos(2*Math.PI/g),x=Math.sin(2*Math.PI/g),P=0;P<y;P+=g)for(var B=u,j=x,I=0;I<S;I++){var $=h[P+I],Y=v[P+I],oi=h[P+I+S],J=v[P+I+S],Q=B*oi-j*J;J=B*J+j*oi,oi=Q,h[P+I]=$+oi,v[P+I]=Y+J,h[P+I+S]=$-oi,v[P+I+S]=Y-J,I!==g&&(Q=u*B-x*j,j=u*j+x*B,B=Q)}},O.prototype.guessLen13b=function(c,d){var h=Math.max(d,c)|1,v=h&1,y=0;for(h=h/2|0;h;h=h>>>1)y++;return 1<<y+1+v},O.prototype.conjugate=function(c,d,h){if(!(h<=1))for(var v=0;v<h/2;v++){var y=c[v];c[v]=c[h-v-1],c[h-v-1]=y,y=d[v],d[v]=-d[h-v-1],d[h-v-1]=-y}},O.prototype.normalize13b=function(c,d){for(var h=0,v=0;v<d/2;v++){var y=Math.round(c[2*v+1]/d)*8192+Math.round(c[2*v]/d)+h;c[v]=y&67108863,y<67108864?h=0:h=y/67108864|0}return c},O.prototype.convert13b=function(c,d,h,v){for(var y=0,w=0;w<d;w++)y=y+(c[w]|0),h[2*w]=y&8191,y=y>>>13,h[2*w+1]=y&8191,y=y>>>13;for(w=2*d;w<v;++w)h[w]=0;t(y===0),t((y&-8192)===0)},O.prototype.stub=function(c){for(var d=new Array(c),h=0;h<c;h++)d[h]=0;return d},O.prototype.mulp=function(c,d,h){var v=2*this.guessLen13b(c.length,d.length),y=this.makeRBT(v),w=this.stub(v),S=new Array(v),g=new Array(v),u=new Array(v),x=new Array(v),P=new Array(v),B=new Array(v),j=h.words;j.length=v,this.convert13b(c.words,c.length,S,v),this.convert13b(d.words,d.length,x,v),this.transform(S,w,g,u,v,y),this.transform(x,w,P,B,v,y);for(var I=0;I<v;I++){var $=g[I]*P[I]-u[I]*B[I];u[I]=g[I]*B[I]+u[I]*P[I],g[I]=$}return this.conjugate(g,u,v),this.transform(g,u,j,w,v,y),this.conjugate(j,w,v),this.normalize13b(j,v),h.negative=c.negative^d.negative,h.length=c.length+d.length,h.strip()},r.prototype.mul=function(c){var d=new r(null);return d.words=new Array(this.length+c.length),this.mulTo(c,d)},r.prototype.mulf=function(c){var d=new r(null);return d.words=new Array(this.length+c.length),M(this,c,d)},r.prototype.imul=function(c){return this.clone().mulTo(c,this)},r.prototype.imuln=function(c){t(typeof c=="number"),t(c<67108864);for(var d=0,h=0;h<this.length;h++){var v=(this.words[h]|0)*c,y=(v&67108863)+(d&67108863);d>>=26,d+=v/67108864|0,d+=y>>>26,this.words[h]=y&67108863}return d!==0&&(this.words[h]=d,this.length++),this.length=c===0?1:this.length,this},r.prototype.muln=function(c){return this.clone().imuln(c)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(c){var d=_(c);if(d.length===0)return new r(1);for(var h=this,v=0;v<d.length&&d[v]===0;v++,h=h.sqr());if(++v<d.length)for(var y=h.sqr();v<d.length;v++,y=y.sqr())d[v]!==0&&(h=h.mul(y));return h},r.prototype.iushln=function(c){t(typeof c=="number"&&c>=0);var d=c%26,h=(c-d)/26,v=67108863>>>26-d<<26-d,y;if(d!==0){var w=0;for(y=0;y<this.length;y++){var S=this.words[y]&v,g=(this.words[y]|0)-S<<d;this.words[y]=g|w,w=S>>>26-d}w&&(this.words[y]=w,this.length++)}if(h!==0){for(y=this.length-1;y>=0;y--)this.words[y+h]=this.words[y];for(y=0;y<h;y++)this.words[y]=0;this.length+=h}return this.strip()},r.prototype.ishln=function(c){return t(this.negative===0),this.iushln(c)},r.prototype.iushrn=function(c,d,h){t(typeof c=="number"&&c>=0);var v;d?v=(d-d%26)/26:v=0;var y=c%26,w=Math.min((c-y)/26,this.length),S=67108863^67108863>>>y<<y,g=h;if(v-=w,v=Math.max(0,v),g){for(var u=0;u<w;u++)g.words[u]=this.words[u];g.length=w}if(w!==0)if(this.length>w)for(this.length-=w,u=0;u<this.length;u++)this.words[u]=this.words[u+w];else this.words[0]=0,this.length=1;var x=0;for(u=this.length-1;u>=0&&(x!==0||u>=v);u--){var P=this.words[u]|0;this.words[u]=x<<26-y|P>>>y,x=P&S}return g&&x!==0&&(g.words[g.length++]=x),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.ishrn=function(c,d,h){return t(this.negative===0),this.iushrn(c,d,h)},r.prototype.shln=function(c){return this.clone().ishln(c)},r.prototype.ushln=function(c){return this.clone().iushln(c)},r.prototype.shrn=function(c){return this.clone().ishrn(c)},r.prototype.ushrn=function(c){return this.clone().iushrn(c)},r.prototype.testn=function(c){t(typeof c=="number"&&c>=0);var d=c%26,h=(c-d)/26,v=1<<d;if(this.length<=h)return!1;var y=this.words[h];return!!(y&v)},r.prototype.imaskn=function(c){t(typeof c=="number"&&c>=0);var d=c%26,h=(c-d)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(d!==0&&h++,this.length=Math.min(h,this.length),d!==0){var v=67108863^67108863>>>d<<d;this.words[this.length-1]&=v}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.maskn=function(c){return this.clone().imaskn(c)},r.prototype.iaddn=function(c){return t(typeof c=="number"),t(c<67108864),c<0?this.isubn(-c):this.negative!==0?this.length===1&&(this.words[0]|0)<c?(this.words[0]=c-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(c),this.negative=1,this):this._iaddn(c)},r.prototype._iaddn=function(c){this.words[0]+=c;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},r.prototype.isubn=function(c){if(t(typeof c=="number"),t(c<67108864),c<0)return this.iaddn(-c);if(this.negative!==0)return this.negative=0,this.iaddn(c),this.negative=1,this;if(this.words[0]-=c,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this.strip()},r.prototype.addn=function(c){return this.clone().iaddn(c)},r.prototype.subn=function(c){return this.clone().isubn(c)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(c,d,h){var v=c.length+h,y;this._expand(v);var w,S=0;for(y=0;y<c.length;y++){w=(this.words[y+h]|0)+S;var g=(c.words[y]|0)*d;w-=g&67108863,S=(w>>26)-(g/67108864|0),this.words[y+h]=w&67108863}for(;y<this.length-h;y++)w=(this.words[y+h]|0)+S,S=w>>26,this.words[y+h]=w&67108863;if(S===0)return this.strip();for(t(S===-1),S=0,y=0;y<this.length;y++)w=-(this.words[y]|0)+S,S=w>>26,this.words[y]=w&67108863;return this.negative=1,this.strip()},r.prototype._wordDiv=function(c,d){var h=this.length-c.length,v=this.clone(),y=c,w=y.words[y.length-1]|0,S=this._countBits(w);h=26-S,h!==0&&(y=y.ushln(h),v.iushln(h),w=y.words[y.length-1]|0);var g=v.length-y.length,u;if(d!=="mod"){u=new r(null),u.length=g+1,u.words=new Array(u.length);for(var x=0;x<u.length;x++)u.words[x]=0}var P=v.clone()._ishlnsubmul(y,1,g);P.negative===0&&(v=P,u&&(u.words[g]=1));for(var B=g-1;B>=0;B--){var j=(v.words[y.length+B]|0)*67108864+(v.words[y.length+B-1]|0);for(j=Math.min(j/w|0,67108863),v._ishlnsubmul(y,j,B);v.negative!==0;)j--,v.negative=0,v._ishlnsubmul(y,1,B),v.isZero()||(v.negative^=1);u&&(u.words[B]=j)}return u&&u.strip(),v.strip(),d!=="div"&&h!==0&&v.iushrn(h),{div:u||null,mod:v}},r.prototype.divmod=function(c,d,h){if(t(!c.isZero()),this.isZero())return{div:new r(0),mod:new r(0)};var v,y,w;return this.negative!==0&&c.negative===0?(w=this.neg().divmod(c,d),d!=="mod"&&(v=w.div.neg()),d!=="div"&&(y=w.mod.neg(),h&&y.negative!==0&&y.iadd(c)),{div:v,mod:y}):this.negative===0&&c.negative!==0?(w=this.divmod(c.neg(),d),d!=="mod"&&(v=w.div.neg()),{div:v,mod:w.mod}):(this.negative&c.negative)!==0?(w=this.neg().divmod(c.neg(),d),d!=="div"&&(y=w.mod.neg(),h&&y.negative!==0&&y.isub(c)),{div:w.div,mod:y}):c.length>this.length||this.cmp(c)<0?{div:new r(0),mod:this}:c.length===1?d==="div"?{div:this.divn(c.words[0]),mod:null}:d==="mod"?{div:null,mod:new r(this.modn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new r(this.modn(c.words[0]))}:this._wordDiv(c,d)},r.prototype.div=function(c){return this.divmod(c,"div",!1).div},r.prototype.mod=function(c){return this.divmod(c,"mod",!1).mod},r.prototype.umod=function(c){return this.divmod(c,"mod",!0).mod},r.prototype.divRound=function(c){var d=this.divmod(c);if(d.mod.isZero())return d.div;var h=d.div.negative!==0?d.mod.isub(c):d.mod,v=c.ushrn(1),y=c.andln(1),w=h.cmp(v);return w<0||y===1&&w===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},r.prototype.modn=function(c){t(c<=67108863);for(var d=(1<<26)%c,h=0,v=this.length-1;v>=0;v--)h=(d*h+(this.words[v]|0))%c;return h},r.prototype.idivn=function(c){t(c<=67108863);for(var d=0,h=this.length-1;h>=0;h--){var v=(this.words[h]|0)+d*67108864;this.words[h]=v/c|0,d=v%c}return this.strip()},r.prototype.divn=function(c){return this.clone().idivn(c)},r.prototype.egcd=function(c){t(c.negative===0),t(!c.isZero());var d=this,h=c.clone();d.negative!==0?d=d.umod(c):d=d.clone();for(var v=new r(1),y=new r(0),w=new r(0),S=new r(1),g=0;d.isEven()&&h.isEven();)d.iushrn(1),h.iushrn(1),++g;for(var u=h.clone(),x=d.clone();!d.isZero();){for(var P=0,B=1;(d.words[0]&B)===0&&P<26;++P,B<<=1);if(P>0)for(d.iushrn(P);P-- >0;)(v.isOdd()||y.isOdd())&&(v.iadd(u),y.isub(x)),v.iushrn(1),y.iushrn(1);for(var j=0,I=1;(h.words[0]&I)===0&&j<26;++j,I<<=1);if(j>0)for(h.iushrn(j);j-- >0;)(w.isOdd()||S.isOdd())&&(w.iadd(u),S.isub(x)),w.iushrn(1),S.iushrn(1);d.cmp(h)>=0?(d.isub(h),v.isub(w),y.isub(S)):(h.isub(d),w.isub(v),S.isub(y))}return{a:w,b:S,gcd:h.iushln(g)}},r.prototype._invmp=function(c){t(c.negative===0),t(!c.isZero());var d=this,h=c.clone();d.negative!==0?d=d.umod(c):d=d.clone();for(var v=new r(1),y=new r(0),w=h.clone();d.cmpn(1)>0&&h.cmpn(1)>0;){for(var S=0,g=1;(d.words[0]&g)===0&&S<26;++S,g<<=1);if(S>0)for(d.iushrn(S);S-- >0;)v.isOdd()&&v.iadd(w),v.iushrn(1);for(var u=0,x=1;(h.words[0]&x)===0&&u<26;++u,x<<=1);if(u>0)for(h.iushrn(u);u-- >0;)y.isOdd()&&y.iadd(w),y.iushrn(1);d.cmp(h)>=0?(d.isub(h),v.isub(y)):(h.isub(d),y.isub(v))}var P;return d.cmpn(1)===0?P=v:P=y,P.cmpn(0)<0&&P.iadd(c),P},r.prototype.gcd=function(c){if(this.isZero())return c.abs();if(c.isZero())return this.abs();var d=this.clone(),h=c.clone();d.negative=0,h.negative=0;for(var v=0;d.isEven()&&h.isEven();v++)d.iushrn(1),h.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;h.isEven();)h.iushrn(1);var y=d.cmp(h);if(y<0){var w=d;d=h,h=w}else if(y===0||h.cmpn(1)===0)break;d.isub(h)}while(!0);return h.iushln(v)},r.prototype.invm=function(c){return this.egcd(c).a.umod(c)},r.prototype.isEven=function(){return(this.words[0]&1)===0},r.prototype.isOdd=function(){return(this.words[0]&1)===1},r.prototype.andln=function(c){return this.words[0]&c},r.prototype.bincn=function(c){t(typeof c=="number");var d=c%26,h=(c-d)/26,v=1<<d;if(this.length<=h)return this._expand(h+1),this.words[h]|=v,this;for(var y=v,w=h;y!==0&&w<this.length;w++){var S=this.words[w]|0;S+=y,y=S>>>26,S&=67108863,this.words[w]=S}return y!==0&&(this.words[w]=y,this.length++),this},r.prototype.isZero=function(){return this.length===1&&this.words[0]===0},r.prototype.cmpn=function(c){var d=c<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this.strip();var h;if(this.length>1)h=1;else{d&&(c=-c),t(c<=67108863,"Number is too big");var v=this.words[0]|0;h=v===c?0:v<c?-1:1}return this.negative!==0?-h|0:h},r.prototype.cmp=function(c){if(this.negative!==0&&c.negative===0)return-1;if(this.negative===0&&c.negative!==0)return 1;var d=this.ucmp(c);return this.negative!==0?-d|0:d},r.prototype.ucmp=function(c){if(this.length>c.length)return 1;if(this.length<c.length)return-1;for(var d=0,h=this.length-1;h>=0;h--){var v=this.words[h]|0,y=c.words[h]|0;if(v!==y){v<y?d=-1:v>y&&(d=1);break}}return d},r.prototype.gtn=function(c){return this.cmpn(c)===1},r.prototype.gt=function(c){return this.cmp(c)===1},r.prototype.gten=function(c){return this.cmpn(c)>=0},r.prototype.gte=function(c){return this.cmp(c)>=0},r.prototype.ltn=function(c){return this.cmpn(c)===-1},r.prototype.lt=function(c){return this.cmp(c)===-1},r.prototype.lten=function(c){return this.cmpn(c)<=0},r.prototype.lte=function(c){return this.cmp(c)<=0},r.prototype.eqn=function(c){return this.cmpn(c)===0},r.prototype.eq=function(c){return this.cmp(c)===0},r.red=function(c){return new H(c)},r.prototype.toRed=function(c){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),c.convertTo(this)._forceRed(c)},r.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype._forceRed=function(c){return this.red=c,this},r.prototype.forceRed=function(c){return t(!this.red,"Already a number in reduction context"),this._forceRed(c)},r.prototype.redAdd=function(c){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,c)},r.prototype.redIAdd=function(c){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,c)},r.prototype.redSub=function(c){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,c)},r.prototype.redISub=function(c){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,c)},r.prototype.redShl=function(c){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,c)},r.prototype.redMul=function(c){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.mul(this,c)},r.prototype.redIMul=function(c){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.imul(this,c)},r.prototype.redSqr=function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(c){return t(this.red&&!c.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,c)};var A={k256:null,p224:null,p192:null,p25519:null};function D(b,c){this.name=b,this.p=new r(c,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var c=new r(null);return c.words=new Array(Math.ceil(this.n/13)),c},D.prototype.ireduce=function(c){var d=c,h;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),h=d.bitLength();while(h>this.n);var v=h<this.n?-1:d.ucmp(this.p);return v===0?(d.words[0]=0,d.length=1):v>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},D.prototype.split=function(c,d){c.iushrn(this.n,0,d)},D.prototype.imulK=function(c){return c.imul(this.k)};function U(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(U,D),U.prototype.split=function(c,d){for(var h=4194303,v=Math.min(c.length,9),y=0;y<v;y++)d.words[y]=c.words[y];if(d.length=v,c.length<=9){c.words[0]=0,c.length=1;return}var w=c.words[9];for(d.words[d.length++]=w&h,y=10;y<c.length;y++){var S=c.words[y]|0;c.words[y-10]=(S&h)<<4|w>>>22,w=S}w>>>=22,c.words[y-10]=w,w===0&&c.length>10?c.length-=10:c.length-=9},U.prototype.imulK=function(c){c.words[c.length]=0,c.words[c.length+1]=0,c.length+=2;for(var d=0,h=0;h<c.length;h++){var v=c.words[h]|0;d+=v*977,c.words[h]=d&67108863,d=v*64+(d/67108864|0)}return c.words[c.length-1]===0&&(c.length--,c.words[c.length-1]===0&&c.length--),c};function te(){D.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(te,D);function z(){D.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(z,D);function re(){D.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(re,D),re.prototype.imulK=function(c){for(var d=0,h=0;h<c.length;h++){var v=(c.words[h]|0)*19+d,y=v&67108863;v>>>=26,c.words[h]=y,d=v}return d!==0&&(c.words[c.length++]=d),c},r._prime=function(c){if(A[c])return A[c];var d;if(c==="k256")d=new U;else if(c==="p224")d=new te;else if(c==="p192")d=new z;else if(c==="p25519")d=new re;else throw new Error("Unknown prime "+c);return A[c]=d,d};function H(b){if(typeof b=="string"){var c=r._prime(b);this.m=c.p,this.prime=c}else t(b.gtn(1),"modulus must be greater than 1"),this.m=b,this.prime=null}H.prototype._verify1=function(c){t(c.negative===0,"red works only with positives"),t(c.red,"red works only with red numbers")},H.prototype._verify2=function(c,d){t((c.negative|d.negative)===0,"red works only with positives"),t(c.red&&c.red===d.red,"red works only with red numbers")},H.prototype.imod=function(c){return this.prime?this.prime.ireduce(c)._forceRed(this):c.umod(this.m)._forceRed(this)},H.prototype.neg=function(c){return c.isZero()?c.clone():this.m.sub(c)._forceRed(this)},H.prototype.add=function(c,d){this._verify2(c,d);var h=c.add(d);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},H.prototype.iadd=function(c,d){this._verify2(c,d);var h=c.iadd(d);return h.cmp(this.m)>=0&&h.isub(this.m),h},H.prototype.sub=function(c,d){this._verify2(c,d);var h=c.sub(d);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},H.prototype.isub=function(c,d){this._verify2(c,d);var h=c.isub(d);return h.cmpn(0)<0&&h.iadd(this.m),h},H.prototype.shl=function(c,d){return this._verify1(c),this.imod(c.ushln(d))},H.prototype.imul=function(c,d){return this._verify2(c,d),this.imod(c.imul(d))},H.prototype.mul=function(c,d){return this._verify2(c,d),this.imod(c.mul(d))},H.prototype.isqr=function(c){return this.imul(c,c.clone())},H.prototype.sqr=function(c){return this.mul(c,c)},H.prototype.sqrt=function(c){if(c.isZero())return c.clone();var d=this.m.andln(3);if(t(d%2===1),d===3){var h=this.m.add(new r(1)).iushrn(2);return this.pow(c,h)}for(var v=this.m.subn(1),y=0;!v.isZero()&&v.andln(1)===0;)y++,v.iushrn(1);t(!v.isZero());var w=new r(1).toRed(this),S=w.redNeg(),g=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new r(2*u*u).toRed(this);this.pow(u,g).cmp(S)!==0;)u.redIAdd(S);for(var x=this.pow(u,v),P=this.pow(c,v.addn(1).iushrn(1)),B=this.pow(c,v),j=y;B.cmp(w)!==0;){for(var I=B,$=0;I.cmp(w)!==0;$++)I=I.redSqr();t($<j);var Y=this.pow(x,new r(1).iushln(j-$-1));P=P.redMul(Y),x=Y.redSqr(),B=B.redMul(x),j=$}return P},H.prototype.invm=function(c){var d=c._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},H.prototype.pow=function(c,d){if(d.isZero())return new r(1).toRed(this);if(d.cmpn(1)===0)return c.clone();var h=4,v=new Array(1<<h);v[0]=new r(1).toRed(this),v[1]=c;for(var y=2;y<v.length;y++)v[y]=this.mul(v[y-1],c);var w=v[0],S=0,g=0,u=d.bitLength()%26;for(u===0&&(u=26),y=d.length-1;y>=0;y--){for(var x=d.words[y],P=u-1;P>=0;P--){var B=x>>P&1;if(w!==v[0]&&(w=this.sqr(w)),B===0&&S===0){g=0;continue}S<<=1,S|=B,g++,!(g!==h&&(y!==0||P!==0))&&(w=this.mul(w,v[S]),g=0,S=0)}u=26}return w},H.prototype.convertTo=function(c){var d=c.umod(this.m);return d===c?d.clone():d},H.prototype.convertFrom=function(c){var d=c.clone();return d.red=null,d},r.mont=function(c){return new ae(c)};function ae(b){H.call(this,b),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new r(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(ae,H),ae.prototype.convertTo=function(c){return this.imod(c.ushln(this.shift))},ae.prototype.convertFrom=function(c){var d=this.imod(c.mul(this.rinv));return d.red=null,d},ae.prototype.imul=function(c,d){if(c.isZero()||d.isZero())return c.words[0]=0,c.length=1,c;var h=c.imul(d),v=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=h.isub(v).iushrn(this.shift),w=y;return y.cmp(this.m)>=0?w=y.isub(this.m):y.cmpn(0)<0&&(w=y.iadd(this.m)),w._forceRed(this)},ae.prototype.mul=function(c,d){if(c.isZero()||d.isZero())return new r(0)._forceRed(this);var h=c.mul(d),v=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=h.isub(v).iushrn(this.shift),w=y;return y.cmp(this.m)>=0?w=y.isub(this.m):y.cmpn(0)<0&&(w=y.iadd(this.m)),w._forceRed(this)},ae.prototype.invm=function(c){var d=this.imod(c._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(typeof hl>"u"||hl,tv)});var iv=C((aO,vl)=>{typeof Object.create=="function"?vl.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:vl.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 xi=C((cO,xl)=>{try{if(gl=require("util"),typeof gl.inherits!="function")throw"";xl.exports=gl.inherits}catch{xl.exports=iv()}var gl});var io=C((lO,nv)=>{"use strict";var to=require("buffer"),Mn=to.Buffer,St={},Et;for(Et in to)to.hasOwnProperty(Et)&&(Et==="SlowBuffer"||Et==="Buffer"||(St[Et]=to[Et]));var On=St.Buffer={};for(Et in Mn)Mn.hasOwnProperty(Et)&&(Et==="allocUnsafe"||Et==="allocUnsafeSlow"||(On[Et]=Mn[Et]));St.Buffer.prototype=Mn.prototype;(!On.from||On.from===Uint8Array.from)&&(On.from=function(i,e,t){if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof i);if(i&&typeof i.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);return Mn(i,e,t)});On.alloc||(On.alloc=function(i,e,t){if(typeof i!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof i);if(i<0||i>=2*(1<<30))throw new RangeError('The value "'+i+'" is invalid for option "size"');var n=Mn(i);return!e||e.length===0?n.fill(0):typeof t=="string"?n.fill(e,t):n.fill(e),n});if(!St.kStringMaxLength)try{St.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}St.constants||(St.constants={MAX_LENGTH:St.kMaxLength},St.kStringMaxLength&&(St.constants.MAX_STRING_LENGTH=St.kStringMaxLength));nv.exports=St});var no=C(rv=>{"use strict";var KE=xi();function kt(i){this._reporterState={obj:null,path:[],options:i||{},errors:[]}}rv.Reporter=kt;kt.prototype.isError=function(e){return e instanceof An};kt.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};kt.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)};kt.prototype.enterKey=function(e){return this._reporterState.path.push(e)};kt.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)};kt.prototype.leaveKey=function(e,t,n){let r=this._reporterState;this.exitKey(e),r.obj!==null&&(r.obj[t]=n)};kt.prototype.path=function(){return this._reporterState.path.join("/")};kt.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t};kt.prototype.leaveObject=function(e){let t=this._reporterState,n=t.obj;return t.obj=e,n};kt.prototype.error=function(e){let t,n=this._reporterState,r=e instanceof An;if(r?t=e:t=new An(n.path.map(function(s){return"["+JSON.stringify(s)+"]"}).join(""),e.message||e,e.stack),!n.options.partial)throw t;return r||n.errors.push(t),t};kt.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};function An(i,e){this.path=i,this.rethrow(e)}KE(An,Error);An.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,An),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}});var Bn=C(yl=>{"use strict";var GE=xi(),ro=no().Reporter,Rn=io().Buffer;function Ct(i,e){if(ro.call(this,e),!Rn.isBuffer(i)){this.error("Input not Buffer");return}this.base=i,this.offset=0,this.length=i.length}GE(Ct,ro);yl.DecoderBuffer=Ct;Ct.isDecoderBuffer=function(e){return e instanceof Ct?!0:typeof e=="object"&&Rn.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"};Ct.prototype.save=function(){return{offset:this.offset,reporter:ro.prototype.save.call(this)}};Ct.prototype.restore=function(e){let t=new Ct(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,ro.prototype.restore.call(this,e.reporter),t};Ct.prototype.isEmpty=function(){return this.offset===this.length};Ct.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};Ct.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");let n=new Ct(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n};Ct.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function Pn(i,e){if(Array.isArray(i))this.length=0,this.value=i.map(function(t){return Pn.isEncoderBuffer(t)||(t=new Pn(t,e)),this.length+=t.length,t},this);else if(typeof i=="number"){if(!(0<=i&&i<=255))return e.error("non-byte EncoderBuffer value");this.value=i,this.length=1}else if(typeof i=="string")this.value=i,this.length=Rn.byteLength(i);else if(Rn.isBuffer(i))this.value=i,this.length=i.length;else return e.error("Unsupported type: "+typeof i)}yl.EncoderBuffer=Pn;Pn.isEncoderBuffer=function(e){return e instanceof Pn?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};Pn.prototype.join=function(e,t){return e||(e=Rn.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):Rn.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}});var av=C((dO,ov)=>{ov.exports=sv;function sv(i,e){if(!i)throw new Error(e||"Assertion failed")}sv.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}});var so=C((fO,lv)=>{"use strict";var YE=no().Reporter,JE=Bn().EncoderBuffer,XE=Bn().DecoderBuffer,tt=av(),cv=["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"],ZE=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(cv),QE=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function K(i,e,t){let n={};this._baseState=n,n.name=t,n.enc=i,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())}lv.exports=K;var ek=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];K.prototype.clone=function(){let e=this._baseState,t={};ek.forEach(function(r){t[r]=e[r]});let n=new this.constructor(t.parent);return n._baseState=t,n};K.prototype._wrap=function(){let e=this._baseState;ZE.forEach(function(t){this[t]=function(){let r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}},this)};K.prototype._init=function(e){let t=this._baseState;tt(t.parent===null),e.call(this),t.children=t.children.filter(function(n){return n._baseState.parent===this},this),tt.equal(t.children.length,1,"Root node can have only one child")};K.prototype._useArgs=function(e){let t=this._baseState,n=e.filter(function(r){return r instanceof this.constructor},this);e=e.filter(function(r){return!(r instanceof this.constructor)},this),n.length!==0&&(tt(t.children===null),t.children=n,n.forEach(function(r){r._baseState.parent=this},this)),e.length!==0&&(tt(t.args===null),t.args=e,t.reverseArgs=e.map(function(r){if(typeof r!="object"||r.constructor!==Object)return r;let s={};return Object.keys(r).forEach(function(o){o==(o|0)&&(o|=0);let a=r[o];s[a]=o}),s}))};QE.forEach(function(i){K.prototype[i]=function(){let t=this._baseState;throw new Error(i+" not implemented for encoding: "+t.enc)}});cv.forEach(function(i){K.prototype[i]=function(){let t=this._baseState,n=Array.prototype.slice.call(arguments);return tt(t.tag===null),t.tag=i,this._useArgs(n),this}});K.prototype.use=function(e){tt(e);let t=this._baseState;return tt(t.use===null),t.use=e,this};K.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};K.prototype.def=function(e){let t=this._baseState;return tt(t.default===null),t.default=e,t.optional=!0,this};K.prototype.explicit=function(e){let t=this._baseState;return tt(t.explicit===null&&t.implicit===null),t.explicit=e,this};K.prototype.implicit=function(e){let t=this._baseState;return tt(t.explicit===null&&t.implicit===null),t.implicit=e,this};K.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this};K.prototype.key=function(e){let t=this._baseState;return tt(t.key===null),t.key=e,this};K.prototype.any=function(){let e=this._baseState;return e.any=!0,this};K.prototype.choice=function(e){let t=this._baseState;return tt(t.choice===null),t.choice=e,this._useArgs(Object.keys(e).map(function(n){return e[n]})),this};K.prototype.contains=function(e){let t=this._baseState;return tt(t.use===null),t.contains=e,this};K.prototype._decode=function(e,t){let n=this._baseState;if(n.parent===null)return e.wrapResult(n.children[0]._decode(e,t));let r=n.default,s=!0,o=null;if(n.key!==null&&(o=e.enterKey(n.key)),n.optional){let l=null;if(n.explicit!==null?l=n.explicit:n.implicit!==null?l=n.implicit:n.tag!==null&&(l=n.tag),l===null&&!n.any){let p=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),s=!0}catch{s=!1}e.restore(p)}else if(s=this._peekTag(e,l,n.any),e.isError(s))return s}let a;if(n.obj&&s&&(a=e.enterObject()),s){if(n.explicit!==null){let p=this._decodeTag(e,n.explicit);if(e.isError(p))return p;e=p}let l=e.offset;if(n.use===null&&n.choice===null){let p;n.any&&(p=e.save());let f=this._decodeTag(e,n.implicit!==null?n.implicit:n.tag,n.any);if(e.isError(f))return f;n.any?r=e.raw(p):e=f}if(t&&t.track&&n.tag!==null&&t.track(e.path(),l,e.length,"tagged"),t&&t.track&&n.tag!==null&&t.track(e.path(),e.offset,e.length,"content"),n.any||(n.choice===null?r=this._decodeGeneric(n.tag,e,t):r=this._decodeChoice(e,t)),e.isError(r))return r;if(!n.any&&n.choice===null&&n.children!==null&&n.children.forEach(function(f){f._decode(e,t)}),n.contains&&(n.tag==="octstr"||n.tag==="bitstr")){let p=new XE(r);r=this._getUse(n.contains,e._reporterState.obj)._decode(p,t)}}return n.obj&&s&&(r=e.leaveObject(a)),n.key!==null&&(r!==null||s===!0)?e.leaveKey(o,n.key,r):o!==null&&e.exitKey(o),r};K.prototype._decodeGeneric=function(e,t,n){let r=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(t,e,r.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):e==="objid"&&r.args?this._decodeObjid(t,r.args[0],r.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,r.args&&r.args[0],n):r.use!==null?this._getUse(r.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)};K.prototype._getUse=function(e,t){let n=this._baseState;return n.useDecoder=this._use(e,t),tt(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};K.prototype._decodeChoice=function(e,t){let n=this._baseState,r=null,s=!1;return Object.keys(n.choice).some(function(o){let a=e.save(),l=n.choice[o];try{let p=l._decode(e,t);if(e.isError(p))return!1;r={type:o,value:p},s=!0}catch{return e.restore(a),!1}return!0},this),s?r:e.error("Choice not matched")};K.prototype._createEncoderBuffer=function(e){return new JE(e,this.reporter)};K.prototype._encode=function(e,t,n){let r=this._baseState;if(r.default!==null&&r.default===e)return;let s=this._encodeValue(e,t,n);if(s!==void 0&&!this._skipDefault(s,t,n))return s};K.prototype._encodeValue=function(e,t,n){let r=this._baseState;if(r.parent===null)return r.children[0]._encode(e,t||new YE);let s=null;if(this.reporter=t,r.optional&&e===void 0)if(r.default!==null)e=r.default;else return;let o=null,a=!1;if(r.any)s=this._createEncoderBuffer(e);else if(r.choice)s=this._encodeChoice(e,t);else if(r.contains)o=this._getUse(r.contains,n)._encode(e,t),a=!0;else if(r.children)o=r.children.map(function(l){if(l._baseState.tag==="null_")return l._encode(null,t,e);if(l._baseState.key===null)return t.error("Child should have a key");let p=t.enterKey(l._baseState.key);if(typeof e!="object")return t.error("Child expected, but input is not object");let f=l._encode(e[l._baseState.key],t,e);return t.leaveKey(p),f},this).filter(function(l){return l}),o=this._createEncoderBuffer(o);else if(r.tag==="seqof"||r.tag==="setof"){if(!(r.args&&r.args.length===1))return t.error("Too many args for : "+r.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");let l=this.clone();l._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(p){let f=this._baseState;return this._getUse(f.args[0],e)._encode(p,t)},l))}else r.use!==null?s=this._getUse(r.use,n)._encode(e,t):(o=this._encodePrimitive(r.tag,e),a=!0);if(!r.any&&r.choice===null){let l=r.implicit!==null?r.implicit:r.tag,p=r.implicit===null?"universal":"context";l===null?r.use===null&&t.error("Tag could be omitted only for .use()"):r.use===null&&(s=this._encodeComposite(l,a,p,o))}return r.explicit!==null&&(s=this._encodeComposite(r.explicit,!1,"context",s)),s};K.prototype._encodeChoice=function(e,t){let n=this._baseState,r=n.choice[e.type];return r||tt(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),r._encode(e.value,t)};K.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)};K.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};K.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var oo=C(Di=>{"use strict";function uv(i){let e={};return Object.keys(i).forEach(function(t){(t|0)==t&&(t=t|0);let n=i[t];e[n]=t}),e}Di.tagClass={0:"universal",1:"application",2:"context",3:"private"};Di.tagClassByName=uv(Di.tagClass);Di.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"};Di.tagByName=uv(Di.tag)});var wl=C((mO,fv)=>{"use strict";var tk=xi(),ri=io().Buffer,pv=so(),bl=oo();function dv(i){this.enc="der",this.name=i.name,this.entity=i,this.tree=new Nt,this.tree._init(i.body)}fv.exports=dv;dv.prototype.encode=function(e,t){return this.tree._encode(e,t).join()};function Nt(i){pv.call(this,"der",i)}tk(Nt,pv);Nt.prototype._encodeComposite=function(e,t,n,r){let s=ik(e,t,n,this.reporter);if(r.length<128){let l=ri.alloc(2);return l[0]=s,l[1]=r.length,this._createEncoderBuffer([l,r])}let o=1;for(let l=r.length;l>=256;l>>=8)o++;let a=ri.alloc(2+o);a[0]=s,a[1]=128|o;for(let l=1+o,p=r.length;p>0;l--,p>>=8)a[l]=p&255;return this._createEncoderBuffer([a,r])};Nt.prototype._encodeStr=function(e,t){if(t==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(t==="bmpstr"){let n=ri.alloc(e.length*2);for(let r=0;r<e.length;r++)n.writeUInt16BE(e.charCodeAt(r),r*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")};Nt.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 r=0;for(let a=0;a<e.length;a++){let l=e[a];for(r++;l>=128;l>>=7)r++}let s=ri.alloc(r),o=s.length-1;for(let a=e.length-1;a>=0;a--){let l=e[a];for(s[o--]=l&127;(l>>=7)>0;)s[o--]=128|l&127}return this._createEncoderBuffer(s)};function Tt(i){return i<10?"0"+i:i}Nt.prototype._encodeTime=function(e,t){let n,r=new Date(e);return t==="gentime"?n=[Tt(r.getUTCFullYear()),Tt(r.getUTCMonth()+1),Tt(r.getUTCDate()),Tt(r.getUTCHours()),Tt(r.getUTCMinutes()),Tt(r.getUTCSeconds()),"Z"].join(""):t==="utctime"?n=[Tt(r.getUTCFullYear()%100),Tt(r.getUTCMonth()+1),Tt(r.getUTCDate()),Tt(r.getUTCHours()),Tt(r.getUTCMinutes()),Tt(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")};Nt.prototype._encodeNull=function(){return this._createEncoderBuffer("")};Nt.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"&&!ri.isBuffer(e)){let s=e.toArray();!e.sign&&s[0]&128&&s.unshift(0),e=ri.from(s)}if(ri.isBuffer(e)){let s=e.length;e.length===0&&s++;let o=ri.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 r=new Array(n);for(let s=r.length-1;s>=0;s--)r[s]=e&255,e>>=8;return r[0]&128&&r.unshift(0),this._createEncoderBuffer(ri.from(r))};Nt.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};Nt.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getEncoder("der").tree};Nt.prototype._skipDefault=function(e,t,n){let r=this._baseState,s;if(r.default===null)return!1;let o=e.join();if(r.defaultBuffer===void 0&&(r.defaultBuffer=this._encodeValue(r.default,t,n).join()),o.length!==r.defaultBuffer.length)return!1;for(s=0;s<o.length;s++)if(o[s]!==r.defaultBuffer[s])return!1;return!0};function ik(i,e,t,n){let r;if(i==="seqof"?i="seq":i==="setof"&&(i="set"),bl.tagByName.hasOwnProperty(i))r=bl.tagByName[i];else if(typeof i=="number"&&(i|0)===i)r=i;else return n.error("Unknown tag: "+i);return r>=31?n.error("Multi-octet tag encoding unsupported"):(e||(r|=32),r|=bl.tagClassByName[t||"universal"]<<6,r)}});var mv=C((vO,hv)=>{"use strict";var nk=xi(),_l=wl();function Sl(i){_l.call(this,i),this.enc="pem"}nk(Sl,_l);hv.exports=Sl;Sl.prototype.encode=function(e,t){let r=_l.prototype.encode.call(this,e).toString("base64"),s=["-----BEGIN "+t.label+"-----"];for(let o=0;o<r.length;o+=64)s.push(r.slice(o,o+64));return s.push("-----END "+t.label+"-----"),s.join(`
|
|
26
|
+
`)}});var El=C(gv=>{"use strict";var vv=gv;vv.der=wl();vv.pem=mv()});var Cl=C((xO,Sv)=>{"use strict";var rk=xi(),sk=ml(),xv=Bn().DecoderBuffer,bv=so(),yv=oo();function wv(i){this.enc="der",this.name=i.name,this.entity=i,this.tree=new ft,this.tree._init(i.body)}Sv.exports=wv;wv.prototype.decode=function(e,t){return xv.isDecoderBuffer(e)||(e=new xv(e,t)),this.tree._decode(e,t)};function ft(i){bv.call(this,"der",i)}rk(ft,bv);ft.prototype._peekTag=function(e,t,n){if(e.isEmpty())return!1;let r=e.save(),s=kl(e,'Failed to peek tag: "'+t+'"');return e.isError(s)?s:(e.restore(r),s.tag===t||s.tagStr===t||s.tagStr+"of"===t||n)};ft.prototype._decodeTag=function(e,t,n){let r=kl(e,'Failed to decode tag of "'+t+'"');if(e.isError(r))return r;let s=_v(e,r.primitive,'Failed to get length of "'+t+'"');if(e.isError(s))return s;if(!n&&r.tag!==t&&r.tagStr!==t&&r.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(r.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+'"'))};ft.prototype._skipUntilEnd=function(e,t){for(;;){let n=kl(e,t);if(e.isError(n))return n;let r=_v(e,n.primitive,t);if(e.isError(r))return r;let s;if(n.primitive||r!==null?s=e.skip(r):s=this._skipUntilEnd(e,t),e.isError(s))return s;if(n.tagStr==="end")break}};ft.prototype._decodeList=function(e,t,n,r){let s=[];for(;!e.isEmpty();){let o=this._peekTag(e,"end");if(e.isError(o))return o;let a=n.decode(e,"der",r);if(e.isError(a)&&o)break;s.push(a)}return s};ft.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 r="";for(let s=0;s<n.length/2;s++)r+=String.fromCharCode(n.readUInt16BE(s*2));return r}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")}};ft.prototype._decodeObjid=function(e,t,n){let r,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 l=s[0]/40|0,p=s[0]%40;if(n?r=s:r=[l,p].concat(s.slice(1)),t){let f=t[r.join(" ")];f===void 0&&(f=t[r.join(".")]),f!==void 0&&(r=f)}return r};ft.prototype._decodeTime=function(e,t){let n=e.raw().toString(),r,s,o,a,l,p;if(t==="gentime")r=n.slice(0,4)|0,s=n.slice(4,6)|0,o=n.slice(6,8)|0,a=n.slice(8,10)|0,l=n.slice(10,12)|0,p=n.slice(12,14)|0;else if(t==="utctime")r=n.slice(0,2)|0,s=n.slice(2,4)|0,o=n.slice(4,6)|0,a=n.slice(6,8)|0,l=n.slice(8,10)|0,p=n.slice(10,12)|0,r<70?r=2e3+r:r=1900+r;else return e.error("Decoding "+t+" time is not supported yet");return Date.UTC(r,s-1,o,a,l,p,0)};ft.prototype._decodeNull=function(){return null};ft.prototype._decodeBool=function(e){let t=e.readUInt8();return e.isError(t)?t:t!==0};ft.prototype._decodeInt=function(e,t){let n=e.raw(),r=new sk(n);return t&&(r=t[r.toString(10)]||r),r};ft.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getDecoder("der").tree};function kl(i,e){let t=i.readUInt8(e);if(i.isError(t))return t;let n=yv.tagClass[t>>6],r=(t&32)===0;if((t&31)===31){let o=t;for(t=0;(o&128)===128;){if(o=i.readUInt8(e),i.isError(o))return o;t<<=7,t|=o&127}}else t&=31;let s=yv.tag[t];return{cls:n,primitive:r,tag:t,tagStr:s}}function _v(i,e,t){let n=i.readUInt8(t);if(i.isError(n))return n;if(!e&&n===128)return null;if((n&128)===0)return n;let r=n&127;if(r>4)return i.error("length octect is too long");n=0;for(let s=0;s<r;s++){n<<=8;let o=i.readUInt8(t);if(i.isError(o))return o;n|=o}return n}});var kv=C((yO,Ev)=>{"use strict";var ok=xi(),ak=io().Buffer,Tl=Cl();function Ml(i){Tl.call(this,i),this.enc="pem"}ok(Ml,Tl);Ev.exports=Ml;Ml.prototype.decode=function(e,t){let n=e.toString().split(/[\r\n]+/g),r=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,a=-1;for(let f=0;f<n.length;f++){let m=n[f].match(s);if(m!==null&&m[2]===r)if(o===-1){if(m[1]!=="BEGIN")break;o=f}else{if(m[1]!=="END")break;a=f;break}}if(o===-1||a===-1)throw new Error("PEM section not found for: "+r);let l=n.slice(o+1,a).join("");l.replace(/[^a-z0-9+/=]+/gi,"");let p=ak.from(l,"base64");return Tl.prototype.decode.call(this,p,t)}});var Ol=C(Tv=>{"use strict";var Cv=Tv;Cv.der=Cl();Cv.pem=kv()});var Ov=C(Mv=>{"use strict";var ck=El(),lk=Ol(),uk=xi(),pk=Mv;pk.define=function(e,t){return new jn(e,t)};function jn(i,e){this.name=i,this.body=e,this.decoders={},this.encoders={}}jn.prototype._createNamed=function(e){let t=this.name;function n(r){this._initNamed(r,t)}return uk(n,e),n.prototype._initNamed=function(s,o){e.call(this,s,o)},new n(this)};jn.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(lk[e])),this.decoders[e]};jn.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)};jn.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(ck[e])),this.encoders[e]};jn.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}});var Rv=C(Av=>{"use strict";var ao=Av;ao.Reporter=no().Reporter;ao.DecoderBuffer=Bn().DecoderBuffer;ao.EncoderBuffer=Bn().EncoderBuffer;ao.Node=so()});var jv=C(Bv=>{"use strict";var Pv=Bv;Pv._reverse=function(e){let t={};return Object.keys(e).forEach(function(n){(n|0)==n&&(n=n|0);let r=e[n];t[r]=n}),t};Pv.der=oo()});var Dv=C(Nv=>{"use strict";var Nn=Nv;Nn.bignum=ml();Nn.define=Ov().define;Nn.base=Rv();Nn.constants=jv();Nn.decoders=Ol();Nn.encoders=El()});var Dn=C((Al,qv)=>{var co=require("buffer"),zt=co.Buffer;function Iv(i,e){for(var t in i)e[t]=i[t]}zt.from&&zt.alloc&&zt.allocUnsafe&&zt.allocUnsafeSlow?qv.exports=co:(Iv(co,Al),Al.Buffer=Ii);function Ii(i,e,t){return zt(i,e,t)}Ii.prototype=Object.create(zt.prototype);Iv(zt,Ii);Ii.from=function(i,e,t){if(typeof i=="number")throw new TypeError("Argument must not be a number");return zt(i,e,t)};Ii.alloc=function(i,e,t){if(typeof i!="number")throw new TypeError("Argument must be a number");var n=zt(i);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n};Ii.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return zt(i)};Ii.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return co.SlowBuffer(i)}});var Rl=C((kO,Lv)=>{var lo=Dn().Buffer,dk=require("stream"),fk=require("util");function uo(i){if(this.buffer=null,this.writable=!0,this.readable=!0,!i)return this.buffer=lo.alloc(0),this;if(typeof i.pipe=="function")return this.buffer=lo.alloc(0),i.pipe(this),this;if(i.length||typeof i=="object")return this.buffer=i,this.writable=!1,process.nextTick(function(){this.emit("end",i),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof i+")")}fk.inherits(uo,dk);uo.prototype.write=function(e){this.buffer=lo.concat([this.buffer,lo.from(e)]),this.emit("data",e)};uo.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};Lv.exports=uo});var Uv=C((CO,Fv)=>{"use strict";function Pl(i){var e=(i/8|0)+(i%8===0?0:1);return e}var hk={ES256:Pl(256),ES384:Pl(384),ES512:Pl(521)};function mk(i){var e=hk[i];if(e)return e;throw new Error('Unknown algorithm "'+i+'"')}Fv.exports=mk});var Gv=C((TO,Kv)=>{"use strict";var po=Dn().Buffer,zv=Uv(),fo=128,$v=0,vk=32,gk=16,xk=2,Wv=gk|vk|$v<<6,ho=xk|$v<<6;function yk(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Vv(i){if(po.isBuffer(i))return i;if(typeof i=="string")return po.from(i,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function bk(i,e){i=Vv(i);var t=zv(e),n=t+1,r=i.length,s=0;if(i[s++]!==Wv)throw new Error('Could not find expected "seq"');var o=i[s++];if(o===(fo|1)&&(o=i[s++]),r-s<o)throw new Error('"seq" specified length of "'+o+'", only "'+(r-s)+'" remaining');if(i[s++]!==ho)throw new Error('Could not find expected "int" for "r"');var a=i[s++];if(r-s-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(r-s-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var l=s;if(s+=a,i[s++]!==ho)throw new Error('Could not find expected "int" for "s"');var p=i[s++];if(r-s!==p)throw new Error('"s" specified length of "'+p+'", expected "'+(r-s)+'"');if(n<p)throw new Error('"s" specified length of "'+p+'", max of "'+n+'" is acceptable');var f=s;if(s+=p,s!==r)throw new Error('Expected to consume entire buffer, but "'+(r-s)+'" bytes remain');var m=t-a,_=t-p,E=po.allocUnsafe(m+a+_+p);for(s=0;s<m;++s)E[s]=0;i.copy(E,s,l+Math.max(-m,0),l+a),s=t;for(var k=s;s<k+_;++s)E[s]=0;return i.copy(E,s,f+Math.max(-_,0),f+p),E=E.toString("base64"),E=yk(E),E}function Hv(i,e,t){for(var n=0;e+n<t&&i[e+n]===0;)++n;var r=i[e+n]>=fo;return r&&--n,n}function wk(i,e){i=Vv(i);var t=zv(e),n=i.length;if(n!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+n+'"');var r=Hv(i,0,t),s=Hv(i,t,i.length),o=t-r,a=t-s,l=2+o+1+1+a,p=l<fo,f=po.allocUnsafe((p?2:3)+l),m=0;return f[m++]=Wv,p?f[m++]=l:(f[m++]=fo|1,f[m++]=l&255),f[m++]=ho,f[m++]=o,r<0?(f[m++]=0,m+=i.copy(f,m,0,t)):m+=i.copy(f,m,r,t),f[m++]=ho,f[m++]=a,s<0?(f[m++]=0,i.copy(f,m,t)):i.copy(f,m,t+s),f}Kv.exports={derToJose:bk,joseToDer:wk}});var Jv=C((MO,Yv)=>{"use strict";var ur=require("buffer").Buffer,Bl=require("buffer").SlowBuffer;Yv.exports=mo;function mo(i,e){if(!ur.isBuffer(i)||!ur.isBuffer(e)||i.length!==e.length)return!1;for(var t=0,n=0;n<i.length;n++)t|=i[n]^e[n];return t===0}mo.install=function(){ur.prototype.equal=Bl.prototype.equal=function(e){return mo(this,e)}};var _k=ur.prototype.equal,Sk=Bl.prototype.equal;mo.restore=function(){ur.prototype.equal=_k,Bl.prototype.equal=Sk}});var Il=C((OO,sg)=>{var qn=Dn().Buffer,Mt=require("crypto"),Zv=Gv(),Xv=require("util"),Ek=`"%s" is not a valid algorithm.
|
|
27
27
|
Supported algorithms are:
|
|
28
|
-
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,as="secret must be a string or buffer",Pn="key must be a string or a buffer",_E="key must be a string, a buffer or an object",Cl=typeof Tt.createPublicKey=="function";Cl&&(Pn+=" or a KeyObject",as+="or a KeyObject");function Pv(i){if(!Bn.isBuffer(i)&&typeof i!="string"&&(!Cl||typeof i!="object"||typeof i.type!="string"||typeof i.asymmetricKeyType!="string"||typeof i.export!="function"))throw Nt(Pn)}function Bv(i){if(!Bn.isBuffer(i)&&typeof i!="string"&&typeof i!="object")throw Nt(_E)}function SE(i){if(!Bn.isBuffer(i)){if(typeof i=="string")return i;if(!Cl||typeof i!="object"||i.type!=="secret"||typeof i.export!="function")throw Nt(as)}}function Tl(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function jv(i){i=i.toString();var e=4-i.length%4;if(e!==4)for(var t=0;t<e;++t)i+="=";return i.replace(/\-/g,"+").replace(/_/g,"/")}function Nt(i){var e=[].slice.call(arguments,1),t=Av.format.bind(Av,i).apply(null,e);return new TypeError(t)}function EE(i){return Bn.isBuffer(i)||typeof i=="string"}function cs(i){return EE(i)||(i=JSON.stringify(i)),i}function Nv(i){return function(t,n){SE(n),t=cs(t);var s=Tt.createHmac("sha"+i,n),r=(s.update(t),s.digest("base64"));return Tl(r)}}var kl,kE="timingSafeEqual"in Tt?function(e,t){return e.byteLength!==t.byteLength?!1:Tt.timingSafeEqual(e,t)}:function(e,t){return kl||(kl=Ov()),kl(e,t)};function CE(i){return function(t,n,s){var r=Nv(i)(t,s);return kE(Bn.from(n),Bn.from(r))}}function Iv(i){return function(t,n){Bv(n),t=cs(t);var s=Tt.createSign("RSA-SHA"+i),r=(s.update(t),s.sign(n,"base64"));return Tl(r)}}function Dv(i){return function(t,n,s){Pv(s),t=cs(t),n=jv(n);var r=Tt.createVerify("RSA-SHA"+i);return r.update(t),r.verify(s,n,"base64")}}function TE(i){return function(t,n){Bv(n),t=cs(t);var s=Tt.createSign("RSA-SHA"+i),r=(s.update(t),s.sign({key:n,padding:Tt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Tt.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Tl(r)}}function ME(i){return function(t,n,s){Pv(s),t=cs(t),n=jv(n);var r=Tt.createVerify("RSA-SHA"+i);return r.update(t),r.verify({key:s,padding:Tt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Tt.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function OE(i){var e=Iv(i);return function(){var n=e.apply(null,arguments);return n=Rv.derToJose(n,"ES"+i),n}}function AE(i){var e=Dv(i);return function(n,s,r){s=Rv.joseToDer(s,"ES"+i).toString("base64");var o=e(n,s,r);return o}}function RE(){return function(){return""}}function PE(){return function(e,t){return t===""}}qv.exports=function(e){var t={hs:Nv,rs:Iv,ps:TE,es:OE,none:RE},n={hs:CE,rs:Dv,ps:ME,es:AE,none:PE},s=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!s)throw Nt(wE,e);var r=(s[1]||s[3]).toLowerCase(),o=s[2];return{sign:t[r](o),verify:n[r](o)}}});var Ol=T((uM,Lv)=>{var BE=require("buffer").Buffer;Lv.exports=function(e){return typeof e=="string"?e:typeof e=="number"||BE.isBuffer(e)?e.toString():JSON.stringify(e)}});var Wv=T((pM,$v)=>{var jE=Rn().Buffer,Fv=_l(),NE=Ml(),IE=require("stream"),Uv=Ol(),Al=require("util");function Hv(i,e){return jE.from(i,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function DE(i,e,t){t=t||"utf8";var n=Hv(Uv(i),"binary"),s=Hv(Uv(e),t);return Al.format("%s.%s",n,s)}function zv(i){var e=i.header,t=i.payload,n=i.secret||i.privateKey,s=i.encoding,r=NE(e.alg),o=DE(e,t,s),a=r.sign(o,n);return Al.format("%s.%s",o,a)}function oo(i){var e=i.secret;if(e=e??i.privateKey,e=e??i.key,/^hs/i.test(i.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new Fv(e);this.readable=!0,this.header=i.header,this.encoding=i.encoding,this.secret=this.privateKey=this.key=t,this.payload=new Fv(i.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))}Al.inherits(oo,IE);oo.prototype.sign=function(){try{var e=zv({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")}};oo.sign=zv;$v.exports=oo});var tg=T((dM,eg)=>{var Kv=Rn().Buffer,Vv=_l(),qE=Ml(),LE=require("stream"),Gv=Ol(),FE=require("util"),UE=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function HE(i){return Object.prototype.toString.call(i)==="[object Object]"}function zE(i){if(HE(i))return i;try{return JSON.parse(i)}catch{return}}function Yv(i){var e=i.split(".",1)[0];return zE(Kv.from(e,"base64").toString("binary"))}function $E(i){return i.split(".",2).join(".")}function Jv(i){return i.split(".")[2]}function WE(i,e){e=e||"utf8";var t=i.split(".")[1];return Kv.from(t,"base64").toString(e)}function Xv(i){return UE.test(i)&&!!Yv(i)}function Zv(i,e,t){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}i=Gv(i);var s=Jv(i),r=$E(i),o=qE(e);return o.verify(r,s,t)}function Qv(i,e){if(e=e||{},i=Gv(i),!Xv(i))return null;var t=Yv(i);if(!t)return null;var n=WE(i);return(t.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:t,payload:n,signature:Jv(i)}}function jn(i){i=i||{};var e=i.secret;if(e=e??i.publicKey,e=e??i.key,/^hs/i.test(i.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new Vv(e);this.readable=!0,this.algorithm=i.algorithm,this.encoding=i.encoding,this.secret=this.publicKey=this.key=t,this.signature=new Vv(i.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))}FE.inherits(jn,LE);jn.prototype.verify=function(){try{var e=Zv(this.signature.buffer,this.algorithm,this.key.buffer),t=Qv(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")}};jn.decode=Qv;jn.isValid=Xv;jn.verify=Zv;eg.exports=jn});var ng=T(vi=>{var ig=Wv(),ao=tg(),VE=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];vi.ALGORITHMS=VE;vi.sign=ig.sign;vi.verify=ao.verify;vi.decode=ao.decode;vi.isValid=ao.isValid;vi.createSign=function(e){return new ig(e)};vi.createVerify=function(e){return new ao(e)}});var co=T((hM,sg)=>{"use strict";var Rl={};Rl.supportedContentEncodings={AES_GCM:"aesgcm",AES_128_GCM:"aes128gcm"};Rl.supportedUrgency={VERY_LOW:"very-low",LOW:"low",NORMAL:"normal",HIGH:"high"};sg.exports=Rl});var Pl=T((mM,rg)=>{"use strict";function KE(i){return/^[A-Za-z0-9\-_]+$/.test(i)}rg.exports={validate:KE}});var jl=T((vM,fg)=>{"use strict";var GE=require("crypto"),YE=mv(),JE=ng(),{URL:ag}=require("url"),og=co(),cg=Pl(),XE=720*60,ZE=1440*60,QE=YE.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 ek(i){return QE.encode({version:1,privateKey:i,parameters:[1,2,840,10045,3,1,7]},"pem",{label:"EC PRIVATE KEY"})}function tk(){let i=GE.createECDH("prime256v1");i.generateKeys();let e=i.getPublicKey(),t=i.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 lg(i){if(!i)throw new Error("No subject set in vapidDetails.subject.");if(typeof i!="string"||i.length===0)throw new Error("The subject value must be a string containing an https: URL or mailto: address. "+i);let e=null;try{e=new ag(i)}catch{throw new Error("Vapid subject is not a valid URL. "+i)}if(!["https:","mailto:"].includes(e.protocol))throw new Error("Vapid subject is not an https: or mailto: URL. "+i);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 ug(i){if(!i)throw new Error("No key set vapidDetails.publicKey");if(typeof i!="string")throw new Error("Vapid public key is must be a URL safe Base 64 encoded string.");if(!cg.validate(i))throw new Error('Vapid public key must be a URL safe Base 64 (without "=")');if(i=Buffer.from(i,"base64url"),i.length!==65)throw new Error("Vapid public key should be 65 bytes long when decoded.")}function pg(i){if(!i)throw new Error("No key set in vapidDetails.privateKey");if(typeof i!="string")throw new Error("Vapid private key must be a URL safe Base 64 encoded string.");if(!cg.validate(i))throw new Error('Vapid private key must be a URL safe Base 64 (without "=")');if(i=Buffer.from(i,"base64url"),i.length!==32)throw new Error("Vapid private key should be 32 bytes long when decoded.")}function Bl(i){let e=new Date;return e.setSeconds(e.getSeconds()+i),Math.floor(e.getTime()/1e3)}function dg(i){if(!Number.isInteger(i))throw new Error("`expiration` value must be a number");if(i<0)throw new Error("`expiration` must be a positive integer");let e=Bl(ZE);if(i>=e)throw new Error("`expiration` value is greater than maximum of 24 hours")}function ik(i,e,t,n,s,r){if(!i)throw new Error("No audience could be generated for VAPID.");if(typeof i!="string"||i.length===0)throw new Error("The audience value must be a string containing the origin of a push service. "+i);try{new ag(i)}catch{throw new Error("VAPID audience is not a url. "+i)}lg(e),ug(t),pg(n),n=Buffer.from(n,"base64url"),r?dg(r):r=Bl(XE);let o={typ:"JWT",alg:"ES256"},a={aud:i,exp:r,sub:e},l=JE.sign({header:o,payload:a,privateKey:ek(n)});if(s===og.supportedContentEncodings.AES_128_GCM)return{Authorization:"vapid t="+l+", k="+t};if(s===og.supportedContentEncodings.AES_GCM)return{Authorization:"WebPush "+l,"Crypto-Key":"p256ecdsa="+t};throw new Error("Unsupported encoding type specified.")}fg.exports={generateVAPIDKeys:tk,getFutureExpirationTimestamp:Bl,getVapidHeaders:ik,validateSubject:lg,validatePublicKey:ug,validatePrivateKey:pg,validateExpiration:dg}});var Eg=T((gM,Sg)=>{"use strict";var uo=require("crypto"),mg="aes-128-gcm",po={aes128gcm:1,aesgcm:2},Ni=16,zt=16,nk=12,vg=32,ls="encrypt",us="decrypt",K;process.env.ECE_KEYLOG==="1"?K=function(i,e){return console.warn(i+" ["+e.length+"]: "+e.toString("base64url")),e}:K=function(i,e){return e};function lo(i){return typeof i=="string"?Buffer.from(i,"base64url"):i}function gg(i,e){var t=uo.createHmac("sha256",i);return t.update(e),t.digest()}function xg(i,e){return K("salt",i),K("ikm",e),K("extract",gg(i,e))}function Nl(i,e,t){K("prk",i),K("info",e);var n=Buffer.alloc(0),s=Buffer.alloc(0);e=Buffer.from(e,"ascii");for(var r=0,o=Buffer.alloc(1);n.length<t;)o.writeUIntBE(++r,0,1),s=gg(i,Buffer.concat([s,e,o])),n=Buffer.concat([n,s]);return K("expand",n.slice(0,t))}function yg(i,e,t,n){return Nl(xg(i,e),t,n)}function Il(i,e){var t=Buffer.concat([Buffer.from("Content-Encoding: "+i+"\0","ascii"),e]);return K("info "+i,t),t}function hg(i){var e=Buffer.concat([Buffer.alloc(2),i]);return e.writeUIntBE(i.length,0,2),e}function sk(i,e){var t=i.privateKey,n,s;if(e===ls)n=t.getPublicKey(),s=i.dh;else if(e===us)n=i.dh,s=t.getPublicKey();else throw new Error("Unknown mode only "+ls+" and "+us+" supported");return{secret:t.computeSecret(i.dh),context:Buffer.concat([Buffer.from(i.keylabel,"ascii"),Buffer.from([0]),hg(s),hg(n)])}}function rk(i,e){var t={secret:null,context:Buffer.alloc(0)};if(i.key){if(t.secret=i.key,t.secret.length!==zt)throw new Error("An explicit key must be "+zt+" bytes")}else i.dh?t=sk(i,e):typeof i.keyid!==void 0&&(t.secret=i.keymap[i.keyid]);if(!t.secret)throw new Error("Unable to determine key");return K("secret",t.secret),K("context",t.context),i.authSecret&&(t.secret=yg(i.authSecret,t.secret,Il("auth",Buffer.alloc(0)),vg),K("authsecret",t.secret)),t}function ok(i,e){if(!i.authSecret)throw new Error("No authentication secret for webpush");K("authsecret",i.authSecret);var t,n,s;if(e===ls)n=i.privateKey.getPublicKey(),t=s=i.dh;else if(e===us)t=n=i.keyid,s=i.privateKey.getPublicKey();else throw new Error("Unknown mode only "+ls+" and "+us+" supported");return K("remote pubkey",t),K("sender pubkey",n),K("receiver pubkey",s),K("secret dh",yg(i.authSecret,i.privateKey.computeSecret(t),Buffer.concat([Buffer.from("WebPush: info\0"),s,n]),vg))}function ak(i,e,t){if(t&&!vk(t))throw new Error("Callback is not a function");if(i.key){if(i.key.length!==zt)throw new Error("An explicit key must be "+zt+" bytes");return K("secret key",i.key)}if(!i.privateKey){if(t)var n=t(i.keyid);else var n=i.keymap&&i.keymap[i.keyid];if(!n)throw new Error('No saved key (keyid: "'+i.keyid+'")');return n}return ok(i,e)}function bg(i,e,t){if(!i.salt)throw new Error("must include a salt parameter for "+i.version);var n,s,r;if(i.version==="aesgcm"){var o=rk(i,e,t);n=Il("aesgcm",o.context),s=Il("nonce",o.context),r=o.secret}else if(i.version==="aes128gcm")n=Buffer.from("Content-Encoding: aes128gcm\0"),s=Buffer.from("Content-Encoding: nonce\0"),r=ak(i,e,t);else throw new Error("Unable to set context for mode "+i.version);var a=xg(i.salt,r),l={key:Nl(a,n,zt),nonce:Nl(a,s,nk)};return K("key",l.key),K("nonce base",l.nonce),l}function wg(i){var e={};e.version=i.version||"aes128gcm",e.rs=parseInt(i.rs,10),isNaN(e.rs)&&(e.rs=4096);var t=po[e.version];if(e.version==="aes128gcm"&&(t+=Ni),e.rs<=t)throw new Error("The rs parameter has to be greater than "+t);if(i.salt&&(e.salt=lo(i.salt),e.salt.length!==zt))throw new Error("The salt parameter must be "+zt+" bytes");return e.keyid=i.keyid,i.key?e.key=lo(i.key):(e.privateKey=i.privateKey,e.privateKey||(e.keymap=i.keymap),e.version!=="aes128gcm"&&(e.keylabel=i.keylabel||"P-256"),i.dh&&(e.dh=lo(i.dh))),i.authSecret&&(e.authSecret=lo(i.authSecret)),e}function _g(i,e){var t=Buffer.from(i),n=t.readUIntBE(t.length-6,6),s=((n^e)&16777215)+((n/16777216^e/16777216)&16777215)*16777216;return t.writeUIntBE(s,t.length-6,6),K("nonce"+e,t),t}function ck(i,e){var t=i.readUIntBE(20,1);return e.salt=i.slice(0,zt),e.rs=i.readUIntBE(zt,4),e.keyid=i.slice(21,21+t),21+t}function lk(i,e){var t=po[e],n=i.readUIntBE(0,t);if(n+t>i.length)throw new Error("padding exceeds block size");K("padding",i.slice(0,t+n));var s=Buffer.alloc(n);if(s.fill(0),s.compare(i.slice(t,t+n))!==0)throw new Error("invalid padding");return i.slice(t+n)}function uk(i,e){for(var t=i.length-1;t>=0;){if(i[t]){if(e){if(i[t]!==2)throw new Error("last record needs to start padding with a 2")}else if(i[t]!==1)throw new Error("last record needs to start padding with a 2");return i.slice(0,t)}--t}throw new Error("all zero plaintext")}function pk(i,e,t,n,s){K("decrypt",t);var r=_g(i.nonce,e),o=uo.createDecipheriv(mg,i.key,r);o.setAuthTag(t.slice(t.length-Ni));var a=o.update(t.slice(0,t.length-Ni));return a=Buffer.concat([a,o.final()]),K("decrypted",a),n.version!=="aes128gcm"?lk(a,n.version):uk(a,s)}function dk(i,e,t){var n=wg(e);if(n.version==="aes128gcm"){var s=ck(i,n);i=i.slice(s)}var r=bg(n,us,t),o=0,a=Buffer.alloc(0),l=n.rs;n.version!=="aes128gcm"&&(l+=Ni);for(var p=0;o<i.length;++p){var f=o+l;if(n.version!=="aes128gcm"&&f===i.length)throw new Error("Truncated payload");if(f=Math.min(f,i.length),f-o<=Ni)throw new Error("Invalid block: too small at "+p);var v=pk(r,p,i.slice(o,f),n,f>=i.length);a=Buffer.concat([a,v]),o=f}return a}function fk(i,e,t,n,s,r){K("encrypt",t),n=n||0;var o=_g(i.nonce,e),a=uo.createCipheriv(mg,i.key,o),l=[],p=po[s.version],f=Buffer.alloc(n+p);if(f.fill(0),s.version!=="aes128gcm"){if(f.writeUIntBE(n,0,p),K("padding",f),l.push(a.update(f)),l.push(a.update(t)),!r&&f.length+t.length<s.rs)throw new Error("Unable to pad to record size")}else l.push(a.update(t)),f.writeUIntBE(r?2:1,0,1),K("padding",f),l.push(a.update(f));a.final();var v=a.getAuthTag();if(v.length!==Ni)throw new Error("invalid tag generated");return l.push(v),K("encrypted",Buffer.concat(l))}function hk(i){var e=Buffer.alloc(5),t=Buffer.from(i.keyid||[]);if(t.length>255)throw new Error("keyid is too large");return e.writeUIntBE(i.rs,0,4),e.writeUIntBE(t.length,4,1),Buffer.concat([i.salt,e,t])}function mk(i,e,t){if(!Buffer.isBuffer(i))throw new Error("buffer argument must be a Buffer");var n=wg(e);n.salt||(n.salt=uo.randomBytes(zt));var s;n.version==="aes128gcm"?(n.privateKey&&!n.keyid&&(n.keyid=n.privateKey.getPublicKey()),s=hk(n)):s=Buffer.alloc(0);var r=bg(n,ls,t),o=0,a=po[n.version],l=a;n.version==="aes128gcm"&&(l+=Ni);for(var p=isNaN(parseInt(e.pad,10))?0:parseInt(e.pad,10),f=0,v=!1;!v;){var _=Math.min(n.rs-l-1,p);n.version!=="aes128gcm"&&(_=Math.min((1<<a*8)-1,_)),p>0&&_===0&&++_,p-=_;var E=o+n.rs-l-_;n.version!=="aes128gcm"?v=E>i.length:v=E>=i.length,v=v&&p<=0;var C=fk(r,f,i.slice(o,E),_,n,v);s=Buffer.concat([s,C]),o=E,++f}return s}function vk(i){return typeof i=="function"}Sg.exports={decrypt:dk,encrypt:mk}});var Dl=T((xM,Cg)=>{"use strict";var kg=require("crypto"),gk=Eg(),xk=function(i,e,t,n){if(!i)throw new Error("No user public key provided for encryption.");if(typeof i!="string")throw new Error("The subscription p256dh value must be a string.");if(Buffer.from(i,"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 s=kg.createECDH("prime256v1"),r=s.generateKeys(),o=kg.randomBytes(16).toString("base64url"),a=gk.encrypt(t,{version:n,dh:i,privateKey:s,salt:o,authSecret:e});return{localPublicKey:r,salt:o,cipherText:a}};Cg.exports={encrypt:xk}});var ql=T((yM,Mg)=>{"use strict";function Tg(i,e,t,n,s){Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=i,this.statusCode=e,this.headers=t,this.body=n,this.endpoint=s}require("util").inherits(Tg,Error);Mg.exports=Tg});var Rg=T(rt=>{"use strict";var yk=rt&&rt.__createBinding||(Object.create?(function(i,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,s)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),bk=rt&&rt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Og=rt&&rt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&yk(e,i,t);return bk(e,i),e};Object.defineProperty(rt,"__esModule",{value:!0});rt.req=rt.json=rt.toBuffer=void 0;var wk=Og(require("http")),_k=Og(require("https"));async function Ag(i){let e=0,t=[];for await(let n of i)e+=n.length,t.push(n);return Buffer.concat(t,e)}rt.toBuffer=Ag;async function Sk(i){let t=(await Ag(i)).toString("utf8");try{return JSON.parse(t)}catch(n){let s=n;throw s.message+=` (input: ${t})`,s}}rt.json=Sk;function Ek(i,e={}){let n=((typeof i=="string"?i:i.href).startsWith("https:")?_k:wk).request(i,e),s=new Promise((r,o)=>{n.once("response",r).once("error",o).end()});return n.then=s.then.bind(s),n}rt.req=Ek});var Ng=T(ft=>{"use strict";var Bg=ft&&ft.__createBinding||(Object.create?(function(i,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,s)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),kk=ft&&ft.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),jg=ft&&ft.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&Bg(e,i,t);return kk(e,i),e},Ck=ft&&ft.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Bg(e,i,t)};Object.defineProperty(ft,"__esModule",{value:!0});ft.Agent=void 0;var Tk=jg(require("net")),Pg=jg(require("http")),Mk=require("https");Ck(Rg(),ft);var $t=Symbol("AgentBaseInternalState"),Ll=class extends Pg.Agent{constructor(e){super(e),this[$t]={}}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(`
|
|
29
|
-
`).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
|
|
28
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,pr="secret must be a string or buffer",In="key must be a string or a buffer",kk="key must be a string, a buffer or an object",Nl=typeof Mt.createPublicKey=="function";Nl&&(In+=" or a KeyObject",pr+="or a KeyObject");function Qv(i){if(!qn.isBuffer(i)&&typeof i!="string"&&(!Nl||typeof i!="object"||typeof i.type!="string"||typeof i.asymmetricKeyType!="string"||typeof i.export!="function"))throw Dt(In)}function eg(i){if(!qn.isBuffer(i)&&typeof i!="string"&&typeof i!="object")throw Dt(kk)}function Ck(i){if(!qn.isBuffer(i)){if(typeof i=="string")return i;if(!Nl||typeof i!="object"||i.type!=="secret"||typeof i.export!="function")throw Dt(pr)}}function Dl(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function tg(i){i=i.toString();var e=4-i.length%4;if(e!==4)for(var t=0;t<e;++t)i+="=";return i.replace(/\-/g,"+").replace(/_/g,"/")}function Dt(i){var e=[].slice.call(arguments,1),t=Xv.format.bind(Xv,i).apply(null,e);return new TypeError(t)}function Tk(i){return qn.isBuffer(i)||typeof i=="string"}function dr(i){return Tk(i)||(i=JSON.stringify(i)),i}function ig(i){return function(t,n){Ck(n),t=dr(t);var r=Mt.createHmac("sha"+i,n),s=(r.update(t),r.digest("base64"));return Dl(s)}}var jl,Mk="timingSafeEqual"in Mt?function(e,t){return e.byteLength!==t.byteLength?!1:Mt.timingSafeEqual(e,t)}:function(e,t){return jl||(jl=Jv()),jl(e,t)};function Ok(i){return function(t,n,r){var s=ig(i)(t,r);return Mk(qn.from(n),qn.from(s))}}function ng(i){return function(t,n){eg(n),t=dr(t);var r=Mt.createSign("RSA-SHA"+i),s=(r.update(t),r.sign(n,"base64"));return Dl(s)}}function rg(i){return function(t,n,r){Qv(r),t=dr(t),n=tg(n);var s=Mt.createVerify("RSA-SHA"+i);return s.update(t),s.verify(r,n,"base64")}}function Ak(i){return function(t,n){eg(n),t=dr(t);var r=Mt.createSign("RSA-SHA"+i),s=(r.update(t),r.sign({key:n,padding:Mt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Mt.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Dl(s)}}function Rk(i){return function(t,n,r){Qv(r),t=dr(t),n=tg(n);var s=Mt.createVerify("RSA-SHA"+i);return s.update(t),s.verify({key:r,padding:Mt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Mt.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function Pk(i){var e=ng(i);return function(){var n=e.apply(null,arguments);return n=Zv.derToJose(n,"ES"+i),n}}function Bk(i){var e=rg(i);return function(n,r,s){r=Zv.joseToDer(r,"ES"+i).toString("base64");var o=e(n,r,s);return o}}function jk(){return function(){return""}}function Nk(){return function(e,t){return t===""}}sg.exports=function(e){var t={hs:ig,rs:ng,ps:Ak,es:Pk,none:jk},n={hs:Ok,rs:rg,ps:Rk,es:Bk,none:Nk},r=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!r)throw Dt(Ek,e);var s=(r[1]||r[3]).toLowerCase(),o=r[2];return{sign:t[s](o),verify:n[s](o)}}});var ql=C((AO,og)=>{var Dk=require("buffer").Buffer;og.exports=function(e){return typeof e=="string"?e:typeof e=="number"||Dk.isBuffer(e)?e.toString():JSON.stringify(e)}});var dg=C((RO,pg)=>{var Ik=Dn().Buffer,ag=Rl(),qk=Il(),Lk=require("stream"),cg=ql(),Ll=require("util");function lg(i,e){return Ik.from(i,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Fk(i,e,t){t=t||"utf8";var n=lg(cg(i),"binary"),r=lg(cg(e),t);return Ll.format("%s.%s",n,r)}function ug(i){var e=i.header,t=i.payload,n=i.secret||i.privateKey,r=i.encoding,s=qk(e.alg),o=Fk(e,t,r),a=s.sign(o,n);return Ll.format("%s.%s",o,a)}function vo(i){var e=i.secret;if(e=e??i.privateKey,e=e??i.key,/^hs/i.test(i.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new ag(e);this.readable=!0,this.header=i.header,this.encoding=i.encoding,this.secret=this.privateKey=this.key=t,this.payload=new ag(i.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))}Ll.inherits(vo,Lk);vo.prototype.sign=function(){try{var e=ug({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")}};vo.sign=ug;pg.exports=vo});var _g=C((PO,wg)=>{var hg=Dn().Buffer,fg=Rl(),Uk=Il(),Hk=require("stream"),mg=ql(),zk=require("util"),$k=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function Wk(i){return Object.prototype.toString.call(i)==="[object Object]"}function Vk(i){if(Wk(i))return i;try{return JSON.parse(i)}catch{return}}function vg(i){var e=i.split(".",1)[0];return Vk(hg.from(e,"base64").toString("binary"))}function Kk(i){return i.split(".",2).join(".")}function gg(i){return i.split(".")[2]}function Gk(i,e){e=e||"utf8";var t=i.split(".")[1];return hg.from(t,"base64").toString(e)}function xg(i){return $k.test(i)&&!!vg(i)}function yg(i,e,t){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}i=mg(i);var r=gg(i),s=Kk(i),o=Uk(e);return o.verify(s,r,t)}function bg(i,e){if(e=e||{},i=mg(i),!xg(i))return null;var t=vg(i);if(!t)return null;var n=Gk(i);return(t.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:t,payload:n,signature:gg(i)}}function Ln(i){i=i||{};var e=i.secret;if(e=e??i.publicKey,e=e??i.key,/^hs/i.test(i.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new fg(e);this.readable=!0,this.algorithm=i.algorithm,this.encoding=i.encoding,this.secret=this.publicKey=this.key=t,this.signature=new fg(i.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))}zk.inherits(Ln,Hk);Ln.prototype.verify=function(){try{var e=yg(this.signature.buffer,this.algorithm,this.key.buffer),t=bg(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")}};Ln.decode=bg;Ln.isValid=xg;Ln.verify=yg;wg.exports=Ln});var Eg=C(yi=>{var Sg=dg(),go=_g(),Yk=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];yi.ALGORITHMS=Yk;yi.sign=Sg.sign;yi.verify=go.verify;yi.decode=go.decode;yi.isValid=go.isValid;yi.createSign=function(e){return new Sg(e)};yi.createVerify=function(e){return new go(e)}});var xo=C((jO,kg)=>{"use strict";var Fl={};Fl.supportedContentEncodings={AES_GCM:"aesgcm",AES_128_GCM:"aes128gcm"};Fl.supportedUrgency={VERY_LOW:"very-low",LOW:"low",NORMAL:"normal",HIGH:"high"};kg.exports=Fl});var Ul=C((NO,Cg)=>{"use strict";function Jk(i){return/^[A-Za-z0-9\-_]+$/.test(i)}Cg.exports={validate:Jk}});var zl=C((DO,jg)=>{"use strict";var Xk=require("crypto"),Zk=Dv(),Qk=Eg(),{URL:Mg}=require("url"),Tg=xo(),Og=Ul(),eC=720*60,tC=1440*60,iC=Zk.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 nC(i){return iC.encode({version:1,privateKey:i,parameters:[1,2,840,10045,3,1,7]},"pem",{label:"EC PRIVATE KEY"})}function rC(){let i=Xk.createECDH("prime256v1");i.generateKeys();let e=i.getPublicKey(),t=i.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 Ag(i){if(!i)throw new Error("No subject set in vapidDetails.subject.");if(typeof i!="string"||i.length===0)throw new Error("The subject value must be a string containing an https: URL or mailto: address. "+i);let e=null;try{e=new Mg(i)}catch{throw new Error("Vapid subject is not a valid URL. "+i)}if(!["https:","mailto:"].includes(e.protocol))throw new Error("Vapid subject is not an https: or mailto: URL. "+i);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 Rg(i){if(!i)throw new Error("No key set vapidDetails.publicKey");if(typeof i!="string")throw new Error("Vapid public key is must be a URL safe Base 64 encoded string.");if(!Og.validate(i))throw new Error('Vapid public key must be a URL safe Base 64 (without "=")');if(i=Buffer.from(i,"base64url"),i.length!==65)throw new Error("Vapid public key should be 65 bytes long when decoded.")}function Pg(i){if(!i)throw new Error("No key set in vapidDetails.privateKey");if(typeof i!="string")throw new Error("Vapid private key must be a URL safe Base 64 encoded string.");if(!Og.validate(i))throw new Error('Vapid private key must be a URL safe Base 64 (without "=")');if(i=Buffer.from(i,"base64url"),i.length!==32)throw new Error("Vapid private key should be 32 bytes long when decoded.")}function Hl(i){let e=new Date;return e.setSeconds(e.getSeconds()+i),Math.floor(e.getTime()/1e3)}function Bg(i){if(!Number.isInteger(i))throw new Error("`expiration` value must be a number");if(i<0)throw new Error("`expiration` must be a positive integer");let e=Hl(tC);if(i>=e)throw new Error("`expiration` value is greater than maximum of 24 hours")}function sC(i,e,t,n,r,s){if(!i)throw new Error("No audience could be generated for VAPID.");if(typeof i!="string"||i.length===0)throw new Error("The audience value must be a string containing the origin of a push service. "+i);try{new Mg(i)}catch{throw new Error("VAPID audience is not a url. "+i)}Ag(e),Rg(t),Pg(n),n=Buffer.from(n,"base64url"),s?Bg(s):s=Hl(eC);let o={typ:"JWT",alg:"ES256"},a={aud:i,exp:s,sub:e},l=Qk.sign({header:o,payload:a,privateKey:nC(n)});if(r===Tg.supportedContentEncodings.AES_128_GCM)return{Authorization:"vapid t="+l+", k="+t};if(r===Tg.supportedContentEncodings.AES_GCM)return{Authorization:"WebPush "+l,"Crypto-Key":"p256ecdsa="+t};throw new Error("Unsupported encoding type specified.")}jg.exports={generateVAPIDKeys:rC,getFutureExpirationTimestamp:Hl,getVapidHeaders:sC,validateSubject:Ag,validatePublicKey:Rg,validatePrivateKey:Pg,validateExpiration:Bg}});var Wg=C((IO,$g)=>{"use strict";var bo=require("crypto"),Dg="aes-128-gcm",wo={aes128gcm:1,aesgcm:2},qi=16,$t=16,oC=12,Ig=32,fr="encrypt",hr="decrypt",G;process.env.ECE_KEYLOG==="1"?G=function(i,e){return console.warn(i+" ["+e.length+"]: "+e.toString("base64url")),e}:G=function(i,e){return e};function yo(i){return typeof i=="string"?Buffer.from(i,"base64url"):i}function qg(i,e){var t=bo.createHmac("sha256",i);return t.update(e),t.digest()}function Lg(i,e){return G("salt",i),G("ikm",e),G("extract",qg(i,e))}function $l(i,e,t){G("prk",i),G("info",e);var n=Buffer.alloc(0),r=Buffer.alloc(0);e=Buffer.from(e,"ascii");for(var s=0,o=Buffer.alloc(1);n.length<t;)o.writeUIntBE(++s,0,1),r=qg(i,Buffer.concat([r,e,o])),n=Buffer.concat([n,r]);return G("expand",n.slice(0,t))}function Fg(i,e,t,n){return $l(Lg(i,e),t,n)}function Wl(i,e){var t=Buffer.concat([Buffer.from("Content-Encoding: "+i+"\0","ascii"),e]);return G("info "+i,t),t}function Ng(i){var e=Buffer.concat([Buffer.alloc(2),i]);return e.writeUIntBE(i.length,0,2),e}function aC(i,e){var t=i.privateKey,n,r;if(e===fr)n=t.getPublicKey(),r=i.dh;else if(e===hr)n=i.dh,r=t.getPublicKey();else throw new Error("Unknown mode only "+fr+" and "+hr+" supported");return{secret:t.computeSecret(i.dh),context:Buffer.concat([Buffer.from(i.keylabel,"ascii"),Buffer.from([0]),Ng(r),Ng(n)])}}function cC(i,e){var t={secret:null,context:Buffer.alloc(0)};if(i.key){if(t.secret=i.key,t.secret.length!==$t)throw new Error("An explicit key must be "+$t+" bytes")}else i.dh?t=aC(i,e):typeof i.keyid!==void 0&&(t.secret=i.keymap[i.keyid]);if(!t.secret)throw new Error("Unable to determine key");return G("secret",t.secret),G("context",t.context),i.authSecret&&(t.secret=Fg(i.authSecret,t.secret,Wl("auth",Buffer.alloc(0)),Ig),G("authsecret",t.secret)),t}function lC(i,e){if(!i.authSecret)throw new Error("No authentication secret for webpush");G("authsecret",i.authSecret);var t,n,r;if(e===fr)n=i.privateKey.getPublicKey(),t=r=i.dh;else if(e===hr)t=n=i.keyid,r=i.privateKey.getPublicKey();else throw new Error("Unknown mode only "+fr+" and "+hr+" supported");return G("remote pubkey",t),G("sender pubkey",n),G("receiver pubkey",r),G("secret dh",Fg(i.authSecret,i.privateKey.computeSecret(t),Buffer.concat([Buffer.from("WebPush: info\0"),r,n]),Ig))}function uC(i,e,t){if(t&&!yC(t))throw new Error("Callback is not a function");if(i.key){if(i.key.length!==$t)throw new Error("An explicit key must be "+$t+" bytes");return G("secret key",i.key)}if(!i.privateKey){if(t)var n=t(i.keyid);else var n=i.keymap&&i.keymap[i.keyid];if(!n)throw new Error('No saved key (keyid: "'+i.keyid+'")');return n}return lC(i,e)}function Ug(i,e,t){if(!i.salt)throw new Error("must include a salt parameter for "+i.version);var n,r,s;if(i.version==="aesgcm"){var o=cC(i,e,t);n=Wl("aesgcm",o.context),r=Wl("nonce",o.context),s=o.secret}else if(i.version==="aes128gcm")n=Buffer.from("Content-Encoding: aes128gcm\0"),r=Buffer.from("Content-Encoding: nonce\0"),s=uC(i,e,t);else throw new Error("Unable to set context for mode "+i.version);var a=Lg(i.salt,s),l={key:$l(a,n,$t),nonce:$l(a,r,oC)};return G("key",l.key),G("nonce base",l.nonce),l}function Hg(i){var e={};e.version=i.version||"aes128gcm",e.rs=parseInt(i.rs,10),isNaN(e.rs)&&(e.rs=4096);var t=wo[e.version];if(e.version==="aes128gcm"&&(t+=qi),e.rs<=t)throw new Error("The rs parameter has to be greater than "+t);if(i.salt&&(e.salt=yo(i.salt),e.salt.length!==$t))throw new Error("The salt parameter must be "+$t+" bytes");return e.keyid=i.keyid,i.key?e.key=yo(i.key):(e.privateKey=i.privateKey,e.privateKey||(e.keymap=i.keymap),e.version!=="aes128gcm"&&(e.keylabel=i.keylabel||"P-256"),i.dh&&(e.dh=yo(i.dh))),i.authSecret&&(e.authSecret=yo(i.authSecret)),e}function zg(i,e){var t=Buffer.from(i),n=t.readUIntBE(t.length-6,6),r=((n^e)&16777215)+((n/16777216^e/16777216)&16777215)*16777216;return t.writeUIntBE(r,t.length-6,6),G("nonce"+e,t),t}function pC(i,e){var t=i.readUIntBE(20,1);return e.salt=i.slice(0,$t),e.rs=i.readUIntBE($t,4),e.keyid=i.slice(21,21+t),21+t}function dC(i,e){var t=wo[e],n=i.readUIntBE(0,t);if(n+t>i.length)throw new Error("padding exceeds block size");G("padding",i.slice(0,t+n));var r=Buffer.alloc(n);if(r.fill(0),r.compare(i.slice(t,t+n))!==0)throw new Error("invalid padding");return i.slice(t+n)}function fC(i,e){for(var t=i.length-1;t>=0;){if(i[t]){if(e){if(i[t]!==2)throw new Error("last record needs to start padding with a 2")}else if(i[t]!==1)throw new Error("last record needs to start padding with a 2");return i.slice(0,t)}--t}throw new Error("all zero plaintext")}function hC(i,e,t,n,r){G("decrypt",t);var s=zg(i.nonce,e),o=bo.createDecipheriv(Dg,i.key,s);o.setAuthTag(t.slice(t.length-qi));var a=o.update(t.slice(0,t.length-qi));return a=Buffer.concat([a,o.final()]),G("decrypted",a),n.version!=="aes128gcm"?dC(a,n.version):fC(a,r)}function mC(i,e,t){var n=Hg(e);if(n.version==="aes128gcm"){var r=pC(i,n);i=i.slice(r)}var s=Ug(n,hr,t),o=0,a=Buffer.alloc(0),l=n.rs;n.version!=="aes128gcm"&&(l+=qi);for(var p=0;o<i.length;++p){var f=o+l;if(n.version!=="aes128gcm"&&f===i.length)throw new Error("Truncated payload");if(f=Math.min(f,i.length),f-o<=qi)throw new Error("Invalid block: too small at "+p);var m=hC(s,p,i.slice(o,f),n,f>=i.length);a=Buffer.concat([a,m]),o=f}return a}function vC(i,e,t,n,r,s){G("encrypt",t),n=n||0;var o=zg(i.nonce,e),a=bo.createCipheriv(Dg,i.key,o),l=[],p=wo[r.version],f=Buffer.alloc(n+p);if(f.fill(0),r.version!=="aes128gcm"){if(f.writeUIntBE(n,0,p),G("padding",f),l.push(a.update(f)),l.push(a.update(t)),!s&&f.length+t.length<r.rs)throw new Error("Unable to pad to record size")}else l.push(a.update(t)),f.writeUIntBE(s?2:1,0,1),G("padding",f),l.push(a.update(f));a.final();var m=a.getAuthTag();if(m.length!==qi)throw new Error("invalid tag generated");return l.push(m),G("encrypted",Buffer.concat(l))}function gC(i){var e=Buffer.alloc(5),t=Buffer.from(i.keyid||[]);if(t.length>255)throw new Error("keyid is too large");return e.writeUIntBE(i.rs,0,4),e.writeUIntBE(t.length,4,1),Buffer.concat([i.salt,e,t])}function xC(i,e,t){if(!Buffer.isBuffer(i))throw new Error("buffer argument must be a Buffer");var n=Hg(e);n.salt||(n.salt=bo.randomBytes($t));var r;n.version==="aes128gcm"?(n.privateKey&&!n.keyid&&(n.keyid=n.privateKey.getPublicKey()),r=gC(n)):r=Buffer.alloc(0);var s=Ug(n,fr,t),o=0,a=wo[n.version],l=a;n.version==="aes128gcm"&&(l+=qi);for(var p=isNaN(parseInt(e.pad,10))?0:parseInt(e.pad,10),f=0,m=!1;!m;){var _=Math.min(n.rs-l-1,p);n.version!=="aes128gcm"&&(_=Math.min((1<<a*8)-1,_)),p>0&&_===0&&++_,p-=_;var E=o+n.rs-l-_;n.version!=="aes128gcm"?m=E>i.length:m=E>=i.length,m=m&&p<=0;var k=vC(s,f,i.slice(o,E),_,n,m);r=Buffer.concat([r,k]),o=E,++f}return r}function yC(i){return typeof i=="function"}$g.exports={decrypt:mC,encrypt:xC}});var Vl=C((qO,Kg)=>{"use strict";var Vg=require("crypto"),bC=Wg(),wC=function(i,e,t,n){if(!i)throw new Error("No user public key provided for encryption.");if(typeof i!="string")throw new Error("The subscription p256dh value must be a string.");if(Buffer.from(i,"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 r=Vg.createECDH("prime256v1"),s=r.generateKeys(),o=Vg.randomBytes(16).toString("base64url"),a=bC.encrypt(t,{version:n,dh:i,privateKey:r,salt:o,authSecret:e});return{localPublicKey:s,salt:o,cipherText:a}};Kg.exports={encrypt:wC}});var Kl=C((LO,Yg)=>{"use strict";function Gg(i,e,t,n,r){Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=i,this.statusCode=e,this.headers=t,this.body=n,this.endpoint=r}require("util").inherits(Gg,Error);Yg.exports=Gg});var Zg=C(ot=>{"use strict";var _C=ot&&ot.__createBinding||(Object.create?(function(i,e,t,n){n===void 0&&(n=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,r)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),SC=ot&&ot.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Jg=ot&&ot.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&_C(e,i,t);return SC(e,i),e};Object.defineProperty(ot,"__esModule",{value:!0});ot.req=ot.json=ot.toBuffer=void 0;var EC=Jg(require("http")),kC=Jg(require("https"));async function Xg(i){let e=0,t=[];for await(let n of i)e+=n.length,t.push(n);return Buffer.concat(t,e)}ot.toBuffer=Xg;async function CC(i){let t=(await Xg(i)).toString("utf8");try{return JSON.parse(t)}catch(n){let r=n;throw r.message+=` (input: ${t})`,r}}ot.json=CC;function TC(i,e={}){let n=((typeof i=="string"?i:i.href).startsWith("https:")?kC:EC).request(i,e),r=new Promise((s,o)=>{n.once("response",s).once("error",o).end()});return n.then=r.then.bind(r),n}ot.req=TC});var i0=C(ht=>{"use strict";var e0=ht&&ht.__createBinding||(Object.create?(function(i,e,t,n){n===void 0&&(n=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,r)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),MC=ht&&ht.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),t0=ht&&ht.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&e0(e,i,t);return MC(e,i),e},OC=ht&&ht.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&e0(e,i,t)};Object.defineProperty(ht,"__esModule",{value:!0});ht.Agent=void 0;var AC=t0(require("net")),Qg=t0(require("http")),RC=require("https");OC(Zg(),ht);var Wt=Symbol("AgentBaseInternalState"),Gl=class extends Qg.Agent{constructor(e){super(e),this[Wt]={}}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(`
|
|
29
|
+
`).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 AC.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],r=n.indexOf(t);r!==-1&&(n.splice(r,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?RC.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,n){let r={...t,secureEndpoint:this.isSecureEndpoint(t)},s=this.getName(r),o=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,r)).then(a=>{if(this.decrementSockets(s,o),a instanceof Qg.Agent)try{return a.addRequest(e,r)}catch(l){return n(l)}this[Wt].currentSocket=a,super.createSocket(e,t,n)},a=>{this.decrementSockets(s,o),n(a)})}createConnection(){let e=this[Wt].currentSocket;if(this[Wt].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Wt].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Wt]&&(this[Wt].defaultPort=e)}get protocol(){return this[Wt].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Wt]&&(this[Wt].protocol=e)}};ht.Agent=Gl});var n0=C(Fn=>{"use strict";var PC=Fn&&Fn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Fn,"__esModule",{value:!0});Fn.parseProxyResponse=void 0;var BC=PC(se()),_o=(0,BC.default)("https-proxy-agent:parse-proxy-response");function jC(i){return new Promise((e,t)=>{let n=0,r=[];function s(){let f=i.read();f?p(f):i.once("readable",s)}function o(){i.removeListener("end",a),i.removeListener("error",l),i.removeListener("readable",s)}function a(){o(),_o("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}function l(f){o(),_o("onerror %o",f),t(f)}function p(f){r.push(f),n+=f.length;let m=Buffer.concat(r,n),_=m.indexOf(`\r
|
|
30
30
|
\r
|
|
31
|
-
`);if(_===-1){
|
|
32
|
-
`),
|
|
33
|
-
`;if(n.username||n.password){let _=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;
|
|
34
|
-
`;let l=(0,
|
|
35
|
-
`);let{connect:p,buffered:f}=await l;if(e.emit("proxyConnect",p),this.emit("proxyConnect",p,e),p.statusCode===200)return e.once("socket",Lk),t.secureEndpoint?(ps("Upgrading socket connection to TLS"),Dg.connect({...Lg(qg(t),"host","path","port"),socket:s})):s;s.destroy();let v=new ho.Socket({writable:!1});return v.readable=!0,e.once("socket",_=>{ps("Replaying proxy buffer for failed request"),(0,jk.default)(_.listenerCount("data")>0),_.push(f),_.push(null)}),v}};mo.protocols=["http","https"];Mt.HttpsProxyAgent=mo;function Lk(i){i.resume()}function Lg(i,...e){let t={},n;for(n in i)e.includes(n)||(t[n]=i[n]);return t}});var Kg=T((EM,Vg)=>{"use strict";var $g=require("url"),Wg=require("https"),Fk=ql(),vo=jl(),Uk=Dl(),ht=co(),Hk=Pl(),zg=2419200,Fl="",Ul;function ds(){}ds.prototype.setGCMAPIKey=function(i){if(i===null){Fl=null;return}if(typeof i>"u"||typeof i!="string"||i.length===0)throw new Error("The GCM API Key should be a non-empty string or null.");Fl=i};ds.prototype.setVapidDetails=function(i,e,t){if(arguments.length===1&&arguments[0]===null){Ul=null;return}vo.validateSubject(i),vo.validatePublicKey(e),vo.validatePrivateKey(t),Ul={subject:i,publicKey:e,privateKey:t}};ds.prototype.generateRequestDetails=function(i,e,t){if(!i||!i.endpoint)throw new Error("You must pass in a subscription with at least an endpoint.");if(typeof i.endpoint!="string"||i.endpoint.length===0)throw new Error("The subscription endpoint must be a string with a valid URL.");if(e&&(typeof i!="object"||!i.keys||!i.keys.p256dh||!i.keys.auth))throw new Error("To send a message with a payload, the subscription must have 'auth' and 'p256dh' keys.");let n=Fl,s=Ul,r=zg,o={},a=ht.supportedContentEncodings.AES_128_GCM,l=ht.supportedUrgency.NORMAL,p,f,v,_;if(t){let O=["headers","gcmAPIKey","vapidDetails","TTL","contentEncoding","urgency","topic","proxy","agent","timeout"],A=Object.keys(t);for(let N=0;N<A.length;N+=1){let U=A[N];if(!O.includes(U))throw new Error("'"+U+"' is an invalid option. The valid options are ['"+O.join("', '")+"'].")}if(t.headers){o=t.headers;let N=Object.keys(o).filter(function(U){return typeof t[U]<"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&&(s=t.vapidDetails),t.TTL!==void 0&&(r=Number(t.TTL),r<0))throw new Error("TTL should be a number and should be at least 0");if(t.contentEncoding)if(t.contentEncoding===ht.supportedContentEncodings.AES_128_GCM||t.contentEncoding===ht.supportedContentEncodings.AES_GCM)a=t.contentEncoding;else throw new Error("Unsupported content encoding specified.");if(t.urgency)if(t.urgency===ht.supportedUrgency.VERY_LOW||t.urgency===ht.supportedUrgency.LOW||t.urgency===ht.supportedUrgency.NORMAL||t.urgency===ht.supportedUrgency.HIGH)l=t.urgency;else throw new Error("Unsupported urgency specified.");if(t.topic){if(!Hk.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");p=t.topic}t.proxy&&(typeof t.proxy=="string"||typeof t.proxy.host=="string"?f=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 Wg.Agent?(f&&console.warn("Agent option will be ignored because proxy option is defined."),v=t.agent):console.warn("Wrong type for the agent option, it should be an instance of https.Agent.")),typeof t.timeout=="number"&&(_=t.timeout)}typeof r>"u"&&(r=zg);let E={method:"POST",headers:{TTL:r}};Object.keys(o).forEach(function(O){E.headers[O]=o[O]});let C=null;if(e){let O=Uk.encrypt(i.keys.p256dh,i.keys.auth,e,a);E.headers["Content-Length"]=O.cipherText.length,E.headers["Content-Type"]="application/octet-stream",a===ht.supportedContentEncodings.AES_128_GCM?E.headers["Content-Encoding"]=ht.supportedContentEncodings.AES_128_GCM:a===ht.supportedContentEncodings.AES_GCM&&(E.headers["Content-Encoding"]=ht.supportedContentEncodings.AES_GCM,E.headers.Encryption="salt="+O.salt,E.headers["Crypto-Key"]="dh="+O.localPublicKey.toString("base64url")),C=O.cipherText}else E.headers["Content-Length"]=0;let k=i.endpoint.startsWith("https://android.googleapis.com/gcm/send"),M=i.endpoint.startsWith("https://fcm.googleapis.com/fcm/send");if(k)n?E.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(s){let O=$g.parse(i.endpoint),A=O.protocol+"//"+O.host,N=vo.getVapidHeaders(A,s.subject,s.publicKey,s.privateKey,a);E.headers.Authorization=N.Authorization,a===ht.supportedContentEncodings.AES_GCM&&(E.headers["Crypto-Key"]?E.headers["Crypto-Key"]+=";"+N["Crypto-Key"]:E.headers["Crypto-Key"]=N["Crypto-Key"])}else M&&n&&(E.headers.Authorization="key="+n);return E.headers.Urgency=l,p&&(E.headers.Topic=p),E.body=C,E.endpoint=i.endpoint,f&&(E.proxy=f),v&&(E.agent=v),_&&(E.timeout=_),E};ds.prototype.sendNotification=function(i,e,t){let n;try{n=this.generateRequestDetails(i,e,t)}catch(s){return Promise.reject(s)}return new Promise(function(s,r){let o={},a=$g.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:p}=Hg();o.agent=new p(n.proxy)}let l=Wg.request(o,function(p){let f="";p.on("data",function(v){f+=v}),p.on("end",function(){p.statusCode<200||p.statusCode>299?r(new Fk("Received unexpected response code",p.statusCode,p.headers,f,n.endpoint)):s({statusCode:p.statusCode,body:f,headers:p.headers})})});n.timeout&&l.on("timeout",function(){l.destroy(new Error("Socket timeout"))}),l.on("error",function(p){r(p)}),n.body&&l.write(n.body),l.end()})};Vg.exports=ds});var Jg=T((kM,Yg)=>{"use strict";var Gg=jl(),zk=Dl(),$k=Kg(),Wk=ql(),Vk=co(),fs=new $k;Yg.exports={WebPushError:Wk,supportedContentEncodings:Vk.supportedContentEncodings,encrypt:zk.encrypt,getVapidHeaders:Gg.getVapidHeaders,generateVAPIDKeys:Gg.generateVAPIDKeys,setGCMAPIKey:fs.setGCMAPIKey,setVapidDetails:fs.setVapidDetails,generateRequestDetails:fs.generateRequestDetails,sendNotification:fs.sendNotification.bind(fs)}});var L0=T((QM,Xl)=>{"use strict";var f2=Object.prototype.hasOwnProperty,tt="~";function ys(){}Object.create&&(ys.prototype=Object.create(null),new ys().__proto__||(tt=!1));function h2(i,e,t){this.fn=i,this.context=e,this.once=t||!1}function q0(i,e,t,n,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var r=new h2(t,n||i,s),o=tt?tt+e:e;return i._events[o]?i._events[o].fn?i._events[o]=[i._events[o],r]:i._events[o].push(r):(i._events[o]=r,i._eventsCount++),i}function Co(i,e){--i._eventsCount===0?i._events=new ys:delete i._events[e]}function Je(){this._events=new ys,this._eventsCount=0}Je.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)f2.call(t,n)&&e.push(tt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Je.prototype.listeners=function(e){var t=tt?tt+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,r=n.length,o=new Array(r);s<r;s++)o[s]=n[s].fn;return o};Je.prototype.listenerCount=function(e){var t=tt?tt+e:e,n=this._events[t];return n?n.fn?1:n.length:0};Je.prototype.emit=function(e,t,n,s,r,o){var a=tt?tt+e:e;if(!this._events[a])return!1;var l=this._events[a],p=arguments.length,f,v;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),p){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,s),!0;case 5:return l.fn.call(l.context,t,n,s,r),!0;case 6:return l.fn.call(l.context,t,n,s,r,o),!0}for(v=1,f=new Array(p-1);v<p;v++)f[v-1]=arguments[v];l.fn.apply(l.context,f)}else{var _=l.length,E;for(v=0;v<_;v++)switch(l[v].once&&this.removeListener(e,l[v].fn,void 0,!0),p){case 1:l[v].fn.call(l[v].context);break;case 2:l[v].fn.call(l[v].context,t);break;case 3:l[v].fn.call(l[v].context,t,n);break;case 4:l[v].fn.call(l[v].context,t,n,s);break;default:if(!f)for(E=1,f=new Array(p-1);E<p;E++)f[E-1]=arguments[E];l[v].fn.apply(l[v].context,f)}}return!0};Je.prototype.on=function(e,t,n){return q0(this,e,t,n,!1)};Je.prototype.once=function(e,t,n){return q0(this,e,t,n,!0)};Je.prototype.removeListener=function(e,t,n,s){var r=tt?tt+e:e;if(!this._events[r])return this;if(!t)return Co(this,r),this;var o=this._events[r];if(o.fn)o.fn===t&&(!s||o.once)&&(!n||o.context===n)&&Co(this,r);else{for(var a=0,l=[],p=o.length;a<p;a++)(o[a].fn!==t||s&&!o[a].once||n&&o[a].context!==n)&&l.push(o[a]);l.length?this._events[r]=l.length===1?l[0]:l:Co(this,r)}return this};Je.prototype.removeAllListeners=function(e){var t;return e?(t=tt?tt+e:e,this._events[t]&&Co(this,t)):(this._events=new ys,this._eventsCount=0),this};Je.prototype.off=Je.prototype.removeListener;Je.prototype.addListener=Je.prototype.on;Je.prefixed=tt;Je.EventEmitter=Je;typeof Xl<"u"&&(Xl.exports=Je)});var U0=T((eO,F0)=>{"use strict";F0.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 To=T(z0=>{var ni=z0,m2=require("url"),H0=require("util")._extend,v2=U0(),g2=/(^|,)\s*upgrade\s*($|,)/i,Zl=/^https|wss/;ni.isSSL=Zl;ni.setupOutgoing=function(i,e,t,n){i.port=e[n||"target"].port||(Zl.test(e[n||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(a){i[a]=e[n||"target"][a]}),i.method=e.method||t.method,i.headers=H0({},t.headers),e.headers&&H0(i.headers,e.headers),e.auth&&(i.auth=e.auth),e.ca&&(i.ca=e.ca),Zl.test(e[n||"target"].protocol)&&(i.rejectUnauthorized=typeof e.secure>"u"?!0:e.secure),i.agent=e.agent||!1,i.localAddress=e.localAddress,i.agent||(i.headers=i.headers||{},(typeof i.headers.connection!="string"||!g2.test(i.headers.connection))&&(i.headers.connection="close"));var s=e[n||"target"],r=s&&e.prependPath!==!1&&s.path||"",o=e.toProxy?t.url:m2.parse(t.url).path||"";return o=e.ignorePath?"":o,i.path=ni.urlJoin(r,o),e.changeOrigin&&(i.headers.host=v2(i.port,e[n||"target"].protocol)&&!x2(i.host)?i.host+":"+i.port:i.host),i};ni.setupSocket=function(i){return i.setTimeout(0),i.setNoDelay(!0),i.setKeepAlive(!0,0),i};ni.getPort=function(i){var e=i.headers.host?i.headers.host.match(/:(\d+)/):"";return e?e[1]:ni.hasEncryptedConnection(i)?"443":"80"};ni.hasEncryptedConnection=function(i){return!!(i.connection.encrypted||i.connection.pair)};ni.urlJoin=function(){var i=Array.prototype.slice.call(arguments),e=i.length-1,t=i[e],n=t.split("?"),s;return i[e]=n.shift(),s=[i.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")],s.push.apply(s,n),s.join("?")};ni.rewriteCookieProperty=function i(e,t,n){return Array.isArray(e)?e.map(function(s){return i(s,t,n)}):e.replace(new RegExp("(;\\s*"+n+"=)([^;]+)","i"),function(s,r,o){var a;if(o in t)a=t[o];else if("*"in t)a=t["*"];else return s;return a?r+a:""})};function x2(i){return!!~i.indexOf(":")}});var K0=T((iO,V0)=>{var $0=require("url"),W0=To(),y2=/^201|30(1|2|7|8)$/;V0.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,s){if((s.hostRewrite||s.autoRewrite||s.protocolRewrite)&&n.headers.location&&y2.test(n.statusCode)){var r=$0.parse(s.target),o=$0.parse(n.headers.location);if(r.host!=o.host)return;s.hostRewrite?o.host=s.hostRewrite:s.autoRewrite&&(o.host=e.headers.host),s.protocolRewrite&&(o.protocol=s.protocolRewrite),n.headers.location=o.format()}},writeHeaders:function(e,t,n,s){var r=s.cookieDomainRewrite,o=s.cookiePathRewrite,a=s.preserveHeaderKeyCase,l,p=function(_,E){E!=null&&(r&&_.toLowerCase()==="set-cookie"&&(E=W0.rewriteCookieProperty(E,r,"domain")),o&&_.toLowerCase()==="set-cookie"&&(E=W0.rewriteCookieProperty(E,o,"path")),t.setHeader(String(_).trim(),E))};if(typeof r=="string"&&(r={"*":r}),typeof o=="string"&&(o={"*":o}),a&&n.rawHeaders!=null){l={};for(var f=0;f<n.rawHeaders.length;f+=2){var v=n.rawHeaders[f];l[v.toLowerCase()]=v}}Object.keys(n.headers).forEach(function(_){var E=n.headers[_];a&&l&&(_=l[_]||_),p(_,E)})},writeStatusCode:function(e,t,n){n.statusMessage?(t.statusCode=n.statusCode,t.statusMessage=n.statusMessage):t.statusCode=n.statusCode}}});var Y0=T((nO,G0)=>{var bs;G0.exports=function(){if(!bs){try{bs=ie()("follow-redirects")}catch{}typeof bs!="function"&&(bs=function(){})}bs.apply(null,arguments)}});var ex=T((sO,uu)=>{var _s=require("url"),ws=_s.URL,b2=require("http"),w2=require("https"),nu=require("stream").Writable,su=require("assert"),J0=Y0();(function(){var e=typeof process<"u",t=typeof window<"u"&&typeof document<"u",n=qi(Error.captureStackTrace);!e&&(t||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var ru=!1;try{su(new ws(""))}catch(i){ru=i.code==="ERR_INVALID_URL"}var _2=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],ou=["abort","aborted","connect","error","socket","timeout"],au=Object.create(null);ou.forEach(function(i){au[i]=function(e,t,n){this._redirectable.emit(i,e,t,n)}});var eu=Ss("ERR_INVALID_URL","Invalid URL",TypeError),tu=Ss("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),S2=Ss("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",tu),E2=Ss("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),k2=Ss("ERR_STREAM_WRITE_AFTER_END","write after end"),C2=nu.prototype.destroy||Z0;function at(i,e){nu.call(this),this._sanitizeOptions(i),this._options=i,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(s){t.emit("error",s instanceof tu?s:new tu({cause:s}))}},this._performRequest()}at.prototype=Object.create(nu.prototype);at.prototype.abort=function(){lu(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};at.prototype.destroy=function(i){return lu(this._currentRequest,i),C2.call(this,i),this};at.prototype.write=function(i,e,t){if(this._ending)throw new k2;if(!Di(i)&&!O2(i))throw new TypeError("data should be a string, Buffer or Uint8Array");if(qi(e)&&(t=e,e=null),i.length===0){t&&t();return}this._requestBodyLength+i.length<=this._options.maxBodyLength?(this._requestBodyLength+=i.length,this._requestBodyBuffers.push({data:i,encoding:e}),this._currentRequest.write(i,e,t)):(this.emit("error",new E2),this.abort())};at.prototype.end=function(i,e,t){if(qi(i)?(t=i,i=e=null):qi(e)&&(t=e,e=null),!i)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var n=this,s=this._currentRequest;this.write(i,e,function(){n._ended=!0,s.end(null,null,t)}),this._ending=!0}};at.prototype.setHeader=function(i,e){this._options.headers[i]=e,this._currentRequest.setHeader(i,e)};at.prototype.removeHeader=function(i){delete this._options.headers[i],this._currentRequest.removeHeader(i)};at.prototype.setTimeout=function(i,e){var t=this;function n(o){o.setTimeout(i),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function s(o){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),r()},i),n(o)}function r(){t._timeout&&(clearTimeout(t._timeout),t._timeout=null),t.removeListener("abort",r),t.removeListener("error",r),t.removeListener("response",r),t.removeListener("close",r),e&&t.removeListener("timeout",e),t.socket||t._currentRequest.removeListener("socket",s)}return e&&this.on("timeout",e),this.socket?s(this.socket):this._currentRequest.once("socket",s),this.on("socket",n),this.on("abort",r),this.on("error",r),this.on("response",r),this.on("close",r),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(i){at.prototype[i]=function(e,t){return this._currentRequest[i](e,t)}});["aborted","connection","socket"].forEach(function(i){Object.defineProperty(at.prototype,i,{get:function(){return this._currentRequest[i]}})});at.prototype._sanitizeOptions=function(i){if(i.headers||(i.headers={}),i.host&&(i.hostname||(i.hostname=i.host),delete i.host),!i.pathname&&i.path){var e=i.path.indexOf("?");e<0?i.pathname=i.path:(i.pathname=i.path.substring(0,e),i.search=i.path.substring(e))}};at.prototype._performRequest=function(){var i=this._options.protocol,e=this._options.nativeProtocols[i];if(!e)throw new TypeError("Unsupported protocol "+i);if(this._options.agents){var t=i.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 s of ou)n.on(s,au[s]);if(this._currentUrl=/^\//.test(this._options.path)?_s.format(this._options):this._options.path,this._isRedirect){var r=0,o=this,a=this._requestBodyBuffers;(function l(p){if(n===o._currentRequest)if(p)o.emit("error",p);else if(r<a.length){var f=a[r++];n.finished||n.write(f.data,f.encoding,l)}else o._ended&&n.end()})()}};at.prototype._processResponse=function(i){var e=i.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:i.headers,statusCode:e});var t=i.headers.location;if(!t||this._options.followRedirects===!1||e<300||e>=400){i.responseUrl=this._currentUrl,i.redirects=this._redirects,this.emit("response",i),this._requestBodyBuffers=[];return}if(lu(this._currentRequest),i.destroy(),++this._redirectCount>this._options.maxRedirects)throw new S2;var n,s=this._options.beforeRedirect;s&&(n=Object.assign({Host:i.req.getHeader("host")},this._options.headers));var r=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=[],Ql(/^content-/i,this._options.headers));var o=Ql(/^host$/i,this._options.headers),a=cu(this._currentUrl),l=o||a.host,p=/^\w+:/.test(t)?this._currentUrl:_s.format(Object.assign(a,{host:l})),f=T2(t,p);if(J0("redirecting to",f.href),this._isRedirect=!0,iu(f,this._options),(f.protocol!==a.protocol&&f.protocol!=="https:"||f.host!==l&&!M2(f.host,l))&&Ql(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),qi(s)){var v={headers:i.headers,statusCode:e},_={url:p,method:r,headers:n};s(this._options,v,_),this._sanitizeOptions(this._options)}this._performRequest()};function X0(i){var e={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(i).forEach(function(n){var s=n+":",r=t[s]=i[n],o=e[n]=Object.create(r);function a(p,f,v){return A2(p)?p=iu(p):Di(p)?p=iu(cu(p)):(v=f,f=Q0(p),p={protocol:s}),qi(f)&&(v=f,f=null),f=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},p,f),f.nativeProtocols=t,!Di(f.host)&&!Di(f.hostname)&&(f.hostname="::1"),su.equal(f.protocol,s,"protocol mismatch"),J0("options",f),new at(f,v)}function l(p,f,v){var _=o.request(p,f,v);return _.end(),_}Object.defineProperties(o,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:l,configurable:!0,enumerable:!0,writable:!0}})}),e}function Z0(){}function cu(i){var e;if(ru)e=new ws(i);else if(e=Q0(_s.parse(i)),!Di(e.protocol))throw new eu({input:i});return e}function T2(i,e){return ru?new ws(i,e):cu(_s.resolve(e,i))}function Q0(i){if(/^\[/.test(i.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(i.hostname))throw new eu({input:i.href||i});if(/^\[/.test(i.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(i.host))throw new eu({input:i.href||i});return i}function iu(i,e){var t=e||{};for(var n of _2)t[n]=i[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 Ql(i,e){var t;for(var n in e)i.test(n)&&(t=e[n],delete e[n]);return t===null||typeof t>"u"?void 0:String(t).trim()}function Ss(i,e,t){function n(s){qi(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,s||{}),this.code=i,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 ["+i+"]",enumerable:!1}}),n}function lu(i,e){for(var t of ou)i.removeListener(t,au[t]);i.on("error",Z0),i.destroy(e)}function M2(i,e){su(Di(i)&&Di(e));var t=i.length-e.length-1;return t>0&&i[t]==="."&&i.endsWith(e)}function Di(i){return typeof i=="string"||i instanceof String}function qi(i){return typeof i=="function"}function O2(i){return typeof i=="object"&&"length"in i}function A2(i){return ws&&i instanceof ws}uu.exports=X0({http:b2,https:w2});uu.exports.wrap=X0});var ix=T((rO,tx)=>{var R2=require("http"),P2=require("https"),Es=K0(),Mo=To(),B2=ex();Es=Object.keys(Es).map(function(i){return Es[i]});var j2={http:R2,https:P2};tx.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 s=e.isSpdy||Mo.hasEncryptedConnection(e),r={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Mo.getPort(e),proto:s?"https":"http"};["for","port","proto"].forEach(function(o){e.headers["x-forwarded-"+o]=(e.headers["x-forwarded-"+o]||"")+(e.headers["x-forwarded-"+o]?",":"")+r[o]}),e.headers["x-forwarded-host"]=e.headers["x-forwarded-host"]||e.headers.host||""}},stream:function(e,t,n,s,r,o){r.emit("start",e,t,n.target||n.forward);var a=n.followRedirects?B2:j2,l=a.http,p=a.https;if(n.forward){var f=(n.forward.protocol==="https:"?p:l).request(Mo.setupOutgoing(n.ssl||{},n,e,"forward")),v=C(f,n.forward);if(e.on("error",v),f.on("error",v),(n.buffer||e).pipe(f),!n.target)return t.end()}var _=(n.target.protocol==="https:"?p:l).request(Mo.setupOutgoing(n.ssl||{},n,e));_.on("socket",function(k){r&&!_.getHeader("expect")&&r.emit("proxyReq",_,e,t,n)}),n.proxyTimeout&&_.setTimeout(n.proxyTimeout,function(){_.abort()}),e.on("aborted",function(){_.abort()});var E=C(_,n.target);e.on("error",E),_.on("error",E);function C(k,M){return function(A){if(e.socket.destroyed&&A.code==="ECONNRESET")return r.emit("econnreset",A,e,t,M),k.abort();o?o(A,e,t,M):r.emit("error",A,e,t,M)}}(n.buffer||e).pipe(_),_.on("response",function(k){if(r&&r.emit("proxyRes",k,e,t),!t.headersSent&&!n.selfHandleResponse)for(var M=0;M<Es.length&&!Es[M](e,t,k,n);M++);t.finished?r&&r.emit("end",e,t,k):(k.on("end",function(){r&&r.emit("end",e,t,k)}),n.selfHandleResponse||k.pipe(t))})}}});var sx=T((oO,nx)=>{var N2=require("http"),I2=require("https"),Ln=To();nx.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 s={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Ln.getPort(e),proto:Ln.hasEncryptedConnection(e)?"wss":"ws"};["for","port","proto"].forEach(function(r){e.headers["x-forwarded-"+r]=(e.headers["x-forwarded-"+r]||"")+(e.headers["x-forwarded-"+r]?",":"")+s[r]})}},stream:function(e,t,n,s,r,o){var a=function(f,v){return Object.keys(v).reduce(function(_,E){var C=v[E];if(!Array.isArray(C))return _.push(E+": "+C),_;for(var k=0;k<C.length;k++)_.push(E+": "+C[k]);return _},[f]).join(`\r
|
|
31
|
+
`);if(_===-1){_o("have not received end of HTTP headers yet..."),s();return}let E=m.slice(0,_).toString("ascii").split(`\r
|
|
32
|
+
`),k=E.shift();if(!k)return i.destroy(),t(new Error("No header received from proxy CONNECT response"));let T=k.split(" "),M=+T[1],O=T.slice(2).join(" "),A={};for(let D of E){if(!D)continue;let U=D.indexOf(":");if(U===-1)return i.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${D}"`));let te=D.slice(0,U).toLowerCase(),z=D.slice(U+1).trimStart(),re=A[te];typeof re=="string"?A[te]=[re,z]:Array.isArray(re)?re.push(z):A[te]=z}_o("got proxy server response: %o %o",k,A),o(),e({connect:{statusCode:M,statusText:O,headers:A},buffered:m})}i.on("error",l),i.on("end",a),s()})}Fn.parseProxyResponse=jC});var l0=C(Ot=>{"use strict";var NC=Ot&&Ot.__createBinding||(Object.create?(function(i,e,t,n){n===void 0&&(n=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,r)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),DC=Ot&&Ot.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),a0=Ot&&Ot.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&NC(e,i,t);return DC(e,i),e},c0=Ot&&Ot.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.HttpsProxyAgent=void 0;var So=a0(require("net")),r0=a0(require("tls")),IC=c0(require("assert")),qC=c0(se()),LC=i0(),FC=require("url"),UC=n0(),mr=(0,qC.default)("https-proxy-agent"),s0=i=>i.servername===void 0&&i.host&&!So.isIP(i.host)?{...i,servername:i.host}:i,Eo=class extends LC.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new FC.URL(e):e,this.proxyHeaders=t?.headers??{},mr("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),r=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?o0(t,"headers"):null,host:n,port:r}}async connect(e,t){let{proxy:n}=this;if(!t.host)throw new TypeError('No "host" provided');let r;n.protocol==="https:"?(mr("Creating `tls.Socket`: %o",this.connectOpts),r=r0.connect(s0(this.connectOpts))):(mr("Creating `net.Socket`: %o",this.connectOpts),r=So.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},o=So.isIPv6(t.host)?`[${t.host}]`:t.host,a=`CONNECT ${o}:${t.port} HTTP/1.1\r
|
|
33
|
+
`;if(n.username||n.password){let _=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(_).toString("base64")}`}s.Host=`${o}:${t.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let _ of Object.keys(s))a+=`${_}: ${s[_]}\r
|
|
34
|
+
`;let l=(0,UC.parseProxyResponse)(r);r.write(`${a}\r
|
|
35
|
+
`);let{connect:p,buffered:f}=await l;if(e.emit("proxyConnect",p),this.emit("proxyConnect",p,e),p.statusCode===200)return e.once("socket",HC),t.secureEndpoint?(mr("Upgrading socket connection to TLS"),r0.connect({...o0(s0(t),"host","path","port"),socket:r})):r;r.destroy();let m=new So.Socket({writable:!1});return m.readable=!0,e.once("socket",_=>{mr("Replaying proxy buffer for failed request"),(0,IC.default)(_.listenerCount("data")>0),_.push(f),_.push(null)}),m}};Eo.protocols=["http","https"];Ot.HttpsProxyAgent=Eo;function HC(i){i.resume()}function o0(i,...e){let t={},n;for(n in i)e.includes(n)||(t[n]=i[n]);return t}});var h0=C(($O,f0)=>{"use strict";var p0=require("url"),d0=require("https"),zC=Kl(),ko=zl(),$C=Vl(),mt=xo(),WC=Ul(),u0=2419200,Yl="",Jl;function vr(){}vr.prototype.setGCMAPIKey=function(i){if(i===null){Yl=null;return}if(typeof i>"u"||typeof i!="string"||i.length===0)throw new Error("The GCM API Key should be a non-empty string or null.");Yl=i};vr.prototype.setVapidDetails=function(i,e,t){if(arguments.length===1&&arguments[0]===null){Jl=null;return}ko.validateSubject(i),ko.validatePublicKey(e),ko.validatePrivateKey(t),Jl={subject:i,publicKey:e,privateKey:t}};vr.prototype.generateRequestDetails=function(i,e,t){if(!i||!i.endpoint)throw new Error("You must pass in a subscription with at least an endpoint.");if(typeof i.endpoint!="string"||i.endpoint.length===0)throw new Error("The subscription endpoint must be a string with a valid URL.");if(e&&(typeof i!="object"||!i.keys||!i.keys.p256dh||!i.keys.auth))throw new Error("To send a message with a payload, the subscription must have 'auth' and 'p256dh' keys.");let n=Yl,r=Jl,s=u0,o={},a=mt.supportedContentEncodings.AES_128_GCM,l=mt.supportedUrgency.NORMAL,p,f,m,_;if(t){let O=["headers","gcmAPIKey","vapidDetails","TTL","contentEncoding","urgency","topic","proxy","agent","timeout"],A=Object.keys(t);for(let D=0;D<A.length;D+=1){let U=A[D];if(!O.includes(U))throw new Error("'"+U+"' is an invalid option. The valid options are ['"+O.join("', '")+"'].")}if(t.headers){o=t.headers;let D=Object.keys(o).filter(function(U){return typeof t[U]<"u"});if(D.length>0)throw new Error("Duplicated headers defined ["+D.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&&(r=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===mt.supportedContentEncodings.AES_128_GCM||t.contentEncoding===mt.supportedContentEncodings.AES_GCM)a=t.contentEncoding;else throw new Error("Unsupported content encoding specified.");if(t.urgency)if(t.urgency===mt.supportedUrgency.VERY_LOW||t.urgency===mt.supportedUrgency.LOW||t.urgency===mt.supportedUrgency.NORMAL||t.urgency===mt.supportedUrgency.HIGH)l=t.urgency;else throw new Error("Unsupported urgency specified.");if(t.topic){if(!WC.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");p=t.topic}t.proxy&&(typeof t.proxy=="string"||typeof t.proxy.host=="string"?f=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 d0.Agent?(f&&console.warn("Agent option will be ignored because proxy option is defined."),m=t.agent):console.warn("Wrong type for the agent option, it should be an instance of https.Agent.")),typeof t.timeout=="number"&&(_=t.timeout)}typeof s>"u"&&(s=u0);let E={method:"POST",headers:{TTL:s}};Object.keys(o).forEach(function(O){E.headers[O]=o[O]});let k=null;if(e){let O=$C.encrypt(i.keys.p256dh,i.keys.auth,e,a);E.headers["Content-Length"]=O.cipherText.length,E.headers["Content-Type"]="application/octet-stream",a===mt.supportedContentEncodings.AES_128_GCM?E.headers["Content-Encoding"]=mt.supportedContentEncodings.AES_128_GCM:a===mt.supportedContentEncodings.AES_GCM&&(E.headers["Content-Encoding"]=mt.supportedContentEncodings.AES_GCM,E.headers.Encryption="salt="+O.salt,E.headers["Crypto-Key"]="dh="+O.localPublicKey.toString("base64url")),k=O.cipherText}else E.headers["Content-Length"]=0;let T=i.endpoint.startsWith("https://android.googleapis.com/gcm/send"),M=i.endpoint.startsWith("https://fcm.googleapis.com/fcm/send");if(T)n?E.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(r){let O=p0.parse(i.endpoint),A=O.protocol+"//"+O.host,D=ko.getVapidHeaders(A,r.subject,r.publicKey,r.privateKey,a);E.headers.Authorization=D.Authorization,a===mt.supportedContentEncodings.AES_GCM&&(E.headers["Crypto-Key"]?E.headers["Crypto-Key"]+=";"+D["Crypto-Key"]:E.headers["Crypto-Key"]=D["Crypto-Key"])}else M&&n&&(E.headers.Authorization="key="+n);return E.headers.Urgency=l,p&&(E.headers.Topic=p),E.body=k,E.endpoint=i.endpoint,f&&(E.proxy=f),m&&(E.agent=m),_&&(E.timeout=_),E};vr.prototype.sendNotification=function(i,e,t){let n;try{n=this.generateRequestDetails(i,e,t)}catch(r){return Promise.reject(r)}return new Promise(function(r,s){let o={},a=p0.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:p}=l0();o.agent=new p(n.proxy)}let l=d0.request(o,function(p){let f="";p.on("data",function(m){f+=m}),p.on("end",function(){p.statusCode<200||p.statusCode>299?s(new zC("Received unexpected response code",p.statusCode,p.headers,f,n.endpoint)):r({statusCode:p.statusCode,body:f,headers:p.headers})})});n.timeout&&l.on("timeout",function(){l.destroy(new Error("Socket timeout"))}),l.on("error",function(p){s(p)}),n.body&&l.write(n.body),l.end()})};f0.exports=vr});var g0=C((WO,v0)=>{"use strict";var m0=zl(),VC=Vl(),KC=h0(),GC=Kl(),YC=xo(),gr=new KC;v0.exports={WebPushError:GC,supportedContentEncodings:YC.supportedContentEncodings,encrypt:VC.encrypt,getVapidHeaders:m0.getVapidHeaders,generateVAPIDKeys:m0.generateVAPIDKeys,setGCMAPIKey:gr.setGCMAPIKey,setVapidDetails:gr.setVapidDetails,generateRequestDetails:gr.generateRequestDetails,sendNotification:gr.sendNotification.bind(gr)}});var lx=C((yA,ou)=>{"use strict";var g2=Object.prototype.hasOwnProperty,it="~";function Sr(){}Object.create&&(Sr.prototype=Object.create(null),new Sr().__proto__||(it=!1));function x2(i,e,t){this.fn=i,this.context=e,this.once=t||!1}function cx(i,e,t,n,r){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new x2(t,n||i,r),o=it?it+e:e;return i._events[o]?i._events[o].fn?i._events[o]=[i._events[o],s]:i._events[o].push(s):(i._events[o]=s,i._eventsCount++),i}function No(i,e){--i._eventsCount===0?i._events=new Sr:delete i._events[e]}function Ze(){this._events=new Sr,this._eventsCount=0}Ze.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)g2.call(t,n)&&e.push(it?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Ze.prototype.listeners=function(e){var t=it?it+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,o=new Array(s);r<s;r++)o[r]=n[r].fn;return o};Ze.prototype.listenerCount=function(e){var t=it?it+e:e,n=this._events[t];return n?n.fn?1:n.length:0};Ze.prototype.emit=function(e,t,n,r,s,o){var a=it?it+e:e;if(!this._events[a])return!1;var l=this._events[a],p=arguments.length,f,m;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),p){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,r),!0;case 5:return l.fn.call(l.context,t,n,r,s),!0;case 6:return l.fn.call(l.context,t,n,r,s,o),!0}for(m=1,f=new Array(p-1);m<p;m++)f[m-1]=arguments[m];l.fn.apply(l.context,f)}else{var _=l.length,E;for(m=0;m<_;m++)switch(l[m].once&&this.removeListener(e,l[m].fn,void 0,!0),p){case 1:l[m].fn.call(l[m].context);break;case 2:l[m].fn.call(l[m].context,t);break;case 3:l[m].fn.call(l[m].context,t,n);break;case 4:l[m].fn.call(l[m].context,t,n,r);break;default:if(!f)for(E=1,f=new Array(p-1);E<p;E++)f[E-1]=arguments[E];l[m].fn.apply(l[m].context,f)}}return!0};Ze.prototype.on=function(e,t,n){return cx(this,e,t,n,!1)};Ze.prototype.once=function(e,t,n){return cx(this,e,t,n,!0)};Ze.prototype.removeListener=function(e,t,n,r){var s=it?it+e:e;if(!this._events[s])return this;if(!t)return No(this,s),this;var o=this._events[s];if(o.fn)o.fn===t&&(!r||o.once)&&(!n||o.context===n)&&No(this,s);else{for(var a=0,l=[],p=o.length;a<p;a++)(o[a].fn!==t||r&&!o[a].once||n&&o[a].context!==n)&&l.push(o[a]);l.length?this._events[s]=l.length===1?l[0]:l:No(this,s)}return this};Ze.prototype.removeAllListeners=function(e){var t;return e?(t=it?it+e:e,this._events[t]&&No(this,t)):(this._events=new Sr,this._eventsCount=0),this};Ze.prototype.off=Ze.prototype.removeListener;Ze.prototype.addListener=Ze.prototype.on;Ze.prefixed=it;Ze.EventEmitter=Ze;typeof ou<"u"&&(ou.exports=Ze)});var px=C((bA,ux)=>{"use strict";ux.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 Do=C(fx=>{var si=fx,y2=require("url"),dx=require("util")._extend,b2=px(),w2=/(^|,)\s*upgrade\s*($|,)/i,au=/^https|wss/;si.isSSL=au;si.setupOutgoing=function(i,e,t,n){i.port=e[n||"target"].port||(au.test(e[n||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(a){i[a]=e[n||"target"][a]}),i.method=e.method||t.method,i.headers=dx({},t.headers),e.headers&&dx(i.headers,e.headers),e.auth&&(i.auth=e.auth),e.ca&&(i.ca=e.ca),au.test(e[n||"target"].protocol)&&(i.rejectUnauthorized=typeof e.secure>"u"?!0:e.secure),i.agent=e.agent||!1,i.localAddress=e.localAddress,i.agent||(i.headers=i.headers||{},(typeof i.headers.connection!="string"||!w2.test(i.headers.connection))&&(i.headers.connection="close"));var r=e[n||"target"],s=r&&e.prependPath!==!1&&r.path||"",o=e.toProxy?t.url:y2.parse(t.url).path||"";return o=e.ignorePath?"":o,i.path=si.urlJoin(s,o),e.changeOrigin&&(i.headers.host=b2(i.port,e[n||"target"].protocol)&&!_2(i.host)?i.host+":"+i.port:i.host),i};si.setupSocket=function(i){return i.setTimeout(0),i.setNoDelay(!0),i.setKeepAlive(!0,0),i};si.getPort=function(i){var e=i.headers.host?i.headers.host.match(/:(\d+)/):"";return e?e[1]:si.hasEncryptedConnection(i)?"443":"80"};si.hasEncryptedConnection=function(i){return!!(i.connection.encrypted||i.connection.pair)};si.urlJoin=function(){var i=Array.prototype.slice.call(arguments),e=i.length-1,t=i[e],n=t.split("?"),r;return i[e]=n.shift(),r=[i.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")],r.push.apply(r,n),r.join("?")};si.rewriteCookieProperty=function i(e,t,n){return Array.isArray(e)?e.map(function(r){return i(r,t,n)}):e.replace(new RegExp("(;\\s*"+n+"=)([^;]+)","i"),function(r,s,o){var a;if(o in t)a=t[o];else if("*"in t)a=t["*"];else return r;return a?s+a:""})};function _2(i){return!!~i.indexOf(":")}});var gx=C((_A,vx)=>{var hx=require("url"),mx=Do(),S2=/^201|30(1|2|7|8)$/;vx.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,r){if((r.hostRewrite||r.autoRewrite||r.protocolRewrite)&&n.headers.location&&S2.test(n.statusCode)){var s=hx.parse(r.target),o=hx.parse(n.headers.location);if(s.host!=o.host)return;r.hostRewrite?o.host=r.hostRewrite:r.autoRewrite&&(o.host=e.headers.host),r.protocolRewrite&&(o.protocol=r.protocolRewrite),n.headers.location=o.format()}},writeHeaders:function(e,t,n,r){var s=r.cookieDomainRewrite,o=r.cookiePathRewrite,a=r.preserveHeaderKeyCase,l,p=function(_,E){E!=null&&(s&&_.toLowerCase()==="set-cookie"&&(E=mx.rewriteCookieProperty(E,s,"domain")),o&&_.toLowerCase()==="set-cookie"&&(E=mx.rewriteCookieProperty(E,o,"path")),t.setHeader(String(_).trim(),E))};if(typeof s=="string"&&(s={"*":s}),typeof o=="string"&&(o={"*":o}),a&&n.rawHeaders!=null){l={};for(var f=0;f<n.rawHeaders.length;f+=2){var m=n.rawHeaders[f];l[m.toLowerCase()]=m}}Object.keys(n.headers).forEach(function(_){var E=n.headers[_];a&&l&&(_=l[_]||_),p(_,E)})},writeStatusCode:function(e,t,n){n.statusMessage?(t.statusCode=n.statusCode,t.statusMessage=n.statusMessage):t.statusCode=n.statusCode}}});var yx=C((SA,xx)=>{var Er;xx.exports=function(){if(!Er){try{Er=se()("follow-redirects")}catch{}typeof Er!="function"&&(Er=function(){})}Er.apply(null,arguments)}});var Ex=C((EA,yu)=>{var Cr=require("url"),kr=Cr.URL,E2=require("http"),k2=require("https"),du=require("stream").Writable,fu=require("assert"),bx=yx();(function(){var e=typeof process<"u",t=typeof window<"u"&&typeof document<"u",n=Ui(Error.captureStackTrace);!e&&(t||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var hu=!1;try{fu(new kr(""))}catch(i){hu=i.code==="ERR_INVALID_URL"}var C2=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],mu=["abort","aborted","connect","error","socket","timeout"],vu=Object.create(null);mu.forEach(function(i){vu[i]=function(e,t,n){this._redirectable.emit(i,e,t,n)}});var lu=Tr("ERR_INVALID_URL","Invalid URL",TypeError),uu=Tr("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),T2=Tr("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",uu),M2=Tr("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),O2=Tr("ERR_STREAM_WRITE_AFTER_END","write after end"),A2=du.prototype.destroy||_x;function ct(i,e){du.call(this),this._sanitizeOptions(i),this._options=i,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(r){t.emit("error",r instanceof uu?r:new uu({cause:r}))}},this._performRequest()}ct.prototype=Object.create(du.prototype);ct.prototype.abort=function(){xu(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};ct.prototype.destroy=function(i){return xu(this._currentRequest,i),A2.call(this,i),this};ct.prototype.write=function(i,e,t){if(this._ending)throw new O2;if(!Fi(i)&&!B2(i))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Ui(e)&&(t=e,e=null),i.length===0){t&&t();return}this._requestBodyLength+i.length<=this._options.maxBodyLength?(this._requestBodyLength+=i.length,this._requestBodyBuffers.push({data:i,encoding:e}),this._currentRequest.write(i,e,t)):(this.emit("error",new M2),this.abort())};ct.prototype.end=function(i,e,t){if(Ui(i)?(t=i,i=e=null):Ui(e)&&(t=e,e=null),!i)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var n=this,r=this._currentRequest;this.write(i,e,function(){n._ended=!0,r.end(null,null,t)}),this._ending=!0}};ct.prototype.setHeader=function(i,e){this._options.headers[i]=e,this._currentRequest.setHeader(i,e)};ct.prototype.removeHeader=function(i){delete this._options.headers[i],this._currentRequest.removeHeader(i)};ct.prototype.setTimeout=function(i,e){var t=this;function n(o){o.setTimeout(i),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function r(o){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),s()},i),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",r)}return e&&this.on("timeout",e),this.socket?r(this.socket):this._currentRequest.once("socket",r),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(i){ct.prototype[i]=function(e,t){return this._currentRequest[i](e,t)}});["aborted","connection","socket"].forEach(function(i){Object.defineProperty(ct.prototype,i,{get:function(){return this._currentRequest[i]}})});ct.prototype._sanitizeOptions=function(i){if(i.headers||(i.headers={}),i.host&&(i.hostname||(i.hostname=i.host),delete i.host),!i.pathname&&i.path){var e=i.path.indexOf("?");e<0?i.pathname=i.path:(i.pathname=i.path.substring(0,e),i.search=i.path.substring(e))}};ct.prototype._performRequest=function(){var i=this._options.protocol,e=this._options.nativeProtocols[i];if(!e)throw new TypeError("Unsupported protocol "+i);if(this._options.agents){var t=i.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 r of mu)n.on(r,vu[r]);if(this._currentUrl=/^\//.test(this._options.path)?Cr.format(this._options):this._options.path,this._isRedirect){var s=0,o=this,a=this._requestBodyBuffers;(function l(p){if(n===o._currentRequest)if(p)o.emit("error",p);else if(s<a.length){var f=a[s++];n.finished||n.write(f.data,f.encoding,l)}else o._ended&&n.end()})()}};ct.prototype._processResponse=function(i){var e=i.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:i.headers,statusCode:e});var t=i.headers.location;if(!t||this._options.followRedirects===!1||e<300||e>=400){i.responseUrl=this._currentUrl,i.redirects=this._redirects,this.emit("response",i),this._requestBodyBuffers=[];return}if(xu(this._currentRequest),i.destroy(),++this._redirectCount>this._options.maxRedirects)throw new T2;var n,r=this._options.beforeRedirect;r&&(n=Object.assign({Host:i.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=[],cu(/^content-/i,this._options.headers));var o=cu(/^host$/i,this._options.headers),a=gu(this._currentUrl),l=o||a.host,p=/^\w+:/.test(t)?this._currentUrl:Cr.format(Object.assign(a,{host:l})),f=R2(t,p);if(bx("redirecting to",f.href),this._isRedirect=!0,pu(f,this._options),(f.protocol!==a.protocol&&f.protocol!=="https:"||f.host!==l&&!P2(f.host,l))&&cu(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),Ui(r)){var m={headers:i.headers,statusCode:e},_={url:p,method:s,headers:n};r(this._options,m,_),this._sanitizeOptions(this._options)}this._performRequest()};function wx(i){var e={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(i).forEach(function(n){var r=n+":",s=t[r]=i[n],o=e[n]=Object.create(s);function a(p,f,m){return j2(p)?p=pu(p):Fi(p)?p=pu(gu(p)):(m=f,f=Sx(p),p={protocol:r}),Ui(f)&&(m=f,f=null),f=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},p,f),f.nativeProtocols=t,!Fi(f.host)&&!Fi(f.hostname)&&(f.hostname="::1"),fu.equal(f.protocol,r,"protocol mismatch"),bx("options",f),new ct(f,m)}function l(p,f,m){var _=o.request(p,f,m);return _.end(),_}Object.defineProperties(o,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:l,configurable:!0,enumerable:!0,writable:!0}})}),e}function _x(){}function gu(i){var e;if(hu)e=new kr(i);else if(e=Sx(Cr.parse(i)),!Fi(e.protocol))throw new lu({input:i});return e}function R2(i,e){return hu?new kr(i,e):gu(Cr.resolve(e,i))}function Sx(i){if(/^\[/.test(i.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(i.hostname))throw new lu({input:i.href||i});if(/^\[/.test(i.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(i.host))throw new lu({input:i.href||i});return i}function pu(i,e){var t=e||{};for(var n of C2)t[n]=i[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 cu(i,e){var t;for(var n in e)i.test(n)&&(t=e[n],delete e[n]);return t===null||typeof t>"u"?void 0:String(t).trim()}function Tr(i,e,t){function n(r){Ui(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,r||{}),this.code=i,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 ["+i+"]",enumerable:!1}}),n}function xu(i,e){for(var t of mu)i.removeListener(t,vu[t]);i.on("error",_x),i.destroy(e)}function P2(i,e){fu(Fi(i)&&Fi(e));var t=i.length-e.length-1;return t>0&&i[t]==="."&&i.endsWith(e)}function Fi(i){return typeof i=="string"||i instanceof String}function Ui(i){return typeof i=="function"}function B2(i){return typeof i=="object"&&"length"in i}function j2(i){return kr&&i instanceof kr}yu.exports=wx({http:E2,https:k2});yu.exports.wrap=wx});var Cx=C((kA,kx)=>{var N2=require("http"),D2=require("https"),Mr=gx(),Io=Do(),I2=Ex();Mr=Object.keys(Mr).map(function(i){return Mr[i]});var q2={http:N2,https:D2};kx.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 r=e.isSpdy||Io.hasEncryptedConnection(e),s={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Io.getPort(e),proto:r?"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,r,s,o){s.emit("start",e,t,n.target||n.forward);var a=n.followRedirects?I2:q2,l=a.http,p=a.https;if(n.forward){var f=(n.forward.protocol==="https:"?p:l).request(Io.setupOutgoing(n.ssl||{},n,e,"forward")),m=k(f,n.forward);if(e.on("error",m),f.on("error",m),(n.buffer||e).pipe(f),!n.target)return t.end()}var _=(n.target.protocol==="https:"?p:l).request(Io.setupOutgoing(n.ssl||{},n,e));_.on("socket",function(T){s&&!_.getHeader("expect")&&s.emit("proxyReq",_,e,t,n)}),n.proxyTimeout&&_.setTimeout(n.proxyTimeout,function(){_.abort()}),e.on("aborted",function(){_.abort()});var E=k(_,n.target);e.on("error",E),_.on("error",E);function k(T,M){return function(A){if(e.socket.destroyed&&A.code==="ECONNRESET")return s.emit("econnreset",A,e,t,M),T.abort();o?o(A,e,t,M):s.emit("error",A,e,t,M)}}(n.buffer||e).pipe(_),_.on("response",function(T){if(s&&s.emit("proxyRes",T,e,t),!t.headersSent&&!n.selfHandleResponse)for(var M=0;M<Mr.length&&!Mr[M](e,t,T,n);M++);t.finished?s&&s.emit("end",e,t,T):(T.on("end",function(){s&&s.emit("end",e,t,T)}),n.selfHandleResponse||T.pipe(t))})}}});var Mx=C((CA,Tx)=>{var L2=require("http"),F2=require("https"),$n=Do();Tx.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 r={for:e.connection.remoteAddress||e.socket.remoteAddress,port:$n.getPort(e),proto:$n.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]?",":"")+r[s]})}},stream:function(e,t,n,r,s,o){var a=function(f,m){return Object.keys(m).reduce(function(_,E){var k=m[E];if(!Array.isArray(k))return _.push(E+": "+k),_;for(var T=0;T<k.length;T++)_.push(E+": "+k[T]);return _},[f]).join(`\r
|
|
36
36
|
`)+`\r
|
|
37
37
|
\r
|
|
38
|
-
`};Ln.setupSocket(t),s&&s.length&&t.unshift(s);var l=(Ln.isSSL.test(n.target.protocol)?I2:N2).request(Ln.setupOutgoing(n.ssl||{},n,e));return r&&r.emit("proxyReqWs",l,e,t,n,s),l.on("error",p),l.on("response",function(f){f.upgrade||(t.write(a("HTTP/"+f.httpVersion+" "+f.statusCode+" "+f.statusMessage,f.headers)),f.pipe(t))}),l.on("upgrade",function(f,v,_){v.on("error",p),v.on("end",function(){r.emit("close",f,v,_)}),t.on("error",function(){v.end()}),Ln.setupSocket(v),_&&_.length&&v.unshift(_),t.write(a("HTTP/1.1 101 Switching Protocols",f.headers)),v.pipe(t).pipe(v),r.emit("open",v),r.emit("proxySocket",v)}),l.end();function p(f){o?o(f,e,t):r.emit("error",f,e,t),t.end()}}}});var px=T((aO,ux)=>{var cx=ux.exports,rx=require("util")._extend,D2=require("url").parse,lx=L0(),q2=require("http"),L2=require("https"),ox=ix(),ax=sx();cx.Server=Li;function pu(i){return function(e){return function(t,n){var s=i==="ws"?this.wsPasses:this.webPasses,r=[].slice.call(arguments),o=r.length-1,a,l;typeof r[o]=="function"&&(l=r[o],o--);var p=e;if(!(r[o]instanceof Buffer)&&r[o]!==n&&(p=rx({},e),rx(p,r[o]),o--),r[o]instanceof Buffer&&(a=r[o]),["target","forward"].forEach(function(v){typeof p[v]=="string"&&(p[v]=D2(p[v]))}),!p.target&&!p.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var f=0;f<s.length&&!s[f](t,n,p,a,this,l);f++);}}}cx.createRightProxy=pu;function Li(i){lx.call(this),i=i||{},i.prependPath=i.prependPath!==!1,this.web=this.proxyRequest=pu("web")(i),this.ws=this.proxyWebsocketRequest=pu("ws")(i),this.options=i,this.webPasses=Object.keys(ox).map(function(e){return ox[e]}),this.wsPasses=Object.keys(ax).map(function(e){return ax[e]}),this.on("error",this.onError,this)}require("util").inherits(Li,lx);Li.prototype.onError=function(i){if(this.listeners("error").length===1)throw i};Li.prototype.listen=function(i,e){var t=this,n=function(s,r){t.web(s,r)};return this._server=this.options.ssl?L2.createServer(this.options.ssl,n):q2.createServer(n),this.options.ws&&this._server.on("upgrade",function(s,r,o){t.ws(s,r,o)}),this._server.listen(i,e),this};Li.prototype.close=function(i){var e=this;this._server&&this._server.close(t);function t(){e._server=null,i&&i.apply(null,arguments)}};Li.prototype.before=function(i,e,t){if(i!=="ws"&&i!=="web")throw new Error("type must be `web` or `ws`");var n=i==="ws"?this.wsPasses:this.webPasses,s=!1;if(n.forEach(function(r,o){r.name===e&&(s=o)}),s===!1)throw new Error("No such pass");n.splice(s,0,t)};Li.prototype.after=function(i,e,t){if(i!=="ws"&&i!=="web")throw new Error("type must be `web` or `ws`");var n=i==="ws"?this.wsPasses:this.webPasses,s=!1;if(n.forEach(function(r,o){r.name===e&&(s=o)}),s===!1)throw new Error("No such pass");n.splice(s++,0,t)}});var fx=T((cO,dx)=>{var ks=px().Server;function du(i){return new ks(i)}ks.createProxyServer=du;ks.createServer=du;ks.createProxy=du;dx.exports=ks});var mx=T((lO,hx)=>{hx.exports=fx()});var J2={};bi(J2,{startServer:()=>Rx});module.exports=Dx(J2);var Tx=require("http"),Mx=require("url"),Ox=require("child_process");var Ch=F(kh(),1),{Server:Th,Namespace:ST,Socket:ET}=Ch.default;var Gl=F(require("node-pty"),1),v0=F(Gc(),1);var fi=null;function OS(){return process.env.CODESPACES==="true"||process.env.GITPOD_WORKSPACE_ID||process.platform==="linux"&&!process.env.DISPLAY}async function hm(){if(fi!==null)return fi;if(OS())return fi=!1,console.log("\u2705 Remote desktop not available (headless environment)"),fi;try{let i=await import("@hurdlegroup/robotjs");(i.default||i).getScreenSize(),fi=!0}catch{fi=!1,console.log("\u2705 Remote desktop not available (no display or robotjs not installed)")}return fi}function mm(){return fi===!0}async function vm(i){let e=null,t=null,n=null,s=null,r=null,o=null,a=null,l=async()=>{if(e)return!0;try{let k=await import("@hurdlegroup/robotjs");e=k.default||k;let{TileManager:M}=await Promise.resolve().then(()=>(nm(),im)),{ResourceManager:O}=await Promise.resolve().then(()=>(rm(),sm)),{ScreenUpdateHelper:A}=await Promise.resolve().then(()=>(am(),om)),{MouseHandler:N}=await Promise.resolve().then(()=>(lm(),cm)),{KeyboardHandler:U}=await Promise.resolve().then(()=>(pm(),um)),{ScreenHandler:We}=await Promise.resolve().then(()=>(fm(),dm));return t=M,n=O,s=A,r=N,o=U,a=We,e.setMouseDelay(2),e.setKeyboardDelay(2),!0}catch(k){return console.error("\u274C Failed to load remote modules:",k.message),!1}},p=i.of("/remote"),f=null,v=null,_=null,E=null,C=null;p.on("connection",async k=>{let M=k.handshake.auth?.apiKey;if(!M){console.log("\u274C Remote connection rejected: no apiKey"),k.disconnect();return}if(console.log("\u{1F5A5}\uFE0F Remote client connected:",k.id),!await l()){k.emit("error",{message:"Remote desktop not available"}),k.disconnect();return}f||(f=new n,v=new s(f),_=new r(e,f),E=new o(e,f),C=new a(f,v),f.startResourceMonitoring()),k.isAuthenticated=!0;let A=new t(e);f.addClient(k.id,{tileManager:A,screenInterval:null,authenticated:!0,apiKey:M});let N=U=>U;_.setupMouseHandlers(k,N),E.setupKeyboardHandlers(k,N),C.setupScreenHandlers(k,N),k.on("disconnect",()=>{console.log("\u{1F5A5}\uFE0F Remote client disconnected:",k.id),f.removeClient(k.id)})})}var il=F(require("net"),1),wt=F(require("fs"),1),Pi=F(require("path"),1),ym=F(require("os"),1),bm=require("child_process"),wm=require("url"),Lr=Pi.default.dirname((0,wm.fileURLToPath)(__importMetaUrl)),yn=Pi.default.join(ym.default.homedir(),".9remote"),Dr=process.platform==="win32"?"\\\\.\\pipe\\9remote-pty":Pi.default.join(yn,"pty-daemon.sock"),gm=Pi.default.join(Lr,"ptyDaemon.js"),xm=Pi.default.join(Lr,"ptyDaemon.cjs"),Ut=null,xn=!1,hi=!1,tl="",AS=0,bn=new Map,qr=new Map;function RS(){return++AS}function Fr(i,e){qr.has(i)||qr.set(i,[]),qr.get(i).push(e)}function ss(i,e){let t=qr.get(i);if(t)for(let n of t)try{n(e)}catch(s){console.error(`[DaemonClient] Error in ${i} handler:`,s)}}function nl(i){if(!Ut||!xn)return!1;try{return Ut.write(JSON.stringify(i)+`
|
|
39
|
-
`),!0}catch(e){return console.error("[DaemonClient] Send error:",e),!1}}function
|
|
40
|
-
`);
|
|
38
|
+
`};$n.setupSocket(t),r&&r.length&&t.unshift(r);var l=($n.isSSL.test(n.target.protocol)?F2:L2).request($n.setupOutgoing(n.ssl||{},n,e));return s&&s.emit("proxyReqWs",l,e,t,n,r),l.on("error",p),l.on("response",function(f){f.upgrade||(t.write(a("HTTP/"+f.httpVersion+" "+f.statusCode+" "+f.statusMessage,f.headers)),f.pipe(t))}),l.on("upgrade",function(f,m,_){m.on("error",p),m.on("end",function(){s.emit("close",f,m,_)}),t.on("error",function(){m.end()}),$n.setupSocket(m),_&&_.length&&m.unshift(_),t.write(a("HTTP/1.1 101 Switching Protocols",f.headers)),m.pipe(t).pipe(m),s.emit("open",m),s.emit("proxySocket",m)}),l.end();function p(f){o?o(f,e,t):s.emit("error",f,e,t),t.end()}}}});var Nx=C((TA,jx)=>{var Px=jx.exports,Ox=require("util")._extend,U2=require("url").parse,Bx=lx(),H2=require("http"),z2=require("https"),Ax=Cx(),Rx=Mx();Px.Server=Hi;function bu(i){return function(e){return function(t,n){var r=i==="ws"?this.wsPasses:this.webPasses,s=[].slice.call(arguments),o=s.length-1,a,l;typeof s[o]=="function"&&(l=s[o],o--);var p=e;if(!(s[o]instanceof Buffer)&&s[o]!==n&&(p=Ox({},e),Ox(p,s[o]),o--),s[o]instanceof Buffer&&(a=s[o]),["target","forward"].forEach(function(m){typeof p[m]=="string"&&(p[m]=U2(p[m]))}),!p.target&&!p.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var f=0;f<r.length&&!r[f](t,n,p,a,this,l);f++);}}}Px.createRightProxy=bu;function Hi(i){Bx.call(this),i=i||{},i.prependPath=i.prependPath!==!1,this.web=this.proxyRequest=bu("web")(i),this.ws=this.proxyWebsocketRequest=bu("ws")(i),this.options=i,this.webPasses=Object.keys(Ax).map(function(e){return Ax[e]}),this.wsPasses=Object.keys(Rx).map(function(e){return Rx[e]}),this.on("error",this.onError,this)}require("util").inherits(Hi,Bx);Hi.prototype.onError=function(i){if(this.listeners("error").length===1)throw i};Hi.prototype.listen=function(i,e){var t=this,n=function(r,s){t.web(r,s)};return this._server=this.options.ssl?z2.createServer(this.options.ssl,n):H2.createServer(n),this.options.ws&&this._server.on("upgrade",function(r,s,o){t.ws(r,s,o)}),this._server.listen(i,e),this};Hi.prototype.close=function(i){var e=this;this._server&&this._server.close(t);function t(){e._server=null,i&&i.apply(null,arguments)}};Hi.prototype.before=function(i,e,t){if(i!=="ws"&&i!=="web")throw new Error("type must be `web` or `ws`");var n=i==="ws"?this.wsPasses:this.webPasses,r=!1;if(n.forEach(function(s,o){s.name===e&&(r=o)}),r===!1)throw new Error("No such pass");n.splice(r,0,t)};Hi.prototype.after=function(i,e,t){if(i!=="ws"&&i!=="web")throw new Error("type must be `web` or `ws`");var n=i==="ws"?this.wsPasses:this.webPasses,r=!1;if(n.forEach(function(s,o){s.name===e&&(r=o)}),r===!1)throw new Error("No such pass");n.splice(r++,0,t)}});var Ix=C((MA,Dx)=>{var Or=Nx().Server;function wu(i){return new Or(i)}Or.createProxyServer=wu;Or.createServer=wu;Or.createProxy=wu;Dx.exports=Or});var Lx=C((OA,qx)=>{qx.exports=Ix()});var eT={};Si(eT,{startServer:()=>ty});module.exports=ay(eT);var Xx=require("http"),Zx=require("url"),Qx=require("child_process");var Nh=L(jh(),1),{Server:Dh,Namespace:TM,Socket:MM}=Nh.default;var K0=require("fs"),G0=require("path"),Y0=require("os");var nu=L(require("node-pty"),1),I0=L(nl(),1);var um=L(require("node:url"),1),pm=L(require("node:path"),1),dm=L(require("node:module"),1),XS=um.default.fileURLToPath(__importMetaUrl),qM=pm.default.dirname(XS),ZS=dm.default.createRequire(__importMetaUrl),Z=ZS("../../../build/Release/node_datachannel.node");var hm=L(require("stream"),1),QS=Object.defineProperty,eE=(i,e,t)=>e in i?QS(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,fm=(i,e,t)=>eE(i,typeof e!="symbol"?e+"":e,t),Ls=class extends hm.Duplex{constructor(e,t){super({allowHalfOpen:!1,...t,objectMode:!0}),fm(this,"_rawChannel"),fm(this,"_readActive"),this._rawChannel=e,this._readActive=!0,e.onMessage(n=>{this._readActive&&(this._readActive=this.push(n))}),e.onClosed(()=>{this.push(null),this.destroy()}),e.onError(n=>{this.destroy(new Error(`DataChannel error: ${n}`))}),e.isOpen()||(this.cork(),e.onOpen(()=>this.uncork()))}_read(){this._readActive=!0}_write(e,t,n){let r;try{if(Buffer.isBuffer(e))r=this._rawChannel.sendMessageBinary(e);else if(typeof e=="string")r=this._rawChannel.sendMessage(e);else{let s=e.constructor.name||typeof e;throw new Error(`Cannot write ${s} to DataChannel stream`)}}catch(s){return n(s)}n(r?null:new Error("Failed to write to DataChannel"))}_final(e){this.allowHalfOpen||this.destroy(),e(null)}_destroy(e,t){this._rawChannel.close(),t(e)}get label(){return this._rawChannel.getLabel()}get id(){return this._rawChannel.getId()}get protocol(){return this._rawChannel.getProtocol()}};var gm=require("events");var xm=i=>{throw TypeError(i)},ym=(i,e,t)=>e.has(i)||xm("Cannot "+t),bn=(i,e,t)=>(ym(i,e,"read from private field"),t?t.call(i):e.get(i)),mm=(i,e,t)=>e.has(i)?xm("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),vm=(i,e,t,n)=>(ym(i,e,"write to private field"),e.set(i,t),t),mi,Fs,Us=class extends gm.EventEmitter{constructor(e){super(),mm(this,mi),mm(this,Fs,[]),vm(this,mi,new Z.WebSocketServer(e)),bn(this,mi).onClient(t=>{this.emit("client",t),bn(this,Fs).push(t)})}port(){return bn(this,mi)?.port()||0}stop(){bn(this,Fs).forEach(e=>{e?.close()}),bn(this,mi)?.stop(),vm(this,mi,null),this.removeAllListeners()}onClient(e){bn(this,mi)&&this.on("client",e)}};mi=new WeakMap;Fs=new WeakMap;var bm=Z.WebSocket;function tE(){Z.preload()}function iE(i){Z.initLogger(i)}function nE(){Z.cleanup()}function rE(i){Z.setSctpSettings(i)}function sE(){return Z.getLibraryVersion()}var oE=Z.Audio,aE=Z.Video,cE=Z.Track,lE=Z.DataChannel,uE=Z.PeerConnection,pE=Z.IceUdpMuxListener,dE=Z.RtpPacketizationConfig,fE=Z.PacingHandler,hE=Z.RtcpReceivingSession,mE=Z.RtcpNackResponder,vE=Z.RtcpSrReporter,gE=Z.RtpPacketizer,xE=Z.H264RtpPacketizer,yE=Z.H265RtpPacketizer,bE=Z.AV1RtpPacketizer,wE=Ls,wm={initLogger:iE,cleanup:nE,preload:tE,setSctpSettings:rE,getLibraryVersion:sE,PacingHandler:fE,RtcpReceivingSession:hE,RtcpNackResponder:mE,RtcpSrReporter:vE,RtpPacketizationConfig:dE,RtpPacketizer:gE,H264RtpPacketizer:xE,H265RtpPacketizer:yE,AV1RtpPacketizer:bE,Track:cE,Video:aE,Audio:oE,DataChannel:lE,PeerConnection:uE,WebSocket:bm,WebSocketServer:Us,DataChannelStream:wE,IceUdpMuxListener:pE};var{PeerConnection:_E}=wm,SE=65536,EE="https://9remote.cc/api/webrtc/turn-credentials",kE=1380*60*1e3,CE=[{hostname:"stun.cloudflare.com",port:3478,type:"Stun"}];async function TE(i){try{let e=await fetch(EE,{headers:{"X-API-Key":i}});if(!e.ok)throw new Error(`HTTP ${e.status}`);let{iceServers:t}=await e.json(),n=[];for(let r of t)for(let s of r.urls)if(s.startsWith("stun:")){let o=s.replace("stun:","").split(":")[0],a=parseInt(s.split(":")[2]||"3478");n.push({hostname:o,port:a,type:"Stun"})}else if(s.startsWith("turn:")||s.startsWith("turns:")){let o=s.startsWith("turns:"),l=s.replace(/^turns?:/,"").split("?")[0],p=l.split(":")[0],f=parseInt(l.split(":")[1]||(o?"5349":"3478")),m=s.includes("transport=tcp")?"Tcp":"Udp";n.push({hostname:p,port:f,type:o?"Tls":"Turn",relayType:m,username:r.username,password:r.credential})}return n}catch(e){return console.error("[WebRTC] Failed to fetch TURN credentials:",e.message),null}}var Hs=class{constructor(){this.peers=new Map,this.iceServers=CE,this.apiKey=null,this._refreshTimer=null}async init(e){this.apiKey=e,await this._refreshTurnCredentials()}async _refreshTurnCredentials(){if(!this.apiKey)return;let e=await TE(this.apiKey);e?.length&&(this.iceServers=e,console.log(`[WebRTC] TURN credentials loaded (${e.length} servers)`)),clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(()=>this._refreshTurnCredentials(),kE)}createPeer(e){this.closePeer(e);let t=new _E(`peer-${e}`,{iceServers:this.iceServers});return t.onDataChannel(n=>{n.onOpen(()=>{let r=this.peers.get(e);r&&(r.dc=n),console.log(`[WebRTC] DataChannel open [${e.slice(0,6)}]`)}),n.onClosed(()=>{let r=this.peers.get(e);r&&(r.dc=null)}),n.onError(r=>console.error(`[WebRTC] DC error [${e.slice(0,6)}]:`,r))}),this.peers.set(e,{pc:t,dc:null}),{pc:t}}async processOffer(e,t){let n=this.peers.get(e);if(!n)throw new Error("No peer for socket "+e);let{pc:r}=n;return new Promise((s,o)=>{r.onLocalDescription((a,l)=>{l==="answer"&&s(a)});try{r.setRemoteDescription(t,"offer"),r.setLocalDescription()}catch(a){o(a)}setTimeout(()=>o(new Error("Answer timeout")),1e4)})}addIceCandidate(e,t,n){let r=this.peers.get(e);if(r)try{r.pc.addRemoteCandidate(t,n)}catch(s){console.error("[WebRTC] addRemoteCandidate error:",s.message)}}sendTile(e,t){let n=this.peers.get(e);if(!n?.dc)return!1;try{return t.length>SE?(console.warn(`[WebRTC] tile too large (${t.length}B), skipping DC \u2192 WS fallback`),!1):(n.dc.sendMessageBinary(t),!0)}catch(r){return console.error(`[WebRTC] sendTile error [${e.slice(0,6)}]:`,r.message),!1}}isReady(e){return!!this.peers.get(e)?.dc}closePeer(e){let t=this.peers.get(e);if(t){try{t.pc.close()}catch{}this.peers.delete(e)}}closeAll(){clearTimeout(this._refreshTimer);for(let e of this.peers.keys())this.closePeer(e)}};wn();var{enableWebRTC:Ws,enableTurn:RE}=Ke.webrtc,ii=Ws?new Hs:null,vi=null;function PE(){return process.env.CODESPACES==="true"||process.env.GITPOD_WORKSPACE_ID||process.platform==="linux"&&!process.env.DISPLAY}async function Nm(){if(vi!==null)return vi;if(PE())return vi=!1,console.log("\u2705 Remote desktop not available (headless environment)"),vi;try{let i=await import("@hurdlegroup/robotjs");(i.default||i).getScreenSize(),vi=!0}catch{vi=!1,console.log("\u2705 Remote desktop not available (no display or robotjs not installed)")}return vi}function Dm(){return vi===!0}async function Im(i,e){if(Ws&&ii){let M=RE?e:null;ii.init(M).catch(O=>console.error("[WebRTC] init error:",O.message))}let t=null,n=null,r=null,s=null,o=null,a=null,l=null,p=async()=>{if(t)return!0;try{let M=await import("@hurdlegroup/robotjs");t=M.default||M;let{TileManager:O}=await Promise.resolve().then(()=>(Em(),Sm)),{ResourceManager:A}=await Promise.resolve().then(()=>(Cm(),km)),{ScreenUpdateHelper:D}=await Promise.resolve().then(()=>(Mm(),Tm)),{MouseHandler:U}=await Promise.resolve().then(()=>(Am(),Om)),{KeyboardHandler:te}=await Promise.resolve().then(()=>(Pm(),Rm)),{ScreenHandler:z}=await Promise.resolve().then(()=>(jm(),Bm));return n=O,r=A,s=D,o=U,a=te,l=z,t.setMouseDelay(2),t.setKeyboardDelay(2),!0}catch(M){return console.error("\u274C Failed to load remote modules:",M.message),!1}},f=i.of("/remote"),m=null,_=null,E=null,k=null,T=null;f.on("connection",async M=>{let O=M.handshake.auth?.apiKey;if(!O){console.log("\u274C Remote connection rejected: no apiKey"),M.disconnect();return}if(console.log("\u{1F5A5}\uFE0F Remote client connected:",M.id),!await p()){M.emit("error",{message:"Remote desktop not available"}),M.disconnect();return}m||(m=new r,_=new s(m),E=new o(t,m),k=new a(t,m),T=new l(m,_,ii),m.startResourceMonitoring()),M.isAuthenticated=!0;let D=new n(t);m.addClient(M.id,{tileManager:D,screenInterval:null,authenticated:!0,apiKey:O});let U=te=>te;E.setupMouseHandlers(M,U),k.setupKeyboardHandlers(M,U),T.setupScreenHandlers(M,U),Ws&&ii&&(M.on("webrtc:offer",async({sdp:te})=>{try{let{pc:z}=ii.createPeer(M.id);z.onLocalCandidate((H,ae)=>{H&&M.emit("webrtc:ice-candidate",{candidate:H,mid:ae})});let re=await ii.processOffer(M.id,te);M.emit("webrtc:answer",{sdp:re})}catch(z){console.error("[WebRTC] offer error:",z.message),M.emit("webrtc:error",{message:z.message})}}),M.on("webrtc:ice-candidate",({candidate:te,mid:z})=>{ii.addIceCandidate(M.id,te,z||"0")})),M.on("disconnect",()=>{console.log("\u{1F5A5}\uFE0F Remote client disconnected:",M.id),m.removeClient(M.id),Ws&&ii&&ii.closePeer(M.id)})})}var pl=L(require("net"),1),_t=L(require("fs"),1),Ni=L(require("path"),1),Fm=L(require("os"),1),Um=require("child_process"),Hm=require("url"),Gs=Ni.default.dirname((0,Hm.fileURLToPath)(__importMetaUrl)),En=Ni.default.join(Fm.default.homedir(),".9remote"),Vs=process.platform==="win32"?"\\\\.\\pipe\\9remote-pty":Ni.default.join(En,"pty-daemon.sock"),qm=Ni.default.join(Gs,"ptyDaemon.js"),Lm=Ni.default.join(Gs,"ptyDaemon.cjs"),Ht=null,Sn=!1,gi=!1,ul="",BE=0,kn=new Map,Ks=new Map;function jE(){return++BE}function Ys(i,e){Ks.has(i)||Ks.set(i,[]),Ks.get(i).push(e)}function cr(i,e){let t=Ks.get(i);if(t)for(let n of t)try{n(e)}catch(r){console.error(`[DaemonClient] Error in ${i} handler:`,r)}}function dl(i){if(!Ht||!Sn)return!1;try{return Ht.write(JSON.stringify(i)+`
|
|
39
|
+
`),!0}catch(e){return console.error("[DaemonClient] Send error:",e),!1}}function lr(i,e=5e3){return new Promise((t,n)=>{let r=jE();i.requestId=r;let s=setTimeout(()=>{kn.delete(r),n(new Error("Request timeout"))},e);kn.set(r,{resolve:t,reject:n,timer:s}),dl(i)||(clearTimeout(s),kn.delete(r),n(new Error("Not connected to daemon")))})}function NE(i){let{type:e,requestId:t,...n}=i;if(t&&kn.has(t)){let{resolve:r,timer:s}=kn.get(t);clearTimeout(s),kn.delete(t),r({type:e,...n});return}switch(e){case"output":cr("output",{sessionId:n.sessionId,data:Buffer.from(n.data,"base64")});break;case"sessionClosed":cr("sessionClosed",n.sessionId);break;case"sessionRenamed":cr("sessionRenamed",{sessionId:n.sessionId,name:n.name});break;case"pong":break;default:console.log("[DaemonClient] Unknown message:",e)}}function zm(){return new Promise(i=>{let e=pl.default.connect(Vs),t=setTimeout(()=>{e.destroy(),i(!1)},1e3);e.on("connect",()=>{clearTimeout(t),e.destroy(),i(!0)}),e.on("error",()=>{if(clearTimeout(t),process.platform!=="win32"&&_t.default.existsSync(Vs))try{_t.default.unlinkSync(Vs)}catch{}i(!1)})})}function DE(){return _t.default.existsSync(En)||_t.default.mkdirSync(En,{recursive:!0}),_t.default.existsSync(qm)?{script:qm,cwd:Gs}:_t.default.existsSync(Lm)?{script:Lm,cwd:Gs}:(console.error("[DaemonClient] \u274C Daemon script not found"),null)}async function IE(){if(!_t.default.existsSync(En))try{_t.default.mkdirSync(En,{recursive:!0})}catch(o){return console.error("[DaemonClient] Failed to create socket directory:",o.message),!1}let i=DE();if(!i)return!1;let{script:e,cwd:t}=i,n=Ni.default.join(En,"daemon.log"),r;try{r=_t.default.openSync(n,"w")}catch(o){console.error("[DaemonClient] Failed to open log file:",o.message),r="ignore"}if((0,Um.spawn)("node",[e],{detached:!0,stdio:["ignore",r,r],cwd:t}).unref(),typeof r=="number")try{_t.default.closeSync(r)}catch{}for(let o=0;o<20;o++)if(await new Promise(a=>setTimeout(a,100)),await zm())return!0;console.error("[DaemonClient] \u274C Failed to start daemon");try{let o=_t.default.readFileSync(n,"utf8");o.trim()&&(console.error("[DaemonClient] Daemon log:"),console.error(o))}catch{}return!1}async function $m(){if(!(Sn||gi)){gi=!0;try{return!await zm()&&!await IE()?(console.error("[DaemonClient] \u274C Failed to start daemon"),gi=!1,!1):new Promise(i=>{let e=setTimeout(()=>{console.error("[DaemonClient] \u274C Connection timeout after 5s"),Ht&&Ht.destroy(),gi=!1,i(!1)},5e3);Ht=pl.default.connect(Vs),Ht.on("connect",()=>{clearTimeout(e),Sn=!0,gi=!1,cr("connected"),i(!0)}),Ht.on("data",t=>{ul+=t.toString();let n=ul.split(`
|
|
40
|
+
`);ul=n.pop()||"";for(let r of n)if(r.trim())try{NE(JSON.parse(r))}catch{console.error("[DaemonClient] Invalid message:",r)}}),Ht.on("close",()=>{Sn=!1,Ht=null,cr("disconnected"),setTimeout(()=>{!Sn&&!gi&&$m()},2e3)}),Ht.on("error",t=>{clearTimeout(e),console.error("[DaemonClient] \u274C Connection error:",t.message),console.error("[DaemonClient] Error code:",t.code),gi=!1,i(!1)})})}catch(i){return console.error("[DaemonClient] \u274C Connect error:",i),gi=!1,!1}}}async function Wm(){return $m()}function ni(){return Sn}async function Vm(){return(await lr({type:"listSessions"})).sessions||[]}async function Km(i,e=80,t=24){let n=`session-${Date.now()}`;return await lr({type:"createSession",sessionId:n,name:i,cols:e,rows:t})}async function Gm(i){return await lr({type:"joinSession",sessionId:i})}function fl(i,e){return dl({type:"input",sessionId:i,data:e})}function Ym(i,e,t){return dl({type:"resize",sessionId:i,cols:e,rows:t})}async function Jm(i){return await lr({type:"deleteSession",sessionId:i})}async function Xm(i,e){return await lr({type:"renameSession",sessionId:i,name:e})}var Js=L(require("os"),1),Ge=L(require("fs"),1),Tn=L(require("path"),1);function Xs(){return Tn.default.join(Js.default.homedir(),".claude","settings.json")}function Zs(){return Tn.default.join(Js.default.homedir(),".codex","config.toml")}function Qs(){return Tn.default.join(Js.default.homedir(),".gemini","settings.json")}function Cn(i){try{if(Ge.default.existsSync(i))return JSON.parse(Ge.default.readFileSync(i,"utf8"))}catch{}return{}}function eo(i,e){let t=Tn.default.dirname(i);Ge.default.existsSync(t)||Ge.default.mkdirSync(t,{recursive:!0}),Ge.default.writeFileSync(i,JSON.stringify(e,null,2),"utf8")}function LE(){let i=Xs(),e=Cn(i),t='curl -s "http://localhost:2208/api/notify?type=stop&sessionId=$NINE_REMOTE_SESSION_ID&tool=claude" > /dev/null 2>&1';return e.hooks={...e.hooks,Stop:[{matcher:"",hooks:[{type:"command",command:t}]}]},eo(i,e),{success:!0}}function FE(){let i=Xs(),e=Cn(i);return e.hooks&&(delete e.hooks.Stop,delete e.hooks.Notification,Object.keys(e.hooks).length===0&&delete e.hooks),eo(i,e),{success:!0}}function UE(){let i=Zs(),e=Tn.default.dirname(i);Ge.default.existsSync(e)||Ge.default.mkdirSync(e,{recursive:!0});let t='curl -s "http://localhost:2208/api/notify?type=stop&sessionId=$NINE_REMOTE_SESSION_ID&tool=codex" > /dev/null 2>&1',n="";return Ge.default.existsSync(i)&&(n=Ge.default.readFileSync(i,"utf8"),n=n.replace(/\n?# 9Remote notification\nnotify\s*=.*\n?/g,"")),n+=`
|
|
41
41
|
# 9Remote notification
|
|
42
42
|
notify = ["bash", "-c", "${t}"]
|
|
43
|
-
`,Ve.default.writeFileSync(i,n,"utf8"),{success:!0}}function LS(){let i=zr();if(!Ve.default.existsSync(i))return{success:!0};let e=Ve.default.readFileSync(i,"utf8");return e=e.replace(/\n?# 9Remote notification\nnotify\s*=.*\n?/g,""),Ve.default.writeFileSync(i,e,"utf8"),{success:!0}}function FS(){let i=$r(),e=wn(i),t='curl -s "http://localhost:2208/api/notify?type=stop&sessionId=$NINE_REMOTE_SESSION_ID&tool=gemini" > /dev/null 2>&1',n='curl -s "http://localhost:2208/api/notify?type=notification&sessionId=$NINE_REMOTE_SESSION_ID&tool=gemini" > /dev/null 2>&1';return e.hooks={...e.hooks,enabled:!0,AfterAgent:[{matcher:"",hooks:[{type:"command",command:t}]}],Notification:[{matcher:"",hooks:[{type:"command",command:n}]}]},e.tools||(e.tools={}),e.tools.enableHooks=!0,Wr(i,e),{success:!0}}function US(){let i=$r(),e=wn(i);return e.hooks&&(delete e.hooks.AfterAgent,delete e.hooks.Notification,delete e.hooks.enabled,Object.keys(e.hooks).length===0&&delete e.hooks),Wr(i,e),{success:!0}}function HS(i){switch(i){case"claude":{let e=wn(Hr());return!!(e.hooks?.Stop||e.hooks?.Notification)}case"codex":{let e=zr();return Ve.default.existsSync(e)?Ve.default.readFileSync(e,"utf8").includes("# 9Remote notification"):!1}case"gemini":{let e=wn($r());return!!(e.hooks?.AfterAgent||e.hooks?.Notification)}default:return!1}}function zS(i){let e={claude:Hr().replace("/settings.json",""),codex:zr().replace("/config.toml",""),gemini:$r().replace("/settings.json","")};return Ve.default.existsSync(e[i])}function Rm(i){switch(i){case"claude":return IS();case"codex":return qS();case"gemini":return FS();default:return{success:!1,error:"Unknown tool"}}}function Pm(i){switch(i){case"claude":return DS();case"codex":return LS();case"gemini":return US();default:return{success:!1,error:"Unknown tool"}}}function Bm(){let i=["claude","codex","gemini"],e={};for(let t of i)e[t]={installed:zS(t),enabled:HS(t)};return e}var Hl=F(require("os"),1),It=F(require("fs"),1),hs=F(require("path"),1),go=F(Jg(),1),xo=hs.default.join(Hl.default.homedir(),".9remote","vapid.json"),yo=hs.default.join(Hl.default.homedir(),".9remote","push-subscriptions.json"),CM=1800*1e3,ot=[];function Kk(){try{if(It.default.existsSync(xo))return JSON.parse(It.default.readFileSync(xo,"utf8"))}catch{}return null}function Gk(i){let e=hs.default.dirname(xo);It.default.existsSync(e)||It.default.mkdirSync(e,{recursive:!0}),It.default.writeFileSync(xo,JSON.stringify(i,null,2),"utf8")}function Yk(){let i=Kk();if(!i){let e=go.default.generateVAPIDKeys();i={publicKey:e.publicKey,privateKey:e.privateKey},Gk(i)}return go.default.setVapidDetails("mailto:admin@9remote.cc",i.publicKey,i.privateKey),i}function Jk(){try{It.default.existsSync(yo)&&(ot=JSON.parse(It.default.readFileSync(yo,"utf8")))}catch{ot=[]}}function ms(){try{let i=hs.default.dirname(yo);It.default.existsSync(i)||It.default.mkdirSync(i,{recursive:!0}),It.default.writeFileSync(yo,JSON.stringify(ot,null,2),"utf8")}catch(i){console.error("Failed to save push subscriptions:",i.message)}}function Xg(i,e){ot=ot.filter(t=>t.endpoint!==i.endpoint),ot.push({...i,socketId:e,lastConnectedAt:Date.now()}),ms()}function Zg(i){ot=ot.filter(e=>e.endpoint!==i),ms()}function Qg(i){for(let e of ot)e.socketId===i&&(e.disconnectedAt=Date.now());ms()}function e0(i,e){for(let t of ot)t.endpoint===e&&(t.socketId=i,t.disconnectedAt=null,t.lastConnectedAt=Date.now());ms()}async function t0(i){let t={claude:"Claude",codex:"Codex",gemini:"Gemini"}[i.tool]||"AI";console.log(`\u{1F514} Sending push notification: ${i.type} ${t}`);let n=JSON.stringify({title:i.type==="stop"?`${t} \u2705`:`${t} \u{1F514}`,body:i.type==="stop"?`${t} completed the task`:`${t} needs your input`,data:{url:"/workspace",type:i.type}}),s=[],r=ot.reduce((a,l)=>(a?.lastConnectedAt??0)>=(l?.lastConnectedAt??0)?a:l,null),o=r?[r]:[];console.log(`\u{1F4E4} sendPush: total=${ot.length} target=${o.length>0?r.endpoint.slice(0,50)+"...":"none"}`);for(let a of o)try{await go.default.sendNotification({endpoint:a.endpoint,keys:a.keys},n),console.log(` \u2705 Push sent to ${a.endpoint.slice(0,50)}...`)}catch(l){console.log(` \u274C Push failed: ${l.statusCode} ${l.message}`),(l.statusCode===410||l.statusCode===404)&&s.push(a.endpoint)}s.length>0&&(ot=ot.filter(a=>!s.includes(a.endpoint)),ms())}var Xk=Yk();Jk();function i0(){return Xk.publicKey}var gi=F(require("fs"),1),zl=F(require("path"),1),bo=0,vs=null,Zk=6e4,Qk={name:"9Remote",postCreateCommand:"npm install -g 9remote@latest",postAttachCommand:"9remote start",forwardPorts:[2208],portsAttributes:{2208:{label:"9Remote Server",onAutoForward:"notify"}}};function xi(){return process.env.CODESPACES==="true"}function n0(){return xi()?{isCodespaces:!0,codespaceName:process.env.CODESPACE_NAME||"unknown",workspacePath:process.env.CODESPACE_VSCODE_FOLDER||process.cwd()}:null}function s0(){bo++,xi()&&bo===1&&e2()}function r0(){bo--,xi()&&bo===0&&t2()}function e2(){vs||(vs=setInterval(()=>{process.memoryUsage()},Zk))}function t2(){vs&&(console.log("\u23F8\uFE0F Stopping Codespaces heartbeat"),clearInterval(vs),vs=null)}function o0(i){return zl.default.join(i,".devcontainer","devcontainer.json")}function a0(i){try{let e=o0(i);if(!gi.default.existsSync(e))return{enabled:!1,exists:!1};let t=JSON.parse(gi.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 c0(i,e){try{let t=zl.default.join(i,".devcontainer"),n=o0(i);gi.default.existsSync(t)||gi.default.mkdirSync(t,{recursive:!0});let s={...Qk};if(gi.default.existsSync(n))try{s={...JSON.parse(gi.default.readFileSync(n,"utf8"))}}catch{}return e?(s.postAttachCommand="9remote start",s.postCreateCommand||(s.postCreateCommand="npm install -g 9remote@latest")):delete s.postAttachCommand,gi.default.writeFileSync(n,JSON.stringify(s,null,2)),{success:!0,enabled:e}}catch(t){return{success:!1,error:t.message}}}var In=F(require("os"),1),Ye=F(require("fs"),1),Ii=F(require("path"),1),Dn=Ii.default.join(In.default.homedir(),".9remote","buffers"),wo=Ii.default.join(In.default.homedir(),".9remote","sessions.json"),_o="/tmp/9remote-uploads";Ye.default.existsSync(_o)||Ye.default.mkdirSync(_o,{recursive:!0});function So(){return process.platform==="win32"?process.env.COMSPEC||"powershell.exe":process.env.SHELL||"/bin/zsh"}function $l(i){return i?"/workspaces":In.default.homedir()}function Wl(){let i=In.default.homedir(),e=In.default.userInfo().username,t=So(),n={...process.env};if(Object.assign(n,{HOME:i,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:i,OLDPWD:i,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 s=n.PROMPT_COMMAND||"";n.PROMPT_COMMAND=`printf "\\e]7;file://%s\\a" "\${HOSTNAME}\${PWD}"${s?`; ${s}`:""}`}return n}function l0(){Ye.default.existsSync(Dn)||Ye.default.mkdirSync(Dn,{recursive:!0})}function gs(i,e,t){if(t==="buffer"){l0();try{Ye.default.writeFileSync(Ii.default.join(Dn,`${i}.buf`),e.join(""),"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to save buffer for ${i}:`,n.message)}}}function u0(i,e){if(e!=="buffer")return null;let t=Ii.default.join(Dn,`${i}.buf`);try{if(Ye.default.existsSync(t))return Ye.default.readFileSync(t,"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to load buffer for ${i}:`,n.message)}return null}function Eo(i){let e=Ii.default.join(Dn,`${i}.buf`);try{Ye.default.existsSync(e)&&Ye.default.unlinkSync(e)}catch{}}function p0(){l0();try{return Ye.default.readdirSync(Dn).filter(i=>i.endsWith(".buf")).map(i=>i.replace(".buf",""))}catch{return[]}}function d0(){try{if(Ye.default.existsSync(wo))return JSON.parse(Ye.default.readFileSync(wo,"utf8"))}catch(i){console.log("\u26A0\uFE0F Failed to load session metadata:",i.message)}return{}}function Vl(i){try{let e={};for(let[n,s]of i)e[n]={name:s.name,createdAt:s.createdAt};let t=Ii.default.dirname(wo);Ye.default.existsSync(t)||Ye.default.mkdirSync(t,{recursive:!0}),Ye.default.writeFileSync(wo,JSON.stringify(e,null,2),"utf8")}catch(e){console.log("\u26A0\uFE0F Failed to save session metadata:",e.message)}}var Kl={};function f0(i,e){Kl[i]=e}function h0(i){delete Kl[i]}function m0(){return{...Kl}}var g0=F(require("fs"),1),x0=F(require("path"),1),i2=v0.default.rgb(230,138,110),ee=new Map,Ot="daemon";async function y0(){if(Ot==="daemon")if(!await Em())console.error("\u274C Failed to connect to PTY daemon, falling back to buffer mode");else{let n=await km();for(let r of n)ee.set(r.id,{daemon:!0,name:r.name,createdAt:r.createdAt});let s=n.length;console.log(i2(s>0?`\u2705 Connected to daemon with ${s} session(s)`:"\u2705 Connected to PTY daemon"));return}console.log("\u{1F4E6} Buffer persistence mode - scrollback enabled");let i=p0(),e=d0();for(let t of i){let n=e[t]||{};ee.set(t,{pty:null,name:n.name||`Terminal ${ee.size+1}`,createdAt:n.createdAt||Date.now(),buffer:[],needsRestore:!0}),console.log(`\u{1F504} Found saved session: ${t}`)}i.length>0&&console.log(`\u2705 Found ${i.length} saved session(s)`)}function b0(i){Ot==="daemon"&&(Fr("output",({sessionId:e,data:t})=>i.emit("output",{sessionId:e,data:t})),Fr("sessionClosed",e=>{ee.delete(e),i.emit("sessionClosed",e)}),Fr("sessionRenamed",({sessionId:e,name:t})=>{let n=ee.get(e);n&&(n.name=t),i.emit("session-renamed",{sessionId:e,name:t})})),i.on("connection",e=>{console.log(`\u{1F4DF} Terminal client connected: ${e.id}`),s0(),e.on("getNotificationState",()=>{e.emit("notificationState",m0())}),e.emit("serverInfo",{remoteAvailable:mm(),daemonMode:Ot==="daemon"&&ti(),platform:process.platform,...n0()}),e.on("getSessions",t=>{let n=[];for(let[s,r]of ee)n.push({id:s,name:r.name,createdAt:r.createdAt,restored:r.restored||!1});t(n)}),e.on("createSession",async({name:t},n)=>{let s=`session-${Date.now()}`,r=Wl();r.NINE_REMOTE_SESSION_ID=s;let o=$l(xi());try{if(Ot==="daemon"&&ti()){let E=await Cm(t,80,24);E.success?(ee.set(E.sessionId,{daemon:!0,name:t||`Terminal ${ee.size+1}`,createdAt:Date.now(),cwd:E.cwd}),n({success:!0,sessionId:E.sessionId})):n({success:!1,error:E.error});return}let a=So(),l=process.platform==="win32"?[]:["-l"],p=Gl.default.spawn(a,l,{name:"xterm-256color",cols:80,rows:24,cwd:o,env:r,useConpty:!1}),f={pty:p,name:t||`Terminal ${ee.size+1}`,createdAt:Date.now(),buffer:[],cwd:o},v=50*1024,_=null;p.onData(E=>{f.buffer.push(E);let C=f.buffer.reduce((k,M)=>k+M.length,0);for(;C>v&&f.buffer.length>1;)C-=f.buffer.shift().length;i.emit("output",{sessionId:s,data:Buffer.from(E,"utf-8")}),Ot==="buffer"&&(_&&clearTimeout(_),_=setTimeout(()=>gs(s,f.buffer,Ot),2e3))}),p.onExit(({exitCode:E})=>{console.log(`PTY exited: sessionId=${s}, code=${E}`),Ot==="buffer"&&f.buffer.length>0&&gs(s,f.buffer,Ot),ee.delete(s),Eo(s),i.emit("sessionClosed",s)}),console.log(`PTY created: sessionId=${s}, name=${t}`),ee.set(s,f),n({success:!0,sessionId:s})}catch(a){console.error("Failed to create session:",a),n({success:!1,error:a.message})}}),e.on("joinSession",async(t,n)=>{let s=ee.get(t);if(!s)return n({success:!1,error:"Session not found"});if(s.daemon&&ti()){try{let r=await Tm(t);n({success:r.success,name:r.name,cwd:r.cwd,error:r.error})}catch(r){n({success:!1,error:r.message})}return}if(s.needsRestore&&Ot==="buffer")try{let r=So(),o=process.platform==="win32"?[]:["-l"],a=$l(xi()),l=Gl.default.spawn(r,o,{name:"xterm-256color",cols:80,rows:24,cwd:a,env:Wl(),useConpty:!1});s.pty=l,s.needsRestore=!1,s.cwd=a;let p=u0(t,Ot);p&&(s.buffer=[p]);let f=50*1024,v=null;l.onData(_=>{s.buffer.push(_);let E=s.buffer.reduce((C,k)=>C+k.length,0);for(;E>f&&s.buffer.length>1;)E-=s.buffer.shift().length;i.emit("output",{sessionId:t,data:Buffer.from(_,"utf-8")}),v&&clearTimeout(v),v=setTimeout(()=>gs(t,s.buffer,Ot),2e3)}),l.onExit(({exitCode:_})=>{console.log(`PTY exited: sessionId=${t}, code=${_}`),s.buffer.length>0&&gs(t,s.buffer,Ot),ee.delete(t),Eo(t),i.emit("sessionClosed",t)}),console.log(`\u2705 Restored PTY session: ${t}`)}catch(r){return console.error("Failed to restore session:",r),n({success:!1,error:"Failed to restore session"})}s.buffer?.length>0&&e.emit("output",{sessionId:t,data:Buffer.from(s.buffer.join(""),"utf-8")}),n({success:!0,name:s.name,cwd:s.cwd})}),e.on("input",({sessionId:t,data:n})=>{if(!t)return;let s=ee.get(t);if(s){if(s.daemon&&ti())return sl(t,n);s.pty&&s.pty.write(Buffer.isBuffer(n)?n.toString("utf-8"):n)}}),e.on("upload-file",({sessionId:t,filename:n,size:s,content:r})=>{if(!t)return;let o=ee.get(t);if(o)try{let a=n.replace(/[^a-zA-Z0-9._-]/g,"_"),l=x0.default.join(_o,`${Date.now()}_${a}`);g0.default.writeFileSync(l,Buffer.from(r,"base64")),console.log(`\u{1F4CE} File uploaded: ${l} (${s} bytes)`),o.daemon&&ti()?sl(t,l):o.pty&&o.pty.write(l)}catch(a){console.error("File upload error:",a),e.emit("output",{sessionId:t,data:Buffer.from(`\r
|
|
43
|
+
`,Ge.default.writeFileSync(i,n,"utf8"),{success:!0}}function HE(){let i=Zs();if(!Ge.default.existsSync(i))return{success:!0};let e=Ge.default.readFileSync(i,"utf8");return e=e.replace(/\n?# 9Remote notification\nnotify\s*=.*\n?/g,""),Ge.default.writeFileSync(i,e,"utf8"),{success:!0}}function zE(){let i=Qs(),e=Cn(i),t='curl -s "http://localhost:2208/api/notify?type=stop&sessionId=$NINE_REMOTE_SESSION_ID&tool=gemini" > /dev/null 2>&1',n='curl -s "http://localhost:2208/api/notify?type=notification&sessionId=$NINE_REMOTE_SESSION_ID&tool=gemini" > /dev/null 2>&1';return e.hooks={...e.hooks,enabled:!0,AfterAgent:[{matcher:"",hooks:[{type:"command",command:t}]}],Notification:[{matcher:"",hooks:[{type:"command",command:n}]}]},e.tools||(e.tools={}),e.tools.enableHooks=!0,eo(i,e),{success:!0}}function $E(){let i=Qs(),e=Cn(i);return e.hooks&&(delete e.hooks.AfterAgent,delete e.hooks.Notification,delete e.hooks.enabled,Object.keys(e.hooks).length===0&&delete e.hooks),eo(i,e),{success:!0}}function WE(i){switch(i){case"claude":{let e=Cn(Xs());return!!(e.hooks?.Stop||e.hooks?.Notification)}case"codex":{let e=Zs();return Ge.default.existsSync(e)?Ge.default.readFileSync(e,"utf8").includes("# 9Remote notification"):!1}case"gemini":{let e=Cn(Qs());return!!(e.hooks?.AfterAgent||e.hooks?.Notification)}default:return!1}}function VE(i){let e={claude:Xs().replace("/settings.json",""),codex:Zs().replace("/config.toml",""),gemini:Qs().replace("/settings.json","")};return Ge.default.existsSync(e[i])}function Zm(i){switch(i){case"claude":return LE();case"codex":return UE();case"gemini":return zE();default:return{success:!1,error:"Unknown tool"}}}function Qm(i){switch(i){case"claude":return FE();case"codex":return HE();case"gemini":return $E();default:return{success:!1,error:"Unknown tool"}}}function ev(){let i=["claude","codex","gemini"],e={};for(let t of i)e[t]={installed:VE(t),enabled:WE(t)};return e}var Xl=L(require("os"),1),It=L(require("fs"),1),xr=L(require("path"),1),Co=L(g0(),1),To=xr.default.join(Xl.default.homedir(),".9remote","vapid.json"),Mo=xr.default.join(Xl.default.homedir(),".9remote","push-subscriptions.json"),VO=1800*1e3,at=[];function JC(){try{if(It.default.existsSync(To))return JSON.parse(It.default.readFileSync(To,"utf8"))}catch{}return null}function XC(i){let e=xr.default.dirname(To);It.default.existsSync(e)||It.default.mkdirSync(e,{recursive:!0}),It.default.writeFileSync(To,JSON.stringify(i,null,2),"utf8")}function ZC(){let i=JC();if(!i){let e=Co.default.generateVAPIDKeys();i={publicKey:e.publicKey,privateKey:e.privateKey},XC(i)}return Co.default.setVapidDetails("mailto:admin@9remote.cc",i.publicKey,i.privateKey),i}function QC(){try{It.default.existsSync(Mo)&&(at=JSON.parse(It.default.readFileSync(Mo,"utf8")))}catch{at=[]}}function yr(){try{let i=xr.default.dirname(Mo);It.default.existsSync(i)||It.default.mkdirSync(i,{recursive:!0}),It.default.writeFileSync(Mo,JSON.stringify(at,null,2),"utf8")}catch(i){console.error("Failed to save push subscriptions:",i.message)}}function x0(i,e){at=at.filter(t=>t.endpoint!==i.endpoint),at.push({...i,socketId:e,lastConnectedAt:Date.now()}),yr()}function y0(i){at=at.filter(e=>e.endpoint!==i),yr()}function b0(i){for(let e of at)e.socketId===i&&(e.disconnectedAt=Date.now());yr()}function w0(i,e){for(let t of at)t.endpoint===e&&(t.socketId=i,t.disconnectedAt=null,t.lastConnectedAt=Date.now());yr()}async function _0(i){let t={claude:"Claude",codex:"Codex",gemini:"Gemini"}[i.tool]||"AI";console.log(`\u{1F514} Sending push notification: ${i.type} ${t}`);let n=JSON.stringify({title:i.type==="stop"?`${t} \u2705`:`${t} \u{1F514}`,body:i.type==="stop"?`${t} completed the task`:`${t} needs your input`,data:{url:"/workspace",type:i.type}}),r=[],s=at.reduce((a,l)=>(a?.lastConnectedAt??0)>=(l?.lastConnectedAt??0)?a:l,null),o=s?[s]:[];console.log(`\u{1F4E4} sendPush: total=${at.length} target=${o.length>0?s.endpoint.slice(0,50)+"...":"none"}`);for(let a of o)try{await Co.default.sendNotification({endpoint:a.endpoint,keys:a.keys},n),console.log(` \u2705 Push sent to ${a.endpoint.slice(0,50)}...`)}catch(l){console.log(` \u274C Push failed: ${l.statusCode} ${l.message}`),(l.statusCode===410||l.statusCode===404)&&r.push(a.endpoint)}r.length>0&&(at=at.filter(a=>!r.includes(a.endpoint)),yr())}var e2=ZC();QC();function S0(){return e2.publicKey}var bi=L(require("fs"),1),Zl=L(require("path"),1),Oo=0,br=null,t2=6e4,i2={name:"9Remote",postCreateCommand:"npm install -g 9remote@latest",postAttachCommand:"9remote start",forwardPorts:[2208],portsAttributes:{2208:{label:"9Remote Server",onAutoForward:"notify"}}};function wi(){return process.env.CODESPACES==="true"}function E0(){return wi()?{isCodespaces:!0,codespaceName:process.env.CODESPACE_NAME||"unknown",workspacePath:process.env.CODESPACE_VSCODE_FOLDER||process.cwd()}:null}function k0(){Oo++,wi()&&Oo===1&&n2()}function C0(){Oo--,wi()&&Oo===0&&r2()}function n2(){br||(br=setInterval(()=>{process.memoryUsage()},t2))}function r2(){br&&(console.log("\u23F8\uFE0F Stopping Codespaces heartbeat"),clearInterval(br),br=null)}function T0(i){return Zl.default.join(i,".devcontainer","devcontainer.json")}function M0(i){try{let e=T0(i);if(!bi.default.existsSync(e))return{enabled:!1,exists:!1};let t=JSON.parse(bi.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 O0(i,e){try{let t=Zl.default.join(i,".devcontainer"),n=T0(i);bi.default.existsSync(t)||bi.default.mkdirSync(t,{recursive:!0});let r={...i2};if(bi.default.existsSync(n))try{r={...JSON.parse(bi.default.readFileSync(n,"utf8"))}}catch{}return e?(r.postAttachCommand="9remote start",r.postCreateCommand||(r.postCreateCommand="npm install -g 9remote@latest")):delete r.postAttachCommand,bi.default.writeFileSync(n,JSON.stringify(r,null,2)),{success:!0,enabled:e}}catch(t){return{success:!1,error:t.message}}}var Un=L(require("os"),1),Xe=L(require("fs"),1),Li=L(require("path"),1),Hn=Li.default.join(Un.default.homedir(),".9remote","buffers"),Ao=Li.default.join(Un.default.homedir(),".9remote","sessions.json"),Ro="/tmp/9remote-uploads";Xe.default.existsSync(Ro)||Xe.default.mkdirSync(Ro,{recursive:!0});function Po(){return process.platform==="win32"?process.env.COMSPEC||"powershell.exe":process.env.SHELL||"/bin/zsh"}function Ql(i){return i?"/workspaces":Un.default.homedir()}function eu(){let i=Un.default.homedir(),e=Un.default.userInfo().username,t=Po(),n={...process.env};if(Object.assign(n,{HOME:i,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:i,OLDPWD:i,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 r=n.PROMPT_COMMAND||"";n.PROMPT_COMMAND=`printf "\\e]7;file://%s\\a" "\${HOSTNAME}\${PWD}"${r?`; ${r}`:""}`}return n}function A0(){Xe.default.existsSync(Hn)||Xe.default.mkdirSync(Hn,{recursive:!0})}function wr(i,e,t){if(t==="buffer"){A0();try{Xe.default.writeFileSync(Li.default.join(Hn,`${i}.buf`),e.join(""),"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to save buffer for ${i}:`,n.message)}}}function R0(i,e){if(e!=="buffer")return null;let t=Li.default.join(Hn,`${i}.buf`);try{if(Xe.default.existsSync(t))return Xe.default.readFileSync(t,"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to load buffer for ${i}:`,n.message)}return null}function Bo(i){let e=Li.default.join(Hn,`${i}.buf`);try{Xe.default.existsSync(e)&&Xe.default.unlinkSync(e)}catch{}}function P0(){A0();try{return Xe.default.readdirSync(Hn).filter(i=>i.endsWith(".buf")).map(i=>i.replace(".buf",""))}catch{return[]}}function B0(){try{if(Xe.default.existsSync(Ao))return JSON.parse(Xe.default.readFileSync(Ao,"utf8"))}catch(i){console.log("\u26A0\uFE0F Failed to load session metadata:",i.message)}return{}}function tu(i){try{let e={};for(let[n,r]of i)e[n]={name:r.name,createdAt:r.createdAt};let t=Li.default.dirname(Ao);Xe.default.existsSync(t)||Xe.default.mkdirSync(t,{recursive:!0}),Xe.default.writeFileSync(Ao,JSON.stringify(e,null,2),"utf8")}catch(e){console.log("\u26A0\uFE0F Failed to save session metadata:",e.message)}}var iu={};function j0(i,e){iu[i]=e}function N0(i){delete iu[i]}function D0(){return{...iu}}var q0=L(require("fs"),1),L0=L(require("path"),1),s2=I0.default.rgb(230,138,110),ne=new Map,At="daemon";async function F0(){if(At==="daemon")if(!await Wm())console.error("\u274C Failed to connect to PTY daemon, falling back to buffer mode");else{let n=await Vm();for(let s of n)ne.set(s.id,{daemon:!0,name:s.name,createdAt:s.createdAt});let r=n.length;console.log(s2(r>0?`\u2705 Connected to daemon with ${r} session(s)`:"\u2705 Connected to PTY daemon"));return}console.log("\u{1F4E6} Buffer persistence mode - scrollback enabled");let i=P0(),e=B0();for(let t of i){let n=e[t]||{};ne.set(t,{pty:null,name:n.name||`Terminal ${ne.size+1}`,createdAt:n.createdAt||Date.now(),buffer:[],needsRestore:!0}),console.log(`\u{1F504} Found saved session: ${t}`)}i.length>0&&console.log(`\u2705 Found ${i.length} saved session(s)`)}function U0(i){At==="daemon"&&(Ys("output",({sessionId:e,data:t})=>i.emit("output",{sessionId:e,data:t})),Ys("sessionClosed",e=>{ne.delete(e),i.emit("sessionClosed",e)}),Ys("sessionRenamed",({sessionId:e,name:t})=>{let n=ne.get(e);n&&(n.name=t),i.emit("session-renamed",{sessionId:e,name:t})})),i.on("connection",e=>{console.log(`\u{1F4DF} Terminal client connected: ${e.id}`),k0(),e.on("getNotificationState",()=>{e.emit("notificationState",D0())}),e.emit("serverInfo",{remoteAvailable:Dm(),daemonMode:At==="daemon"&&ni(),platform:process.platform,...E0()}),e.on("getSessions",t=>{let n=[];for(let[r,s]of ne)n.push({id:r,name:s.name,createdAt:s.createdAt,restored:s.restored||!1});t(n)}),e.on("createSession",async({name:t},n)=>{let r=`session-${Date.now()}`,s=eu();s.NINE_REMOTE_SESSION_ID=r;let o=Ql(wi());try{if(At==="daemon"&&ni()){let E=await Km(t,80,24);E.success?(ne.set(E.sessionId,{daemon:!0,name:t||`Terminal ${ne.size+1}`,createdAt:Date.now(),cwd:E.cwd}),n({success:!0,sessionId:E.sessionId})):n({success:!1,error:E.error});return}let a=Po(),l=process.platform==="win32"?[]:["-l"],p=nu.default.spawn(a,l,{name:"xterm-256color",cols:80,rows:24,cwd:o,env:s,useConpty:!1}),f={pty:p,name:t||`Terminal ${ne.size+1}`,createdAt:Date.now(),buffer:[],cwd:o},m=50*1024,_=null;p.onData(E=>{f.buffer.push(E);let k=f.buffer.reduce((T,M)=>T+M.length,0);for(;k>m&&f.buffer.length>1;)k-=f.buffer.shift().length;i.emit("output",{sessionId:r,data:Buffer.from(E,"utf-8")}),At==="buffer"&&(_&&clearTimeout(_),_=setTimeout(()=>wr(r,f.buffer,At),2e3))}),p.onExit(({exitCode:E})=>{console.log(`PTY exited: sessionId=${r}, code=${E}`),At==="buffer"&&f.buffer.length>0&&wr(r,f.buffer,At),ne.delete(r),Bo(r),i.emit("sessionClosed",r)}),console.log(`PTY created: sessionId=${r}, name=${t}`),ne.set(r,f),n({success:!0,sessionId:r})}catch(a){console.error("Failed to create session:",a),n({success:!1,error:a.message})}}),e.on("joinSession",async(t,n)=>{let r=ne.get(t);if(!r)return n({success:!1,error:"Session not found"});if(r.daemon&&ni()){try{let s=await Gm(t);n({success:s.success,name:s.name,cwd:s.cwd,error:s.error})}catch(s){n({success:!1,error:s.message})}return}if(r.needsRestore&&At==="buffer")try{let s=Po(),o=process.platform==="win32"?[]:["-l"],a=Ql(wi()),l=nu.default.spawn(s,o,{name:"xterm-256color",cols:80,rows:24,cwd:a,env:eu(),useConpty:!1});r.pty=l,r.needsRestore=!1,r.cwd=a;let p=R0(t,At);p&&(r.buffer=[p]);let f=50*1024,m=null;l.onData(_=>{r.buffer.push(_);let E=r.buffer.reduce((k,T)=>k+T.length,0);for(;E>f&&r.buffer.length>1;)E-=r.buffer.shift().length;i.emit("output",{sessionId:t,data:Buffer.from(_,"utf-8")}),m&&clearTimeout(m),m=setTimeout(()=>wr(t,r.buffer,At),2e3)}),l.onExit(({exitCode:_})=>{console.log(`PTY exited: sessionId=${t}, code=${_}`),r.buffer.length>0&&wr(t,r.buffer,At),ne.delete(t),Bo(t),i.emit("sessionClosed",t)}),console.log(`\u2705 Restored PTY session: ${t}`)}catch(s){return console.error("Failed to restore session:",s),n({success:!1,error:"Failed to restore session"})}r.buffer?.length>0&&e.emit("output",{sessionId:t,data:Buffer.from(r.buffer.join(""),"utf-8")}),n({success:!0,name:r.name,cwd:r.cwd})}),e.on("input",({sessionId:t,data:n})=>{if(!t)return;let r=ne.get(t);if(r){if(r.daemon&&ni())return fl(t,n);r.pty&&r.pty.write(Buffer.isBuffer(n)?n.toString("utf-8"):n)}}),e.on("upload-file",({sessionId:t,filename:n,size:r,content:s})=>{if(!t)return;let o=ne.get(t);if(o)try{let a=n.replace(/[^a-zA-Z0-9._-]/g,"_"),l=L0.default.join(Ro,`${Date.now()}_${a}`);q0.default.writeFileSync(l,Buffer.from(s,"base64")),console.log(`\u{1F4CE} File uploaded: ${l} (${r} bytes)`),o.daemon&&ni()?fl(t,l):o.pty&&o.pty.write(l)}catch(a){console.error("File upload error:",a),e.emit("output",{sessionId:t,data:Buffer.from(`\r
|
|
44
44
|
Error uploading file: ${a.message}\r
|
|
45
|
-
`,"utf-8")})}}),e.on("resize",({sessionId:t,cols:n,rows:
|
|
46
|
-
`).filter(Boolean),o=[],a={};try{(0,
|
|
47
|
-
`).filter(Boolean).forEach(p=>{let f=p.split(" ");if(f.length>=3){let
|
|
48
|
-
`).length,E.deleted=0}}catch{}o.push({status:_,path:
|
|
45
|
+
`,"utf-8")})}}),e.on("resize",({sessionId:t,cols:n,rows:r})=>{if(!t)return;let s=ne.get(t);if(s){if(s.daemon&&ni())return Ym(t,n,r);if(s.pty)try{s.pty.resize(n,r)}catch(o){console.log(`Resize failed for ${t}: ${o.message}`)}}}),e.on("deleteSession",async(t,n)=>{let r=ne.get(t);if(!r)return n({success:!1,error:"Session not found"});if(r.daemon&&ni()){try{await Jm(t),ne.delete(t),n({success:!0})}catch(s){n({success:!1,error:s.message})}return}r.pty&&r.pty.kill(),ne.delete(t),Bo(t),i.emit("sessionClosed",t),tu(ne),n({success:!0})}),e.on("renameSession",async({sessionId:t,name:n},r)=>{let s=ne.get(t);if(!s)return r({success:!1,error:"Session not found"});if(s.daemon&&ni()){try{await Xm(t,n),s.name=n,r({success:!0})}catch(o){r({success:!1,error:o.message})}return}s.name=n,i.emit("session-renamed",{sessionId:t,name:n}),tu(ne),r({success:!0})}),e.on("enableHook",async({tool:t},n)=>{try{n(await Zm(t))}catch(r){n({success:!1,error:r.message})}}),e.on("disableHook",async({tool:t},n)=>{try{n(await Qm(t))}catch(r){n({success:!1,error:r.message})}}),e.on("getHookStatus",t=>t(ev())),e.on("getVapidKey",t=>t(S0())),e.on("pushSubscribe",t=>{t?.endpoint&&(w0(e.id,t.endpoint),x0(t,e.id))}),e.on("pushUnsubscribe",t=>{t&&y0(t)}),e.on("clearNotification",t=>{t&&(N0(t),e.broadcast.emit("notificationCleared",t))}),e.on("getAutoStartStatus",t=>{if(!wi())return t({success:!1,error:"Not in Codespaces"});let n=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();t({success:!0,...M0(n)})}),e.on("setAutoStart",({enabled:t},n)=>{if(!wi())return n({success:!1,error:"Not in Codespaces"});let r=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();n(O0(r,t))}),e.on("disconnect",()=>{console.log(`\u{1F4DF} Terminal client disconnected: ${e.id}`),b0(e.id),C0()})})}var F=L(require("fs"),1),Kt=L(require("path"),1),zn=L(require("os"),1),Vt=require("child_process");var H0=["node_modules",".git"],z0=[".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"];function $0(i){return H0.includes(i)}function _r(i){let e=Kt.default.extname(i).toLowerCase();return z0.includes(e)}function o2(i,e){return i.isDirectory()?"folder":_r(e)?"binary":"file"}function jo(i){return i<1024?`${i}B`:i<1024*1024?`${(i/1024).toFixed(1)}KB`:`${(i/(1024*1024)).toFixed(1)}MB`}function W0(i,e,t,n=50){if(!(t.length>=n))try{let r=F.default.readdirSync(i);for(let s of r){if(t.length>=n)return;if(s.startsWith(".")||$0(s))continue;let o=Kt.default.join(i,s);try{let a=F.default.statSync(o);a.isDirectory()?W0(o,e,t,n):s.toLowerCase().includes(e.toLowerCase())&&t.push({name:s,path:o,type:_r(s)?"binary":"file",size:a.size,sizeFormatted:jo(a.size)})}catch{}}}catch{}}function a2(){if(process.platform!=="win32")return[];try{return(0,Vt.execSync)("wmic logicaldisk get name",{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).split(/\r?\n/).map(t=>t.trim()).filter(t=>/^[A-Z]:$/.test(t)).map(t=>({letter:t[0],path:t+"\\"}))}catch{let i=[];for(let e of"CDEFGHIJ"){let t=`${e}:\\`;F.default.existsSync(t)&&i.push({letter:e,path:t})}return i}}function V0(i){i.on("connection",e=>{e.on("getSystemInfo",t=>{let n=process.platform,r=n==="win32";t({success:!0,platform:n,isWindows:r,drives:r?a2():[],homedir:zn.default.homedir()})}),e.on("getFiles",({dirPath:t},n)=>{try{let r=t||zn.default.homedir(),s=t?.startsWith("~")?t.replace("~",zn.default.homedir()):r;if(!F.default.existsSync(s)){n({success:!1,error:"Directory not found"});return}let o=F.default.readdirSync(s),a=[];for(let l of o)if(!(l.startsWith(".")&&l!==".env"&&l!==".env.example")&&!$0(l))try{let p=Kt.default.join(s,l),f=F.default.statSync(p);a.push({name:l,path:p,type:o2(f,l),size:f.isFile()?f.size:null,sizeFormatted:f.isFile()?jo(f.size):null,modified:f.mtime.getTime()})}catch{}a.sort((l,p)=>l.type==="folder"&&p.type!=="folder"?-1:l.type!=="folder"&&p.type==="folder"?1:l.name.localeCompare(p.name)),n({success:!0,files:a,currentPath:s,parentPath:Kt.default.dirname(s)})}catch(r){n({success:!1,error:r.message})}}),e.on("searchFiles",({workspace:t,query:n},r)=>{try{if(!n||n.length<2){r({success:!0,files:[]});return}let s=t?.startsWith("~")?t.replace("~",zn.default.homedir()):t||zn.default.homedir();if(!F.default.existsSync(s)){r({success:!1,error:"Workspace not found"});return}let o=[];W0(s,n,o,50),o.sort((a,l)=>{let p=a.name.toLowerCase()===n.toLowerCase(),f=l.name.toLowerCase()===n.toLowerCase();return p&&!f?-1:!p&&f?1:a.path.length-l.path.length}),r({success:!0,files:o})}catch(s){r({success:!1,error:s.message})}}),e.on("readFile",({filePath:t},n)=>{try{if(!F.default.existsSync(t)){n({success:!1,error:"File not found"});return}let r=F.default.statSync(t);if(r.size>512e3){n({success:!1,error:`File too large (${jo(r.size)}). Max ${jo(512e3)}`});return}if(_r(t)){n({success:!1,error:"Cannot open binary file"});return}let s=F.default.readFileSync(t,"utf-8");n({success:!0,content:s})}catch(r){n({success:!1,error:r.message})}}),e.on("writeFile",({filePath:t,content:n},r)=>{try{F.default.writeFileSync(t,n,"utf-8"),r({success:!0})}catch(s){r({success:!1,error:s.message})}}),e.on("createItem",({itemPath:t,type:n},r)=>{try{if(F.default.existsSync(t)){r({success:!1,error:"Item already exists"});return}n==="folder"?F.default.mkdirSync(t,{recursive:!0}):F.default.writeFileSync(t,"","utf-8"),r({success:!0})}catch(s){r({success:!1,error:s.message})}}),e.on("deleteItem",({itemPath:t},n)=>{try{if(!F.default.existsSync(t)){n({success:!1,error:"Item not found"});return}F.default.statSync(t).isDirectory()?F.default.rmSync(t,{recursive:!0}):F.default.unlinkSync(t),n({success:!0})}catch(r){n({success:!1,error:r.message})}}),e.on("renameItem",({oldPath:t,newPath:n},r)=>{try{if(!F.default.existsSync(t)){r({success:!1,error:"Item not found"});return}if(F.default.existsSync(n)){r({success:!1,error:"Target already exists"});return}F.default.renameSync(t,n),r({success:!0})}catch(s){r({success:!1,error:s.message})}}),e.on("gitStatus",({repoPath:t},n)=>{try{let s=(0,Vt.execSync)("git status --porcelain",{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim().split(`
|
|
46
|
+
`).filter(Boolean),o=[],a={};try{(0,Vt.execSync)("git diff HEAD --numstat",{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim().split(`
|
|
47
|
+
`).filter(Boolean).forEach(p=>{let f=p.split(" ");if(f.length>=3){let m=f[0]==="-"?0:parseInt(f[0],10)||0,_=f[1]==="-"?0:parseInt(f[1],10)||0;a[f[2]]={added:m,deleted:_}}})}catch{}for(let l of s){let p=l.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!p)continue;let f=p[1],m=p[2];if(!m)continue;let _;f.includes("?")?_="?":f.includes("A")?_="A":f.includes("D")?_="D":f.includes("M")?_="M":f.includes("R")?_="R":_=f.trim()[0]||"?";let E=a[m]||{added:0,deleted:0};if(_==="?")try{let k=Kt.default.join(t,m);if(F.default.existsSync(k)&&!_r(m)){let T=F.default.readFileSync(k,"utf-8");E.added=T.split(`
|
|
48
|
+
`).length,E.deleted=0}}catch{}o.push({status:_,path:m,added:E.added,deleted:E.deleted})}n({success:!0,files:o})}catch{n({success:!1,error:"Not a git repository or git not available"})}}),e.on("gitFileStatus",({repoPath:t,filePath:n},r)=>{try{let s=Kt.default.relative(t,n),a=(0,Vt.execSync)(`git status --porcelain -- "${s}"`,{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();if(!a){r({success:!0,status:null});return}let l=a.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!l){r({success:!0,status:null});return}let p=l[1],f;p.includes("?")?f="?":p.includes("A")?f="A":p.includes("D")?f="D":p.includes("M")?f="M":p.includes("R")?f="R":f=p.trim()[0]||"?",r({success:!0,status:f,file:s})}catch{r({success:!0,status:null})}}),e.on("gitDiff",({repoPath:t,file:n,status:r},s)=>{try{let o="";if(n&&r==="?"){let a=Kt.default.join(t,n);if(F.default.existsSync(a)){let p=F.default.readFileSync(a,"utf-8").split(`
|
|
49
49
|
`);o=`diff --git a/${n} b/${n}
|
|
50
50
|
new file mode 100644
|
|
51
51
|
--- /dev/null
|
|
52
52
|
+++ b/${n}
|
|
53
53
|
@@ -0,0 +1,${p.length} @@
|
|
54
54
|
${p.map(f=>`+${f}`).join(`
|
|
55
|
-
`)}`}}else if(n){let a=`git diff HEAD -- "${n}"`;o=(0,
|
|
56
|
-
`).filter(p=>p.startsWith("??")).map(p=>p.substring(3));for(let p of l){let f=
|
|
55
|
+
`)}`}}else if(n){let a=`git diff HEAD -- "${n}"`;o=(0,Vt.execSync)(a,{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}else{o=(0,Vt.execSync)("git diff HEAD",{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]});let l=(0,Vt.execSync)("git status --porcelain",{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim().split(`
|
|
56
|
+
`).filter(p=>p.startsWith("??")).map(p=>p.substring(3));for(let p of l){let f=Kt.default.join(t,p);if(F.default.existsSync(f)&&!_r(p))try{if(F.default.statSync(f).size<=512e3){let E=F.default.readFileSync(f,"utf-8").split(`
|
|
57
57
|
`);o+=`
|
|
58
58
|
diff --git a/${p} b/${p}
|
|
59
59
|
new file mode 100644
|
|
60
60
|
--- /dev/null
|
|
61
61
|
+++ b/${p}
|
|
62
62
|
@@ -0,0 +1,${E.length} @@
|
|
63
|
-
${E.map(
|
|
64
|
-
`)}`}}catch{}}}
|
|
65
|
-
`);for(let
|
|
63
|
+
${E.map(k=>`+${k}`).join(`
|
|
64
|
+
`)}`}}catch{}}}s({success:!0,diff:o})}catch(o){s({success:!1,error:o.message})}}),e.on("gitDiscard",({repoPath:t,file:n,status:r},s)=>{try{if(!n){s({success:!1,error:"No file specified"});return}let o=Kt.default.join(t,n);r==="?"?F.default.existsSync(o)&&(F.default.statSync(o).isDirectory()?F.default.rmSync(o,{recursive:!0}):F.default.unlinkSync(o)):r==="A"?((0,Vt.execSync)(`git reset HEAD -- "${n}"`,{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),F.default.existsSync(o)&&F.default.unlinkSync(o)):(0,Vt.execSync)(`git checkout HEAD -- "${n}"`,{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),s({success:!0})}catch(o){s({success:!1,error:o.message})}})})}function c2(){try{let i=(0,G0.join)((0,Y0.homedir)(),".9remote","keys.json");return JSON.parse((0,K0.readFileSync)(i,"utf8")).key||null}catch{return null}}var J0=null;function su(){return J0}async function X0(i){let e=new Dh(i,{cors:{origin:"*",methods:["GET","POST"],credentials:!0,allowedHeaders:["*"]},transports:["websocket","polling"],allowEIO3:!0,allowUpgrades:!0,pingTimeout:6e4,pingInterval:25e3});return await Nm(),U0(e),Im(e,c2()),V0(e),J0=e,e}var Z0=L(require("http"),1),Q0=L(require("https"),1),ex=require("child_process"),tx=require("util"),l2=(0,tx.promisify)(ex.exec);async function u2(){let i=process.platform,e=new Set([80,443]);try{let t;if(i==="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 l2(t),r=n.split(`
|
|
65
|
+
`);for(let s of r){let o=s.match(/[:\*\]](\d{2,5})(?:\s|$)/g);if(o)for(let a of o){let l=parseInt(a.replace(/[:\*\]\s]/g,""),10);l>0&&l<=65535&&(l===80||l===443||l>=1024)&&e.add(l)}}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 p2(i,e=2e3){return new Promise(t=>{let n=Z0.default.request({host:"localhost",port:i,method:"GET",path:"/",timeout:e},r=>{r.on("data",()=>{}),r.on("end",()=>{}),t({active:!0,protocol:"http",status:r.statusCode})});n.on("error",r=>{t({active:!1,error:r.message})}),n.on("timeout",()=>{n.destroy(),t({active:!1,error:"timeout"})}),n.end()})}function d2(i,e=2e3){return new Promise(t=>{let n=Q0.default.request({host:"localhost",port:i,method:"GET",path:"/",timeout:e,rejectUnauthorized:!1},r=>{r.on("data",()=>{}),r.on("end",()=>{}),t({active:!0,protocol:"https",status:r.statusCode})});n.on("error",r=>{t({active:!1,error:r.message})}),n.on("timeout",()=>{n.destroy(),t({active:!1,error:"timeout"})}),n.end()})}async function f2(i){let[e,t]=await Promise.all([p2(i),d2(i)]);return t.active?{port:i,...t}:e.active?{port:i,...e}:{port:i,active:!1}}async function ix(){let i=await u2();return(await Promise.all(i.map(t=>f2(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 nx=L(require("crypto"),1),h2=process.env.API_KEY_SECRET||"9remote-api-key-secret";function m2(i,e){return nx.default.createHmac("sha256",h2).update(i+e).digest("hex").slice(0,8)}function v2(i){if(!i||!i.startsWith("sk-"))return null;let e=i.split("-");if(e.length===4){let[,t,n,r]=e,s=m2(t,n);return r!==s?null:{machineId:t,keyId:n}}return null}function rx(i){return v2(i)!==null}async function sx(i,e){let t=i.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(!rx(n)){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Invalid API key"}));return}let r=await ix();e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify(r))}function ox(i){i.setHeader("Access-Control-Allow-Origin","*"),i.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS"),i.setHeader("Access-Control-Allow-Headers","*"),i.setHeader("Access-Control-Allow-Credentials","true")}function ax(i,e){return i.method==="OPTIONS"?(e.writeHead(200),e.end(),!0):!1}var Wn=require("zlib"),zx=L(Lx(),1);var $2=["data:","javascript:","#","mailto:","blob:"],W2=["href","src","action","srcset","poster","data","formaction","data-src","data-href","data-url","data-background"];function qo(i,e){return!i||$2.some(t=>i.startsWith(t))||i.startsWith("/proxy/")?i:i.startsWith(`http://localhost:${e}`)?i.replace(`http://localhost:${e}`,`/proxy/${e}`):i.startsWith("/")&&!i.startsWith("//")?`/proxy/${e}${i}`:i}function Fx(i,e){let t=`/proxy/${e}`,n=new RegExp(`(${W2.join("|")})=(["'])([^"']*?)\\2`,"gi");return i=i.replace(n,(r,s,o,a)=>{if(s.toLowerCase()==="srcset"){let l=a.split(",").map(p=>{let[f,...m]=p.trim().split(/\s+/),_=qo(f,e);return m.length?`${_} ${m.join(" ")}`:_}).join(", ");return`${s}=${o}${l}${o}`}return`${s}=${o}${qo(a,e)}${o}`}),i=i.replace(/url\(\s*(["']?)(\/_next\/[^)"']+)\1\s*\)/gi,(r,s,o)=>`url(${s}${t}${o}${s})`),i=i.replace(/"(\/_next\/[^"]+)"/g,(r,s)=>`"${t}${s}"`),i}function Ux(i){let e=`/proxy/${i}`;return`
|
|
66
66
|
// Service Worker for 9Remote Proxy - Port ${i}
|
|
67
67
|
const PROXY_BASE = '${e}';
|
|
68
68
|
const TARGET_PORT = ${i};
|
|
@@ -117,7 +117,7 @@ self.addEventListener('fetch', (event) => {
|
|
|
117
117
|
|
|
118
118
|
event.respondWith(fetch(new Request(newUrl, requestInit)));
|
|
119
119
|
});
|
|
120
|
-
`}function
|
|
120
|
+
`}function Hx(i){return`
|
|
121
121
|
<script data-proxy-injected="true">
|
|
122
122
|
(function() {
|
|
123
123
|
if (window.__proxySwRegistered) return;
|
|
@@ -159,7 +159,7 @@ self.addEventListener('fetch', (event) => {
|
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
161
|
})();
|
|
162
|
-
</script>`}var
|
|
162
|
+
</script>`}var _u=new Set;function $x(i){_u.add(String(i))}function Wx(i){_u.delete(String(i))}function V2(i){return _u.has(String(i))}function K2(i){switch(i){case"gzip":return(0,Wn.createGunzip)();case"deflate":return(0,Wn.createInflate)();case"br":return(0,Wn.createBrotliDecompress)();default:return null}}function G2(i,e){if(i.includes("<head>"))return i.replace("<head>","<head>"+e);if(i.includes("<HEAD>"))return i.replace("<HEAD>","<HEAD>"+e);let t=i.match(/<head[^>]*>/i);return t?i.replace(t[0],t[0]+e):e+i}function Vx(){let i=zx.default.createProxyServer({selfHandleResponse:!0});return i.on("proxyRes",(e,t,n)=>{let r=t._proxyTargetPort,s=e.headers["content-type"]||"",o=e.headers["content-encoding"]||"",a=s.includes("text/html"),l={...e.headers};if(l.location&&(l.location=qo(l.location,r)),s.includes("application/json")||s.includes("text/x-component")){n.writeHead(e.statusCode,l),e.pipe(n);return}if(s.includes("javascript")||s.includes("text/javascript")){n.writeHead(e.statusCode,l),e.pipe(n);return}if(!a){n.writeHead(e.statusCode,l),e.pipe(n);return}delete l["content-length"],delete l["content-encoding"];let m=K2(o),_=m?e.pipe(m):e,E=[];_.on("data",k=>E.push(k)),_.on("error",k=>{console.error("[Proxy] Decompress error:",k.message),n.writeHead(502),n.end("Bad Gateway: Decompression failed")}),_.on("end",()=>{let k=Buffer.concat(E).toString("utf8");k=Fx(k,r);let T=Hx(r);k=G2(k,T),n.writeHead(e.statusCode,l),n.end(k)})}),i}function Kx(i,e,t,n,r,s){if(r==="/sw.js"){let o=Ux(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(!V2(n)){t.writeHead(401,{"Content-Type":"text/html"}),t.end(`
|
|
163
163
|
<!DOCTYPE html>
|
|
164
164
|
<html>
|
|
165
165
|
<head><title>Unauthorized</title></head>
|
|
@@ -170,7 +170,7 @@ self.addEventListener('fetch', (event) => {
|
|
|
170
170
|
</div>
|
|
171
171
|
</body>
|
|
172
172
|
</html>
|
|
173
|
-
`);return}e._proxyTargetPort=n,e.url=
|
|
173
|
+
`);return}e._proxyTargetPort=n,e.url=r+(s||""),i.web(e,t,{target:`http://localhost:${n}`,changeOrigin:!0},o=>{t.writeHead(502),t.end(`Bad Gateway: ${o.message}`)})}var ey=L(nl(),1),Y2=ey.default.rgb(230,138,110);function J2(){return process.env.CODESPACES==="true"}async function X2(i,e){if(i.method!=="POST"){e.writeHead(405),e.end(JSON.stringify({error:"Method not allowed"}));return}if(!J2()){e.writeHead(400),e.end(JSON.stringify({error:"Not running on Codespaces"}));return}let t=process.env.CODESPACE_NAME;if(!t){e.writeHead(400),e.end(JSON.stringify({error:"Codespace name not found"}));return}let n=su();n&&n.emit("codespace:stopping"),e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify({success:!0,message:"Stopping codespace..."})),setTimeout(()=>{(0,Qx.exec)(`gh codespace stop -c ${t}`,r=>{r&&console.error("Failed to stop codespace:",r)})},500)}var Z2="localhost",Gx=parseInt(process.env.PORT||"2208",10),Yx={},Q2=1e4;function Jx(i,e,t,n){let r=Date.now(),s,o,a;if(n)s=n.type||"stop",o=n.sessionId||"",a=n.tool||"claude";else try{let p=JSON.parse(t||"{}");s=p.type||"stop",o=p.sessionId||"",a=p.tool||"claude"}catch{e.writeHead(400),e.end(JSON.stringify({error:"Invalid JSON"}));return}let l=su();if(l){let p={type:s,sessionId:o,tool:a,timestamp:r};if(o&&o){j0(o,p),l.emit("chatNotification",p);let f=`${a}:${s}`;r-(Yx[f]||0)<Q2||(Yx[f]=r,l.timeout(5e3).emit("chatNotificationAck",p,(_,E)=>{let k=l.sockets.sockets.size;!(!_&&E&&E.length>0)&&k===0&&_0(p)}))}}e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify({success:!0}))}async function ty(){await F0();let i=Vx(),e=(0,Xx.createServer)(async(t,n)=>{if(ox(n),!ax(t,n))try{let r=(0,Zx.parse)(t.url,!0),{pathname:s,search:o}=r;if(s==="/api/health"){n.setHeader("Content-Type","application/json"),n.writeHead(200),n.end(JSON.stringify({status:"ok",timestamp:Date.now()}));return}if(s==="/api/local-sites"){await sx(t,n);return}if(s==="/api/codespace/stop"){await X2(t,n);return}if(s==="/api/notify"&&t.method==="POST"){let a="";t.on("data",l=>a+=l),t.on("end",()=>{Jx(t,n,a)});return}if(s==="/api/notify"&&t.method==="GET"){Jx(t,n,null,r.query);return}if(s==="/api/proxy/start"&&t.method==="POST"){let a="";t.on("data",l=>a+=l),t.on("end",()=>{let{port:l}=JSON.parse(a||"{}");l?($x(l),n.setHeader("Content-Type","application/json"),n.writeHead(200),n.end(JSON.stringify({success:!0}))):(n.writeHead(400),n.end(JSON.stringify({error:"Port required"})))});return}if(s==="/api/proxy/end"&&t.method==="POST"){let a="";t.on("data",l=>a+=l),t.on("end",()=>{let{port:l}=JSON.parse(a||"{}");l?(Wx(l),n.setHeader("Content-Type","application/json"),n.writeHead(200),n.end(JSON.stringify({success:!0}))):(n.writeHead(400),n.end(JSON.stringify({error:"Port required"})))});return}if(s.startsWith("/proxy/")){let a=s.match(/^\/proxy\/(\d+)(\/.*)?$/);if(a){Kx(i,t,n,a[1],a[2]||"/",o);return}}n.writeHead(404),n.end(JSON.stringify({error:"Not found"}))}catch(r){console.error("Error:",t.url,r),n.statusCode=500,n.end("Internal server error")}});await X0(e),e.listen(Gx,t=>{if(t)throw t;console.log(Y2(`\u2705 Server ready on http://${Z2}:${Gx}`))})}ty();0&&(module.exports={startServer});
|
|
174
174
|
/*! Bundled license information:
|
|
175
175
|
|
|
176
176
|
negotiator/index.js:
|