9remote 0.1.49 → 0.1.50
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 +2 -2
- package/dist/server.cjs +29 -29
- package/dist/ui/assets/index-0y2xzwGf.css +1 -0
- package/dist/ui/assets/index-Cu8zxWgo.js +8 -0
- package/dist/ui/index.html +2 -2
- package/index.js +10 -0
- package/package.json +1 -1
- package/dist/ui/assets/index-CWkDNGlQ.js +0 -8
- package/dist/ui/assets/index-dbQMrYNp.css +0 -1
package/dist/server.cjs
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
const __importMetaUrl = require('url').pathToFileURL(__filename).href;
|
|
2
|
-
var Z0=Object.create;var In=Object.defineProperty;var Q0=Object.getOwnPropertyDescriptor;var ey=Object.getOwnPropertyNames;var ty=Object.getPrototypeOf,iy=Object.prototype.hasOwnProperty;var Si=(i,e)=>()=>(i&&(e=i(i=0)),e);var T=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),Ei=(i,e)=>{for(var t in e)In(i,t,{get:e[t],enumerable:!0})},$u=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ey(e))!iy.call(i,n)&&n!==t&&In(i,n,{get:()=>e[n],enumerable:!(r=Q0(e,n))||r.enumerable});return i};var L=(i,e,t)=>(t=i!=null?Z0(ty(i)):{},$u(e||!i||!i.__esModule?In(t,"default",{value:i,enumerable:!0}):t,i)),ry=i=>$u(In({},"__esModule",{value:!0}),i);var Yu=T((Pk,la)=>{"use strict";la.exports=Gu;la.exports.preferredCharsets=Gu;var ny=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function sy(i){for(var e=i.split(","),t=0,r=0;t<e.length;t++){var n=oy(e[t].trim(),t);n&&(e[r++]=n)}return e.length=r,e}function oy(i,e){var t=ny.exec(i);if(!t)return null;var r=t[1],n=1;if(t[2])for(var s=t[2].split(";"),o=0;o<s.length;o++){var c=s[o].trim().split("=");if(c[0]==="q"){n=parseFloat(c[1]);break}}return{charset:r,q:n,i:e}}function ay(i,e,t){for(var r={o:-1,q:0,s:0},n=0;n<e.length;n++){var s=cy(i,e[n],t);s&&(r.s-s.s||r.q-s.q||r.o-s.o)<0&&(r=s)}return r}function cy(i,e,t){var r=0;if(e.charset.toLowerCase()===i.toLowerCase())r|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:r}}function Gu(i,e){var t=sy(i===void 0?"*":i||"");if(!e)return t.filter(Ku).sort(Vu).map(ly);var r=e.map(function(s,o){return ay(s,t,o)});return r.filter(Ku).sort(Vu).map(function(s){return e[r.indexOf(s)]})}function Vu(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function ly(i){return i.charset}function Ku(i){return i.q>0}});var ep=T((Bk,ua)=>{"use strict";ua.exports=Qu;ua.exports.preferredEncodings=Qu;var uy=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function py(i){for(var e=i.split(","),t=!1,r=1,n=0,s=0;n<e.length;n++){var o=dy(e[n].trim(),n);o&&(e[s++]=o,t=t||Zu("identity",o),r=Math.min(r,o.q||1))}return t||(e[s++]={encoding:"identity",q:r,i:n}),e.length=s,e}function dy(i,e){var t=uy.exec(i);if(!t)return null;var r=t[1],n=1;if(t[2])for(var s=t[2].split(";"),o=0;o<s.length;o++){var c=s[o].trim().split("=");if(c[0]==="q"){n=parseFloat(c[1]);break}}return{encoding:r,q:n,i:e}}function fy(i,e,t){for(var r={o:-1,q:0,s:0},n=0;n<e.length;n++){var s=Zu(i,e[n],t);s&&(r.s-s.s||r.q-s.q||r.o-s.o)<0&&(r=s)}return r}function Zu(i,e,t){var r=0;if(e.encoding.toLowerCase()===i.toLowerCase())r|=1;else if(e.encoding!=="*")return null;return{i:t,o:e.i,q:e.q,s:r}}function Qu(i,e){var t=py(i||"");if(!e)return t.filter(Xu).sort(Ju).map(hy);var r=e.map(function(s,o){return fy(s,t,o)});return r.filter(Xu).sort(Ju).map(function(s){return e[r.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 hy(i){return i.encoding}function Xu(i){return i.q>0}});var sp=T((Nk,pa)=>{"use strict";pa.exports=np;pa.exports.preferredLanguages=np;var my=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function vy(i){for(var e=i.split(","),t=0,r=0;t<e.length;t++){var n=rp(e[t].trim(),t);n&&(e[r++]=n)}return e.length=r,e}function rp(i,e){var t=my.exec(i);if(!t)return null;var r=t[1],n=t[2],s=r;n&&(s+="-"+n);var o=1;if(t[3])for(var c=t[3].split(";"),u=0;u<c.length;u++){var d=c[u].split("=");d[0]==="q"&&(o=parseFloat(d[1]))}return{prefix:r,suffix:n,q:o,i:e,full:s}}function gy(i,e,t){for(var r={o:-1,q:0,s:0},n=0;n<e.length;n++){var s=xy(i,e[n],t);s&&(r.s-s.s||r.q-s.q||r.o-s.o)<0&&(r=s)}return r}function xy(i,e,t){var r=rp(i);if(!r)return null;var n=0;if(e.full.toLowerCase()===r.full.toLowerCase())n|=4;else if(e.prefix.toLowerCase()===r.full.toLowerCase())n|=2;else if(e.full.toLowerCase()===r.prefix.toLowerCase())n|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function np(i,e){var t=vy(i===void 0?"*":i||"");if(!e)return t.filter(ip).sort(tp).map(yy);var r=e.map(function(s,o){return gy(s,t,o)});return r.filter(ip).sort(tp).map(function(s){return e[r.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 yy(i){return i.full}function ip(i){return i.q>0}});var pp=T((Ik,da)=>{"use strict";da.exports=lp;da.exports.preferredMediaTypes=lp;var by=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function wy(i){for(var e=Ty(i),t=0,r=0;t<e.length;t++){var n=cp(e[t].trim(),t);n&&(e[r++]=n)}return e.length=r,e}function cp(i,e){var t=by.exec(i);if(!t)return null;var r=Object.create(null),n=1,s=t[2],o=t[1];if(t[3])for(var c=ky(t[3]).map(Cy),u=0;u<c.length;u++){var d=c[u],f=d[0].toLowerCase(),v=d[1],_=v&&v[0]==='"'&&v[v.length-1]==='"'?v.substr(1,v.length-2):v;if(f==="q"){n=parseFloat(_);break}r[f]=_}return{type:o,subtype:s,params:r,q:n,i:e}}function _y(i,e,t){for(var r={o:-1,q:0,s:0},n=0;n<e.length;n++){var s=Sy(i,e[n],t);s&&(r.s-s.s||r.q-s.q||r.o-s.o)<0&&(r=s)}return r}function Sy(i,e,t){var r=cp(i),n=0;if(!r)return null;if(e.type.toLowerCase()==r.type.toLowerCase())n|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==r.subtype.toLowerCase())n|=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()==(r.params[o]||"").toLowerCase()}))n|=1;else return null;return{i:t,o:e.i,q:e.q,s:n}}function lp(i,e){var t=wy(i===void 0?"*/*":i||"");if(!e)return t.filter(ap).sort(op).map(Ey);var r=e.map(function(s,o){return _y(s,t,o)});return r.filter(ap).sort(op).map(function(s){return e[r.indexOf(s)]})}function op(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function Ey(i){return i.type+"/"+i.subtype}function ap(i){return i.q>0}function up(i){for(var e=0,t=0;(t=i.indexOf('"',t))!==-1;)e++,t++;return e}function Cy(i){var e=i.indexOf("="),t,r;return e===-1?t=i:(t=i.substr(0,e),r=i.substr(e+1)),[t,r]}function Ty(i){for(var e=i.split(","),t=1,r=0;t<e.length;t++)up(e[r])%2==0?e[++r]=e[t]:e[r]+=","+e[t];return e.length=r+1,e}function ky(i){for(var e=i.split(";"),t=1,r=0;t<e.length;t++)up(e[r])%2==0?e[++r]=e[t]:e[r]+=";"+e[t];e.length=r+1;for(var t=0;t<e.length;t++)e[t]=e[t].trim();return e}});var dp=T((Dk,fa)=>{"use strict";var My=Yu(),Oy=ep(),Ay=sp(),Ry=pp();fa.exports=H;fa.exports.Negotiator=H;function H(i){if(!(this instanceof H))return new H(i);this.request=i}H.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]};H.prototype.charsets=function(e){return My(this.request.headers["accept-charset"],e)};H.prototype.encoding=function(e){var t=this.encodings(e);return t&&t[0]};H.prototype.encodings=function(e){return Oy(this.request.headers["accept-encoding"],e)};H.prototype.language=function(e){var t=this.languages(e);return t&&t[0]};H.prototype.languages=function(e){return Ay(this.request.headers["accept-language"],e)};H.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]};H.prototype.mediaTypes=function(e){return Ry(this.request.headers.accept,e)};H.prototype.preferredCharset=H.prototype.charset;H.prototype.preferredCharsets=H.prototype.charsets;H.prototype.preferredEncoding=H.prototype.encoding;H.prototype.preferredEncodings=H.prototype.encodings;H.prototype.preferredLanguage=H.prototype.language;H.prototype.preferredLanguages=H.prototype.languages;H.prototype.preferredMediaType=H.prototype.mediaType;H.prototype.preferredMediaTypes=H.prototype.mediaTypes});var fp=T((jk,Py)=>{Py.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 mp=T((Lk,hp)=>{hp.exports=fp()});var xp=T(it=>{"use strict";var Dn=mp(),By=require("path").extname,vp=/^\s*([^;\s]*)(?:;|\s|$)/,Ny=/^text\//i;it.charset=gp;it.charsets={lookup:gp};it.contentType=Iy;it.extension=Dy;it.extensions=Object.create(null);it.lookup=jy;it.types=Object.create(null);Ly(it.extensions,it.types);function gp(i){if(!i||typeof i!="string")return!1;var e=vp.exec(i),t=e&&Dn[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&Ny.test(e[1])?"UTF-8":!1}function Iy(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 Dy(i){if(!i||typeof i!="string")return!1;var e=vp.exec(i),t=e&&it.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function jy(i){if(!i||typeof i!="string")return!1;var e=By("x."+i).toLowerCase().substr(1);return e&&it.types[e]||!1}function Ly(i,e){var t=["nginx","apache",void 0,"iana"];Object.keys(Dn).forEach(function(n){var s=Dn[n],o=s.extensions;if(!(!o||!o.length)){i[n]=o;for(var c=0;c<o.length;c++){var u=o[c];if(e[u]){var d=t.indexOf(Dn[e[u]].source),f=t.indexOf(s.source);if(e[u]!=="application/octet-stream"&&(d>f||d===f&&e[u].substr(0,12)==="application/"))continue}e[u]=n}}})}});var jn=T((Fk,yp)=>{"use strict";var qy=dp(),Fy=xp();yp.exports=lt;function lt(i){if(!(this instanceof lt))return new lt(i);this.headers=i.headers,this.negotiator=new qy(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 r=e.map(Uy),n=this.negotiator.mediaTypes(r.filter(Hy)),s=n[0];return s?e[r.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 Uy(i){return i.indexOf("/")===-1?Fy.lookup(i):i}function Hy(i){return typeof i=="string"}});var ma=T((bp,wp)=>{var Yr=require("crypto"),ha=function(){};ha.prototype.getRandomBytes=function(i){var e=4096,t=this;if(i=i||12,i>e)return Yr.randomBytes(i);var r=parseInt(e/i),n=parseInt(r*.85);if(!n||(this.bytesBufferIndex==null&&(this.bytesBufferIndex=-1),this.bytesBufferIndex==r&&(this.bytesBuffer=null,this.bytesBufferIndex=-1),(this.bytesBufferIndex==-1||this.bytesBufferIndex>n)&&(this.isGeneratingBytes||(this.isGeneratingBytes=!0,Yr.randomBytes(e,function(o,c){t.bytesBuffer=c,t.bytesBufferIndex=0,t.isGeneratingBytes=!1})),this.bytesBufferIndex==-1)))return Yr.randomBytes(i);var s=this.bytesBuffer.slice(i*this.bytesBufferIndex,i*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,s};ha.prototype.generateId=function(){var i=Buffer.alloc(15);return i.writeInt32BE?(this.sequenceNumber=this.sequenceNumber+1|0,i.writeInt32BE(this.sequenceNumber,11),Yr.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()};bp=wp.exports=new ha});var Ln=T(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.ERROR_PACKET=pi.PACKET_TYPES_REVERSE=pi.PACKET_TYPES=void 0;var Ut=Object.create(null);pi.PACKET_TYPES=Ut;Ut.open="0";Ut.close="1";Ut.ping="2";Ut.pong="3";Ut.message="4";Ut.upgrade="5";Ut.noop="6";var _p=Object.create(null);pi.PACKET_TYPES_REVERSE=_p;Object.keys(Ut).forEach(i=>{_p[Ut[i]]=i});var zy={type:"error",data:"parser error"};pi.ERROR_PACKET=zy});var Ep=T(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.encodePacket=void 0;Yi.encodePacketToBinary=Vy;var Wy=Ln(),$y=({type:i,data:e},t,r)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?r(t?e:"b"+Sp(e,!0).toString("base64")):r(Wy.PACKET_TYPES[i]+(e||""));Yi.encodePacket=$y;var Sp=(i,e)=>Buffer.isBuffer(i)||i instanceof Uint8Array&&!e?i:i instanceof ArrayBuffer?Buffer.from(i):Buffer.from(i.buffer,i.byteOffset,i.byteLength),va;function Vy(i,e){if(i.data instanceof ArrayBuffer||ArrayBuffer.isView(i.data))return e(Sp(i.data,!1));(0,Yi.encodePacket)(i,!0,t=>{va||(va=new TextEncoder),e(va.encode(t))})}});var Tp=T(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.decodePacket=void 0;var qn=Ln(),Ky=(i,e)=>{if(typeof i!="string")return{type:"message",data:Cp(i,e)};let t=i.charAt(0);if(t==="b"){let r=Buffer.from(i.substring(1),"base64");return{type:"message",data:Cp(r,e)}}return qn.PACKET_TYPES_REVERSE[t]?i.length>1?{type:qn.PACKET_TYPES_REVERSE[t],data:i.substring(1)}:{type:qn.PACKET_TYPES_REVERSE[t]}:qn.ERROR_PACKET};Fn.decodePacket=Ky;var Cp=(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 Jr=T(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.decodePayload=rt.decodePacket=rt.encodePayload=rt.encodePacket=rt.protocol=void 0;rt.createPacketEncoderStream=Jy;rt.createPacketDecoderStream=Xy;var xa=Ep();Object.defineProperty(rt,"encodePacket",{enumerable:!0,get:function(){return xa.encodePacket}});var ya=Tp();Object.defineProperty(rt,"decodePacket",{enumerable:!0,get:function(){return ya.decodePacket}});var kp=Ln(),Mp="",Gy=(i,e)=>{let t=i.length,r=new Array(t),n=0;i.forEach((s,o)=>{(0,xa.encodePacket)(s,!1,c=>{r[o]=c,++n===t&&e(r.join(Mp))})})};rt.encodePayload=Gy;var Yy=(i,e)=>{let t=i.split(Mp),r=[];for(let n=0;n<t.length;n++){let s=(0,ya.decodePacket)(t[n],e);if(r.push(s),s.type==="error")break}return r};rt.decodePayload=Yy;function Jy(){return new TransformStream({transform(i,e){(0,xa.encodePacketToBinary)(i,t=>{let r=t.length,n;if(r<126)n=new Uint8Array(1),new DataView(n.buffer).setUint8(0,r);else if(r<65536){n=new Uint8Array(3);let s=new DataView(n.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{n=new Uint8Array(9);let s=new DataView(n.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}i.data&&typeof i.data!="string"&&(n[0]|=128),e.enqueue(n),e.enqueue(t)})}})}var ga;function Un(i){return i.reduce((e,t)=>e+t.length,0)}function Hn(i,e){if(i[0].length===e)return i.shift();let t=new Uint8Array(e),r=0;for(let n=0;n<e;n++)t[n]=i[0][r++],r===i[0].length&&(i.shift(),r=0);return i.length&&r<i[0].length&&(i[0]=i[0].slice(r)),t}function Xy(i,e){ga||(ga=new TextDecoder);let t=[],r=0,n=-1,s=!1;return new TransformStream({transform(o,c){for(t.push(o);;){if(r===0){if(Un(t)<1)break;let u=Hn(t,1);s=(u[0]&128)===128,n=u[0]&127,n<126?r=3:n===126?r=1:r=2}else if(r===1){if(Un(t)<2)break;let u=Hn(t,2);n=new DataView(u.buffer,u.byteOffset,u.length).getUint16(0),r=3}else if(r===2){if(Un(t)<8)break;let u=Hn(t,8),d=new DataView(u.buffer,u.byteOffset,u.length),f=d.getUint32(0);if(f>Math.pow(2,21)-1){c.enqueue(kp.ERROR_PACKET);break}n=f*Math.pow(2,32)+d.getUint32(4),r=3}else{if(Un(t)<n)break;let u=Hn(t,n);c.enqueue((0,ya.decodePacket)(s?u:ga.decode(u),e)),r=0}if(n===0||n>i){c.enqueue(kp.ERROR_PACKET);break}}}})}rt.protocol=4});var Pp=T(($k,Rp)=>{var di=String.fromCharCode;function Op(i){for(var e=[],t=0,r=i.length,n,s;t<r;)n=i.charCodeAt(t++),n>=55296&&n<=56319&&t<r?(s=i.charCodeAt(t++),(s&64512)==56320?e.push(((n&1023)<<10)+(s&1023)+65536):(e.push(n),t--)):e.push(n);return e}function Zy(i){for(var e=i.length,t=-1,r,n="";++t<e;)r=i[t],r>65535&&(r-=65536,n+=di(r>>>10&1023|55296),r=56320|r&1023),n+=di(r);return n}function Ap(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 ba(i,e){return di(i>>e&63|128)}function Qy(i,e){if((i&4294967168)==0)return di(i);var t="";return(i&4294965248)==0?t=di(i>>6&31|192):(i&4294901760)==0?(Ap(i,e)||(i=65533),t=di(i>>12&15|224),t+=ba(i,6)):(i&4292870144)==0&&(t=di(i>>18&7|240),t+=ba(i,12),t+=ba(i,6)),t+=di(i&63|128),t}function eb(i,e){e=e||{};for(var t=e.strict!==!1,r=Op(i),n=r.length,s=-1,o,c="";++s<n;)o=r[s],c+=Qy(o,t);return c}function Ji(){if(fi>=Wn)throw Error("Invalid byte index");var i=zn[fi]&255;if(fi++,(i&192)==128)return i&63;throw Error("Invalid continuation byte")}function tb(i){var e,t,r,n,s;if(fi>Wn)throw Error("Invalid byte index");if(fi==Wn)return!1;if(e=zn[fi]&255,fi++,(e&128)==0)return e;if((e&224)==192){if(t=Ji(),s=(e&31)<<6|t,s>=128)return s;throw Error("Invalid continuation byte")}if((e&240)==224){if(t=Ji(),r=Ji(),s=(e&15)<<12|t<<6|r,s>=2048)return Ap(s,i)?s:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(t=Ji(),r=Ji(),n=Ji(),s=(e&7)<<18|t<<12|r<<6|n,s>=65536&&s<=1114111))return s;throw Error("Invalid UTF-8 detected")}var zn,Wn,fi;function ib(i,e){e=e||{};var t=e.strict!==!1;zn=Op(i),Wn=zn.length,fi=0;for(var r=[],n;(n=tb(t))!==!1;)r.push(n);return Zy(r)}Rp.exports={version:"2.1.2",encode:eb,decode:ib}});var Fp=T(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.packets=Fe.protocol=void 0;Fe.encodePacket=wa;Fe.encodeBase64Packet=Ip;Fe.decodePacket=_a;Fe.decodeBase64Packet=Dp;Fe.encodePayload=ob;Fe.decodePayload=cb;Fe.encodePayloadAsBinary=Lp;Fe.decodePayloadAsBinary=qp;var Np=Pp();Fe.protocol=3;var rb=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 Xi=Object.keys(Fe.packets),Rt={type:"error",data:"parser error"},nb=Buffer.concat([]);function wa(i,e,t,r){if(typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t=null),Buffer.isBuffer(i.data))return Bp(i,e,r);if(i.data&&(i.data.buffer||i.data)instanceof ArrayBuffer)return Bp({type:i.type,data:Sa(i.data)},e,r);var n=Fe.packets[i.type];return i.data!==void 0&&(n+=t?Np.encode(String(i.data),{strict:!1}):String(i.data)),r(""+n)}function Bp(i,e,t){if(!e)return Ip(i,t);var r=i.data,n=Buffer.allocUnsafe(1);return n[0]=Fe.packets[i.type],t(Buffer.concat([n,r]))}function Ip(i,e){var t=Buffer.isBuffer(i.data)?i.data:Sa(i.data),r="b"+Fe.packets[i.type];return r+=t.toString("base64"),e(r)}function _a(i,e,t){if(i===void 0)return Rt;let r;if(typeof i=="string")return r=i.charAt(0),r==="b"?Dp(i.slice(1),e):t&&(i=sb(i),i===!1)||Number(r)!=r||!Xi[r]?Rt:i.length>1?{type:Xi[r],data:i.slice(1)}:{type:Xi[r]};if(e==="arraybuffer"){var n=new Uint8Array(i);return r=n[0],{type:Xi[r],data:n.buffer.slice(1)}}return i instanceof ArrayBuffer&&(i=Sa(i)),r=i[0],{type:Xi[r],data:i.slice(1)}}function sb(i){try{i=Np.decode(i,{strict:!1})}catch{return!1}return i}function Dp(i,e){var t=Xi[i.charAt(0)],r=Buffer.from(i.slice(1),"base64");if(e==="arraybuffer"){for(var n=new Uint8Array(r.length),s=0;s<n.length;s++)n[s]=r[s];r=n.buffer}return{type:t,data:r}}function ob(i,e,t){if(typeof e=="function"&&(t=e,e=null),e&&rb(i))return Lp(i,t);if(!i.length)return t("0:");function r(n,s){wa(n,e,!1,function(o){s(null,ab(o))})}jp(i,r,function(n,s){return t(s.join(""))})}function ab(i){return i.length+":"+i}function jp(i,e,t){let r=new Array(i.length),n=0;for(let s=0;s<i.length;s++)e(i[s],(o,c)=>{r[s]=c,++n===i.length&&t(null,r)})}function cb(i,e,t){if(typeof i!="string")return qp(i,e,t);if(typeof e=="function"&&(t=e,e=null),i==="")return t(Rt,0,1);for(var r="",n,s,o,c=0,u=i.length;c<u;c++){var d=i.charAt(c);if(d!==":"){r+=d;continue}if(r===""||r!=(n=Number(r))||(s=i.slice(c+1,c+1+n),r!=s.length))return t(Rt,0,1);if(s.length){if(o=_a(s,e,!1),Rt.type===o.type&&Rt.data===o.data)return t(Rt,0,1);var f=t(o,c+n,u);if(f===!1)return}c+=n,r=""}if(r!=="")return t(Rt,0,1)}function lb(i){for(var e="",t=0,r=i.length;t<r;t++)e+=String.fromCharCode(i[t]);return e}function ub(i){for(var e=Buffer.allocUnsafe(i.length),t=0,r=i.length;t<r;t++)e.writeUInt8(i.charCodeAt(t),t);return e}function Sa(i){var e=i.byteLength||i.length,t=i.byteOffset||0;return Buffer.from(i.buffer||i,t,e)}function Lp(i,e){if(!i.length)return e(nb);jp(i,pb,function(t,r){return e(Buffer.concat(r))})}function pb(i,e){function t(r){var n=""+r.length,s;if(typeof r=="string"){s=Buffer.allocUnsafe(n.length+2),s[0]=0;for(var o=0;o<n.length;o++)s[o+1]=parseInt(n[o],10);return s[s.length-1]=255,e(null,Buffer.concat([s,ub(r)]))}s=Buffer.allocUnsafe(n.length+2),s[0]=1;for(var o=0;o<n.length;o++)s[o+1]=parseInt(n[o],10);s[s.length-1]=255,e(null,Buffer.concat([s,r]))}wa(i,!0,!0,t)}function qp(i,e,t){typeof e=="function"&&(t=e,e=null);for(var r=i,n=[],s;r.length>0;){var o="",c=r[0]===0;for(s=1;r[s]!==255;s++){if(o.length>310)return t(Rt,0,1);o+=""+r[s]}r=r.slice(o.length+1);var u=parseInt(o,10),d=r.slice(1,u+1);c&&(d=lb(d)),n.push(d),r=r.slice(u+1)}var f=n.length;for(s=0;s<f;s++){var v=n[s];t(_a(v,e,!0),s,f)}}});var Hp=T((Kk,Up)=>{var Zi=1e3,Qi=Zi*60,er=Qi*60,Ci=er*24,db=Ci*7,fb=Ci*365.25;Up.exports=function(i,e){e=e||{};var t=typeof i;if(t==="string"&&i.length>0)return hb(i);if(t==="number"&&isFinite(i))return e.long?vb(i):mb(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function hb(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]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return t*fb;case"weeks":case"week":case"w":return t*db;case"days":case"day":case"d":return t*Ci;case"hours":case"hour":case"hrs":case"hr":case"h":return t*er;case"minutes":case"minute":case"mins":case"min":case"m":return t*Qi;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 mb(i){var e=Math.abs(i);return e>=Ci?Math.round(i/Ci)+"d":e>=er?Math.round(i/er)+"h":e>=Qi?Math.round(i/Qi)+"m":e>=Zi?Math.round(i/Zi)+"s":i+"ms"}function vb(i){var e=Math.abs(i);return e>=Ci?$n(i,e,Ci,"day"):e>=er?$n(i,e,er,"hour"):e>=Qi?$n(i,e,Qi,"minute"):e>=Zi?$n(i,e,Zi,"second"):i+" ms"}function $n(i,e,t,r){var n=e>=t*1.5;return Math.round(i/t)+" "+r+(n?"s":"")}});var Ea=T((Gk,zp)=>{function gb(i){t.debug=t,t.default=t,t.coerce=u,t.disable=o,t.enable=n,t.enabled=c,t.humanize=Hp(),t.destroy=d,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),I=A-(v||A);O.diff=I,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,Le)=>{if(te==="%%")return"%";U++;let q=t.formatters[Le];if(typeof q=="function"){let qe=M[U];te=q.call(O,qe),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=r,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 r(f,v){let _=t(this.namespace+(typeof v>"u"?":":v)+f);return _.log=this.log,_}function n(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 s(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 c(f){for(let v of t.skips)if(s(f,v))return!1;for(let v of t.names)if(s(f,v))return!0;return!1}function u(f){return f instanceof Error?f.stack||f.message:f}function d(){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}zp.exports=gb});var Wp=T((nt,Vn)=>{nt.formatArgs=yb;nt.save=bb;nt.load=wb;nt.useColors=xb;nt.storage=_b();nt.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`."))}})();nt.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 xb(){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 yb(i){if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+Vn.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;i.splice(1,0,e,"color: inherit");let t=0,r=0;i[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(t++,n==="%c"&&(r=t))}),i.splice(r,0,e)}nt.log=console.debug||console.log||(()=>{});function bb(i){try{i?nt.storage.setItem("debug",i):nt.storage.removeItem("debug")}catch{}}function wb(){let i;try{i=nt.storage.getItem("debug")||nt.storage.getItem("DEBUG")}catch{}return!i&&typeof process<"u"&&"env"in process&&(i=process.env.DEBUG),i}function _b(){try{return localStorage}catch{}}Vn.exports=Ea()(nt);var{formatters:Sb}=Vn.exports;Sb.j=function(i){try{return JSON.stringify(i)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Vp=T((Yk,$p)=>{"use strict";$p.exports=(i,e=process.argv)=>{let t=i.startsWith("-")?"":i.length===1?"-":"--",r=e.indexOf(t+i),n=e.indexOf("--");return r!==-1&&(n===-1||r<n)}});var Yp=T((Jk,Gp)=>{"use strict";var Eb=require("os"),Kp=require("tty"),vt=Vp(),{env:Ue}=process,hi;vt("no-color")||vt("no-colors")||vt("color=false")||vt("color=never")?hi=0:(vt("color")||vt("colors")||vt("color=true")||vt("color=always"))&&(hi=1);"FORCE_COLOR"in Ue&&(Ue.FORCE_COLOR==="true"?hi=1:Ue.FORCE_COLOR==="false"?hi=0:hi=Ue.FORCE_COLOR.length===0?1:Math.min(parseInt(Ue.FORCE_COLOR,10),3));function Ca(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function Ta(i,e){if(hi===0)return 0;if(vt("color=16m")||vt("color=full")||vt("color=truecolor"))return 3;if(vt("color=256"))return 2;if(i&&!e&&hi===void 0)return 0;let t=hi||0;if(Ue.TERM==="dumb")return t;if(process.platform==="win32"){let r=Eb.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Ue)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r 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 r=parseInt((Ue.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ue.TERM_PROGRAM){case"iTerm.app":return r>=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 Cb(i){let e=Ta(i,i&&i.isTTY);return Ca(e)}Gp.exports={supportsColor:Cb,stdout:Ca(Ta(!0,Kp.isatty(1))),stderr:Ca(Ta(!0,Kp.isatty(2)))}});var Xp=T((He,Gn)=>{var Tb=require("tty"),Kn=require("util");He.init=Bb;He.log=Ab;He.formatArgs=Mb;He.save=Rb;He.load=Pb;He.useColors=kb;He.destroy=Kn.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=Yp();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,(n,s)=>s.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),i[t]=r,i},{});function kb(){return"colors"in He.inspectOpts?!!He.inspectOpts.colors:Tb.isatty(process.stderr.fd)}function Mb(i){let{namespace:e,useColors:t}=this;if(t){let r=this.color,n="\x1B[3"+(r<8?r:"8;5;"+r),s=` ${n};1m${e} \x1B[0m`;i[0]=s+i[0].split(`
|
|
2
|
+
var Q0=Object.create;var In=Object.defineProperty;var ey=Object.getOwnPropertyDescriptor;var ty=Object.getOwnPropertyNames;var iy=Object.getPrototypeOf,ry=Object.prototype.hasOwnProperty;var Si=(i,e)=>()=>(i&&(e=i(i=0)),e);var T=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),Ei=(i,e)=>{for(var t in e)In(i,t,{get:e[t],enumerable:!0})},$u=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ty(e))!ry.call(i,n)&&n!==t&&In(i,n,{get:()=>e[n],enumerable:!(r=ey(e,n))||r.enumerable});return i};var L=(i,e,t)=>(t=i!=null?Q0(iy(i)):{},$u(e||!i||!i.__esModule?In(t,"default",{value:i,enumerable:!0}):t,i)),ny=i=>$u(In({},"__esModule",{value:!0}),i);var Yu=T((Pk,la)=>{"use strict";la.exports=Gu;la.exports.preferredCharsets=Gu;var sy=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function oy(i){for(var e=i.split(","),t=0,r=0;t<e.length;t++){var n=ay(e[t].trim(),t);n&&(e[r++]=n)}return e.length=r,e}function ay(i,e){var t=sy.exec(i);if(!t)return null;var r=t[1],n=1;if(t[2])for(var s=t[2].split(";"),o=0;o<s.length;o++){var c=s[o].trim().split("=");if(c[0]==="q"){n=parseFloat(c[1]);break}}return{charset:r,q:n,i:e}}function cy(i,e,t){for(var r={o:-1,q:0,s:0},n=0;n<e.length;n++){var s=ly(i,e[n],t);s&&(r.s-s.s||r.q-s.q||r.o-s.o)<0&&(r=s)}return r}function ly(i,e,t){var r=0;if(e.charset.toLowerCase()===i.toLowerCase())r|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:r}}function Gu(i,e){var t=oy(i===void 0?"*":i||"");if(!e)return t.filter(Ku).sort(Vu).map(uy);var r=e.map(function(s,o){return cy(s,t,o)});return r.filter(Ku).sort(Vu).map(function(s){return e[r.indexOf(s)]})}function Vu(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function uy(i){return i.charset}function Ku(i){return i.q>0}});var ep=T((Bk,ua)=>{"use strict";ua.exports=Qu;ua.exports.preferredEncodings=Qu;var py=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function dy(i){for(var e=i.split(","),t=!1,r=1,n=0,s=0;n<e.length;n++){var o=fy(e[n].trim(),n);o&&(e[s++]=o,t=t||Zu("identity",o),r=Math.min(r,o.q||1))}return t||(e[s++]={encoding:"identity",q:r,i:n}),e.length=s,e}function fy(i,e){var t=py.exec(i);if(!t)return null;var r=t[1],n=1;if(t[2])for(var s=t[2].split(";"),o=0;o<s.length;o++){var c=s[o].trim().split("=");if(c[0]==="q"){n=parseFloat(c[1]);break}}return{encoding:r,q:n,i:e}}function hy(i,e,t){for(var r={o:-1,q:0,s:0},n=0;n<e.length;n++){var s=Zu(i,e[n],t);s&&(r.s-s.s||r.q-s.q||r.o-s.o)<0&&(r=s)}return r}function Zu(i,e,t){var r=0;if(e.encoding.toLowerCase()===i.toLowerCase())r|=1;else if(e.encoding!=="*")return null;return{i:t,o:e.i,q:e.q,s:r}}function Qu(i,e){var t=dy(i||"");if(!e)return t.filter(Xu).sort(Ju).map(my);var r=e.map(function(s,o){return hy(s,t,o)});return r.filter(Xu).sort(Ju).map(function(s){return e[r.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 my(i){return i.encoding}function Xu(i){return i.q>0}});var sp=T((Nk,pa)=>{"use strict";pa.exports=np;pa.exports.preferredLanguages=np;var vy=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function gy(i){for(var e=i.split(","),t=0,r=0;t<e.length;t++){var n=rp(e[t].trim(),t);n&&(e[r++]=n)}return e.length=r,e}function rp(i,e){var t=vy.exec(i);if(!t)return null;var r=t[1],n=t[2],s=r;n&&(s+="-"+n);var o=1;if(t[3])for(var c=t[3].split(";"),u=0;u<c.length;u++){var d=c[u].split("=");d[0]==="q"&&(o=parseFloat(d[1]))}return{prefix:r,suffix:n,q:o,i:e,full:s}}function xy(i,e,t){for(var r={o:-1,q:0,s:0},n=0;n<e.length;n++){var s=yy(i,e[n],t);s&&(r.s-s.s||r.q-s.q||r.o-s.o)<0&&(r=s)}return r}function yy(i,e,t){var r=rp(i);if(!r)return null;var n=0;if(e.full.toLowerCase()===r.full.toLowerCase())n|=4;else if(e.prefix.toLowerCase()===r.full.toLowerCase())n|=2;else if(e.full.toLowerCase()===r.prefix.toLowerCase())n|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function np(i,e){var t=gy(i===void 0?"*":i||"");if(!e)return t.filter(ip).sort(tp).map(by);var r=e.map(function(s,o){return xy(s,t,o)});return r.filter(ip).sort(tp).map(function(s){return e[r.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 by(i){return i.full}function ip(i){return i.q>0}});var pp=T((Ik,da)=>{"use strict";da.exports=lp;da.exports.preferredMediaTypes=lp;var wy=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function _y(i){for(var e=ky(i),t=0,r=0;t<e.length;t++){var n=cp(e[t].trim(),t);n&&(e[r++]=n)}return e.length=r,e}function cp(i,e){var t=wy.exec(i);if(!t)return null;var r=Object.create(null),n=1,s=t[2],o=t[1];if(t[3])for(var c=My(t[3]).map(Ty),u=0;u<c.length;u++){var d=c[u],f=d[0].toLowerCase(),v=d[1],_=v&&v[0]==='"'&&v[v.length-1]==='"'?v.substr(1,v.length-2):v;if(f==="q"){n=parseFloat(_);break}r[f]=_}return{type:o,subtype:s,params:r,q:n,i:e}}function Sy(i,e,t){for(var r={o:-1,q:0,s:0},n=0;n<e.length;n++){var s=Ey(i,e[n],t);s&&(r.s-s.s||r.q-s.q||r.o-s.o)<0&&(r=s)}return r}function Ey(i,e,t){var r=cp(i),n=0;if(!r)return null;if(e.type.toLowerCase()==r.type.toLowerCase())n|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==r.subtype.toLowerCase())n|=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()==(r.params[o]||"").toLowerCase()}))n|=1;else return null;return{i:t,o:e.i,q:e.q,s:n}}function lp(i,e){var t=_y(i===void 0?"*/*":i||"");if(!e)return t.filter(ap).sort(op).map(Cy);var r=e.map(function(s,o){return Sy(s,t,o)});return r.filter(ap).sort(op).map(function(s){return e[r.indexOf(s)]})}function op(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function Cy(i){return i.type+"/"+i.subtype}function ap(i){return i.q>0}function up(i){for(var e=0,t=0;(t=i.indexOf('"',t))!==-1;)e++,t++;return e}function Ty(i){var e=i.indexOf("="),t,r;return e===-1?t=i:(t=i.substr(0,e),r=i.substr(e+1)),[t,r]}function ky(i){for(var e=i.split(","),t=1,r=0;t<e.length;t++)up(e[r])%2==0?e[++r]=e[t]:e[r]+=","+e[t];return e.length=r+1,e}function My(i){for(var e=i.split(";"),t=1,r=0;t<e.length;t++)up(e[r])%2==0?e[++r]=e[t]:e[r]+=";"+e[t];e.length=r+1;for(var t=0;t<e.length;t++)e[t]=e[t].trim();return e}});var dp=T((Dk,fa)=>{"use strict";var Oy=Yu(),Ay=ep(),Ry=sp(),Py=pp();fa.exports=H;fa.exports.Negotiator=H;function H(i){if(!(this instanceof H))return new H(i);this.request=i}H.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]};H.prototype.charsets=function(e){return Oy(this.request.headers["accept-charset"],e)};H.prototype.encoding=function(e){var t=this.encodings(e);return t&&t[0]};H.prototype.encodings=function(e){return Ay(this.request.headers["accept-encoding"],e)};H.prototype.language=function(e){var t=this.languages(e);return t&&t[0]};H.prototype.languages=function(e){return Ry(this.request.headers["accept-language"],e)};H.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]};H.prototype.mediaTypes=function(e){return Py(this.request.headers.accept,e)};H.prototype.preferredCharset=H.prototype.charset;H.prototype.preferredCharsets=H.prototype.charsets;H.prototype.preferredEncoding=H.prototype.encoding;H.prototype.preferredEncodings=H.prototype.encodings;H.prototype.preferredLanguage=H.prototype.language;H.prototype.preferredLanguages=H.prototype.languages;H.prototype.preferredMediaType=H.prototype.mediaType;H.prototype.preferredMediaTypes=H.prototype.mediaTypes});var fp=T((jk,By)=>{By.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 mp=T((Lk,hp)=>{hp.exports=fp()});var xp=T(it=>{"use strict";var Dn=mp(),Ny=require("path").extname,vp=/^\s*([^;\s]*)(?:;|\s|$)/,Iy=/^text\//i;it.charset=gp;it.charsets={lookup:gp};it.contentType=Dy;it.extension=jy;it.extensions=Object.create(null);it.lookup=Ly;it.types=Object.create(null);qy(it.extensions,it.types);function gp(i){if(!i||typeof i!="string")return!1;var e=vp.exec(i),t=e&&Dn[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&Iy.test(e[1])?"UTF-8":!1}function Dy(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 jy(i){if(!i||typeof i!="string")return!1;var e=vp.exec(i),t=e&&it.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function Ly(i){if(!i||typeof i!="string")return!1;var e=Ny("x."+i).toLowerCase().substr(1);return e&&it.types[e]||!1}function qy(i,e){var t=["nginx","apache",void 0,"iana"];Object.keys(Dn).forEach(function(n){var s=Dn[n],o=s.extensions;if(!(!o||!o.length)){i[n]=o;for(var c=0;c<o.length;c++){var u=o[c];if(e[u]){var d=t.indexOf(Dn[e[u]].source),f=t.indexOf(s.source);if(e[u]!=="application/octet-stream"&&(d>f||d===f&&e[u].substr(0,12)==="application/"))continue}e[u]=n}}})}});var jn=T((Fk,yp)=>{"use strict";var Fy=dp(),Uy=xp();yp.exports=lt;function lt(i){if(!(this instanceof lt))return new lt(i);this.headers=i.headers,this.negotiator=new Fy(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 r=e.map(Hy),n=this.negotiator.mediaTypes(r.filter(zy)),s=n[0];return s?e[r.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 Hy(i){return i.indexOf("/")===-1?Uy.lookup(i):i}function zy(i){return typeof i=="string"}});var ma=T((bp,wp)=>{var Yr=require("crypto"),ha=function(){};ha.prototype.getRandomBytes=function(i){var e=4096,t=this;if(i=i||12,i>e)return Yr.randomBytes(i);var r=parseInt(e/i),n=parseInt(r*.85);if(!n||(this.bytesBufferIndex==null&&(this.bytesBufferIndex=-1),this.bytesBufferIndex==r&&(this.bytesBuffer=null,this.bytesBufferIndex=-1),(this.bytesBufferIndex==-1||this.bytesBufferIndex>n)&&(this.isGeneratingBytes||(this.isGeneratingBytes=!0,Yr.randomBytes(e,function(o,c){t.bytesBuffer=c,t.bytesBufferIndex=0,t.isGeneratingBytes=!1})),this.bytesBufferIndex==-1)))return Yr.randomBytes(i);var s=this.bytesBuffer.slice(i*this.bytesBufferIndex,i*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,s};ha.prototype.generateId=function(){var i=Buffer.alloc(15);return i.writeInt32BE?(this.sequenceNumber=this.sequenceNumber+1|0,i.writeInt32BE(this.sequenceNumber,11),Yr.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()};bp=wp.exports=new ha});var Ln=T(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.ERROR_PACKET=pi.PACKET_TYPES_REVERSE=pi.PACKET_TYPES=void 0;var Ut=Object.create(null);pi.PACKET_TYPES=Ut;Ut.open="0";Ut.close="1";Ut.ping="2";Ut.pong="3";Ut.message="4";Ut.upgrade="5";Ut.noop="6";var _p=Object.create(null);pi.PACKET_TYPES_REVERSE=_p;Object.keys(Ut).forEach(i=>{_p[Ut[i]]=i});var Wy={type:"error",data:"parser error"};pi.ERROR_PACKET=Wy});var Ep=T(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.encodePacket=void 0;Yi.encodePacketToBinary=Ky;var $y=Ln(),Vy=({type:i,data:e},t,r)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?r(t?e:"b"+Sp(e,!0).toString("base64")):r($y.PACKET_TYPES[i]+(e||""));Yi.encodePacket=Vy;var Sp=(i,e)=>Buffer.isBuffer(i)||i instanceof Uint8Array&&!e?i:i instanceof ArrayBuffer?Buffer.from(i):Buffer.from(i.buffer,i.byteOffset,i.byteLength),va;function Ky(i,e){if(i.data instanceof ArrayBuffer||ArrayBuffer.isView(i.data))return e(Sp(i.data,!1));(0,Yi.encodePacket)(i,!0,t=>{va||(va=new TextEncoder),e(va.encode(t))})}});var Tp=T(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.decodePacket=void 0;var qn=Ln(),Gy=(i,e)=>{if(typeof i!="string")return{type:"message",data:Cp(i,e)};let t=i.charAt(0);if(t==="b"){let r=Buffer.from(i.substring(1),"base64");return{type:"message",data:Cp(r,e)}}return qn.PACKET_TYPES_REVERSE[t]?i.length>1?{type:qn.PACKET_TYPES_REVERSE[t],data:i.substring(1)}:{type:qn.PACKET_TYPES_REVERSE[t]}:qn.ERROR_PACKET};Fn.decodePacket=Gy;var Cp=(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 Jr=T(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.decodePayload=rt.decodePacket=rt.encodePayload=rt.encodePacket=rt.protocol=void 0;rt.createPacketEncoderStream=Xy;rt.createPacketDecoderStream=Zy;var xa=Ep();Object.defineProperty(rt,"encodePacket",{enumerable:!0,get:function(){return xa.encodePacket}});var ya=Tp();Object.defineProperty(rt,"decodePacket",{enumerable:!0,get:function(){return ya.decodePacket}});var kp=Ln(),Mp="",Yy=(i,e)=>{let t=i.length,r=new Array(t),n=0;i.forEach((s,o)=>{(0,xa.encodePacket)(s,!1,c=>{r[o]=c,++n===t&&e(r.join(Mp))})})};rt.encodePayload=Yy;var Jy=(i,e)=>{let t=i.split(Mp),r=[];for(let n=0;n<t.length;n++){let s=(0,ya.decodePacket)(t[n],e);if(r.push(s),s.type==="error")break}return r};rt.decodePayload=Jy;function Xy(){return new TransformStream({transform(i,e){(0,xa.encodePacketToBinary)(i,t=>{let r=t.length,n;if(r<126)n=new Uint8Array(1),new DataView(n.buffer).setUint8(0,r);else if(r<65536){n=new Uint8Array(3);let s=new DataView(n.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{n=new Uint8Array(9);let s=new DataView(n.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}i.data&&typeof i.data!="string"&&(n[0]|=128),e.enqueue(n),e.enqueue(t)})}})}var ga;function Un(i){return i.reduce((e,t)=>e+t.length,0)}function Hn(i,e){if(i[0].length===e)return i.shift();let t=new Uint8Array(e),r=0;for(let n=0;n<e;n++)t[n]=i[0][r++],r===i[0].length&&(i.shift(),r=0);return i.length&&r<i[0].length&&(i[0]=i[0].slice(r)),t}function Zy(i,e){ga||(ga=new TextDecoder);let t=[],r=0,n=-1,s=!1;return new TransformStream({transform(o,c){for(t.push(o);;){if(r===0){if(Un(t)<1)break;let u=Hn(t,1);s=(u[0]&128)===128,n=u[0]&127,n<126?r=3:n===126?r=1:r=2}else if(r===1){if(Un(t)<2)break;let u=Hn(t,2);n=new DataView(u.buffer,u.byteOffset,u.length).getUint16(0),r=3}else if(r===2){if(Un(t)<8)break;let u=Hn(t,8),d=new DataView(u.buffer,u.byteOffset,u.length),f=d.getUint32(0);if(f>Math.pow(2,21)-1){c.enqueue(kp.ERROR_PACKET);break}n=f*Math.pow(2,32)+d.getUint32(4),r=3}else{if(Un(t)<n)break;let u=Hn(t,n);c.enqueue((0,ya.decodePacket)(s?u:ga.decode(u),e)),r=0}if(n===0||n>i){c.enqueue(kp.ERROR_PACKET);break}}}})}rt.protocol=4});var Pp=T(($k,Rp)=>{var di=String.fromCharCode;function Op(i){for(var e=[],t=0,r=i.length,n,s;t<r;)n=i.charCodeAt(t++),n>=55296&&n<=56319&&t<r?(s=i.charCodeAt(t++),(s&64512)==56320?e.push(((n&1023)<<10)+(s&1023)+65536):(e.push(n),t--)):e.push(n);return e}function Qy(i){for(var e=i.length,t=-1,r,n="";++t<e;)r=i[t],r>65535&&(r-=65536,n+=di(r>>>10&1023|55296),r=56320|r&1023),n+=di(r);return n}function Ap(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 ba(i,e){return di(i>>e&63|128)}function eb(i,e){if((i&4294967168)==0)return di(i);var t="";return(i&4294965248)==0?t=di(i>>6&31|192):(i&4294901760)==0?(Ap(i,e)||(i=65533),t=di(i>>12&15|224),t+=ba(i,6)):(i&4292870144)==0&&(t=di(i>>18&7|240),t+=ba(i,12),t+=ba(i,6)),t+=di(i&63|128),t}function tb(i,e){e=e||{};for(var t=e.strict!==!1,r=Op(i),n=r.length,s=-1,o,c="";++s<n;)o=r[s],c+=eb(o,t);return c}function Ji(){if(fi>=Wn)throw Error("Invalid byte index");var i=zn[fi]&255;if(fi++,(i&192)==128)return i&63;throw Error("Invalid continuation byte")}function ib(i){var e,t,r,n,s;if(fi>Wn)throw Error("Invalid byte index");if(fi==Wn)return!1;if(e=zn[fi]&255,fi++,(e&128)==0)return e;if((e&224)==192){if(t=Ji(),s=(e&31)<<6|t,s>=128)return s;throw Error("Invalid continuation byte")}if((e&240)==224){if(t=Ji(),r=Ji(),s=(e&15)<<12|t<<6|r,s>=2048)return Ap(s,i)?s:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(t=Ji(),r=Ji(),n=Ji(),s=(e&7)<<18|t<<12|r<<6|n,s>=65536&&s<=1114111))return s;throw Error("Invalid UTF-8 detected")}var zn,Wn,fi;function rb(i,e){e=e||{};var t=e.strict!==!1;zn=Op(i),Wn=zn.length,fi=0;for(var r=[],n;(n=ib(t))!==!1;)r.push(n);return Qy(r)}Rp.exports={version:"2.1.2",encode:tb,decode:rb}});var Fp=T(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.packets=Fe.protocol=void 0;Fe.encodePacket=wa;Fe.encodeBase64Packet=Ip;Fe.decodePacket=_a;Fe.decodeBase64Packet=Dp;Fe.encodePayload=ab;Fe.decodePayload=lb;Fe.encodePayloadAsBinary=Lp;Fe.decodePayloadAsBinary=qp;var Np=Pp();Fe.protocol=3;var nb=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 Xi=Object.keys(Fe.packets),Rt={type:"error",data:"parser error"},sb=Buffer.concat([]);function wa(i,e,t,r){if(typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t=null),Buffer.isBuffer(i.data))return Bp(i,e,r);if(i.data&&(i.data.buffer||i.data)instanceof ArrayBuffer)return Bp({type:i.type,data:Sa(i.data)},e,r);var n=Fe.packets[i.type];return i.data!==void 0&&(n+=t?Np.encode(String(i.data),{strict:!1}):String(i.data)),r(""+n)}function Bp(i,e,t){if(!e)return Ip(i,t);var r=i.data,n=Buffer.allocUnsafe(1);return n[0]=Fe.packets[i.type],t(Buffer.concat([n,r]))}function Ip(i,e){var t=Buffer.isBuffer(i.data)?i.data:Sa(i.data),r="b"+Fe.packets[i.type];return r+=t.toString("base64"),e(r)}function _a(i,e,t){if(i===void 0)return Rt;let r;if(typeof i=="string")return r=i.charAt(0),r==="b"?Dp(i.slice(1),e):t&&(i=ob(i),i===!1)||Number(r)!=r||!Xi[r]?Rt:i.length>1?{type:Xi[r],data:i.slice(1)}:{type:Xi[r]};if(e==="arraybuffer"){var n=new Uint8Array(i);return r=n[0],{type:Xi[r],data:n.buffer.slice(1)}}return i instanceof ArrayBuffer&&(i=Sa(i)),r=i[0],{type:Xi[r],data:i.slice(1)}}function ob(i){try{i=Np.decode(i,{strict:!1})}catch{return!1}return i}function Dp(i,e){var t=Xi[i.charAt(0)],r=Buffer.from(i.slice(1),"base64");if(e==="arraybuffer"){for(var n=new Uint8Array(r.length),s=0;s<n.length;s++)n[s]=r[s];r=n.buffer}return{type:t,data:r}}function ab(i,e,t){if(typeof e=="function"&&(t=e,e=null),e&&nb(i))return Lp(i,t);if(!i.length)return t("0:");function r(n,s){wa(n,e,!1,function(o){s(null,cb(o))})}jp(i,r,function(n,s){return t(s.join(""))})}function cb(i){return i.length+":"+i}function jp(i,e,t){let r=new Array(i.length),n=0;for(let s=0;s<i.length;s++)e(i[s],(o,c)=>{r[s]=c,++n===i.length&&t(null,r)})}function lb(i,e,t){if(typeof i!="string")return qp(i,e,t);if(typeof e=="function"&&(t=e,e=null),i==="")return t(Rt,0,1);for(var r="",n,s,o,c=0,u=i.length;c<u;c++){var d=i.charAt(c);if(d!==":"){r+=d;continue}if(r===""||r!=(n=Number(r))||(s=i.slice(c+1,c+1+n),r!=s.length))return t(Rt,0,1);if(s.length){if(o=_a(s,e,!1),Rt.type===o.type&&Rt.data===o.data)return t(Rt,0,1);var f=t(o,c+n,u);if(f===!1)return}c+=n,r=""}if(r!=="")return t(Rt,0,1)}function ub(i){for(var e="",t=0,r=i.length;t<r;t++)e+=String.fromCharCode(i[t]);return e}function pb(i){for(var e=Buffer.allocUnsafe(i.length),t=0,r=i.length;t<r;t++)e.writeUInt8(i.charCodeAt(t),t);return e}function Sa(i){var e=i.byteLength||i.length,t=i.byteOffset||0;return Buffer.from(i.buffer||i,t,e)}function Lp(i,e){if(!i.length)return e(sb);jp(i,db,function(t,r){return e(Buffer.concat(r))})}function db(i,e){function t(r){var n=""+r.length,s;if(typeof r=="string"){s=Buffer.allocUnsafe(n.length+2),s[0]=0;for(var o=0;o<n.length;o++)s[o+1]=parseInt(n[o],10);return s[s.length-1]=255,e(null,Buffer.concat([s,pb(r)]))}s=Buffer.allocUnsafe(n.length+2),s[0]=1;for(var o=0;o<n.length;o++)s[o+1]=parseInt(n[o],10);s[s.length-1]=255,e(null,Buffer.concat([s,r]))}wa(i,!0,!0,t)}function qp(i,e,t){typeof e=="function"&&(t=e,e=null);for(var r=i,n=[],s;r.length>0;){var o="",c=r[0]===0;for(s=1;r[s]!==255;s++){if(o.length>310)return t(Rt,0,1);o+=""+r[s]}r=r.slice(o.length+1);var u=parseInt(o,10),d=r.slice(1,u+1);c&&(d=ub(d)),n.push(d),r=r.slice(u+1)}var f=n.length;for(s=0;s<f;s++){var v=n[s];t(_a(v,e,!0),s,f)}}});var Hp=T((Kk,Up)=>{var Zi=1e3,Qi=Zi*60,er=Qi*60,Ci=er*24,fb=Ci*7,hb=Ci*365.25;Up.exports=function(i,e){e=e||{};var t=typeof i;if(t==="string"&&i.length>0)return mb(i);if(t==="number"&&isFinite(i))return e.long?gb(i):vb(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function mb(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]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return t*hb;case"weeks":case"week":case"w":return t*fb;case"days":case"day":case"d":return t*Ci;case"hours":case"hour":case"hrs":case"hr":case"h":return t*er;case"minutes":case"minute":case"mins":case"min":case"m":return t*Qi;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 vb(i){var e=Math.abs(i);return e>=Ci?Math.round(i/Ci)+"d":e>=er?Math.round(i/er)+"h":e>=Qi?Math.round(i/Qi)+"m":e>=Zi?Math.round(i/Zi)+"s":i+"ms"}function gb(i){var e=Math.abs(i);return e>=Ci?$n(i,e,Ci,"day"):e>=er?$n(i,e,er,"hour"):e>=Qi?$n(i,e,Qi,"minute"):e>=Zi?$n(i,e,Zi,"second"):i+" ms"}function $n(i,e,t,r){var n=e>=t*1.5;return Math.round(i/t)+" "+r+(n?"s":"")}});var Ea=T((Gk,zp)=>{function xb(i){t.debug=t,t.default=t,t.coerce=u,t.disable=o,t.enable=n,t.enabled=c,t.humanize=Hp(),t.destroy=d,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),I=A-(v||A);O.diff=I,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,Le)=>{if(te==="%%")return"%";U++;let q=t.formatters[Le];if(typeof q=="function"){let qe=M[U];te=q.call(O,qe),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=r,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 r(f,v){let _=t(this.namespace+(typeof v>"u"?":":v)+f);return _.log=this.log,_}function n(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 s(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 c(f){for(let v of t.skips)if(s(f,v))return!1;for(let v of t.names)if(s(f,v))return!0;return!1}function u(f){return f instanceof Error?f.stack||f.message:f}function d(){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}zp.exports=xb});var Wp=T((nt,Vn)=>{nt.formatArgs=bb;nt.save=wb;nt.load=_b;nt.useColors=yb;nt.storage=Sb();nt.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`."))}})();nt.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 yb(){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 bb(i){if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+Vn.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;i.splice(1,0,e,"color: inherit");let t=0,r=0;i[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(t++,n==="%c"&&(r=t))}),i.splice(r,0,e)}nt.log=console.debug||console.log||(()=>{});function wb(i){try{i?nt.storage.setItem("debug",i):nt.storage.removeItem("debug")}catch{}}function _b(){let i;try{i=nt.storage.getItem("debug")||nt.storage.getItem("DEBUG")}catch{}return!i&&typeof process<"u"&&"env"in process&&(i=process.env.DEBUG),i}function Sb(){try{return localStorage}catch{}}Vn.exports=Ea()(nt);var{formatters:Eb}=Vn.exports;Eb.j=function(i){try{return JSON.stringify(i)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Vp=T((Yk,$p)=>{"use strict";$p.exports=(i,e=process.argv)=>{let t=i.startsWith("-")?"":i.length===1?"-":"--",r=e.indexOf(t+i),n=e.indexOf("--");return r!==-1&&(n===-1||r<n)}});var Yp=T((Jk,Gp)=>{"use strict";var Cb=require("os"),Kp=require("tty"),vt=Vp(),{env:Ue}=process,hi;vt("no-color")||vt("no-colors")||vt("color=false")||vt("color=never")?hi=0:(vt("color")||vt("colors")||vt("color=true")||vt("color=always"))&&(hi=1);"FORCE_COLOR"in Ue&&(Ue.FORCE_COLOR==="true"?hi=1:Ue.FORCE_COLOR==="false"?hi=0:hi=Ue.FORCE_COLOR.length===0?1:Math.min(parseInt(Ue.FORCE_COLOR,10),3));function Ca(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function Ta(i,e){if(hi===0)return 0;if(vt("color=16m")||vt("color=full")||vt("color=truecolor"))return 3;if(vt("color=256"))return 2;if(i&&!e&&hi===void 0)return 0;let t=hi||0;if(Ue.TERM==="dumb")return t;if(process.platform==="win32"){let r=Cb.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Ue)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r 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 r=parseInt((Ue.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ue.TERM_PROGRAM){case"iTerm.app":return r>=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 Tb(i){let e=Ta(i,i&&i.isTTY);return Ca(e)}Gp.exports={supportsColor:Tb,stdout:Ca(Ta(!0,Kp.isatty(1))),stderr:Ca(Ta(!0,Kp.isatty(2)))}});var Xp=T((He,Gn)=>{var kb=require("tty"),Kn=require("util");He.init=Nb;He.log=Rb;He.formatArgs=Ob;He.save=Pb;He.load=Bb;He.useColors=Mb;He.destroy=Kn.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=Yp();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,(n,s)=>s.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),i[t]=r,i},{});function Mb(){return"colors"in He.inspectOpts?!!He.inspectOpts.colors:kb.isatty(process.stderr.fd)}function Ob(i){let{namespace:e,useColors:t}=this;if(t){let r=this.color,n="\x1B[3"+(r<8?r:"8;5;"+r),s=` ${n};1m${e} \x1B[0m`;i[0]=s+i[0].split(`
|
|
3
3
|
`).join(`
|
|
4
|
-
`+s),i.push(n+"m+"+Gn.exports.humanize(this.diff)+"\x1B[0m")}else i[0]=
|
|
5
|
-
`)}function
|
|
6
|
-
`).map(e=>e.trim()).join(" ")};Jp.O=function(i){return this.inspectOpts.colors=this.useColors,Kn.inspect(i,this.inspectOpts)}});var ie=T((Xk,ka)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?ka.exports=Wp():ka.exports=Xp()});var Ti=T(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.Transport=void 0;var
|
|
7
|
-
`}),super.onData(e.replace($b,"\\n")))}doWrite(e,t,r){let n=JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");e=this.head+n+this.foot,super.doWrite(e,t,r)}};Zn.JSONP=Aa});var id=T(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.WebSocket=void 0;var Kb=Ti(),Gb=ie(),td=(0,Gb.default)("engine:ws"),Ra=class extends Kb.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,r)=>{let n=r?t:t.toString();td('received "%s"',n),super.onData(n)}),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 r=e[t],n=t+1===e.length;this._canSendPreEncodedFrame(r)?this.socket._sender.sendFrame(r.options.wsPreEncodedFrame,n?this._onSentLast:this._onSent):this.parser.encodePacket(r,this.supportsBinary,n?this._doSendLast:this._doSend)}}_canSendPreEncodedFrame(e){var t,r,n;return!this.perMessageDeflate&&typeof((r=(t=this.socket)===null||t===void 0?void 0:t._sender)===null||r===void 0?void 0:r.sendFrame)=="function"&&((n=e.options)===null||n===void 0?void 0:n.wsPreEncodedFrame)!==void 0}doClose(e){td("closing"),this.socket.close(),e&&e()}};Qn.WebSocket=Ra});var Ba=T(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.WebTransport=void 0;var Yb=Ti(),Jb=ie(),Xb=Jr(),tr=(0,Jb.default)("engine:webtransport"),Pa=class extends Yb.Transport{constructor(e,t,r){super({_query:{EIO:"4"}}),this.session=e;let n=(0,Xb.createPacketEncoderStream)();n.readable.pipeTo(t.writable).catch(()=>{tr("the stream was closed")}),this.writer=n.writable.getWriter(),(async()=>{try{for(;;){let{value:s,done:o}=await r.read();if(o){tr("session is closed");break}tr("received chunk: %o",s),this.onPacket(s)}}catch(s){tr("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 r=e[t];await this.writer.write(r)}}catch(t){tr("error while writing: %s",t.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(e){tr("closing WebTransport session"),this.session.close(),e&&e()}};es.WebTransport=Pa});var Ia=T(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});var Zb=Oa(),Qb=ed(),ew=id(),tw=Ba();Na.default={polling:rd,websocket:ew.WebSocket,webtransport:tw.WebTransport};function rd(i){return typeof i._query.j=="string"?new Qb.JSONP(i):new Zb.Polling(i)}rd.upgradesTo=["websocket","webtransport"]});var ja=T(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.Socket=void 0;var iw=require("events"),rw=ie(),Jt=require("timers"),re=(0,rw.default)("engine:socket"),Da=class extends iw.EventEmitter{get readyState(){return this._readyState}set readyState(e){re("readyState updated from %s to %s",this._readyState,e),this._readyState=e}constructor(e,t,r,n,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=n,this.protocol=s,n&&(n.websocket&&n.websocket._socket?this.remoteAddress=n.websocket._socket.remoteAddress:this.remoteAddress=n.connection.remoteAddress),this.pingTimeoutTimer=null,this.pingIntervalTimer=null,this.setTransport(r),this.onOpen()}onOpen(){this.readyState="open",this.transport.sid=this.id,this.sendPacket("open",JSON.stringify({sid:this.id,upgrades:this.getAvailableUpgrades(),pingInterval:this.server.opts.pingInterval,pingTimeout:this.server.opts.pingTimeout,maxPayload:this.server.opts.maxHttpBufferSize})),this.server.opts.initialPacket&&this.sendPacket("message",this.server.opts.initialPacket),this.emit("open"),this.protocol===3?this.resetPingTimeout():this.schedulePing()}onPacket(e){if(this.readyState!=="open")return re("packet received with closed socket");switch(re(`received packet ${e.type}`),this.emit("packet",e),e.type){case"ping":if(this.transport.protocol!==3){this.onError(new Error("invalid heartbeat direction"));return}re("got ping"),this.pingTimeoutTimer.refresh(),this.sendPacket("pong"),this.emit("heartbeat");break;case"pong":if(this.transport.protocol===3){this.onError(new Error("invalid heartbeat direction"));return}re("got pong"),(0,Jt.clearTimeout)(this.pingTimeoutTimer),this.pingIntervalTimer.refresh(),this.emit("heartbeat");break;case"error":this.onClose("parse error");break;case"message":this.emit("data",e.data),this.emit("message",e.data);break}}onError(e){re("transport error"),this.onClose("transport error",e)}schedulePing(){this.pingIntervalTimer=(0,Jt.setTimeout)(()=>{re("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){(0,Jt.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,Jt.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),r=()=>this.flush(),n=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",r),this.transport.on("packet",n),this.transport.on("drain",s),this.transport.once("close",o),this.cleanupFn.push(function(){e.removeListener("error",t),e.removeListener("ready",r),e.removeListener("packet",n),e.removeListener("drain",s),e.removeListener("close",o)})}onDrain(){if(this.sentCallbackFn.length>0){re("executing batch send callback");let e=this.sentCallbackFn.shift();if(e)for(let t=0;t<e.length;t++)e[t](this.transport)}}_maybeUpgrade(e){re('might upgrade socket transport from "%s" to "%s"',this.transport.name,e.name),this.upgrading=!0;let t=(0,Jt.setTimeout)(()=>{re("client did not complete upgrade - closing transport"),o(),e.readyState==="open"&&e.close()},this.server.opts.upgradeTimeout),r,n=f=>{f.type==="ping"&&f.data==="probe"?(re("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(r),r=setInterval(s,100)):f.type==="upgrade"&&this.readyState!=="closed"?(re("got upgrade packet - upgrading"),o(),this.transport.discard(),this.upgraded=!0,this.clearTransport(),this.setTransport(e),this.emit("upgrade",e),this.flush(),this.readyState==="closing"&&e.close(()=>{this.onClose("forced close")})):(o(),e.close())},s=()=>{this.transport.name==="polling"&&this.transport.writable&&(re("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}]))},o=()=>{this.upgrading=!1,clearInterval(r),(0,Jt.clearTimeout)(t),e.removeListener("packet",n),e.removeListener("close",u),e.removeListener("error",c),this.removeListener("close",d)},c=f=>{re("client did not complete upgrade - %s",f),o(),e.close(),e=null},u=()=>{c("transport closed")},d=()=>{c("socket closed")};e.on("packet",n),e.once("close",u),e.once("error",c),this.once("close",d)}clearTransport(){let e,t=this.cleanupFn.length;for(let r=0;r<t;r++)e=this.cleanupFn.shift(),e();this.transport.on("error",function(){re("error triggered by discarded transport")}),this.transport.close(),(0,Jt.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){this.readyState!=="closed"&&(this.readyState="closed",(0,Jt.clearTimeout)(this.pingIntervalTimer),(0,Jt.clearTimeout)(this.pingTimeoutTimer),process.nextTick(()=>{this.writeBuffer=[]}),this.packetsFn=[],this.sentCallbackFn=[],this.clearTransport(),this.emit("close",e,t))}send(e,t,r){return this.sendPacket("message",e,t,r),this}write(e,t,r){return this.sendPacket("message",e,t,r),this}sendPacket(e,t,r={},n){if(typeof r=="function"&&(n=r,r={}),this.readyState!=="closing"&&this.readyState!=="closed"){re('sending packet "%s" (%s)',e,t),r.compress=r.compress!==!1;let s={type:e,options:r};t&&(s.data=t),this.emit("packetCreate",s),this.writeBuffer.push(s),typeof n=="function"&&this.packetsFn.push(n),this.flush()}}flush(){if(this.readyState!=="closed"&&this.transport.writable&&this.writeBuffer.length){re("flushing buffer to transport"),this.emit("flush",this.writeBuffer),this.server.emit("flush",this,this.writeBuffer);let e=this.writeBuffer;this.writeBuffer=[],this.packetsFn.length?(this.sentCallbackFn.push(this.packetsFn),this.packetsFn=[]):this.sentCallbackFn.push(null),this.transport.send(e),this.emit("drain"),this.server.emit("drain",this)}}getAvailableUpgrades(){let e=[],t=this.server.upgrades(this.transport.name);for(let r=0;r<t.length;++r){let n=t[r];this.server.opts.transports.indexOf(n)!==-1&&e.push(n)}return e}close(e){if(e&&(this.readyState==="open"||this.readyState==="closing"))return this.closeTransport(e);if(this.readyState==="open"){if(this.readyState="closing",this.writeBuffer.length){re("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{re("all packets have been sent, closing the transport"),this.closeTransport(e)});return}re("the buffer is empty, closing the transport right away"),this.closeTransport(e)}}closeTransport(e){re("closing the transport (discard? %s)",!!e),e&&this.transport.discard(),this.transport.close(this.onClose.bind(this,"forced close"))}};ts.Socket=Da});var od=T(La=>{"use strict";La.parse=uw;La.serialize=pw;var nw=Object.prototype.toString,sw=Object.prototype.hasOwnProperty,ow=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,aw=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,cw=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,lw=/^[\u0020-\u003A\u003D-\u007E]*$/;function uw(i,e){if(typeof i!="string")throw new TypeError("argument str must be a string");var t={},r=i.length;if(r<2)return t;var n=e&&e.decode||dw,s=0,o=0,c=0;do{if(o=i.indexOf("=",s),o===-1)break;if(c=i.indexOf(";",s),c===-1)c=r;else if(o>c){s=i.lastIndexOf(";",o-1)+1;continue}var u=nd(i,s,o),d=sd(i,o,u),f=i.slice(u,d);if(!sw.call(t,f)){var v=nd(i,o+1,c),_=sd(i,c,v);i.charCodeAt(v)===34&&i.charCodeAt(_-1)===34&&(v++,_--);var E=i.slice(v,_);t[f]=hw(E,n)}s=c+1}while(s<r);return t}function nd(i,e,t){do{var r=i.charCodeAt(e);if(r!==32&&r!==9)return e}while(++e<t);return t}function sd(i,e,t){for(;e>t;){var r=i.charCodeAt(--e);if(r!==32&&r!==9)return e+1}return t}function pw(i,e,t){var r=t&&t.encode||encodeURIComponent;if(typeof r!="function")throw new TypeError("option encode is invalid");if(!ow.test(i))throw new TypeError("argument name is invalid");var n=r(e);if(!aw.test(n))throw new TypeError("argument val is invalid");var s=i+"="+n;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(!cw.test(t.domain))throw new TypeError("option domain is invalid");s+="; Domain="+t.domain}if(t.path){if(!lw.test(t.path))throw new TypeError("option path is invalid");s+="; Path="+t.path}if(t.expires){var c=t.expires;if(!fw(c)||isNaN(c.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+c.toUTCString()}if(t.httpOnly&&(s+="; HttpOnly"),t.secure&&(s+="; Secure"),t.partitioned&&(s+="; Partitioned"),t.priority){var u=typeof t.priority=="string"?t.priority.toLowerCase():t.priority;switch(u){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 d=typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite;switch(d){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 dw(i){return i.indexOf("%")!==-1?decodeURIComponent(i):i}function fw(i){return nw.call(i)==="[object Date]"}function hw(i,e){try{return e(i)}catch{return i}}});var Xt=T((oM,ld)=>{"use strict";var ad=["nodebuffer","arraybuffer","fragments"],cd=typeof Blob<"u";cd&&ad.push("blob");ld.exports={BINARY_TYPES:ad,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:cd,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Cd=T((aM,Ed)=>{var fd=require("fs"),Zt=require("path"),hd=require("os"),md=typeof __webpack_require__=="function"?__non_webpack_require__:require,mw=process.config&&process.config.variables||{},vw=!!process.env.PREBUILDS_ONLY,ud=process.versions.modules,qa=yw()?"electron":xw()?"node-webkit":"node",Fa=process.env.npm_config_arch||hd.arch(),Ua=process.env.npm_config_platform||hd.platform(),vd=process.env.LIBC||(bw(Ua)?"musl":"glibc"),Ha=process.env.ARM_VERSION||(Fa==="arm64"?"8":mw.arm_version)||"",gd=(process.versions.uv||"").split(".")[0];Ed.exports=Ht;function Ht(i){return md(Ht.resolve(i))}Ht.resolve=Ht.path=function(i){i=Zt.resolve(i||".");try{var e=md(Zt.join(i,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(i=process.env[e+"_PREBUILD"])}catch{}if(!vw){var t=pd(Zt.join(i,"build/Release"),dd);if(t)return t;var r=pd(Zt.join(i,"build/Debug"),dd);if(r)return r}var n=c(i);if(n)return n;var s=c(Zt.dirname(process.execPath));if(s)return s;var o=["platform="+Ua,"arch="+Fa,"runtime="+qa,"abi="+ud,"uv="+gd,Ha?"armv="+Ha:"","libc="+vd,"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(n+"m+"+Gn.exports.humanize(this.diff)+"\x1B[0m")}else i[0]=Ab()+e+" "+i[0]}function Ab(){return He.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Rb(...i){return process.stderr.write(Kn.formatWithOptions(He.inspectOpts,...i)+`
|
|
5
|
+
`)}function Pb(i){i?process.env.DEBUG=i:delete process.env.DEBUG}function Bb(){return process.env.DEBUG}function Nb(i){i.inspectOpts={};let e=Object.keys(He.inspectOpts);for(let t=0;t<e.length;t++)i.inspectOpts[e[t]]=He.inspectOpts[e[t]]}Gn.exports=Ea()(He);var{formatters:Jp}=Gn.exports;Jp.o=function(i){return this.inspectOpts.colors=this.useColors,Kn.inspect(i,this.inspectOpts).split(`
|
|
6
|
+
`).map(e=>e.trim()).join(" ")};Jp.O=function(i){return this.inspectOpts.colors=this.useColors,Kn.inspect(i,this.inspectOpts)}});var ie=T((Xk,ka)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?ka.exports=Wp():ka.exports=Xp()});var Ti=T(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.Transport=void 0;var Ib=require("events"),Db=Jr(),jb=Fp(),Lb=ie(),Zp=(0,Lb.default)("engine:transport");function qb(){}var Yn=class extends Ib.EventEmitter{get readyState(){return this._readyState}set readyState(e){Zp("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?Db:jb,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||qb))}onError(e,t){if(this.listeners("error").length){let r=new Error(e);r.type="TransportError",r.description=t,this.emit("error",r)}else Zp("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")}};Jn.Transport=Yn;Yn.upgradesTo=[]});var Oa=T(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.Polling=void 0;var Fb=Ti(),Qp=require("zlib"),Ub=jn(),Hb=ie(),ut=(0,Hb.default)("engine:polling"),zb={gzip:Qp.createGzip,deflate:Qp.createDeflate},Ma=class extends Fb.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 r=()=>{this.onError("poll connection closed prematurely")},n=()=>{e.removeListener("close",r),this.req=this.res=null};e.cleanup=n,e.on("close",r),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 r=e.headers["content-type"]==="application/octet-stream";if(r&&this.protocol===4)return this.onError("invalid content");this.dataReq=e,this.dataRes=t;let n=r?Buffer.concat([]):"",s=()=>{e.removeListener("data",c),e.removeListener("end",u),e.removeListener("close",o),this.dataReq=this.dataRes=n=null},o=()=>{s(),this.onError("data request connection closed prematurely")},c=d=>{let f;r?(n=Buffer.concat([n,d]),f=n.length):(n+=d,f=Buffer.byteLength(n)),f>this.maxHttpBufferSize&&(t.writeHead(413).end(),s())},u=()=>{this.onData(n);let d={"Content-Type":"text/html","Content-Length":"2"};t.writeHead(200,this.headers(e,d)),t.end("ok"),s()};e.on("close",o),r||e.setEncoding("utf8"),e.on("data",c),e.on("end",u)}onData(e){ut('received "%s"',e);let t=r=>{if(r.type==="close")return ut("got xhr close packet"),this.onClose(),!1;this.onPacket(r)};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=r=>{let n=e.some(s=>s.options&&s.options.compress);this.write(r,{compress:n})};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,r){let n=typeof e=="string",o={"Content-Type":n?"text/plain; charset=UTF-8":"application/octet-stream"},c=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),r()};if(!this.httpCompression||!t.compress){c(e);return}if((n?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){c(e);return}let d=Ub(this.req).encodings(["gzip","deflate"]);if(!d){c(e);return}this.compress(e,d,(f,v)=>{if(f){this.res.writeHead(500),this.res.end(),r(f);return}o["Content-Encoding"]=d,c(v)})}compress(e,t,r){ut("compressing");let n=[],s=0;zb[t](this.httpCompression).on("error",r).on("data",function(o){n.push(o),s+=o.length}).on("end",function(){r(null,Buffer.concat(n,s))}).end(e)}doClose(e){ut("closing");let t;this.dataReq&&(ut("aborting ongoing data request"),this.dataReq.destroy());let r=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(ut("transport writable - closing right away"),this.send([{type:"close"}]),r()):this.discarded?(ut("transport discarded - closing right away"),r()):(ut("transport not writable - buffering orderly close"),this.shouldClose=r,t=setTimeout(r,this.closeTimeout))}headers(e,t={}){let r=e.headers["user-agent"];return r&&(~r.indexOf(";MSIE")||~r.indexOf("Trident/"))&&(t["X-XSS-Protection"]="0"),t["cache-control"]="no-store",this.emit("headers",t,e),t}};Xn.Polling=Ma});var ed=T(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.JSONP=void 0;var Wb=Oa(),$b=require("querystring"),Vb=/\\\\n/g,Kb=/(\\)?\\n/g,Aa=class extends Wb.Polling{constructor(e){super(e),this.head="___eio["+(e._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(e){e=$b.parse(e).d,typeof e=="string"&&(e=e.replace(Kb,function(t,r){return r?t:`
|
|
7
|
+
`}),super.onData(e.replace(Vb,"\\n")))}doWrite(e,t,r){let n=JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");e=this.head+n+this.foot,super.doWrite(e,t,r)}};Zn.JSONP=Aa});var id=T(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.WebSocket=void 0;var Gb=Ti(),Yb=ie(),td=(0,Yb.default)("engine:ws"),Ra=class extends Gb.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,r)=>{let n=r?t:t.toString();td('received "%s"',n),super.onData(n)}),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 r=e[t],n=t+1===e.length;this._canSendPreEncodedFrame(r)?this.socket._sender.sendFrame(r.options.wsPreEncodedFrame,n?this._onSentLast:this._onSent):this.parser.encodePacket(r,this.supportsBinary,n?this._doSendLast:this._doSend)}}_canSendPreEncodedFrame(e){var t,r,n;return!this.perMessageDeflate&&typeof((r=(t=this.socket)===null||t===void 0?void 0:t._sender)===null||r===void 0?void 0:r.sendFrame)=="function"&&((n=e.options)===null||n===void 0?void 0:n.wsPreEncodedFrame)!==void 0}doClose(e){td("closing"),this.socket.close(),e&&e()}};Qn.WebSocket=Ra});var Ba=T(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.WebTransport=void 0;var Jb=Ti(),Xb=ie(),Zb=Jr(),tr=(0,Xb.default)("engine:webtransport"),Pa=class extends Jb.Transport{constructor(e,t,r){super({_query:{EIO:"4"}}),this.session=e;let n=(0,Zb.createPacketEncoderStream)();n.readable.pipeTo(t.writable).catch(()=>{tr("the stream was closed")}),this.writer=n.writable.getWriter(),(async()=>{try{for(;;){let{value:s,done:o}=await r.read();if(o){tr("session is closed");break}tr("received chunk: %o",s),this.onPacket(s)}}catch(s){tr("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 r=e[t];await this.writer.write(r)}}catch(t){tr("error while writing: %s",t.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(e){tr("closing WebTransport session"),this.session.close(),e&&e()}};es.WebTransport=Pa});var Ia=T(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});var Qb=Oa(),ew=ed(),tw=id(),iw=Ba();Na.default={polling:rd,websocket:tw.WebSocket,webtransport:iw.WebTransport};function rd(i){return typeof i._query.j=="string"?new ew.JSONP(i):new Qb.Polling(i)}rd.upgradesTo=["websocket","webtransport"]});var ja=T(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.Socket=void 0;var rw=require("events"),nw=ie(),Jt=require("timers"),re=(0,nw.default)("engine:socket"),Da=class extends rw.EventEmitter{get readyState(){return this._readyState}set readyState(e){re("readyState updated from %s to %s",this._readyState,e),this._readyState=e}constructor(e,t,r,n,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=n,this.protocol=s,n&&(n.websocket&&n.websocket._socket?this.remoteAddress=n.websocket._socket.remoteAddress:this.remoteAddress=n.connection.remoteAddress),this.pingTimeoutTimer=null,this.pingIntervalTimer=null,this.setTransport(r),this.onOpen()}onOpen(){this.readyState="open",this.transport.sid=this.id,this.sendPacket("open",JSON.stringify({sid:this.id,upgrades:this.getAvailableUpgrades(),pingInterval:this.server.opts.pingInterval,pingTimeout:this.server.opts.pingTimeout,maxPayload:this.server.opts.maxHttpBufferSize})),this.server.opts.initialPacket&&this.sendPacket("message",this.server.opts.initialPacket),this.emit("open"),this.protocol===3?this.resetPingTimeout():this.schedulePing()}onPacket(e){if(this.readyState!=="open")return re("packet received with closed socket");switch(re(`received packet ${e.type}`),this.emit("packet",e),e.type){case"ping":if(this.transport.protocol!==3){this.onError(new Error("invalid heartbeat direction"));return}re("got ping"),this.pingTimeoutTimer.refresh(),this.sendPacket("pong"),this.emit("heartbeat");break;case"pong":if(this.transport.protocol===3){this.onError(new Error("invalid heartbeat direction"));return}re("got pong"),(0,Jt.clearTimeout)(this.pingTimeoutTimer),this.pingIntervalTimer.refresh(),this.emit("heartbeat");break;case"error":this.onClose("parse error");break;case"message":this.emit("data",e.data),this.emit("message",e.data);break}}onError(e){re("transport error"),this.onClose("transport error",e)}schedulePing(){this.pingIntervalTimer=(0,Jt.setTimeout)(()=>{re("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){(0,Jt.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,Jt.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),r=()=>this.flush(),n=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",r),this.transport.on("packet",n),this.transport.on("drain",s),this.transport.once("close",o),this.cleanupFn.push(function(){e.removeListener("error",t),e.removeListener("ready",r),e.removeListener("packet",n),e.removeListener("drain",s),e.removeListener("close",o)})}onDrain(){if(this.sentCallbackFn.length>0){re("executing batch send callback");let e=this.sentCallbackFn.shift();if(e)for(let t=0;t<e.length;t++)e[t](this.transport)}}_maybeUpgrade(e){re('might upgrade socket transport from "%s" to "%s"',this.transport.name,e.name),this.upgrading=!0;let t=(0,Jt.setTimeout)(()=>{re("client did not complete upgrade - closing transport"),o(),e.readyState==="open"&&e.close()},this.server.opts.upgradeTimeout),r,n=f=>{f.type==="ping"&&f.data==="probe"?(re("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(r),r=setInterval(s,100)):f.type==="upgrade"&&this.readyState!=="closed"?(re("got upgrade packet - upgrading"),o(),this.transport.discard(),this.upgraded=!0,this.clearTransport(),this.setTransport(e),this.emit("upgrade",e),this.flush(),this.readyState==="closing"&&e.close(()=>{this.onClose("forced close")})):(o(),e.close())},s=()=>{this.transport.name==="polling"&&this.transport.writable&&(re("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}]))},o=()=>{this.upgrading=!1,clearInterval(r),(0,Jt.clearTimeout)(t),e.removeListener("packet",n),e.removeListener("close",u),e.removeListener("error",c),this.removeListener("close",d)},c=f=>{re("client did not complete upgrade - %s",f),o(),e.close(),e=null},u=()=>{c("transport closed")},d=()=>{c("socket closed")};e.on("packet",n),e.once("close",u),e.once("error",c),this.once("close",d)}clearTransport(){let e,t=this.cleanupFn.length;for(let r=0;r<t;r++)e=this.cleanupFn.shift(),e();this.transport.on("error",function(){re("error triggered by discarded transport")}),this.transport.close(),(0,Jt.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){this.readyState!=="closed"&&(this.readyState="closed",(0,Jt.clearTimeout)(this.pingIntervalTimer),(0,Jt.clearTimeout)(this.pingTimeoutTimer),process.nextTick(()=>{this.writeBuffer=[]}),this.packetsFn=[],this.sentCallbackFn=[],this.clearTransport(),this.emit("close",e,t))}send(e,t,r){return this.sendPacket("message",e,t,r),this}write(e,t,r){return this.sendPacket("message",e,t,r),this}sendPacket(e,t,r={},n){if(typeof r=="function"&&(n=r,r={}),this.readyState!=="closing"&&this.readyState!=="closed"){re('sending packet "%s" (%s)',e,t),r.compress=r.compress!==!1;let s={type:e,options:r};t&&(s.data=t),this.emit("packetCreate",s),this.writeBuffer.push(s),typeof n=="function"&&this.packetsFn.push(n),this.flush()}}flush(){if(this.readyState!=="closed"&&this.transport.writable&&this.writeBuffer.length){re("flushing buffer to transport"),this.emit("flush",this.writeBuffer),this.server.emit("flush",this,this.writeBuffer);let e=this.writeBuffer;this.writeBuffer=[],this.packetsFn.length?(this.sentCallbackFn.push(this.packetsFn),this.packetsFn=[]):this.sentCallbackFn.push(null),this.transport.send(e),this.emit("drain"),this.server.emit("drain",this)}}getAvailableUpgrades(){let e=[],t=this.server.upgrades(this.transport.name);for(let r=0;r<t.length;++r){let n=t[r];this.server.opts.transports.indexOf(n)!==-1&&e.push(n)}return e}close(e){if(e&&(this.readyState==="open"||this.readyState==="closing"))return this.closeTransport(e);if(this.readyState==="open"){if(this.readyState="closing",this.writeBuffer.length){re("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{re("all packets have been sent, closing the transport"),this.closeTransport(e)});return}re("the buffer is empty, closing the transport right away"),this.closeTransport(e)}}closeTransport(e){re("closing the transport (discard? %s)",!!e),e&&this.transport.discard(),this.transport.close(this.onClose.bind(this,"forced close"))}};ts.Socket=Da});var od=T(La=>{"use strict";La.parse=pw;La.serialize=dw;var sw=Object.prototype.toString,ow=Object.prototype.hasOwnProperty,aw=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,cw=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,lw=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,uw=/^[\u0020-\u003A\u003D-\u007E]*$/;function pw(i,e){if(typeof i!="string")throw new TypeError("argument str must be a string");var t={},r=i.length;if(r<2)return t;var n=e&&e.decode||fw,s=0,o=0,c=0;do{if(o=i.indexOf("=",s),o===-1)break;if(c=i.indexOf(";",s),c===-1)c=r;else if(o>c){s=i.lastIndexOf(";",o-1)+1;continue}var u=nd(i,s,o),d=sd(i,o,u),f=i.slice(u,d);if(!ow.call(t,f)){var v=nd(i,o+1,c),_=sd(i,c,v);i.charCodeAt(v)===34&&i.charCodeAt(_-1)===34&&(v++,_--);var E=i.slice(v,_);t[f]=mw(E,n)}s=c+1}while(s<r);return t}function nd(i,e,t){do{var r=i.charCodeAt(e);if(r!==32&&r!==9)return e}while(++e<t);return t}function sd(i,e,t){for(;e>t;){var r=i.charCodeAt(--e);if(r!==32&&r!==9)return e+1}return t}function dw(i,e,t){var r=t&&t.encode||encodeURIComponent;if(typeof r!="function")throw new TypeError("option encode is invalid");if(!aw.test(i))throw new TypeError("argument name is invalid");var n=r(e);if(!cw.test(n))throw new TypeError("argument val is invalid");var s=i+"="+n;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(!lw.test(t.domain))throw new TypeError("option domain is invalid");s+="; Domain="+t.domain}if(t.path){if(!uw.test(t.path))throw new TypeError("option path is invalid");s+="; Path="+t.path}if(t.expires){var c=t.expires;if(!hw(c)||isNaN(c.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+c.toUTCString()}if(t.httpOnly&&(s+="; HttpOnly"),t.secure&&(s+="; Secure"),t.partitioned&&(s+="; Partitioned"),t.priority){var u=typeof t.priority=="string"?t.priority.toLowerCase():t.priority;switch(u){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 d=typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite;switch(d){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 fw(i){return i.indexOf("%")!==-1?decodeURIComponent(i):i}function hw(i){return sw.call(i)==="[object Date]"}function mw(i,e){try{return e(i)}catch{return i}}});var Xt=T((oM,ld)=>{"use strict";var ad=["nodebuffer","arraybuffer","fragments"],cd=typeof Blob<"u";cd&&ad.push("blob");ld.exports={BINARY_TYPES:ad,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:cd,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Cd=T((aM,Ed)=>{var fd=require("fs"),Zt=require("path"),hd=require("os"),md=typeof __webpack_require__=="function"?__non_webpack_require__:require,vw=process.config&&process.config.variables||{},gw=!!process.env.PREBUILDS_ONLY,ud=process.versions.modules,qa=bw()?"electron":yw()?"node-webkit":"node",Fa=process.env.npm_config_arch||hd.arch(),Ua=process.env.npm_config_platform||hd.platform(),vd=process.env.LIBC||(ww(Ua)?"musl":"glibc"),Ha=process.env.ARM_VERSION||(Fa==="arm64"?"8":vw.arm_version)||"",gd=(process.versions.uv||"").split(".")[0];Ed.exports=Ht;function Ht(i){return md(Ht.resolve(i))}Ht.resolve=Ht.path=function(i){i=Zt.resolve(i||".");try{var e=md(Zt.join(i,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(i=process.env[e+"_PREBUILD"])}catch{}if(!gw){var t=pd(Zt.join(i,"build/Release"),dd);if(t)return t;var r=pd(Zt.join(i,"build/Debug"),dd);if(r)return r}var n=c(i);if(n)return n;var s=c(Zt.dirname(process.execPath));if(s)return s;var o=["platform="+Ua,"arch="+Fa,"runtime="+qa,"abi="+ud,"uv="+gd,Ha?"armv="+Ha:"","libc="+vd,"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 c(u){var d=za(Zt.join(u,"prebuilds")).map(xd),f=d.filter(yd(Ua,Fa)).sort(bd)[0];if(f){var v=Zt.join(u,"prebuilds",f.name),_=za(v).map(wd),E=_.filter(_d(qa,ud)),C=E.sort(Sd(qa))[0];if(C)return Zt.join(v,C.file)}}};function za(i){try{return fd.readdirSync(i)}catch{return[]}}function pd(i,e){var t=za(i).filter(e);return t[0]&&Zt.join(i,t[0])}function dd(i){return/\.node$/.test(i)}function xd(i){var e=i.split("-");if(e.length===2){var t=e[0],r=e[1].split("+");if(t&&r.length&&r.every(Boolean))return{name:i,platform:t,architectures:r}}}function yd(i,e){return function(t){return t==null||t.platform!==i?!1:t.architectures.includes(e)}}function bd(i,e){return i.architectures.length-e.architectures.length}function wd(i){var e=i.split("."),t=e.pop(),r={file:i,specificity:0};if(t==="node"){for(var n=0;n<e.length;n++){var s=e[n];if(s==="node"||s==="electron"||s==="node-webkit")r.runtime=s;else if(s==="napi")r.napi=!0;else if(s.slice(0,3)==="abi")r.abi=s.slice(3);else if(s.slice(0,2)==="uv")r.uv=s.slice(2);else if(s.slice(0,4)==="armv")r.armv=s.slice(4);else if(s==="glibc"||s==="musl")r.libc=s;else continue;r.specificity++}return r}}function _d(i,e){return function(t){return!(t==null||t.runtime&&t.runtime!==i&&!gw(t)||t.abi&&t.abi!==e&&!t.napi||t.uv&&t.uv!==gd||t.armv&&t.armv!==Ha||t.libc&&t.libc!==vd)}}function gw(i){return i.runtime==="node"&&i.napi}function Sd(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 xw(){return!!(process.versions&&process.versions.nw)}function yw(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function bw(i){return i==="linux"&&fd.existsSync("/etc/alpine-release")}Ht.parseTags=wd;Ht.matchTags=_d;Ht.compareTags=Sd;Ht.parseTuple=xd;Ht.matchTuple=yd;Ht.compareTuples=bd});var Va=T((cM,$a)=>{var Wa=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof Wa.addon=="function"?$a.exports=Wa.addon.bind(Wa):$a.exports=Cd()});var kd=T((lM,Td)=>{"use strict";var ww=(i,e,t,r,n)=>{for(var s=0;s<n;s++)t[r+s]=i[s]^e[s&3]},_w=(i,e)=>{let t=i.length;for(var r=0;r<t;r++)i[r]^=e[r&3]};Td.exports={mask:ww,unmask:_w}});var Md=T((uM,Ka)=>{"use strict";try{Ka.exports=Va()(__dirname)}catch{Ka.exports=kd()}});var Xr=T((pM,is)=>{"use strict";var{EMPTY_BUFFER:Sw}=Xt(),Ga=Buffer[Symbol.species];function Ew(i,e){if(i.length===0)return Sw;if(i.length===1)return i[0];let t=Buffer.allocUnsafe(e),r=0;for(let n=0;n<i.length;n++){let s=i[n];t.set(s,r),r+=s.length}return r<e?new Ga(t.buffer,t.byteOffset,r):t}function Od(i,e,t,r,n){for(let s=0;s<n;s++)t[r+s]=i[s]^e[s&3]}function Ad(i,e){for(let t=0;t<i.length;t++)i[t]^=e[t&3]}function Cw(i){return i.length===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.length)}function Ya(i){if(Ya.readOnly=!0,Buffer.isBuffer(i))return i;let e;return i instanceof ArrayBuffer?e=new Ga(i):ArrayBuffer.isView(i)?e=new Ga(i.buffer,i.byteOffset,i.byteLength):(e=Buffer.from(i),Ya.readOnly=!1),e}is.exports={concat:Ew,mask:Od,toArrayBuffer:Cw,toBuffer:Ya,unmask:Ad};if(!process.env.WS_NO_BUFFER_UTIL)try{let i=Md();is.exports.mask=function(e,t,r,n,s){s<48?Od(e,t,r,n,s):i.mask(e,t,r,n,s)},is.exports.unmask=function(e,t){e.length<32?Ad(e,t):i.unmask(e,t)}}catch{}});var Bd=T((dM,Pd)=>{"use strict";var Rd=Symbol("kDone"),Ja=Symbol("kRun"),Xa=class{constructor(e){this[Rd]=()=>{this.pending--,this[Ja]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Ja]()}[Ja](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[Rd])}}};Pd.exports=Xa});var Qr=T((fM,jd)=>{"use strict";var Zr=require("zlib"),Nd=Xr(),Tw=Bd(),{kStatusCode:Id}=Xt(),kw=Buffer[Symbol.species],Mw=Buffer.from([0,0,255,255]),ns=Symbol("permessage-deflate"),Qt=Symbol("total-length"),ir=Symbol("callback"),mi=Symbol("buffers"),rr=Symbol("error"),rs,Za=class{constructor(e,t,r){if(this._maxPayload=r|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,!rs){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;rs=new Tw(n)}}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[ir];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,r=e.find(n=>!(t.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>n.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!n.client_max_window_bits));if(!r)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(r.server_no_context_takeover=!0),t.clientNoContextTakeover&&(r.client_no_context_takeover=!0),typeof t.serverMaxWindowBits=="number"&&(r.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?r.client_max_window_bits=t.clientMaxWindowBits:(r.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete r.client_max_window_bits,r}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(r=>{let n=t[r];if(n.length>1)throw new Error(`Parameter "${r}" must have only a single value`);if(n=n[0],r==="client_max_window_bits"){if(n!==!0){let s=+n;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${n}`);n=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${r}": ${n}`)}else if(r==="server_max_window_bits"){let s=+n;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${n}`);n=s}else if(r==="client_no_context_takeover"||r==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${r}": ${n}`)}else throw new Error(`Unknown parameter "${r}"`);t[r]=n})}),e}decompress(e,t,r){rs.add(n=>{this._decompress(e,t,(s,o)=>{n(),r(s,o)})})}compress(e,t,r){rs.add(n=>{this._compress(e,t,(s,o)=>{n(),r(s,o)})})}_decompress(e,t,r){let n=this._isServer?"client":"server";if(!this._inflate){let s=`${n}_max_window_bits`,o=typeof this.params[s]!="number"?Zr.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=Zr.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[ns]=this,this._inflate[Qt]=0,this._inflate[mi]=[],this._inflate.on("error",Aw),this._inflate.on("data",Dd)}this._inflate[ir]=r,this._inflate.write(e),t&&this._inflate.write(Mw),this._inflate.flush(()=>{let s=this._inflate[rr];if(s){this._inflate.close(),this._inflate=null,r(s);return}let o=Nd.concat(this._inflate[mi],this._inflate[Qt]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Qt]=0,this._inflate[mi]=[],t&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),r(null,o)})}_compress(e,t,r){let n=this._isServer?"server":"client";if(!this._deflate){let s=`${n}_max_window_bits`,o=typeof this.params[s]!="number"?Zr.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=Zr.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[Qt]=0,this._deflate[mi]=[],this._deflate.on("data",Ow)}this._deflate[ir]=r,this._deflate.write(e),this._deflate.flush(Zr.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=Nd.concat(this._deflate[mi],this._deflate[Qt]);t&&(s=new kw(s.buffer,s.byteOffset,s.length-4)),this._deflate[ir]=null,this._deflate[Qt]=0,this._deflate[mi]=[],t&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),r(null,s)})}};jd.exports=Za;function Ow(i){this[mi].push(i),this[Qt]+=i.length}function Dd(i){if(this[Qt]+=i.length,this[ns]._maxPayload<1||this[Qt]<=this[ns]._maxPayload){this[mi].push(i);return}this[rr]=new RangeError("Max payload size exceeded"),this[rr].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[rr][Id]=1009,this.removeListener("data",Dd),this.reset()}function Aw(i){if(this[ns]._inflate=null,this[rr]){this[ir](this[rr]);return}i[Id]=1007,this[ir](i)}});var qd=T((hM,Ld)=>{"use strict";function Rw(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}Ld.exports=Rw});var Fd=T((mM,Qa)=>{"use strict";try{Qa.exports=Va()(__dirname)}catch{Qa.exports=qd()}});var nr=T((vM,ss)=>{"use strict";var{isUtf8:Ud}=require("buffer"),{hasBlob:Pw}=Xt(),Bw=[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 Nw(i){return i>=1e3&&i<=1014&&i!==1004&&i!==1005&&i!==1006||i>=3e3&&i<=4999}function ec(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 Iw(i){return Pw&&typeof i=="object"&&typeof i.arrayBuffer=="function"&&typeof i.type=="string"&&typeof i.stream=="function"&&(i[Symbol.toStringTag]==="Blob"||i[Symbol.toStringTag]==="File")}ss.exports={isBlob:Iw,isValidStatusCode:Nw,isValidUTF8:ec,tokenChars:Bw};if(Ud)ss.exports.isValidUTF8=function(i){return i.length<24?ec(i):Ud(i)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let i=Fd();ss.exports.isValidUTF8=function(e){return e.length<32?ec(e):i(e)}}catch{}});var sc=T((gM,Gd)=>{"use strict";var{Writable:Dw}=require("stream"),Hd=Qr(),{BINARY_TYPES:jw,EMPTY_BUFFER:zd,kStatusCode:Lw,kWebSocket:qw}=Xt(),{concat:tc,toArrayBuffer:Fw,unmask:Uw}=Xr(),{isValidStatusCode:Hw,isValidUTF8:Wd}=nr(),os=Buffer[Symbol.species],gt=0,$d=1,Vd=2,Kd=3,ic=4,rc=5,as=6,nc=class extends Dw{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||jw[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[qw]=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,r){if(this._opcode===8&&this._state==gt)return r();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(r)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let r=this._buffers[0];return this._buffers[0]=new os(r.buffer,r.byteOffset+e,r.length-e),new os(r.buffer,r.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let r=this._buffers[0],n=t.length-e;e>=r.length?t.set(this._buffers.shift(),n):(t.set(new Uint8Array(r.buffer,r.byteOffset,e),n),this._buffers[0]=new os(r.buffer,r.byteOffset+e,r.length-e)),e-=r.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case gt:this.getInfo(e);break;case $d:this.getPayloadLength16(e);break;case Vd:this.getPayloadLength64(e);break;case Kd:this.getMask();break;case ic:this.getData(e);break;case rc:case as: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 n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(n);return}let r=(t[0]&64)===64;if(r&&!this._extensions[Hd.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(r){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(n);return}if(r){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(n);return}this._payloadLength===126?this._state=$d:this._payloadLength===127?this._state=Vd: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),r=t.readUInt32BE(0);if(r>Math.pow(2,21)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(n);return}this._payloadLength=r*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=Kd:this._state=ic}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=ic}getData(e){let t=zd;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&&Uw(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=rc,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[Hd.extensionName].decompress(e,this._fin,(n,s)=>{if(n)return t(n);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,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=tc(r,t):this._binaryType==="arraybuffer"?n=Fw(tc(r,t)):this._binaryType==="blob"?n=new Blob(r):n=r,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=gt):(this._state=as,setImmediate(()=>{this.emit("message",n,!0),this._state=gt,this.startLoop(e)}))}else{let n=tc(r,t);if(!this._skipUTF8Validation&&!Wd(n)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===rc||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=gt):(this._state=as,setImmediate(()=>{this.emit("message",n,!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,zd),this.end();else{let r=e.readUInt16BE(0);if(!Hw(r)){let s=this.createError(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let n=new os(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Wd(n)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._loop=!1,this.emit("conclude",r,n),this.end()}this._state=gt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=gt):(this._state=as,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=gt,this.startLoop(t)}))}createError(e,t,r,n,s){this._loop=!1,this._errored=!0;let o=new e(r?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=s,o[Lw]=n,o}};Gd.exports=nc});var cc=T((yM,Xd)=>{"use strict";var{Duplex:xM}=require("stream"),{randomFillSync:zw}=require("crypto"),Yd=Qr(),{EMPTY_BUFFER:Ww,kWebSocket:$w,NOOP:Vw}=Xt(),{isBlob:sr,isValidStatusCode:Kw}=nr(),{mask:Jd,toBuffer:ki}=Xr(),xt=Symbol("kByteLength"),Gw=Buffer.alloc(4),cs=8*1024,Mi,or=cs,Pt=0,Yw=1,Jw=2,oc=class i{constructor(e,t,r){this._extensions=t||{},r&&(this._generateMask=r,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Pt,this.onerror=Vw,this[$w]=void 0}static frame(e,t){let r,n=!1,s=2,o=!1;t.mask&&(r=t.maskBuffer||Gw,t.generateMask?t.generateMask(r):(or===cs&&(Mi===void 0&&(Mi=Buffer.alloc(cs)),zw(Mi,0,cs),or=0),r[0]=Mi[or++],r[1]=Mi[or++],r[2]=Mi[or++],r[3]=Mi[or++]),o=(r[0]|r[1]|r[2]|r[3])===0,s=6);let c;typeof e=="string"?(!t.mask||o)&&t[xt]!==void 0?c=t[xt]:(e=Buffer.from(e),c=e.length):(c=e.length,n=t.mask&&t.readOnly&&!o);let u=c;c>=65536?(s+=8,u=127):c>125&&(s+=2,u=126);let d=Buffer.allocUnsafe(n?c+s:s);return d[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(d[0]|=64),d[1]=u,u===126?d.writeUInt16BE(c,2):u===127&&(d[2]=d[3]=0,d.writeUIntBE(c,4,6)),t.mask?(d[1]|=128,d[s-4]=r[0],d[s-3]=r[1],d[s-2]=r[2],d[s-1]=r[3],o?[d,e]:n?(Jd(e,r,d,s,c),[d]):(Jd(e,r,e,0,c),[d,e])):[d,e]}close(e,t,r,n){let s;if(e===void 0)s=Ww;else{if(typeof e!="number"||!Kw(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 c=Buffer.byteLength(t);if(c>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+c),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:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Pt?this.enqueue([this.dispatch,s,!1,o,n]):this.sendFrame(i.frame(s,o),n)}ping(e,t,r){let n,s;if(typeof e=="string"?(n=Buffer.byteLength(e),s=!1):sr(e)?(n=e.size,s=!1):(e=ki(e),n=e.length,s=ki.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[xt]:n,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};sr(e)?this._state!==Pt?this.enqueue([this.getBlobData,e,!1,o,r]):this.getBlobData(e,!1,o,r):this._state!==Pt?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(i.frame(e,o),r)}pong(e,t,r){let n,s;if(typeof e=="string"?(n=Buffer.byteLength(e),s=!1):sr(e)?(n=e.size,s=!1):(e=ki(e),n=e.length,s=ki.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[xt]:n,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};sr(e)?this._state!==Pt?this.enqueue([this.getBlobData,e,!1,o,r]):this.getBlobData(e,!1,o,r):this._state!==Pt?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(i.frame(e,o),r)}send(e,t,r){let n=this._extensions[Yd.extensionName],s=t.binary?2:1,o=t.compress,c,u;typeof e=="string"?(c=Buffer.byteLength(e),u=!1):sr(e)?(c=e.size,u=!1):(e=ki(e),c=e.length,u=ki.readOnly),this._firstFragment?(this._firstFragment=!1,o&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=c>=n._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0);let d={[xt]:c,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:u,rsv1:o};sr(e)?this._state!==Pt?this.enqueue([this.getBlobData,e,this._compress,d,r]):this.getBlobData(e,this._compress,d,r):this._state!==Pt?this.enqueue([this.dispatch,e,this._compress,d,r]):this.dispatch(e,this._compress,d,r)}getBlobData(e,t,r,n){this._bufferedBytes+=r[xt],this._state=Jw,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let c=new Error("The socket was closed while the blob was being read");process.nextTick(ac,this,c,n);return}this._bufferedBytes-=r[xt];let o=ki(s);t?this.dispatch(o,t,r,n):(this._state=Pt,this.sendFrame(i.frame(o,r),n),this.dequeue())}).catch(s=>{process.nextTick(Xw,this,s,n)})}dispatch(e,t,r,n){if(!t){this.sendFrame(i.frame(e,r),n);return}let s=this._extensions[Yd.extensionName];this._bufferedBytes+=r[xt],this._state=Yw,s.compress(e,r.fin,(o,c)=>{if(this._socket.destroyed){let u=new Error("The socket was closed while data was being compressed");ac(this,u,n);return}this._bufferedBytes-=r[xt],this._state=Pt,r.readOnly=!1,this.sendFrame(i.frame(c,r),n),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)}};Xd.exports=oc;function ac(i,e,t){typeof t=="function"&&t(e);for(let r=0;r<i._queue.length;r++){let n=i._queue[r],s=n[n.length-1];typeof s=="function"&&s(e)}}function Xw(i,e,t){ac(i,e,t),i.onerror(e)}});var af=T((bM,of)=>{"use strict";var{kForOnEventAttribute:en,kListener:lc}=Xt(),Zd=Symbol("kCode"),Qd=Symbol("kData"),ef=Symbol("kError"),tf=Symbol("kMessage"),rf=Symbol("kReason"),ar=Symbol("kTarget"),nf=Symbol("kType"),sf=Symbol("kWasClean"),ei=class{constructor(e){this[ar]=null,this[nf]=e}get target(){return this[ar]}get type(){return this[nf]}};Object.defineProperty(ei.prototype,"target",{enumerable:!0});Object.defineProperty(ei.prototype,"type",{enumerable:!0});var Oi=class extends ei{constructor(e,t={}){super(e),this[Zd]=t.code===void 0?0:t.code,this[rf]=t.reason===void 0?"":t.reason,this[sf]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[Zd]}get reason(){return this[rf]}get wasClean(){return this[sf]}};Object.defineProperty(Oi.prototype,"code",{enumerable:!0});Object.defineProperty(Oi.prototype,"reason",{enumerable:!0});Object.defineProperty(Oi.prototype,"wasClean",{enumerable:!0});var cr=class extends ei{constructor(e,t={}){super(e),this[ef]=t.error===void 0?null:t.error,this[tf]=t.message===void 0?"":t.message}get error(){return this[ef]}get message(){return this[tf]}};Object.defineProperty(cr.prototype,"error",{enumerable:!0});Object.defineProperty(cr.prototype,"message",{enumerable:!0});var tn=class extends ei{constructor(e,t={}){super(e),this[Qd]=t.data===void 0?null:t.data}get data(){return this[Qd]}};Object.defineProperty(tn.prototype,"data",{enumerable:!0});var Zw={addEventListener(i,e,t={}){for(let n of this.listeners(i))if(!t[en]&&n[lc]===e&&!n[en])return;let r;if(i==="message")r=function(s,o){let c=new tn("message",{data:o?s:s.toString()});c[ar]=this,ls(e,this,c)};else if(i==="close")r=function(s,o){let c=new Oi("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});c[ar]=this,ls(e,this,c)};else if(i==="error")r=function(s){let o=new cr("error",{error:s,message:s.message});o[ar]=this,ls(e,this,o)};else if(i==="open")r=function(){let s=new ei("open");s[ar]=this,ls(e,this,s)};else return;r[en]=!!t[en],r[lc]=e,t.once?this.once(i,r):this.on(i,r)},removeEventListener(i,e){for(let t of this.listeners(i))if(t[lc]===e&&!t[en]){this.removeListener(i,t);break}}};of.exports={CloseEvent:Oi,ErrorEvent:cr,Event:ei,EventTarget:Zw,MessageEvent:tn};function ls(i,e,t){typeof i=="object"&&i.handleEvent?i.handleEvent.call(i,t):i.call(e,t)}});var uc=T((wM,cf)=>{"use strict";var{tokenChars:rn}=nr();function zt(i,e,t){i[e]===void 0?i[e]=[t]:i[e].push(t)}function Qw(i){let e=Object.create(null),t=Object.create(null),r=!1,n=!1,s=!1,o,c,u=-1,d=-1,f=-1,v=0;for(;v<i.length;v++)if(d=i.charCodeAt(v),o===void 0)if(f===-1&&rn[d]===1)u===-1&&(u=v);else if(v!==0&&(d===32||d===9))f===-1&&u!==-1&&(f=v);else if(d===59||d===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${v}`);f===-1&&(f=v);let E=i.slice(u,f);d===44?(zt(e,E,t),t=Object.create(null)):o=E,u=f=-1}else throw new SyntaxError(`Unexpected character at index ${v}`);else if(c===void 0)if(f===-1&&rn[d]===1)u===-1&&(u=v);else if(d===32||d===9)f===-1&&u!==-1&&(f=v);else if(d===59||d===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${v}`);f===-1&&(f=v),zt(t,i.slice(u,f),!0),d===44&&(zt(e,o,t),t=Object.create(null),o=void 0),u=f=-1}else if(d===61&&u!==-1&&f===-1)c=i.slice(u,v),u=f=-1;else throw new SyntaxError(`Unexpected character at index ${v}`);else if(n){if(rn[d]!==1)throw new SyntaxError(`Unexpected character at index ${v}`);u===-1?u=v:r||(r=!0),n=!1}else if(s)if(rn[d]===1)u===-1&&(u=v);else if(d===34&&u!==-1)s=!1,f=v;else if(d===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${v}`);else if(d===34&&i.charCodeAt(v-1)===61)s=!0;else if(f===-1&&rn[d]===1)u===-1&&(u=v);else if(u!==-1&&(d===32||d===9))f===-1&&(f=v);else if(d===59||d===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${v}`);f===-1&&(f=v);let E=i.slice(u,f);r&&(E=E.replace(/\\/g,""),r=!1),zt(t,c,E),d===44&&(zt(e,o,t),t=Object.create(null),o=void 0),c=void 0,u=f=-1}else throw new SyntaxError(`Unexpected character at index ${v}`);if(u===-1||s||d===32||d===9)throw new SyntaxError("Unexpected end of input");f===-1&&(f=v);let _=i.slice(u,f);return o===void 0?zt(e,_,t):(c===void 0?zt(t,_,!0):r?zt(t,c,_.replace(/\\/g,"")):zt(t,c,_),zt(e,o,t)),e}function e_(i){return Object.keys(i).map(e=>{let t=i[e];return Array.isArray(t)||(t=[t]),t.map(r=>[e].concat(Object.keys(r).map(n=>{let s=r[n];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?n:`${n}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}cf.exports={format:e_,parse:Qw}});var fs=T((EM,bf)=>{"use strict";var t_=require("events"),i_=require("https"),r_=require("http"),pf=require("net"),n_=require("tls"),{randomBytes:s_,createHash:o_}=require("crypto"),{Duplex:_M,Readable:SM}=require("stream"),{URL:pc}=require("url"),vi=Qr(),a_=sc(),c_=cc(),{isBlob:l_}=nr(),{BINARY_TYPES:lf,EMPTY_BUFFER:us,GUID:u_,kForOnEventAttribute:dc,kListener:p_,kStatusCode:d_,kWebSocket:ze,NOOP:df}=Xt(),{EventTarget:{addEventListener:f_,removeEventListener:h_}}=af(),{format:m_,parse:v_}=uc(),{toBuffer:g_}=Xr(),x_=30*1e3,ff=Symbol("kAborted"),fc=[8,13],ti=["CONNECTING","OPEN","CLOSING","CLOSED"],y_=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,J=class i extends t_{constructor(e,t,r){super(),this._binaryType=lf[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=us,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?(r=t,t=[]):t=[t]),hf(this,e,t,r)):(this._autoPong=r.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){lf.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,r){let n=new a_({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation}),s=new c_(e,this._extensions,r.generateMask);this._receiver=n,this._sender=s,this._socket=e,n[ze]=this,s[ze]=this,e[ze]=this,n.on("conclude",__),n.on("drain",S_),n.on("error",E_),n.on("message",C_),n.on("ping",T_),n.on("pong",k_),s.onerror=M_,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",gf),e.on("data",ds),e.on("end",xf),e.on("error",yf),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[vi.extensionName]&&this._extensions[vi.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,r=>{r||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),vf(this)}}pause(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,r){if(this.readyState===i.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=t=void 0):typeof t=="function"&&(r=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==i.OPEN){hc(this,e,r);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||us,t,r)}pong(e,t,r){if(this.readyState===i.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=t=void 0):typeof t=="function"&&(r=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==i.OPEN){hc(this,e,r);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||us,t,r)}resume(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,r){if(this.readyState===i.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(r=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==i.OPEN){hc(this,e,r);return}let n={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[vi.extensionName]||(n.compress=!1),this._sender.send(e||us,n,r)}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(J,"CONNECTING",{enumerable:!0,value:ti.indexOf("CONNECTING")});Object.defineProperty(J.prototype,"CONNECTING",{enumerable:!0,value:ti.indexOf("CONNECTING")});Object.defineProperty(J,"OPEN",{enumerable:!0,value:ti.indexOf("OPEN")});Object.defineProperty(J.prototype,"OPEN",{enumerable:!0,value:ti.indexOf("OPEN")});Object.defineProperty(J,"CLOSING",{enumerable:!0,value:ti.indexOf("CLOSING")});Object.defineProperty(J.prototype,"CLOSING",{enumerable:!0,value:ti.indexOf("CLOSING")});Object.defineProperty(J,"CLOSED",{enumerable:!0,value:ti.indexOf("CLOSED")});Object.defineProperty(J.prototype,"CLOSED",{enumerable:!0,value:ti.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(i=>{Object.defineProperty(J.prototype,i,{enumerable:!0})});["open","error","close","message"].forEach(i=>{Object.defineProperty(J.prototype,`on${i}`,{enumerable:!0,get(){for(let e of this.listeners(i))if(e[dc])return e[p_];return null},set(e){for(let t of this.listeners(i))if(t[dc]){this.removeListener(i,t);break}typeof e=="function"&&this.addEventListener(i,e,{[dc]:!0})}})});J.prototype.addEventListener=f_;J.prototype.removeEventListener=h_;bf.exports=J;function hf(i,e,t,r){let n={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:fc[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(i._autoPong=n.autoPong,!fc.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${fc.join(", ")})`);let s;if(e instanceof pc)s=e;else try{s=new pc(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:",c=s.protocol==="ws+unix:",u;if(s.protocol!=="ws:"&&!o&&!c?u=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:c&&!s.pathname?u="The URL's pathname is empty":s.hash&&(u="The URL contains a fragment identifier"),u){let k=new SyntaxError(u);if(i._redirects===0)throw k;ps(i,k);return}let d=o?443:80,f=s_(16).toString("base64"),v=o?i_.request:r_.request,_=new Set,E;if(n.createConnection=n.createConnection||(o?w_:b_),n.defaultPort=n.defaultPort||d,n.port=s.port||d,n.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":f,Connection:"Upgrade",Upgrade:"websocket"},n.path=s.pathname+s.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(E=new vi(n.perMessageDeflate!==!0?n.perMessageDeflate:{},!1,n.maxPayload),n.headers["Sec-WebSocket-Extensions"]=m_({[vi.extensionName]:E.offer()})),t.length){for(let k of t){if(typeof k!="string"||!y_.test(k)||_.has(k))throw new SyntaxError("An invalid or duplicated subprotocol was specified");_.add(k)}n.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(s.username||s.password)&&(n.auth=`${s.username}:${s.password}`),c){let k=n.path.split(":");n.socketPath=k[0],n.path=k[1]}let C;if(n.followRedirects){if(i._redirects===0){i._originalIpc=c,i._originalSecure=o,i._originalHostOrSocketPath=c?n.socketPath:s.host;let k=r&&r.headers;if(r={...r,headers:{}},k)for(let[M,O]of Object.entries(k))r.headers[M.toLowerCase()]=O}else if(i.listenerCount("redirect")===0){let k=c?i._originalIpc?n.socketPath===i._originalHostOrSocketPath:!1:i._originalIpc?!1:s.host===i._originalHostOrSocketPath;(!k||i._originalSecure&&!o)&&(delete n.headers.authorization,delete n.headers.cookie,k||delete n.headers.host,n.auth=void 0)}n.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),C=i._req=v(n),i._redirects&&i.emit("redirect",i.url,C)}else C=i._req=v(n);n.timeout&&C.on("timeout",()=>{pt(i,C,"Opening handshake has timed out")}),C.on("error",k=>{C===null||C[ff]||(C=i._req=null,ps(i,k))}),C.on("response",k=>{let M=k.headers.location,O=k.statusCode;if(M&&n.followRedirects&&O>=300&&O<400){if(++i._redirects>n.maxRedirects){pt(i,C,"Maximum redirects exceeded");return}C.abort();let A;try{A=new pc(M,e)}catch{let U=new SyntaxError(`Invalid URL: ${M}`);ps(i,U);return}hf(i,A,t,r)}else i.emit("unexpected-response",C,k)||pt(i,C,`Unexpected server response: ${k.statusCode}`)}),C.on("upgrade",(k,M,O)=>{if(i.emit("upgrade",k),i.readyState!==J.CONNECTING)return;C=i._req=null;let A=k.headers.upgrade;if(A===void 0||A.toLowerCase()!=="websocket"){pt(i,M,"Invalid Upgrade header");return}let I=o_("sha1").update(f+u_).digest("base64");if(k.headers["sec-websocket-accept"]!==I){pt(i,M,"Invalid Sec-WebSocket-Accept header");return}let U=k.headers["sec-websocket-protocol"],Xe;if(U!==void 0?_.size?_.has(U)||(Xe="Server sent an invalid subprotocol"):Xe="Server sent a subprotocol but none was requested":_.size&&(Xe="Server sent no subprotocol"),Xe){pt(i,M,Xe);return}U&&(i._protocol=U);let te=k.headers["sec-websocket-extensions"];if(te!==void 0){if(!E){pt(i,M,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Le;try{Le=v_(te)}catch{pt(i,M,"Invalid Sec-WebSocket-Extensions header");return}let q=Object.keys(Le);if(q.length!==1||q[0]!==vi.extensionName){pt(i,M,"Server indicated an extension that was not requested");return}try{E.accept(Le[vi.extensionName])}catch{pt(i,M,"Invalid Sec-WebSocket-Extensions header");return}i._extensions[vi.extensionName]=E}i.setSocket(M,O,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(C,i):C.end()}function ps(i,e){i._readyState=J.CLOSING,i._errorEmitted=!0,i.emit("error",e),i.emitClose()}function b_(i){return i.path=i.socketPath,pf.connect(i)}function w_(i){return i.path=void 0,!i.servername&&i.servername!==""&&(i.servername=pf.isIP(i.host)?"":i.host),n_.connect(i)}function pt(i,e,t){i._readyState=J.CLOSING;let r=new Error(t);Error.captureStackTrace(r,pt),e.setHeader?(e[ff]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(ps,i,r)):(e.destroy(r),e.once("error",i.emit.bind(i,"error")),e.once("close",i.emitClose.bind(i)))}function hc(i,e,t){if(e){let r=l_(e)?e.size:g_(e).length;i._socket?i._sender._bufferedBytes+=r:i._bufferedAmount+=r}if(t){let r=new Error(`WebSocket is not open: readyState ${i.readyState} (${ti[i.readyState]})`);process.nextTick(t,r)}}function __(i,e){let t=this[ze];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=i,t._socket[ze]!==void 0&&(t._socket.removeListener("data",ds),process.nextTick(mf,t._socket),i===1005?t.close():t.close(i,e))}function S_(){let i=this[ze];i.isPaused||i._socket.resume()}function E_(i){let e=this[ze];e._socket[ze]!==void 0&&(e._socket.removeListener("data",ds),process.nextTick(mf,e._socket),e.close(i[d_])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",i))}function uf(){this[ze].emitClose()}function C_(i,e){this[ze].emit("message",i,e)}function T_(i){let e=this[ze];e._autoPong&&e.pong(i,!this._isServer,df),e.emit("ping",i)}function k_(i){this[ze].emit("pong",i)}function mf(i){i.resume()}function M_(i){let e=this[ze];e.readyState!==J.CLOSED&&(e.readyState===J.OPEN&&(e._readyState=J.CLOSING,vf(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",i)))}function vf(i){i._closeTimer=setTimeout(i._socket.destroy.bind(i._socket),x_)}function gf(){let i=this[ze];this.removeListener("close",gf),this.removeListener("data",ds),this.removeListener("end",xf),i._readyState=J.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",uf),i._receiver.on("finish",uf))}function ds(i){this[ze]._receiver.write(i)||this.pause()}function xf(){let i=this[ze];i._readyState=J.CLOSING,i._receiver.end(),this.end()}function yf(){let i=this[ze];this.removeListener("error",yf),this.on("error",df),i&&(i._readyState=J.CLOSING,this.destroy())}});var Ef=T((TM,Sf)=>{"use strict";var CM=fs(),{Duplex:O_}=require("stream");function wf(i){i.emit("close")}function A_(){!this.destroyed&&this._writableState.finished&&this.destroy()}function _f(i){this.removeListener("error",_f),this.destroy(),this.listenerCount("error")===0&&this.emit("error",i)}function R_(i,e){let t=!0,r=new O_({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return i.on("message",function(s,o){let c=!o&&r._readableState.objectMode?s.toString():s;r.push(c)||i.pause()}),i.once("error",function(s){r.destroyed||(t=!1,r.destroy(s))}),i.once("close",function(){r.destroyed||r.push(null)}),r._destroy=function(n,s){if(i.readyState===i.CLOSED){s(n),process.nextTick(wf,r);return}let o=!1;i.once("error",function(u){o=!0,s(u)}),i.once("close",function(){o||s(n),process.nextTick(wf,r)}),t&&i.terminate()},r._final=function(n){if(i.readyState===i.CONNECTING){i.once("open",function(){r._final(n)});return}i._socket!==null&&(i._socket._writableState.finished?(n(),r._readableState.endEmitted&&r.destroy()):(i._socket.once("finish",function(){n()}),i.close()))},r._read=function(){i.isPaused&&i.resume()},r._write=function(n,s,o){if(i.readyState===i.CONNECTING){i.once("open",function(){r._write(n,s,o)});return}i.send(n,o)},r.on("end",A_),r.on("error",_f),r}Sf.exports=R_});var Tf=T((kM,Cf)=>{"use strict";var{tokenChars:P_}=nr();function B_(i){let e=new Set,t=-1,r=-1,n=0;for(n;n<i.length;n++){let o=i.charCodeAt(n);if(r===-1&&P_[o]===1)t===-1&&(t=n);else if(n!==0&&(o===32||o===9))r===-1&&t!==-1&&(r=n);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${n}`);r===-1&&(r=n);let c=i.slice(t,r);if(e.has(c))throw new SyntaxError(`The "${c}" subprotocol is duplicated`);e.add(c),t=r=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(t===-1||r!==-1)throw new SyntaxError("Unexpected end of input");let s=i.slice(t,n);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}Cf.exports={parse:B_}});var Bf=T((OM,Pf)=>{"use strict";var N_=require("events"),hs=require("http"),{Duplex:MM}=require("stream"),{createHash:I_}=require("crypto"),kf=uc(),Ai=Qr(),D_=Tf(),j_=fs(),{GUID:L_,kWebSocket:q_}=Xt(),F_=/^[+/0-9A-Za-z]{22}==$/,Mf=0,Of=1,Rf=2,mc=class extends N_{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:j_,...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=hs.createServer((r,n)=>{let s=hs.STATUS_CODES[426];n.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),n.end(s)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let r=this.emit.bind(this,"connection");this._removeListeners=U_(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,s,o)=>{this.handleUpgrade(n,s,o,r)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=Mf}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===Rf){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(nn,this);return}if(e&&this.once("close",e),this._state!==Of)if(this._state=Of,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(nn,this):process.nextTick(nn,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{nn(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,r,n){t.on("error",Af);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,c=+e.headers["sec-websocket-version"];if(e.method!=="GET"){Ri(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){Ri(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!F_.test(s)){Ri(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(c!==13&&c!==8){Ri(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){sn(t,400);return}let u=e.headers["sec-websocket-protocol"],d=new Set;if(u!==void 0)try{d=D_.parse(u)}catch{Ri(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 Ai(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let E=kf.parse(f);E[Ai.extensionName]&&(_.accept(E[Ai.extensionName]),v[Ai.extensionName]=_)}catch{Ri(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let _={origin:e.headers[`${c===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 sn(t,C||401,k,M);this.completeUpgrade(v,s,d,e,t,r,n)});return}if(!this.options.verifyClient(_))return sn(t,401)}this.completeUpgrade(v,s,d,e,t,r,n)}completeUpgrade(e,t,r,n,s,o,c){if(!s.readable||!s.writable)return s.destroy();if(s[q_])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Mf)return sn(s,503);let d=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${I_("sha1").update(t+L_).digest("base64")}`],f=new this.options.WebSocket(null,void 0,this.options);if(r.size){let v=this.options.handleProtocols?this.options.handleProtocols(r,n):r.values().next().value;v&&(d.push(`Sec-WebSocket-Protocol: ${v}`),f._protocol=v)}if(e[Ai.extensionName]){let v=e[Ai.extensionName].params,_=kf.format({[Ai.extensionName]:[v]});d.push(`Sec-WebSocket-Extensions: ${_}`),f._extensions=e}this.emit("headers",d,n),s.write(d.concat(`\r
|
|
9
|
+
`);function c(u){var d=za(Zt.join(u,"prebuilds")).map(xd),f=d.filter(yd(Ua,Fa)).sort(bd)[0];if(f){var v=Zt.join(u,"prebuilds",f.name),_=za(v).map(wd),E=_.filter(_d(qa,ud)),C=E.sort(Sd(qa))[0];if(C)return Zt.join(v,C.file)}}};function za(i){try{return fd.readdirSync(i)}catch{return[]}}function pd(i,e){var t=za(i).filter(e);return t[0]&&Zt.join(i,t[0])}function dd(i){return/\.node$/.test(i)}function xd(i){var e=i.split("-");if(e.length===2){var t=e[0],r=e[1].split("+");if(t&&r.length&&r.every(Boolean))return{name:i,platform:t,architectures:r}}}function yd(i,e){return function(t){return t==null||t.platform!==i?!1:t.architectures.includes(e)}}function bd(i,e){return i.architectures.length-e.architectures.length}function wd(i){var e=i.split("."),t=e.pop(),r={file:i,specificity:0};if(t==="node"){for(var n=0;n<e.length;n++){var s=e[n];if(s==="node"||s==="electron"||s==="node-webkit")r.runtime=s;else if(s==="napi")r.napi=!0;else if(s.slice(0,3)==="abi")r.abi=s.slice(3);else if(s.slice(0,2)==="uv")r.uv=s.slice(2);else if(s.slice(0,4)==="armv")r.armv=s.slice(4);else if(s==="glibc"||s==="musl")r.libc=s;else continue;r.specificity++}return r}}function _d(i,e){return function(t){return!(t==null||t.runtime&&t.runtime!==i&&!xw(t)||t.abi&&t.abi!==e&&!t.napi||t.uv&&t.uv!==gd||t.armv&&t.armv!==Ha||t.libc&&t.libc!==vd)}}function xw(i){return i.runtime==="node"&&i.napi}function Sd(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 yw(){return!!(process.versions&&process.versions.nw)}function bw(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function ww(i){return i==="linux"&&fd.existsSync("/etc/alpine-release")}Ht.parseTags=wd;Ht.matchTags=_d;Ht.compareTags=Sd;Ht.parseTuple=xd;Ht.matchTuple=yd;Ht.compareTuples=bd});var Va=T((cM,$a)=>{var Wa=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof Wa.addon=="function"?$a.exports=Wa.addon.bind(Wa):$a.exports=Cd()});var kd=T((lM,Td)=>{"use strict";var _w=(i,e,t,r,n)=>{for(var s=0;s<n;s++)t[r+s]=i[s]^e[s&3]},Sw=(i,e)=>{let t=i.length;for(var r=0;r<t;r++)i[r]^=e[r&3]};Td.exports={mask:_w,unmask:Sw}});var Md=T((uM,Ka)=>{"use strict";try{Ka.exports=Va()(__dirname)}catch{Ka.exports=kd()}});var Xr=T((pM,is)=>{"use strict";var{EMPTY_BUFFER:Ew}=Xt(),Ga=Buffer[Symbol.species];function Cw(i,e){if(i.length===0)return Ew;if(i.length===1)return i[0];let t=Buffer.allocUnsafe(e),r=0;for(let n=0;n<i.length;n++){let s=i[n];t.set(s,r),r+=s.length}return r<e?new Ga(t.buffer,t.byteOffset,r):t}function Od(i,e,t,r,n){for(let s=0;s<n;s++)t[r+s]=i[s]^e[s&3]}function Ad(i,e){for(let t=0;t<i.length;t++)i[t]^=e[t&3]}function Tw(i){return i.length===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.length)}function Ya(i){if(Ya.readOnly=!0,Buffer.isBuffer(i))return i;let e;return i instanceof ArrayBuffer?e=new Ga(i):ArrayBuffer.isView(i)?e=new Ga(i.buffer,i.byteOffset,i.byteLength):(e=Buffer.from(i),Ya.readOnly=!1),e}is.exports={concat:Cw,mask:Od,toArrayBuffer:Tw,toBuffer:Ya,unmask:Ad};if(!process.env.WS_NO_BUFFER_UTIL)try{let i=Md();is.exports.mask=function(e,t,r,n,s){s<48?Od(e,t,r,n,s):i.mask(e,t,r,n,s)},is.exports.unmask=function(e,t){e.length<32?Ad(e,t):i.unmask(e,t)}}catch{}});var Bd=T((dM,Pd)=>{"use strict";var Rd=Symbol("kDone"),Ja=Symbol("kRun"),Xa=class{constructor(e){this[Rd]=()=>{this.pending--,this[Ja]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Ja]()}[Ja](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[Rd])}}};Pd.exports=Xa});var Qr=T((fM,jd)=>{"use strict";var Zr=require("zlib"),Nd=Xr(),kw=Bd(),{kStatusCode:Id}=Xt(),Mw=Buffer[Symbol.species],Ow=Buffer.from([0,0,255,255]),ns=Symbol("permessage-deflate"),Qt=Symbol("total-length"),ir=Symbol("callback"),mi=Symbol("buffers"),rr=Symbol("error"),rs,Za=class{constructor(e,t,r){if(this._maxPayload=r|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,!rs){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;rs=new kw(n)}}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[ir];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,r=e.find(n=>!(t.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>n.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!n.client_max_window_bits));if(!r)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(r.server_no_context_takeover=!0),t.clientNoContextTakeover&&(r.client_no_context_takeover=!0),typeof t.serverMaxWindowBits=="number"&&(r.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?r.client_max_window_bits=t.clientMaxWindowBits:(r.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete r.client_max_window_bits,r}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(r=>{let n=t[r];if(n.length>1)throw new Error(`Parameter "${r}" must have only a single value`);if(n=n[0],r==="client_max_window_bits"){if(n!==!0){let s=+n;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${n}`);n=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${r}": ${n}`)}else if(r==="server_max_window_bits"){let s=+n;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${n}`);n=s}else if(r==="client_no_context_takeover"||r==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${r}": ${n}`)}else throw new Error(`Unknown parameter "${r}"`);t[r]=n})}),e}decompress(e,t,r){rs.add(n=>{this._decompress(e,t,(s,o)=>{n(),r(s,o)})})}compress(e,t,r){rs.add(n=>{this._compress(e,t,(s,o)=>{n(),r(s,o)})})}_decompress(e,t,r){let n=this._isServer?"client":"server";if(!this._inflate){let s=`${n}_max_window_bits`,o=typeof this.params[s]!="number"?Zr.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=Zr.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[ns]=this,this._inflate[Qt]=0,this._inflate[mi]=[],this._inflate.on("error",Rw),this._inflate.on("data",Dd)}this._inflate[ir]=r,this._inflate.write(e),t&&this._inflate.write(Ow),this._inflate.flush(()=>{let s=this._inflate[rr];if(s){this._inflate.close(),this._inflate=null,r(s);return}let o=Nd.concat(this._inflate[mi],this._inflate[Qt]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Qt]=0,this._inflate[mi]=[],t&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),r(null,o)})}_compress(e,t,r){let n=this._isServer?"server":"client";if(!this._deflate){let s=`${n}_max_window_bits`,o=typeof this.params[s]!="number"?Zr.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=Zr.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[Qt]=0,this._deflate[mi]=[],this._deflate.on("data",Aw)}this._deflate[ir]=r,this._deflate.write(e),this._deflate.flush(Zr.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=Nd.concat(this._deflate[mi],this._deflate[Qt]);t&&(s=new Mw(s.buffer,s.byteOffset,s.length-4)),this._deflate[ir]=null,this._deflate[Qt]=0,this._deflate[mi]=[],t&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),r(null,s)})}};jd.exports=Za;function Aw(i){this[mi].push(i),this[Qt]+=i.length}function Dd(i){if(this[Qt]+=i.length,this[ns]._maxPayload<1||this[Qt]<=this[ns]._maxPayload){this[mi].push(i);return}this[rr]=new RangeError("Max payload size exceeded"),this[rr].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[rr][Id]=1009,this.removeListener("data",Dd),this.reset()}function Rw(i){if(this[ns]._inflate=null,this[rr]){this[ir](this[rr]);return}i[Id]=1007,this[ir](i)}});var qd=T((hM,Ld)=>{"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}Ld.exports=Pw});var Fd=T((mM,Qa)=>{"use strict";try{Qa.exports=Va()(__dirname)}catch{Qa.exports=qd()}});var nr=T((vM,ss)=>{"use strict";var{isUtf8:Ud}=require("buffer"),{hasBlob:Bw}=Xt(),Nw=[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 Iw(i){return i>=1e3&&i<=1014&&i!==1004&&i!==1005&&i!==1006||i>=3e3&&i<=4999}function ec(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 Dw(i){return Bw&&typeof i=="object"&&typeof i.arrayBuffer=="function"&&typeof i.type=="string"&&typeof i.stream=="function"&&(i[Symbol.toStringTag]==="Blob"||i[Symbol.toStringTag]==="File")}ss.exports={isBlob:Dw,isValidStatusCode:Iw,isValidUTF8:ec,tokenChars:Nw};if(Ud)ss.exports.isValidUTF8=function(i){return i.length<24?ec(i):Ud(i)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let i=Fd();ss.exports.isValidUTF8=function(e){return e.length<32?ec(e):i(e)}}catch{}});var sc=T((gM,Gd)=>{"use strict";var{Writable:jw}=require("stream"),Hd=Qr(),{BINARY_TYPES:Lw,EMPTY_BUFFER:zd,kStatusCode:qw,kWebSocket:Fw}=Xt(),{concat:tc,toArrayBuffer:Uw,unmask:Hw}=Xr(),{isValidStatusCode:zw,isValidUTF8:Wd}=nr(),os=Buffer[Symbol.species],gt=0,$d=1,Vd=2,Kd=3,ic=4,rc=5,as=6,nc=class extends jw{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||Lw[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[Fw]=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,r){if(this._opcode===8&&this._state==gt)return r();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(r)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let r=this._buffers[0];return this._buffers[0]=new os(r.buffer,r.byteOffset+e,r.length-e),new os(r.buffer,r.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let r=this._buffers[0],n=t.length-e;e>=r.length?t.set(this._buffers.shift(),n):(t.set(new Uint8Array(r.buffer,r.byteOffset,e),n),this._buffers[0]=new os(r.buffer,r.byteOffset+e,r.length-e)),e-=r.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case gt:this.getInfo(e);break;case $d:this.getPayloadLength16(e);break;case Vd:this.getPayloadLength64(e);break;case Kd:this.getMask();break;case ic:this.getData(e);break;case rc:case as: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 n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(n);return}let r=(t[0]&64)===64;if(r&&!this._extensions[Hd.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(r){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(n);return}if(r){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(n);return}this._payloadLength===126?this._state=$d:this._payloadLength===127?this._state=Vd: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),r=t.readUInt32BE(0);if(r>Math.pow(2,21)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(n);return}this._payloadLength=r*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=Kd:this._state=ic}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=ic}getData(e){let t=zd;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&&Hw(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=rc,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[Hd.extensionName].decompress(e,this._fin,(n,s)=>{if(n)return t(n);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,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=tc(r,t):this._binaryType==="arraybuffer"?n=Uw(tc(r,t)):this._binaryType==="blob"?n=new Blob(r):n=r,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=gt):(this._state=as,setImmediate(()=>{this.emit("message",n,!0),this._state=gt,this.startLoop(e)}))}else{let n=tc(r,t);if(!this._skipUTF8Validation&&!Wd(n)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===rc||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=gt):(this._state=as,setImmediate(()=>{this.emit("message",n,!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,zd),this.end();else{let r=e.readUInt16BE(0);if(!zw(r)){let s=this.createError(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let n=new os(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Wd(n)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._loop=!1,this.emit("conclude",r,n),this.end()}this._state=gt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=gt):(this._state=as,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=gt,this.startLoop(t)}))}createError(e,t,r,n,s){this._loop=!1,this._errored=!0;let o=new e(r?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=s,o[qw]=n,o}};Gd.exports=nc});var cc=T((yM,Xd)=>{"use strict";var{Duplex:xM}=require("stream"),{randomFillSync:Ww}=require("crypto"),Yd=Qr(),{EMPTY_BUFFER:$w,kWebSocket:Vw,NOOP:Kw}=Xt(),{isBlob:sr,isValidStatusCode:Gw}=nr(),{mask:Jd,toBuffer:ki}=Xr(),xt=Symbol("kByteLength"),Yw=Buffer.alloc(4),cs=8*1024,Mi,or=cs,Pt=0,Jw=1,Xw=2,oc=class i{constructor(e,t,r){this._extensions=t||{},r&&(this._generateMask=r,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Pt,this.onerror=Kw,this[Vw]=void 0}static frame(e,t){let r,n=!1,s=2,o=!1;t.mask&&(r=t.maskBuffer||Yw,t.generateMask?t.generateMask(r):(or===cs&&(Mi===void 0&&(Mi=Buffer.alloc(cs)),Ww(Mi,0,cs),or=0),r[0]=Mi[or++],r[1]=Mi[or++],r[2]=Mi[or++],r[3]=Mi[or++]),o=(r[0]|r[1]|r[2]|r[3])===0,s=6);let c;typeof e=="string"?(!t.mask||o)&&t[xt]!==void 0?c=t[xt]:(e=Buffer.from(e),c=e.length):(c=e.length,n=t.mask&&t.readOnly&&!o);let u=c;c>=65536?(s+=8,u=127):c>125&&(s+=2,u=126);let d=Buffer.allocUnsafe(n?c+s:s);return d[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(d[0]|=64),d[1]=u,u===126?d.writeUInt16BE(c,2):u===127&&(d[2]=d[3]=0,d.writeUIntBE(c,4,6)),t.mask?(d[1]|=128,d[s-4]=r[0],d[s-3]=r[1],d[s-2]=r[2],d[s-1]=r[3],o?[d,e]:n?(Jd(e,r,d,s,c),[d]):(Jd(e,r,e,0,c),[d,e])):[d,e]}close(e,t,r,n){let s;if(e===void 0)s=$w;else{if(typeof e!="number"||!Gw(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 c=Buffer.byteLength(t);if(c>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+c),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:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Pt?this.enqueue([this.dispatch,s,!1,o,n]):this.sendFrame(i.frame(s,o),n)}ping(e,t,r){let n,s;if(typeof e=="string"?(n=Buffer.byteLength(e),s=!1):sr(e)?(n=e.size,s=!1):(e=ki(e),n=e.length,s=ki.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[xt]:n,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};sr(e)?this._state!==Pt?this.enqueue([this.getBlobData,e,!1,o,r]):this.getBlobData(e,!1,o,r):this._state!==Pt?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(i.frame(e,o),r)}pong(e,t,r){let n,s;if(typeof e=="string"?(n=Buffer.byteLength(e),s=!1):sr(e)?(n=e.size,s=!1):(e=ki(e),n=e.length,s=ki.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[xt]:n,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};sr(e)?this._state!==Pt?this.enqueue([this.getBlobData,e,!1,o,r]):this.getBlobData(e,!1,o,r):this._state!==Pt?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(i.frame(e,o),r)}send(e,t,r){let n=this._extensions[Yd.extensionName],s=t.binary?2:1,o=t.compress,c,u;typeof e=="string"?(c=Buffer.byteLength(e),u=!1):sr(e)?(c=e.size,u=!1):(e=ki(e),c=e.length,u=ki.readOnly),this._firstFragment?(this._firstFragment=!1,o&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=c>=n._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0);let d={[xt]:c,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:u,rsv1:o};sr(e)?this._state!==Pt?this.enqueue([this.getBlobData,e,this._compress,d,r]):this.getBlobData(e,this._compress,d,r):this._state!==Pt?this.enqueue([this.dispatch,e,this._compress,d,r]):this.dispatch(e,this._compress,d,r)}getBlobData(e,t,r,n){this._bufferedBytes+=r[xt],this._state=Xw,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let c=new Error("The socket was closed while the blob was being read");process.nextTick(ac,this,c,n);return}this._bufferedBytes-=r[xt];let o=ki(s);t?this.dispatch(o,t,r,n):(this._state=Pt,this.sendFrame(i.frame(o,r),n),this.dequeue())}).catch(s=>{process.nextTick(Zw,this,s,n)})}dispatch(e,t,r,n){if(!t){this.sendFrame(i.frame(e,r),n);return}let s=this._extensions[Yd.extensionName];this._bufferedBytes+=r[xt],this._state=Jw,s.compress(e,r.fin,(o,c)=>{if(this._socket.destroyed){let u=new Error("The socket was closed while data was being compressed");ac(this,u,n);return}this._bufferedBytes-=r[xt],this._state=Pt,r.readOnly=!1,this.sendFrame(i.frame(c,r),n),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)}};Xd.exports=oc;function ac(i,e,t){typeof t=="function"&&t(e);for(let r=0;r<i._queue.length;r++){let n=i._queue[r],s=n[n.length-1];typeof s=="function"&&s(e)}}function Zw(i,e,t){ac(i,e,t),i.onerror(e)}});var af=T((bM,of)=>{"use strict";var{kForOnEventAttribute:en,kListener:lc}=Xt(),Zd=Symbol("kCode"),Qd=Symbol("kData"),ef=Symbol("kError"),tf=Symbol("kMessage"),rf=Symbol("kReason"),ar=Symbol("kTarget"),nf=Symbol("kType"),sf=Symbol("kWasClean"),ei=class{constructor(e){this[ar]=null,this[nf]=e}get target(){return this[ar]}get type(){return this[nf]}};Object.defineProperty(ei.prototype,"target",{enumerable:!0});Object.defineProperty(ei.prototype,"type",{enumerable:!0});var Oi=class extends ei{constructor(e,t={}){super(e),this[Zd]=t.code===void 0?0:t.code,this[rf]=t.reason===void 0?"":t.reason,this[sf]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[Zd]}get reason(){return this[rf]}get wasClean(){return this[sf]}};Object.defineProperty(Oi.prototype,"code",{enumerable:!0});Object.defineProperty(Oi.prototype,"reason",{enumerable:!0});Object.defineProperty(Oi.prototype,"wasClean",{enumerable:!0});var cr=class extends ei{constructor(e,t={}){super(e),this[ef]=t.error===void 0?null:t.error,this[tf]=t.message===void 0?"":t.message}get error(){return this[ef]}get message(){return this[tf]}};Object.defineProperty(cr.prototype,"error",{enumerable:!0});Object.defineProperty(cr.prototype,"message",{enumerable:!0});var tn=class extends ei{constructor(e,t={}){super(e),this[Qd]=t.data===void 0?null:t.data}get data(){return this[Qd]}};Object.defineProperty(tn.prototype,"data",{enumerable:!0});var Qw={addEventListener(i,e,t={}){for(let n of this.listeners(i))if(!t[en]&&n[lc]===e&&!n[en])return;let r;if(i==="message")r=function(s,o){let c=new tn("message",{data:o?s:s.toString()});c[ar]=this,ls(e,this,c)};else if(i==="close")r=function(s,o){let c=new Oi("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});c[ar]=this,ls(e,this,c)};else if(i==="error")r=function(s){let o=new cr("error",{error:s,message:s.message});o[ar]=this,ls(e,this,o)};else if(i==="open")r=function(){let s=new ei("open");s[ar]=this,ls(e,this,s)};else return;r[en]=!!t[en],r[lc]=e,t.once?this.once(i,r):this.on(i,r)},removeEventListener(i,e){for(let t of this.listeners(i))if(t[lc]===e&&!t[en]){this.removeListener(i,t);break}}};of.exports={CloseEvent:Oi,ErrorEvent:cr,Event:ei,EventTarget:Qw,MessageEvent:tn};function ls(i,e,t){typeof i=="object"&&i.handleEvent?i.handleEvent.call(i,t):i.call(e,t)}});var uc=T((wM,cf)=>{"use strict";var{tokenChars:rn}=nr();function zt(i,e,t){i[e]===void 0?i[e]=[t]:i[e].push(t)}function e_(i){let e=Object.create(null),t=Object.create(null),r=!1,n=!1,s=!1,o,c,u=-1,d=-1,f=-1,v=0;for(;v<i.length;v++)if(d=i.charCodeAt(v),o===void 0)if(f===-1&&rn[d]===1)u===-1&&(u=v);else if(v!==0&&(d===32||d===9))f===-1&&u!==-1&&(f=v);else if(d===59||d===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${v}`);f===-1&&(f=v);let E=i.slice(u,f);d===44?(zt(e,E,t),t=Object.create(null)):o=E,u=f=-1}else throw new SyntaxError(`Unexpected character at index ${v}`);else if(c===void 0)if(f===-1&&rn[d]===1)u===-1&&(u=v);else if(d===32||d===9)f===-1&&u!==-1&&(f=v);else if(d===59||d===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${v}`);f===-1&&(f=v),zt(t,i.slice(u,f),!0),d===44&&(zt(e,o,t),t=Object.create(null),o=void 0),u=f=-1}else if(d===61&&u!==-1&&f===-1)c=i.slice(u,v),u=f=-1;else throw new SyntaxError(`Unexpected character at index ${v}`);else if(n){if(rn[d]!==1)throw new SyntaxError(`Unexpected character at index ${v}`);u===-1?u=v:r||(r=!0),n=!1}else if(s)if(rn[d]===1)u===-1&&(u=v);else if(d===34&&u!==-1)s=!1,f=v;else if(d===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${v}`);else if(d===34&&i.charCodeAt(v-1)===61)s=!0;else if(f===-1&&rn[d]===1)u===-1&&(u=v);else if(u!==-1&&(d===32||d===9))f===-1&&(f=v);else if(d===59||d===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${v}`);f===-1&&(f=v);let E=i.slice(u,f);r&&(E=E.replace(/\\/g,""),r=!1),zt(t,c,E),d===44&&(zt(e,o,t),t=Object.create(null),o=void 0),c=void 0,u=f=-1}else throw new SyntaxError(`Unexpected character at index ${v}`);if(u===-1||s||d===32||d===9)throw new SyntaxError("Unexpected end of input");f===-1&&(f=v);let _=i.slice(u,f);return o===void 0?zt(e,_,t):(c===void 0?zt(t,_,!0):r?zt(t,c,_.replace(/\\/g,"")):zt(t,c,_),zt(e,o,t)),e}function t_(i){return Object.keys(i).map(e=>{let t=i[e];return Array.isArray(t)||(t=[t]),t.map(r=>[e].concat(Object.keys(r).map(n=>{let s=r[n];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?n:`${n}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}cf.exports={format:t_,parse:e_}});var fs=T((EM,bf)=>{"use strict";var i_=require("events"),r_=require("https"),n_=require("http"),pf=require("net"),s_=require("tls"),{randomBytes:o_,createHash:a_}=require("crypto"),{Duplex:_M,Readable:SM}=require("stream"),{URL:pc}=require("url"),vi=Qr(),c_=sc(),l_=cc(),{isBlob:u_}=nr(),{BINARY_TYPES:lf,EMPTY_BUFFER:us,GUID:p_,kForOnEventAttribute:dc,kListener:d_,kStatusCode:f_,kWebSocket:ze,NOOP:df}=Xt(),{EventTarget:{addEventListener:h_,removeEventListener:m_}}=af(),{format:v_,parse:g_}=uc(),{toBuffer:x_}=Xr(),y_=30*1e3,ff=Symbol("kAborted"),fc=[8,13],ti=["CONNECTING","OPEN","CLOSING","CLOSED"],b_=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,J=class i extends i_{constructor(e,t,r){super(),this._binaryType=lf[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=us,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?(r=t,t=[]):t=[t]),hf(this,e,t,r)):(this._autoPong=r.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){lf.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,r){let n=new c_({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation}),s=new l_(e,this._extensions,r.generateMask);this._receiver=n,this._sender=s,this._socket=e,n[ze]=this,s[ze]=this,e[ze]=this,n.on("conclude",S_),n.on("drain",E_),n.on("error",C_),n.on("message",T_),n.on("ping",k_),n.on("pong",M_),s.onerror=O_,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",gf),e.on("data",ds),e.on("end",xf),e.on("error",yf),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[vi.extensionName]&&this._extensions[vi.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,r=>{r||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),vf(this)}}pause(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,r){if(this.readyState===i.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=t=void 0):typeof t=="function"&&(r=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==i.OPEN){hc(this,e,r);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||us,t,r)}pong(e,t,r){if(this.readyState===i.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=t=void 0):typeof t=="function"&&(r=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==i.OPEN){hc(this,e,r);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||us,t,r)}resume(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,r){if(this.readyState===i.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(r=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==i.OPEN){hc(this,e,r);return}let n={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[vi.extensionName]||(n.compress=!1),this._sender.send(e||us,n,r)}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(J,"CONNECTING",{enumerable:!0,value:ti.indexOf("CONNECTING")});Object.defineProperty(J.prototype,"CONNECTING",{enumerable:!0,value:ti.indexOf("CONNECTING")});Object.defineProperty(J,"OPEN",{enumerable:!0,value:ti.indexOf("OPEN")});Object.defineProperty(J.prototype,"OPEN",{enumerable:!0,value:ti.indexOf("OPEN")});Object.defineProperty(J,"CLOSING",{enumerable:!0,value:ti.indexOf("CLOSING")});Object.defineProperty(J.prototype,"CLOSING",{enumerable:!0,value:ti.indexOf("CLOSING")});Object.defineProperty(J,"CLOSED",{enumerable:!0,value:ti.indexOf("CLOSED")});Object.defineProperty(J.prototype,"CLOSED",{enumerable:!0,value:ti.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(i=>{Object.defineProperty(J.prototype,i,{enumerable:!0})});["open","error","close","message"].forEach(i=>{Object.defineProperty(J.prototype,`on${i}`,{enumerable:!0,get(){for(let e of this.listeners(i))if(e[dc])return e[d_];return null},set(e){for(let t of this.listeners(i))if(t[dc]){this.removeListener(i,t);break}typeof e=="function"&&this.addEventListener(i,e,{[dc]:!0})}})});J.prototype.addEventListener=h_;J.prototype.removeEventListener=m_;bf.exports=J;function hf(i,e,t,r){let n={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:fc[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(i._autoPong=n.autoPong,!fc.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${fc.join(", ")})`);let s;if(e instanceof pc)s=e;else try{s=new pc(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:",c=s.protocol==="ws+unix:",u;if(s.protocol!=="ws:"&&!o&&!c?u=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:c&&!s.pathname?u="The URL's pathname is empty":s.hash&&(u="The URL contains a fragment identifier"),u){let k=new SyntaxError(u);if(i._redirects===0)throw k;ps(i,k);return}let d=o?443:80,f=o_(16).toString("base64"),v=o?r_.request:n_.request,_=new Set,E;if(n.createConnection=n.createConnection||(o?__:w_),n.defaultPort=n.defaultPort||d,n.port=s.port||d,n.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":f,Connection:"Upgrade",Upgrade:"websocket"},n.path=s.pathname+s.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(E=new vi(n.perMessageDeflate!==!0?n.perMessageDeflate:{},!1,n.maxPayload),n.headers["Sec-WebSocket-Extensions"]=v_({[vi.extensionName]:E.offer()})),t.length){for(let k of t){if(typeof k!="string"||!b_.test(k)||_.has(k))throw new SyntaxError("An invalid or duplicated subprotocol was specified");_.add(k)}n.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(s.username||s.password)&&(n.auth=`${s.username}:${s.password}`),c){let k=n.path.split(":");n.socketPath=k[0],n.path=k[1]}let C;if(n.followRedirects){if(i._redirects===0){i._originalIpc=c,i._originalSecure=o,i._originalHostOrSocketPath=c?n.socketPath:s.host;let k=r&&r.headers;if(r={...r,headers:{}},k)for(let[M,O]of Object.entries(k))r.headers[M.toLowerCase()]=O}else if(i.listenerCount("redirect")===0){let k=c?i._originalIpc?n.socketPath===i._originalHostOrSocketPath:!1:i._originalIpc?!1:s.host===i._originalHostOrSocketPath;(!k||i._originalSecure&&!o)&&(delete n.headers.authorization,delete n.headers.cookie,k||delete n.headers.host,n.auth=void 0)}n.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),C=i._req=v(n),i._redirects&&i.emit("redirect",i.url,C)}else C=i._req=v(n);n.timeout&&C.on("timeout",()=>{pt(i,C,"Opening handshake has timed out")}),C.on("error",k=>{C===null||C[ff]||(C=i._req=null,ps(i,k))}),C.on("response",k=>{let M=k.headers.location,O=k.statusCode;if(M&&n.followRedirects&&O>=300&&O<400){if(++i._redirects>n.maxRedirects){pt(i,C,"Maximum redirects exceeded");return}C.abort();let A;try{A=new pc(M,e)}catch{let U=new SyntaxError(`Invalid URL: ${M}`);ps(i,U);return}hf(i,A,t,r)}else i.emit("unexpected-response",C,k)||pt(i,C,`Unexpected server response: ${k.statusCode}`)}),C.on("upgrade",(k,M,O)=>{if(i.emit("upgrade",k),i.readyState!==J.CONNECTING)return;C=i._req=null;let A=k.headers.upgrade;if(A===void 0||A.toLowerCase()!=="websocket"){pt(i,M,"Invalid Upgrade header");return}let I=a_("sha1").update(f+p_).digest("base64");if(k.headers["sec-websocket-accept"]!==I){pt(i,M,"Invalid Sec-WebSocket-Accept header");return}let U=k.headers["sec-websocket-protocol"],Xe;if(U!==void 0?_.size?_.has(U)||(Xe="Server sent an invalid subprotocol"):Xe="Server sent a subprotocol but none was requested":_.size&&(Xe="Server sent no subprotocol"),Xe){pt(i,M,Xe);return}U&&(i._protocol=U);let te=k.headers["sec-websocket-extensions"];if(te!==void 0){if(!E){pt(i,M,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Le;try{Le=g_(te)}catch{pt(i,M,"Invalid Sec-WebSocket-Extensions header");return}let q=Object.keys(Le);if(q.length!==1||q[0]!==vi.extensionName){pt(i,M,"Server indicated an extension that was not requested");return}try{E.accept(Le[vi.extensionName])}catch{pt(i,M,"Invalid Sec-WebSocket-Extensions header");return}i._extensions[vi.extensionName]=E}i.setSocket(M,O,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(C,i):C.end()}function ps(i,e){i._readyState=J.CLOSING,i._errorEmitted=!0,i.emit("error",e),i.emitClose()}function w_(i){return i.path=i.socketPath,pf.connect(i)}function __(i){return i.path=void 0,!i.servername&&i.servername!==""&&(i.servername=pf.isIP(i.host)?"":i.host),s_.connect(i)}function pt(i,e,t){i._readyState=J.CLOSING;let r=new Error(t);Error.captureStackTrace(r,pt),e.setHeader?(e[ff]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(ps,i,r)):(e.destroy(r),e.once("error",i.emit.bind(i,"error")),e.once("close",i.emitClose.bind(i)))}function hc(i,e,t){if(e){let r=u_(e)?e.size:x_(e).length;i._socket?i._sender._bufferedBytes+=r:i._bufferedAmount+=r}if(t){let r=new Error(`WebSocket is not open: readyState ${i.readyState} (${ti[i.readyState]})`);process.nextTick(t,r)}}function S_(i,e){let t=this[ze];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=i,t._socket[ze]!==void 0&&(t._socket.removeListener("data",ds),process.nextTick(mf,t._socket),i===1005?t.close():t.close(i,e))}function E_(){let i=this[ze];i.isPaused||i._socket.resume()}function C_(i){let e=this[ze];e._socket[ze]!==void 0&&(e._socket.removeListener("data",ds),process.nextTick(mf,e._socket),e.close(i[f_])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",i))}function uf(){this[ze].emitClose()}function T_(i,e){this[ze].emit("message",i,e)}function k_(i){let e=this[ze];e._autoPong&&e.pong(i,!this._isServer,df),e.emit("ping",i)}function M_(i){this[ze].emit("pong",i)}function mf(i){i.resume()}function O_(i){let e=this[ze];e.readyState!==J.CLOSED&&(e.readyState===J.OPEN&&(e._readyState=J.CLOSING,vf(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",i)))}function vf(i){i._closeTimer=setTimeout(i._socket.destroy.bind(i._socket),y_)}function gf(){let i=this[ze];this.removeListener("close",gf),this.removeListener("data",ds),this.removeListener("end",xf),i._readyState=J.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",uf),i._receiver.on("finish",uf))}function ds(i){this[ze]._receiver.write(i)||this.pause()}function xf(){let i=this[ze];i._readyState=J.CLOSING,i._receiver.end(),this.end()}function yf(){let i=this[ze];this.removeListener("error",yf),this.on("error",df),i&&(i._readyState=J.CLOSING,this.destroy())}});var Ef=T((TM,Sf)=>{"use strict";var CM=fs(),{Duplex:A_}=require("stream");function wf(i){i.emit("close")}function R_(){!this.destroyed&&this._writableState.finished&&this.destroy()}function _f(i){this.removeListener("error",_f),this.destroy(),this.listenerCount("error")===0&&this.emit("error",i)}function P_(i,e){let t=!0,r=new A_({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return i.on("message",function(s,o){let c=!o&&r._readableState.objectMode?s.toString():s;r.push(c)||i.pause()}),i.once("error",function(s){r.destroyed||(t=!1,r.destroy(s))}),i.once("close",function(){r.destroyed||r.push(null)}),r._destroy=function(n,s){if(i.readyState===i.CLOSED){s(n),process.nextTick(wf,r);return}let o=!1;i.once("error",function(u){o=!0,s(u)}),i.once("close",function(){o||s(n),process.nextTick(wf,r)}),t&&i.terminate()},r._final=function(n){if(i.readyState===i.CONNECTING){i.once("open",function(){r._final(n)});return}i._socket!==null&&(i._socket._writableState.finished?(n(),r._readableState.endEmitted&&r.destroy()):(i._socket.once("finish",function(){n()}),i.close()))},r._read=function(){i.isPaused&&i.resume()},r._write=function(n,s,o){if(i.readyState===i.CONNECTING){i.once("open",function(){r._write(n,s,o)});return}i.send(n,o)},r.on("end",R_),r.on("error",_f),r}Sf.exports=P_});var Tf=T((kM,Cf)=>{"use strict";var{tokenChars:B_}=nr();function N_(i){let e=new Set,t=-1,r=-1,n=0;for(n;n<i.length;n++){let o=i.charCodeAt(n);if(r===-1&&B_[o]===1)t===-1&&(t=n);else if(n!==0&&(o===32||o===9))r===-1&&t!==-1&&(r=n);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${n}`);r===-1&&(r=n);let c=i.slice(t,r);if(e.has(c))throw new SyntaxError(`The "${c}" subprotocol is duplicated`);e.add(c),t=r=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(t===-1||r!==-1)throw new SyntaxError("Unexpected end of input");let s=i.slice(t,n);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}Cf.exports={parse:N_}});var Bf=T((OM,Pf)=>{"use strict";var I_=require("events"),hs=require("http"),{Duplex:MM}=require("stream"),{createHash:D_}=require("crypto"),kf=uc(),Ai=Qr(),j_=Tf(),L_=fs(),{GUID:q_,kWebSocket:F_}=Xt(),U_=/^[+/0-9A-Za-z]{22}==$/,Mf=0,Of=1,Rf=2,mc=class extends I_{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:L_,...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=hs.createServer((r,n)=>{let s=hs.STATUS_CODES[426];n.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),n.end(s)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let r=this.emit.bind(this,"connection");this._removeListeners=H_(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,s,o)=>{this.handleUpgrade(n,s,o,r)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=Mf}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===Rf){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(nn,this);return}if(e&&this.once("close",e),this._state!==Of)if(this._state=Of,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(nn,this):process.nextTick(nn,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{nn(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,r,n){t.on("error",Af);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,c=+e.headers["sec-websocket-version"];if(e.method!=="GET"){Ri(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){Ri(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!U_.test(s)){Ri(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(c!==13&&c!==8){Ri(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){sn(t,400);return}let u=e.headers["sec-websocket-protocol"],d=new Set;if(u!==void 0)try{d=j_.parse(u)}catch{Ri(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 Ai(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let E=kf.parse(f);E[Ai.extensionName]&&(_.accept(E[Ai.extensionName]),v[Ai.extensionName]=_)}catch{Ri(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let _={origin:e.headers[`${c===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 sn(t,C||401,k,M);this.completeUpgrade(v,s,d,e,t,r,n)});return}if(!this.options.verifyClient(_))return sn(t,401)}this.completeUpgrade(v,s,d,e,t,r,n)}completeUpgrade(e,t,r,n,s,o,c){if(!s.readable||!s.writable)return s.destroy();if(s[F_])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Mf)return sn(s,503);let d=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${D_("sha1").update(t+q_).digest("base64")}`],f=new this.options.WebSocket(null,void 0,this.options);if(r.size){let v=this.options.handleProtocols?this.options.handleProtocols(r,n):r.values().next().value;v&&(d.push(`Sec-WebSocket-Protocol: ${v}`),f._protocol=v)}if(e[Ai.extensionName]){let v=e[Ai.extensionName].params,_=kf.format({[Ai.extensionName]:[v]});d.push(`Sec-WebSocket-Extensions: ${_}`),f._extensions=e}this.emit("headers",d,n),s.write(d.concat(`\r
|
|
10
10
|
`).join(`\r
|
|
11
|
-
`)),s.removeListener("error",Af),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(nn,this)})),c(f,n)}};Pf.exports=mc;function
|
|
11
|
+
`)),s.removeListener("error",Af),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(nn,this)})),c(f,n)}};Pf.exports=mc;function H_(i,e){for(let t of Object.keys(e))i.on(t,e[t]);return function(){for(let r of Object.keys(e))i.removeListener(r,e[r])}}function nn(i){i._state=Rf,i.emit("close")}function Af(){this.destroy()}function sn(i,e,t,r){t=t||hs.STATUS_CODES[e],r={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...r},i.once("finish",i.destroy),i.end(`HTTP/1.1 ${e} ${hs.STATUS_CODES[e]}\r
|
|
12
12
|
`+Object.keys(r).map(n=>`${n}: ${r[n]}`).join(`\r
|
|
13
13
|
`)+`\r
|
|
14
14
|
\r
|
|
15
|
-
`+t)}function Ri(i,e,t,r,n,s){if(i.listenerCount("wsClientError")){let o=new Error(n);Error.captureStackTrace(o,Ri),i.emit("wsClientError",o,t,e)}else sn(t,r,n,s)}});var vc=T((AM,Nf)=>{"use strict";var ii=fs();ii.createWebSocketStream=Ef();ii.Server=Bf();ii.Receiver=sc();ii.Sender=cc();ii.WebSocket=ii;ii.WebSocketServer=ii.Server;Nf.exports=ii});var jf=T((RM,Df)=>{"use strict";var If=Object.getOwnPropertySymbols,H_=Object.prototype.hasOwnProperty,z_=Object.prototype.propertyIsEnumerable;function W_(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function $_(){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 r=Object.getOwnPropertyNames(e).map(function(s){return e[s]});if(r.join("")!=="0123456789")return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(s){n[s]=s}),Object.keys(Object.assign({},n)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Df.exports=$_()?Object.assign:function(i,e){for(var t,r=W_(i),n,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var o in t)H_.call(t,o)&&(r[o]=t[o]);if(If){n=If(t);for(var c=0;c<n.length;c++)z_.call(t,n[c])&&(r[n[c]]=t[n[c]])}}return r}});var Ff=T((PM,gc)=>{"use strict";gc.exports=K_;gc.exports.append=qf;var V_=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function qf(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:Lf(String(e)),r=0;r<t.length;r++)if(!V_.test(t[r]))throw new TypeError("field argument contains an invalid header name");if(i==="*")return i;var n=i,s=Lf(i.toLowerCase());if(t.indexOf("*")!==-1||s.indexOf("*")!==-1)return"*";for(var o=0;o<t.length;o++){var c=t[o].toLowerCase();s.indexOf(c)===-1&&(s.push(c),n=n?n+", "+t[o]:t[o])}return n}function Lf(i){for(var e=0,t=[],r=0,n=0,s=i.length;n<s;n++)switch(i.charCodeAt(n)){case 32:r===e&&(r=e=n+1);break;case 44:t.push(i.substring(r,e)),r=e=n+1;break;default:e=n+1;break}return t.push(i.substring(r,e)),t}function K_(i,e){if(!i||!i.getHeader||!i.setHeader)throw new TypeError("res argument is required");var t=i.getHeader("Vary")||"",r=Array.isArray(t)?t.join(", "):String(t);(t=qf(r,e))&&i.setHeader("Vary",t)}});var xc=T((BM,Uf)=>{(function(){"use strict";var i=jf(),e=Ff(),t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function r(C){return typeof C=="string"||C instanceof String}function n(C,k){if(Array.isArray(k)){for(var M=0;M<k.length;++M)if(n(C,k[M]))return!0;return!1}else return r(k)?C===k:k instanceof RegExp?k.test(C):!!k}function s(C,k){var M=k.headers.origin,O=[],A;return!C.origin||C.origin==="*"?O.push([{key:"Access-Control-Allow-Origin",value:"*"}]):r(C.origin)?(O.push([{key:"Access-Control-Allow-Origin",value:C.origin}]),O.push([{key:"Vary",value:"Origin"}])):(A=n(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 c(C){return C.credentials===!0?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function u(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 d(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=[],I=k.method&&k.method.toUpperCase&&k.method.toUpperCase();I==="OPTIONS"?(A.push(s(C,k)),A.push(c(C)),A.push(o(C)),A.push(u(C,k)),A.push(f(C)),A.push(d(C)),v(A,M),C.preflightContinue?O():(M.statusCode=C.optionsSuccessStatus,M.setHeader("Content-Length","0"),M.end())):(A.push(s(C,k)),A.push(c(C)),A.push(d(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,I){k(O,function(U,Xe){if(U)I(U);else{var te=i({},t,Xe),Le=null;te.origin&&typeof te.origin=="function"?Le=te.origin:te.origin&&(Le=function(q,qe){qe(null,te.origin)}),Le?Le(O.headers.origin,function(q,qe){q||!qe?I(q):(te.origin=qe,_(te,O,A,I))}):I()}})}}Uf.exports=E})()});var bc=T(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.Server=pr.BaseServer=void 0;var Hf=ma(),ms=Ia(),G_=require("events"),zf=ja(),Y_=ie(),J_=od(),X_=vc(),Wf=Ba(),Z_=Jr(),j=(0,Y_.default)("engine"),lr=Symbol("responseHeaders");function Q_(i){try{let e=JSON.parse(i);if(typeof e.sid=="string")return e.sid}catch{}}var ur=class extends G_.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:X_.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(xc()(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?ms.default[e].upgradesTo||[]:[]}verify(e,t,r){let n=e._query.transport;if(!~this.opts.transports.indexOf(n)||n==="webtransport")return j('unknown transport "%s"',n),r(G.errors.UNKNOWN_TRANSPORT,{transport:n});if(eS(e.headers.origin)){let c=e.headers.origin;return e.headers.origin=null,j("origin header invalid"),r(G.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:c})}let o=e._query.sid;if(o){if(!this.clients.hasOwnProperty(o))return j('unknown sid "%s"',o),r(G.errors.UNKNOWN_SID,{sid:o});let c=this.clients[o].transport.name;if(!t&&c!==n)return j("bad request: unexpected transport without upgrade"),r(G.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:n,previousTransport:c})}else return e.method!=="GET"?r(G.errors.BAD_HANDSHAKE_METHOD,{method:e.method}):n==="websocket"&&!t?(j("invalid transport upgrade"),r(G.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"})):this.opts.allowRequest?this.opts.allowRequest(e,(c,u)=>{if(!u)return r(G.errors.FORBIDDEN,{message:c});r()}):r();r()}use(e){this.middlewares.push(e)}_applyMiddlewares(e,t,r){if(this.middlewares.length===0)return j("no middleware to apply, skipping"),r();let n=s=>{j("applying middleware n\xB0%d",s+1),this.middlewares[s](e,t,o=>{if(o)return r(o);s+1<this.middlewares.length?n(s+1):r()})};n(0)}close(){j("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 Hf.generateId()}async handshake(e,t,r){let n=t._query.EIO==="4"?4:3;if(n===3&&!this.opts.allowEIO3){j("unsupported protocol version"),this.emit("connection_error",{req:t,code:G.errors.UNSUPPORTED_PROTOCOL_VERSION,message:G.errorMessages[G.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:n}}),r(G.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let s;try{s=await this.generateId(t)}catch(u){j("error while generating an id"),this.emit("connection_error",{req:t,code:G.errors.BAD_REQUEST,message:G.errorMessages[G.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:u}}),r(G.errors.BAD_REQUEST);return}j('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(u){j('error handshaking to transport "%s"',e),this.emit("connection_error",{req:t,code:G.errors.BAD_REQUEST,message:G.errorMessages[G.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:u}}),r(G.errors.BAD_REQUEST);return}let c=new zf.Socket(s,this,o,t,n);return o.on("headers",(u,d)=>{!d._query.sid&&(this.opts.cookie&&(u["Set-Cookie"]=[(0,J_.serialize)(this.opts.cookie.name,s,this.opts.cookie)]),this.emit("initial_headers",u,d)),this.emit("headers",u,d)}),o.onRequest(t),this.clients[s]=c,this.clientsCount++,c.once("close",()=>{delete this.clients[s],this.clientsCount--}),this.emit("connection",c),o}async onWebTransportSession(e){let t=setTimeout(()=>{j("the client failed to establish a bidirectional stream in the given period"),e.close()},this.opts.upgradeTimeout),n=await e.incomingBidirectionalStreams.getReader().read();if(n.done){j("session is closed");return}let s=n.value,o=(0,Z_.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),c=s.readable.pipeThrough(o).getReader(),{value:u,done:d}=await c.read();if(d){j("stream is closed");return}if(clearTimeout(t),u.type!=="open")return j("invalid WebTransport handshake"),e.close();if(u.data===void 0){let _=new Wf.WebTransport(e,s,c),E=Hf.generateId();j('handshaking client "%s" (WebTransport)',E);let C=new zf.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=Q_(u.data);if(!f)return j("invalid WebTransport handshake"),e.close();let v=this.clients[f];if(!v)j("upgrade attempt for closed client"),e.close();else if(v.upgrading)j("transport has already been trying to upgrade"),e.close();else if(v.upgraded)j("transport had already been upgraded"),e.close();else{j("upgrading existing transport");let _=new Wf.WebTransport(e,s,c);v._maybeUpgrade(_)}}};pr.BaseServer=ur;ur.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};ur.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};var yc=class{constructor(e,t){this.req=e,this.socket=t,e[lr]={}}setHeader(e,t){this.req[lr][e]=t}getHeader(e){return this.req[lr][e]}removeHeader(e){delete this.req[lr][e]}write(){}writeHead(){}end(){this.socket.destroy()}},G=class i extends ur{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 r=t[lr]||{};delete t[lr],!t._query.sid&&this.emit("initial_headers",r,t),this.emit("headers",r,t),j("writing headers: %j",r),Object.keys(r).forEach(s=>{e.push(`${s}: ${r[s]}`)})}))}cleanup(){this.ws&&(j("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 ms.default[e](t)}handleRequest(e,t){j('handling "%s" http request "%s"',e.method,e.url),this.prepare(e),e.res=t;let r=(n,s)=>{if(n!==void 0){this.emit("connection_error",{req:e,code:n,message:i.errorMessages[n],context:s}),$f(t,n,s);return}if(e._query.sid)j("setting new request for existing client"),this.clients[e._query.sid].transport.onRequest(e);else{let o=(c,u)=>$f(t,c,u);this.handshake(e._query.transport,e,o)}};this._applyMiddlewares(e,t,n=>{n?r(i.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!1,r)})}handleUpgrade(e,t,r){this.prepare(e);let n=new yc(e,t),s=(o,c)=>{if(o!==void 0){this.emit("connection_error",{req:e,code:o,message:i.errorMessages[o],context:c}),Vf(t,o,c);return}let u=Buffer.from(r);r=null,n.writeHead(),this.ws.handleUpgrade(e,t,u,d=>{this.onWebSocket(e,t,d)})};this._applyMiddlewares(e,n,o=>{o?s(i.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!0,s)})}onWebSocket(e,t,r){if(r.on("error",s),ms.default[e._query.transport]!==void 0&&!ms.default[e._query.transport].prototype.handlesUpgrades){j("transport doesnt handle upgraded requests"),r.close();return}let n=e._query.sid;if(e.websocket=r,n){let o=this.clients[n];if(!o)j("upgrade attempt for closed client"),r.close();else if(o.upgrading)j("transport has already been trying to upgrade"),r.close();else if(o.upgraded)j("transport had already been upgraded"),r.close();else{j("upgrading existing transport"),r.removeListener("error",s);let c=this.createTransport(e._query.transport,e);c.perMessageDeflate=this.opts.perMessageDeflate,o._maybeUpgrade(c)}}else{let o=(c,u)=>Vf(t,c,u);this.handshake(e._query.transport,e,o)}function s(){j("websocket error before upgrade")}}attach(e,t={}){let r=this._computePath(t),n=t.destroyUpgradeTimeout||1e3;function s(c){return r===c.url.slice(0,r.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",(c,u)=>{if(s(c))j('intercepting request for path "%s"',r),this.handleRequest(c,u);else{let d=0,f=o.length;for(;d<f;d++)o[d].call(e,c,u)}}),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",(c,u,d)=>{s(c)?this.handleUpgrade(c,u,d):t.destroyUpgrade!==!1&&setTimeout(function(){if(u.writable&&u.bytesWritten<=0)return u.on("error",f=>{j("error while destroying upgrade: %s",f.message)}),u.end()},n)})}};pr.Server=G;function $f(i,e,t){let r=e===G.errors.FORBIDDEN?403:400,n=t&&t.message?t.message:G.errorMessages[e];i.writeHead(r,{"Content-Type":"application/json"}),i.end(JSON.stringify({code:e,message:n}))}function Vf(i,e,t={}){if(i.on("error",()=>{j("ignoring error from closed connection")}),i.writable){let r=t.message||G.errorMessages[e],n=Buffer.byteLength(r);i.write(`HTTP/1.1 400 Bad Request\r
|
|
15
|
+
`+t)}function Ri(i,e,t,r,n,s){if(i.listenerCount("wsClientError")){let o=new Error(n);Error.captureStackTrace(o,Ri),i.emit("wsClientError",o,t,e)}else sn(t,r,n,s)}});var vc=T((AM,Nf)=>{"use strict";var ii=fs();ii.createWebSocketStream=Ef();ii.Server=Bf();ii.Receiver=sc();ii.Sender=cc();ii.WebSocket=ii;ii.WebSocketServer=ii.Server;Nf.exports=ii});var jf=T((RM,Df)=>{"use strict";var If=Object.getOwnPropertySymbols,z_=Object.prototype.hasOwnProperty,W_=Object.prototype.propertyIsEnumerable;function $_(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function V_(){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 r=Object.getOwnPropertyNames(e).map(function(s){return e[s]});if(r.join("")!=="0123456789")return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(s){n[s]=s}),Object.keys(Object.assign({},n)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Df.exports=V_()?Object.assign:function(i,e){for(var t,r=$_(i),n,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var o in t)z_.call(t,o)&&(r[o]=t[o]);if(If){n=If(t);for(var c=0;c<n.length;c++)W_.call(t,n[c])&&(r[n[c]]=t[n[c]])}}return r}});var Ff=T((PM,gc)=>{"use strict";gc.exports=G_;gc.exports.append=qf;var K_=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function qf(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:Lf(String(e)),r=0;r<t.length;r++)if(!K_.test(t[r]))throw new TypeError("field argument contains an invalid header name");if(i==="*")return i;var n=i,s=Lf(i.toLowerCase());if(t.indexOf("*")!==-1||s.indexOf("*")!==-1)return"*";for(var o=0;o<t.length;o++){var c=t[o].toLowerCase();s.indexOf(c)===-1&&(s.push(c),n=n?n+", "+t[o]:t[o])}return n}function Lf(i){for(var e=0,t=[],r=0,n=0,s=i.length;n<s;n++)switch(i.charCodeAt(n)){case 32:r===e&&(r=e=n+1);break;case 44:t.push(i.substring(r,e)),r=e=n+1;break;default:e=n+1;break}return t.push(i.substring(r,e)),t}function G_(i,e){if(!i||!i.getHeader||!i.setHeader)throw new TypeError("res argument is required");var t=i.getHeader("Vary")||"",r=Array.isArray(t)?t.join(", "):String(t);(t=qf(r,e))&&i.setHeader("Vary",t)}});var xc=T((BM,Uf)=>{(function(){"use strict";var i=jf(),e=Ff(),t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function r(C){return typeof C=="string"||C instanceof String}function n(C,k){if(Array.isArray(k)){for(var M=0;M<k.length;++M)if(n(C,k[M]))return!0;return!1}else return r(k)?C===k:k instanceof RegExp?k.test(C):!!k}function s(C,k){var M=k.headers.origin,O=[],A;return!C.origin||C.origin==="*"?O.push([{key:"Access-Control-Allow-Origin",value:"*"}]):r(C.origin)?(O.push([{key:"Access-Control-Allow-Origin",value:C.origin}]),O.push([{key:"Vary",value:"Origin"}])):(A=n(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 c(C){return C.credentials===!0?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function u(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 d(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=[],I=k.method&&k.method.toUpperCase&&k.method.toUpperCase();I==="OPTIONS"?(A.push(s(C,k)),A.push(c(C)),A.push(o(C)),A.push(u(C,k)),A.push(f(C)),A.push(d(C)),v(A,M),C.preflightContinue?O():(M.statusCode=C.optionsSuccessStatus,M.setHeader("Content-Length","0"),M.end())):(A.push(s(C,k)),A.push(c(C)),A.push(d(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,I){k(O,function(U,Xe){if(U)I(U);else{var te=i({},t,Xe),Le=null;te.origin&&typeof te.origin=="function"?Le=te.origin:te.origin&&(Le=function(q,qe){qe(null,te.origin)}),Le?Le(O.headers.origin,function(q,qe){q||!qe?I(q):(te.origin=qe,_(te,O,A,I))}):I()}})}}Uf.exports=E})()});var bc=T(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.Server=pr.BaseServer=void 0;var Hf=ma(),ms=Ia(),Y_=require("events"),zf=ja(),J_=ie(),X_=od(),Z_=vc(),Wf=Ba(),Q_=Jr(),j=(0,J_.default)("engine"),lr=Symbol("responseHeaders");function eS(i){try{let e=JSON.parse(i);if(typeof e.sid=="string")return e.sid}catch{}}var ur=class extends Y_.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:Z_.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(xc()(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?ms.default[e].upgradesTo||[]:[]}verify(e,t,r){let n=e._query.transport;if(!~this.opts.transports.indexOf(n)||n==="webtransport")return j('unknown transport "%s"',n),r(G.errors.UNKNOWN_TRANSPORT,{transport:n});if(tS(e.headers.origin)){let c=e.headers.origin;return e.headers.origin=null,j("origin header invalid"),r(G.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:c})}let o=e._query.sid;if(o){if(!this.clients.hasOwnProperty(o))return j('unknown sid "%s"',o),r(G.errors.UNKNOWN_SID,{sid:o});let c=this.clients[o].transport.name;if(!t&&c!==n)return j("bad request: unexpected transport without upgrade"),r(G.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:n,previousTransport:c})}else return e.method!=="GET"?r(G.errors.BAD_HANDSHAKE_METHOD,{method:e.method}):n==="websocket"&&!t?(j("invalid transport upgrade"),r(G.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"})):this.opts.allowRequest?this.opts.allowRequest(e,(c,u)=>{if(!u)return r(G.errors.FORBIDDEN,{message:c});r()}):r();r()}use(e){this.middlewares.push(e)}_applyMiddlewares(e,t,r){if(this.middlewares.length===0)return j("no middleware to apply, skipping"),r();let n=s=>{j("applying middleware n\xB0%d",s+1),this.middlewares[s](e,t,o=>{if(o)return r(o);s+1<this.middlewares.length?n(s+1):r()})};n(0)}close(){j("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 Hf.generateId()}async handshake(e,t,r){let n=t._query.EIO==="4"?4:3;if(n===3&&!this.opts.allowEIO3){j("unsupported protocol version"),this.emit("connection_error",{req:t,code:G.errors.UNSUPPORTED_PROTOCOL_VERSION,message:G.errorMessages[G.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:n}}),r(G.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let s;try{s=await this.generateId(t)}catch(u){j("error while generating an id"),this.emit("connection_error",{req:t,code:G.errors.BAD_REQUEST,message:G.errorMessages[G.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:u}}),r(G.errors.BAD_REQUEST);return}j('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(u){j('error handshaking to transport "%s"',e),this.emit("connection_error",{req:t,code:G.errors.BAD_REQUEST,message:G.errorMessages[G.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:u}}),r(G.errors.BAD_REQUEST);return}let c=new zf.Socket(s,this,o,t,n);return o.on("headers",(u,d)=>{!d._query.sid&&(this.opts.cookie&&(u["Set-Cookie"]=[(0,X_.serialize)(this.opts.cookie.name,s,this.opts.cookie)]),this.emit("initial_headers",u,d)),this.emit("headers",u,d)}),o.onRequest(t),this.clients[s]=c,this.clientsCount++,c.once("close",()=>{delete this.clients[s],this.clientsCount--}),this.emit("connection",c),o}async onWebTransportSession(e){let t=setTimeout(()=>{j("the client failed to establish a bidirectional stream in the given period"),e.close()},this.opts.upgradeTimeout),n=await e.incomingBidirectionalStreams.getReader().read();if(n.done){j("session is closed");return}let s=n.value,o=(0,Q_.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),c=s.readable.pipeThrough(o).getReader(),{value:u,done:d}=await c.read();if(d){j("stream is closed");return}if(clearTimeout(t),u.type!=="open")return j("invalid WebTransport handshake"),e.close();if(u.data===void 0){let _=new Wf.WebTransport(e,s,c),E=Hf.generateId();j('handshaking client "%s" (WebTransport)',E);let C=new zf.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=eS(u.data);if(!f)return j("invalid WebTransport handshake"),e.close();let v=this.clients[f];if(!v)j("upgrade attempt for closed client"),e.close();else if(v.upgrading)j("transport has already been trying to upgrade"),e.close();else if(v.upgraded)j("transport had already been upgraded"),e.close();else{j("upgrading existing transport");let _=new Wf.WebTransport(e,s,c);v._maybeUpgrade(_)}}};pr.BaseServer=ur;ur.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};ur.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};var yc=class{constructor(e,t){this.req=e,this.socket=t,e[lr]={}}setHeader(e,t){this.req[lr][e]=t}getHeader(e){return this.req[lr][e]}removeHeader(e){delete this.req[lr][e]}write(){}writeHead(){}end(){this.socket.destroy()}},G=class i extends ur{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 r=t[lr]||{};delete t[lr],!t._query.sid&&this.emit("initial_headers",r,t),this.emit("headers",r,t),j("writing headers: %j",r),Object.keys(r).forEach(s=>{e.push(`${s}: ${r[s]}`)})}))}cleanup(){this.ws&&(j("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 ms.default[e](t)}handleRequest(e,t){j('handling "%s" http request "%s"',e.method,e.url),this.prepare(e),e.res=t;let r=(n,s)=>{if(n!==void 0){this.emit("connection_error",{req:e,code:n,message:i.errorMessages[n],context:s}),$f(t,n,s);return}if(e._query.sid)j("setting new request for existing client"),this.clients[e._query.sid].transport.onRequest(e);else{let o=(c,u)=>$f(t,c,u);this.handshake(e._query.transport,e,o)}};this._applyMiddlewares(e,t,n=>{n?r(i.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!1,r)})}handleUpgrade(e,t,r){this.prepare(e);let n=new yc(e,t),s=(o,c)=>{if(o!==void 0){this.emit("connection_error",{req:e,code:o,message:i.errorMessages[o],context:c}),Vf(t,o,c);return}let u=Buffer.from(r);r=null,n.writeHead(),this.ws.handleUpgrade(e,t,u,d=>{this.onWebSocket(e,t,d)})};this._applyMiddlewares(e,n,o=>{o?s(i.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!0,s)})}onWebSocket(e,t,r){if(r.on("error",s),ms.default[e._query.transport]!==void 0&&!ms.default[e._query.transport].prototype.handlesUpgrades){j("transport doesnt handle upgraded requests"),r.close();return}let n=e._query.sid;if(e.websocket=r,n){let o=this.clients[n];if(!o)j("upgrade attempt for closed client"),r.close();else if(o.upgrading)j("transport has already been trying to upgrade"),r.close();else if(o.upgraded)j("transport had already been upgraded"),r.close();else{j("upgrading existing transport"),r.removeListener("error",s);let c=this.createTransport(e._query.transport,e);c.perMessageDeflate=this.opts.perMessageDeflate,o._maybeUpgrade(c)}}else{let o=(c,u)=>Vf(t,c,u);this.handshake(e._query.transport,e,o)}function s(){j("websocket error before upgrade")}}attach(e,t={}){let r=this._computePath(t),n=t.destroyUpgradeTimeout||1e3;function s(c){return r===c.url.slice(0,r.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",(c,u)=>{if(s(c))j('intercepting request for path "%s"',r),this.handleRequest(c,u);else{let d=0,f=o.length;for(;d<f;d++)o[d].call(e,c,u)}}),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",(c,u,d)=>{s(c)?this.handleUpgrade(c,u,d):t.destroyUpgrade!==!1&&setTimeout(function(){if(u.writable&&u.bytesWritten<=0)return u.on("error",f=>{j("error while destroying upgrade: %s",f.message)}),u.end()},n)})}};pr.Server=G;function $f(i,e,t){let r=e===G.errors.FORBIDDEN?403:400,n=t&&t.message?t.message:G.errorMessages[e];i.writeHead(r,{"Content-Type":"application/json"}),i.end(JSON.stringify({code:e,message:n}))}function Vf(i,e,t={}){if(i.on("error",()=>{j("ignoring error from closed connection")}),i.writable){let r=t.message||G.errorMessages[e],n=Buffer.byteLength(r);i.write(`HTTP/1.1 400 Bad Request\r
|
|
16
16
|
Connection: close\r
|
|
17
17
|
Content-type: text/html\r
|
|
18
18
|
Content-Length: `+n+`\r
|
|
19
19
|
\r
|
|
20
|
-
`+r)}i.destroy()}var on=[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 eS(i){if(i+="",i.length<1)return!1;if(!on[i.charCodeAt(0)])return j('invalid header, index 0, char "%s"',i.charCodeAt(0)),!0;if(i.length<2)return!1;if(!on[i.charCodeAt(1)])return j('invalid header, index 1, char "%s"',i.charCodeAt(1)),!0;if(i.length<3)return!1;if(!on[i.charCodeAt(2)])return j('invalid header, index 2, char "%s"',i.charCodeAt(2)),!0;if(i.length<4)return!1;if(!on[i.charCodeAt(3)])return j('invalid header, index 3, char "%s"',i.charCodeAt(3)),!0;for(let e=4;e<i.length;++e)if(!on[i.charCodeAt(e)])return j('invalid header, index "%i", char "%s"',e,i.charCodeAt(e)),!0;return!1}});var Gf=T(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.Polling=void 0;var tS=Ti(),Kf=require("zlib"),iS=jn(),rS=ie(),yt=(0,rS.default)("engine:polling"),nS={gzip:Kf.createGzip,deflate:Kf.createDeflate},wc=class extends tS.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 r=()=>{this.writable=!1,this.onError("poll connection closed prematurely")},n=()=>{this.req=this.res=null};e.cleanup=n,t.onAborted(r),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 r=Number(e.headers["content-length"]);if(!r){this.onError("content-length header required"),t.writeStatus("411 Length Required").end();return}if(r>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,c={"Content-Type":"text/html"};this.headers(e,c);for(let d in c)t.writeHeader(d,String(c[d]));let u=d=>{this.onData(d.toString()),this.onDataRequestCleanup(),t.cork(()=>{t.end("ok")})};t.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),t.onData((d,f)=>{let v=o+d.byteLength;if(v>r){this.onError("content-length mismatch"),t.close();return}if(!s){if(f){u(Buffer.from(d));return}s=Buffer.allocUnsafe(r)}if(Buffer.from(d).copy(s,o),f){if(v!=r){this.onError("content-length mismatch"),t.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}u(s);return}o=v})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(e){yt('received "%s"',e);let t=r=>{if(r.type==="close")return yt("got xhr close packet"),this.onClose(),!1;this.onPacket(r)};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=r=>{let n=e.some(s=>s.options&&s.options.compress);this.write(r,{compress:n})};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,r){let n=typeof e=="string",o={"Content-Type":n?"text/plain; charset=UTF-8":"application/octet-stream"},c=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)}),r()};if(!this.httpCompression||!t.compress){c(e);return}if((n?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){c(e);return}let d=iS(this.req).encodings(["gzip","deflate"]);if(!d){c(e);return}this.compress(e,d,(f,v)=>{if(f){this.res.writeStatus("500 Internal Server Error"),this.res.end(),r(f);return}o["Content-Encoding"]=d,c(v)})}compress(e,t,r){yt("compressing");let n=[],s=0;nS[t](this.httpCompression).on("error",r).on("data",function(o){n.push(o),s+=o.length}).on("end",function(){r(null,Buffer.concat(n,s))}).end(e)}doClose(e){yt("closing");let t,r=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(yt("transport writable - closing right away"),this.send([{type:"close"}]),r()):this.discarded?(yt("transport discarded - closing right away"),r()):(yt("transport not writable - buffering orderly close"),this.shouldClose=r,t=setTimeout(r,this.closeTimeout))}headers(e,t){t=t||{};let r=e.headers["user-agent"];return r&&(~r.indexOf(";MSIE")||~r.indexOf("Trident/"))&&(t["X-XSS-Protection"]="0"),t["cache-control"]="no-store",this.emit("headers",t,e),t}};vs.Polling=wc});var Jf=T(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.WebSocket=void 0;var sS=Ti(),oS=ie(),Yf=(0,oS.default)("engine:ws"),_c=class extends sS.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 r=e[t],n=t+1===e.length,s=o=>{let c=typeof o!="string",u=this.perMessageDeflate&&Buffer.byteLength(o)>this.perMessageDeflate.threshold;Yf('writing "%s"',o),this.socket.send(o,c,u),n&&(this.emit("drain"),this.writable=!0,this.emit("ready"))};r.options&&typeof r.options.wsPreEncoded=="string"?s(r.options.wsPreEncoded):this.parser.encodePacket(r,this.supportsBinary,s)}}doClose(e){Yf("closing"),e&&e(),this.socket.end()}};gs.WebSocket=_c});var Xf=T(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});var aS=Gf(),cS=Jf();Sc.default={polling:aS.Polling,websocket:cS.WebSocket}});var Zf=T(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.uServer=void 0;var lS=ie(),Pi=bc(),uS=Xf(),gi=(0,lS.default)("engine:uws"),Ec=class extends Pi.BaseServer{init(){}cleanup(){}prepare(e,t){e.method=e.getMethod().toUpperCase(),e.url=e.getUrl();let r=new URLSearchParams(e.getQuery());e._query=Object.fromEntries(r.entries()),e.headers={},e.forEach((n,s)=>{e.headers[n]=s}),e.connection={remoteAddress:Buffer.from(t.getRemoteAddressAsText()).toString()},t.onAborted(()=>{gi("response has been aborted")})}createTransport(e,t){return new uS.default[e](t)}attach(e,t={}){let r=this._computePath(t);e.any(r,this.handleRequest.bind(this)).ws(r,{compression:t.compression,idleTimeout:t.idleTimeout,maxBackpressure:t.maxBackpressure,maxPayloadLength:this.opts.maxHttpBufferSize,upgrade:this.handleUpgrade.bind(this),open:n=>{let s=n.getUserData().transport;s.socket=n,s.writable=!0,s.emit("ready")},message:(n,s,o)=>{n.getUserData().transport.onData(o?s:Buffer.from(s).toString())},close:(n,s,o)=>{n.getUserData().transport.onClose(s,o)}})}_applyMiddlewares(e,t,r){if(this.middlewares.length===0)return r();e.res=new Cc(t),super._applyMiddlewares(e,e.res,n=>{e.res.writeHead(),r(n)})}handleRequest(e,t){gi('handling "%s" http request "%s"',t.getMethod(),t.getUrl()),this.prepare(t,e),t.res=e;let r=(n,s)=>{if(n!==void 0){this.emit("connection_error",{req:t,code:n,message:Pi.Server.errorMessages[n],context:s}),this.abortRequest(t.res,n,s);return}if(t._query.sid)gi("setting new request for existing client"),this.clients[t._query.sid].transport.onRequest(t);else{let o=(c,u)=>this.abortRequest(e,c,u);this.handshake(t._query.transport,t,o)}};this._applyMiddlewares(t,e,n=>{n?r(Pi.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,r)})}handleUpgrade(e,t,r){gi("on upgrade"),this.prepare(t,e),t.res=e;let n=async(s,o)=>{if(s!==void 0){this.emit("connection_error",{req:t,code:s,message:Pi.Server.errorMessages[s],context:o}),this.abortRequest(e,s,o);return}let c=t._query.sid,u;if(c){let d=this.clients[c];if(d){if(d.upgrading)return gi("transport has already been trying to upgrade"),e.close();if(d.upgraded)return gi("transport had already been upgraded"),e.close();gi("upgrading existing transport"),u=this.createTransport(t._query.transport,t),d._maybeUpgrade(u)}else return gi("upgrade attempt for closed client"),e.close()}else if(u=await this.handshake(t._query.transport,t,(d,f)=>this.abortRequest(e,d,f)),!u)return;t.res.writeStatus("101 Switching Protocols"),e.upgrade({transport:u},t.getHeader("sec-websocket-key"),t.getHeader("sec-websocket-protocol"),t.getHeader("sec-websocket-extensions"),r)};this._applyMiddlewares(t,e,s=>{s?n(Pi.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,n)})}abortRequest(e,t,r){let n=t===Pi.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",s=r&&r.message?r.message:Pi.Server.errorMessages[t];e.writeStatus(n),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:s}))}};xs.uServer=Ec;var Cc=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(r=>{this.writeHeader(e,r)}):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 ih=T(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.protocol=We.Transport=We.Socket=We.uServer=We.parser=We.transports=We.Server=void 0;We.listen=vS;We.attach=th;var pS=require("http"),Qf=bc();Object.defineProperty(We,"Server",{enumerable:!0,get:function(){return Qf.Server}});var dS=Ia();We.transports=dS.default;var eh=Jr();We.parser=eh;var fS=Zf();Object.defineProperty(We,"uServer",{enumerable:!0,get:function(){return fS.uServer}});var hS=ja();Object.defineProperty(We,"Socket",{enumerable:!0,get:function(){return hS.Socket}});var mS=Ti();Object.defineProperty(We,"Transport",{enumerable:!0,get:function(){return mS.Transport}});We.protocol=eh.protocol;function vS(i,e,t){typeof e=="function"&&(t=e,e={});let r=(0,pS.createServer)(function(s,o){o.writeHead(501),o.end("Not Implemented")}),n=th(r,e);return n.httpServer=r,r.listen(i,t),n}function th(i,e){let t=new Qf.Server(e);return t.attach(i,e),t}});var nh=T(rh=>{rh.Emitter=Ze;function Ze(i){if(i)return gS(i)}function gS(i){for(var e in Ze.prototype)i[e]=Ze.prototype[e];return i}Ze.prototype.on=Ze.prototype.addEventListener=function(i,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(e),this};Ze.prototype.once=function(i,e){function t(){this.off(i,t),e.apply(this,arguments)}return t.fn=e,this.on(i,t),this};Ze.prototype.off=Ze.prototype.removeListener=Ze.prototype.removeAllListeners=Ze.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 r,n=0;n<t.length;n++)if(r=t[n],r===e||r.fn===e){t.splice(n,1);break}return t.length===0&&delete this._callbacks["$"+i],this};Ze.prototype.emit=function(i){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+i],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(t){t=t.slice(0);for(var r=0,n=t.length;r<n;++r)t[r].apply(this,e)}return this};Ze.prototype.emitReserved=Ze.prototype.emit;Ze.prototype.listeners=function(i){return this._callbacks=this._callbacks||{},this._callbacks["$"+i]||[]};Ze.prototype.hasListeners=function(i){return!!this.listeners(i).length}});var Tc=T(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.isBinary=oh;bs.hasBinary=ys;var xS=typeof ArrayBuffer=="function",yS=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i.buffer instanceof ArrayBuffer,sh=Object.prototype.toString,bS=typeof Blob=="function"||typeof Blob<"u"&&sh.call(Blob)==="[object BlobConstructor]",wS=typeof File=="function"||typeof File<"u"&&sh.call(File)==="[object FileConstructor]";function oh(i){return xS&&(i instanceof ArrayBuffer||yS(i))||bS&&i instanceof Blob||wS&&i instanceof File}function ys(i,e){if(!i||typeof i!="object")return!1;if(Array.isArray(i)){for(let t=0,r=i.length;t<r;t++)if(ys(i[t]))return!0;return!1}if(oh(i))return!0;if(i.toJSON&&typeof i.toJSON=="function"&&arguments.length===1)return ys(i.toJSON(),!0);for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)&&ys(i[t]))return!0;return!1}});var ah=T(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.deconstructPacket=SS;ws.reconstructPacket=ES;var _S=Tc();function SS(i){let e=[],t=i.data,r=i;return r.data=kc(t,e),r.attachments=e.length,{packet:r,buffers:e}}function kc(i,e){if(!i)return i;if((0,_S.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 r=0;r<i.length;r++)t[r]=kc(i[r],e);return t}else if(typeof i=="object"&&!(i instanceof Date)){let t={};for(let r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=kc(i[r],e));return t}return i}function ES(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 an=T(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.Decoder=Bt.Encoder=Bt.PacketType=Bt.protocol=void 0;Bt.isPacketValid=RS;var CS=nh(),ch=ah(),lh=Tc(),TS=ie(),Oc=(0,TS.default)("socket.io-parser"),uh=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];Bt.protocol=5;var z;(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"})(z||(Bt.PacketType=z={}));var Ac=class{constructor(e){this.replacer=e}encode(e){return Oc("encoding packet %j",e),(e.type===z.EVENT||e.type===z.ACK)&&(0,lh.hasBinary)(e)?this.encodeAsBinary({type:e.type===z.EVENT?z.BINARY_EVENT:z.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===z.BINARY_EVENT||e.type===z.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)),Oc("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,ch.deconstructPacket)(e),r=this.encodeAsString(t.packet),n=t.buffers;return n.unshift(r),n}};Bt.Encoder=Ac;var Rc=class i extends CS.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 r=t.type===z.BINARY_EVENT;r||t.type===z.BINARY_ACK?(t.type=r?z.EVENT:z.ACK,this.reconstructor=new Pc(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,lh.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,r={type:Number(e.charAt(0))};if(z[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===z.BINARY_EVENT||r.type===z.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");r.attachments=Number(o)}if(e.charAt(t+1)==="/"){let s=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););r.nsp=e.substring(s,t)}else r.nsp="/";let n=e.charAt(t+1);if(n!==""&&Number(n)==n){let s=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}r.id=Number(e.substring(s,t+1))}if(e.charAt(++t)){let s=this.tryParse(e.substr(t));if(i.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return Oc("decoded %s as %j",e,r),r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case z.CONNECT:return _s(t);case z.DISCONNECT:return t===void 0;case z.CONNECT_ERROR:return typeof t=="string"||_s(t);case z.EVENT:case z.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&uh.indexOf(t[0])===-1);case z.ACK:case z.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};Bt.Decoder=Rc;var Pc=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,ch.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function kS(i){return typeof i=="string"}var MS=Number.isInteger||function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i};function OS(i){return i===void 0||MS(i)}function _s(i){return Object.prototype.toString.call(i)==="[object Object]"}function AS(i,e){switch(i){case z.CONNECT:return e===void 0||_s(e);case z.DISCONNECT:return e===void 0;case z.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&uh.indexOf(e[0])===-1);case z.ACK:return Array.isArray(e);case z.CONNECT_ERROR:return typeof e=="string"||_s(e);default:return!1}}function RS(i){return kS(i.nsp)&&OS(i.id)&&AS(i.type,i.data)}});var ph=T(dr=>{"use strict";var PS=dr&&dr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(dr,"__esModule",{value:!0});dr.Client=void 0;var Ss=an(),BS=PS(ie()),Nt=(0,BS.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?(Nt("no namespace joined yet, close the client"),this.close()):Nt("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return Nt("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,r=>{r?this.doConnect(e,t):(Nt("creation of namespace %s was denied",e),this._packet({type:Ss.PacketType.CONNECT_ERROR,nsp:e,data:{message:"Invalid namespace"}}))})}doConnect(e,t){let r=this.server.of(e);r._add(this,t,n=>{this.sockets.set(n.id,n),this.nsps.set(r.name,n),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 Nt("ignoring remove for %s",e.id)}close(){this.conn.readyState==="open"&&(Nt("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if(this.conn.readyState!=="open"){Nt("ignoring packet write %j",e);return}let r=t.preEncoded?e:this.encoder.encode(e);this.writeToEngine(r,t)}writeToEngine(e,t){if(t.volatile&&!this.conn.transport.writable){Nt("volatile packet is discarded since the transport is not currently writable");return}let r=Array.isArray(e)?e:[e];for(let n of r)this.conn.write(n,t)}ondata(e){try{this.decoder.add(e)}catch(t){Nt("invalid packet format"),this.onerror(t)}}ondecoded(e){let{namespace:t,authPayload:r}=this._parseNamespace(e),n=this.nsps.get(t);!n&&e.type===Ss.PacketType.CONNECT?this.connect(t,r):n&&e.type!==Ss.PacketType.CONNECT&&e.type!==Ss.PacketType.CONNECT_ERROR?process.nextTick(function(){n._onpacket(e)}):(Nt("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){Nt("client close with reason %s",e),this.destroy();for(let r of this.sockets.values())r._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)}};dr.Client=Bc});var Cs=T(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.StrictEventEmitter=void 0;var NS=require("events"),Nc=class extends NS.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)}};Es.StrictEventEmitter=Nc});var Ic=T(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.RESERVED_EVENTS=void 0;Ts.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var Dc=T(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.RemoteSocket=fr.BroadcastOperator=void 0;var IS=Ic(),DS=an(),ks=class i{constructor(e,t=new Set,r=new Set,n={}){this.adapter=e,this.rooms=t,this.exceptRooms=r,this.flags=n}to(e){let t=new Set(this.rooms);return Array.isArray(e)?e.forEach(r=>t.add(r)):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(r=>t.add(r)):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(IS.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let r=[e,...t],n={type:DS.PacketType.EVENT,data:r};if(!(typeof r[r.length-1]=="function"))return this.adapter.broadcast(n,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let o=r.pop(),c=!1,u=[],d=setTimeout(()=>{c=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:u])},this.flags.timeout),f=-1,v=0,_=0,E=()=>{!c&&f===v&&u.length===_&&(clearTimeout(d),o.apply(this,[null,this.flags.expectSingleResponse?u[0]:u]))};return this.adapter.broadcastWithAck(n,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},C=>{_+=C,v++,E()},C=>{u.push(C),E()}),this.adapter.serverCount().then(C=>{f=C,E()}),!0}emitWithAck(e,...t){return new Promise((r,n)=>{t.push((s,o)=>s?(s.responses=o,n(s)):r(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 Ms(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)}};fr.BroadcastOperator=ks;var Ms=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 ks(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}};fr.RemoteSocket=Ms});var Lc=T(hr=>{"use strict";var hh=hr&&hr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(hr,"__esModule",{value:!0});hr.Socket=void 0;var bt=an(),jS=hh(ie()),LS=Cs(),dh=hh(ma()),qS=Dc(),FS=Ic(),Ke=(0,jS.default)("socket.io:socket"),US=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function fh(){}var jc=class extends LS.StrictEventEmitter{constructor(e,t,r,n){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,n?(this.id=n.sid,this.pid=n.pid,n.rooms.forEach(s=>this.join(s)),this.data=n.data,n.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=dh.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=dh.default.generateId())),this.handshake=this.buildHandshake(r),this.on("error",fh)}buildHandshake(e){var t,r,n,s;return{headers:((t=this.request)===null||t===void 0?void 0:t.headers)||{},time:new Date+"",address:this.conn.remoteAddress,xdomain:!!(!((r=this.request)===null||r===void 0)&&r.headers.origin),secure:!this.request||!!this.request.connection.encrypted,issued:+new Date,url:(n=this.request)===null||n===void 0?void 0:n.url,query:((s=this.request)===null||s===void 0?void 0:s._query)||{},auth:e}}emit(e,...t){if(FS.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let r=[e,...t],n={type:bt.PacketType.EVENT,data:r};if(typeof r[r.length-1]=="function"){let o=this.nsp._ids++;Ke("emitting packet with ack id %d",o),this.registerAckCallback(o,r.pop()),n.id=o}let s=Object.assign({},this.flags);return this.flags={},this.nsp.server.opts.connectionStateRecovery?this.adapter.broadcast(n,{rooms:new Set([this.id]),except:new Set,flags:s}):(this.notifyOutgoingListeners(n),this.packet(n,s)),!0}emitWithAck(e,...t){let r=this.flags.timeout!==void 0;return new Promise((n,s)=>{t.push((o,c)=>r?o?s(o):n(c):n(o)),this.emit(e,...t)})}registerAckCallback(e,t){let r=this.flags.timeout;if(r===void 0){this.acks.set(e,t);return}let n=setTimeout(()=>{Ke("event with ack id %d has timed out after %d ms",e,r),this.acks.delete(e),t.call(this,new Error("operation has timed out"))},r);this.acks.set(e,(...s)=>{clearTimeout(n),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 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:bt.PacketType.CONNECT}):this.packet({type:bt.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(Ke("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(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 r=this._anyListeners.slice();for(let n of r)n.apply(this,t)}this.dispatch(t)}ack(e){let t=this,r=!1;return function(){if(r)return;let n=Array.prototype.slice.call(arguments);Ke("sending ack %j",n),t.packet({id:e,type:bt.PacketType.ACK,data:n}),r=!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&&US.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=fh}_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){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 r=this.fns.slice(0);function n(s){r[s](e,o=>{if(o)return t(o);if(!r[s+1])return t();n(s+1)})}n(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 r=0;r<t.length;r++)if(e===t[r])return t.splice(r,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 r=0;r<t.length;r++)if(e===t[r])return t.splice(r,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 r of t)r.apply(this,e.data)}}newBroadcastOperator(){let e=Object.assign({},this.flags);return this.flags={},new qS.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}};hr.Socket=jc});var Fc=T(ri=>{"use strict";var HS=ri&&ri.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ri,"__esModule",{value:!0});ri.Namespace=ri.RESERVED_EVENTS=void 0;var mh=Lc(),zS=Cs(),WS=HS(ie()),dt=Dc(),mr=(0,WS.default)("socket.io:namespace");ri.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);var qc=class extends zS.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=>{mr("error while initializing adapter: %s",e)})}use(e){return this._fns.push(e),this}run(e,t){if(!this._fns.length)return t();let r=this._fns.slice(0);function n(s){r[s](e,o=>{if(o)return t(o);if(!r[s+1])return t();n(s+1)})}n(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,r){var n;mr("adding socket to nsp %s",this.name);let s=await this._createSocket(e,t);if(this._preConnectSockets.set(s.id,s),!((n=this.server.opts.connectionStateRecovery)===null||n===void 0)&&n.skipMiddlewares&&s.recovered&&e.conn.readyState==="open")return this._doConnect(s,r);this.run(s,o=>{process.nextTick(()=>{if(e.conn.readyState!=="open"){mr("next called after client was closed - ignoring socket"),s._cleanup();return}if(o)return mr("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,r)})})}async _createSocket(e,t){let r=t.pid,n=t.offset;if(this.server.opts.connectionStateRecovery&&typeof r=="string"&&typeof n=="string"){let s;try{s=await this.adapter.restoreSession(r,n)}catch(o){mr("error while restoring session: %s",o)}if(s)return mr("connection state recovered for sid %s",s.sid),new mh.Socket(this,e,t,s)}return new mh.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(ri.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((r,n)=>{t.push((s,o)=>s?(s.responses=o,n(s)):r(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)}};ri.Namespace=qc});var bh=T(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.encode=Uc;cn.decode=$S;cn.yeast=VS;var xh="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Os=64,yh={},vh=0,xi=0,gh;function Uc(i){let e="";do e=xh[i%Os]+e,i=Math.floor(i/Os);while(i>0);return e}function $S(i){let e=0;for(xi=0;xi<i.length;xi++)e=e*Os+yh[i.charAt(xi)];return e}function VS(){let i=Uc(+new Date);return i!==gh?(vh=0,gh=i):i+"."+Uc(vh++)}for(;xi<Os;xi++)yh[xh[xi]]=xi});var Wc=T(vr=>{"use strict";var Hc;Object.defineProperty(vr,"__esModule",{value:!0});vr.SessionAwareAdapter=vr.Adapter=void 0;var KS=require("events"),GS=bh(),As=vc(),YS=typeof((Hc=As?.Sender)===null||Hc===void 0?void 0:Hc.frame)=="function",Rs=class extends KS.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 r of t)this.sids.get(e).add(r),this.rooms.has(r)||(this.rooms.set(r,new Set),this.emit("create-room",r)),this.rooms.get(r).has(e)||(this.rooms.get(r).add(e),this.emit("join-room",r,e))}del(e,t){this.sids.has(e)&&this.sids.get(e).delete(t),this._del(t,e)}_del(e,t){let r=this.rooms.get(e);r!=null&&(r.delete(t)&&this.emit("leave-room",e,t),r.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 r=t.flags||{},n={preEncoded:!0,volatile:r.volatile,compress:r.compress};e.nsp=this.nsp.name;let s=this._encode(e,n);this.apply(t,o=>{typeof o.notifyOutgoingListeners=="function"&&o.notifyOutgoingListeners(e),o.client.writeToEngine(s,n)})}broadcastWithAck(e,t,r,n){let s=t.flags||{},o={preEncoded:!0,volatile:s.volatile,compress:s.compress};e.nsp=this.nsp.name,e.id=this.nsp._ids++;let c=this._encode(e,o),u=0;this.apply(t,d=>{u++,d.acks.set(e.id,n),typeof d.notifyOutgoingListeners=="function"&&d.notifyOutgoingListeners(e),d.client.writeToEngine(c,o)}),r(u)}_encode(e,t){let r=this.encoder.encode(e);if(YS&&r.length===1&&typeof r[0]=="string"){let n=Buffer.from("4"+r[0]);t.wsPreEncodedFrame=As.Sender.frame(n,{readOnly:!1,mask:!1,rsv1:!1,opcode:1,fin:!0})}return r}sockets(e){let t=new Set;return this.apply({rooms:e},r=>{t.add(r.id)}),Promise.resolve(t)}socketRooms(e){return this.sids.get(e)}fetchSockets(e){let t=[];return this.apply(e,r=>{t.push(r)}),Promise.resolve(t)}addSockets(e,t){this.apply(e,r=>{r.join(t)})}delSockets(e,t){this.apply(e,r=>{t.forEach(n=>r.leave(n))})}disconnectSockets(e,t){this.apply(e,r=>{r.disconnect(t)})}apply(e,t){let r=e.rooms,n=this.computeExceptSids(e.except);if(r.size){let s=new Set;for(let o of r)if(this.rooms.has(o))for(let c of this.rooms.get(o)){if(s.has(c)||n.has(c))continue;let u=this.nsp.sockets.get(c);u&&(t(u),s.add(c))}}else for(let[s]of this.sids){if(n.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 r of e)this.rooms.has(r)&&this.rooms.get(r).forEach(n=>t.add(n));return t}serverSideEmit(e){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(e){}restoreSession(e,t){return null}};vr.Adapter=Rs;var zc=class extends Rs{constructor(e){super(e),this.nsp=e,this.sessions=new Map,this.packets=[],this.maxDisconnectionDuration=e.server.opts.connectionStateRecovery.maxDisconnectionDuration,setInterval(()=>{let r=Date.now()-this.maxDisconnectionDuration;this.sessions.forEach((n,s)=>{n.disconnectedAt<r&&this.sessions.delete(s)});for(let n=this.packets.length-1;n>=0;n--)if(this.packets[n].emittedAt<r){this.packets.splice(0,n+1);break}},60*1e3).unref()}persistSession(e){e.disconnectedAt=Date.now(),this.sessions.set(e.pid,e)}restoreSession(e,t){let r=this.sessions.get(e);if(!r)return null;if(r.disconnectedAt+this.maxDisconnectionDuration<Date.now())return this.sessions.delete(e),null;let s=this.packets.findIndex(c=>c.id===t);if(s===-1)return null;let o=[];for(let c=s+1;c<this.packets.length;c++){let u=this.packets[c];JS(r.rooms,u.opts)&&o.push(u.data)}return Promise.resolve(Object.assign(Object.assign({},r),{missedPackets:o}))}broadcast(e,t){var r;let n=e.type===2,s=e.id===void 0,o=((r=t.flags)===null||r===void 0?void 0:r.volatile)===void 0;if(n&&s&&o){let c=(0,GS.yeast)();e.data.push(c),this.packets.push({id:c,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};vr.SessionAwareAdapter=zc;function JS(i,e){let t=e.rooms.size===0||i.some(n=>e.rooms.has(n)),r=i.every(n=>!e.except.has(n));return t&&r}});var wh=T(Wt=>{"use strict";var XS=Wt&&Wt.__rest||function(i,e){var t={};for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&e.indexOf(r)<0&&(t[r]=i[r]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(i);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(i,r[n])&&(t[r[n]]=i[r[n]]);return t};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.ClusterAdapterWithHeartbeat=Wt.ClusterAdapter=Wt.MessageType=void 0;var ZS=Wc(),QS=ie(),e1=require("crypto"),Q=(0,QS.debug)("socket.io-adapter"),t1="emitter",Ps=5e3;function xr(){return(0,e1.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||(Wt.MessageType=N={}));function Bi(i){return{rooms:[...i.rooms],except:[...i.except],flags:i.flags}}function gr(i){return{rooms:new Set(i.rooms),except:new Set(i.except),flags:i.flags}}var Bs=class extends ZS.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=xr()}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 N.BROADCAST:{if(e.data.requestId!==void 0)super.broadcastWithAck(e.data.packet,gr(e.data.opts),n=>{Q("[%s] waiting for %d client acknowledgements",this.uid,n),this.publishResponse(e.uid,{type:N.BROADCAST_CLIENT_COUNT,data:{requestId:e.data.requestId,clientCount:n}})},n=>{Q("[%s] received acknowledgement with value %j",this.uid,n),this.publishResponse(e.uid,{type:N.BROADCAST_ACK,data:{requestId:e.data.requestId,packet:n}})});else{let n=e.data.packet,s=gr(e.data.opts);this.addOffsetIfNecessary(n,s,t),super.broadcast(n,s)}break}case N.SOCKETS_JOIN:super.addSockets(gr(e.data.opts),e.data.rooms);break;case N.SOCKETS_LEAVE:super.delSockets(gr(e.data.opts),e.data.rooms);break;case N.DISCONNECT_SOCKETS:super.disconnectSockets(gr(e.data.opts),e.data.close);break;case N.FETCH_SOCKETS:{Q("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(gr(e.data.opts)).then(r=>{this.publishResponse(e.uid,{type:N.FETCH_SOCKETS_RESPONSE,data:{requestId:e.data.requestId,sockets:r.map(n=>{let s=n.handshake,{sessionStore:o}=s,c=XS(s,["sessionStore"]);return{id:n.id,handshake:c,rooms:[...n.rooms],data:n.data}})}})});break}case N.SERVER_SIDE_EMIT:{let r=e.data.packet;if(!(e.data.requestId!==void 0)){this.nsp._onServerSideEmit(r);return}let s=!1,o=c=>{s||(s=!0,Q("[%s] calling acknowledgement with %j",this.uid,c),this.publishResponse(e.uid,{type:N.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:e.data.requestId,packet:c}}))};this.nsp._onServerSideEmit([...r,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:Q("[%s] unknown message type: %s",this.uid,e.type)}}onResponse(e){var t,r;let n=e.data.requestId;switch(Q("[%s] received response %s to request %s",this.uid,e.type,n),e.type){case N.BROADCAST_CLIENT_COUNT:{(t=this.ackRequests.get(n))===null||t===void 0||t.clientCountCallback(e.data.clientCount);break}case N.BROADCAST_ACK:{(r=this.ackRequests.get(n))===null||r===void 0||r.ack(e.data.packet);break}case N.FETCH_SOCKETS_RESPONSE:{let s=this.requests.get(n);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(n));break}case N.SERVER_SIDE_EMIT_RESPONSE:{let s=this.requests.get(n);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(n));break}default:Q("[%s] unknown response type: %s",this.uid,e.type)}}async broadcast(e,t){var r;if(!((r=t.flags)===null||r===void 0?void 0:r.local))try{let s=await this.publishAndReturnOffset({type:N.BROADCAST,data:{packet:e,opts:Bi(t)}});this.addOffsetIfNecessary(e,t,s)}catch(s){return Q("[%s] error while broadcasting message: %s",this.uid,s.message)}super.broadcast(e,t)}addOffsetIfNecessary(e,t,r){var n;if(!this.nsp.server.opts.connectionStateRecovery)return;let s=e.type===2,o=e.id===void 0,c=((n=t.flags)===null||n===void 0?void 0:n.volatile)===void 0;s&&o&&c&&e.data.push(r)}broadcastWithAck(e,t,r,n){var s;if(!((s=t?.flags)===null||s===void 0?void 0:s.local)){let c=xr();this.ackRequests.set(c,{clientCountCallback:r,ack:n}),this.publish({type:N.BROADCAST,data:{packet:e,requestId:c,opts:Bi(t)}}),setTimeout(()=>{this.ackRequests.delete(c)},t.flags.timeout)}super.broadcastWithAck(e,t,r,n)}async addSockets(e,t){var r;if(!((r=e.flags)===null||r===void 0?void 0:r.local))try{await this.publishAndReturnOffset({type:N.SOCKETS_JOIN,data:{opts:Bi(e),rooms:t}})}catch(s){Q("[%s] error while publishing message: %s",this.uid,s.message)}super.addSockets(e,t)}async delSockets(e,t){var r;if(!((r=e.flags)===null||r===void 0?void 0:r.local))try{await this.publishAndReturnOffset({type:N.SOCKETS_LEAVE,data:{opts:Bi(e),rooms:t}})}catch(s){Q("[%s] error while publishing message: %s",this.uid,s.message)}super.delSockets(e,t)}async disconnectSockets(e,t){var r;if(!((r=e.flags)===null||r===void 0?void 0:r.local))try{await this.publishAndReturnOffset({type:N.DISCONNECT_SOCKETS,data:{opts:Bi(e),close:t}})}catch(s){Q("[%s] error while publishing message: %s",this.uid,s.message)}super.disconnectSockets(e,t)}async fetchSockets(e){var t;let[r,n]=await Promise.all([super.fetchSockets(e),this.serverCount()]),s=n-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return r;let o=xr();return new Promise((c,u)=>{let d=setTimeout(()=>{let v=this.requests.get(o);v&&(u(new Error(`timeout reached: only ${v.current} responses received out of ${v.expected}`)),this.requests.delete(o))},e.flags.timeout||Ps),f={type:N.FETCH_SOCKETS,resolve:c,timeout:d,current:0,expected:s,responses:r};this.requests.set(o,f),this.publish({type:N.FETCH_SOCKETS,data:{opts:Bi(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 r=e.pop(),n=await this.serverCount()-1;if(Q('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,n),n<=0)return r(null,[]);let s=xr(),o=setTimeout(()=>{let u=this.requests.get(s);u&&(r(new Error(`timeout reached: only ${u.current} responses received out of ${u.expected}`),u.responses),this.requests.delete(s))},Ps),c={type:N.SERVER_SIDE_EMIT,resolve:r,timeout:o,current:0,expected:n,responses:[]};this.requests.set(s,c),this.publish({type:N.SERVER_SIDE_EMIT,data:{requestId:s,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(r=>{Q("[%s] error while publishing response: %s",this.uid,r)})}};Wt.ClusterAdapter=Bs;var $c=class extends Bs{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 r=Date.now();this.nodesMap.forEach((n,s)=>{r-n>this._opts.heartbeatTimeout&&(Q("[%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 Q("[%s] ignore message from self",this.uid);switch(e.uid&&e.uid!==t1&&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 r=e.pop(),n=this.nodesMap.size;if(Q('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,n),n<=0)return r(null,[]);let s=xr(),o=setTimeout(()=>{let u=this.customRequests.get(s);u&&(r(new Error(`timeout reached: missing ${u.missingUids.size} responses`),u.responses),this.customRequests.delete(s))},Ps),c={type:N.SERVER_SIDE_EMIT,resolve:r,timeout:o,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(s,c),this.publish({type:N.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}async fetchSockets(e){var t;let[r,n]=await Promise.all([super.fetchSockets({rooms:e.rooms,except:e.except,flags:{local:!0}}),this.serverCount()]),s=n-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return r;let o=xr();return new Promise((c,u)=>{let d=setTimeout(()=>{let v=this.customRequests.get(o);v&&(u(new Error(`timeout reached: missing ${v.missingUids.size} responses`)),this.customRequests.delete(o))},e.flags.timeout||Ps),f={type:N.FETCH_SOCKETS,resolve:c,timeout:d,missingUids:new Set([...this.nodesMap.keys()]),responses:r};this.customRequests.set(o,f),this.publish({type:N.FETCH_SOCKETS,data:{opts:Bi(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 N.FETCH_SOCKETS_RESPONSE:{let r=this.customRequests.get(t);if(!r)return;e.data.sockets.forEach(n=>r.responses.push(n)),r.missingUids.delete(e.uid),r.missingUids.size===0&&(clearTimeout(r.timeout),r.resolve(r.responses),this.customRequests.delete(t));break}case N.SERVER_SIDE_EMIT_RESPONSE:{let r=this.customRequests.get(t);if(!r)return;r.responses.push(e.data.packet),r.missingUids.delete(e.uid),r.missingUids.size===0&&(clearTimeout(r.timeout),r.resolve(null,r.responses),this.customRequests.delete(t));break}default:super.onResponse(e)}}removeNode(e){this.customRequests.forEach((t,r)=>{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(r))}),this.nodesMap.delete(e)}};Wt.ClusterAdapterWithHeartbeat=$c});var Ns=T(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.MessageType=wt.ClusterAdapterWithHeartbeat=wt.ClusterAdapter=wt.SessionAwareAdapter=wt.Adapter=void 0;var _h=Wc();Object.defineProperty(wt,"Adapter",{enumerable:!0,get:function(){return _h.Adapter}});Object.defineProperty(wt,"SessionAwareAdapter",{enumerable:!0,get:function(){return _h.SessionAwareAdapter}});var Vc=wh();Object.defineProperty(wt,"ClusterAdapter",{enumerable:!0,get:function(){return Vc.ClusterAdapter}});Object.defineProperty(wt,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return Vc.ClusterAdapterWithHeartbeat}});Object.defineProperty(wt,"MessageType",{enumerable:!0,get:function(){return Vc.MessageType}})});var Ch=T(yr=>{"use strict";var i1=yr&&yr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(yr,"__esModule",{value:!0});yr.ParentNamespace=void 0;var Sh=Fc(),r1=Ns(),n1=i1(ie()),Eh=(0,n1.default)("socket.io:parent-namespace"),Is=class i extends Sh.Namespace{constructor(e){super(e,"/_"+i.count++),this.children=new Set}_initAdapter(){this.adapter=new Kc(this)}emit(e,...t){return this.children.forEach(r=>{r.emit(e,...t)}),!0}createChild(e){Eh("creating child namespace %s",e);let t=new Sh.Namespace(this.server,e);if(this._fns.forEach(r=>t.use(r)),this.listeners("connect").forEach(r=>t.on("connect",r)),this.listeners("connection").forEach(r=>t.on("connection",r)),this.children.add(t),this.server._opts.cleanupEmptyChildNamespaces){let r=t._remove;t._remove=n=>{r.call(t,n),t.sockets.size===0&&(Eh("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")}};yr.ParentNamespace=Is;Is.count=0;var Kc=class extends r1.Adapter{broadcast(e,t){this.nsp.children.forEach(r=>{r.adapter.broadcast(e,t)})}}});var Rh=T(Ii=>{"use strict";var s1=Ii&&Ii.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.patchAdapter=a1;Ii.restoreAdapter=c1;Ii.serveFile=u1;var Ni=Ns(),Th=require("fs"),o1=s1(ie()),Ds=(0,o1.default)("socket.io:adapter-uws"),Gc="",{addAll:Mh,del:Oh,broadcast:Ah}=Ni.Adapter.prototype;function a1(i){Ni.Adapter.prototype.addAll=function(e,t){let r=!this.sids.has(e);Mh.call(this,e,t);let n=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(n){if(n.conn.transport.name==="websocket"){kh(this.nsp.name,n,r,t);return}r&&n.conn.on("upgrade",()=>{let s=this.sids.get(e);s&&kh(this.nsp.name,n,r,s)})}},Ni.Adapter.prototype.del=function(e,t){Oh.call(this,e,t);let r=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(r&&r.conn.transport.name==="websocket"){let n=r.conn.id,s=r.conn.transport.socket,o=`${this.nsp.name}${Gc}${t}`;Ds("unsubscribe connection %s from topic %s",n,o),s.unsubscribe(o)}},Ni.Adapter.prototype.broadcast=function(e,t){if(!(t.rooms.size<=1&&t.except.size===0)){Ah.call(this,e,t);return}let n=t.flags||{},s={preEncoded:!0,volatile:n.volatile,compress:n.compress};e.nsp=this.nsp.name;let o=this.encoder.encode(e),c=t.rooms.size===0?this.nsp.name:`${this.nsp.name}${Gc}${t.rooms.keys().next().value}`;Ds("fast publish to %s",c),o.forEach(u=>{let d=typeof u!="string";i.publish(c,d?u:"4"+u,d)}),this.apply(t,u=>{u.conn.transport.name!=="websocket"&&u.client.writeToEngine(o,s)})}}function kh(i,e,t,r){let n=e.conn.id,s=e.conn.transport.socket;t&&(Ds("subscribe connection %s to topic %s",n,i),s.subscribe(i)),r.forEach(o=>{let c=`${i}${Gc}${o}`;Ds("subscribe connection %s to topic %s",n,c),s.subscribe(c)})}function c1(){Ni.Adapter.prototype.addAll=Mh,Ni.Adapter.prototype.del=Oh,Ni.Adapter.prototype.broadcast=Ah}var l1=i=>{let{buffer:e,byteOffset:t,byteLength:r}=i;return e.slice(t,t+r)};function u1(i,e){let{size:t}=(0,Th.statSync)(e),r=(0,Th.createReadStream)(e),n=()=>!r.destroyed&&r.destroy(),s=c=>{throw n(),c},o=c=>{let u=l1(c);i.cork(()=>{let d=i.getWriteOffset(),[f,v]=i.tryEnd(u,t);!v&&!f&&(r.pause(),i.onWritable(_=>{let[E,C]=i.tryEnd(u.slice(_-d),t);return!C&&E&&r.resume(),E}))})};i.onAborted(n),r.on("data",o).on("error",s).on("end",n)}});var Ph=T((iO,p1)=>{p1.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 Fh=T((Ge,ln)=>{"use strict";var d1=Ge&&Ge.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),f1=Ge&&Ge.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),h1=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)&&d1(e,i,t);return f1(e,i),e},Xc=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 m1=Xc(require("http")),v1=require("fs"),Yc=require("zlib"),g1=jn(),js=require("stream"),Bh=require("path"),Nh=ih(),x1=ph(),Ih=require("events"),Zc=Fc();Object.defineProperty(Ge,"Namespace",{enumerable:!0,get:function(){return Zc.Namespace}});var y1=Ch(),Dh=Ns(),b1=h1(an()),w1=Xc(ie()),qh=Lc();Object.defineProperty(Ge,"Socket",{enumerable:!0,get:function(){return qh.Socket}});var _1=Cs(),Jc=Rh(),S1=Xc(xc()),Qe=(0,w1.default)("socket.io:server"),jh=Ph().version,Lh=/\.map/,br=class i extends _1.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||b1,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||Dh.SessionAwareAdapter)):this.adapter(t.adapter||Dh.Adapter),t.cleanupEmptyChildNamespaces=!!t.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),(e||typeof e=="number")&&this.attach(e),this.opts.cors&&(this._corsMiddleware=(0,S1.default)(this.opts.cors))}get _opts(){return this.opts}serveClient(e){return arguments.length?(this._serveClient=e,this):this._serveClient}_checkNamespace(e,t,r){if(this.parentNsps.size===0)return r(!1);let n=this.parentNsps.keys(),s=()=>{let o=n.next();if(o.done)return r(!1);o.value(e,t,(c,u)=>{if(c||!u)return s();if(this._nsps.has(e))return Qe("dynamic namespace %s already exists",e),r(this._nsps.get(e));let d=this.parentNsps.get(o.value).createChild(e);Qe("dynamic namespace %s was created",e),r(d)})};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 r="You are trying to attach socket.io to an express request handler function. Please pass a http.Server instance.";throw new Error(r)}if(Number(e)==e&&(e=Number(e)),typeof e=="number"){Qe("creating http server and binding to %d",e);let r=e;e=m1.default.createServer((n,s)=>{s.writeHead(404),s.end()}),e.listen(r)}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,Qe("creating uWebSockets.js-based engine with opts %j",t);let r=new Nh.uServer(t);r.attach(e,t),this.bind(r),this._serveClient&&e.get(`${this._path}/*`,(n,s)=>{if(!this.clientPathRegex.test(s.getUrl())){s.setYield(!0);return}let o=s.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),c=Lh.test(o),u=c?"map":"source",d='"'+jh+'"',f="W/"+d,v=s.getHeader("if-none-match");if(v&&(d===v||f===v)){Qe("serve client %s 304",u),n.writeStatus("304 Not Modified"),n.end();return}Qe("serve client %s",u),n.writeHeader("cache-control","public, max-age=0"),n.writeHeader("content-type","application/"+(c?"json":"javascript")+"; charset=utf-8"),n.writeHeader("etag",d);let _=Bh.join(__dirname,"../client-dist/",o);(0,Jc.serveFile)(n,_)}),(0,Jc.patchAdapter)(e)}initEngine(e,t){Qe("creating engine.io instance with opts %j",t),this.eio=(0,Nh.attach)(e,t),this._serveClient&&this.attachServe(e),this.httpServer=e,this.bind(this.eio)}attachServe(e){Qe("attaching client serving req handler");let t=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("request",(r,n)=>{if(this.clientPathRegex.test(r.url))this._corsMiddleware?this._corsMiddleware(r,n,()=>{this.serve(r,n)}):this.serve(r,n);else for(let s=0;s<t.length;s++)t[s].call(e,r,n)})}serve(e,t){let r=e.url.replace(this._path,"").replace(/\?.*$/,""),n=Lh.test(r),s=n?"map":"source",o='"'+jh+'"',c="W/"+o,u=e.headers["if-none-match"];if(u&&(o===u||c===u)){Qe("serve client %s 304",s),t.writeHead(304),t.end();return}Qe("serve client %s",s),t.setHeader("Cache-Control","public, max-age=0"),t.setHeader("Content-Type","application/"+(n?"json":"javascript")+"; charset=utf-8"),t.setHeader("ETag",o),i.sendFile(r,e,t)}static sendFile(e,t,r){let n=(0,v1.createReadStream)(Bh.join(__dirname,"../client-dist/",e)),s=g1(t).encodings(["br","gzip","deflate"]),o=c=>{c&&r.end()};switch(s){case"br":r.writeHead(200,{"content-encoding":"br"}),(0,js.pipeline)(n,(0,Yc.createBrotliCompress)(),r,o);break;case"gzip":r.writeHead(200,{"content-encoding":"gzip"}),(0,js.pipeline)(n,(0,Yc.createGzip)(),r,o);break;case"deflate":r.writeHead(200,{"content-encoding":"deflate"}),(0,js.pipeline)(n,(0,Yc.createDeflate)(),r,o);break;default:r.writeHead(200),(0,js.pipeline)(n,r,o)}}bind(e){return this.engine=e,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(e){Qe("incoming connection with id %s",e.id);let t=new x1.Client(this,e);return e.protocol===3&&t.connect("/"),this}of(e,t){if(typeof e=="function"||e instanceof RegExp){let n=new y1.ParentNamespace(this);return Qe("initializing parent namespace %s",n.name),typeof e=="function"?this.parentNsps.set(e,n):(this.parentNsps.set((s,o,c)=>c(null,e.test(s)),n),this.parentNamespacesFromRegExp.set(e,n)),t&&n.on("connect",t),n}String(e)[0]!=="/"&&(e="/"+e);let r=this._nsps.get(e);if(!r){for(let[n,s]of this.parentNamespacesFromRegExp)if(n.test(e))return Qe("attaching namespace %s to parent namespace %s",e,n),s.createChild(e);Qe("initializing namespace %s",e),r=new Zc.Namespace(this,e),this._nsps.set(e,r),e!=="/"&&this.sockets.emitReserved("new_namespace",r)}return t&&r.on("connect",t),r}async close(e){if(await Promise.allSettled([...this._nsps.values()].map(async t=>{t.sockets.forEach(r=>{r._onclose("server shutting down")}),await t.adapter.close()})),this.engine.close(),(0,Jc.restoreAdapter)(),this.httpServer)return new Promise(t=>{this.httpServer.close(r=>{e&&e(r),r&&Qe("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=br;var E1=Object.keys(Ih.EventEmitter.prototype).filter(function(i){return typeof Ih.EventEmitter.prototype[i]=="function"});E1.forEach(function(i){br.prototype[i]=function(){return this.sockets[i].apply(this.sockets,arguments)}});ln.exports=(i,e)=>new br(i,e);ln.exports.Server=br;ln.exports.Namespace=Zc.Namespace;ln.exports.Socket=qh.Socket});var $e,kr=Si(()=>{$e={webrtc:{enableWebRTC:!0,enableTurn:!1,turnApiUrl:"https://9remote.cc/api/webrtc/turn-credentials",turnRefreshInterval:828e5,dcMaxMessageSize:65536,dcBufferThreshold:65536,dcChunkSize:8,dcMaxTilesPerFrame:32,dcReliable:!0,dcOrdered:!1,answerTimeout:1e4},robotSettings:{mouseDelay:2,keyboardDelay:2},throttling:{mouseThrottle:8,keyThrottle:25,typeTextThrottle:100,maxTextLength:1e3},resourceManagement:{inactiveTimeout:12e4,memoryCheckInterval:6e4,memoryWarningThreshold:1e3,maxTimersPerClient:100,maxChunkTimersPerClient:50},streaming:{activeInterval:60,idleInterval:400,idleThreshold:3,actionCaptureDelay:50,chunkSize:32,chunkDelay:5}}});var vm={};Ei(vm,{TileManager:()=>cl});var Gs,Mr,Js,Ys,mm,K1,G1,cl,gm=Si(()=>{Gs=L(require("sharp"),1),Mr=L(require("fs"),1),Js=L(require("path"),1),Ys=require("child_process"),mm=require("url"),K1=(0,mm.fileURLToPath)(__importMetaUrl),G1=Js.default.dirname(K1),cl=class{constructor(e){this.robot=e,this.tileSize=128,this.lastTileChecksums=new Map,this.screenWidth=0,this.screenHeight=0,this.tilesPerRow=0,this.tilesPerColumn=0,this.totalTiles=0,this.frameCount=0,this.tempDir=Js.default.join(G1,"../../temp"),this.changeThreshold=1,this.scaledWidth=0,this.scaledHeight=0,this.isProcessing=!1,this.sharedScreenCache=null,this.lastCaptureTime=0,this.CACHE_TTL=100,this.dpiScale=1,this.captureWidth=0,this.captureHeight=0,this.scaleFactor=1,this.compressionQuality=50,Mr.default.existsSync(this.tempDir)||Mr.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 r=100;if(this.totalTiles>r){let n=Math.ceil(Math.sqrt(this.scaledWidth*this.scaledHeight/r));this.tileSize=Math.max(n,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 Init] Logical: ${e}x${t} | DPI Scale: ${this.dpiScale}x | Capture: ${this.captureWidth}x${this.captureHeight} | Scaled: ${this.scaledWidth}x${this.scaledHeight} | Tiles: ${this.totalTiles}`)}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(){if(process.platform==="darwin"){let e=this.robot.screen.capture(0,0,this.screenWidth,this.screenHeight),r=e.byteWidth/e.bytesPerPixel/this.screenWidth;r>=1.9&&r<=2.1?this.dpiScale=2:this.dpiScale=1}else process.platform==="win32"?this.dpiScale=this._detectDpiScaleWin32():this.dpiScale=1;this.captureWidth=Math.floor(this.screenWidth*this.dpiScale),this.captureHeight=Math.floor(this.screenHeight*this.dpiScale)}_detectDpiScaleWin32(){console.log(`\u{1F50D} [DPI Detection] screenWidth from robot: ${this.screenWidth}x${this.screenHeight}`);try{let e=(0,Ys.execSync)(`powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "try{Get-ItemPropertyValue 'HKCU:\\Control Panel\\Desktop\\WindowMetrics' -Name AppliedDPI}catch{0}"`,{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(console.log(`\u{1F50D} [DPI Detection] Strategy 1 (Registry AppliedDPI): ${t} DPI`),t>=96){let r=t/96;return console.log(`\u2705 [DPI Detection] Using registry scale: ${r}x (${t}/96)`),r}}catch(e){console.log("\u274C [DPI Detection] Strategy 1 failed:",e.message)}try{let e=(0,Ys.execSync)('powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "(Get-WmiObject -Class Win32_VideoController | Select-Object -First 1).CurrentHorizontalResolution"',{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(console.log(`\u{1F50D} [DPI Detection] Strategy 2 (WMI): physical width = ${t}px`),t>0&&t>this.screenWidth){let r=t/this.screenWidth;return console.log(`\u2705 [DPI Detection] Using WMI scale: ${r}x (${t}/${this.screenWidth})`),r}}catch(e){console.log("\u274C [DPI Detection] Strategy 2 failed:",e.message)}try{let e=(0,Ys.execSync)(`powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "Add-Type -TypeDefinition 'using System;using System.Runtime.InteropServices;public class Disp{[DllImport(\\"user32\\")]public static extern bool EnumDisplaySettings(string d,int m,ref DEVMODE dm);[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Ansi)]public struct DEVMODE{[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)]public string dmDeviceName;public short dmSpecVersion,dmDriverVersion,dmSize,dmDriverExtra;public int dmFields;public int dmPositionX,dmPositionY,dmDisplayOrientation,dmDisplayFixedOutput;public short dmColor,dmDuplex,dmYResolution,dmTTOption,dmCollate;[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)]public string dmFormName;public short dmLogPixels;public int dmBitsPerPel,dmPelsWidth,dmPelsHeight,dmDisplayFlags,dmDisplayFrequency;}}'; $dm=New-Object Disp+DEVMODE; $dm.dmSize=[System.Runtime.InteropServices.Marshal]::SizeOf($dm); [Disp]::EnumDisplaySettings($null,-1,[ref]$dm) | Out-Null; Write-Output $dm.dmPelsWidth"`,{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(console.log(`\u{1F50D} [DPI Detection] Strategy 3 (EnumDisplaySettings): physical width = ${t}px`),t>0&&t>this.screenWidth){let r=t/this.screenWidth;return console.log(`\u2705 [DPI Detection] Using EnumDisplaySettings scale: ${r}x (${t}/${this.screenWidth})`),r}}catch(e){console.log("\u274C [DPI Detection] Strategy 3 failed:",e.message)}return console.log("\u26A0\uFE0F [DPI Detection] All strategies failed, fallback to 1x"),1}async captureFullScreen(){let e=this.robot.screen.capture(0,0,this.captureWidth,this.captureHeight),t=e.byteWidth/e.bytesPerPixel,r=e.height,n=Buffer.from(e.image),s=new Uint32Array(n.buffer,n.byteOffset,n.length>>2);for(let d=0;d<s.length;d++){let f=s[d];s[d]=f&4278255360|(f&16711680)>>16|(f&255)<<16}let o=n,c=t,u=r;if(this.dpiScale>1||this.scaleFactor<1){let d=Math.floor(this.screenWidth*this.scaleFactor),f=Math.floor(this.screenHeight*this.scaleFactor);o=await(0,Gs.default)(n,{raw:{width:t,height:r,channels:e.bytesPerPixel}}).resize(d,f,{kernel:Gs.default.kernel.lanczos3,fit:"fill",fastShrinkOnLoad:!1}).raw().toBuffer(),c=d,u=f}return{buffer:o,width:c,height:u,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=[],r=[],n=new Map;this.frameCount++;for(let c=0;c<this.totalTiles;c++){let u=this.calculateTileChecksumDirect(e,c);n.set(c,u)}let s=Array.from(n.values());if(this.lastTileChecksums.size===0){let c=[];for(let d=0;d<this.totalTiles;d++)this.lastTileChecksums.set(d,n.get(d)),c.push(this.processTileAsync(e,d));let u=await Promise.all(c);return t.push(...u),{tiles:t,currentHashes:s}}for(let c=0;c<this.totalTiles;c++){let u=n.get(c),d=this.lastTileChecksums.get(c);u!==d&&(r.push(c),this.lastTileChecksums.set(c,u))}if(r.length/this.totalTiles>this.changeThreshold){let c=[];for(let d=0;d<this.totalTiles;d++)c.push(this.processTileAsync(e,d));let u=await Promise.all(c);t.push(...u.map(d=>({...d,fullRefresh:!0})))}else if(r.length>0){let c=r.map(d=>this.processTileAsync(e,d)),u=await Promise.all(c);t.push(...u)}return{tiles:t,currentHashes:s}}finally{this.isProcessing=!1}}async processTileAsync(e,t,r=null){let n=r||this.extractTile(e,t),s=await this.compressTileImage(n.buffer,n.width,n.height),{row:o,col:c}=this.getTilePosition(t);return{type:"tile-update",tileIndex:t,x:c*this.tileSize,y:o*this.tileSize,width:n.width,height:n.height,imageBuffer:s,timestamp:Date.now(),frameCount:this.frameCount}}calculateTileChecksumDirect(e,t){let{row:r,col:n}=this.getTilePosition(t),s=n*this.tileSize,o=r*this.tileSize,c=Math.min(s+this.tileSize,e.width),u=Math.min(o+this.tileSize,e.height),d=c-s,f=u-o,v=e.channels,_=e.width*v,E=0,C=16;for(let k=0;k<f;k+=4){let M=(o+k)*_+s*v;for(let O=0;O<d;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:r,col:n}=this.getTilePosition(t),s=n*this.tileSize,o=r*this.tileSize,c=Math.min(s+this.tileSize,e.width),u=Math.min(o+this.tileSize,e.height),d=c-s,f=u-o,v=e.channels,_=d*v,E=Buffer.alloc(d*f*v);for(let C=0;C<f;C++){let k=((o+C)*e.width+s)*v,M=C*_;e.buffer.copy(E,M,k,k+_)}return{buffer:E,width:d,height:f,channels:v,tileIndex:t,x:s,y:o}}async compressTileImage(e,t,r){return(0,Gs.default)(e,{raw:{width:t,height:r,channels:4}}).jpeg({quality:this.compressionQuality}).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(),r=[],n=[];this.frameCount++;let s=new Map;for(let c=0;c<this.totalTiles;c++){let u=this.calculateTileChecksumDirect(t,c);s.set(c,u),this.lastTileChecksums.set(c,u)}if(!e||e.length===0){let c=[];for(let d=0;d<this.totalTiles;d++)c.push(this.processTileAsync(t,d));let u=await Promise.all(c);return r.push(...u),{tiles:r,currentHashes:Array.from(s.values())}}for(let c=0;c<this.totalTiles;c++)e[c]!==s.get(c)&&n.push(c);if(n.length/this.totalTiles>this.changeThreshold){let c=[];for(let d=0;d<this.totalTiles;d++)c.push(this.processTileAsync(t,d));let u=await Promise.all(c);r.push(...u.map(d=>({...d,fullRefresh:!0})))}else if(n.length>0){let c=n.map(d=>this.processTileAsync(t,d)),u=await Promise.all(c);r.push(...u)}return{tiles:r,currentHashes:Array.from(s.values()),changedIndices:n}}finally{this.isProcessing=!1}}clearMemory(){this.sharedScreenCache=null,this.lastCaptureTime=0,this.lastTileChecksums.clear()}reset(){this.lastTileChecksums.clear(),this.frameCount=0}cleanup(){try{Mr.default.existsSync(this.tempDir)&&Mr.default.readdirSync(this.tempDir).forEach(t=>Mr.default.unlinkSync(Js.default.join(this.tempDir,t)))}catch(e){console.warn("Cleanup error:",e)}}}});var xm={};Ei(xm,{ResourceManager:()=>ll});var ll,ym=Si(()=>{kr();ll=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>$e.resourceManagement.memoryWarningThreshold&&(console.warn(`\u26A0\uFE0F High memory: ${t}MB`),this.cleanupInactiveClients())},$e.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=$e.resourceManagement.inactiveTimeout;for(let[r,n]of this.activeClients.entries())e-n.lastActivity>t&&(console.log(`\u{1F9F9} Cleaning inactive client: ${r}`),this.cleanupClientResources(r,n),this.activeClients.delete(r))}cleanupClientResources(e,t){try{t.isStreaming=!1,t?.streamingTimeout&&(clearTimeout(t.streamingTimeout),t.streamingTimeout=null),t?.screenInterval&&(clearInterval(t.screenInterval),t.screenInterval=null);let r=this.activeTimers.get(e);r&&(r.forEach(s=>clearTimeout(s)),this.activeTimers.delete(e));let n=this.chunkTimers.get(e);n&&(n.forEach(s=>clearTimeout(s)),this.chunkTimers.delete(e)),t?.tileManager&&(t.tileManager.clearMemory(),t.tileManager.cleanup(),t.tileManager.reset())}catch(r){console.error(`Error cleaning up ${e}:`,r.message)}}getStreamingConfig(){return $e.streaming}getWebRTCConfig(){return $e.webrtc}removeClient(e){let t=this.activeClients.get(e);t&&(this.cleanupClientResources(e,t),this.activeClients.delete(e))}getChunkTimers(e){return this.chunkTimers.has(e)||this.chunkTimers.set(e,new Set),this.chunkTimers.get(e)}cleanupAll(){this.stopResourceMonitoring();for(let[e,t]of this.activeClients.entries())this.cleanupClientResources(e,t);this.activeClients.clear(),this.activeTimers.clear(),this.chunkTimers.clear()}}});var bm={};Ei(bm,{ScreenUpdateHelper:()=>ul});var ul,wm=Si(()=>{kr();ul=class{constructor(e){this.resourceManager=e}async sendTilesInChunks(e,t,r,n=!1){if(!t||t.length===0)return;let s=$e.streaming.chunkSize,o=[];for(let u=0;u<t.length;u+=s)o.push(t.slice(u,u+s));let c=this.resourceManager.getChunkTimers(e.id);for(let u=0;u<o.length;u++){let d=o[u],f=u===o.length-1,v=setTimeout(()=>{c.delete(v),e.connected&&e.emit("tiles-data",{tiles:d,timestamp:r,forceRefresh:!1,userAction:n,chunkInfo:{chunkIndex:u,totalChunks:o.length,isLastChunk:f}})},u*$e.streaming.chunkDelay);c.add(v)}}}});var _m={};Ei(_m,{MouseHandler:()=>pl});var pl,Sm=Si(()=>{kr();pl=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastMouseMove=0}setupMouseHandlers(e,t){let r=this.robot;e.on("mouse-move",t(n=>{let s=Date.now();if(!(s-this.lastMouseMove<$e.throttling.mouseThrottle)){this.lastMouseMove=s;try{let o=r.getScreenSize(),c=Math.round(n.x/100*o.width),u=Math.round(n.y/100*o.height),d=Math.max(0,Math.min(o.width-1,c)),f=Math.max(0,Math.min(o.height-1,u));r.moveMouse(d,f),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Mouse move error:",o.message)}}})),e.on("mouse-click",t(async n=>{try{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=r.getScreenSize(),c=Math.round(n.x/100*o.width),u=Math.round(n.y/100*o.height),d=Math.max(0,Math.min(o.width-1,c)),f=Math.max(0,Math.min(o.height-1,u));r.moveMouse(d,f),r.mouseClick(n.button||"left",n.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 n=>{try{if(!this.resourceManager.getClient(e.id))return;let o=r.getScreenSize(),c=Math.round(n.x/100*o.width),u=Math.round(n.y/100*o.height),d=Math.max(0,Math.min(o.width-1,c)),f=Math.max(0,Math.min(o.height-1,u));r.moveMouse(d,f),r.mouseToggle("down",n.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse press error:",s.message)}})),e.on("mouse-release",t(async n=>{try{if(!this.resourceManager.getClient(e.id))return;let o=r.getScreenSize(),c=Math.round(n.x/100*o.width),u=Math.round(n.y/100*o.height),d=Math.max(0,Math.min(o.width-1,c)),f=Math.max(0,Math.min(o.height-1,u));r.moveMouse(d,f),r.mouseToggle("up",n.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse release error:",s.message)}})),e.on("scroll",t(async n=>{try{let{direction:s,amount:o=60,horizontal:c=!1}=n,u=this.resourceManager.getClient(e.id);if(!u)return;let d=0,f=0;c||s==="left"||s==="right"?d=s==="right"?o:-o:f=s==="down"?-o:o,r.scrollMouse(d,f),u.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Scroll error:",s.message)}})),e.on("mouse-drag-select",t(n=>{try{let{startX:s,startY:o,endX:c,endY:u}=n,d=r.getScreenSize(),f=Math.round(s/100*d.width),v=Math.round(o/100*d.height),_=Math.round(c/100*d.width),E=Math.round(u/100*d.height),C=Math.max(0,Math.min(d.width-1,f)),k=Math.max(0,Math.min(d.height-1,v)),M=Math.max(0,Math.min(d.width-1,_)),O=Math.max(0,Math.min(d.height-1,E));r.moveMouse(C,k),r.mouseToggle("down","left"),r.dragMouse(M,O),r.mouseToggle("up","left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Drag selection error:",s.message)}}))}}});var Em={};Ei(Em,{KeyboardHandler:()=>dl});var dl,Cm=Si(()=>{kr();dl=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastKeyPress=0,this.lastTypeText=0}setupKeyboardHandlers(e,t){let r=this.robot;e.on("key-press",t(n=>{let s=Date.now();if(!(s-this.lastKeyPress<$e.throttling.keyThrottle)){this.lastKeyPress=s;try{if(!n.key||typeof n.key!="string")return;let o=this.resourceManager.getClient(e.id),c=n.key;if(c.length===1){r.keyTap(c,n.modifier||[]);for(let u of n.modifier||[])r.keyToggle(u,"up")}else switch(c.toLowerCase()){case"enter":case"return":r.keyTap("enter");break;case"space":r.keyTap(" ");break;case"backspace":r.keyTap("backspace");break;case"tab":r.keyTap("tab");break;case"escape":r.keyTap("escape");break;default:r.keyTap(c,n.modifier||[])}o&&(o.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Key press error:",o.message)}}})),e.on("type-text",t(n=>{let s=Date.now();if(!(s-this.lastTypeText<$e.throttling.typeTextThrottle)){this.lastTypeText=s;try{if(!n.text||typeof n.text!="string")return;let o=n.text;o.length>$e.throttling.maxTextLength&&(o=o.substring(0,$e.throttling.maxTextLength));let c=o.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,""),u=this.resourceManager.getClient(e.id);setTimeout(()=>{try{r.typeString(c),this.resourceManager.updateClientActivity(e.id),u&&(u.idleFrameCount=0,u.tileManager&&u.tileManager.clearScreenCache())}catch(d){console.error("Robot typeString error:",d.message)}},10)}catch(o){console.error("Type text error:",o.message)}}}))}}});var Tm={};Ei(Tm,{ScreenHandler:()=>hl});function Y1(i){let e=Buffer.alloc(24);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),e.writeUInt32LE(i.imageBuffer.length,20),Buffer.concat([e,i.imageBuffer])}function fl(i,e){let t=Buffer.alloc(12);return t.writeUInt32LE(i.length,0),t.writeDoubleBE(e,4),Buffer.concat([t,...i.map(Y1)])}var hl,km=Si(()=>{hl=class{constructor(e,t){this.resourceManager=e,this.screenUpdateHelper=t}setupScreenHandlers(e,t,r){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&&r.sendTiles({tiles:s,timestamp:Date.now()},fl),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Tile capture error:",s),r.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 o=n.tileHashes||[],c=await s.tileManager.compareClientTileHashes(o);c?.tiles?.length>0?r.sendTiles({tiles:c.tiles,timestamp:Date.now(),currentHashes:c.currentHashes,changedIndices:c.changedIndices},fl):r.emit("tiles-data",{tiles:[],timestamp:Date.now(),currentHashes:c.currentHashes,changedIndices:[]}),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Tile capture with hashes error:",o),r.emit("screen-error",{error:o.message})}})),e.on("start-streaming",t(async()=>{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,n.tileManager.lastTileChecksums.clear();try{let o=await n.tileManager.getScreenDimensions();r.emit("screen-dimensions",o)}catch(o){console.error("Get dimensions error:",o.message)}let s=async()=>{if(!e.connected||!n.isStreaming){n.streamingTimeout=null;return}try{let o=performance.now(),c=await n.tileManager.detectChangedTilesWithHashes();c.tiles.length>0&&e.connected?(r.sendTiles({tiles:c.tiles,timestamp:Date.now(),currentHashes:c.currentHashes},fl),n.idleFrameCount=0):n.idleFrameCount++;let{activeInterval:u,idleInterval:d,idleThreshold:f}=this.resourceManager.getStreamingConfig(),v=n.idleFrameCount>=f?d:u,_=Math.max(0,v-(performance.now()-o));n.streamingTimeout=setTimeout(s,_)}catch(o){console.error("Auto streaming error:",o),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();r.emit("screen-dimensions",s)}catch(s){console.error("Get dimensions error:",s),r.emit("screen-error",{error:s.message})}})),e.on("boost-stream",t(()=>{let n=this.resourceManager.getClient(e.id);n&&(n.idleFrameCount=0)}))}}});var El=T((iv,Sl)=>{(function(i,e){"use strict";function t(b,a){if(!b)throw new Error(a||"Assertion failed")}function r(b,a){b.super_=a;var p=function(){};p.prototype=a.prototype,b.prototype=new p,b.prototype.constructor=b}function n(b,a,p){if(n.isBN(b))return b;this.negative=0,this.words=null,this.length=0,this.red=null,b!==null&&((a==="le"||a==="be")&&(p=a,a=10),this._init(b||0,a||10,p||"be"))}typeof i=="object"?i.exports=n:e.BN=n,n.BN=n,n.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=require("buffer").Buffer}catch{}n.isBN=function(a){return a instanceof n?!0:a!==null&&typeof a=="object"&&a.constructor.wordSize===n.wordSize&&Array.isArray(a.words)},n.max=function(a,p){return a.cmp(p)>0?a:p},n.min=function(a,p){return a.cmp(p)<0?a:p},n.prototype._init=function(a,p,h){if(typeof a=="number")return this._initNumber(a,p,h);if(typeof a=="object")return this._initArray(a,p,h);p==="hex"&&(p=16),t(p===(p|0)&&p>=2&&p<=36),a=a.toString().replace(/\s+/g,"");var m=0;a[0]==="-"&&(m++,this.negative=1),m<a.length&&(p===16?this._parseHex(a,m,h):(this._parseBase(a,p,m),h==="le"&&this._initArray(this.toArray(),p,h)))},n.prototype._initNumber=function(a,p,h){a<0&&(this.negative=1,a=-a),a<67108864?(this.words=[a&67108863],this.length=1):a<4503599627370496?(this.words=[a&67108863,a/67108864&67108863],this.length=2):(t(a<9007199254740992),this.words=[a&67108863,a/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),p,h)},n.prototype._initArray=function(a,p,h){if(t(typeof a.length=="number"),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.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=a.length-1,y=0;m>=0;m-=3)w=a[m]|a[m-1]<<8|a[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<a.length;m+=3)w=a[m]|a[m+1]<<8|a[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,a){var p=b.charCodeAt(a);return p>=65&&p<=70?p-55:p>=97&&p<=102?p-87:p-48&15}function c(b,a,p){var h=o(b,p);return p-1>=a&&(h|=o(b,p-1)<<4),h}n.prototype._parseHex=function(a,p,h){this.length=Math.ceil((a.length-p)/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=a.length-1;m>=p;m-=2)S=c(a,p,m)<<y,this.words[w]|=S&67108863,y>=18?(y-=18,w+=1,this.words[w]|=S>>>26):y+=8;else{var g=a.length-p;for(m=g%2===0?p+1:p;m<a.length;m+=2)S=c(a,p,m)<<y,this.words[w]|=S&67108863,y>=18?(y-=18,w+=1,this.words[w]|=S>>>26):y+=8}this.strip()};function u(b,a,p,h){for(var m=0,y=Math.min(b.length,p),w=a;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}n.prototype._parseBase=function(a,p,h){this.words=[0],this.length=1;for(var m=0,y=1;y<=67108863;y*=p)m++;m--,y=y/p|0;for(var w=a.length-h,S=w%m,g=Math.min(w,w-S)+h,l=0,x=h;x<g;x+=m)l=u(a,x,x+m,p),this.imuln(y),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(S!==0){var R=1;for(l=u(a,x,a.length,p),x=0;x<S;x++)R*=p;this.imuln(R),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this.strip()},n.prototype.copy=function(a){a.words=new Array(this.length);for(var p=0;p<this.length;p++)a.words[p]=this.words[p];a.length=this.length,a.negative=this.negative,a.red=this.red},n.prototype.clone=function(){var a=new n(null);return this.copy(a),a},n.prototype._expand=function(a){for(;this.length<a;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var d=["","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];n.prototype.toString=function(a,p){a=a||10,p=p|0||1;var h;if(a===16||a==="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=d[6-g.length]+g+h:h=g+h}for(y!==0&&(h=y.toString(16)+h);h.length%p!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(a===(a|0)&&a>=2&&a<=36){var l=f[a],x=v[a];h="";var R=this.clone();for(R.negative=0;!R.isZero();){var P=R.modn(x).toString(a);R=R.idivn(x),R.isZero()?h=P+h:h=d[l-P.length]+P+h}for(this.isZero()&&(h="0"+h);h.length%p!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}t(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var a=this.words[0];return this.length===2?a+=this.words[1]*67108864:this.length===3&&this.words[2]===1?a+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-a:a},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(a,p){return t(typeof s<"u"),this.toArrayLike(s,a,p)},n.prototype.toArray=function(a,p){return this.toArrayLike(Array,a,p)},n.prototype.toArrayLike=function(a,p,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=p==="le",S=new a(y),g,l,x=this.clone();if(w){for(l=0;!x.isZero();l++)g=x.andln(255),x.iushrn(8),S[l]=g;for(;l<y;l++)S[l]=0}else{for(l=0;l<y-m;l++)S[l]=0;for(l=0;!x.isZero();l++)g=x.andln(255),x.iushrn(8),S[y-l-1]=g}return S},Math.clz32?n.prototype._countBits=function(a){return 32-Math.clz32(a)}:n.prototype._countBits=function(a){var p=a,h=0;return p>=4096&&(h+=13,p>>>=13),p>=64&&(h+=7,p>>>=7),p>=8&&(h+=4,p>>>=4),p>=2&&(h+=2,p>>>=2),h+p},n.prototype._zeroBits=function(a){if(a===0)return 26;var p=a,h=0;return(p&8191)===0&&(h+=13,p>>>=13),(p&127)===0&&(h+=7,p>>>=7),(p&15)===0&&(h+=4,p>>>=4),(p&3)===0&&(h+=2,p>>>=2),(p&1)===0&&h++,h},n.prototype.bitLength=function(){var a=this.words[this.length-1],p=this._countBits(a);return(this.length-1)*26+p};function _(b){for(var a=new Array(b.bitLength()),p=0;p<a.length;p++){var h=p/26|0,m=p%26;a[p]=(b.words[h]&1<<m)>>>m}return a}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,p=0;p<this.length;p++){var h=this._zeroBits(this.words[p]);if(a+=h,h!==26)break}return a},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(a){return this.negative!==0?this.abs().inotn(a).iaddn(1):this.clone()},n.prototype.fromTwos=function(a){return this.testn(a-1)?this.notn(a).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(a){for(;this.length<a.length;)this.words[this.length++]=0;for(var p=0;p<a.length;p++)this.words[p]=this.words[p]|a.words[p];return this.strip()},n.prototype.ior=function(a){return t((this.negative|a.negative)===0),this.iuor(a)},n.prototype.or=function(a){return this.length>a.length?this.clone().ior(a):a.clone().ior(this)},n.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},n.prototype.iuand=function(a){var p;this.length>a.length?p=a:p=this;for(var h=0;h<p.length;h++)this.words[h]=this.words[h]&a.words[h];return this.length=p.length,this.strip()},n.prototype.iand=function(a){return t((this.negative|a.negative)===0),this.iuand(a)},n.prototype.and=function(a){return this.length>a.length?this.clone().iand(a):a.clone().iand(this)},n.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},n.prototype.iuxor=function(a){var p,h;this.length>a.length?(p=this,h=a):(p=a,h=this);for(var m=0;m<h.length;m++)this.words[m]=p.words[m]^h.words[m];if(this!==p)for(;m<p.length;m++)this.words[m]=p.words[m];return this.length=p.length,this.strip()},n.prototype.ixor=function(a){return t((this.negative|a.negative)===0),this.iuxor(a)},n.prototype.xor=function(a){return this.length>a.length?this.clone().ixor(a):a.clone().ixor(this)},n.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},n.prototype.inotn=function(a){t(typeof a=="number"&&a>=0);var p=Math.ceil(a/26)|0,h=a%26;this._expand(p),h>0&&p--;for(var m=0;m<p;m++)this.words[m]=~this.words[m]&67108863;return h>0&&(this.words[m]=~this.words[m]&67108863>>26-h),this.strip()},n.prototype.notn=function(a){return this.clone().inotn(a)},n.prototype.setn=function(a,p){t(typeof a=="number"&&a>=0);var h=a/26|0,m=a%26;return this._expand(h+1),p?this.words[h]=this.words[h]|1<<m:this.words[h]=this.words[h]&~(1<<m),this.strip()},n.prototype.iadd=function(a){var p;if(this.negative!==0&&a.negative===0)return this.negative=0,p=this.isub(a),this.negative^=1,this._normSign();if(this.negative===0&&a.negative!==0)return a.negative=0,p=this.isub(a),a.negative=1,p._normSign();var h,m;this.length>a.length?(h=this,m=a):(h=a,m=this);for(var y=0,w=0;w<m.length;w++)p=(h.words[w]|0)+(m.words[w]|0)+y,this.words[w]=p&67108863,y=p>>>26;for(;y!==0&&w<h.length;w++)p=(h.words[w]|0)+y,this.words[w]=p&67108863,y=p>>>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},n.prototype.add=function(a){var p;return a.negative!==0&&this.negative===0?(a.negative=0,p=this.sub(a),a.negative^=1,p):a.negative===0&&this.negative!==0?(this.negative=0,p=a.sub(this),this.negative=1,p):this.length>a.length?this.clone().iadd(a):a.clone().iadd(this)},n.prototype.isub=function(a){if(a.negative!==0){a.negative=0;var p=this.iadd(a);return a.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var h=this.cmp(a);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,y;h>0?(m=this,y=a):(m=a,y=this);for(var w=0,S=0;S<y.length;S++)p=(m.words[S]|0)-(y.words[S]|0)+w,w=p>>26,this.words[S]=p&67108863;for(;w!==0&&S<m.length;S++)p=(m.words[S]|0)+w,w=p>>26,this.words[S]=p&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()},n.prototype.sub=function(a){return this.clone().isub(a)};function E(b,a,p){p.negative=a.negative^b.negative;var h=b.length+a.length|0;p.length=h,h=h-1|0;var m=b.words[0]|0,y=a.words[0]|0,w=m*y,S=w&67108863,g=w/67108864|0;p.words[0]=S;for(var l=1;l<h;l++){for(var x=g>>>26,R=g&67108863,P=Math.min(l,a.length-1),B=Math.max(0,l-b.length+1);B<=P;B++){var D=l-B|0;m=b.words[D]|0,y=a.words[B]|0,w=m*y+R,x+=w/67108864|0,R=w&67108863}p.words[l]=R|0,g=x|0}return g!==0?p.words[l]=g|0:p.length--,p.strip()}var C=function(a,p,h){var m=a.words,y=p.words,w=h.words,S=0,g,l,x,R=m[0]|0,P=R&8191,B=R>>>13,D=m[1]|0,F=D&8191,V=D>>>13,ui=m[2]|0,K=ui&8191,Y=ui>>>13,Mu=m[3]|0,ne=Mu&8191,se=Mu>>>13,Ou=m[4]|0,oe=Ou&8191,ae=Ou>>>13,Au=m[5]|0,ce=Au&8191,le=Au>>>13,Ru=m[6]|0,ue=Ru&8191,pe=Ru>>>13,Pu=m[7]|0,de=Pu&8191,fe=Pu>>>13,Bu=m[8]|0,he=Bu&8191,me=Bu>>>13,Nu=m[9]|0,ve=Nu&8191,ge=Nu>>>13,Iu=y[0]|0,xe=Iu&8191,ye=Iu>>>13,Du=y[1]|0,be=Du&8191,we=Du>>>13,ju=y[2]|0,_e=ju&8191,Se=ju>>>13,Lu=y[3]|0,Ee=Lu&8191,Ce=Lu>>>13,qu=y[4]|0,Te=qu&8191,ke=qu>>>13,Fu=y[5]|0,Me=Fu&8191,Oe=Fu>>>13,Uu=y[6]|0,Ae=Uu&8191,Re=Uu>>>13,Hu=y[7]|0,Pe=Hu&8191,Be=Hu>>>13,zu=y[8]|0,Ne=zu&8191,Ie=zu>>>13,Wu=y[9]|0,De=Wu&8191,je=Wu>>>13;h.negative=a.negative^p.negative,h.length=19,g=Math.imul(P,xe),l=Math.imul(P,ye),l=l+Math.imul(B,xe)|0,x=Math.imul(B,ye);var Wo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Wo>>>26)|0,Wo&=67108863,g=Math.imul(F,xe),l=Math.imul(F,ye),l=l+Math.imul(V,xe)|0,x=Math.imul(V,ye),g=g+Math.imul(P,be)|0,l=l+Math.imul(P,we)|0,l=l+Math.imul(B,be)|0,x=x+Math.imul(B,we)|0;var $o=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+($o>>>26)|0,$o&=67108863,g=Math.imul(K,xe),l=Math.imul(K,ye),l=l+Math.imul(Y,xe)|0,x=Math.imul(Y,ye),g=g+Math.imul(F,be)|0,l=l+Math.imul(F,we)|0,l=l+Math.imul(V,be)|0,x=x+Math.imul(V,we)|0,g=g+Math.imul(P,_e)|0,l=l+Math.imul(P,Se)|0,l=l+Math.imul(B,_e)|0,x=x+Math.imul(B,Se)|0;var Vo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Vo>>>26)|0,Vo&=67108863,g=Math.imul(ne,xe),l=Math.imul(ne,ye),l=l+Math.imul(se,xe)|0,x=Math.imul(se,ye),g=g+Math.imul(K,be)|0,l=l+Math.imul(K,we)|0,l=l+Math.imul(Y,be)|0,x=x+Math.imul(Y,we)|0,g=g+Math.imul(F,_e)|0,l=l+Math.imul(F,Se)|0,l=l+Math.imul(V,_e)|0,x=x+Math.imul(V,Se)|0,g=g+Math.imul(P,Ee)|0,l=l+Math.imul(P,Ce)|0,l=l+Math.imul(B,Ee)|0,x=x+Math.imul(B,Ce)|0;var Ko=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Ko>>>26)|0,Ko&=67108863,g=Math.imul(oe,xe),l=Math.imul(oe,ye),l=l+Math.imul(ae,xe)|0,x=Math.imul(ae,ye),g=g+Math.imul(ne,be)|0,l=l+Math.imul(ne,we)|0,l=l+Math.imul(se,be)|0,x=x+Math.imul(se,we)|0,g=g+Math.imul(K,_e)|0,l=l+Math.imul(K,Se)|0,l=l+Math.imul(Y,_e)|0,x=x+Math.imul(Y,Se)|0,g=g+Math.imul(F,Ee)|0,l=l+Math.imul(F,Ce)|0,l=l+Math.imul(V,Ee)|0,x=x+Math.imul(V,Ce)|0,g=g+Math.imul(P,Te)|0,l=l+Math.imul(P,ke)|0,l=l+Math.imul(B,Te)|0,x=x+Math.imul(B,ke)|0;var Go=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Go>>>26)|0,Go&=67108863,g=Math.imul(ce,xe),l=Math.imul(ce,ye),l=l+Math.imul(le,xe)|0,x=Math.imul(le,ye),g=g+Math.imul(oe,be)|0,l=l+Math.imul(oe,we)|0,l=l+Math.imul(ae,be)|0,x=x+Math.imul(ae,we)|0,g=g+Math.imul(ne,_e)|0,l=l+Math.imul(ne,Se)|0,l=l+Math.imul(se,_e)|0,x=x+Math.imul(se,Se)|0,g=g+Math.imul(K,Ee)|0,l=l+Math.imul(K,Ce)|0,l=l+Math.imul(Y,Ee)|0,x=x+Math.imul(Y,Ce)|0,g=g+Math.imul(F,Te)|0,l=l+Math.imul(F,ke)|0,l=l+Math.imul(V,Te)|0,x=x+Math.imul(V,ke)|0,g=g+Math.imul(P,Me)|0,l=l+Math.imul(P,Oe)|0,l=l+Math.imul(B,Me)|0,x=x+Math.imul(B,Oe)|0;var Yo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Yo>>>26)|0,Yo&=67108863,g=Math.imul(ue,xe),l=Math.imul(ue,ye),l=l+Math.imul(pe,xe)|0,x=Math.imul(pe,ye),g=g+Math.imul(ce,be)|0,l=l+Math.imul(ce,we)|0,l=l+Math.imul(le,be)|0,x=x+Math.imul(le,we)|0,g=g+Math.imul(oe,_e)|0,l=l+Math.imul(oe,Se)|0,l=l+Math.imul(ae,_e)|0,x=x+Math.imul(ae,Se)|0,g=g+Math.imul(ne,Ee)|0,l=l+Math.imul(ne,Ce)|0,l=l+Math.imul(se,Ee)|0,x=x+Math.imul(se,Ce)|0,g=g+Math.imul(K,Te)|0,l=l+Math.imul(K,ke)|0,l=l+Math.imul(Y,Te)|0,x=x+Math.imul(Y,ke)|0,g=g+Math.imul(F,Me)|0,l=l+Math.imul(F,Oe)|0,l=l+Math.imul(V,Me)|0,x=x+Math.imul(V,Oe)|0,g=g+Math.imul(P,Ae)|0,l=l+Math.imul(P,Re)|0,l=l+Math.imul(B,Ae)|0,x=x+Math.imul(B,Re)|0;var Jo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Jo>>>26)|0,Jo&=67108863,g=Math.imul(de,xe),l=Math.imul(de,ye),l=l+Math.imul(fe,xe)|0,x=Math.imul(fe,ye),g=g+Math.imul(ue,be)|0,l=l+Math.imul(ue,we)|0,l=l+Math.imul(pe,be)|0,x=x+Math.imul(pe,we)|0,g=g+Math.imul(ce,_e)|0,l=l+Math.imul(ce,Se)|0,l=l+Math.imul(le,_e)|0,x=x+Math.imul(le,Se)|0,g=g+Math.imul(oe,Ee)|0,l=l+Math.imul(oe,Ce)|0,l=l+Math.imul(ae,Ee)|0,x=x+Math.imul(ae,Ce)|0,g=g+Math.imul(ne,Te)|0,l=l+Math.imul(ne,ke)|0,l=l+Math.imul(se,Te)|0,x=x+Math.imul(se,ke)|0,g=g+Math.imul(K,Me)|0,l=l+Math.imul(K,Oe)|0,l=l+Math.imul(Y,Me)|0,x=x+Math.imul(Y,Oe)|0,g=g+Math.imul(F,Ae)|0,l=l+Math.imul(F,Re)|0,l=l+Math.imul(V,Ae)|0,x=x+Math.imul(V,Re)|0,g=g+Math.imul(P,Pe)|0,l=l+Math.imul(P,Be)|0,l=l+Math.imul(B,Pe)|0,x=x+Math.imul(B,Be)|0;var Xo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Xo>>>26)|0,Xo&=67108863,g=Math.imul(he,xe),l=Math.imul(he,ye),l=l+Math.imul(me,xe)|0,x=Math.imul(me,ye),g=g+Math.imul(de,be)|0,l=l+Math.imul(de,we)|0,l=l+Math.imul(fe,be)|0,x=x+Math.imul(fe,we)|0,g=g+Math.imul(ue,_e)|0,l=l+Math.imul(ue,Se)|0,l=l+Math.imul(pe,_e)|0,x=x+Math.imul(pe,Se)|0,g=g+Math.imul(ce,Ee)|0,l=l+Math.imul(ce,Ce)|0,l=l+Math.imul(le,Ee)|0,x=x+Math.imul(le,Ce)|0,g=g+Math.imul(oe,Te)|0,l=l+Math.imul(oe,ke)|0,l=l+Math.imul(ae,Te)|0,x=x+Math.imul(ae,ke)|0,g=g+Math.imul(ne,Me)|0,l=l+Math.imul(ne,Oe)|0,l=l+Math.imul(se,Me)|0,x=x+Math.imul(se,Oe)|0,g=g+Math.imul(K,Ae)|0,l=l+Math.imul(K,Re)|0,l=l+Math.imul(Y,Ae)|0,x=x+Math.imul(Y,Re)|0,g=g+Math.imul(F,Pe)|0,l=l+Math.imul(F,Be)|0,l=l+Math.imul(V,Pe)|0,x=x+Math.imul(V,Be)|0,g=g+Math.imul(P,Ne)|0,l=l+Math.imul(P,Ie)|0,l=l+Math.imul(B,Ne)|0,x=x+Math.imul(B,Ie)|0;var Zo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Zo>>>26)|0,Zo&=67108863,g=Math.imul(ve,xe),l=Math.imul(ve,ye),l=l+Math.imul(ge,xe)|0,x=Math.imul(ge,ye),g=g+Math.imul(he,be)|0,l=l+Math.imul(he,we)|0,l=l+Math.imul(me,be)|0,x=x+Math.imul(me,we)|0,g=g+Math.imul(de,_e)|0,l=l+Math.imul(de,Se)|0,l=l+Math.imul(fe,_e)|0,x=x+Math.imul(fe,Se)|0,g=g+Math.imul(ue,Ee)|0,l=l+Math.imul(ue,Ce)|0,l=l+Math.imul(pe,Ee)|0,x=x+Math.imul(pe,Ce)|0,g=g+Math.imul(ce,Te)|0,l=l+Math.imul(ce,ke)|0,l=l+Math.imul(le,Te)|0,x=x+Math.imul(le,ke)|0,g=g+Math.imul(oe,Me)|0,l=l+Math.imul(oe,Oe)|0,l=l+Math.imul(ae,Me)|0,x=x+Math.imul(ae,Oe)|0,g=g+Math.imul(ne,Ae)|0,l=l+Math.imul(ne,Re)|0,l=l+Math.imul(se,Ae)|0,x=x+Math.imul(se,Re)|0,g=g+Math.imul(K,Pe)|0,l=l+Math.imul(K,Be)|0,l=l+Math.imul(Y,Pe)|0,x=x+Math.imul(Y,Be)|0,g=g+Math.imul(F,Ne)|0,l=l+Math.imul(F,Ie)|0,l=l+Math.imul(V,Ne)|0,x=x+Math.imul(V,Ie)|0,g=g+Math.imul(P,De)|0,l=l+Math.imul(P,je)|0,l=l+Math.imul(B,De)|0,x=x+Math.imul(B,je)|0;var Qo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Qo>>>26)|0,Qo&=67108863,g=Math.imul(ve,be),l=Math.imul(ve,we),l=l+Math.imul(ge,be)|0,x=Math.imul(ge,we),g=g+Math.imul(he,_e)|0,l=l+Math.imul(he,Se)|0,l=l+Math.imul(me,_e)|0,x=x+Math.imul(me,Se)|0,g=g+Math.imul(de,Ee)|0,l=l+Math.imul(de,Ce)|0,l=l+Math.imul(fe,Ee)|0,x=x+Math.imul(fe,Ce)|0,g=g+Math.imul(ue,Te)|0,l=l+Math.imul(ue,ke)|0,l=l+Math.imul(pe,Te)|0,x=x+Math.imul(pe,ke)|0,g=g+Math.imul(ce,Me)|0,l=l+Math.imul(ce,Oe)|0,l=l+Math.imul(le,Me)|0,x=x+Math.imul(le,Oe)|0,g=g+Math.imul(oe,Ae)|0,l=l+Math.imul(oe,Re)|0,l=l+Math.imul(ae,Ae)|0,x=x+Math.imul(ae,Re)|0,g=g+Math.imul(ne,Pe)|0,l=l+Math.imul(ne,Be)|0,l=l+Math.imul(se,Pe)|0,x=x+Math.imul(se,Be)|0,g=g+Math.imul(K,Ne)|0,l=l+Math.imul(K,Ie)|0,l=l+Math.imul(Y,Ne)|0,x=x+Math.imul(Y,Ie)|0,g=g+Math.imul(F,De)|0,l=l+Math.imul(F,je)|0,l=l+Math.imul(V,De)|0,x=x+Math.imul(V,je)|0;var ea=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(ea>>>26)|0,ea&=67108863,g=Math.imul(ve,_e),l=Math.imul(ve,Se),l=l+Math.imul(ge,_e)|0,x=Math.imul(ge,Se),g=g+Math.imul(he,Ee)|0,l=l+Math.imul(he,Ce)|0,l=l+Math.imul(me,Ee)|0,x=x+Math.imul(me,Ce)|0,g=g+Math.imul(de,Te)|0,l=l+Math.imul(de,ke)|0,l=l+Math.imul(fe,Te)|0,x=x+Math.imul(fe,ke)|0,g=g+Math.imul(ue,Me)|0,l=l+Math.imul(ue,Oe)|0,l=l+Math.imul(pe,Me)|0,x=x+Math.imul(pe,Oe)|0,g=g+Math.imul(ce,Ae)|0,l=l+Math.imul(ce,Re)|0,l=l+Math.imul(le,Ae)|0,x=x+Math.imul(le,Re)|0,g=g+Math.imul(oe,Pe)|0,l=l+Math.imul(oe,Be)|0,l=l+Math.imul(ae,Pe)|0,x=x+Math.imul(ae,Be)|0,g=g+Math.imul(ne,Ne)|0,l=l+Math.imul(ne,Ie)|0,l=l+Math.imul(se,Ne)|0,x=x+Math.imul(se,Ie)|0,g=g+Math.imul(K,De)|0,l=l+Math.imul(K,je)|0,l=l+Math.imul(Y,De)|0,x=x+Math.imul(Y,je)|0;var ta=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(ta>>>26)|0,ta&=67108863,g=Math.imul(ve,Ee),l=Math.imul(ve,Ce),l=l+Math.imul(ge,Ee)|0,x=Math.imul(ge,Ce),g=g+Math.imul(he,Te)|0,l=l+Math.imul(he,ke)|0,l=l+Math.imul(me,Te)|0,x=x+Math.imul(me,ke)|0,g=g+Math.imul(de,Me)|0,l=l+Math.imul(de,Oe)|0,l=l+Math.imul(fe,Me)|0,x=x+Math.imul(fe,Oe)|0,g=g+Math.imul(ue,Ae)|0,l=l+Math.imul(ue,Re)|0,l=l+Math.imul(pe,Ae)|0,x=x+Math.imul(pe,Re)|0,g=g+Math.imul(ce,Pe)|0,l=l+Math.imul(ce,Be)|0,l=l+Math.imul(le,Pe)|0,x=x+Math.imul(le,Be)|0,g=g+Math.imul(oe,Ne)|0,l=l+Math.imul(oe,Ie)|0,l=l+Math.imul(ae,Ne)|0,x=x+Math.imul(ae,Ie)|0,g=g+Math.imul(ne,De)|0,l=l+Math.imul(ne,je)|0,l=l+Math.imul(se,De)|0,x=x+Math.imul(se,je)|0;var ia=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(ia>>>26)|0,ia&=67108863,g=Math.imul(ve,Te),l=Math.imul(ve,ke),l=l+Math.imul(ge,Te)|0,x=Math.imul(ge,ke),g=g+Math.imul(he,Me)|0,l=l+Math.imul(he,Oe)|0,l=l+Math.imul(me,Me)|0,x=x+Math.imul(me,Oe)|0,g=g+Math.imul(de,Ae)|0,l=l+Math.imul(de,Re)|0,l=l+Math.imul(fe,Ae)|0,x=x+Math.imul(fe,Re)|0,g=g+Math.imul(ue,Pe)|0,l=l+Math.imul(ue,Be)|0,l=l+Math.imul(pe,Pe)|0,x=x+Math.imul(pe,Be)|0,g=g+Math.imul(ce,Ne)|0,l=l+Math.imul(ce,Ie)|0,l=l+Math.imul(le,Ne)|0,x=x+Math.imul(le,Ie)|0,g=g+Math.imul(oe,De)|0,l=l+Math.imul(oe,je)|0,l=l+Math.imul(ae,De)|0,x=x+Math.imul(ae,je)|0;var ra=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(ra>>>26)|0,ra&=67108863,g=Math.imul(ve,Me),l=Math.imul(ve,Oe),l=l+Math.imul(ge,Me)|0,x=Math.imul(ge,Oe),g=g+Math.imul(he,Ae)|0,l=l+Math.imul(he,Re)|0,l=l+Math.imul(me,Ae)|0,x=x+Math.imul(me,Re)|0,g=g+Math.imul(de,Pe)|0,l=l+Math.imul(de,Be)|0,l=l+Math.imul(fe,Pe)|0,x=x+Math.imul(fe,Be)|0,g=g+Math.imul(ue,Ne)|0,l=l+Math.imul(ue,Ie)|0,l=l+Math.imul(pe,Ne)|0,x=x+Math.imul(pe,Ie)|0,g=g+Math.imul(ce,De)|0,l=l+Math.imul(ce,je)|0,l=l+Math.imul(le,De)|0,x=x+Math.imul(le,je)|0;var na=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(na>>>26)|0,na&=67108863,g=Math.imul(ve,Ae),l=Math.imul(ve,Re),l=l+Math.imul(ge,Ae)|0,x=Math.imul(ge,Re),g=g+Math.imul(he,Pe)|0,l=l+Math.imul(he,Be)|0,l=l+Math.imul(me,Pe)|0,x=x+Math.imul(me,Be)|0,g=g+Math.imul(de,Ne)|0,l=l+Math.imul(de,Ie)|0,l=l+Math.imul(fe,Ne)|0,x=x+Math.imul(fe,Ie)|0,g=g+Math.imul(ue,De)|0,l=l+Math.imul(ue,je)|0,l=l+Math.imul(pe,De)|0,x=x+Math.imul(pe,je)|0;var sa=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(sa>>>26)|0,sa&=67108863,g=Math.imul(ve,Pe),l=Math.imul(ve,Be),l=l+Math.imul(ge,Pe)|0,x=Math.imul(ge,Be),g=g+Math.imul(he,Ne)|0,l=l+Math.imul(he,Ie)|0,l=l+Math.imul(me,Ne)|0,x=x+Math.imul(me,Ie)|0,g=g+Math.imul(de,De)|0,l=l+Math.imul(de,je)|0,l=l+Math.imul(fe,De)|0,x=x+Math.imul(fe,je)|0;var oa=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(oa>>>26)|0,oa&=67108863,g=Math.imul(ve,Ne),l=Math.imul(ve,Ie),l=l+Math.imul(ge,Ne)|0,x=Math.imul(ge,Ie),g=g+Math.imul(he,De)|0,l=l+Math.imul(he,je)|0,l=l+Math.imul(me,De)|0,x=x+Math.imul(me,je)|0;var aa=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(aa>>>26)|0,aa&=67108863,g=Math.imul(ve,De),l=Math.imul(ve,je),l=l+Math.imul(ge,De)|0,x=Math.imul(ge,je);var ca=(S+g|0)+((l&8191)<<13)|0;return S=(x+(l>>>13)|0)+(ca>>>26)|0,ca&=67108863,w[0]=Wo,w[1]=$o,w[2]=Vo,w[3]=Ko,w[4]=Go,w[5]=Yo,w[6]=Jo,w[7]=Xo,w[8]=Zo,w[9]=Qo,w[10]=ea,w[11]=ta,w[12]=ia,w[13]=ra,w[14]=na,w[15]=sa,w[16]=oa,w[17]=aa,w[18]=ca,S!==0&&(w[19]=S,h.length++),h};Math.imul||(C=E);function k(b,a,p){p.negative=a.negative^b.negative,p.length=b.length+a.length;for(var h=0,m=0,y=0;y<p.length-1;y++){var w=m;m=0;for(var S=h&67108863,g=Math.min(y,a.length-1),l=Math.max(0,y-b.length+1);l<=g;l++){var x=y-l,R=b.words[x]|0,P=a.words[l]|0,B=R*P,D=B&67108863;w=w+(B/67108864|0)|0,D=D+S|0,S=D&67108863,w=w+(D>>>26)|0,m+=w>>>26,w&=67108863}p.words[y]=S,h=w,w=m}return h!==0?p.words[y]=h:p.length--,p.strip()}function M(b,a,p){var h=new O;return h.mulp(b,a,p)}n.prototype.mulTo=function(a,p){var h,m=this.length+a.length;return this.length===10&&a.length===10?h=C(this,a,p):m<63?h=E(this,a,p):m<1024?h=k(this,a,p):h=M(this,a,p),h};function O(b,a){this.x=b,this.y=a}O.prototype.makeRBT=function(a){for(var p=new Array(a),h=n.prototype._countBits(a)-1,m=0;m<a;m++)p[m]=this.revBin(m,h,a);return p},O.prototype.revBin=function(a,p,h){if(a===0||a===h-1)return a;for(var m=0,y=0;y<p;y++)m|=(a&1)<<p-y-1,a>>=1;return m},O.prototype.permute=function(a,p,h,m,y,w){for(var S=0;S<w;S++)m[S]=p[a[S]],y[S]=h[a[S]]},O.prototype.transform=function(a,p,h,m,y,w){this.permute(w,a,p,h,m,y);for(var S=1;S<y;S<<=1)for(var g=S<<1,l=Math.cos(2*Math.PI/g),x=Math.sin(2*Math.PI/g),R=0;R<y;R+=g)for(var P=l,B=x,D=0;D<S;D++){var F=h[R+D],V=m[R+D],ui=h[R+D+S],K=m[R+D+S],Y=P*ui-B*K;K=P*K+B*ui,ui=Y,h[R+D]=F+ui,m[R+D]=V+K,h[R+D+S]=F-ui,m[R+D+S]=V-K,D!==g&&(Y=l*P-x*B,B=l*B+x*P,P=Y)}},O.prototype.guessLen13b=function(a,p){var h=Math.max(p,a)|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(a,p,h){if(!(h<=1))for(var m=0;m<h/2;m++){var y=a[m];a[m]=a[h-m-1],a[h-m-1]=y,y=p[m],p[m]=-p[h-m-1],p[h-m-1]=-y}},O.prototype.normalize13b=function(a,p){for(var h=0,m=0;m<p/2;m++){var y=Math.round(a[2*m+1]/p)*8192+Math.round(a[2*m]/p)+h;a[m]=y&67108863,y<67108864?h=0:h=y/67108864|0}return a},O.prototype.convert13b=function(a,p,h,m){for(var y=0,w=0;w<p;w++)y=y+(a[w]|0),h[2*w]=y&8191,y=y>>>13,h[2*w+1]=y&8191,y=y>>>13;for(w=2*p;w<m;++w)h[w]=0;t(y===0),t((y&-8192)===0)},O.prototype.stub=function(a){for(var p=new Array(a),h=0;h<a;h++)p[h]=0;return p},O.prototype.mulp=function(a,p,h){var m=2*this.guessLen13b(a.length,p.length),y=this.makeRBT(m),w=this.stub(m),S=new Array(m),g=new Array(m),l=new Array(m),x=new Array(m),R=new Array(m),P=new Array(m),B=h.words;B.length=m,this.convert13b(a.words,a.length,S,m),this.convert13b(p.words,p.length,x,m),this.transform(S,w,g,l,m,y),this.transform(x,w,R,P,m,y);for(var D=0;D<m;D++){var F=g[D]*R[D]-l[D]*P[D];l[D]=g[D]*P[D]+l[D]*R[D],g[D]=F}return this.conjugate(g,l,m),this.transform(g,l,B,w,m,y),this.conjugate(B,w,m),this.normalize13b(B,m),h.negative=a.negative^p.negative,h.length=a.length+p.length,h.strip()},n.prototype.mul=function(a){var p=new n(null);return p.words=new Array(this.length+a.length),this.mulTo(a,p)},n.prototype.mulf=function(a){var p=new n(null);return p.words=new Array(this.length+a.length),M(this,a,p)},n.prototype.imul=function(a){return this.clone().mulTo(a,this)},n.prototype.imuln=function(a){t(typeof a=="number"),t(a<67108864);for(var p=0,h=0;h<this.length;h++){var m=(this.words[h]|0)*a,y=(m&67108863)+(p&67108863);p>>=26,p+=m/67108864|0,p+=y>>>26,this.words[h]=y&67108863}return p!==0&&(this.words[h]=p,this.length++),this.length=a===0?1:this.length,this},n.prototype.muln=function(a){return this.clone().imuln(a)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(a){var p=_(a);if(p.length===0)return new n(1);for(var h=this,m=0;m<p.length&&p[m]===0;m++,h=h.sqr());if(++m<p.length)for(var y=h.sqr();m<p.length;m++,y=y.sqr())p[m]!==0&&(h=h.mul(y));return h},n.prototype.iushln=function(a){t(typeof a=="number"&&a>=0);var p=a%26,h=(a-p)/26,m=67108863>>>26-p<<26-p,y;if(p!==0){var w=0;for(y=0;y<this.length;y++){var S=this.words[y]&m,g=(this.words[y]|0)-S<<p;this.words[y]=g|w,w=S>>>26-p}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()},n.prototype.ishln=function(a){return t(this.negative===0),this.iushln(a)},n.prototype.iushrn=function(a,p,h){t(typeof a=="number"&&a>=0);var m;p?m=(p-p%26)/26:m=0;var y=a%26,w=Math.min((a-y)/26,this.length),S=67108863^67108863>>>y<<y,g=h;if(m-=w,m=Math.max(0,m),g){for(var l=0;l<w;l++)g.words[l]=this.words[l];g.length=w}if(w!==0)if(this.length>w)for(this.length-=w,l=0;l<this.length;l++)this.words[l]=this.words[l+w];else this.words[0]=0,this.length=1;var x=0;for(l=this.length-1;l>=0&&(x!==0||l>=m);l--){var R=this.words[l]|0;this.words[l]=x<<26-y|R>>>y,x=R&S}return g&&x!==0&&(g.words[g.length++]=x),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(a,p,h){return t(this.negative===0),this.iushrn(a,p,h)},n.prototype.shln=function(a){return this.clone().ishln(a)},n.prototype.ushln=function(a){return this.clone().iushln(a)},n.prototype.shrn=function(a){return this.clone().ishrn(a)},n.prototype.ushrn=function(a){return this.clone().iushrn(a)},n.prototype.testn=function(a){t(typeof a=="number"&&a>=0);var p=a%26,h=(a-p)/26,m=1<<p;if(this.length<=h)return!1;var y=this.words[h];return!!(y&m)},n.prototype.imaskn=function(a){t(typeof a=="number"&&a>=0);var p=a%26,h=(a-p)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(p!==0&&h++,this.length=Math.min(h,this.length),p!==0){var m=67108863^67108863>>>p<<p;this.words[this.length-1]&=m}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.maskn=function(a){return this.clone().imaskn(a)},n.prototype.iaddn=function(a){return t(typeof a=="number"),t(a<67108864),a<0?this.isubn(-a):this.negative!==0?this.length===1&&(this.words[0]|0)<a?(this.words[0]=a-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(a),this.negative=1,this):this._iaddn(a)},n.prototype._iaddn=function(a){this.words[0]+=a;for(var p=0;p<this.length&&this.words[p]>=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},n.prototype.isubn=function(a){if(t(typeof a=="number"),t(a<67108864),a<0)return this.iaddn(-a);if(this.negative!==0)return this.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p<this.length&&this.words[p]<0;p++)this.words[p]+=67108864,this.words[p+1]-=1;return this.strip()},n.prototype.addn=function(a){return this.clone().iaddn(a)},n.prototype.subn=function(a){return this.clone().isubn(a)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(a,p,h){var m=a.length+h,y;this._expand(m);var w,S=0;for(y=0;y<a.length;y++){w=(this.words[y+h]|0)+S;var g=(a.words[y]|0)*p;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()},n.prototype._wordDiv=function(a,p){var h=this.length-a.length,m=this.clone(),y=a,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,l;if(p!=="mod"){l=new n(null),l.length=g+1,l.words=new Array(l.length);for(var x=0;x<l.length;x++)l.words[x]=0}var R=m.clone()._ishlnsubmul(y,1,g);R.negative===0&&(m=R,l&&(l.words[g]=1));for(var P=g-1;P>=0;P--){var B=(m.words[y.length+P]|0)*67108864+(m.words[y.length+P-1]|0);for(B=Math.min(B/w|0,67108863),m._ishlnsubmul(y,B,P);m.negative!==0;)B--,m.negative=0,m._ishlnsubmul(y,1,P),m.isZero()||(m.negative^=1);l&&(l.words[P]=B)}return l&&l.strip(),m.strip(),p!=="div"&&h!==0&&m.iushrn(h),{div:l||null,mod:m}},n.prototype.divmod=function(a,p,h){if(t(!a.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var m,y,w;return this.negative!==0&&a.negative===0?(w=this.neg().divmod(a,p),p!=="mod"&&(m=w.div.neg()),p!=="div"&&(y=w.mod.neg(),h&&y.negative!==0&&y.iadd(a)),{div:m,mod:y}):this.negative===0&&a.negative!==0?(w=this.divmod(a.neg(),p),p!=="mod"&&(m=w.div.neg()),{div:m,mod:w.mod}):(this.negative&a.negative)!==0?(w=this.neg().divmod(a.neg(),p),p!=="div"&&(y=w.mod.neg(),h&&y.negative!==0&&y.isub(a)),{div:w.div,mod:y}):a.length>this.length||this.cmp(a)<0?{div:new n(0),mod:this}:a.length===1?p==="div"?{div:this.divn(a.words[0]),mod:null}:p==="mod"?{div:null,mod:new n(this.modn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new n(this.modn(a.words[0]))}:this._wordDiv(a,p)},n.prototype.div=function(a){return this.divmod(a,"div",!1).div},n.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},n.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},n.prototype.divRound=function(a){var p=this.divmod(a);if(p.mod.isZero())return p.div;var h=p.div.negative!==0?p.mod.isub(a):p.mod,m=a.ushrn(1),y=a.andln(1),w=h.cmp(m);return w<0||y===1&&w===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},n.prototype.modn=function(a){t(a<=67108863);for(var p=(1<<26)%a,h=0,m=this.length-1;m>=0;m--)h=(p*h+(this.words[m]|0))%a;return h},n.prototype.idivn=function(a){t(a<=67108863);for(var p=0,h=this.length-1;h>=0;h--){var m=(this.words[h]|0)+p*67108864;this.words[h]=m/a|0,p=m%a}return this.strip()},n.prototype.divn=function(a){return this.clone().idivn(a)},n.prototype.egcd=function(a){t(a.negative===0),t(!a.isZero());var p=this,h=a.clone();p.negative!==0?p=p.umod(a):p=p.clone();for(var m=new n(1),y=new n(0),w=new n(0),S=new n(1),g=0;p.isEven()&&h.isEven();)p.iushrn(1),h.iushrn(1),++g;for(var l=h.clone(),x=p.clone();!p.isZero();){for(var R=0,P=1;(p.words[0]&P)===0&&R<26;++R,P<<=1);if(R>0)for(p.iushrn(R);R-- >0;)(m.isOdd()||y.isOdd())&&(m.iadd(l),y.isub(x)),m.iushrn(1),y.iushrn(1);for(var B=0,D=1;(h.words[0]&D)===0&&B<26;++B,D<<=1);if(B>0)for(h.iushrn(B);B-- >0;)(w.isOdd()||S.isOdd())&&(w.iadd(l),S.isub(x)),w.iushrn(1),S.iushrn(1);p.cmp(h)>=0?(p.isub(h),m.isub(w),y.isub(S)):(h.isub(p),w.isub(m),S.isub(y))}return{a:w,b:S,gcd:h.iushln(g)}},n.prototype._invmp=function(a){t(a.negative===0),t(!a.isZero());var p=this,h=a.clone();p.negative!==0?p=p.umod(a):p=p.clone();for(var m=new n(1),y=new n(0),w=h.clone();p.cmpn(1)>0&&h.cmpn(1)>0;){for(var S=0,g=1;(p.words[0]&g)===0&&S<26;++S,g<<=1);if(S>0)for(p.iushrn(S);S-- >0;)m.isOdd()&&m.iadd(w),m.iushrn(1);for(var l=0,x=1;(h.words[0]&x)===0&&l<26;++l,x<<=1);if(l>0)for(h.iushrn(l);l-- >0;)y.isOdd()&&y.iadd(w),y.iushrn(1);p.cmp(h)>=0?(p.isub(h),m.isub(y)):(h.isub(p),y.isub(m))}var R;return p.cmpn(1)===0?R=m:R=y,R.cmpn(0)<0&&R.iadd(a),R},n.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var p=this.clone(),h=a.clone();p.negative=0,h.negative=0;for(var m=0;p.isEven()&&h.isEven();m++)p.iushrn(1),h.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;h.isEven();)h.iushrn(1);var y=p.cmp(h);if(y<0){var w=p;p=h,h=w}else if(y===0||h.cmpn(1)===0)break;p.isub(h)}while(!0);return h.iushln(m)},n.prototype.invm=function(a){return this.egcd(a).a.umod(a)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(a){return this.words[0]&a},n.prototype.bincn=function(a){t(typeof a=="number");var p=a%26,h=(a-p)/26,m=1<<p;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},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(a){var p=a<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this.strip();var h;if(this.length>1)h=1;else{p&&(a=-a),t(a<=67108863,"Number is too big");var m=this.words[0]|0;h=m===a?0:m<a?-1:1}return this.negative!==0?-h|0:h},n.prototype.cmp=function(a){if(this.negative!==0&&a.negative===0)return-1;if(this.negative===0&&a.negative!==0)return 1;var p=this.ucmp(a);return this.negative!==0?-p|0:p},n.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;for(var p=0,h=this.length-1;h>=0;h--){var m=this.words[h]|0,y=a.words[h]|0;if(m!==y){m<y?p=-1:m>y&&(p=1);break}}return p},n.prototype.gtn=function(a){return this.cmpn(a)===1},n.prototype.gt=function(a){return this.cmp(a)===1},n.prototype.gten=function(a){return this.cmpn(a)>=0},n.prototype.gte=function(a){return this.cmp(a)>=0},n.prototype.ltn=function(a){return this.cmpn(a)===-1},n.prototype.lt=function(a){return this.cmp(a)===-1},n.prototype.lten=function(a){return this.cmpn(a)<=0},n.prototype.lte=function(a){return this.cmp(a)<=0},n.prototype.eqn=function(a){return this.cmpn(a)===0},n.prototype.eq=function(a){return this.cmp(a)===0},n.red=function(a){return new q(a)},n.prototype.toRed=function(a){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),a.convertTo(this)._forceRed(a)},n.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(a){return this.red=a,this},n.prototype.forceRed=function(a){return t(!this.red,"Already a number in reduction context"),this._forceRed(a)},n.prototype.redAdd=function(a){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},n.prototype.redIAdd=function(a){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},n.prototype.redSub=function(a){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},n.prototype.redISub=function(a){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},n.prototype.redShl=function(a){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},n.prototype.redMul=function(a){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},n.prototype.redIMul=function(a){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},n.prototype.redSqr=function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(a){return t(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var A={k256:null,p224:null,p192:null,p25519:null};function I(b,a){this.name=b,this.p=new n(a,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}I.prototype._tmp=function(){var a=new n(null);return a.words=new Array(Math.ceil(this.n/13)),a},I.prototype.ireduce=function(a){var p=a,h;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),h=p.bitLength();while(h>this.n);var m=h<this.n?-1:p.ucmp(this.p);return m===0?(p.words[0]=0,p.length=1):m>0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},I.prototype.split=function(a,p){a.iushrn(this.n,0,p)},I.prototype.imulK=function(a){return a.imul(this.k)};function U(){I.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}r(U,I),U.prototype.split=function(a,p){for(var h=4194303,m=Math.min(a.length,9),y=0;y<m;y++)p.words[y]=a.words[y];if(p.length=m,a.length<=9){a.words[0]=0,a.length=1;return}var w=a.words[9];for(p.words[p.length++]=w&h,y=10;y<a.length;y++){var S=a.words[y]|0;a.words[y-10]=(S&h)<<4|w>>>22,w=S}w>>>=22,a.words[y-10]=w,w===0&&a.length>10?a.length-=10:a.length-=9},U.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var p=0,h=0;h<a.length;h++){var m=a.words[h]|0;p+=m*977,a.words[h]=p&67108863,p=m*64+(p/67108864|0)}return a.words[a.length-1]===0&&(a.length--,a.words[a.length-1]===0&&a.length--),a};function Xe(){I.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}r(Xe,I);function te(){I.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}r(te,I);function Le(){I.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}r(Le,I),Le.prototype.imulK=function(a){for(var p=0,h=0;h<a.length;h++){var m=(a.words[h]|0)*19+p,y=m&67108863;m>>>=26,a.words[h]=y,p=m}return p!==0&&(a.words[a.length++]=p),a},n._prime=function(a){if(A[a])return A[a];var p;if(a==="k256")p=new U;else if(a==="p224")p=new Xe;else if(a==="p192")p=new te;else if(a==="p25519")p=new Le;else throw new Error("Unknown prime "+a);return A[a]=p,p};function q(b){if(typeof b=="string"){var a=n._prime(b);this.m=a.p,this.prime=a}else t(b.gtn(1),"modulus must be greater than 1"),this.m=b,this.prime=null}q.prototype._verify1=function(a){t(a.negative===0,"red works only with positives"),t(a.red,"red works only with red numbers")},q.prototype._verify2=function(a,p){t((a.negative|p.negative)===0,"red works only with positives"),t(a.red&&a.red===p.red,"red works only with red numbers")},q.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},q.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},q.prototype.add=function(a,p){this._verify2(a,p);var h=a.add(p);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},q.prototype.iadd=function(a,p){this._verify2(a,p);var h=a.iadd(p);return h.cmp(this.m)>=0&&h.isub(this.m),h},q.prototype.sub=function(a,p){this._verify2(a,p);var h=a.sub(p);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},q.prototype.isub=function(a,p){this._verify2(a,p);var h=a.isub(p);return h.cmpn(0)<0&&h.iadd(this.m),h},q.prototype.shl=function(a,p){return this._verify1(a),this.imod(a.ushln(p))},q.prototype.imul=function(a,p){return this._verify2(a,p),this.imod(a.imul(p))},q.prototype.mul=function(a,p){return this._verify2(a,p),this.imod(a.mul(p))},q.prototype.isqr=function(a){return this.imul(a,a.clone())},q.prototype.sqr=function(a){return this.mul(a,a)},q.prototype.sqrt=function(a){if(a.isZero())return a.clone();var p=this.m.andln(3);if(t(p%2===1),p===3){var h=this.m.add(new n(1)).iushrn(2);return this.pow(a,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 n(1).toRed(this),S=w.redNeg(),g=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new n(2*l*l).toRed(this);this.pow(l,g).cmp(S)!==0;)l.redIAdd(S);for(var x=this.pow(l,m),R=this.pow(a,m.addn(1).iushrn(1)),P=this.pow(a,m),B=y;P.cmp(w)!==0;){for(var D=P,F=0;D.cmp(w)!==0;F++)D=D.redSqr();t(F<B);var V=this.pow(x,new n(1).iushln(B-F-1));R=R.redMul(V),x=V.redSqr(),P=P.redMul(x),B=F}return R},q.prototype.invm=function(a){var p=a._invmp(this.m);return p.negative!==0?(p.negative=0,this.imod(p).redNeg()):this.imod(p)},q.prototype.pow=function(a,p){if(p.isZero())return new n(1).toRed(this);if(p.cmpn(1)===0)return a.clone();var h=4,m=new Array(1<<h);m[0]=new n(1).toRed(this),m[1]=a;for(var y=2;y<m.length;y++)m[y]=this.mul(m[y-1],a);var w=m[0],S=0,g=0,l=p.bitLength()%26;for(l===0&&(l=26),y=p.length-1;y>=0;y--){for(var x=p.words[y],R=l-1;R>=0;R--){var P=x>>R&1;if(w!==m[0]&&(w=this.sqr(w)),P===0&&S===0){g=0;continue}S<<=1,S|=P,g++,!(g!==h&&(y!==0||R!==0))&&(w=this.mul(w,m[S]),g=0,S=0)}l=26}return w},q.prototype.convertTo=function(a){var p=a.umod(this.m);return p===a?p.clone():p},q.prototype.convertFrom=function(a){var p=a.clone();return p.red=null,p},n.mont=function(a){return new qe(a)};function qe(b){q.call(this,b),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(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)}r(qe,q),qe.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},qe.prototype.convertFrom=function(a){var p=this.imod(a.mul(this.rinv));return p.red=null,p},qe.prototype.imul=function(a,p){if(a.isZero()||p.isZero())return a.words[0]=0,a.length=1,a;var h=a.imul(p),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)},qe.prototype.mul=function(a,p){if(a.isZero()||p.isZero())return new n(0)._forceRed(this);var h=a.mul(p),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)},qe.prototype.invm=function(a){var p=this.imod(a._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(typeof Sl>"u"||Sl,iv)});var rv=T((FO,Cl)=>{typeof Object.create=="function"?Cl.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Cl.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}});var wi=T((UO,kl)=>{try{if(Tl=require("util"),typeof Tl.inherits!="function")throw"";kl.exports=Tl.inherits}catch{kl.exports=rv()}var Tl});var io=T((HO,nv)=>{"use strict";var to=require("buffer"),Rr=to.Buffer,Et={},Ct;for(Ct in to)to.hasOwnProperty(Ct)&&(Ct==="SlowBuffer"||Ct==="Buffer"||(Et[Ct]=to[Ct]));var Pr=Et.Buffer={};for(Ct in Rr)Rr.hasOwnProperty(Ct)&&(Ct==="allocUnsafe"||Ct==="allocUnsafeSlow"||(Pr[Ct]=Rr[Ct]));Et.Buffer.prototype=Rr.prototype;(!Pr.from||Pr.from===Uint8Array.from)&&(Pr.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 Rr(i,e,t)});Pr.alloc||(Pr.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 r=Rr(i);return!e||e.length===0?r.fill(0):typeof t=="string"?r.fill(e,t):r.fill(e),r});if(!Et.kStringMaxLength)try{Et.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}Et.constants||(Et.constants={MAX_LENGTH:Et.kMaxLength},Et.kStringMaxLength&&(Et.constants.MAX_STRING_LENGTH=Et.kStringMaxLength));nv.exports=Et});var ro=T(sv=>{"use strict";var uE=wi();function Tt(i){this._reporterState={obj:null,path:[],options:i||{},errors:[]}}sv.Reporter=Tt;Tt.prototype.isError=function(e){return e instanceof Br};Tt.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};Tt.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)};Tt.prototype.enterKey=function(e){return this._reporterState.path.push(e)};Tt.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)};Tt.prototype.leaveKey=function(e,t,r){let n=this._reporterState;this.exitKey(e),n.obj!==null&&(n.obj[t]=r)};Tt.prototype.path=function(){return this._reporterState.path.join("/")};Tt.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t};Tt.prototype.leaveObject=function(e){let t=this._reporterState,r=t.obj;return t.obj=e,r};Tt.prototype.error=function(e){let t,r=this._reporterState,n=e instanceof Br;if(n?t=e:t=new Br(r.path.map(function(s){return"["+JSON.stringify(s)+"]"}).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.errors.push(t),t};Tt.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};function Br(i,e){this.path=i,this.rethrow(e)}uE(Br,Error);Br.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Br),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}});var Dr=T(Ml=>{"use strict";var pE=wi(),no=ro().Reporter,Nr=io().Buffer;function kt(i,e){if(no.call(this,e),!Nr.isBuffer(i)){this.error("Input not Buffer");return}this.base=i,this.offset=0,this.length=i.length}pE(kt,no);Ml.DecoderBuffer=kt;kt.isDecoderBuffer=function(e){return e instanceof kt?!0:typeof e=="object"&&Nr.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:no.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,no.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 r=new kt(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r};kt.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function Ir(i,e){if(Array.isArray(i))this.length=0,this.value=i.map(function(t){return Ir.isEncoderBuffer(t)||(t=new Ir(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=Nr.byteLength(i);else if(Nr.isBuffer(i))this.value=i,this.length=i.length;else return e.error("Unsupported type: "+typeof i)}Ml.EncoderBuffer=Ir;Ir.isEncoderBuffer=function(e){return e instanceof Ir?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};Ir.prototype.join=function(e,t){return e||(e=Nr.alloc(this.length)),t||(t=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(r){r.join(e,t),t+=r.length}):(typeof this.value=="number"?e[t]=this.value:typeof this.value=="string"?e.write(this.value,t):Nr.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}});var cv=T(($O,av)=>{av.exports=ov;function ov(i,e){if(!i)throw new Error(e||"Assertion failed")}ov.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}});var so=T((VO,uv)=>{"use strict";var dE=ro().Reporter,fE=Dr().EncoderBuffer,hE=Dr().DecoderBuffer,et=cv(),lv=["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"],mE=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(lv),vE=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function W(i,e,t){let r={};this._baseState=r,r.name=t,r.enc=i,r.parent=e||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}uv.exports=W;var gE=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];W.prototype.clone=function(){let e=this._baseState,t={};gE.forEach(function(n){t[n]=e[n]});let r=new this.constructor(t.parent);return r._baseState=t,r};W.prototype._wrap=function(){let e=this._baseState;mE.forEach(function(t){this[t]=function(){let n=new this.constructor(this);return e.children.push(n),n[t].apply(n,arguments)}},this)};W.prototype._init=function(e){let t=this._baseState;et(t.parent===null),e.call(this),t.children=t.children.filter(function(r){return r._baseState.parent===this},this),et.equal(t.children.length,1,"Root node can have only one child")};W.prototype._useArgs=function(e){let t=this._baseState,r=e.filter(function(n){return n instanceof this.constructor},this);e=e.filter(function(n){return!(n instanceof this.constructor)},this),r.length!==0&&(et(t.children===null),t.children=r,r.forEach(function(n){n._baseState.parent=this},this)),e.length!==0&&(et(t.args===null),t.args=e,t.reverseArgs=e.map(function(n){if(typeof n!="object"||n.constructor!==Object)return n;let s={};return Object.keys(n).forEach(function(o){o==(o|0)&&(o|=0);let c=n[o];s[c]=o}),s}))};vE.forEach(function(i){W.prototype[i]=function(){let t=this._baseState;throw new Error(i+" not implemented for encoding: "+t.enc)}});lv.forEach(function(i){W.prototype[i]=function(){let t=this._baseState,r=Array.prototype.slice.call(arguments);return et(t.tag===null),t.tag=i,this._useArgs(r),this}});W.prototype.use=function(e){et(e);let t=this._baseState;return et(t.use===null),t.use=e,this};W.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};W.prototype.def=function(e){let t=this._baseState;return et(t.default===null),t.default=e,t.optional=!0,this};W.prototype.explicit=function(e){let t=this._baseState;return et(t.explicit===null&&t.implicit===null),t.explicit=e,this};W.prototype.implicit=function(e){let t=this._baseState;return et(t.explicit===null&&t.implicit===null),t.implicit=e,this};W.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this};W.prototype.key=function(e){let t=this._baseState;return et(t.key===null),t.key=e,this};W.prototype.any=function(){let e=this._baseState;return e.any=!0,this};W.prototype.choice=function(e){let t=this._baseState;return et(t.choice===null),t.choice=e,this._useArgs(Object.keys(e).map(function(r){return e[r]})),this};W.prototype.contains=function(e){let t=this._baseState;return et(t.use===null),t.contains=e,this};W.prototype._decode=function(e,t){let r=this._baseState;if(r.parent===null)return e.wrapResult(r.children[0]._decode(e,t));let n=r.default,s=!0,o=null;if(r.key!==null&&(o=e.enterKey(r.key)),r.optional){let u=null;if(r.explicit!==null?u=r.explicit:r.implicit!==null?u=r.implicit:r.tag!==null&&(u=r.tag),u===null&&!r.any){let d=e.save();try{r.choice===null?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),s=!0}catch{s=!1}e.restore(d)}else if(s=this._peekTag(e,u,r.any),e.isError(s))return s}let c;if(r.obj&&s&&(c=e.enterObject()),s){if(r.explicit!==null){let d=this._decodeTag(e,r.explicit);if(e.isError(d))return d;e=d}let u=e.offset;if(r.use===null&&r.choice===null){let d;r.any&&(d=e.save());let f=this._decodeTag(e,r.implicit!==null?r.implicit:r.tag,r.any);if(e.isError(f))return f;r.any?n=e.raw(d):e=f}if(t&&t.track&&r.tag!==null&&t.track(e.path(),u,e.length,"tagged"),t&&t.track&&r.tag!==null&&t.track(e.path(),e.offset,e.length,"content"),r.any||(r.choice===null?n=this._decodeGeneric(r.tag,e,t):n=this._decodeChoice(e,t)),e.isError(n))return n;if(!r.any&&r.choice===null&&r.children!==null&&r.children.forEach(function(f){f._decode(e,t)}),r.contains&&(r.tag==="octstr"||r.tag==="bitstr")){let d=new hE(n);n=this._getUse(r.contains,e._reporterState.obj)._decode(d,t)}}return r.obj&&s&&(n=e.leaveObject(c)),r.key!==null&&(n!==null||s===!0)?e.leaveKey(o,r.key,n):o!==null&&e.exitKey(o),n};W.prototype._decodeGeneric=function(e,t,r){let n=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(t,e,n.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):e==="objid"&&n.args?this._decodeObjid(t,n.args[0],n.args[1],r):e==="objid"?this._decodeObjid(t,null,null,r):e==="gentime"||e==="utctime"?this._decodeTime(t,e,r):e==="null_"?this._decodeNull(t,r):e==="bool"?this._decodeBool(t,r):e==="objDesc"?this._decodeStr(t,e,r):e==="int"||e==="enum"?this._decodeInt(t,n.args&&n.args[0],r):n.use!==null?this._getUse(n.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)};W.prototype._getUse=function(e,t){let r=this._baseState;return r.useDecoder=this._use(e,t),et(r.useDecoder._baseState.parent===null),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder};W.prototype._decodeChoice=function(e,t){let r=this._baseState,n=null,s=!1;return Object.keys(r.choice).some(function(o){let c=e.save(),u=r.choice[o];try{let d=u._decode(e,t);if(e.isError(d))return!1;n={type:o,value:d},s=!0}catch{return e.restore(c),!1}return!0},this),s?n:e.error("Choice not matched")};W.prototype._createEncoderBuffer=function(e){return new fE(e,this.reporter)};W.prototype._encode=function(e,t,r){let n=this._baseState;if(n.default!==null&&n.default===e)return;let s=this._encodeValue(e,t,r);if(s!==void 0&&!this._skipDefault(s,t,r))return s};W.prototype._encodeValue=function(e,t,r){let n=this._baseState;if(n.parent===null)return n.children[0]._encode(e,t||new dE);let s=null;if(this.reporter=t,n.optional&&e===void 0)if(n.default!==null)e=n.default;else return;let o=null,c=!1;if(n.any)s=this._createEncoderBuffer(e);else if(n.choice)s=this._encodeChoice(e,t);else if(n.contains)o=this._getUse(n.contains,r)._encode(e,t),c=!0;else if(n.children)o=n.children.map(function(u){if(u._baseState.tag==="null_")return u._encode(null,t,e);if(u._baseState.key===null)return t.error("Child should have a key");let d=t.enterKey(u._baseState.key);if(typeof e!="object")return t.error("Child expected, but input is not object");let f=u._encode(e[u._baseState.key],t,e);return t.leaveKey(d),f},this).filter(function(u){return u}),o=this._createEncoderBuffer(o);else if(n.tag==="seqof"||n.tag==="setof"){if(!(n.args&&n.args.length===1))return t.error("Too many args for : "+n.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");let u=this.clone();u._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(d){let f=this._baseState;return this._getUse(f.args[0],e)._encode(d,t)},u))}else n.use!==null?s=this._getUse(n.use,r)._encode(e,t):(o=this._encodePrimitive(n.tag,e),c=!0);if(!n.any&&n.choice===null){let u=n.implicit!==null?n.implicit:n.tag,d=n.implicit===null?"universal":"context";u===null?n.use===null&&t.error("Tag could be omitted only for .use()"):n.use===null&&(s=this._encodeComposite(u,c,d,o))}return n.explicit!==null&&(s=this._encodeComposite(n.explicit,!1,"context",s)),s};W.prototype._encodeChoice=function(e,t){let r=this._baseState,n=r.choice[e.type];return n||et(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)};W.prototype._encodePrimitive=function(e,t){let r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if(e==="objid"&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.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,r.args&&r.reverseArgs[0]);if(e==="bool")return this._encodeBool(t);if(e==="objDesc")return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)};W.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};W.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var oo=T(Fi=>{"use strict";function pv(i){let e={};return Object.keys(i).forEach(function(t){(t|0)==t&&(t=t|0);let r=i[t];e[r]=t}),e}Fi.tagClass={0:"universal",1:"application",2:"context",3:"private"};Fi.tagClassByName=pv(Fi.tagClass);Fi.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"};Fi.tagByName=pv(Fi.tag)});var Al=T((GO,hv)=>{"use strict";var xE=wi(),ai=io().Buffer,dv=so(),Ol=oo();function fv(i){this.enc="der",this.name=i.name,this.entity=i,this.tree=new jt,this.tree._init(i.body)}hv.exports=fv;fv.prototype.encode=function(e,t){return this.tree._encode(e,t).join()};function jt(i){dv.call(this,"der",i)}xE(jt,dv);jt.prototype._encodeComposite=function(e,t,r,n){let s=yE(e,t,r,this.reporter);if(n.length<128){let u=ai.alloc(2);return u[0]=s,u[1]=n.length,this._createEncoderBuffer([u,n])}let o=1;for(let u=n.length;u>=256;u>>=8)o++;let c=ai.alloc(2+o);c[0]=s,c[1]=128|o;for(let u=1+o,d=n.length;d>0;u--,d>>=8)c[u]=d&255;return this._createEncoderBuffer([c,n])};jt.prototype._encodeStr=function(e,t){if(t==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(t==="bmpstr"){let r=ai.alloc(e.length*2);for(let n=0;n<e.length;n++)r.writeUInt16BE(e.charCodeAt(n),n*2);return this._createEncoderBuffer(r)}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,r){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 c=0;c<e.length;c++)e[c]|=0}else if(Array.isArray(e)){e=e.slice();for(let c=0;c<e.length;c++)e[c]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!r){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}let n=0;for(let c=0;c<e.length;c++){let u=e[c];for(n++;u>=128;u>>=7)n++}let s=ai.alloc(n),o=s.length-1;for(let c=e.length-1;c>=0;c--){let u=e[c];for(s[o--]=u&127;(u>>=7)>0;)s[o--]=128|u&127}return this._createEncoderBuffer(s)};function Mt(i){return i<10?"0"+i:i}jt.prototype._encodeTime=function(e,t){let r,n=new Date(e);return t==="gentime"?r=[Mt(n.getUTCFullYear()),Mt(n.getUTCMonth()+1),Mt(n.getUTCDate()),Mt(n.getUTCHours()),Mt(n.getUTCMinutes()),Mt(n.getUTCSeconds()),"Z"].join(""):t==="utctime"?r=[Mt(n.getUTCFullYear()%100),Mt(n.getUTCMonth()+1),Mt(n.getUTCDate()),Mt(n.getUTCHours()),Mt(n.getUTCMinutes()),Mt(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"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"&&!ai.isBuffer(e)){let s=e.toArray();!e.sign&&s[0]&128&&s.unshift(0),e=ai.from(s)}if(ai.isBuffer(e)){let s=e.length;e.length===0&&s++;let o=ai.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 r=1;for(let s=e;s>=256;s>>=8)r++;let n=new Array(r);for(let s=n.length-1;s>=0;s--)n[s]=e&255,e>>=8;return n[0]&128&&n.unshift(0),this._createEncoderBuffer(ai.from(n))};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,r){let n=this._baseState,s;if(n.default===null)return!1;let o=e.join();if(n.defaultBuffer===void 0&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),o.length!==n.defaultBuffer.length)return!1;for(s=0;s<o.length;s++)if(o[s]!==n.defaultBuffer[s])return!1;return!0};function yE(i,e,t,r){let n;if(i==="seqof"?i="seq":i==="setof"&&(i="set"),Ol.tagByName.hasOwnProperty(i))n=Ol.tagByName[i];else if(typeof i=="number"&&(i|0)===i)n=i;else return r.error("Unknown tag: "+i);return n>=31?r.error("Multi-octet tag encoding unsupported"):(e||(n|=32),n|=Ol.tagClassByName[t||"universal"]<<6,n)}});var vv=T((YO,mv)=>{"use strict";var bE=wi(),Rl=Al();function Pl(i){Rl.call(this,i),this.enc="pem"}bE(Pl,Rl);mv.exports=Pl;Pl.prototype.encode=function(e,t){let n=Rl.prototype.encode.call(this,e).toString("base64"),s=["-----BEGIN "+t.label+"-----"];for(let o=0;o<n.length;o+=64)s.push(n.slice(o,o+64));return s.push("-----END "+t.label+"-----"),s.join(`
|
|
21
|
-
`)}});var Bl=T(xv=>{"use strict";var gv=xv;gv.der=Al();gv.pem=vv()});var Il=T((XO,Ev)=>{"use strict";var wE=wi(),_E=El(),yv=Dr().DecoderBuffer,wv=so(),bv=oo();function _v(i){this.enc="der",this.name=i.name,this.entity=i,this.tree=new ft,this.tree._init(i.body)}Ev.exports=_v;_v.prototype.decode=function(e,t){return yv.isDecoderBuffer(e)||(e=new yv(e,t)),this.tree._decode(e,t)};function ft(i){wv.call(this,"der",i)}wE(ft,wv);ft.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;let n=e.save(),s=Nl(e,'Failed to peek tag: "'+t+'"');return e.isError(s)?s:(e.restore(n),s.tag===t||s.tagStr===t||s.tagStr+"of"===t||r)};ft.prototype._decodeTag=function(e,t,r){let n=Nl(e,'Failed to decode tag of "'+t+'"');if(e.isError(n))return n;let s=Sv(e,n.primitive,'Failed to get length of "'+t+'"');if(e.isError(s))return s;if(!r&&n.tag!==t&&n.tagStr!==t&&n.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(n.primitive||s!==null)return e.skip(s,'Failed to match body of: "'+t+'"');let o=e.save(),c=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(c)?c:(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 r=Nl(e,t);if(e.isError(r))return r;let n=Sv(e,r.primitive,t);if(e.isError(n))return n;let s;if(r.primitive||n!==null?s=e.skip(n):s=this._skipUntilEnd(e,t),e.isError(s))return s;if(r.tagStr==="end")break}};ft.prototype._decodeList=function(e,t,r,n){let s=[];for(;!e.isEmpty();){let o=this._peekTag(e,"end");if(e.isError(o))return o;let c=r.decode(e,"der",n);if(e.isError(c)&&o)break;s.push(c)}return s};ft.prototype._decodeStr=function(e,t){if(t==="bitstr"){let r=e.readUInt8();return e.isError(r)?r:{unused:r,data:e.raw()}}else if(t==="bmpstr"){let r=e.raw();if(r.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");let n="";for(let s=0;s<r.length/2;s++)n+=String.fromCharCode(r.readUInt16BE(s*2));return n}else if(t==="numstr"){let r=e.raw().toString("ascii");return this._isNumstr(r)?r: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 r=e.raw().toString("ascii");return this._isPrintstr(r)?r: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,r){let n,s=[],o=0,c=0;for(;!e.isEmpty();)c=e.readUInt8(),o<<=7,o|=c&127,(c&128)===0&&(s.push(o),o=0);c&128&&s.push(o);let u=s[0]/40|0,d=s[0]%40;if(r?n=s:n=[u,d].concat(s.slice(1)),t){let f=t[n.join(" ")];f===void 0&&(f=t[n.join(".")]),f!==void 0&&(n=f)}return n};ft.prototype._decodeTime=function(e,t){let r=e.raw().toString(),n,s,o,c,u,d;if(t==="gentime")n=r.slice(0,4)|0,s=r.slice(4,6)|0,o=r.slice(6,8)|0,c=r.slice(8,10)|0,u=r.slice(10,12)|0,d=r.slice(12,14)|0;else if(t==="utctime")n=r.slice(0,2)|0,s=r.slice(2,4)|0,o=r.slice(4,6)|0,c=r.slice(6,8)|0,u=r.slice(8,10)|0,d=r.slice(10,12)|0,n<70?n=2e3+n:n=1900+n;else return e.error("Decoding "+t+" time is not supported yet");return Date.UTC(n,s-1,o,c,u,d,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 r=e.raw(),n=new _E(r);return t&&(n=t[n.toString(10)]||n),n};ft.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getDecoder("der").tree};function Nl(i,e){let t=i.readUInt8(e);if(i.isError(t))return t;let r=bv.tagClass[t>>6],n=(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=bv.tag[t];return{cls:r,primitive:n,tag:t,tagStr:s}}function Sv(i,e,t){let r=i.readUInt8(t);if(i.isError(r))return r;if(!e&&r===128)return null;if((r&128)===0)return r;let n=r&127;if(n>4)return i.error("length octect is too long");r=0;for(let s=0;s<n;s++){r<<=8;let o=i.readUInt8(t);if(i.isError(o))return o;r|=o}return r}});var Tv=T((ZO,Cv)=>{"use strict";var SE=wi(),EE=io().Buffer,Dl=Il();function jl(i){Dl.call(this,i),this.enc="pem"}SE(jl,Dl);Cv.exports=jl;jl.prototype.decode=function(e,t){let r=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,c=-1;for(let f=0;f<r.length;f++){let v=r[f].match(s);if(v!==null&&v[2]===n)if(o===-1){if(v[1]!=="BEGIN")break;o=f}else{if(v[1]!=="END")break;c=f;break}}if(o===-1||c===-1)throw new Error("PEM section not found for: "+n);let u=r.slice(o+1,c).join("");u.replace(/[^a-z0-9+/=]+/gi,"");let d=EE.from(u,"base64");return Dl.prototype.decode.call(this,d,t)}});var Ll=T(Mv=>{"use strict";var kv=Mv;kv.der=Il();kv.pem=Tv()});var Av=T(Ov=>{"use strict";var CE=Bl(),TE=Ll(),kE=wi(),ME=Ov;ME.define=function(e,t){return new jr(e,t)};function jr(i,e){this.name=i,this.body=e,this.decoders={},this.encoders={}}jr.prototype._createNamed=function(e){let t=this.name;function r(n){this._initNamed(n,t)}return kE(r,e),r.prototype._initNamed=function(s,o){e.call(this,s,o)},new r(this)};jr.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(TE[e])),this.decoders[e]};jr.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)};jr.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(CE[e])),this.encoders[e]};jr.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}});var Pv=T(Rv=>{"use strict";var ao=Rv;ao.Reporter=ro().Reporter;ao.DecoderBuffer=Dr().DecoderBuffer;ao.EncoderBuffer=Dr().EncoderBuffer;ao.Node=so()});var Iv=T(Nv=>{"use strict";var Bv=Nv;Bv._reverse=function(e){let t={};return Object.keys(e).forEach(function(r){(r|0)==r&&(r=r|0);let n=e[r];t[n]=r}),t};Bv.der=oo()});var jv=T(Dv=>{"use strict";var Lr=Dv;Lr.bignum=El();Lr.define=Av().define;Lr.base=Pv();Lr.constants=Iv();Lr.decoders=Ll();Lr.encoders=Bl()});var qr=T((ql,qv)=>{var co=require("buffer"),Kt=co.Buffer;function Lv(i,e){for(var t in i)e[t]=i[t]}Kt.from&&Kt.alloc&&Kt.allocUnsafe&&Kt.allocUnsafeSlow?qv.exports=co:(Lv(co,ql),ql.Buffer=Ui);function Ui(i,e,t){return Kt(i,e,t)}Ui.prototype=Object.create(Kt.prototype);Lv(Kt,Ui);Ui.from=function(i,e,t){if(typeof i=="number")throw new TypeError("Argument must not be a number");return Kt(i,e,t)};Ui.alloc=function(i,e,t){if(typeof i!="number")throw new TypeError("Argument must be a number");var r=Kt(i);return e!==void 0?typeof t=="string"?r.fill(e,t):r.fill(e):r.fill(0),r};Ui.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return Kt(i)};Ui.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return co.SlowBuffer(i)}});var Fl=T((nA,Fv)=>{var lo=qr().Buffer,OE=require("stream"),AE=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+")")}AE.inherits(uo,OE);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};Fv.exports=uo});var Hv=T((sA,Uv)=>{"use strict";function Ul(i){var e=(i/8|0)+(i%8===0?0:1);return e}var RE={ES256:Ul(256),ES384:Ul(384),ES512:Ul(521)};function PE(i){var e=RE[i];if(e)return e;throw new Error('Unknown algorithm "'+i+'"')}Uv.exports=PE});var Yv=T((oA,Gv)=>{"use strict";var po=qr().Buffer,Wv=Hv(),fo=128,$v=0,BE=32,NE=16,IE=2,Vv=NE|BE|$v<<6,ho=IE|$v<<6;function DE(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Kv(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 jE(i,e){i=Kv(i);var t=Wv(e),r=t+1,n=i.length,s=0;if(i[s++]!==Vv)throw new Error('Could not find expected "seq"');var o=i[s++];if(o===(fo|1)&&(o=i[s++]),n-s<o)throw new Error('"seq" specified length of "'+o+'", only "'+(n-s)+'" remaining');if(i[s++]!==ho)throw new Error('Could not find expected "int" for "r"');var c=i[s++];if(n-s-2<c)throw new Error('"r" specified length of "'+c+'", only "'+(n-s-2)+'" available');if(r<c)throw new Error('"r" specified length of "'+c+'", max of "'+r+'" is acceptable');var u=s;if(s+=c,i[s++]!==ho)throw new Error('Could not find expected "int" for "s"');var d=i[s++];if(n-s!==d)throw new Error('"s" specified length of "'+d+'", expected "'+(n-s)+'"');if(r<d)throw new Error('"s" specified length of "'+d+'", max of "'+r+'" is acceptable');var f=s;if(s+=d,s!==n)throw new Error('Expected to consume entire buffer, but "'+(n-s)+'" bytes remain');var v=t-c,_=t-d,E=po.allocUnsafe(v+c+_+d);for(s=0;s<v;++s)E[s]=0;i.copy(E,s,u+Math.max(-v,0),u+c),s=t;for(var C=s;s<C+_;++s)E[s]=0;return i.copy(E,s,f+Math.max(-_,0),f+d),E=E.toString("base64"),E=DE(E),E}function zv(i,e,t){for(var r=0;e+r<t&&i[e+r]===0;)++r;var n=i[e+r]>=fo;return n&&--r,r}function LE(i,e){i=Kv(i);var t=Wv(e),r=i.length;if(r!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+r+'"');var n=zv(i,0,t),s=zv(i,t,i.length),o=t-n,c=t-s,u=2+o+1+1+c,d=u<fo,f=po.allocUnsafe((d?2:3)+u),v=0;return f[v++]=Vv,d?f[v++]=u:(f[v++]=fo|1,f[v++]=u&255),f[v++]=ho,f[v++]=o,n<0?(f[v++]=0,v+=i.copy(f,v,0,t)):v+=i.copy(f,v,n,t),f[v++]=ho,f[v++]=c,s<0?(f[v++]=0,i.copy(f,v,t)):i.copy(f,v,t+s),f}Gv.exports={derToJose:jE,joseToDer:LE}});var Xv=T((aA,Jv)=>{"use strict";var mn=require("buffer").Buffer,Hl=require("buffer").SlowBuffer;Jv.exports=mo;function mo(i,e){if(!mn.isBuffer(i)||!mn.isBuffer(e)||i.length!==e.length)return!1;for(var t=0,r=0;r<i.length;r++)t|=i[r]^e[r];return t===0}mo.install=function(){mn.prototype.equal=Hl.prototype.equal=function(e){return mo(this,e)}};var qE=mn.prototype.equal,FE=Hl.prototype.equal;mo.restore=function(){mn.prototype.equal=qE,Hl.prototype.equal=FE}});var Vl=T((cA,og)=>{var Ur=qr().Buffer,Ot=require("crypto"),Qv=Yv(),Zv=require("util"),UE=`"%s" is not a valid algorithm.
|
|
20
|
+
`+r)}i.destroy()}var on=[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 tS(i){if(i+="",i.length<1)return!1;if(!on[i.charCodeAt(0)])return j('invalid header, index 0, char "%s"',i.charCodeAt(0)),!0;if(i.length<2)return!1;if(!on[i.charCodeAt(1)])return j('invalid header, index 1, char "%s"',i.charCodeAt(1)),!0;if(i.length<3)return!1;if(!on[i.charCodeAt(2)])return j('invalid header, index 2, char "%s"',i.charCodeAt(2)),!0;if(i.length<4)return!1;if(!on[i.charCodeAt(3)])return j('invalid header, index 3, char "%s"',i.charCodeAt(3)),!0;for(let e=4;e<i.length;++e)if(!on[i.charCodeAt(e)])return j('invalid header, index "%i", char "%s"',e,i.charCodeAt(e)),!0;return!1}});var Gf=T(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.Polling=void 0;var iS=Ti(),Kf=require("zlib"),rS=jn(),nS=ie(),yt=(0,nS.default)("engine:polling"),sS={gzip:Kf.createGzip,deflate:Kf.createDeflate},wc=class extends iS.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 r=()=>{this.writable=!1,this.onError("poll connection closed prematurely")},n=()=>{this.req=this.res=null};e.cleanup=n,t.onAborted(r),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 r=Number(e.headers["content-length"]);if(!r){this.onError("content-length header required"),t.writeStatus("411 Length Required").end();return}if(r>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,c={"Content-Type":"text/html"};this.headers(e,c);for(let d in c)t.writeHeader(d,String(c[d]));let u=d=>{this.onData(d.toString()),this.onDataRequestCleanup(),t.cork(()=>{t.end("ok")})};t.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),t.onData((d,f)=>{let v=o+d.byteLength;if(v>r){this.onError("content-length mismatch"),t.close();return}if(!s){if(f){u(Buffer.from(d));return}s=Buffer.allocUnsafe(r)}if(Buffer.from(d).copy(s,o),f){if(v!=r){this.onError("content-length mismatch"),t.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}u(s);return}o=v})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(e){yt('received "%s"',e);let t=r=>{if(r.type==="close")return yt("got xhr close packet"),this.onClose(),!1;this.onPacket(r)};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=r=>{let n=e.some(s=>s.options&&s.options.compress);this.write(r,{compress:n})};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,r){let n=typeof e=="string",o={"Content-Type":n?"text/plain; charset=UTF-8":"application/octet-stream"},c=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)}),r()};if(!this.httpCompression||!t.compress){c(e);return}if((n?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){c(e);return}let d=rS(this.req).encodings(["gzip","deflate"]);if(!d){c(e);return}this.compress(e,d,(f,v)=>{if(f){this.res.writeStatus("500 Internal Server Error"),this.res.end(),r(f);return}o["Content-Encoding"]=d,c(v)})}compress(e,t,r){yt("compressing");let n=[],s=0;sS[t](this.httpCompression).on("error",r).on("data",function(o){n.push(o),s+=o.length}).on("end",function(){r(null,Buffer.concat(n,s))}).end(e)}doClose(e){yt("closing");let t,r=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(yt("transport writable - closing right away"),this.send([{type:"close"}]),r()):this.discarded?(yt("transport discarded - closing right away"),r()):(yt("transport not writable - buffering orderly close"),this.shouldClose=r,t=setTimeout(r,this.closeTimeout))}headers(e,t){t=t||{};let r=e.headers["user-agent"];return r&&(~r.indexOf(";MSIE")||~r.indexOf("Trident/"))&&(t["X-XSS-Protection"]="0"),t["cache-control"]="no-store",this.emit("headers",t,e),t}};vs.Polling=wc});var Jf=T(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.WebSocket=void 0;var oS=Ti(),aS=ie(),Yf=(0,aS.default)("engine:ws"),_c=class extends oS.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 r=e[t],n=t+1===e.length,s=o=>{let c=typeof o!="string",u=this.perMessageDeflate&&Buffer.byteLength(o)>this.perMessageDeflate.threshold;Yf('writing "%s"',o),this.socket.send(o,c,u),n&&(this.emit("drain"),this.writable=!0,this.emit("ready"))};r.options&&typeof r.options.wsPreEncoded=="string"?s(r.options.wsPreEncoded):this.parser.encodePacket(r,this.supportsBinary,s)}}doClose(e){Yf("closing"),e&&e(),this.socket.end()}};gs.WebSocket=_c});var Xf=T(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});var cS=Gf(),lS=Jf();Sc.default={polling:cS.Polling,websocket:lS.WebSocket}});var Zf=T(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.uServer=void 0;var uS=ie(),Pi=bc(),pS=Xf(),gi=(0,uS.default)("engine:uws"),Ec=class extends Pi.BaseServer{init(){}cleanup(){}prepare(e,t){e.method=e.getMethod().toUpperCase(),e.url=e.getUrl();let r=new URLSearchParams(e.getQuery());e._query=Object.fromEntries(r.entries()),e.headers={},e.forEach((n,s)=>{e.headers[n]=s}),e.connection={remoteAddress:Buffer.from(t.getRemoteAddressAsText()).toString()},t.onAborted(()=>{gi("response has been aborted")})}createTransport(e,t){return new pS.default[e](t)}attach(e,t={}){let r=this._computePath(t);e.any(r,this.handleRequest.bind(this)).ws(r,{compression:t.compression,idleTimeout:t.idleTimeout,maxBackpressure:t.maxBackpressure,maxPayloadLength:this.opts.maxHttpBufferSize,upgrade:this.handleUpgrade.bind(this),open:n=>{let s=n.getUserData().transport;s.socket=n,s.writable=!0,s.emit("ready")},message:(n,s,o)=>{n.getUserData().transport.onData(o?s:Buffer.from(s).toString())},close:(n,s,o)=>{n.getUserData().transport.onClose(s,o)}})}_applyMiddlewares(e,t,r){if(this.middlewares.length===0)return r();e.res=new Cc(t),super._applyMiddlewares(e,e.res,n=>{e.res.writeHead(),r(n)})}handleRequest(e,t){gi('handling "%s" http request "%s"',t.getMethod(),t.getUrl()),this.prepare(t,e),t.res=e;let r=(n,s)=>{if(n!==void 0){this.emit("connection_error",{req:t,code:n,message:Pi.Server.errorMessages[n],context:s}),this.abortRequest(t.res,n,s);return}if(t._query.sid)gi("setting new request for existing client"),this.clients[t._query.sid].transport.onRequest(t);else{let o=(c,u)=>this.abortRequest(e,c,u);this.handshake(t._query.transport,t,o)}};this._applyMiddlewares(t,e,n=>{n?r(Pi.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,r)})}handleUpgrade(e,t,r){gi("on upgrade"),this.prepare(t,e),t.res=e;let n=async(s,o)=>{if(s!==void 0){this.emit("connection_error",{req:t,code:s,message:Pi.Server.errorMessages[s],context:o}),this.abortRequest(e,s,o);return}let c=t._query.sid,u;if(c){let d=this.clients[c];if(d){if(d.upgrading)return gi("transport has already been trying to upgrade"),e.close();if(d.upgraded)return gi("transport had already been upgraded"),e.close();gi("upgrading existing transport"),u=this.createTransport(t._query.transport,t),d._maybeUpgrade(u)}else return gi("upgrade attempt for closed client"),e.close()}else if(u=await this.handshake(t._query.transport,t,(d,f)=>this.abortRequest(e,d,f)),!u)return;t.res.writeStatus("101 Switching Protocols"),e.upgrade({transport:u},t.getHeader("sec-websocket-key"),t.getHeader("sec-websocket-protocol"),t.getHeader("sec-websocket-extensions"),r)};this._applyMiddlewares(t,e,s=>{s?n(Pi.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,n)})}abortRequest(e,t,r){let n=t===Pi.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",s=r&&r.message?r.message:Pi.Server.errorMessages[t];e.writeStatus(n),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:s}))}};xs.uServer=Ec;var Cc=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(r=>{this.writeHeader(e,r)}):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 ih=T(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.protocol=We.Transport=We.Socket=We.uServer=We.parser=We.transports=We.Server=void 0;We.listen=gS;We.attach=th;var dS=require("http"),Qf=bc();Object.defineProperty(We,"Server",{enumerable:!0,get:function(){return Qf.Server}});var fS=Ia();We.transports=fS.default;var eh=Jr();We.parser=eh;var hS=Zf();Object.defineProperty(We,"uServer",{enumerable:!0,get:function(){return hS.uServer}});var mS=ja();Object.defineProperty(We,"Socket",{enumerable:!0,get:function(){return mS.Socket}});var vS=Ti();Object.defineProperty(We,"Transport",{enumerable:!0,get:function(){return vS.Transport}});We.protocol=eh.protocol;function gS(i,e,t){typeof e=="function"&&(t=e,e={});let r=(0,dS.createServer)(function(s,o){o.writeHead(501),o.end("Not Implemented")}),n=th(r,e);return n.httpServer=r,r.listen(i,t),n}function th(i,e){let t=new Qf.Server(e);return t.attach(i,e),t}});var nh=T(rh=>{rh.Emitter=Ze;function Ze(i){if(i)return xS(i)}function xS(i){for(var e in Ze.prototype)i[e]=Ze.prototype[e];return i}Ze.prototype.on=Ze.prototype.addEventListener=function(i,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(e),this};Ze.prototype.once=function(i,e){function t(){this.off(i,t),e.apply(this,arguments)}return t.fn=e,this.on(i,t),this};Ze.prototype.off=Ze.prototype.removeListener=Ze.prototype.removeAllListeners=Ze.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 r,n=0;n<t.length;n++)if(r=t[n],r===e||r.fn===e){t.splice(n,1);break}return t.length===0&&delete this._callbacks["$"+i],this};Ze.prototype.emit=function(i){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+i],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(t){t=t.slice(0);for(var r=0,n=t.length;r<n;++r)t[r].apply(this,e)}return this};Ze.prototype.emitReserved=Ze.prototype.emit;Ze.prototype.listeners=function(i){return this._callbacks=this._callbacks||{},this._callbacks["$"+i]||[]};Ze.prototype.hasListeners=function(i){return!!this.listeners(i).length}});var Tc=T(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.isBinary=oh;bs.hasBinary=ys;var yS=typeof ArrayBuffer=="function",bS=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i.buffer instanceof ArrayBuffer,sh=Object.prototype.toString,wS=typeof Blob=="function"||typeof Blob<"u"&&sh.call(Blob)==="[object BlobConstructor]",_S=typeof File=="function"||typeof File<"u"&&sh.call(File)==="[object FileConstructor]";function oh(i){return yS&&(i instanceof ArrayBuffer||bS(i))||wS&&i instanceof Blob||_S&&i instanceof File}function ys(i,e){if(!i||typeof i!="object")return!1;if(Array.isArray(i)){for(let t=0,r=i.length;t<r;t++)if(ys(i[t]))return!0;return!1}if(oh(i))return!0;if(i.toJSON&&typeof i.toJSON=="function"&&arguments.length===1)return ys(i.toJSON(),!0);for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)&&ys(i[t]))return!0;return!1}});var ah=T(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.deconstructPacket=ES;ws.reconstructPacket=CS;var SS=Tc();function ES(i){let e=[],t=i.data,r=i;return r.data=kc(t,e),r.attachments=e.length,{packet:r,buffers:e}}function kc(i,e){if(!i)return i;if((0,SS.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 r=0;r<i.length;r++)t[r]=kc(i[r],e);return t}else if(typeof i=="object"&&!(i instanceof Date)){let t={};for(let r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=kc(i[r],e));return t}return i}function CS(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 an=T(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.Decoder=Bt.Encoder=Bt.PacketType=Bt.protocol=void 0;Bt.isPacketValid=PS;var TS=nh(),ch=ah(),lh=Tc(),kS=ie(),Oc=(0,kS.default)("socket.io-parser"),uh=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];Bt.protocol=5;var z;(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"})(z||(Bt.PacketType=z={}));var Ac=class{constructor(e){this.replacer=e}encode(e){return Oc("encoding packet %j",e),(e.type===z.EVENT||e.type===z.ACK)&&(0,lh.hasBinary)(e)?this.encodeAsBinary({type:e.type===z.EVENT?z.BINARY_EVENT:z.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===z.BINARY_EVENT||e.type===z.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)),Oc("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,ch.deconstructPacket)(e),r=this.encodeAsString(t.packet),n=t.buffers;return n.unshift(r),n}};Bt.Encoder=Ac;var Rc=class i extends TS.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 r=t.type===z.BINARY_EVENT;r||t.type===z.BINARY_ACK?(t.type=r?z.EVENT:z.ACK,this.reconstructor=new Pc(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,lh.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,r={type:Number(e.charAt(0))};if(z[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===z.BINARY_EVENT||r.type===z.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");r.attachments=Number(o)}if(e.charAt(t+1)==="/"){let s=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););r.nsp=e.substring(s,t)}else r.nsp="/";let n=e.charAt(t+1);if(n!==""&&Number(n)==n){let s=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}r.id=Number(e.substring(s,t+1))}if(e.charAt(++t)){let s=this.tryParse(e.substr(t));if(i.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return Oc("decoded %s as %j",e,r),r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case z.CONNECT:return _s(t);case z.DISCONNECT:return t===void 0;case z.CONNECT_ERROR:return typeof t=="string"||_s(t);case z.EVENT:case z.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&uh.indexOf(t[0])===-1);case z.ACK:case z.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};Bt.Decoder=Rc;var Pc=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,ch.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function MS(i){return typeof i=="string"}var OS=Number.isInteger||function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i};function AS(i){return i===void 0||OS(i)}function _s(i){return Object.prototype.toString.call(i)==="[object Object]"}function RS(i,e){switch(i){case z.CONNECT:return e===void 0||_s(e);case z.DISCONNECT:return e===void 0;case z.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&uh.indexOf(e[0])===-1);case z.ACK:return Array.isArray(e);case z.CONNECT_ERROR:return typeof e=="string"||_s(e);default:return!1}}function PS(i){return MS(i.nsp)&&AS(i.id)&&RS(i.type,i.data)}});var ph=T(dr=>{"use strict";var BS=dr&&dr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(dr,"__esModule",{value:!0});dr.Client=void 0;var Ss=an(),NS=BS(ie()),Nt=(0,NS.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?(Nt("no namespace joined yet, close the client"),this.close()):Nt("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return Nt("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,r=>{r?this.doConnect(e,t):(Nt("creation of namespace %s was denied",e),this._packet({type:Ss.PacketType.CONNECT_ERROR,nsp:e,data:{message:"Invalid namespace"}}))})}doConnect(e,t){let r=this.server.of(e);r._add(this,t,n=>{this.sockets.set(n.id,n),this.nsps.set(r.name,n),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 Nt("ignoring remove for %s",e.id)}close(){this.conn.readyState==="open"&&(Nt("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if(this.conn.readyState!=="open"){Nt("ignoring packet write %j",e);return}let r=t.preEncoded?e:this.encoder.encode(e);this.writeToEngine(r,t)}writeToEngine(e,t){if(t.volatile&&!this.conn.transport.writable){Nt("volatile packet is discarded since the transport is not currently writable");return}let r=Array.isArray(e)?e:[e];for(let n of r)this.conn.write(n,t)}ondata(e){try{this.decoder.add(e)}catch(t){Nt("invalid packet format"),this.onerror(t)}}ondecoded(e){let{namespace:t,authPayload:r}=this._parseNamespace(e),n=this.nsps.get(t);!n&&e.type===Ss.PacketType.CONNECT?this.connect(t,r):n&&e.type!==Ss.PacketType.CONNECT&&e.type!==Ss.PacketType.CONNECT_ERROR?process.nextTick(function(){n._onpacket(e)}):(Nt("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){Nt("client close with reason %s",e),this.destroy();for(let r of this.sockets.values())r._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)}};dr.Client=Bc});var Cs=T(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.StrictEventEmitter=void 0;var IS=require("events"),Nc=class extends IS.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)}};Es.StrictEventEmitter=Nc});var Ic=T(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.RESERVED_EVENTS=void 0;Ts.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var Dc=T(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.RemoteSocket=fr.BroadcastOperator=void 0;var DS=Ic(),jS=an(),ks=class i{constructor(e,t=new Set,r=new Set,n={}){this.adapter=e,this.rooms=t,this.exceptRooms=r,this.flags=n}to(e){let t=new Set(this.rooms);return Array.isArray(e)?e.forEach(r=>t.add(r)):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(r=>t.add(r)):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(DS.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let r=[e,...t],n={type:jS.PacketType.EVENT,data:r};if(!(typeof r[r.length-1]=="function"))return this.adapter.broadcast(n,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let o=r.pop(),c=!1,u=[],d=setTimeout(()=>{c=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:u])},this.flags.timeout),f=-1,v=0,_=0,E=()=>{!c&&f===v&&u.length===_&&(clearTimeout(d),o.apply(this,[null,this.flags.expectSingleResponse?u[0]:u]))};return this.adapter.broadcastWithAck(n,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},C=>{_+=C,v++,E()},C=>{u.push(C),E()}),this.adapter.serverCount().then(C=>{f=C,E()}),!0}emitWithAck(e,...t){return new Promise((r,n)=>{t.push((s,o)=>s?(s.responses=o,n(s)):r(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 Ms(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)}};fr.BroadcastOperator=ks;var Ms=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 ks(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}};fr.RemoteSocket=Ms});var Lc=T(hr=>{"use strict";var hh=hr&&hr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(hr,"__esModule",{value:!0});hr.Socket=void 0;var bt=an(),LS=hh(ie()),qS=Cs(),dh=hh(ma()),FS=Dc(),US=Ic(),Ke=(0,LS.default)("socket.io:socket"),HS=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function fh(){}var jc=class extends qS.StrictEventEmitter{constructor(e,t,r,n){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,n?(this.id=n.sid,this.pid=n.pid,n.rooms.forEach(s=>this.join(s)),this.data=n.data,n.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=dh.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=dh.default.generateId())),this.handshake=this.buildHandshake(r),this.on("error",fh)}buildHandshake(e){var t,r,n,s;return{headers:((t=this.request)===null||t===void 0?void 0:t.headers)||{},time:new Date+"",address:this.conn.remoteAddress,xdomain:!!(!((r=this.request)===null||r===void 0)&&r.headers.origin),secure:!this.request||!!this.request.connection.encrypted,issued:+new Date,url:(n=this.request)===null||n===void 0?void 0:n.url,query:((s=this.request)===null||s===void 0?void 0:s._query)||{},auth:e}}emit(e,...t){if(US.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let r=[e,...t],n={type:bt.PacketType.EVENT,data:r};if(typeof r[r.length-1]=="function"){let o=this.nsp._ids++;Ke("emitting packet with ack id %d",o),this.registerAckCallback(o,r.pop()),n.id=o}let s=Object.assign({},this.flags);return this.flags={},this.nsp.server.opts.connectionStateRecovery?this.adapter.broadcast(n,{rooms:new Set([this.id]),except:new Set,flags:s}):(this.notifyOutgoingListeners(n),this.packet(n,s)),!0}emitWithAck(e,...t){let r=this.flags.timeout!==void 0;return new Promise((n,s)=>{t.push((o,c)=>r?o?s(o):n(c):n(o)),this.emit(e,...t)})}registerAckCallback(e,t){let r=this.flags.timeout;if(r===void 0){this.acks.set(e,t);return}let n=setTimeout(()=>{Ke("event with ack id %d has timed out after %d ms",e,r),this.acks.delete(e),t.call(this,new Error("operation has timed out"))},r);this.acks.set(e,(...s)=>{clearTimeout(n),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 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:bt.PacketType.CONNECT}):this.packet({type:bt.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(Ke("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(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 r=this._anyListeners.slice();for(let n of r)n.apply(this,t)}this.dispatch(t)}ack(e){let t=this,r=!1;return function(){if(r)return;let n=Array.prototype.slice.call(arguments);Ke("sending ack %j",n),t.packet({id:e,type:bt.PacketType.ACK,data:n}),r=!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&&HS.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=fh}_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){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 r=this.fns.slice(0);function n(s){r[s](e,o=>{if(o)return t(o);if(!r[s+1])return t();n(s+1)})}n(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 r=0;r<t.length;r++)if(e===t[r])return t.splice(r,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 r=0;r<t.length;r++)if(e===t[r])return t.splice(r,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 r of t)r.apply(this,e.data)}}newBroadcastOperator(){let e=Object.assign({},this.flags);return this.flags={},new FS.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}};hr.Socket=jc});var Fc=T(ri=>{"use strict";var zS=ri&&ri.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ri,"__esModule",{value:!0});ri.Namespace=ri.RESERVED_EVENTS=void 0;var mh=Lc(),WS=Cs(),$S=zS(ie()),dt=Dc(),mr=(0,$S.default)("socket.io:namespace");ri.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);var qc=class extends WS.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=>{mr("error while initializing adapter: %s",e)})}use(e){return this._fns.push(e),this}run(e,t){if(!this._fns.length)return t();let r=this._fns.slice(0);function n(s){r[s](e,o=>{if(o)return t(o);if(!r[s+1])return t();n(s+1)})}n(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,r){var n;mr("adding socket to nsp %s",this.name);let s=await this._createSocket(e,t);if(this._preConnectSockets.set(s.id,s),!((n=this.server.opts.connectionStateRecovery)===null||n===void 0)&&n.skipMiddlewares&&s.recovered&&e.conn.readyState==="open")return this._doConnect(s,r);this.run(s,o=>{process.nextTick(()=>{if(e.conn.readyState!=="open"){mr("next called after client was closed - ignoring socket"),s._cleanup();return}if(o)return mr("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,r)})})}async _createSocket(e,t){let r=t.pid,n=t.offset;if(this.server.opts.connectionStateRecovery&&typeof r=="string"&&typeof n=="string"){let s;try{s=await this.adapter.restoreSession(r,n)}catch(o){mr("error while restoring session: %s",o)}if(s)return mr("connection state recovered for sid %s",s.sid),new mh.Socket(this,e,t,s)}return new mh.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(ri.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((r,n)=>{t.push((s,o)=>s?(s.responses=o,n(s)):r(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)}};ri.Namespace=qc});var bh=T(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.encode=Uc;cn.decode=VS;cn.yeast=KS;var xh="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Os=64,yh={},vh=0,xi=0,gh;function Uc(i){let e="";do e=xh[i%Os]+e,i=Math.floor(i/Os);while(i>0);return e}function VS(i){let e=0;for(xi=0;xi<i.length;xi++)e=e*Os+yh[i.charAt(xi)];return e}function KS(){let i=Uc(+new Date);return i!==gh?(vh=0,gh=i):i+"."+Uc(vh++)}for(;xi<Os;xi++)yh[xh[xi]]=xi});var Wc=T(vr=>{"use strict";var Hc;Object.defineProperty(vr,"__esModule",{value:!0});vr.SessionAwareAdapter=vr.Adapter=void 0;var GS=require("events"),YS=bh(),As=vc(),JS=typeof((Hc=As?.Sender)===null||Hc===void 0?void 0:Hc.frame)=="function",Rs=class extends GS.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 r of t)this.sids.get(e).add(r),this.rooms.has(r)||(this.rooms.set(r,new Set),this.emit("create-room",r)),this.rooms.get(r).has(e)||(this.rooms.get(r).add(e),this.emit("join-room",r,e))}del(e,t){this.sids.has(e)&&this.sids.get(e).delete(t),this._del(t,e)}_del(e,t){let r=this.rooms.get(e);r!=null&&(r.delete(t)&&this.emit("leave-room",e,t),r.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 r=t.flags||{},n={preEncoded:!0,volatile:r.volatile,compress:r.compress};e.nsp=this.nsp.name;let s=this._encode(e,n);this.apply(t,o=>{typeof o.notifyOutgoingListeners=="function"&&o.notifyOutgoingListeners(e),o.client.writeToEngine(s,n)})}broadcastWithAck(e,t,r,n){let s=t.flags||{},o={preEncoded:!0,volatile:s.volatile,compress:s.compress};e.nsp=this.nsp.name,e.id=this.nsp._ids++;let c=this._encode(e,o),u=0;this.apply(t,d=>{u++,d.acks.set(e.id,n),typeof d.notifyOutgoingListeners=="function"&&d.notifyOutgoingListeners(e),d.client.writeToEngine(c,o)}),r(u)}_encode(e,t){let r=this.encoder.encode(e);if(JS&&r.length===1&&typeof r[0]=="string"){let n=Buffer.from("4"+r[0]);t.wsPreEncodedFrame=As.Sender.frame(n,{readOnly:!1,mask:!1,rsv1:!1,opcode:1,fin:!0})}return r}sockets(e){let t=new Set;return this.apply({rooms:e},r=>{t.add(r.id)}),Promise.resolve(t)}socketRooms(e){return this.sids.get(e)}fetchSockets(e){let t=[];return this.apply(e,r=>{t.push(r)}),Promise.resolve(t)}addSockets(e,t){this.apply(e,r=>{r.join(t)})}delSockets(e,t){this.apply(e,r=>{t.forEach(n=>r.leave(n))})}disconnectSockets(e,t){this.apply(e,r=>{r.disconnect(t)})}apply(e,t){let r=e.rooms,n=this.computeExceptSids(e.except);if(r.size){let s=new Set;for(let o of r)if(this.rooms.has(o))for(let c of this.rooms.get(o)){if(s.has(c)||n.has(c))continue;let u=this.nsp.sockets.get(c);u&&(t(u),s.add(c))}}else for(let[s]of this.sids){if(n.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 r of e)this.rooms.has(r)&&this.rooms.get(r).forEach(n=>t.add(n));return t}serverSideEmit(e){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(e){}restoreSession(e,t){return null}};vr.Adapter=Rs;var zc=class extends Rs{constructor(e){super(e),this.nsp=e,this.sessions=new Map,this.packets=[],this.maxDisconnectionDuration=e.server.opts.connectionStateRecovery.maxDisconnectionDuration,setInterval(()=>{let r=Date.now()-this.maxDisconnectionDuration;this.sessions.forEach((n,s)=>{n.disconnectedAt<r&&this.sessions.delete(s)});for(let n=this.packets.length-1;n>=0;n--)if(this.packets[n].emittedAt<r){this.packets.splice(0,n+1);break}},60*1e3).unref()}persistSession(e){e.disconnectedAt=Date.now(),this.sessions.set(e.pid,e)}restoreSession(e,t){let r=this.sessions.get(e);if(!r)return null;if(r.disconnectedAt+this.maxDisconnectionDuration<Date.now())return this.sessions.delete(e),null;let s=this.packets.findIndex(c=>c.id===t);if(s===-1)return null;let o=[];for(let c=s+1;c<this.packets.length;c++){let u=this.packets[c];XS(r.rooms,u.opts)&&o.push(u.data)}return Promise.resolve(Object.assign(Object.assign({},r),{missedPackets:o}))}broadcast(e,t){var r;let n=e.type===2,s=e.id===void 0,o=((r=t.flags)===null||r===void 0?void 0:r.volatile)===void 0;if(n&&s&&o){let c=(0,YS.yeast)();e.data.push(c),this.packets.push({id:c,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};vr.SessionAwareAdapter=zc;function XS(i,e){let t=e.rooms.size===0||i.some(n=>e.rooms.has(n)),r=i.every(n=>!e.except.has(n));return t&&r}});var wh=T(Wt=>{"use strict";var ZS=Wt&&Wt.__rest||function(i,e){var t={};for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&e.indexOf(r)<0&&(t[r]=i[r]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(i);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(i,r[n])&&(t[r[n]]=i[r[n]]);return t};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.ClusterAdapterWithHeartbeat=Wt.ClusterAdapter=Wt.MessageType=void 0;var QS=Wc(),e1=ie(),t1=require("crypto"),Q=(0,e1.debug)("socket.io-adapter"),i1="emitter",Ps=5e3;function xr(){return(0,t1.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||(Wt.MessageType=N={}));function Bi(i){return{rooms:[...i.rooms],except:[...i.except],flags:i.flags}}function gr(i){return{rooms:new Set(i.rooms),except:new Set(i.except),flags:i.flags}}var Bs=class extends QS.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=xr()}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 N.BROADCAST:{if(e.data.requestId!==void 0)super.broadcastWithAck(e.data.packet,gr(e.data.opts),n=>{Q("[%s] waiting for %d client acknowledgements",this.uid,n),this.publishResponse(e.uid,{type:N.BROADCAST_CLIENT_COUNT,data:{requestId:e.data.requestId,clientCount:n}})},n=>{Q("[%s] received acknowledgement with value %j",this.uid,n),this.publishResponse(e.uid,{type:N.BROADCAST_ACK,data:{requestId:e.data.requestId,packet:n}})});else{let n=e.data.packet,s=gr(e.data.opts);this.addOffsetIfNecessary(n,s,t),super.broadcast(n,s)}break}case N.SOCKETS_JOIN:super.addSockets(gr(e.data.opts),e.data.rooms);break;case N.SOCKETS_LEAVE:super.delSockets(gr(e.data.opts),e.data.rooms);break;case N.DISCONNECT_SOCKETS:super.disconnectSockets(gr(e.data.opts),e.data.close);break;case N.FETCH_SOCKETS:{Q("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(gr(e.data.opts)).then(r=>{this.publishResponse(e.uid,{type:N.FETCH_SOCKETS_RESPONSE,data:{requestId:e.data.requestId,sockets:r.map(n=>{let s=n.handshake,{sessionStore:o}=s,c=ZS(s,["sessionStore"]);return{id:n.id,handshake:c,rooms:[...n.rooms],data:n.data}})}})});break}case N.SERVER_SIDE_EMIT:{let r=e.data.packet;if(!(e.data.requestId!==void 0)){this.nsp._onServerSideEmit(r);return}let s=!1,o=c=>{s||(s=!0,Q("[%s] calling acknowledgement with %j",this.uid,c),this.publishResponse(e.uid,{type:N.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:e.data.requestId,packet:c}}))};this.nsp._onServerSideEmit([...r,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:Q("[%s] unknown message type: %s",this.uid,e.type)}}onResponse(e){var t,r;let n=e.data.requestId;switch(Q("[%s] received response %s to request %s",this.uid,e.type,n),e.type){case N.BROADCAST_CLIENT_COUNT:{(t=this.ackRequests.get(n))===null||t===void 0||t.clientCountCallback(e.data.clientCount);break}case N.BROADCAST_ACK:{(r=this.ackRequests.get(n))===null||r===void 0||r.ack(e.data.packet);break}case N.FETCH_SOCKETS_RESPONSE:{let s=this.requests.get(n);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(n));break}case N.SERVER_SIDE_EMIT_RESPONSE:{let s=this.requests.get(n);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(n));break}default:Q("[%s] unknown response type: %s",this.uid,e.type)}}async broadcast(e,t){var r;if(!((r=t.flags)===null||r===void 0?void 0:r.local))try{let s=await this.publishAndReturnOffset({type:N.BROADCAST,data:{packet:e,opts:Bi(t)}});this.addOffsetIfNecessary(e,t,s)}catch(s){return Q("[%s] error while broadcasting message: %s",this.uid,s.message)}super.broadcast(e,t)}addOffsetIfNecessary(e,t,r){var n;if(!this.nsp.server.opts.connectionStateRecovery)return;let s=e.type===2,o=e.id===void 0,c=((n=t.flags)===null||n===void 0?void 0:n.volatile)===void 0;s&&o&&c&&e.data.push(r)}broadcastWithAck(e,t,r,n){var s;if(!((s=t?.flags)===null||s===void 0?void 0:s.local)){let c=xr();this.ackRequests.set(c,{clientCountCallback:r,ack:n}),this.publish({type:N.BROADCAST,data:{packet:e,requestId:c,opts:Bi(t)}}),setTimeout(()=>{this.ackRequests.delete(c)},t.flags.timeout)}super.broadcastWithAck(e,t,r,n)}async addSockets(e,t){var r;if(!((r=e.flags)===null||r===void 0?void 0:r.local))try{await this.publishAndReturnOffset({type:N.SOCKETS_JOIN,data:{opts:Bi(e),rooms:t}})}catch(s){Q("[%s] error while publishing message: %s",this.uid,s.message)}super.addSockets(e,t)}async delSockets(e,t){var r;if(!((r=e.flags)===null||r===void 0?void 0:r.local))try{await this.publishAndReturnOffset({type:N.SOCKETS_LEAVE,data:{opts:Bi(e),rooms:t}})}catch(s){Q("[%s] error while publishing message: %s",this.uid,s.message)}super.delSockets(e,t)}async disconnectSockets(e,t){var r;if(!((r=e.flags)===null||r===void 0?void 0:r.local))try{await this.publishAndReturnOffset({type:N.DISCONNECT_SOCKETS,data:{opts:Bi(e),close:t}})}catch(s){Q("[%s] error while publishing message: %s",this.uid,s.message)}super.disconnectSockets(e,t)}async fetchSockets(e){var t;let[r,n]=await Promise.all([super.fetchSockets(e),this.serverCount()]),s=n-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return r;let o=xr();return new Promise((c,u)=>{let d=setTimeout(()=>{let v=this.requests.get(o);v&&(u(new Error(`timeout reached: only ${v.current} responses received out of ${v.expected}`)),this.requests.delete(o))},e.flags.timeout||Ps),f={type:N.FETCH_SOCKETS,resolve:c,timeout:d,current:0,expected:s,responses:r};this.requests.set(o,f),this.publish({type:N.FETCH_SOCKETS,data:{opts:Bi(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 r=e.pop(),n=await this.serverCount()-1;if(Q('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,n),n<=0)return r(null,[]);let s=xr(),o=setTimeout(()=>{let u=this.requests.get(s);u&&(r(new Error(`timeout reached: only ${u.current} responses received out of ${u.expected}`),u.responses),this.requests.delete(s))},Ps),c={type:N.SERVER_SIDE_EMIT,resolve:r,timeout:o,current:0,expected:n,responses:[]};this.requests.set(s,c),this.publish({type:N.SERVER_SIDE_EMIT,data:{requestId:s,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(r=>{Q("[%s] error while publishing response: %s",this.uid,r)})}};Wt.ClusterAdapter=Bs;var $c=class extends Bs{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 r=Date.now();this.nodesMap.forEach((n,s)=>{r-n>this._opts.heartbeatTimeout&&(Q("[%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 Q("[%s] ignore message from self",this.uid);switch(e.uid&&e.uid!==i1&&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 r=e.pop(),n=this.nodesMap.size;if(Q('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,n),n<=0)return r(null,[]);let s=xr(),o=setTimeout(()=>{let u=this.customRequests.get(s);u&&(r(new Error(`timeout reached: missing ${u.missingUids.size} responses`),u.responses),this.customRequests.delete(s))},Ps),c={type:N.SERVER_SIDE_EMIT,resolve:r,timeout:o,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(s,c),this.publish({type:N.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}async fetchSockets(e){var t;let[r,n]=await Promise.all([super.fetchSockets({rooms:e.rooms,except:e.except,flags:{local:!0}}),this.serverCount()]),s=n-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return r;let o=xr();return new Promise((c,u)=>{let d=setTimeout(()=>{let v=this.customRequests.get(o);v&&(u(new Error(`timeout reached: missing ${v.missingUids.size} responses`)),this.customRequests.delete(o))},e.flags.timeout||Ps),f={type:N.FETCH_SOCKETS,resolve:c,timeout:d,missingUids:new Set([...this.nodesMap.keys()]),responses:r};this.customRequests.set(o,f),this.publish({type:N.FETCH_SOCKETS,data:{opts:Bi(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 N.FETCH_SOCKETS_RESPONSE:{let r=this.customRequests.get(t);if(!r)return;e.data.sockets.forEach(n=>r.responses.push(n)),r.missingUids.delete(e.uid),r.missingUids.size===0&&(clearTimeout(r.timeout),r.resolve(r.responses),this.customRequests.delete(t));break}case N.SERVER_SIDE_EMIT_RESPONSE:{let r=this.customRequests.get(t);if(!r)return;r.responses.push(e.data.packet),r.missingUids.delete(e.uid),r.missingUids.size===0&&(clearTimeout(r.timeout),r.resolve(null,r.responses),this.customRequests.delete(t));break}default:super.onResponse(e)}}removeNode(e){this.customRequests.forEach((t,r)=>{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(r))}),this.nodesMap.delete(e)}};Wt.ClusterAdapterWithHeartbeat=$c});var Ns=T(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.MessageType=wt.ClusterAdapterWithHeartbeat=wt.ClusterAdapter=wt.SessionAwareAdapter=wt.Adapter=void 0;var _h=Wc();Object.defineProperty(wt,"Adapter",{enumerable:!0,get:function(){return _h.Adapter}});Object.defineProperty(wt,"SessionAwareAdapter",{enumerable:!0,get:function(){return _h.SessionAwareAdapter}});var Vc=wh();Object.defineProperty(wt,"ClusterAdapter",{enumerable:!0,get:function(){return Vc.ClusterAdapter}});Object.defineProperty(wt,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return Vc.ClusterAdapterWithHeartbeat}});Object.defineProperty(wt,"MessageType",{enumerable:!0,get:function(){return Vc.MessageType}})});var Ch=T(yr=>{"use strict";var r1=yr&&yr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(yr,"__esModule",{value:!0});yr.ParentNamespace=void 0;var Sh=Fc(),n1=Ns(),s1=r1(ie()),Eh=(0,s1.default)("socket.io:parent-namespace"),Is=class i extends Sh.Namespace{constructor(e){super(e,"/_"+i.count++),this.children=new Set}_initAdapter(){this.adapter=new Kc(this)}emit(e,...t){return this.children.forEach(r=>{r.emit(e,...t)}),!0}createChild(e){Eh("creating child namespace %s",e);let t=new Sh.Namespace(this.server,e);if(this._fns.forEach(r=>t.use(r)),this.listeners("connect").forEach(r=>t.on("connect",r)),this.listeners("connection").forEach(r=>t.on("connection",r)),this.children.add(t),this.server._opts.cleanupEmptyChildNamespaces){let r=t._remove;t._remove=n=>{r.call(t,n),t.sockets.size===0&&(Eh("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")}};yr.ParentNamespace=Is;Is.count=0;var Kc=class extends n1.Adapter{broadcast(e,t){this.nsp.children.forEach(r=>{r.adapter.broadcast(e,t)})}}});var Rh=T(Ii=>{"use strict";var o1=Ii&&Ii.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.patchAdapter=c1;Ii.restoreAdapter=l1;Ii.serveFile=p1;var Ni=Ns(),Th=require("fs"),a1=o1(ie()),Ds=(0,a1.default)("socket.io:adapter-uws"),Gc="",{addAll:Mh,del:Oh,broadcast:Ah}=Ni.Adapter.prototype;function c1(i){Ni.Adapter.prototype.addAll=function(e,t){let r=!this.sids.has(e);Mh.call(this,e,t);let n=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(n){if(n.conn.transport.name==="websocket"){kh(this.nsp.name,n,r,t);return}r&&n.conn.on("upgrade",()=>{let s=this.sids.get(e);s&&kh(this.nsp.name,n,r,s)})}},Ni.Adapter.prototype.del=function(e,t){Oh.call(this,e,t);let r=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(r&&r.conn.transport.name==="websocket"){let n=r.conn.id,s=r.conn.transport.socket,o=`${this.nsp.name}${Gc}${t}`;Ds("unsubscribe connection %s from topic %s",n,o),s.unsubscribe(o)}},Ni.Adapter.prototype.broadcast=function(e,t){if(!(t.rooms.size<=1&&t.except.size===0)){Ah.call(this,e,t);return}let n=t.flags||{},s={preEncoded:!0,volatile:n.volatile,compress:n.compress};e.nsp=this.nsp.name;let o=this.encoder.encode(e),c=t.rooms.size===0?this.nsp.name:`${this.nsp.name}${Gc}${t.rooms.keys().next().value}`;Ds("fast publish to %s",c),o.forEach(u=>{let d=typeof u!="string";i.publish(c,d?u:"4"+u,d)}),this.apply(t,u=>{u.conn.transport.name!=="websocket"&&u.client.writeToEngine(o,s)})}}function kh(i,e,t,r){let n=e.conn.id,s=e.conn.transport.socket;t&&(Ds("subscribe connection %s to topic %s",n,i),s.subscribe(i)),r.forEach(o=>{let c=`${i}${Gc}${o}`;Ds("subscribe connection %s to topic %s",n,c),s.subscribe(c)})}function l1(){Ni.Adapter.prototype.addAll=Mh,Ni.Adapter.prototype.del=Oh,Ni.Adapter.prototype.broadcast=Ah}var u1=i=>{let{buffer:e,byteOffset:t,byteLength:r}=i;return e.slice(t,t+r)};function p1(i,e){let{size:t}=(0,Th.statSync)(e),r=(0,Th.createReadStream)(e),n=()=>!r.destroyed&&r.destroy(),s=c=>{throw n(),c},o=c=>{let u=u1(c);i.cork(()=>{let d=i.getWriteOffset(),[f,v]=i.tryEnd(u,t);!v&&!f&&(r.pause(),i.onWritable(_=>{let[E,C]=i.tryEnd(u.slice(_-d),t);return!C&&E&&r.resume(),E}))})};i.onAborted(n),r.on("data",o).on("error",s).on("end",n)}});var Ph=T((iO,d1)=>{d1.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 Fh=T((Ge,ln)=>{"use strict";var f1=Ge&&Ge.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),h1=Ge&&Ge.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),m1=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)&&f1(e,i,t);return h1(e,i),e},Xc=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 v1=Xc(require("http")),g1=require("fs"),Yc=require("zlib"),x1=jn(),js=require("stream"),Bh=require("path"),Nh=ih(),y1=ph(),Ih=require("events"),Zc=Fc();Object.defineProperty(Ge,"Namespace",{enumerable:!0,get:function(){return Zc.Namespace}});var b1=Ch(),Dh=Ns(),w1=m1(an()),_1=Xc(ie()),qh=Lc();Object.defineProperty(Ge,"Socket",{enumerable:!0,get:function(){return qh.Socket}});var S1=Cs(),Jc=Rh(),E1=Xc(xc()),Qe=(0,_1.default)("socket.io:server"),jh=Ph().version,Lh=/\.map/,br=class i extends S1.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||w1,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||Dh.SessionAwareAdapter)):this.adapter(t.adapter||Dh.Adapter),t.cleanupEmptyChildNamespaces=!!t.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),(e||typeof e=="number")&&this.attach(e),this.opts.cors&&(this._corsMiddleware=(0,E1.default)(this.opts.cors))}get _opts(){return this.opts}serveClient(e){return arguments.length?(this._serveClient=e,this):this._serveClient}_checkNamespace(e,t,r){if(this.parentNsps.size===0)return r(!1);let n=this.parentNsps.keys(),s=()=>{let o=n.next();if(o.done)return r(!1);o.value(e,t,(c,u)=>{if(c||!u)return s();if(this._nsps.has(e))return Qe("dynamic namespace %s already exists",e),r(this._nsps.get(e));let d=this.parentNsps.get(o.value).createChild(e);Qe("dynamic namespace %s was created",e),r(d)})};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 r="You are trying to attach socket.io to an express request handler function. Please pass a http.Server instance.";throw new Error(r)}if(Number(e)==e&&(e=Number(e)),typeof e=="number"){Qe("creating http server and binding to %d",e);let r=e;e=v1.default.createServer((n,s)=>{s.writeHead(404),s.end()}),e.listen(r)}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,Qe("creating uWebSockets.js-based engine with opts %j",t);let r=new Nh.uServer(t);r.attach(e,t),this.bind(r),this._serveClient&&e.get(`${this._path}/*`,(n,s)=>{if(!this.clientPathRegex.test(s.getUrl())){s.setYield(!0);return}let o=s.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),c=Lh.test(o),u=c?"map":"source",d='"'+jh+'"',f="W/"+d,v=s.getHeader("if-none-match");if(v&&(d===v||f===v)){Qe("serve client %s 304",u),n.writeStatus("304 Not Modified"),n.end();return}Qe("serve client %s",u),n.writeHeader("cache-control","public, max-age=0"),n.writeHeader("content-type","application/"+(c?"json":"javascript")+"; charset=utf-8"),n.writeHeader("etag",d);let _=Bh.join(__dirname,"../client-dist/",o);(0,Jc.serveFile)(n,_)}),(0,Jc.patchAdapter)(e)}initEngine(e,t){Qe("creating engine.io instance with opts %j",t),this.eio=(0,Nh.attach)(e,t),this._serveClient&&this.attachServe(e),this.httpServer=e,this.bind(this.eio)}attachServe(e){Qe("attaching client serving req handler");let t=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("request",(r,n)=>{if(this.clientPathRegex.test(r.url))this._corsMiddleware?this._corsMiddleware(r,n,()=>{this.serve(r,n)}):this.serve(r,n);else for(let s=0;s<t.length;s++)t[s].call(e,r,n)})}serve(e,t){let r=e.url.replace(this._path,"").replace(/\?.*$/,""),n=Lh.test(r),s=n?"map":"source",o='"'+jh+'"',c="W/"+o,u=e.headers["if-none-match"];if(u&&(o===u||c===u)){Qe("serve client %s 304",s),t.writeHead(304),t.end();return}Qe("serve client %s",s),t.setHeader("Cache-Control","public, max-age=0"),t.setHeader("Content-Type","application/"+(n?"json":"javascript")+"; charset=utf-8"),t.setHeader("ETag",o),i.sendFile(r,e,t)}static sendFile(e,t,r){let n=(0,g1.createReadStream)(Bh.join(__dirname,"../client-dist/",e)),s=x1(t).encodings(["br","gzip","deflate"]),o=c=>{c&&r.end()};switch(s){case"br":r.writeHead(200,{"content-encoding":"br"}),(0,js.pipeline)(n,(0,Yc.createBrotliCompress)(),r,o);break;case"gzip":r.writeHead(200,{"content-encoding":"gzip"}),(0,js.pipeline)(n,(0,Yc.createGzip)(),r,o);break;case"deflate":r.writeHead(200,{"content-encoding":"deflate"}),(0,js.pipeline)(n,(0,Yc.createDeflate)(),r,o);break;default:r.writeHead(200),(0,js.pipeline)(n,r,o)}}bind(e){return this.engine=e,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(e){Qe("incoming connection with id %s",e.id);let t=new y1.Client(this,e);return e.protocol===3&&t.connect("/"),this}of(e,t){if(typeof e=="function"||e instanceof RegExp){let n=new b1.ParentNamespace(this);return Qe("initializing parent namespace %s",n.name),typeof e=="function"?this.parentNsps.set(e,n):(this.parentNsps.set((s,o,c)=>c(null,e.test(s)),n),this.parentNamespacesFromRegExp.set(e,n)),t&&n.on("connect",t),n}String(e)[0]!=="/"&&(e="/"+e);let r=this._nsps.get(e);if(!r){for(let[n,s]of this.parentNamespacesFromRegExp)if(n.test(e))return Qe("attaching namespace %s to parent namespace %s",e,n),s.createChild(e);Qe("initializing namespace %s",e),r=new Zc.Namespace(this,e),this._nsps.set(e,r),e!=="/"&&this.sockets.emitReserved("new_namespace",r)}return t&&r.on("connect",t),r}async close(e){if(await Promise.allSettled([...this._nsps.values()].map(async t=>{t.sockets.forEach(r=>{r._onclose("server shutting down")}),await t.adapter.close()})),this.engine.close(),(0,Jc.restoreAdapter)(),this.httpServer)return new Promise(t=>{this.httpServer.close(r=>{e&&e(r),r&&Qe("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=br;var C1=Object.keys(Ih.EventEmitter.prototype).filter(function(i){return typeof Ih.EventEmitter.prototype[i]=="function"});C1.forEach(function(i){br.prototype[i]=function(){return this.sockets[i].apply(this.sockets,arguments)}});ln.exports=(i,e)=>new br(i,e);ln.exports.Server=br;ln.exports.Namespace=Zc.Namespace;ln.exports.Socket=qh.Socket});var $e,kr=Si(()=>{$e={webrtc:{enableWebRTC:!0,enableTurn:!1,turnApiUrl:"https://9remote.cc/api/webrtc/turn-credentials",turnRefreshInterval:828e5,dcMaxMessageSize:65536,dcBufferThreshold:65536,dcChunkSize:8,dcMaxTilesPerFrame:32,dcReliable:!0,dcOrdered:!1,answerTimeout:1e4},robotSettings:{mouseDelay:2,keyboardDelay:2},throttling:{mouseThrottle:8,keyThrottle:25,typeTextThrottle:100,maxTextLength:1e3},resourceManagement:{inactiveTimeout:12e4,memoryCheckInterval:6e4,memoryWarningThreshold:1e3,maxTimersPerClient:100,maxChunkTimersPerClient:50},streaming:{activeInterval:60,idleInterval:400,idleThreshold:3,actionCaptureDelay:50,chunkSize:32,chunkDelay:5}}});var vm={};Ei(vm,{TileManager:()=>cl});var Gs,Mr,Js,Ys,mm,G1,Y1,cl,gm=Si(()=>{Gs=L(require("sharp"),1),Mr=L(require("fs"),1),Js=L(require("path"),1),Ys=require("child_process"),mm=require("url"),G1=(0,mm.fileURLToPath)(__importMetaUrl),Y1=Js.default.dirname(G1),cl=class{constructor(e){this.robot=e,this.tileSize=128,this.lastTileChecksums=new Map,this.screenWidth=0,this.screenHeight=0,this.tilesPerRow=0,this.tilesPerColumn=0,this.totalTiles=0,this.frameCount=0,this.tempDir=Js.default.join(Y1,"../../temp"),this.changeThreshold=1,this.scaledWidth=0,this.scaledHeight=0,this.isProcessing=!1,this.sharedScreenCache=null,this.lastCaptureTime=0,this.CACHE_TTL=100,this.dpiScale=1,this.captureWidth=0,this.captureHeight=0,this.scaleFactor=1,this.compressionQuality=50,Mr.default.existsSync(this.tempDir)||Mr.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 r=100;if(this.totalTiles>r){let n=Math.ceil(Math.sqrt(this.scaledWidth*this.scaledHeight/r));this.tileSize=Math.max(n,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 Init] Logical: ${e}x${t} | DPI Scale: ${this.dpiScale}x | Capture: ${this.captureWidth}x${this.captureHeight} | Scaled: ${this.scaledWidth}x${this.scaledHeight} | Tiles: ${this.totalTiles}`)}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(){if(process.platform==="darwin"){let e=this.robot.screen.capture(0,0,this.screenWidth,this.screenHeight),r=e.byteWidth/e.bytesPerPixel/this.screenWidth;r>=1.9&&r<=2.1?this.dpiScale=2:this.dpiScale=1}else process.platform==="win32"?this.dpiScale=this._detectDpiScaleWin32():this.dpiScale=1;this.captureWidth=Math.floor(this.screenWidth*this.dpiScale),this.captureHeight=Math.floor(this.screenHeight*this.dpiScale)}_detectDpiScaleWin32(){console.log(`\u{1F50D} [DPI Detection] screenWidth from robot: ${this.screenWidth}x${this.screenHeight}`);try{let e=(0,Ys.execSync)(`powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "try{Get-ItemPropertyValue 'HKCU:\\Control Panel\\Desktop\\WindowMetrics' -Name AppliedDPI}catch{0}"`,{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(console.log(`\u{1F50D} [DPI Detection] Strategy 1 (Registry AppliedDPI): ${t} DPI`),t>=96){let r=t/96;return console.log(`\u2705 [DPI Detection] Using registry scale: ${r}x (${t}/96)`),r}}catch(e){console.log("\u274C [DPI Detection] Strategy 1 failed:",e.message)}try{let e=(0,Ys.execSync)('powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "(Get-WmiObject -Class Win32_VideoController | Select-Object -First 1).CurrentHorizontalResolution"',{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(console.log(`\u{1F50D} [DPI Detection] Strategy 2 (WMI): physical width = ${t}px`),t>0&&t>this.screenWidth){let r=t/this.screenWidth;return console.log(`\u2705 [DPI Detection] Using WMI scale: ${r}x (${t}/${this.screenWidth})`),r}}catch(e){console.log("\u274C [DPI Detection] Strategy 2 failed:",e.message)}try{let e=(0,Ys.execSync)(`powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "Add-Type -TypeDefinition 'using System;using System.Runtime.InteropServices;public class Disp{[DllImport(\\"user32\\")]public static extern bool EnumDisplaySettings(string d,int m,ref DEVMODE dm);[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Ansi)]public struct DEVMODE{[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)]public string dmDeviceName;public short dmSpecVersion,dmDriverVersion,dmSize,dmDriverExtra;public int dmFields;public int dmPositionX,dmPositionY,dmDisplayOrientation,dmDisplayFixedOutput;public short dmColor,dmDuplex,dmYResolution,dmTTOption,dmCollate;[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)]public string dmFormName;public short dmLogPixels;public int dmBitsPerPel,dmPelsWidth,dmPelsHeight,dmDisplayFlags,dmDisplayFrequency;}}'; $dm=New-Object Disp+DEVMODE; $dm.dmSize=[System.Runtime.InteropServices.Marshal]::SizeOf($dm); [Disp]::EnumDisplaySettings($null,-1,[ref]$dm) | Out-Null; Write-Output $dm.dmPelsWidth"`,{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(console.log(`\u{1F50D} [DPI Detection] Strategy 3 (EnumDisplaySettings): physical width = ${t}px`),t>0&&t>this.screenWidth){let r=t/this.screenWidth;return console.log(`\u2705 [DPI Detection] Using EnumDisplaySettings scale: ${r}x (${t}/${this.screenWidth})`),r}}catch(e){console.log("\u274C [DPI Detection] Strategy 3 failed:",e.message)}return console.log("\u26A0\uFE0F [DPI Detection] All strategies failed, fallback to 1x"),1}async captureFullScreen(){let e=this.robot.screen.capture(0,0,this.captureWidth,this.captureHeight),t=e.byteWidth/e.bytesPerPixel,r=e.height,n=Buffer.from(e.image),s=new Uint32Array(n.buffer,n.byteOffset,n.length>>2);for(let d=0;d<s.length;d++){let f=s[d];s[d]=f&4278255360|(f&16711680)>>16|(f&255)<<16}let o=n,c=t,u=r;if(this.dpiScale>1||this.scaleFactor<1){let d=Math.floor(this.screenWidth*this.scaleFactor),f=Math.floor(this.screenHeight*this.scaleFactor);o=await(0,Gs.default)(n,{raw:{width:t,height:r,channels:e.bytesPerPixel}}).resize(d,f,{kernel:Gs.default.kernel.lanczos3,fit:"fill",fastShrinkOnLoad:!1}).raw().toBuffer(),c=d,u=f}return{buffer:o,width:c,height:u,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=[],r=[],n=new Map;this.frameCount++;for(let c=0;c<this.totalTiles;c++){let u=this.calculateTileChecksumDirect(e,c);n.set(c,u)}let s=Array.from(n.values());if(this.lastTileChecksums.size===0){let c=[];for(let d=0;d<this.totalTiles;d++)this.lastTileChecksums.set(d,n.get(d)),c.push(this.processTileAsync(e,d));let u=await Promise.all(c);return t.push(...u),{tiles:t,currentHashes:s}}for(let c=0;c<this.totalTiles;c++){let u=n.get(c),d=this.lastTileChecksums.get(c);u!==d&&(r.push(c),this.lastTileChecksums.set(c,u))}if(r.length/this.totalTiles>this.changeThreshold){let c=[];for(let d=0;d<this.totalTiles;d++)c.push(this.processTileAsync(e,d));let u=await Promise.all(c);t.push(...u.map(d=>({...d,fullRefresh:!0})))}else if(r.length>0){let c=r.map(d=>this.processTileAsync(e,d)),u=await Promise.all(c);t.push(...u)}return{tiles:t,currentHashes:s}}finally{this.isProcessing=!1}}async processTileAsync(e,t,r=null){let n=r||this.extractTile(e,t),s=await this.compressTileImage(n.buffer,n.width,n.height),{row:o,col:c}=this.getTilePosition(t);return{type:"tile-update",tileIndex:t,x:c*this.tileSize,y:o*this.tileSize,width:n.width,height:n.height,imageBuffer:s,timestamp:Date.now(),frameCount:this.frameCount}}calculateTileChecksumDirect(e,t){let{row:r,col:n}=this.getTilePosition(t),s=n*this.tileSize,o=r*this.tileSize,c=Math.min(s+this.tileSize,e.width),u=Math.min(o+this.tileSize,e.height),d=c-s,f=u-o,v=e.channels,_=e.width*v,E=0,C=16;for(let k=0;k<f;k+=4){let M=(o+k)*_+s*v;for(let O=0;O<d;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:r,col:n}=this.getTilePosition(t),s=n*this.tileSize,o=r*this.tileSize,c=Math.min(s+this.tileSize,e.width),u=Math.min(o+this.tileSize,e.height),d=c-s,f=u-o,v=e.channels,_=d*v,E=Buffer.alloc(d*f*v);for(let C=0;C<f;C++){let k=((o+C)*e.width+s)*v,M=C*_;e.buffer.copy(E,M,k,k+_)}return{buffer:E,width:d,height:f,channels:v,tileIndex:t,x:s,y:o}}async compressTileImage(e,t,r){return(0,Gs.default)(e,{raw:{width:t,height:r,channels:4}}).jpeg({quality:this.compressionQuality}).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(),r=[],n=[];this.frameCount++;let s=new Map;for(let c=0;c<this.totalTiles;c++){let u=this.calculateTileChecksumDirect(t,c);s.set(c,u),this.lastTileChecksums.set(c,u)}if(!e||e.length===0){let c=[];for(let d=0;d<this.totalTiles;d++)c.push(this.processTileAsync(t,d));let u=await Promise.all(c);return r.push(...u),{tiles:r,currentHashes:Array.from(s.values())}}for(let c=0;c<this.totalTiles;c++)e[c]!==s.get(c)&&n.push(c);if(n.length/this.totalTiles>this.changeThreshold){let c=[];for(let d=0;d<this.totalTiles;d++)c.push(this.processTileAsync(t,d));let u=await Promise.all(c);r.push(...u.map(d=>({...d,fullRefresh:!0})))}else if(n.length>0){let c=n.map(d=>this.processTileAsync(t,d)),u=await Promise.all(c);r.push(...u)}return{tiles:r,currentHashes:Array.from(s.values()),changedIndices:n}}finally{this.isProcessing=!1}}clearMemory(){this.sharedScreenCache=null,this.lastCaptureTime=0,this.lastTileChecksums.clear()}reset(){this.lastTileChecksums.clear(),this.frameCount=0}cleanup(){try{Mr.default.existsSync(this.tempDir)&&Mr.default.readdirSync(this.tempDir).forEach(t=>Mr.default.unlinkSync(Js.default.join(this.tempDir,t)))}catch(e){console.warn("Cleanup error:",e)}}}});var xm={};Ei(xm,{ResourceManager:()=>ll});var ll,ym=Si(()=>{kr();ll=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>$e.resourceManagement.memoryWarningThreshold&&(console.warn(`\u26A0\uFE0F High memory: ${t}MB`),this.cleanupInactiveClients())},$e.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=$e.resourceManagement.inactiveTimeout;for(let[r,n]of this.activeClients.entries())e-n.lastActivity>t&&(console.log(`\u{1F9F9} Cleaning inactive client: ${r}`),this.cleanupClientResources(r,n),this.activeClients.delete(r))}cleanupClientResources(e,t){try{t.isStreaming=!1,t?.streamingTimeout&&(clearTimeout(t.streamingTimeout),t.streamingTimeout=null),t?.screenInterval&&(clearInterval(t.screenInterval),t.screenInterval=null);let r=this.activeTimers.get(e);r&&(r.forEach(s=>clearTimeout(s)),this.activeTimers.delete(e));let n=this.chunkTimers.get(e);n&&(n.forEach(s=>clearTimeout(s)),this.chunkTimers.delete(e)),t?.tileManager&&(t.tileManager.clearMemory(),t.tileManager.cleanup(),t.tileManager.reset())}catch(r){console.error(`Error cleaning up ${e}:`,r.message)}}getStreamingConfig(){return $e.streaming}getWebRTCConfig(){return $e.webrtc}removeClient(e){let t=this.activeClients.get(e);t&&(this.cleanupClientResources(e,t),this.activeClients.delete(e))}getChunkTimers(e){return this.chunkTimers.has(e)||this.chunkTimers.set(e,new Set),this.chunkTimers.get(e)}cleanupAll(){this.stopResourceMonitoring();for(let[e,t]of this.activeClients.entries())this.cleanupClientResources(e,t);this.activeClients.clear(),this.activeTimers.clear(),this.chunkTimers.clear()}}});var bm={};Ei(bm,{ScreenUpdateHelper:()=>ul});var ul,wm=Si(()=>{kr();ul=class{constructor(e){this.resourceManager=e}async sendTilesInChunks(e,t,r,n=!1){if(!t||t.length===0)return;let s=$e.streaming.chunkSize,o=[];for(let u=0;u<t.length;u+=s)o.push(t.slice(u,u+s));let c=this.resourceManager.getChunkTimers(e.id);for(let u=0;u<o.length;u++){let d=o[u],f=u===o.length-1,v=setTimeout(()=>{c.delete(v),e.connected&&e.emit("tiles-data",{tiles:d,timestamp:r,forceRefresh:!1,userAction:n,chunkInfo:{chunkIndex:u,totalChunks:o.length,isLastChunk:f}})},u*$e.streaming.chunkDelay);c.add(v)}}}});var _m={};Ei(_m,{MouseHandler:()=>pl});var pl,Sm=Si(()=>{kr();pl=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastMouseMove=0}setupMouseHandlers(e,t){let r=this.robot;e.on("mouse-move",t(n=>{let s=Date.now();if(!(s-this.lastMouseMove<$e.throttling.mouseThrottle)){this.lastMouseMove=s;try{let o=r.getScreenSize(),c=Math.round(n.x/100*o.width),u=Math.round(n.y/100*o.height),d=Math.max(0,Math.min(o.width-1,c)),f=Math.max(0,Math.min(o.height-1,u));r.moveMouse(d,f),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Mouse move error:",o.message)}}})),e.on("mouse-click",t(async n=>{try{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=r.getScreenSize(),c=Math.round(n.x/100*o.width),u=Math.round(n.y/100*o.height),d=Math.max(0,Math.min(o.width-1,c)),f=Math.max(0,Math.min(o.height-1,u));r.moveMouse(d,f),r.mouseClick(n.button||"left",n.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 n=>{try{if(!this.resourceManager.getClient(e.id))return;let o=r.getScreenSize(),c=Math.round(n.x/100*o.width),u=Math.round(n.y/100*o.height),d=Math.max(0,Math.min(o.width-1,c)),f=Math.max(0,Math.min(o.height-1,u));r.moveMouse(d,f),r.mouseToggle("down",n.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse press error:",s.message)}})),e.on("mouse-release",t(async n=>{try{if(!this.resourceManager.getClient(e.id))return;let o=r.getScreenSize(),c=Math.round(n.x/100*o.width),u=Math.round(n.y/100*o.height),d=Math.max(0,Math.min(o.width-1,c)),f=Math.max(0,Math.min(o.height-1,u));r.moveMouse(d,f),r.mouseToggle("up",n.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse release error:",s.message)}})),e.on("scroll",t(async n=>{try{let{direction:s,amount:o=60,horizontal:c=!1}=n,u=this.resourceManager.getClient(e.id);if(!u)return;let d=0,f=0;c||s==="left"||s==="right"?d=s==="right"?o:-o:f=s==="down"?-o:o,r.scrollMouse(d,f),u.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Scroll error:",s.message)}})),e.on("mouse-drag-select",t(n=>{try{let{startX:s,startY:o,endX:c,endY:u}=n,d=r.getScreenSize(),f=Math.round(s/100*d.width),v=Math.round(o/100*d.height),_=Math.round(c/100*d.width),E=Math.round(u/100*d.height),C=Math.max(0,Math.min(d.width-1,f)),k=Math.max(0,Math.min(d.height-1,v)),M=Math.max(0,Math.min(d.width-1,_)),O=Math.max(0,Math.min(d.height-1,E));r.moveMouse(C,k),r.mouseToggle("down","left"),r.dragMouse(M,O),r.mouseToggle("up","left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Drag selection error:",s.message)}}))}}});var Em={};Ei(Em,{KeyboardHandler:()=>dl});var dl,Cm=Si(()=>{kr();dl=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastKeyPress=0,this.lastTypeText=0}setupKeyboardHandlers(e,t){let r=this.robot;e.on("key-press",t(n=>{let s=Date.now();if(!(s-this.lastKeyPress<$e.throttling.keyThrottle)){this.lastKeyPress=s;try{if(!n.key||typeof n.key!="string")return;let o=this.resourceManager.getClient(e.id),c=n.key;if(c.length===1){r.keyTap(c,n.modifier||[]);for(let u of n.modifier||[])r.keyToggle(u,"up")}else switch(c.toLowerCase()){case"enter":case"return":r.keyTap("enter");break;case"space":r.keyTap(" ");break;case"backspace":r.keyTap("backspace");break;case"tab":r.keyTap("tab");break;case"escape":r.keyTap("escape");break;default:r.keyTap(c,n.modifier||[])}o&&(o.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Key press error:",o.message)}}})),e.on("type-text",t(n=>{let s=Date.now();if(!(s-this.lastTypeText<$e.throttling.typeTextThrottle)){this.lastTypeText=s;try{if(!n.text||typeof n.text!="string")return;let o=n.text;o.length>$e.throttling.maxTextLength&&(o=o.substring(0,$e.throttling.maxTextLength));let c=o.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,""),u=this.resourceManager.getClient(e.id);setTimeout(()=>{try{r.typeString(c),this.resourceManager.updateClientActivity(e.id),u&&(u.idleFrameCount=0,u.tileManager&&u.tileManager.clearScreenCache())}catch(d){console.error("Robot typeString error:",d.message)}},10)}catch(o){console.error("Type text error:",o.message)}}}))}}});var Tm={};Ei(Tm,{ScreenHandler:()=>hl});function J1(i){let e=Buffer.alloc(24);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),e.writeUInt32LE(i.imageBuffer.length,20),Buffer.concat([e,i.imageBuffer])}function fl(i,e){let t=Buffer.alloc(12);return t.writeUInt32LE(i.length,0),t.writeDoubleBE(e,4),Buffer.concat([t,...i.map(J1)])}var hl,km=Si(()=>{hl=class{constructor(e,t){this.resourceManager=e,this.screenUpdateHelper=t}setupScreenHandlers(e,t,r){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&&r.sendTiles({tiles:s,timestamp:Date.now()},fl),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Tile capture error:",s),r.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 o=n.tileHashes||[],c=await s.tileManager.compareClientTileHashes(o);c?.tiles?.length>0?r.sendTiles({tiles:c.tiles,timestamp:Date.now(),currentHashes:c.currentHashes,changedIndices:c.changedIndices},fl):r.emit("tiles-data",{tiles:[],timestamp:Date.now(),currentHashes:c.currentHashes,changedIndices:[]}),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Tile capture with hashes error:",o),r.emit("screen-error",{error:o.message})}})),e.on("start-streaming",t(async()=>{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,n.tileManager.lastTileChecksums.clear();try{let o=await n.tileManager.getScreenDimensions();r.emit("screen-dimensions",o)}catch(o){console.error("Get dimensions error:",o.message)}let s=async()=>{if(!e.connected||!n.isStreaming){n.streamingTimeout=null;return}try{let o=performance.now(),c=await n.tileManager.detectChangedTilesWithHashes();c.tiles.length>0&&e.connected?(r.sendTiles({tiles:c.tiles,timestamp:Date.now(),currentHashes:c.currentHashes},fl),n.idleFrameCount=0):n.idleFrameCount++;let{activeInterval:u,idleInterval:d,idleThreshold:f}=this.resourceManager.getStreamingConfig(),v=n.idleFrameCount>=f?d:u,_=Math.max(0,v-(performance.now()-o));n.streamingTimeout=setTimeout(s,_)}catch(o){console.error("Auto streaming error:",o),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();r.emit("screen-dimensions",s)}catch(s){console.error("Get dimensions error:",s),r.emit("screen-error",{error:s.message})}})),e.on("boost-stream",t(()=>{let n=this.resourceManager.getClient(e.id);n&&(n.idleFrameCount=0)}))}}});var El=T((iv,Sl)=>{(function(i,e){"use strict";function t(b,a){if(!b)throw new Error(a||"Assertion failed")}function r(b,a){b.super_=a;var p=function(){};p.prototype=a.prototype,b.prototype=new p,b.prototype.constructor=b}function n(b,a,p){if(n.isBN(b))return b;this.negative=0,this.words=null,this.length=0,this.red=null,b!==null&&((a==="le"||a==="be")&&(p=a,a=10),this._init(b||0,a||10,p||"be"))}typeof i=="object"?i.exports=n:e.BN=n,n.BN=n,n.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=require("buffer").Buffer}catch{}n.isBN=function(a){return a instanceof n?!0:a!==null&&typeof a=="object"&&a.constructor.wordSize===n.wordSize&&Array.isArray(a.words)},n.max=function(a,p){return a.cmp(p)>0?a:p},n.min=function(a,p){return a.cmp(p)<0?a:p},n.prototype._init=function(a,p,h){if(typeof a=="number")return this._initNumber(a,p,h);if(typeof a=="object")return this._initArray(a,p,h);p==="hex"&&(p=16),t(p===(p|0)&&p>=2&&p<=36),a=a.toString().replace(/\s+/g,"");var m=0;a[0]==="-"&&(m++,this.negative=1),m<a.length&&(p===16?this._parseHex(a,m,h):(this._parseBase(a,p,m),h==="le"&&this._initArray(this.toArray(),p,h)))},n.prototype._initNumber=function(a,p,h){a<0&&(this.negative=1,a=-a),a<67108864?(this.words=[a&67108863],this.length=1):a<4503599627370496?(this.words=[a&67108863,a/67108864&67108863],this.length=2):(t(a<9007199254740992),this.words=[a&67108863,a/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),p,h)},n.prototype._initArray=function(a,p,h){if(t(typeof a.length=="number"),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.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=a.length-1,y=0;m>=0;m-=3)w=a[m]|a[m-1]<<8|a[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<a.length;m+=3)w=a[m]|a[m+1]<<8|a[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,a){var p=b.charCodeAt(a);return p>=65&&p<=70?p-55:p>=97&&p<=102?p-87:p-48&15}function c(b,a,p){var h=o(b,p);return p-1>=a&&(h|=o(b,p-1)<<4),h}n.prototype._parseHex=function(a,p,h){this.length=Math.ceil((a.length-p)/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=a.length-1;m>=p;m-=2)S=c(a,p,m)<<y,this.words[w]|=S&67108863,y>=18?(y-=18,w+=1,this.words[w]|=S>>>26):y+=8;else{var g=a.length-p;for(m=g%2===0?p+1:p;m<a.length;m+=2)S=c(a,p,m)<<y,this.words[w]|=S&67108863,y>=18?(y-=18,w+=1,this.words[w]|=S>>>26):y+=8}this.strip()};function u(b,a,p,h){for(var m=0,y=Math.min(b.length,p),w=a;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}n.prototype._parseBase=function(a,p,h){this.words=[0],this.length=1;for(var m=0,y=1;y<=67108863;y*=p)m++;m--,y=y/p|0;for(var w=a.length-h,S=w%m,g=Math.min(w,w-S)+h,l=0,x=h;x<g;x+=m)l=u(a,x,x+m,p),this.imuln(y),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(S!==0){var R=1;for(l=u(a,x,a.length,p),x=0;x<S;x++)R*=p;this.imuln(R),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this.strip()},n.prototype.copy=function(a){a.words=new Array(this.length);for(var p=0;p<this.length;p++)a.words[p]=this.words[p];a.length=this.length,a.negative=this.negative,a.red=this.red},n.prototype.clone=function(){var a=new n(null);return this.copy(a),a},n.prototype._expand=function(a){for(;this.length<a;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var d=["","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];n.prototype.toString=function(a,p){a=a||10,p=p|0||1;var h;if(a===16||a==="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=d[6-g.length]+g+h:h=g+h}for(y!==0&&(h=y.toString(16)+h);h.length%p!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(a===(a|0)&&a>=2&&a<=36){var l=f[a],x=v[a];h="";var R=this.clone();for(R.negative=0;!R.isZero();){var P=R.modn(x).toString(a);R=R.idivn(x),R.isZero()?h=P+h:h=d[l-P.length]+P+h}for(this.isZero()&&(h="0"+h);h.length%p!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}t(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var a=this.words[0];return this.length===2?a+=this.words[1]*67108864:this.length===3&&this.words[2]===1?a+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-a:a},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(a,p){return t(typeof s<"u"),this.toArrayLike(s,a,p)},n.prototype.toArray=function(a,p){return this.toArrayLike(Array,a,p)},n.prototype.toArrayLike=function(a,p,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=p==="le",S=new a(y),g,l,x=this.clone();if(w){for(l=0;!x.isZero();l++)g=x.andln(255),x.iushrn(8),S[l]=g;for(;l<y;l++)S[l]=0}else{for(l=0;l<y-m;l++)S[l]=0;for(l=0;!x.isZero();l++)g=x.andln(255),x.iushrn(8),S[y-l-1]=g}return S},Math.clz32?n.prototype._countBits=function(a){return 32-Math.clz32(a)}:n.prototype._countBits=function(a){var p=a,h=0;return p>=4096&&(h+=13,p>>>=13),p>=64&&(h+=7,p>>>=7),p>=8&&(h+=4,p>>>=4),p>=2&&(h+=2,p>>>=2),h+p},n.prototype._zeroBits=function(a){if(a===0)return 26;var p=a,h=0;return(p&8191)===0&&(h+=13,p>>>=13),(p&127)===0&&(h+=7,p>>>=7),(p&15)===0&&(h+=4,p>>>=4),(p&3)===0&&(h+=2,p>>>=2),(p&1)===0&&h++,h},n.prototype.bitLength=function(){var a=this.words[this.length-1],p=this._countBits(a);return(this.length-1)*26+p};function _(b){for(var a=new Array(b.bitLength()),p=0;p<a.length;p++){var h=p/26|0,m=p%26;a[p]=(b.words[h]&1<<m)>>>m}return a}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,p=0;p<this.length;p++){var h=this._zeroBits(this.words[p]);if(a+=h,h!==26)break}return a},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(a){return this.negative!==0?this.abs().inotn(a).iaddn(1):this.clone()},n.prototype.fromTwos=function(a){return this.testn(a-1)?this.notn(a).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(a){for(;this.length<a.length;)this.words[this.length++]=0;for(var p=0;p<a.length;p++)this.words[p]=this.words[p]|a.words[p];return this.strip()},n.prototype.ior=function(a){return t((this.negative|a.negative)===0),this.iuor(a)},n.prototype.or=function(a){return this.length>a.length?this.clone().ior(a):a.clone().ior(this)},n.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},n.prototype.iuand=function(a){var p;this.length>a.length?p=a:p=this;for(var h=0;h<p.length;h++)this.words[h]=this.words[h]&a.words[h];return this.length=p.length,this.strip()},n.prototype.iand=function(a){return t((this.negative|a.negative)===0),this.iuand(a)},n.prototype.and=function(a){return this.length>a.length?this.clone().iand(a):a.clone().iand(this)},n.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},n.prototype.iuxor=function(a){var p,h;this.length>a.length?(p=this,h=a):(p=a,h=this);for(var m=0;m<h.length;m++)this.words[m]=p.words[m]^h.words[m];if(this!==p)for(;m<p.length;m++)this.words[m]=p.words[m];return this.length=p.length,this.strip()},n.prototype.ixor=function(a){return t((this.negative|a.negative)===0),this.iuxor(a)},n.prototype.xor=function(a){return this.length>a.length?this.clone().ixor(a):a.clone().ixor(this)},n.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},n.prototype.inotn=function(a){t(typeof a=="number"&&a>=0);var p=Math.ceil(a/26)|0,h=a%26;this._expand(p),h>0&&p--;for(var m=0;m<p;m++)this.words[m]=~this.words[m]&67108863;return h>0&&(this.words[m]=~this.words[m]&67108863>>26-h),this.strip()},n.prototype.notn=function(a){return this.clone().inotn(a)},n.prototype.setn=function(a,p){t(typeof a=="number"&&a>=0);var h=a/26|0,m=a%26;return this._expand(h+1),p?this.words[h]=this.words[h]|1<<m:this.words[h]=this.words[h]&~(1<<m),this.strip()},n.prototype.iadd=function(a){var p;if(this.negative!==0&&a.negative===0)return this.negative=0,p=this.isub(a),this.negative^=1,this._normSign();if(this.negative===0&&a.negative!==0)return a.negative=0,p=this.isub(a),a.negative=1,p._normSign();var h,m;this.length>a.length?(h=this,m=a):(h=a,m=this);for(var y=0,w=0;w<m.length;w++)p=(h.words[w]|0)+(m.words[w]|0)+y,this.words[w]=p&67108863,y=p>>>26;for(;y!==0&&w<h.length;w++)p=(h.words[w]|0)+y,this.words[w]=p&67108863,y=p>>>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},n.prototype.add=function(a){var p;return a.negative!==0&&this.negative===0?(a.negative=0,p=this.sub(a),a.negative^=1,p):a.negative===0&&this.negative!==0?(this.negative=0,p=a.sub(this),this.negative=1,p):this.length>a.length?this.clone().iadd(a):a.clone().iadd(this)},n.prototype.isub=function(a){if(a.negative!==0){a.negative=0;var p=this.iadd(a);return a.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var h=this.cmp(a);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,y;h>0?(m=this,y=a):(m=a,y=this);for(var w=0,S=0;S<y.length;S++)p=(m.words[S]|0)-(y.words[S]|0)+w,w=p>>26,this.words[S]=p&67108863;for(;w!==0&&S<m.length;S++)p=(m.words[S]|0)+w,w=p>>26,this.words[S]=p&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()},n.prototype.sub=function(a){return this.clone().isub(a)};function E(b,a,p){p.negative=a.negative^b.negative;var h=b.length+a.length|0;p.length=h,h=h-1|0;var m=b.words[0]|0,y=a.words[0]|0,w=m*y,S=w&67108863,g=w/67108864|0;p.words[0]=S;for(var l=1;l<h;l++){for(var x=g>>>26,R=g&67108863,P=Math.min(l,a.length-1),B=Math.max(0,l-b.length+1);B<=P;B++){var D=l-B|0;m=b.words[D]|0,y=a.words[B]|0,w=m*y+R,x+=w/67108864|0,R=w&67108863}p.words[l]=R|0,g=x|0}return g!==0?p.words[l]=g|0:p.length--,p.strip()}var C=function(a,p,h){var m=a.words,y=p.words,w=h.words,S=0,g,l,x,R=m[0]|0,P=R&8191,B=R>>>13,D=m[1]|0,F=D&8191,V=D>>>13,ui=m[2]|0,K=ui&8191,Y=ui>>>13,Mu=m[3]|0,ne=Mu&8191,se=Mu>>>13,Ou=m[4]|0,oe=Ou&8191,ae=Ou>>>13,Au=m[5]|0,ce=Au&8191,le=Au>>>13,Ru=m[6]|0,ue=Ru&8191,pe=Ru>>>13,Pu=m[7]|0,de=Pu&8191,fe=Pu>>>13,Bu=m[8]|0,he=Bu&8191,me=Bu>>>13,Nu=m[9]|0,ve=Nu&8191,ge=Nu>>>13,Iu=y[0]|0,xe=Iu&8191,ye=Iu>>>13,Du=y[1]|0,be=Du&8191,we=Du>>>13,ju=y[2]|0,_e=ju&8191,Se=ju>>>13,Lu=y[3]|0,Ee=Lu&8191,Ce=Lu>>>13,qu=y[4]|0,Te=qu&8191,ke=qu>>>13,Fu=y[5]|0,Me=Fu&8191,Oe=Fu>>>13,Uu=y[6]|0,Ae=Uu&8191,Re=Uu>>>13,Hu=y[7]|0,Pe=Hu&8191,Be=Hu>>>13,zu=y[8]|0,Ne=zu&8191,Ie=zu>>>13,Wu=y[9]|0,De=Wu&8191,je=Wu>>>13;h.negative=a.negative^p.negative,h.length=19,g=Math.imul(P,xe),l=Math.imul(P,ye),l=l+Math.imul(B,xe)|0,x=Math.imul(B,ye);var Wo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Wo>>>26)|0,Wo&=67108863,g=Math.imul(F,xe),l=Math.imul(F,ye),l=l+Math.imul(V,xe)|0,x=Math.imul(V,ye),g=g+Math.imul(P,be)|0,l=l+Math.imul(P,we)|0,l=l+Math.imul(B,be)|0,x=x+Math.imul(B,we)|0;var $o=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+($o>>>26)|0,$o&=67108863,g=Math.imul(K,xe),l=Math.imul(K,ye),l=l+Math.imul(Y,xe)|0,x=Math.imul(Y,ye),g=g+Math.imul(F,be)|0,l=l+Math.imul(F,we)|0,l=l+Math.imul(V,be)|0,x=x+Math.imul(V,we)|0,g=g+Math.imul(P,_e)|0,l=l+Math.imul(P,Se)|0,l=l+Math.imul(B,_e)|0,x=x+Math.imul(B,Se)|0;var Vo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Vo>>>26)|0,Vo&=67108863,g=Math.imul(ne,xe),l=Math.imul(ne,ye),l=l+Math.imul(se,xe)|0,x=Math.imul(se,ye),g=g+Math.imul(K,be)|0,l=l+Math.imul(K,we)|0,l=l+Math.imul(Y,be)|0,x=x+Math.imul(Y,we)|0,g=g+Math.imul(F,_e)|0,l=l+Math.imul(F,Se)|0,l=l+Math.imul(V,_e)|0,x=x+Math.imul(V,Se)|0,g=g+Math.imul(P,Ee)|0,l=l+Math.imul(P,Ce)|0,l=l+Math.imul(B,Ee)|0,x=x+Math.imul(B,Ce)|0;var Ko=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Ko>>>26)|0,Ko&=67108863,g=Math.imul(oe,xe),l=Math.imul(oe,ye),l=l+Math.imul(ae,xe)|0,x=Math.imul(ae,ye),g=g+Math.imul(ne,be)|0,l=l+Math.imul(ne,we)|0,l=l+Math.imul(se,be)|0,x=x+Math.imul(se,we)|0,g=g+Math.imul(K,_e)|0,l=l+Math.imul(K,Se)|0,l=l+Math.imul(Y,_e)|0,x=x+Math.imul(Y,Se)|0,g=g+Math.imul(F,Ee)|0,l=l+Math.imul(F,Ce)|0,l=l+Math.imul(V,Ee)|0,x=x+Math.imul(V,Ce)|0,g=g+Math.imul(P,Te)|0,l=l+Math.imul(P,ke)|0,l=l+Math.imul(B,Te)|0,x=x+Math.imul(B,ke)|0;var Go=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Go>>>26)|0,Go&=67108863,g=Math.imul(ce,xe),l=Math.imul(ce,ye),l=l+Math.imul(le,xe)|0,x=Math.imul(le,ye),g=g+Math.imul(oe,be)|0,l=l+Math.imul(oe,we)|0,l=l+Math.imul(ae,be)|0,x=x+Math.imul(ae,we)|0,g=g+Math.imul(ne,_e)|0,l=l+Math.imul(ne,Se)|0,l=l+Math.imul(se,_e)|0,x=x+Math.imul(se,Se)|0,g=g+Math.imul(K,Ee)|0,l=l+Math.imul(K,Ce)|0,l=l+Math.imul(Y,Ee)|0,x=x+Math.imul(Y,Ce)|0,g=g+Math.imul(F,Te)|0,l=l+Math.imul(F,ke)|0,l=l+Math.imul(V,Te)|0,x=x+Math.imul(V,ke)|0,g=g+Math.imul(P,Me)|0,l=l+Math.imul(P,Oe)|0,l=l+Math.imul(B,Me)|0,x=x+Math.imul(B,Oe)|0;var Yo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Yo>>>26)|0,Yo&=67108863,g=Math.imul(ue,xe),l=Math.imul(ue,ye),l=l+Math.imul(pe,xe)|0,x=Math.imul(pe,ye),g=g+Math.imul(ce,be)|0,l=l+Math.imul(ce,we)|0,l=l+Math.imul(le,be)|0,x=x+Math.imul(le,we)|0,g=g+Math.imul(oe,_e)|0,l=l+Math.imul(oe,Se)|0,l=l+Math.imul(ae,_e)|0,x=x+Math.imul(ae,Se)|0,g=g+Math.imul(ne,Ee)|0,l=l+Math.imul(ne,Ce)|0,l=l+Math.imul(se,Ee)|0,x=x+Math.imul(se,Ce)|0,g=g+Math.imul(K,Te)|0,l=l+Math.imul(K,ke)|0,l=l+Math.imul(Y,Te)|0,x=x+Math.imul(Y,ke)|0,g=g+Math.imul(F,Me)|0,l=l+Math.imul(F,Oe)|0,l=l+Math.imul(V,Me)|0,x=x+Math.imul(V,Oe)|0,g=g+Math.imul(P,Ae)|0,l=l+Math.imul(P,Re)|0,l=l+Math.imul(B,Ae)|0,x=x+Math.imul(B,Re)|0;var Jo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Jo>>>26)|0,Jo&=67108863,g=Math.imul(de,xe),l=Math.imul(de,ye),l=l+Math.imul(fe,xe)|0,x=Math.imul(fe,ye),g=g+Math.imul(ue,be)|0,l=l+Math.imul(ue,we)|0,l=l+Math.imul(pe,be)|0,x=x+Math.imul(pe,we)|0,g=g+Math.imul(ce,_e)|0,l=l+Math.imul(ce,Se)|0,l=l+Math.imul(le,_e)|0,x=x+Math.imul(le,Se)|0,g=g+Math.imul(oe,Ee)|0,l=l+Math.imul(oe,Ce)|0,l=l+Math.imul(ae,Ee)|0,x=x+Math.imul(ae,Ce)|0,g=g+Math.imul(ne,Te)|0,l=l+Math.imul(ne,ke)|0,l=l+Math.imul(se,Te)|0,x=x+Math.imul(se,ke)|0,g=g+Math.imul(K,Me)|0,l=l+Math.imul(K,Oe)|0,l=l+Math.imul(Y,Me)|0,x=x+Math.imul(Y,Oe)|0,g=g+Math.imul(F,Ae)|0,l=l+Math.imul(F,Re)|0,l=l+Math.imul(V,Ae)|0,x=x+Math.imul(V,Re)|0,g=g+Math.imul(P,Pe)|0,l=l+Math.imul(P,Be)|0,l=l+Math.imul(B,Pe)|0,x=x+Math.imul(B,Be)|0;var Xo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Xo>>>26)|0,Xo&=67108863,g=Math.imul(he,xe),l=Math.imul(he,ye),l=l+Math.imul(me,xe)|0,x=Math.imul(me,ye),g=g+Math.imul(de,be)|0,l=l+Math.imul(de,we)|0,l=l+Math.imul(fe,be)|0,x=x+Math.imul(fe,we)|0,g=g+Math.imul(ue,_e)|0,l=l+Math.imul(ue,Se)|0,l=l+Math.imul(pe,_e)|0,x=x+Math.imul(pe,Se)|0,g=g+Math.imul(ce,Ee)|0,l=l+Math.imul(ce,Ce)|0,l=l+Math.imul(le,Ee)|0,x=x+Math.imul(le,Ce)|0,g=g+Math.imul(oe,Te)|0,l=l+Math.imul(oe,ke)|0,l=l+Math.imul(ae,Te)|0,x=x+Math.imul(ae,ke)|0,g=g+Math.imul(ne,Me)|0,l=l+Math.imul(ne,Oe)|0,l=l+Math.imul(se,Me)|0,x=x+Math.imul(se,Oe)|0,g=g+Math.imul(K,Ae)|0,l=l+Math.imul(K,Re)|0,l=l+Math.imul(Y,Ae)|0,x=x+Math.imul(Y,Re)|0,g=g+Math.imul(F,Pe)|0,l=l+Math.imul(F,Be)|0,l=l+Math.imul(V,Pe)|0,x=x+Math.imul(V,Be)|0,g=g+Math.imul(P,Ne)|0,l=l+Math.imul(P,Ie)|0,l=l+Math.imul(B,Ne)|0,x=x+Math.imul(B,Ie)|0;var Zo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Zo>>>26)|0,Zo&=67108863,g=Math.imul(ve,xe),l=Math.imul(ve,ye),l=l+Math.imul(ge,xe)|0,x=Math.imul(ge,ye),g=g+Math.imul(he,be)|0,l=l+Math.imul(he,we)|0,l=l+Math.imul(me,be)|0,x=x+Math.imul(me,we)|0,g=g+Math.imul(de,_e)|0,l=l+Math.imul(de,Se)|0,l=l+Math.imul(fe,_e)|0,x=x+Math.imul(fe,Se)|0,g=g+Math.imul(ue,Ee)|0,l=l+Math.imul(ue,Ce)|0,l=l+Math.imul(pe,Ee)|0,x=x+Math.imul(pe,Ce)|0,g=g+Math.imul(ce,Te)|0,l=l+Math.imul(ce,ke)|0,l=l+Math.imul(le,Te)|0,x=x+Math.imul(le,ke)|0,g=g+Math.imul(oe,Me)|0,l=l+Math.imul(oe,Oe)|0,l=l+Math.imul(ae,Me)|0,x=x+Math.imul(ae,Oe)|0,g=g+Math.imul(ne,Ae)|0,l=l+Math.imul(ne,Re)|0,l=l+Math.imul(se,Ae)|0,x=x+Math.imul(se,Re)|0,g=g+Math.imul(K,Pe)|0,l=l+Math.imul(K,Be)|0,l=l+Math.imul(Y,Pe)|0,x=x+Math.imul(Y,Be)|0,g=g+Math.imul(F,Ne)|0,l=l+Math.imul(F,Ie)|0,l=l+Math.imul(V,Ne)|0,x=x+Math.imul(V,Ie)|0,g=g+Math.imul(P,De)|0,l=l+Math.imul(P,je)|0,l=l+Math.imul(B,De)|0,x=x+Math.imul(B,je)|0;var Qo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Qo>>>26)|0,Qo&=67108863,g=Math.imul(ve,be),l=Math.imul(ve,we),l=l+Math.imul(ge,be)|0,x=Math.imul(ge,we),g=g+Math.imul(he,_e)|0,l=l+Math.imul(he,Se)|0,l=l+Math.imul(me,_e)|0,x=x+Math.imul(me,Se)|0,g=g+Math.imul(de,Ee)|0,l=l+Math.imul(de,Ce)|0,l=l+Math.imul(fe,Ee)|0,x=x+Math.imul(fe,Ce)|0,g=g+Math.imul(ue,Te)|0,l=l+Math.imul(ue,ke)|0,l=l+Math.imul(pe,Te)|0,x=x+Math.imul(pe,ke)|0,g=g+Math.imul(ce,Me)|0,l=l+Math.imul(ce,Oe)|0,l=l+Math.imul(le,Me)|0,x=x+Math.imul(le,Oe)|0,g=g+Math.imul(oe,Ae)|0,l=l+Math.imul(oe,Re)|0,l=l+Math.imul(ae,Ae)|0,x=x+Math.imul(ae,Re)|0,g=g+Math.imul(ne,Pe)|0,l=l+Math.imul(ne,Be)|0,l=l+Math.imul(se,Pe)|0,x=x+Math.imul(se,Be)|0,g=g+Math.imul(K,Ne)|0,l=l+Math.imul(K,Ie)|0,l=l+Math.imul(Y,Ne)|0,x=x+Math.imul(Y,Ie)|0,g=g+Math.imul(F,De)|0,l=l+Math.imul(F,je)|0,l=l+Math.imul(V,De)|0,x=x+Math.imul(V,je)|0;var ea=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(ea>>>26)|0,ea&=67108863,g=Math.imul(ve,_e),l=Math.imul(ve,Se),l=l+Math.imul(ge,_e)|0,x=Math.imul(ge,Se),g=g+Math.imul(he,Ee)|0,l=l+Math.imul(he,Ce)|0,l=l+Math.imul(me,Ee)|0,x=x+Math.imul(me,Ce)|0,g=g+Math.imul(de,Te)|0,l=l+Math.imul(de,ke)|0,l=l+Math.imul(fe,Te)|0,x=x+Math.imul(fe,ke)|0,g=g+Math.imul(ue,Me)|0,l=l+Math.imul(ue,Oe)|0,l=l+Math.imul(pe,Me)|0,x=x+Math.imul(pe,Oe)|0,g=g+Math.imul(ce,Ae)|0,l=l+Math.imul(ce,Re)|0,l=l+Math.imul(le,Ae)|0,x=x+Math.imul(le,Re)|0,g=g+Math.imul(oe,Pe)|0,l=l+Math.imul(oe,Be)|0,l=l+Math.imul(ae,Pe)|0,x=x+Math.imul(ae,Be)|0,g=g+Math.imul(ne,Ne)|0,l=l+Math.imul(ne,Ie)|0,l=l+Math.imul(se,Ne)|0,x=x+Math.imul(se,Ie)|0,g=g+Math.imul(K,De)|0,l=l+Math.imul(K,je)|0,l=l+Math.imul(Y,De)|0,x=x+Math.imul(Y,je)|0;var ta=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(ta>>>26)|0,ta&=67108863,g=Math.imul(ve,Ee),l=Math.imul(ve,Ce),l=l+Math.imul(ge,Ee)|0,x=Math.imul(ge,Ce),g=g+Math.imul(he,Te)|0,l=l+Math.imul(he,ke)|0,l=l+Math.imul(me,Te)|0,x=x+Math.imul(me,ke)|0,g=g+Math.imul(de,Me)|0,l=l+Math.imul(de,Oe)|0,l=l+Math.imul(fe,Me)|0,x=x+Math.imul(fe,Oe)|0,g=g+Math.imul(ue,Ae)|0,l=l+Math.imul(ue,Re)|0,l=l+Math.imul(pe,Ae)|0,x=x+Math.imul(pe,Re)|0,g=g+Math.imul(ce,Pe)|0,l=l+Math.imul(ce,Be)|0,l=l+Math.imul(le,Pe)|0,x=x+Math.imul(le,Be)|0,g=g+Math.imul(oe,Ne)|0,l=l+Math.imul(oe,Ie)|0,l=l+Math.imul(ae,Ne)|0,x=x+Math.imul(ae,Ie)|0,g=g+Math.imul(ne,De)|0,l=l+Math.imul(ne,je)|0,l=l+Math.imul(se,De)|0,x=x+Math.imul(se,je)|0;var ia=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(ia>>>26)|0,ia&=67108863,g=Math.imul(ve,Te),l=Math.imul(ve,ke),l=l+Math.imul(ge,Te)|0,x=Math.imul(ge,ke),g=g+Math.imul(he,Me)|0,l=l+Math.imul(he,Oe)|0,l=l+Math.imul(me,Me)|0,x=x+Math.imul(me,Oe)|0,g=g+Math.imul(de,Ae)|0,l=l+Math.imul(de,Re)|0,l=l+Math.imul(fe,Ae)|0,x=x+Math.imul(fe,Re)|0,g=g+Math.imul(ue,Pe)|0,l=l+Math.imul(ue,Be)|0,l=l+Math.imul(pe,Pe)|0,x=x+Math.imul(pe,Be)|0,g=g+Math.imul(ce,Ne)|0,l=l+Math.imul(ce,Ie)|0,l=l+Math.imul(le,Ne)|0,x=x+Math.imul(le,Ie)|0,g=g+Math.imul(oe,De)|0,l=l+Math.imul(oe,je)|0,l=l+Math.imul(ae,De)|0,x=x+Math.imul(ae,je)|0;var ra=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(ra>>>26)|0,ra&=67108863,g=Math.imul(ve,Me),l=Math.imul(ve,Oe),l=l+Math.imul(ge,Me)|0,x=Math.imul(ge,Oe),g=g+Math.imul(he,Ae)|0,l=l+Math.imul(he,Re)|0,l=l+Math.imul(me,Ae)|0,x=x+Math.imul(me,Re)|0,g=g+Math.imul(de,Pe)|0,l=l+Math.imul(de,Be)|0,l=l+Math.imul(fe,Pe)|0,x=x+Math.imul(fe,Be)|0,g=g+Math.imul(ue,Ne)|0,l=l+Math.imul(ue,Ie)|0,l=l+Math.imul(pe,Ne)|0,x=x+Math.imul(pe,Ie)|0,g=g+Math.imul(ce,De)|0,l=l+Math.imul(ce,je)|0,l=l+Math.imul(le,De)|0,x=x+Math.imul(le,je)|0;var na=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(na>>>26)|0,na&=67108863,g=Math.imul(ve,Ae),l=Math.imul(ve,Re),l=l+Math.imul(ge,Ae)|0,x=Math.imul(ge,Re),g=g+Math.imul(he,Pe)|0,l=l+Math.imul(he,Be)|0,l=l+Math.imul(me,Pe)|0,x=x+Math.imul(me,Be)|0,g=g+Math.imul(de,Ne)|0,l=l+Math.imul(de,Ie)|0,l=l+Math.imul(fe,Ne)|0,x=x+Math.imul(fe,Ie)|0,g=g+Math.imul(ue,De)|0,l=l+Math.imul(ue,je)|0,l=l+Math.imul(pe,De)|0,x=x+Math.imul(pe,je)|0;var sa=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(sa>>>26)|0,sa&=67108863,g=Math.imul(ve,Pe),l=Math.imul(ve,Be),l=l+Math.imul(ge,Pe)|0,x=Math.imul(ge,Be),g=g+Math.imul(he,Ne)|0,l=l+Math.imul(he,Ie)|0,l=l+Math.imul(me,Ne)|0,x=x+Math.imul(me,Ie)|0,g=g+Math.imul(de,De)|0,l=l+Math.imul(de,je)|0,l=l+Math.imul(fe,De)|0,x=x+Math.imul(fe,je)|0;var oa=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(oa>>>26)|0,oa&=67108863,g=Math.imul(ve,Ne),l=Math.imul(ve,Ie),l=l+Math.imul(ge,Ne)|0,x=Math.imul(ge,Ie),g=g+Math.imul(he,De)|0,l=l+Math.imul(he,je)|0,l=l+Math.imul(me,De)|0,x=x+Math.imul(me,je)|0;var aa=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(aa>>>26)|0,aa&=67108863,g=Math.imul(ve,De),l=Math.imul(ve,je),l=l+Math.imul(ge,De)|0,x=Math.imul(ge,je);var ca=(S+g|0)+((l&8191)<<13)|0;return S=(x+(l>>>13)|0)+(ca>>>26)|0,ca&=67108863,w[0]=Wo,w[1]=$o,w[2]=Vo,w[3]=Ko,w[4]=Go,w[5]=Yo,w[6]=Jo,w[7]=Xo,w[8]=Zo,w[9]=Qo,w[10]=ea,w[11]=ta,w[12]=ia,w[13]=ra,w[14]=na,w[15]=sa,w[16]=oa,w[17]=aa,w[18]=ca,S!==0&&(w[19]=S,h.length++),h};Math.imul||(C=E);function k(b,a,p){p.negative=a.negative^b.negative,p.length=b.length+a.length;for(var h=0,m=0,y=0;y<p.length-1;y++){var w=m;m=0;for(var S=h&67108863,g=Math.min(y,a.length-1),l=Math.max(0,y-b.length+1);l<=g;l++){var x=y-l,R=b.words[x]|0,P=a.words[l]|0,B=R*P,D=B&67108863;w=w+(B/67108864|0)|0,D=D+S|0,S=D&67108863,w=w+(D>>>26)|0,m+=w>>>26,w&=67108863}p.words[y]=S,h=w,w=m}return h!==0?p.words[y]=h:p.length--,p.strip()}function M(b,a,p){var h=new O;return h.mulp(b,a,p)}n.prototype.mulTo=function(a,p){var h,m=this.length+a.length;return this.length===10&&a.length===10?h=C(this,a,p):m<63?h=E(this,a,p):m<1024?h=k(this,a,p):h=M(this,a,p),h};function O(b,a){this.x=b,this.y=a}O.prototype.makeRBT=function(a){for(var p=new Array(a),h=n.prototype._countBits(a)-1,m=0;m<a;m++)p[m]=this.revBin(m,h,a);return p},O.prototype.revBin=function(a,p,h){if(a===0||a===h-1)return a;for(var m=0,y=0;y<p;y++)m|=(a&1)<<p-y-1,a>>=1;return m},O.prototype.permute=function(a,p,h,m,y,w){for(var S=0;S<w;S++)m[S]=p[a[S]],y[S]=h[a[S]]},O.prototype.transform=function(a,p,h,m,y,w){this.permute(w,a,p,h,m,y);for(var S=1;S<y;S<<=1)for(var g=S<<1,l=Math.cos(2*Math.PI/g),x=Math.sin(2*Math.PI/g),R=0;R<y;R+=g)for(var P=l,B=x,D=0;D<S;D++){var F=h[R+D],V=m[R+D],ui=h[R+D+S],K=m[R+D+S],Y=P*ui-B*K;K=P*K+B*ui,ui=Y,h[R+D]=F+ui,m[R+D]=V+K,h[R+D+S]=F-ui,m[R+D+S]=V-K,D!==g&&(Y=l*P-x*B,B=l*B+x*P,P=Y)}},O.prototype.guessLen13b=function(a,p){var h=Math.max(p,a)|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(a,p,h){if(!(h<=1))for(var m=0;m<h/2;m++){var y=a[m];a[m]=a[h-m-1],a[h-m-1]=y,y=p[m],p[m]=-p[h-m-1],p[h-m-1]=-y}},O.prototype.normalize13b=function(a,p){for(var h=0,m=0;m<p/2;m++){var y=Math.round(a[2*m+1]/p)*8192+Math.round(a[2*m]/p)+h;a[m]=y&67108863,y<67108864?h=0:h=y/67108864|0}return a},O.prototype.convert13b=function(a,p,h,m){for(var y=0,w=0;w<p;w++)y=y+(a[w]|0),h[2*w]=y&8191,y=y>>>13,h[2*w+1]=y&8191,y=y>>>13;for(w=2*p;w<m;++w)h[w]=0;t(y===0),t((y&-8192)===0)},O.prototype.stub=function(a){for(var p=new Array(a),h=0;h<a;h++)p[h]=0;return p},O.prototype.mulp=function(a,p,h){var m=2*this.guessLen13b(a.length,p.length),y=this.makeRBT(m),w=this.stub(m),S=new Array(m),g=new Array(m),l=new Array(m),x=new Array(m),R=new Array(m),P=new Array(m),B=h.words;B.length=m,this.convert13b(a.words,a.length,S,m),this.convert13b(p.words,p.length,x,m),this.transform(S,w,g,l,m,y),this.transform(x,w,R,P,m,y);for(var D=0;D<m;D++){var F=g[D]*R[D]-l[D]*P[D];l[D]=g[D]*P[D]+l[D]*R[D],g[D]=F}return this.conjugate(g,l,m),this.transform(g,l,B,w,m,y),this.conjugate(B,w,m),this.normalize13b(B,m),h.negative=a.negative^p.negative,h.length=a.length+p.length,h.strip()},n.prototype.mul=function(a){var p=new n(null);return p.words=new Array(this.length+a.length),this.mulTo(a,p)},n.prototype.mulf=function(a){var p=new n(null);return p.words=new Array(this.length+a.length),M(this,a,p)},n.prototype.imul=function(a){return this.clone().mulTo(a,this)},n.prototype.imuln=function(a){t(typeof a=="number"),t(a<67108864);for(var p=0,h=0;h<this.length;h++){var m=(this.words[h]|0)*a,y=(m&67108863)+(p&67108863);p>>=26,p+=m/67108864|0,p+=y>>>26,this.words[h]=y&67108863}return p!==0&&(this.words[h]=p,this.length++),this.length=a===0?1:this.length,this},n.prototype.muln=function(a){return this.clone().imuln(a)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(a){var p=_(a);if(p.length===0)return new n(1);for(var h=this,m=0;m<p.length&&p[m]===0;m++,h=h.sqr());if(++m<p.length)for(var y=h.sqr();m<p.length;m++,y=y.sqr())p[m]!==0&&(h=h.mul(y));return h},n.prototype.iushln=function(a){t(typeof a=="number"&&a>=0);var p=a%26,h=(a-p)/26,m=67108863>>>26-p<<26-p,y;if(p!==0){var w=0;for(y=0;y<this.length;y++){var S=this.words[y]&m,g=(this.words[y]|0)-S<<p;this.words[y]=g|w,w=S>>>26-p}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()},n.prototype.ishln=function(a){return t(this.negative===0),this.iushln(a)},n.prototype.iushrn=function(a,p,h){t(typeof a=="number"&&a>=0);var m;p?m=(p-p%26)/26:m=0;var y=a%26,w=Math.min((a-y)/26,this.length),S=67108863^67108863>>>y<<y,g=h;if(m-=w,m=Math.max(0,m),g){for(var l=0;l<w;l++)g.words[l]=this.words[l];g.length=w}if(w!==0)if(this.length>w)for(this.length-=w,l=0;l<this.length;l++)this.words[l]=this.words[l+w];else this.words[0]=0,this.length=1;var x=0;for(l=this.length-1;l>=0&&(x!==0||l>=m);l--){var R=this.words[l]|0;this.words[l]=x<<26-y|R>>>y,x=R&S}return g&&x!==0&&(g.words[g.length++]=x),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(a,p,h){return t(this.negative===0),this.iushrn(a,p,h)},n.prototype.shln=function(a){return this.clone().ishln(a)},n.prototype.ushln=function(a){return this.clone().iushln(a)},n.prototype.shrn=function(a){return this.clone().ishrn(a)},n.prototype.ushrn=function(a){return this.clone().iushrn(a)},n.prototype.testn=function(a){t(typeof a=="number"&&a>=0);var p=a%26,h=(a-p)/26,m=1<<p;if(this.length<=h)return!1;var y=this.words[h];return!!(y&m)},n.prototype.imaskn=function(a){t(typeof a=="number"&&a>=0);var p=a%26,h=(a-p)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(p!==0&&h++,this.length=Math.min(h,this.length),p!==0){var m=67108863^67108863>>>p<<p;this.words[this.length-1]&=m}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.maskn=function(a){return this.clone().imaskn(a)},n.prototype.iaddn=function(a){return t(typeof a=="number"),t(a<67108864),a<0?this.isubn(-a):this.negative!==0?this.length===1&&(this.words[0]|0)<a?(this.words[0]=a-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(a),this.negative=1,this):this._iaddn(a)},n.prototype._iaddn=function(a){this.words[0]+=a;for(var p=0;p<this.length&&this.words[p]>=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},n.prototype.isubn=function(a){if(t(typeof a=="number"),t(a<67108864),a<0)return this.iaddn(-a);if(this.negative!==0)return this.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p<this.length&&this.words[p]<0;p++)this.words[p]+=67108864,this.words[p+1]-=1;return this.strip()},n.prototype.addn=function(a){return this.clone().iaddn(a)},n.prototype.subn=function(a){return this.clone().isubn(a)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(a,p,h){var m=a.length+h,y;this._expand(m);var w,S=0;for(y=0;y<a.length;y++){w=(this.words[y+h]|0)+S;var g=(a.words[y]|0)*p;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()},n.prototype._wordDiv=function(a,p){var h=this.length-a.length,m=this.clone(),y=a,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,l;if(p!=="mod"){l=new n(null),l.length=g+1,l.words=new Array(l.length);for(var x=0;x<l.length;x++)l.words[x]=0}var R=m.clone()._ishlnsubmul(y,1,g);R.negative===0&&(m=R,l&&(l.words[g]=1));for(var P=g-1;P>=0;P--){var B=(m.words[y.length+P]|0)*67108864+(m.words[y.length+P-1]|0);for(B=Math.min(B/w|0,67108863),m._ishlnsubmul(y,B,P);m.negative!==0;)B--,m.negative=0,m._ishlnsubmul(y,1,P),m.isZero()||(m.negative^=1);l&&(l.words[P]=B)}return l&&l.strip(),m.strip(),p!=="div"&&h!==0&&m.iushrn(h),{div:l||null,mod:m}},n.prototype.divmod=function(a,p,h){if(t(!a.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var m,y,w;return this.negative!==0&&a.negative===0?(w=this.neg().divmod(a,p),p!=="mod"&&(m=w.div.neg()),p!=="div"&&(y=w.mod.neg(),h&&y.negative!==0&&y.iadd(a)),{div:m,mod:y}):this.negative===0&&a.negative!==0?(w=this.divmod(a.neg(),p),p!=="mod"&&(m=w.div.neg()),{div:m,mod:w.mod}):(this.negative&a.negative)!==0?(w=this.neg().divmod(a.neg(),p),p!=="div"&&(y=w.mod.neg(),h&&y.negative!==0&&y.isub(a)),{div:w.div,mod:y}):a.length>this.length||this.cmp(a)<0?{div:new n(0),mod:this}:a.length===1?p==="div"?{div:this.divn(a.words[0]),mod:null}:p==="mod"?{div:null,mod:new n(this.modn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new n(this.modn(a.words[0]))}:this._wordDiv(a,p)},n.prototype.div=function(a){return this.divmod(a,"div",!1).div},n.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},n.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},n.prototype.divRound=function(a){var p=this.divmod(a);if(p.mod.isZero())return p.div;var h=p.div.negative!==0?p.mod.isub(a):p.mod,m=a.ushrn(1),y=a.andln(1),w=h.cmp(m);return w<0||y===1&&w===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},n.prototype.modn=function(a){t(a<=67108863);for(var p=(1<<26)%a,h=0,m=this.length-1;m>=0;m--)h=(p*h+(this.words[m]|0))%a;return h},n.prototype.idivn=function(a){t(a<=67108863);for(var p=0,h=this.length-1;h>=0;h--){var m=(this.words[h]|0)+p*67108864;this.words[h]=m/a|0,p=m%a}return this.strip()},n.prototype.divn=function(a){return this.clone().idivn(a)},n.prototype.egcd=function(a){t(a.negative===0),t(!a.isZero());var p=this,h=a.clone();p.negative!==0?p=p.umod(a):p=p.clone();for(var m=new n(1),y=new n(0),w=new n(0),S=new n(1),g=0;p.isEven()&&h.isEven();)p.iushrn(1),h.iushrn(1),++g;for(var l=h.clone(),x=p.clone();!p.isZero();){for(var R=0,P=1;(p.words[0]&P)===0&&R<26;++R,P<<=1);if(R>0)for(p.iushrn(R);R-- >0;)(m.isOdd()||y.isOdd())&&(m.iadd(l),y.isub(x)),m.iushrn(1),y.iushrn(1);for(var B=0,D=1;(h.words[0]&D)===0&&B<26;++B,D<<=1);if(B>0)for(h.iushrn(B);B-- >0;)(w.isOdd()||S.isOdd())&&(w.iadd(l),S.isub(x)),w.iushrn(1),S.iushrn(1);p.cmp(h)>=0?(p.isub(h),m.isub(w),y.isub(S)):(h.isub(p),w.isub(m),S.isub(y))}return{a:w,b:S,gcd:h.iushln(g)}},n.prototype._invmp=function(a){t(a.negative===0),t(!a.isZero());var p=this,h=a.clone();p.negative!==0?p=p.umod(a):p=p.clone();for(var m=new n(1),y=new n(0),w=h.clone();p.cmpn(1)>0&&h.cmpn(1)>0;){for(var S=0,g=1;(p.words[0]&g)===0&&S<26;++S,g<<=1);if(S>0)for(p.iushrn(S);S-- >0;)m.isOdd()&&m.iadd(w),m.iushrn(1);for(var l=0,x=1;(h.words[0]&x)===0&&l<26;++l,x<<=1);if(l>0)for(h.iushrn(l);l-- >0;)y.isOdd()&&y.iadd(w),y.iushrn(1);p.cmp(h)>=0?(p.isub(h),m.isub(y)):(h.isub(p),y.isub(m))}var R;return p.cmpn(1)===0?R=m:R=y,R.cmpn(0)<0&&R.iadd(a),R},n.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var p=this.clone(),h=a.clone();p.negative=0,h.negative=0;for(var m=0;p.isEven()&&h.isEven();m++)p.iushrn(1),h.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;h.isEven();)h.iushrn(1);var y=p.cmp(h);if(y<0){var w=p;p=h,h=w}else if(y===0||h.cmpn(1)===0)break;p.isub(h)}while(!0);return h.iushln(m)},n.prototype.invm=function(a){return this.egcd(a).a.umod(a)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(a){return this.words[0]&a},n.prototype.bincn=function(a){t(typeof a=="number");var p=a%26,h=(a-p)/26,m=1<<p;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},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(a){var p=a<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this.strip();var h;if(this.length>1)h=1;else{p&&(a=-a),t(a<=67108863,"Number is too big");var m=this.words[0]|0;h=m===a?0:m<a?-1:1}return this.negative!==0?-h|0:h},n.prototype.cmp=function(a){if(this.negative!==0&&a.negative===0)return-1;if(this.negative===0&&a.negative!==0)return 1;var p=this.ucmp(a);return this.negative!==0?-p|0:p},n.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;for(var p=0,h=this.length-1;h>=0;h--){var m=this.words[h]|0,y=a.words[h]|0;if(m!==y){m<y?p=-1:m>y&&(p=1);break}}return p},n.prototype.gtn=function(a){return this.cmpn(a)===1},n.prototype.gt=function(a){return this.cmp(a)===1},n.prototype.gten=function(a){return this.cmpn(a)>=0},n.prototype.gte=function(a){return this.cmp(a)>=0},n.prototype.ltn=function(a){return this.cmpn(a)===-1},n.prototype.lt=function(a){return this.cmp(a)===-1},n.prototype.lten=function(a){return this.cmpn(a)<=0},n.prototype.lte=function(a){return this.cmp(a)<=0},n.prototype.eqn=function(a){return this.cmpn(a)===0},n.prototype.eq=function(a){return this.cmp(a)===0},n.red=function(a){return new q(a)},n.prototype.toRed=function(a){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),a.convertTo(this)._forceRed(a)},n.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(a){return this.red=a,this},n.prototype.forceRed=function(a){return t(!this.red,"Already a number in reduction context"),this._forceRed(a)},n.prototype.redAdd=function(a){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},n.prototype.redIAdd=function(a){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},n.prototype.redSub=function(a){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},n.prototype.redISub=function(a){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},n.prototype.redShl=function(a){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},n.prototype.redMul=function(a){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},n.prototype.redIMul=function(a){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},n.prototype.redSqr=function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(a){return t(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var A={k256:null,p224:null,p192:null,p25519:null};function I(b,a){this.name=b,this.p=new n(a,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}I.prototype._tmp=function(){var a=new n(null);return a.words=new Array(Math.ceil(this.n/13)),a},I.prototype.ireduce=function(a){var p=a,h;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),h=p.bitLength();while(h>this.n);var m=h<this.n?-1:p.ucmp(this.p);return m===0?(p.words[0]=0,p.length=1):m>0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},I.prototype.split=function(a,p){a.iushrn(this.n,0,p)},I.prototype.imulK=function(a){return a.imul(this.k)};function U(){I.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}r(U,I),U.prototype.split=function(a,p){for(var h=4194303,m=Math.min(a.length,9),y=0;y<m;y++)p.words[y]=a.words[y];if(p.length=m,a.length<=9){a.words[0]=0,a.length=1;return}var w=a.words[9];for(p.words[p.length++]=w&h,y=10;y<a.length;y++){var S=a.words[y]|0;a.words[y-10]=(S&h)<<4|w>>>22,w=S}w>>>=22,a.words[y-10]=w,w===0&&a.length>10?a.length-=10:a.length-=9},U.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var p=0,h=0;h<a.length;h++){var m=a.words[h]|0;p+=m*977,a.words[h]=p&67108863,p=m*64+(p/67108864|0)}return a.words[a.length-1]===0&&(a.length--,a.words[a.length-1]===0&&a.length--),a};function Xe(){I.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}r(Xe,I);function te(){I.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}r(te,I);function Le(){I.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}r(Le,I),Le.prototype.imulK=function(a){for(var p=0,h=0;h<a.length;h++){var m=(a.words[h]|0)*19+p,y=m&67108863;m>>>=26,a.words[h]=y,p=m}return p!==0&&(a.words[a.length++]=p),a},n._prime=function(a){if(A[a])return A[a];var p;if(a==="k256")p=new U;else if(a==="p224")p=new Xe;else if(a==="p192")p=new te;else if(a==="p25519")p=new Le;else throw new Error("Unknown prime "+a);return A[a]=p,p};function q(b){if(typeof b=="string"){var a=n._prime(b);this.m=a.p,this.prime=a}else t(b.gtn(1),"modulus must be greater than 1"),this.m=b,this.prime=null}q.prototype._verify1=function(a){t(a.negative===0,"red works only with positives"),t(a.red,"red works only with red numbers")},q.prototype._verify2=function(a,p){t((a.negative|p.negative)===0,"red works only with positives"),t(a.red&&a.red===p.red,"red works only with red numbers")},q.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},q.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},q.prototype.add=function(a,p){this._verify2(a,p);var h=a.add(p);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},q.prototype.iadd=function(a,p){this._verify2(a,p);var h=a.iadd(p);return h.cmp(this.m)>=0&&h.isub(this.m),h},q.prototype.sub=function(a,p){this._verify2(a,p);var h=a.sub(p);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},q.prototype.isub=function(a,p){this._verify2(a,p);var h=a.isub(p);return h.cmpn(0)<0&&h.iadd(this.m),h},q.prototype.shl=function(a,p){return this._verify1(a),this.imod(a.ushln(p))},q.prototype.imul=function(a,p){return this._verify2(a,p),this.imod(a.imul(p))},q.prototype.mul=function(a,p){return this._verify2(a,p),this.imod(a.mul(p))},q.prototype.isqr=function(a){return this.imul(a,a.clone())},q.prototype.sqr=function(a){return this.mul(a,a)},q.prototype.sqrt=function(a){if(a.isZero())return a.clone();var p=this.m.andln(3);if(t(p%2===1),p===3){var h=this.m.add(new n(1)).iushrn(2);return this.pow(a,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 n(1).toRed(this),S=w.redNeg(),g=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new n(2*l*l).toRed(this);this.pow(l,g).cmp(S)!==0;)l.redIAdd(S);for(var x=this.pow(l,m),R=this.pow(a,m.addn(1).iushrn(1)),P=this.pow(a,m),B=y;P.cmp(w)!==0;){for(var D=P,F=0;D.cmp(w)!==0;F++)D=D.redSqr();t(F<B);var V=this.pow(x,new n(1).iushln(B-F-1));R=R.redMul(V),x=V.redSqr(),P=P.redMul(x),B=F}return R},q.prototype.invm=function(a){var p=a._invmp(this.m);return p.negative!==0?(p.negative=0,this.imod(p).redNeg()):this.imod(p)},q.prototype.pow=function(a,p){if(p.isZero())return new n(1).toRed(this);if(p.cmpn(1)===0)return a.clone();var h=4,m=new Array(1<<h);m[0]=new n(1).toRed(this),m[1]=a;for(var y=2;y<m.length;y++)m[y]=this.mul(m[y-1],a);var w=m[0],S=0,g=0,l=p.bitLength()%26;for(l===0&&(l=26),y=p.length-1;y>=0;y--){for(var x=p.words[y],R=l-1;R>=0;R--){var P=x>>R&1;if(w!==m[0]&&(w=this.sqr(w)),P===0&&S===0){g=0;continue}S<<=1,S|=P,g++,!(g!==h&&(y!==0||R!==0))&&(w=this.mul(w,m[S]),g=0,S=0)}l=26}return w},q.prototype.convertTo=function(a){var p=a.umod(this.m);return p===a?p.clone():p},q.prototype.convertFrom=function(a){var p=a.clone();return p.red=null,p},n.mont=function(a){return new qe(a)};function qe(b){q.call(this,b),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(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)}r(qe,q),qe.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},qe.prototype.convertFrom=function(a){var p=this.imod(a.mul(this.rinv));return p.red=null,p},qe.prototype.imul=function(a,p){if(a.isZero()||p.isZero())return a.words[0]=0,a.length=1,a;var h=a.imul(p),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)},qe.prototype.mul=function(a,p){if(a.isZero()||p.isZero())return new n(0)._forceRed(this);var h=a.mul(p),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)},qe.prototype.invm=function(a){var p=this.imod(a._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(typeof Sl>"u"||Sl,iv)});var rv=T((FO,Cl)=>{typeof Object.create=="function"?Cl.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Cl.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}});var wi=T((UO,kl)=>{try{if(Tl=require("util"),typeof Tl.inherits!="function")throw"";kl.exports=Tl.inherits}catch{kl.exports=rv()}var Tl});var io=T((HO,nv)=>{"use strict";var to=require("buffer"),Rr=to.Buffer,Et={},Ct;for(Ct in to)to.hasOwnProperty(Ct)&&(Ct==="SlowBuffer"||Ct==="Buffer"||(Et[Ct]=to[Ct]));var Pr=Et.Buffer={};for(Ct in Rr)Rr.hasOwnProperty(Ct)&&(Ct==="allocUnsafe"||Ct==="allocUnsafeSlow"||(Pr[Ct]=Rr[Ct]));Et.Buffer.prototype=Rr.prototype;(!Pr.from||Pr.from===Uint8Array.from)&&(Pr.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 Rr(i,e,t)});Pr.alloc||(Pr.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 r=Rr(i);return!e||e.length===0?r.fill(0):typeof t=="string"?r.fill(e,t):r.fill(e),r});if(!Et.kStringMaxLength)try{Et.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}Et.constants||(Et.constants={MAX_LENGTH:Et.kMaxLength},Et.kStringMaxLength&&(Et.constants.MAX_STRING_LENGTH=Et.kStringMaxLength));nv.exports=Et});var ro=T(sv=>{"use strict";var pE=wi();function Tt(i){this._reporterState={obj:null,path:[],options:i||{},errors:[]}}sv.Reporter=Tt;Tt.prototype.isError=function(e){return e instanceof Br};Tt.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};Tt.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)};Tt.prototype.enterKey=function(e){return this._reporterState.path.push(e)};Tt.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)};Tt.prototype.leaveKey=function(e,t,r){let n=this._reporterState;this.exitKey(e),n.obj!==null&&(n.obj[t]=r)};Tt.prototype.path=function(){return this._reporterState.path.join("/")};Tt.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t};Tt.prototype.leaveObject=function(e){let t=this._reporterState,r=t.obj;return t.obj=e,r};Tt.prototype.error=function(e){let t,r=this._reporterState,n=e instanceof Br;if(n?t=e:t=new Br(r.path.map(function(s){return"["+JSON.stringify(s)+"]"}).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.errors.push(t),t};Tt.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};function Br(i,e){this.path=i,this.rethrow(e)}pE(Br,Error);Br.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Br),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}});var Dr=T(Ml=>{"use strict";var dE=wi(),no=ro().Reporter,Nr=io().Buffer;function kt(i,e){if(no.call(this,e),!Nr.isBuffer(i)){this.error("Input not Buffer");return}this.base=i,this.offset=0,this.length=i.length}dE(kt,no);Ml.DecoderBuffer=kt;kt.isDecoderBuffer=function(e){return e instanceof kt?!0:typeof e=="object"&&Nr.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:no.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,no.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 r=new kt(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r};kt.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function Ir(i,e){if(Array.isArray(i))this.length=0,this.value=i.map(function(t){return Ir.isEncoderBuffer(t)||(t=new Ir(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=Nr.byteLength(i);else if(Nr.isBuffer(i))this.value=i,this.length=i.length;else return e.error("Unsupported type: "+typeof i)}Ml.EncoderBuffer=Ir;Ir.isEncoderBuffer=function(e){return e instanceof Ir?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};Ir.prototype.join=function(e,t){return e||(e=Nr.alloc(this.length)),t||(t=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(r){r.join(e,t),t+=r.length}):(typeof this.value=="number"?e[t]=this.value:typeof this.value=="string"?e.write(this.value,t):Nr.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}});var cv=T(($O,av)=>{av.exports=ov;function ov(i,e){if(!i)throw new Error(e||"Assertion failed")}ov.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}});var so=T((VO,uv)=>{"use strict";var fE=ro().Reporter,hE=Dr().EncoderBuffer,mE=Dr().DecoderBuffer,et=cv(),lv=["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"],vE=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(lv),gE=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function W(i,e,t){let r={};this._baseState=r,r.name=t,r.enc=i,r.parent=e||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}uv.exports=W;var xE=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];W.prototype.clone=function(){let e=this._baseState,t={};xE.forEach(function(n){t[n]=e[n]});let r=new this.constructor(t.parent);return r._baseState=t,r};W.prototype._wrap=function(){let e=this._baseState;vE.forEach(function(t){this[t]=function(){let n=new this.constructor(this);return e.children.push(n),n[t].apply(n,arguments)}},this)};W.prototype._init=function(e){let t=this._baseState;et(t.parent===null),e.call(this),t.children=t.children.filter(function(r){return r._baseState.parent===this},this),et.equal(t.children.length,1,"Root node can have only one child")};W.prototype._useArgs=function(e){let t=this._baseState,r=e.filter(function(n){return n instanceof this.constructor},this);e=e.filter(function(n){return!(n instanceof this.constructor)},this),r.length!==0&&(et(t.children===null),t.children=r,r.forEach(function(n){n._baseState.parent=this},this)),e.length!==0&&(et(t.args===null),t.args=e,t.reverseArgs=e.map(function(n){if(typeof n!="object"||n.constructor!==Object)return n;let s={};return Object.keys(n).forEach(function(o){o==(o|0)&&(o|=0);let c=n[o];s[c]=o}),s}))};gE.forEach(function(i){W.prototype[i]=function(){let t=this._baseState;throw new Error(i+" not implemented for encoding: "+t.enc)}});lv.forEach(function(i){W.prototype[i]=function(){let t=this._baseState,r=Array.prototype.slice.call(arguments);return et(t.tag===null),t.tag=i,this._useArgs(r),this}});W.prototype.use=function(e){et(e);let t=this._baseState;return et(t.use===null),t.use=e,this};W.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};W.prototype.def=function(e){let t=this._baseState;return et(t.default===null),t.default=e,t.optional=!0,this};W.prototype.explicit=function(e){let t=this._baseState;return et(t.explicit===null&&t.implicit===null),t.explicit=e,this};W.prototype.implicit=function(e){let t=this._baseState;return et(t.explicit===null&&t.implicit===null),t.implicit=e,this};W.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this};W.prototype.key=function(e){let t=this._baseState;return et(t.key===null),t.key=e,this};W.prototype.any=function(){let e=this._baseState;return e.any=!0,this};W.prototype.choice=function(e){let t=this._baseState;return et(t.choice===null),t.choice=e,this._useArgs(Object.keys(e).map(function(r){return e[r]})),this};W.prototype.contains=function(e){let t=this._baseState;return et(t.use===null),t.contains=e,this};W.prototype._decode=function(e,t){let r=this._baseState;if(r.parent===null)return e.wrapResult(r.children[0]._decode(e,t));let n=r.default,s=!0,o=null;if(r.key!==null&&(o=e.enterKey(r.key)),r.optional){let u=null;if(r.explicit!==null?u=r.explicit:r.implicit!==null?u=r.implicit:r.tag!==null&&(u=r.tag),u===null&&!r.any){let d=e.save();try{r.choice===null?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),s=!0}catch{s=!1}e.restore(d)}else if(s=this._peekTag(e,u,r.any),e.isError(s))return s}let c;if(r.obj&&s&&(c=e.enterObject()),s){if(r.explicit!==null){let d=this._decodeTag(e,r.explicit);if(e.isError(d))return d;e=d}let u=e.offset;if(r.use===null&&r.choice===null){let d;r.any&&(d=e.save());let f=this._decodeTag(e,r.implicit!==null?r.implicit:r.tag,r.any);if(e.isError(f))return f;r.any?n=e.raw(d):e=f}if(t&&t.track&&r.tag!==null&&t.track(e.path(),u,e.length,"tagged"),t&&t.track&&r.tag!==null&&t.track(e.path(),e.offset,e.length,"content"),r.any||(r.choice===null?n=this._decodeGeneric(r.tag,e,t):n=this._decodeChoice(e,t)),e.isError(n))return n;if(!r.any&&r.choice===null&&r.children!==null&&r.children.forEach(function(f){f._decode(e,t)}),r.contains&&(r.tag==="octstr"||r.tag==="bitstr")){let d=new mE(n);n=this._getUse(r.contains,e._reporterState.obj)._decode(d,t)}}return r.obj&&s&&(n=e.leaveObject(c)),r.key!==null&&(n!==null||s===!0)?e.leaveKey(o,r.key,n):o!==null&&e.exitKey(o),n};W.prototype._decodeGeneric=function(e,t,r){let n=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(t,e,n.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):e==="objid"&&n.args?this._decodeObjid(t,n.args[0],n.args[1],r):e==="objid"?this._decodeObjid(t,null,null,r):e==="gentime"||e==="utctime"?this._decodeTime(t,e,r):e==="null_"?this._decodeNull(t,r):e==="bool"?this._decodeBool(t,r):e==="objDesc"?this._decodeStr(t,e,r):e==="int"||e==="enum"?this._decodeInt(t,n.args&&n.args[0],r):n.use!==null?this._getUse(n.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)};W.prototype._getUse=function(e,t){let r=this._baseState;return r.useDecoder=this._use(e,t),et(r.useDecoder._baseState.parent===null),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder};W.prototype._decodeChoice=function(e,t){let r=this._baseState,n=null,s=!1;return Object.keys(r.choice).some(function(o){let c=e.save(),u=r.choice[o];try{let d=u._decode(e,t);if(e.isError(d))return!1;n={type:o,value:d},s=!0}catch{return e.restore(c),!1}return!0},this),s?n:e.error("Choice not matched")};W.prototype._createEncoderBuffer=function(e){return new hE(e,this.reporter)};W.prototype._encode=function(e,t,r){let n=this._baseState;if(n.default!==null&&n.default===e)return;let s=this._encodeValue(e,t,r);if(s!==void 0&&!this._skipDefault(s,t,r))return s};W.prototype._encodeValue=function(e,t,r){let n=this._baseState;if(n.parent===null)return n.children[0]._encode(e,t||new fE);let s=null;if(this.reporter=t,n.optional&&e===void 0)if(n.default!==null)e=n.default;else return;let o=null,c=!1;if(n.any)s=this._createEncoderBuffer(e);else if(n.choice)s=this._encodeChoice(e,t);else if(n.contains)o=this._getUse(n.contains,r)._encode(e,t),c=!0;else if(n.children)o=n.children.map(function(u){if(u._baseState.tag==="null_")return u._encode(null,t,e);if(u._baseState.key===null)return t.error("Child should have a key");let d=t.enterKey(u._baseState.key);if(typeof e!="object")return t.error("Child expected, but input is not object");let f=u._encode(e[u._baseState.key],t,e);return t.leaveKey(d),f},this).filter(function(u){return u}),o=this._createEncoderBuffer(o);else if(n.tag==="seqof"||n.tag==="setof"){if(!(n.args&&n.args.length===1))return t.error("Too many args for : "+n.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");let u=this.clone();u._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(d){let f=this._baseState;return this._getUse(f.args[0],e)._encode(d,t)},u))}else n.use!==null?s=this._getUse(n.use,r)._encode(e,t):(o=this._encodePrimitive(n.tag,e),c=!0);if(!n.any&&n.choice===null){let u=n.implicit!==null?n.implicit:n.tag,d=n.implicit===null?"universal":"context";u===null?n.use===null&&t.error("Tag could be omitted only for .use()"):n.use===null&&(s=this._encodeComposite(u,c,d,o))}return n.explicit!==null&&(s=this._encodeComposite(n.explicit,!1,"context",s)),s};W.prototype._encodeChoice=function(e,t){let r=this._baseState,n=r.choice[e.type];return n||et(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)};W.prototype._encodePrimitive=function(e,t){let r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if(e==="objid"&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.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,r.args&&r.reverseArgs[0]);if(e==="bool")return this._encodeBool(t);if(e==="objDesc")return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)};W.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};W.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var oo=T(Fi=>{"use strict";function pv(i){let e={};return Object.keys(i).forEach(function(t){(t|0)==t&&(t=t|0);let r=i[t];e[r]=t}),e}Fi.tagClass={0:"universal",1:"application",2:"context",3:"private"};Fi.tagClassByName=pv(Fi.tagClass);Fi.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"};Fi.tagByName=pv(Fi.tag)});var Al=T((GO,hv)=>{"use strict";var yE=wi(),ai=io().Buffer,dv=so(),Ol=oo();function fv(i){this.enc="der",this.name=i.name,this.entity=i,this.tree=new jt,this.tree._init(i.body)}hv.exports=fv;fv.prototype.encode=function(e,t){return this.tree._encode(e,t).join()};function jt(i){dv.call(this,"der",i)}yE(jt,dv);jt.prototype._encodeComposite=function(e,t,r,n){let s=bE(e,t,r,this.reporter);if(n.length<128){let u=ai.alloc(2);return u[0]=s,u[1]=n.length,this._createEncoderBuffer([u,n])}let o=1;for(let u=n.length;u>=256;u>>=8)o++;let c=ai.alloc(2+o);c[0]=s,c[1]=128|o;for(let u=1+o,d=n.length;d>0;u--,d>>=8)c[u]=d&255;return this._createEncoderBuffer([c,n])};jt.prototype._encodeStr=function(e,t){if(t==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(t==="bmpstr"){let r=ai.alloc(e.length*2);for(let n=0;n<e.length;n++)r.writeUInt16BE(e.charCodeAt(n),n*2);return this._createEncoderBuffer(r)}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,r){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 c=0;c<e.length;c++)e[c]|=0}else if(Array.isArray(e)){e=e.slice();for(let c=0;c<e.length;c++)e[c]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!r){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}let n=0;for(let c=0;c<e.length;c++){let u=e[c];for(n++;u>=128;u>>=7)n++}let s=ai.alloc(n),o=s.length-1;for(let c=e.length-1;c>=0;c--){let u=e[c];for(s[o--]=u&127;(u>>=7)>0;)s[o--]=128|u&127}return this._createEncoderBuffer(s)};function Mt(i){return i<10?"0"+i:i}jt.prototype._encodeTime=function(e,t){let r,n=new Date(e);return t==="gentime"?r=[Mt(n.getUTCFullYear()),Mt(n.getUTCMonth()+1),Mt(n.getUTCDate()),Mt(n.getUTCHours()),Mt(n.getUTCMinutes()),Mt(n.getUTCSeconds()),"Z"].join(""):t==="utctime"?r=[Mt(n.getUTCFullYear()%100),Mt(n.getUTCMonth()+1),Mt(n.getUTCDate()),Mt(n.getUTCHours()),Mt(n.getUTCMinutes()),Mt(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"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"&&!ai.isBuffer(e)){let s=e.toArray();!e.sign&&s[0]&128&&s.unshift(0),e=ai.from(s)}if(ai.isBuffer(e)){let s=e.length;e.length===0&&s++;let o=ai.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 r=1;for(let s=e;s>=256;s>>=8)r++;let n=new Array(r);for(let s=n.length-1;s>=0;s--)n[s]=e&255,e>>=8;return n[0]&128&&n.unshift(0),this._createEncoderBuffer(ai.from(n))};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,r){let n=this._baseState,s;if(n.default===null)return!1;let o=e.join();if(n.defaultBuffer===void 0&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),o.length!==n.defaultBuffer.length)return!1;for(s=0;s<o.length;s++)if(o[s]!==n.defaultBuffer[s])return!1;return!0};function bE(i,e,t,r){let n;if(i==="seqof"?i="seq":i==="setof"&&(i="set"),Ol.tagByName.hasOwnProperty(i))n=Ol.tagByName[i];else if(typeof i=="number"&&(i|0)===i)n=i;else return r.error("Unknown tag: "+i);return n>=31?r.error("Multi-octet tag encoding unsupported"):(e||(n|=32),n|=Ol.tagClassByName[t||"universal"]<<6,n)}});var vv=T((YO,mv)=>{"use strict";var wE=wi(),Rl=Al();function Pl(i){Rl.call(this,i),this.enc="pem"}wE(Pl,Rl);mv.exports=Pl;Pl.prototype.encode=function(e,t){let n=Rl.prototype.encode.call(this,e).toString("base64"),s=["-----BEGIN "+t.label+"-----"];for(let o=0;o<n.length;o+=64)s.push(n.slice(o,o+64));return s.push("-----END "+t.label+"-----"),s.join(`
|
|
21
|
+
`)}});var Bl=T(xv=>{"use strict";var gv=xv;gv.der=Al();gv.pem=vv()});var Il=T((XO,Ev)=>{"use strict";var _E=wi(),SE=El(),yv=Dr().DecoderBuffer,wv=so(),bv=oo();function _v(i){this.enc="der",this.name=i.name,this.entity=i,this.tree=new ft,this.tree._init(i.body)}Ev.exports=_v;_v.prototype.decode=function(e,t){return yv.isDecoderBuffer(e)||(e=new yv(e,t)),this.tree._decode(e,t)};function ft(i){wv.call(this,"der",i)}_E(ft,wv);ft.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;let n=e.save(),s=Nl(e,'Failed to peek tag: "'+t+'"');return e.isError(s)?s:(e.restore(n),s.tag===t||s.tagStr===t||s.tagStr+"of"===t||r)};ft.prototype._decodeTag=function(e,t,r){let n=Nl(e,'Failed to decode tag of "'+t+'"');if(e.isError(n))return n;let s=Sv(e,n.primitive,'Failed to get length of "'+t+'"');if(e.isError(s))return s;if(!r&&n.tag!==t&&n.tagStr!==t&&n.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(n.primitive||s!==null)return e.skip(s,'Failed to match body of: "'+t+'"');let o=e.save(),c=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(c)?c:(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 r=Nl(e,t);if(e.isError(r))return r;let n=Sv(e,r.primitive,t);if(e.isError(n))return n;let s;if(r.primitive||n!==null?s=e.skip(n):s=this._skipUntilEnd(e,t),e.isError(s))return s;if(r.tagStr==="end")break}};ft.prototype._decodeList=function(e,t,r,n){let s=[];for(;!e.isEmpty();){let o=this._peekTag(e,"end");if(e.isError(o))return o;let c=r.decode(e,"der",n);if(e.isError(c)&&o)break;s.push(c)}return s};ft.prototype._decodeStr=function(e,t){if(t==="bitstr"){let r=e.readUInt8();return e.isError(r)?r:{unused:r,data:e.raw()}}else if(t==="bmpstr"){let r=e.raw();if(r.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");let n="";for(let s=0;s<r.length/2;s++)n+=String.fromCharCode(r.readUInt16BE(s*2));return n}else if(t==="numstr"){let r=e.raw().toString("ascii");return this._isNumstr(r)?r: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 r=e.raw().toString("ascii");return this._isPrintstr(r)?r: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,r){let n,s=[],o=0,c=0;for(;!e.isEmpty();)c=e.readUInt8(),o<<=7,o|=c&127,(c&128)===0&&(s.push(o),o=0);c&128&&s.push(o);let u=s[0]/40|0,d=s[0]%40;if(r?n=s:n=[u,d].concat(s.slice(1)),t){let f=t[n.join(" ")];f===void 0&&(f=t[n.join(".")]),f!==void 0&&(n=f)}return n};ft.prototype._decodeTime=function(e,t){let r=e.raw().toString(),n,s,o,c,u,d;if(t==="gentime")n=r.slice(0,4)|0,s=r.slice(4,6)|0,o=r.slice(6,8)|0,c=r.slice(8,10)|0,u=r.slice(10,12)|0,d=r.slice(12,14)|0;else if(t==="utctime")n=r.slice(0,2)|0,s=r.slice(2,4)|0,o=r.slice(4,6)|0,c=r.slice(6,8)|0,u=r.slice(8,10)|0,d=r.slice(10,12)|0,n<70?n=2e3+n:n=1900+n;else return e.error("Decoding "+t+" time is not supported yet");return Date.UTC(n,s-1,o,c,u,d,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 r=e.raw(),n=new SE(r);return t&&(n=t[n.toString(10)]||n),n};ft.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getDecoder("der").tree};function Nl(i,e){let t=i.readUInt8(e);if(i.isError(t))return t;let r=bv.tagClass[t>>6],n=(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=bv.tag[t];return{cls:r,primitive:n,tag:t,tagStr:s}}function Sv(i,e,t){let r=i.readUInt8(t);if(i.isError(r))return r;if(!e&&r===128)return null;if((r&128)===0)return r;let n=r&127;if(n>4)return i.error("length octect is too long");r=0;for(let s=0;s<n;s++){r<<=8;let o=i.readUInt8(t);if(i.isError(o))return o;r|=o}return r}});var Tv=T((ZO,Cv)=>{"use strict";var EE=wi(),CE=io().Buffer,Dl=Il();function jl(i){Dl.call(this,i),this.enc="pem"}EE(jl,Dl);Cv.exports=jl;jl.prototype.decode=function(e,t){let r=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,c=-1;for(let f=0;f<r.length;f++){let v=r[f].match(s);if(v!==null&&v[2]===n)if(o===-1){if(v[1]!=="BEGIN")break;o=f}else{if(v[1]!=="END")break;c=f;break}}if(o===-1||c===-1)throw new Error("PEM section not found for: "+n);let u=r.slice(o+1,c).join("");u.replace(/[^a-z0-9+/=]+/gi,"");let d=CE.from(u,"base64");return Dl.prototype.decode.call(this,d,t)}});var Ll=T(Mv=>{"use strict";var kv=Mv;kv.der=Il();kv.pem=Tv()});var Av=T(Ov=>{"use strict";var TE=Bl(),kE=Ll(),ME=wi(),OE=Ov;OE.define=function(e,t){return new jr(e,t)};function jr(i,e){this.name=i,this.body=e,this.decoders={},this.encoders={}}jr.prototype._createNamed=function(e){let t=this.name;function r(n){this._initNamed(n,t)}return ME(r,e),r.prototype._initNamed=function(s,o){e.call(this,s,o)},new r(this)};jr.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(kE[e])),this.decoders[e]};jr.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)};jr.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(TE[e])),this.encoders[e]};jr.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}});var Pv=T(Rv=>{"use strict";var ao=Rv;ao.Reporter=ro().Reporter;ao.DecoderBuffer=Dr().DecoderBuffer;ao.EncoderBuffer=Dr().EncoderBuffer;ao.Node=so()});var Iv=T(Nv=>{"use strict";var Bv=Nv;Bv._reverse=function(e){let t={};return Object.keys(e).forEach(function(r){(r|0)==r&&(r=r|0);let n=e[r];t[n]=r}),t};Bv.der=oo()});var jv=T(Dv=>{"use strict";var Lr=Dv;Lr.bignum=El();Lr.define=Av().define;Lr.base=Pv();Lr.constants=Iv();Lr.decoders=Ll();Lr.encoders=Bl()});var qr=T((ql,qv)=>{var co=require("buffer"),Kt=co.Buffer;function Lv(i,e){for(var t in i)e[t]=i[t]}Kt.from&&Kt.alloc&&Kt.allocUnsafe&&Kt.allocUnsafeSlow?qv.exports=co:(Lv(co,ql),ql.Buffer=Ui);function Ui(i,e,t){return Kt(i,e,t)}Ui.prototype=Object.create(Kt.prototype);Lv(Kt,Ui);Ui.from=function(i,e,t){if(typeof i=="number")throw new TypeError("Argument must not be a number");return Kt(i,e,t)};Ui.alloc=function(i,e,t){if(typeof i!="number")throw new TypeError("Argument must be a number");var r=Kt(i);return e!==void 0?typeof t=="string"?r.fill(e,t):r.fill(e):r.fill(0),r};Ui.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return Kt(i)};Ui.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return co.SlowBuffer(i)}});var Fl=T((nA,Fv)=>{var lo=qr().Buffer,AE=require("stream"),RE=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+")")}RE.inherits(uo,AE);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};Fv.exports=uo});var Hv=T((sA,Uv)=>{"use strict";function Ul(i){var e=(i/8|0)+(i%8===0?0:1);return e}var PE={ES256:Ul(256),ES384:Ul(384),ES512:Ul(521)};function BE(i){var e=PE[i];if(e)return e;throw new Error('Unknown algorithm "'+i+'"')}Uv.exports=BE});var Yv=T((oA,Gv)=>{"use strict";var po=qr().Buffer,Wv=Hv(),fo=128,$v=0,NE=32,IE=16,DE=2,Vv=IE|NE|$v<<6,ho=DE|$v<<6;function jE(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Kv(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 LE(i,e){i=Kv(i);var t=Wv(e),r=t+1,n=i.length,s=0;if(i[s++]!==Vv)throw new Error('Could not find expected "seq"');var o=i[s++];if(o===(fo|1)&&(o=i[s++]),n-s<o)throw new Error('"seq" specified length of "'+o+'", only "'+(n-s)+'" remaining');if(i[s++]!==ho)throw new Error('Could not find expected "int" for "r"');var c=i[s++];if(n-s-2<c)throw new Error('"r" specified length of "'+c+'", only "'+(n-s-2)+'" available');if(r<c)throw new Error('"r" specified length of "'+c+'", max of "'+r+'" is acceptable');var u=s;if(s+=c,i[s++]!==ho)throw new Error('Could not find expected "int" for "s"');var d=i[s++];if(n-s!==d)throw new Error('"s" specified length of "'+d+'", expected "'+(n-s)+'"');if(r<d)throw new Error('"s" specified length of "'+d+'", max of "'+r+'" is acceptable');var f=s;if(s+=d,s!==n)throw new Error('Expected to consume entire buffer, but "'+(n-s)+'" bytes remain');var v=t-c,_=t-d,E=po.allocUnsafe(v+c+_+d);for(s=0;s<v;++s)E[s]=0;i.copy(E,s,u+Math.max(-v,0),u+c),s=t;for(var C=s;s<C+_;++s)E[s]=0;return i.copy(E,s,f+Math.max(-_,0),f+d),E=E.toString("base64"),E=jE(E),E}function zv(i,e,t){for(var r=0;e+r<t&&i[e+r]===0;)++r;var n=i[e+r]>=fo;return n&&--r,r}function qE(i,e){i=Kv(i);var t=Wv(e),r=i.length;if(r!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+r+'"');var n=zv(i,0,t),s=zv(i,t,i.length),o=t-n,c=t-s,u=2+o+1+1+c,d=u<fo,f=po.allocUnsafe((d?2:3)+u),v=0;return f[v++]=Vv,d?f[v++]=u:(f[v++]=fo|1,f[v++]=u&255),f[v++]=ho,f[v++]=o,n<0?(f[v++]=0,v+=i.copy(f,v,0,t)):v+=i.copy(f,v,n,t),f[v++]=ho,f[v++]=c,s<0?(f[v++]=0,i.copy(f,v,t)):i.copy(f,v,t+s),f}Gv.exports={derToJose:LE,joseToDer:qE}});var Xv=T((aA,Jv)=>{"use strict";var mn=require("buffer").Buffer,Hl=require("buffer").SlowBuffer;Jv.exports=mo;function mo(i,e){if(!mn.isBuffer(i)||!mn.isBuffer(e)||i.length!==e.length)return!1;for(var t=0,r=0;r<i.length;r++)t|=i[r]^e[r];return t===0}mo.install=function(){mn.prototype.equal=Hl.prototype.equal=function(e){return mo(this,e)}};var FE=mn.prototype.equal,UE=Hl.prototype.equal;mo.restore=function(){mn.prototype.equal=FE,Hl.prototype.equal=UE}});var Vl=T((cA,og)=>{var Ur=qr().Buffer,Ot=require("crypto"),Qv=Yv(),Zv=require("util"),HE=`"%s" is not a valid algorithm.
|
|
22
22
|
Supported algorithms are:
|
|
23
|
-
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,vn="secret must be a string or buffer",Fr="key must be a string or a buffer",HE="key must be a string, a buffer or an object",Wl=typeof Ot.createPublicKey=="function";Wl&&(Fr+=" or a KeyObject",vn+="or a KeyObject");function eg(i){if(!Ur.isBuffer(i)&&typeof i!="string"&&(!Wl||typeof i!="object"||typeof i.type!="string"||typeof i.asymmetricKeyType!="string"||typeof i.export!="function"))throw Lt(Fr)}function tg(i){if(!Ur.isBuffer(i)&&typeof i!="string"&&typeof i!="object")throw Lt(HE)}function zE(i){if(!Ur.isBuffer(i)){if(typeof i=="string")return i;if(!Wl||typeof i!="object"||i.type!=="secret"||typeof i.export!="function")throw Lt(vn)}}function $l(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function ig(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 Lt(i){var e=[].slice.call(arguments,1),t=Zv.format.bind(Zv,i).apply(null,e);return new TypeError(t)}function WE(i){return Ur.isBuffer(i)||typeof i=="string"}function gn(i){return WE(i)||(i=JSON.stringify(i)),i}function rg(i){return function(t,r){zE(r),t=gn(t);var n=Ot.createHmac("sha"+i,r),s=(n.update(t),n.digest("base64"));return $l(s)}}var zl,$E="timingSafeEqual"in Ot?function(e,t){return e.byteLength!==t.byteLength?!1:Ot.timingSafeEqual(e,t)}:function(e,t){return zl||(zl=Xv()),zl(e,t)};function VE(i){return function(t,r,n){var s=rg(i)(t,n);return $E(Ur.from(r),Ur.from(s))}}function ng(i){return function(t,r){tg(r),t=gn(t);var n=Ot.createSign("RSA-SHA"+i),s=(n.update(t),n.sign(r,"base64"));return $l(s)}}function sg(i){return function(t,r,n){eg(n),t=gn(t),r=ig(r);var s=Ot.createVerify("RSA-SHA"+i);return s.update(t),s.verify(n,r,"base64")}}function KE(i){return function(t,r){tg(r),t=gn(t);var n=Ot.createSign("RSA-SHA"+i),s=(n.update(t),n.sign({key:r,padding:Ot.constants.RSA_PKCS1_PSS_PADDING,saltLength:Ot.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return $l(s)}}function GE(i){return function(t,r,n){eg(n),t=gn(t),r=ig(r);var s=Ot.createVerify("RSA-SHA"+i);return s.update(t),s.verify({key:n,padding:Ot.constants.RSA_PKCS1_PSS_PADDING,saltLength:Ot.constants.RSA_PSS_SALTLEN_DIGEST},r,"base64")}}function YE(i){var e=ng(i);return function(){var r=e.apply(null,arguments);return r=Qv.derToJose(r,"ES"+i),r}}function JE(i){var e=sg(i);return function(r,n,s){n=Qv.joseToDer(n,"ES"+i).toString("base64");var o=e(r,n,s);return o}}function XE(){return function(){return""}}function ZE(){return function(e,t){return t===""}}og.exports=function(e){var t={hs:rg,rs:ng,ps:KE,es:YE,none:XE},r={hs:VE,rs:sg,ps:GE,es:JE,none:ZE},n=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!n)throw Lt(UE,e);var s=(n[1]||n[3]).toLowerCase(),o=n[2];return{sign:t[s](o),verify:r[s](o)}}});var Kl=T((lA,ag)=>{var QE=require("buffer").Buffer;ag.exports=function(e){return typeof e=="string"?e:typeof e=="number"||QE.isBuffer(e)?e.toString():JSON.stringify(e)}});var fg=T((uA,dg)=>{var eC=qr().Buffer,cg=Fl(),tC=Vl(),iC=require("stream"),lg=Kl(),Gl=require("util");function ug(i,e){return eC.from(i,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function rC(i,e,t){t=t||"utf8";var r=ug(lg(i),"binary"),n=ug(lg(e),t);return Gl.format("%s.%s",r,n)}function pg(i){var e=i.header,t=i.payload,r=i.secret||i.privateKey,n=i.encoding,s=tC(e.alg),o=rC(e,t,n),c=s.sign(o,r);return Gl.format("%s.%s",o,c)}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 cg(e);this.readable=!0,this.header=i.header,this.encoding=i.encoding,this.secret=this.privateKey=this.key=t,this.payload=new cg(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))}Gl.inherits(vo,iC);vo.prototype.sign=function(){try{var e=pg({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=pg;dg.exports=vo});var Sg=T((pA,_g)=>{var mg=qr().Buffer,hg=Fl(),nC=Vl(),sC=require("stream"),vg=Kl(),oC=require("util"),aC=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function cC(i){return Object.prototype.toString.call(i)==="[object Object]"}function lC(i){if(cC(i))return i;try{return JSON.parse(i)}catch{return}}function gg(i){var e=i.split(".",1)[0];return lC(mg.from(e,"base64").toString("binary"))}function uC(i){return i.split(".",2).join(".")}function xg(i){return i.split(".")[2]}function pC(i,e){e=e||"utf8";var t=i.split(".")[1];return mg.from(t,"base64").toString(e)}function yg(i){return aC.test(i)&&!!gg(i)}function bg(i,e,t){if(!e){var r=new Error("Missing algorithm parameter for jws.verify");throw r.code="MISSING_ALGORITHM",r}i=vg(i);var n=xg(i),s=uC(i),o=nC(e);return o.verify(s,n,t)}function wg(i,e){if(e=e||{},i=vg(i),!yg(i))return null;var t=gg(i);if(!t)return null;var r=pC(i);return(t.typ==="JWT"||e.json)&&(r=JSON.parse(r,e.encoding)),{header:t,payload:r,signature:xg(i)}}function Hr(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 hg(e);this.readable=!0,this.algorithm=i.algorithm,this.encoding=i.encoding,this.secret=this.publicKey=this.key=t,this.signature=new hg(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))}oC.inherits(Hr,sC);Hr.prototype.verify=function(){try{var e=bg(this.signature.buffer,this.algorithm,this.key.buffer),t=wg(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};Hr.decode=wg;Hr.isValid=yg;Hr.verify=bg;_g.exports=Hr});var Cg=T(_i=>{var Eg=fg(),go=Sg(),dC=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];_i.ALGORITHMS=dC;_i.sign=Eg.sign;_i.verify=go.verify;_i.decode=go.decode;_i.isValid=go.isValid;_i.createSign=function(e){return new Eg(e)};_i.createVerify=function(e){return new go(e)}});var xo=T((fA,Tg)=>{"use strict";var Yl={};Yl.supportedContentEncodings={AES_GCM:"aesgcm",AES_128_GCM:"aes128gcm"};Yl.supportedUrgency={VERY_LOW:"very-low",LOW:"low",NORMAL:"normal",HIGH:"high"};Tg.exports=Yl});var Jl=T((hA,kg)=>{"use strict";function fC(i){return/^[A-Za-z0-9\-_]+$/.test(i)}kg.exports={validate:fC}});var Zl=T((mA,Ig)=>{"use strict";var hC=require("crypto"),mC=jv(),vC=Cg(),{URL:Og}=require("url"),Mg=xo(),Ag=Jl(),gC=720*60,xC=1440*60,yC=mC.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 bC(i){return yC.encode({version:1,privateKey:i,parameters:[1,2,840,10045,3,1,7]},"pem",{label:"EC PRIVATE KEY"})}function wC(){let i=hC.createECDH("prime256v1");i.generateKeys();let e=i.getPublicKey(),t=i.getPrivateKey();if(t.length<32){let r=Buffer.alloc(32-t.length);r.fill(0),t=Buffer.concat([r,t])}if(e.length<65){let r=Buffer.alloc(65-e.length);r.fill(0),e=Buffer.concat([r,e])}return{publicKey:e.toString("base64url"),privateKey:t.toString("base64url")}}function Rg(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 Og(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 Pg(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(!Ag.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 Bg(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(!Ag.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 Xl(i){let e=new Date;return e.setSeconds(e.getSeconds()+i),Math.floor(e.getTime()/1e3)}function Ng(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=Xl(xC);if(i>=e)throw new Error("`expiration` value is greater than maximum of 24 hours")}function _C(i,e,t,r,n,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 Og(i)}catch{throw new Error("VAPID audience is not a url. "+i)}Rg(e),Pg(t),Bg(r),r=Buffer.from(r,"base64url"),s?Ng(s):s=Xl(gC);let o={typ:"JWT",alg:"ES256"},c={aud:i,exp:s,sub:e},u=vC.sign({header:o,payload:c,privateKey:bC(r)});if(n===Mg.supportedContentEncodings.AES_128_GCM)return{Authorization:"vapid t="+u+", k="+t};if(n===Mg.supportedContentEncodings.AES_GCM)return{Authorization:"WebPush "+u,"Crypto-Key":"p256ecdsa="+t};throw new Error("Unsupported encoding type specified.")}Ig.exports={generateVAPIDKeys:wC,getFutureExpirationTimestamp:Xl,getVapidHeaders:_C,validateSubject:Rg,validatePublicKey:Pg,validatePrivateKey:Bg,validateExpiration:Ng}});var Vg=T((vA,$g)=>{"use strict";var bo=require("crypto"),jg="aes-128-gcm",wo={aes128gcm:1,aesgcm:2},Hi=16,Gt=16,SC=12,Lg=32,xn="encrypt",yn="decrypt",$;process.env.ECE_KEYLOG==="1"?$=function(i,e){return console.warn(i+" ["+e.length+"]: "+e.toString("base64url")),e}:$=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 Fg(i,e){return $("salt",i),$("ikm",e),$("extract",qg(i,e))}function Ql(i,e,t){$("prk",i),$("info",e);var r=Buffer.alloc(0),n=Buffer.alloc(0);e=Buffer.from(e,"ascii");for(var s=0,o=Buffer.alloc(1);r.length<t;)o.writeUIntBE(++s,0,1),n=qg(i,Buffer.concat([n,e,o])),r=Buffer.concat([r,n]);return $("expand",r.slice(0,t))}function Ug(i,e,t,r){return Ql(Fg(i,e),t,r)}function eu(i,e){var t=Buffer.concat([Buffer.from("Content-Encoding: "+i+"\0","ascii"),e]);return $("info "+i,t),t}function Dg(i){var e=Buffer.concat([Buffer.alloc(2),i]);return e.writeUIntBE(i.length,0,2),e}function EC(i,e){var t=i.privateKey,r,n;if(e===xn)r=t.getPublicKey(),n=i.dh;else if(e===yn)r=i.dh,n=t.getPublicKey();else throw new Error("Unknown mode only "+xn+" and "+yn+" supported");return{secret:t.computeSecret(i.dh),context:Buffer.concat([Buffer.from(i.keylabel,"ascii"),Buffer.from([0]),Dg(n),Dg(r)])}}function CC(i,e){var t={secret:null,context:Buffer.alloc(0)};if(i.key){if(t.secret=i.key,t.secret.length!==Gt)throw new Error("An explicit key must be "+Gt+" bytes")}else i.dh?t=EC(i,e):typeof i.keyid!==void 0&&(t.secret=i.keymap[i.keyid]);if(!t.secret)throw new Error("Unable to determine key");return $("secret",t.secret),$("context",t.context),i.authSecret&&(t.secret=Ug(i.authSecret,t.secret,eu("auth",Buffer.alloc(0)),Lg),$("authsecret",t.secret)),t}function TC(i,e){if(!i.authSecret)throw new Error("No authentication secret for webpush");$("authsecret",i.authSecret);var t,r,n;if(e===xn)r=i.privateKey.getPublicKey(),t=n=i.dh;else if(e===yn)t=r=i.keyid,n=i.privateKey.getPublicKey();else throw new Error("Unknown mode only "+xn+" and "+yn+" supported");return $("remote pubkey",t),$("sender pubkey",r),$("receiver pubkey",n),$("secret dh",Ug(i.authSecret,i.privateKey.computeSecret(t),Buffer.concat([Buffer.from("WebPush: info\0"),n,r]),Lg))}function kC(i,e,t){if(t&&!DC(t))throw new Error("Callback is not a function");if(i.key){if(i.key.length!==Gt)throw new Error("An explicit key must be "+Gt+" bytes");return $("secret key",i.key)}if(!i.privateKey){if(t)var r=t(i.keyid);else var r=i.keymap&&i.keymap[i.keyid];if(!r)throw new Error('No saved key (keyid: "'+i.keyid+'")');return r}return TC(i,e)}function Hg(i,e,t){if(!i.salt)throw new Error("must include a salt parameter for "+i.version);var r,n,s;if(i.version==="aesgcm"){var o=CC(i,e,t);r=eu("aesgcm",o.context),n=eu("nonce",o.context),s=o.secret}else if(i.version==="aes128gcm")r=Buffer.from("Content-Encoding: aes128gcm\0"),n=Buffer.from("Content-Encoding: nonce\0"),s=kC(i,e,t);else throw new Error("Unable to set context for mode "+i.version);var c=Fg(i.salt,s),u={key:Ql(c,r,Gt),nonce:Ql(c,n,SC)};return $("key",u.key),$("nonce base",u.nonce),u}function zg(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+=Hi),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!==Gt))throw new Error("The salt parameter must be "+Gt+" 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 Wg(i,e){var t=Buffer.from(i),r=t.readUIntBE(t.length-6,6),n=((r^e)&16777215)+((r/16777216^e/16777216)&16777215)*16777216;return t.writeUIntBE(n,t.length-6,6),$("nonce"+e,t),t}function MC(i,e){var t=i.readUIntBE(20,1);return e.salt=i.slice(0,Gt),e.rs=i.readUIntBE(Gt,4),e.keyid=i.slice(21,21+t),21+t}function OC(i,e){var t=wo[e],r=i.readUIntBE(0,t);if(r+t>i.length)throw new Error("padding exceeds block size");$("padding",i.slice(0,t+r));var n=Buffer.alloc(r);if(n.fill(0),n.compare(i.slice(t,t+r))!==0)throw new Error("invalid padding");return i.slice(t+r)}function AC(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 RC(i,e,t,r,n){$("decrypt",t);var s=Wg(i.nonce,e),o=bo.createDecipheriv(jg,i.key,s);o.setAuthTag(t.slice(t.length-Hi));var c=o.update(t.slice(0,t.length-Hi));return c=Buffer.concat([c,o.final()]),$("decrypted",c),r.version!=="aes128gcm"?OC(c,r.version):AC(c,n)}function PC(i,e,t){var r=zg(e);if(r.version==="aes128gcm"){var n=MC(i,r);i=i.slice(n)}var s=Hg(r,yn,t),o=0,c=Buffer.alloc(0),u=r.rs;r.version!=="aes128gcm"&&(u+=Hi);for(var d=0;o<i.length;++d){var f=o+u;if(r.version!=="aes128gcm"&&f===i.length)throw new Error("Truncated payload");if(f=Math.min(f,i.length),f-o<=Hi)throw new Error("Invalid block: too small at "+d);var v=RC(s,d,i.slice(o,f),r,f>=i.length);c=Buffer.concat([c,v]),o=f}return c}function BC(i,e,t,r,n,s){$("encrypt",t),r=r||0;var o=Wg(i.nonce,e),c=bo.createCipheriv(jg,i.key,o),u=[],d=wo[n.version],f=Buffer.alloc(r+d);if(f.fill(0),n.version!=="aes128gcm"){if(f.writeUIntBE(r,0,d),$("padding",f),u.push(c.update(f)),u.push(c.update(t)),!s&&f.length+t.length<n.rs)throw new Error("Unable to pad to record size")}else u.push(c.update(t)),f.writeUIntBE(s?2:1,0,1),$("padding",f),u.push(c.update(f));c.final();var v=c.getAuthTag();if(v.length!==Hi)throw new Error("invalid tag generated");return u.push(v),$("encrypted",Buffer.concat(u))}function NC(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 IC(i,e,t){if(!Buffer.isBuffer(i))throw new Error("buffer argument must be a Buffer");var r=zg(e);r.salt||(r.salt=bo.randomBytes(Gt));var n;r.version==="aes128gcm"?(r.privateKey&&!r.keyid&&(r.keyid=r.privateKey.getPublicKey()),n=NC(r)):n=Buffer.alloc(0);var s=Hg(r,xn,t),o=0,c=wo[r.version],u=c;r.version==="aes128gcm"&&(u+=Hi);for(var d=isNaN(parseInt(e.pad,10))?0:parseInt(e.pad,10),f=0,v=!1;!v;){var _=Math.min(r.rs-u-1,d);r.version!=="aes128gcm"&&(_=Math.min((1<<c*8)-1,_)),d>0&&_===0&&++_,d-=_;var E=o+r.rs-u-_;r.version!=="aes128gcm"?v=E>i.length:v=E>=i.length,v=v&&d<=0;var C=BC(s,f,i.slice(o,E),_,r,v);n=Buffer.concat([n,C]),o=E,++f}return n}function DC(i){return typeof i=="function"}$g.exports={decrypt:PC,encrypt:IC}});var tu=T((gA,Gg)=>{"use strict";var Kg=require("crypto"),jC=Vg(),LC=function(i,e,t,r){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 n=Kg.createECDH("prime256v1"),s=n.generateKeys(),o=Kg.randomBytes(16).toString("base64url"),c=jC.encrypt(t,{version:r,dh:i,privateKey:n,salt:o,authSecret:e});return{localPublicKey:s,salt:o,cipherText:c}};Gg.exports={encrypt:LC}});var iu=T((xA,Jg)=>{"use strict";function Yg(i,e,t,r,n){Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=i,this.statusCode=e,this.headers=t,this.body=r,this.endpoint=n}require("util").inherits(Yg,Error);Jg.exports=Yg});var Qg=T(st=>{"use strict";var qC=st&&st.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),FC=st&&st.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Xg=st&&st.__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)&&qC(e,i,t);return FC(e,i),e};Object.defineProperty(st,"__esModule",{value:!0});st.req=st.json=st.toBuffer=void 0;var UC=Xg(require("http")),HC=Xg(require("https"));async function Zg(i){let e=0,t=[];for await(let r of i)e+=r.length,t.push(r);return Buffer.concat(t,e)}st.toBuffer=Zg;async function zC(i){let t=(await Zg(i)).toString("utf8");try{return JSON.parse(t)}catch(r){let n=r;throw n.message+=` (input: ${t})`,n}}st.json=zC;function WC(i,e={}){let r=((typeof i=="string"?i:i.href).startsWith("https:")?HC:UC).request(i,e),n=new Promise((s,o)=>{r.once("response",s).once("error",o).end()});return r.then=n.then.bind(n),r}st.req=WC});var rx=T(ht=>{"use strict";var tx=ht&&ht.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),$C=ht&&ht.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),ix=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)&&tx(e,i,t);return $C(e,i),e},VC=ht&&ht.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&tx(e,i,t)};Object.defineProperty(ht,"__esModule",{value:!0});ht.Agent=void 0;var KC=ix(require("net")),ex=ix(require("http")),GC=require("https");VC(Qg(),ht);var Yt=Symbol("AgentBaseInternalState"),ru=class extends ex.Agent{constructor(e){super(e),this[Yt]={}}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(`
|
|
24
|
-
`).some(r=>r.indexOf("(https.js:")!==-1||r.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
|
|
23
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,vn="secret must be a string or buffer",Fr="key must be a string or a buffer",zE="key must be a string, a buffer or an object",Wl=typeof Ot.createPublicKey=="function";Wl&&(Fr+=" or a KeyObject",vn+="or a KeyObject");function eg(i){if(!Ur.isBuffer(i)&&typeof i!="string"&&(!Wl||typeof i!="object"||typeof i.type!="string"||typeof i.asymmetricKeyType!="string"||typeof i.export!="function"))throw Lt(Fr)}function tg(i){if(!Ur.isBuffer(i)&&typeof i!="string"&&typeof i!="object")throw Lt(zE)}function WE(i){if(!Ur.isBuffer(i)){if(typeof i=="string")return i;if(!Wl||typeof i!="object"||i.type!=="secret"||typeof i.export!="function")throw Lt(vn)}}function $l(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function ig(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 Lt(i){var e=[].slice.call(arguments,1),t=Zv.format.bind(Zv,i).apply(null,e);return new TypeError(t)}function $E(i){return Ur.isBuffer(i)||typeof i=="string"}function gn(i){return $E(i)||(i=JSON.stringify(i)),i}function rg(i){return function(t,r){WE(r),t=gn(t);var n=Ot.createHmac("sha"+i,r),s=(n.update(t),n.digest("base64"));return $l(s)}}var zl,VE="timingSafeEqual"in Ot?function(e,t){return e.byteLength!==t.byteLength?!1:Ot.timingSafeEqual(e,t)}:function(e,t){return zl||(zl=Xv()),zl(e,t)};function KE(i){return function(t,r,n){var s=rg(i)(t,n);return VE(Ur.from(r),Ur.from(s))}}function ng(i){return function(t,r){tg(r),t=gn(t);var n=Ot.createSign("RSA-SHA"+i),s=(n.update(t),n.sign(r,"base64"));return $l(s)}}function sg(i){return function(t,r,n){eg(n),t=gn(t),r=ig(r);var s=Ot.createVerify("RSA-SHA"+i);return s.update(t),s.verify(n,r,"base64")}}function GE(i){return function(t,r){tg(r),t=gn(t);var n=Ot.createSign("RSA-SHA"+i),s=(n.update(t),n.sign({key:r,padding:Ot.constants.RSA_PKCS1_PSS_PADDING,saltLength:Ot.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return $l(s)}}function YE(i){return function(t,r,n){eg(n),t=gn(t),r=ig(r);var s=Ot.createVerify("RSA-SHA"+i);return s.update(t),s.verify({key:n,padding:Ot.constants.RSA_PKCS1_PSS_PADDING,saltLength:Ot.constants.RSA_PSS_SALTLEN_DIGEST},r,"base64")}}function JE(i){var e=ng(i);return function(){var r=e.apply(null,arguments);return r=Qv.derToJose(r,"ES"+i),r}}function XE(i){var e=sg(i);return function(r,n,s){n=Qv.joseToDer(n,"ES"+i).toString("base64");var o=e(r,n,s);return o}}function ZE(){return function(){return""}}function QE(){return function(e,t){return t===""}}og.exports=function(e){var t={hs:rg,rs:ng,ps:GE,es:JE,none:ZE},r={hs:KE,rs:sg,ps:YE,es:XE,none:QE},n=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!n)throw Lt(HE,e);var s=(n[1]||n[3]).toLowerCase(),o=n[2];return{sign:t[s](o),verify:r[s](o)}}});var Kl=T((lA,ag)=>{var eC=require("buffer").Buffer;ag.exports=function(e){return typeof e=="string"?e:typeof e=="number"||eC.isBuffer(e)?e.toString():JSON.stringify(e)}});var fg=T((uA,dg)=>{var tC=qr().Buffer,cg=Fl(),iC=Vl(),rC=require("stream"),lg=Kl(),Gl=require("util");function ug(i,e){return tC.from(i,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function nC(i,e,t){t=t||"utf8";var r=ug(lg(i),"binary"),n=ug(lg(e),t);return Gl.format("%s.%s",r,n)}function pg(i){var e=i.header,t=i.payload,r=i.secret||i.privateKey,n=i.encoding,s=iC(e.alg),o=nC(e,t,n),c=s.sign(o,r);return Gl.format("%s.%s",o,c)}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 cg(e);this.readable=!0,this.header=i.header,this.encoding=i.encoding,this.secret=this.privateKey=this.key=t,this.payload=new cg(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))}Gl.inherits(vo,rC);vo.prototype.sign=function(){try{var e=pg({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=pg;dg.exports=vo});var Sg=T((pA,_g)=>{var mg=qr().Buffer,hg=Fl(),sC=Vl(),oC=require("stream"),vg=Kl(),aC=require("util"),cC=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function lC(i){return Object.prototype.toString.call(i)==="[object Object]"}function uC(i){if(lC(i))return i;try{return JSON.parse(i)}catch{return}}function gg(i){var e=i.split(".",1)[0];return uC(mg.from(e,"base64").toString("binary"))}function pC(i){return i.split(".",2).join(".")}function xg(i){return i.split(".")[2]}function dC(i,e){e=e||"utf8";var t=i.split(".")[1];return mg.from(t,"base64").toString(e)}function yg(i){return cC.test(i)&&!!gg(i)}function bg(i,e,t){if(!e){var r=new Error("Missing algorithm parameter for jws.verify");throw r.code="MISSING_ALGORITHM",r}i=vg(i);var n=xg(i),s=pC(i),o=sC(e);return o.verify(s,n,t)}function wg(i,e){if(e=e||{},i=vg(i),!yg(i))return null;var t=gg(i);if(!t)return null;var r=dC(i);return(t.typ==="JWT"||e.json)&&(r=JSON.parse(r,e.encoding)),{header:t,payload:r,signature:xg(i)}}function Hr(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 hg(e);this.readable=!0,this.algorithm=i.algorithm,this.encoding=i.encoding,this.secret=this.publicKey=this.key=t,this.signature=new hg(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))}aC.inherits(Hr,oC);Hr.prototype.verify=function(){try{var e=bg(this.signature.buffer,this.algorithm,this.key.buffer),t=wg(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};Hr.decode=wg;Hr.isValid=yg;Hr.verify=bg;_g.exports=Hr});var Cg=T(_i=>{var Eg=fg(),go=Sg(),fC=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];_i.ALGORITHMS=fC;_i.sign=Eg.sign;_i.verify=go.verify;_i.decode=go.decode;_i.isValid=go.isValid;_i.createSign=function(e){return new Eg(e)};_i.createVerify=function(e){return new go(e)}});var xo=T((fA,Tg)=>{"use strict";var Yl={};Yl.supportedContentEncodings={AES_GCM:"aesgcm",AES_128_GCM:"aes128gcm"};Yl.supportedUrgency={VERY_LOW:"very-low",LOW:"low",NORMAL:"normal",HIGH:"high"};Tg.exports=Yl});var Jl=T((hA,kg)=>{"use strict";function hC(i){return/^[A-Za-z0-9\-_]+$/.test(i)}kg.exports={validate:hC}});var Zl=T((mA,Ig)=>{"use strict";var mC=require("crypto"),vC=jv(),gC=Cg(),{URL:Og}=require("url"),Mg=xo(),Ag=Jl(),xC=720*60,yC=1440*60,bC=vC.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 wC(i){return bC.encode({version:1,privateKey:i,parameters:[1,2,840,10045,3,1,7]},"pem",{label:"EC PRIVATE KEY"})}function _C(){let i=mC.createECDH("prime256v1");i.generateKeys();let e=i.getPublicKey(),t=i.getPrivateKey();if(t.length<32){let r=Buffer.alloc(32-t.length);r.fill(0),t=Buffer.concat([r,t])}if(e.length<65){let r=Buffer.alloc(65-e.length);r.fill(0),e=Buffer.concat([r,e])}return{publicKey:e.toString("base64url"),privateKey:t.toString("base64url")}}function Rg(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 Og(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 Pg(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(!Ag.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 Bg(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(!Ag.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 Xl(i){let e=new Date;return e.setSeconds(e.getSeconds()+i),Math.floor(e.getTime()/1e3)}function Ng(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=Xl(yC);if(i>=e)throw new Error("`expiration` value is greater than maximum of 24 hours")}function SC(i,e,t,r,n,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 Og(i)}catch{throw new Error("VAPID audience is not a url. "+i)}Rg(e),Pg(t),Bg(r),r=Buffer.from(r,"base64url"),s?Ng(s):s=Xl(xC);let o={typ:"JWT",alg:"ES256"},c={aud:i,exp:s,sub:e},u=gC.sign({header:o,payload:c,privateKey:wC(r)});if(n===Mg.supportedContentEncodings.AES_128_GCM)return{Authorization:"vapid t="+u+", k="+t};if(n===Mg.supportedContentEncodings.AES_GCM)return{Authorization:"WebPush "+u,"Crypto-Key":"p256ecdsa="+t};throw new Error("Unsupported encoding type specified.")}Ig.exports={generateVAPIDKeys:_C,getFutureExpirationTimestamp:Xl,getVapidHeaders:SC,validateSubject:Rg,validatePublicKey:Pg,validatePrivateKey:Bg,validateExpiration:Ng}});var Vg=T((vA,$g)=>{"use strict";var bo=require("crypto"),jg="aes-128-gcm",wo={aes128gcm:1,aesgcm:2},Hi=16,Gt=16,EC=12,Lg=32,xn="encrypt",yn="decrypt",$;process.env.ECE_KEYLOG==="1"?$=function(i,e){return console.warn(i+" ["+e.length+"]: "+e.toString("base64url")),e}:$=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 Fg(i,e){return $("salt",i),$("ikm",e),$("extract",qg(i,e))}function Ql(i,e,t){$("prk",i),$("info",e);var r=Buffer.alloc(0),n=Buffer.alloc(0);e=Buffer.from(e,"ascii");for(var s=0,o=Buffer.alloc(1);r.length<t;)o.writeUIntBE(++s,0,1),n=qg(i,Buffer.concat([n,e,o])),r=Buffer.concat([r,n]);return $("expand",r.slice(0,t))}function Ug(i,e,t,r){return Ql(Fg(i,e),t,r)}function eu(i,e){var t=Buffer.concat([Buffer.from("Content-Encoding: "+i+"\0","ascii"),e]);return $("info "+i,t),t}function Dg(i){var e=Buffer.concat([Buffer.alloc(2),i]);return e.writeUIntBE(i.length,0,2),e}function CC(i,e){var t=i.privateKey,r,n;if(e===xn)r=t.getPublicKey(),n=i.dh;else if(e===yn)r=i.dh,n=t.getPublicKey();else throw new Error("Unknown mode only "+xn+" and "+yn+" supported");return{secret:t.computeSecret(i.dh),context:Buffer.concat([Buffer.from(i.keylabel,"ascii"),Buffer.from([0]),Dg(n),Dg(r)])}}function TC(i,e){var t={secret:null,context:Buffer.alloc(0)};if(i.key){if(t.secret=i.key,t.secret.length!==Gt)throw new Error("An explicit key must be "+Gt+" bytes")}else i.dh?t=CC(i,e):typeof i.keyid!==void 0&&(t.secret=i.keymap[i.keyid]);if(!t.secret)throw new Error("Unable to determine key");return $("secret",t.secret),$("context",t.context),i.authSecret&&(t.secret=Ug(i.authSecret,t.secret,eu("auth",Buffer.alloc(0)),Lg),$("authsecret",t.secret)),t}function kC(i,e){if(!i.authSecret)throw new Error("No authentication secret for webpush");$("authsecret",i.authSecret);var t,r,n;if(e===xn)r=i.privateKey.getPublicKey(),t=n=i.dh;else if(e===yn)t=r=i.keyid,n=i.privateKey.getPublicKey();else throw new Error("Unknown mode only "+xn+" and "+yn+" supported");return $("remote pubkey",t),$("sender pubkey",r),$("receiver pubkey",n),$("secret dh",Ug(i.authSecret,i.privateKey.computeSecret(t),Buffer.concat([Buffer.from("WebPush: info\0"),n,r]),Lg))}function MC(i,e,t){if(t&&!jC(t))throw new Error("Callback is not a function");if(i.key){if(i.key.length!==Gt)throw new Error("An explicit key must be "+Gt+" bytes");return $("secret key",i.key)}if(!i.privateKey){if(t)var r=t(i.keyid);else var r=i.keymap&&i.keymap[i.keyid];if(!r)throw new Error('No saved key (keyid: "'+i.keyid+'")');return r}return kC(i,e)}function Hg(i,e,t){if(!i.salt)throw new Error("must include a salt parameter for "+i.version);var r,n,s;if(i.version==="aesgcm"){var o=TC(i,e,t);r=eu("aesgcm",o.context),n=eu("nonce",o.context),s=o.secret}else if(i.version==="aes128gcm")r=Buffer.from("Content-Encoding: aes128gcm\0"),n=Buffer.from("Content-Encoding: nonce\0"),s=MC(i,e,t);else throw new Error("Unable to set context for mode "+i.version);var c=Fg(i.salt,s),u={key:Ql(c,r,Gt),nonce:Ql(c,n,EC)};return $("key",u.key),$("nonce base",u.nonce),u}function zg(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+=Hi),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!==Gt))throw new Error("The salt parameter must be "+Gt+" 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 Wg(i,e){var t=Buffer.from(i),r=t.readUIntBE(t.length-6,6),n=((r^e)&16777215)+((r/16777216^e/16777216)&16777215)*16777216;return t.writeUIntBE(n,t.length-6,6),$("nonce"+e,t),t}function OC(i,e){var t=i.readUIntBE(20,1);return e.salt=i.slice(0,Gt),e.rs=i.readUIntBE(Gt,4),e.keyid=i.slice(21,21+t),21+t}function AC(i,e){var t=wo[e],r=i.readUIntBE(0,t);if(r+t>i.length)throw new Error("padding exceeds block size");$("padding",i.slice(0,t+r));var n=Buffer.alloc(r);if(n.fill(0),n.compare(i.slice(t,t+r))!==0)throw new Error("invalid padding");return i.slice(t+r)}function RC(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 PC(i,e,t,r,n){$("decrypt",t);var s=Wg(i.nonce,e),o=bo.createDecipheriv(jg,i.key,s);o.setAuthTag(t.slice(t.length-Hi));var c=o.update(t.slice(0,t.length-Hi));return c=Buffer.concat([c,o.final()]),$("decrypted",c),r.version!=="aes128gcm"?AC(c,r.version):RC(c,n)}function BC(i,e,t){var r=zg(e);if(r.version==="aes128gcm"){var n=OC(i,r);i=i.slice(n)}var s=Hg(r,yn,t),o=0,c=Buffer.alloc(0),u=r.rs;r.version!=="aes128gcm"&&(u+=Hi);for(var d=0;o<i.length;++d){var f=o+u;if(r.version!=="aes128gcm"&&f===i.length)throw new Error("Truncated payload");if(f=Math.min(f,i.length),f-o<=Hi)throw new Error("Invalid block: too small at "+d);var v=PC(s,d,i.slice(o,f),r,f>=i.length);c=Buffer.concat([c,v]),o=f}return c}function NC(i,e,t,r,n,s){$("encrypt",t),r=r||0;var o=Wg(i.nonce,e),c=bo.createCipheriv(jg,i.key,o),u=[],d=wo[n.version],f=Buffer.alloc(r+d);if(f.fill(0),n.version!=="aes128gcm"){if(f.writeUIntBE(r,0,d),$("padding",f),u.push(c.update(f)),u.push(c.update(t)),!s&&f.length+t.length<n.rs)throw new Error("Unable to pad to record size")}else u.push(c.update(t)),f.writeUIntBE(s?2:1,0,1),$("padding",f),u.push(c.update(f));c.final();var v=c.getAuthTag();if(v.length!==Hi)throw new Error("invalid tag generated");return u.push(v),$("encrypted",Buffer.concat(u))}function IC(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 DC(i,e,t){if(!Buffer.isBuffer(i))throw new Error("buffer argument must be a Buffer");var r=zg(e);r.salt||(r.salt=bo.randomBytes(Gt));var n;r.version==="aes128gcm"?(r.privateKey&&!r.keyid&&(r.keyid=r.privateKey.getPublicKey()),n=IC(r)):n=Buffer.alloc(0);var s=Hg(r,xn,t),o=0,c=wo[r.version],u=c;r.version==="aes128gcm"&&(u+=Hi);for(var d=isNaN(parseInt(e.pad,10))?0:parseInt(e.pad,10),f=0,v=!1;!v;){var _=Math.min(r.rs-u-1,d);r.version!=="aes128gcm"&&(_=Math.min((1<<c*8)-1,_)),d>0&&_===0&&++_,d-=_;var E=o+r.rs-u-_;r.version!=="aes128gcm"?v=E>i.length:v=E>=i.length,v=v&&d<=0;var C=NC(s,f,i.slice(o,E),_,r,v);n=Buffer.concat([n,C]),o=E,++f}return n}function jC(i){return typeof i=="function"}$g.exports={decrypt:BC,encrypt:DC}});var tu=T((gA,Gg)=>{"use strict";var Kg=require("crypto"),LC=Vg(),qC=function(i,e,t,r){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 n=Kg.createECDH("prime256v1"),s=n.generateKeys(),o=Kg.randomBytes(16).toString("base64url"),c=LC.encrypt(t,{version:r,dh:i,privateKey:n,salt:o,authSecret:e});return{localPublicKey:s,salt:o,cipherText:c}};Gg.exports={encrypt:qC}});var iu=T((xA,Jg)=>{"use strict";function Yg(i,e,t,r,n){Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=i,this.statusCode=e,this.headers=t,this.body=r,this.endpoint=n}require("util").inherits(Yg,Error);Jg.exports=Yg});var Qg=T(st=>{"use strict";var FC=st&&st.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),UC=st&&st.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Xg=st&&st.__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)&&FC(e,i,t);return UC(e,i),e};Object.defineProperty(st,"__esModule",{value:!0});st.req=st.json=st.toBuffer=void 0;var HC=Xg(require("http")),zC=Xg(require("https"));async function Zg(i){let e=0,t=[];for await(let r of i)e+=r.length,t.push(r);return Buffer.concat(t,e)}st.toBuffer=Zg;async function WC(i){let t=(await Zg(i)).toString("utf8");try{return JSON.parse(t)}catch(r){let n=r;throw n.message+=` (input: ${t})`,n}}st.json=WC;function $C(i,e={}){let r=((typeof i=="string"?i:i.href).startsWith("https:")?zC:HC).request(i,e),n=new Promise((s,o)=>{r.once("response",s).once("error",o).end()});return r.then=n.then.bind(n),r}st.req=$C});var rx=T(ht=>{"use strict";var tx=ht&&ht.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),VC=ht&&ht.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),ix=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)&&tx(e,i,t);return VC(e,i),e},KC=ht&&ht.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&tx(e,i,t)};Object.defineProperty(ht,"__esModule",{value:!0});ht.Agent=void 0;var GC=ix(require("net")),ex=ix(require("http")),YC=require("https");KC(Qg(),ht);var Yt=Symbol("AgentBaseInternalState"),ru=class extends ex.Agent{constructor(e){super(e),this[Yt]={}}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(`
|
|
24
|
+
`).some(r=>r.indexOf("(https.js:")!==-1||r.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 GC.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let r=this.sockets[e],n=r.indexOf(t);n!==-1&&(r.splice(n,1),this.totalSocketCount--,r.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?YC.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,r){let n={...t,secureEndpoint:this.isSecureEndpoint(t)},s=this.getName(n),o=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,n)).then(c=>{if(this.decrementSockets(s,o),c instanceof ex.Agent)try{return c.addRequest(e,n)}catch(u){return r(u)}this[Yt].currentSocket=c,super.createSocket(e,t,r)},c=>{this.decrementSockets(s,o),r(c)})}createConnection(){let e=this[Yt].currentSocket;if(this[Yt].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Yt].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Yt]&&(this[Yt].defaultPort=e)}get protocol(){return this[Yt].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Yt]&&(this[Yt].protocol=e)}};ht.Agent=ru});var nx=T(zr=>{"use strict";var JC=zr&&zr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(zr,"__esModule",{value:!0});zr.parseProxyResponse=void 0;var XC=JC(ie()),_o=(0,XC.default)("https-proxy-agent:parse-proxy-response");function ZC(i){return new Promise((e,t)=>{let r=0,n=[];function s(){let f=i.read();f?d(f):i.once("readable",s)}function o(){i.removeListener("end",c),i.removeListener("error",u),i.removeListener("readable",s)}function c(){o(),_o("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}function u(f){o(),_o("onerror %o",f),t(f)}function d(f){n.push(f),r+=f.length;let v=Buffer.concat(n,r),_=v.indexOf(`\r
|
|
25
25
|
\r
|
|
26
26
|
`);if(_===-1){_o("have not received end of HTTP headers yet..."),s();return}let E=v.slice(0,_).toString("ascii").split(`\r
|
|
27
|
-
`),C=E.shift();if(!C)return i.destroy(),t(new Error("No header received from proxy CONNECT response"));let k=C.split(" "),M=+k[1],O=k.slice(2).join(" "),A={};for(let I of E){if(!I)continue;let U=I.indexOf(":");if(U===-1)return i.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${I}"`));let Xe=I.slice(0,U).toLowerCase(),te=I.slice(U+1).trimStart(),Le=A[Xe];typeof Le=="string"?A[Xe]=[Le,te]:Array.isArray(Le)?Le.push(te):A[Xe]=te}_o("got proxy server response: %o %o",C,A),o(),e({connect:{statusCode:M,statusText:O,headers:A},buffered:v})}i.on("error",u),i.on("end",c),s()})}zr.parseProxyResponse=
|
|
27
|
+
`),C=E.shift();if(!C)return i.destroy(),t(new Error("No header received from proxy CONNECT response"));let k=C.split(" "),M=+k[1],O=k.slice(2).join(" "),A={};for(let I of E){if(!I)continue;let U=I.indexOf(":");if(U===-1)return i.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${I}"`));let Xe=I.slice(0,U).toLowerCase(),te=I.slice(U+1).trimStart(),Le=A[Xe];typeof Le=="string"?A[Xe]=[Le,te]:Array.isArray(Le)?Le.push(te):A[Xe]=te}_o("got proxy server response: %o %o",C,A),o(),e({connect:{statusCode:M,statusText:O,headers:A},buffered:v})}i.on("error",u),i.on("end",c),s()})}zr.parseProxyResponse=ZC});var ux=T(At=>{"use strict";var QC=At&&At.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),eT=At&&At.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),cx=At&&At.__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)&&QC(e,i,t);return eT(e,i),e},lx=At&&At.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(At,"__esModule",{value:!0});At.HttpsProxyAgent=void 0;var So=cx(require("net")),sx=cx(require("tls")),tT=lx(require("assert")),iT=lx(ie()),rT=rx(),nT=require("url"),sT=nx(),bn=(0,iT.default)("https-proxy-agent"),ox=i=>i.servername===void 0&&i.host&&!So.isIP(i.host)?{...i,servername:i.host}:i,Eo=class extends rT.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new nT.URL(e):e,this.proxyHeaders=t?.headers??{},bn("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),n=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?ax(t,"headers"):null,host:r,port:n}}async connect(e,t){let{proxy:r}=this;if(!t.host)throw new TypeError('No "host" provided');let n;r.protocol==="https:"?(bn("Creating `tls.Socket`: %o",this.connectOpts),n=sx.connect(ox(this.connectOpts))):(bn("Creating `net.Socket`: %o",this.connectOpts),n=So.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},o=So.isIPv6(t.host)?`[${t.host}]`:t.host,c=`CONNECT ${o}:${t.port} HTTP/1.1\r
|
|
28
28
|
`;if(r.username||r.password){let _=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.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))c+=`${_}: ${s[_]}\r
|
|
29
|
-
`;let u=(0,
|
|
30
|
-
`);let{connect:d,buffered:f}=await u;if(e.emit("proxyConnect",d),this.emit("proxyConnect",d,e),d.statusCode===200)return e.once("socket",sT),t.secureEndpoint?(bn("Upgrading socket connection to TLS"),sx.connect({...ax(ox(t),"host","path","port"),socket:n})):n;n.destroy();let v=new So.Socket({writable:!1});return v.readable=!0,e.once("socket",_=>{bn("Replaying proxy buffer for failed request"),(0,eT.default)(_.listenerCount("data")>0),_.push(f),_.push(null)}),v}};Eo.protocols=["http","https"];At.HttpsProxyAgent=Eo;function sT(i){i.resume()}function ax(i,...e){let t={},r;for(r in i)e.includes(r)||(t[r]=i[r]);return t}});var mx=T((SA,hx)=>{"use strict";var dx=require("url"),fx=require("https"),oT=iu(),Co=Zl(),aT=tu(),mt=xo(),cT=Jl(),px=2419200,nu="",su;function wn(){}wn.prototype.setGCMAPIKey=function(i){if(i===null){nu=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.");nu=i};wn.prototype.setVapidDetails=function(i,e,t){if(arguments.length===1&&arguments[0]===null){su=null;return}Co.validateSubject(i),Co.validatePublicKey(e),Co.validatePrivateKey(t),su={subject:i,publicKey:e,privateKey:t}};wn.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 r=nu,n=su,s=px,o={},c=mt.supportedContentEncodings.AES_128_GCM,u=mt.supportedUrgency.NORMAL,d,f,v,_;if(t){let O=["headers","gcmAPIKey","vapidDetails","TTL","contentEncoding","urgency","topic","proxy","agent","timeout"],A=Object.keys(t);for(let I=0;I<A.length;I+=1){let U=A[I];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 I=Object.keys(o).filter(function(U){return typeof t[U]<"u"});if(I.length>0)throw new Error("Duplicated headers defined ["+I.join(",")+"]. Please either define the header in thetop level options OR in the 'headers' key.")}if(t.gcmAPIKey&&(r=t.gcmAPIKey),t.vapidDetails!==void 0&&(n=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)c=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)u=t.urgency;else throw new Error("Unsupported urgency specified.");if(t.topic){if(!cT.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");d=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 fx.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 s>"u"&&(s=px);let E={method:"POST",headers:{TTL:s}};Object.keys(o).forEach(function(O){E.headers[O]=o[O]});let C=null;if(e){let O=aT.encrypt(i.keys.p256dh,i.keys.auth,e,c);E.headers["Content-Length"]=O.cipherText.length,E.headers["Content-Type"]="application/octet-stream",c===mt.supportedContentEncodings.AES_128_GCM?E.headers["Content-Encoding"]=mt.supportedContentEncodings.AES_128_GCM:c===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")),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)r?E.headers.Authorization="key="+r: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(n){let O=dx.parse(i.endpoint),A=O.protocol+"//"+O.host,I=Co.getVapidHeaders(A,n.subject,n.publicKey,n.privateKey,c);E.headers.Authorization=I.Authorization,c===mt.supportedContentEncodings.AES_GCM&&(E.headers["Crypto-Key"]?E.headers["Crypto-Key"]+=";"+I["Crypto-Key"]:E.headers["Crypto-Key"]=I["Crypto-Key"])}else M&&r&&(E.headers.Authorization="key="+r);return E.headers.Urgency=u,d&&(E.headers.Topic=d),E.body=C,E.endpoint=i.endpoint,f&&(E.proxy=f),v&&(E.agent=v),_&&(E.timeout=_),E};wn.prototype.sendNotification=function(i,e,t){let r;try{r=this.generateRequestDetails(i,e,t)}catch(n){return Promise.reject(n)}return new Promise(function(n,s){let o={},c=dx.parse(r.endpoint);if(o.hostname=c.hostname,o.port=c.port,o.path=c.path,o.headers=r.headers,o.method=r.method,r.timeout&&(o.timeout=r.timeout),r.agent&&(o.agent=r.agent),r.proxy){let{HttpsProxyAgent:d}=ux();o.agent=new d(r.proxy)}let u=fx.request(o,function(d){let f="";d.on("data",function(v){f+=v}),d.on("end",function(){d.statusCode<200||d.statusCode>299?s(new oT("Received unexpected response code",d.statusCode,d.headers,f,r.endpoint)):n({statusCode:d.statusCode,body:f,headers:d.headers})})});r.timeout&&u.on("timeout",function(){u.destroy(new Error("Socket timeout"))}),u.on("error",function(d){s(d)}),r.body&&u.write(r.body),u.end()})};hx.exports=wn});var xx=T((EA,gx)=>{"use strict";var vx=Zl(),lT=tu(),uT=mx(),pT=iu(),dT=xo(),_n=new uT;gx.exports={WebPushError:pT,supportedContentEncodings:dT.supportedContentEncodings,encrypt:lT.encrypt,getVapidHeaders:vx.getVapidHeaders,generateVAPIDKeys:vx.generateVAPIDKeys,setGCMAPIKey:_n.setGCMAPIKey,setVapidDetails:_n.setVapidDetails,generateRequestDetails:_n.generateRequestDetails,sendNotification:_n.sendNotification.bind(_n)}});var n0=T((pR,uu)=>{"use strict";var LT=Object.prototype.hasOwnProperty,tt="~";function Tn(){}Object.create&&(Tn.prototype=Object.create(null),new Tn().__proto__||(tt=!1));function qT(i,e,t){this.fn=i,this.context=e,this.once=t||!1}function r0(i,e,t,r,n){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new qT(t,r||i,n),o=tt?tt+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 Lo(i,e){--i._eventsCount===0?i._events=new Tn:delete i._events[e]}function Je(){this._events=new Tn,this._eventsCount=0}Je.prototype.eventNames=function(){var e=[],t,r;if(this._eventsCount===0)return e;for(r in t=this._events)LT.call(t,r)&&e.push(tt?r.slice(1):r);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Je.prototype.listeners=function(e){var t=tt?tt+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,s=r.length,o=new Array(s);n<s;n++)o[n]=r[n].fn;return o};Je.prototype.listenerCount=function(e){var t=tt?tt+e:e,r=this._events[t];return r?r.fn?1:r.length:0};Je.prototype.emit=function(e,t,r,n,s,o){var c=tt?tt+e:e;if(!this._events[c])return!1;var u=this._events[c],d=arguments.length,f,v;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,n),!0;case 5:return u.fn.call(u.context,t,r,n,s),!0;case 6:return u.fn.call(u.context,t,r,n,s,o),!0}for(v=1,f=new Array(d-1);v<d;v++)f[v-1]=arguments[v];u.fn.apply(u.context,f)}else{var _=u.length,E;for(v=0;v<_;v++)switch(u[v].once&&this.removeListener(e,u[v].fn,void 0,!0),d){case 1:u[v].fn.call(u[v].context);break;case 2:u[v].fn.call(u[v].context,t);break;case 3:u[v].fn.call(u[v].context,t,r);break;case 4:u[v].fn.call(u[v].context,t,r,n);break;default:if(!f)for(E=1,f=new Array(d-1);E<d;E++)f[E-1]=arguments[E];u[v].fn.apply(u[v].context,f)}}return!0};Je.prototype.on=function(e,t,r){return r0(this,e,t,r,!1)};Je.prototype.once=function(e,t,r){return r0(this,e,t,r,!0)};Je.prototype.removeListener=function(e,t,r,n){var s=tt?tt+e:e;if(!this._events[s])return this;if(!t)return Lo(this,s),this;var o=this._events[s];if(o.fn)o.fn===t&&(!n||o.once)&&(!r||o.context===r)&&Lo(this,s);else{for(var c=0,u=[],d=o.length;c<d;c++)(o[c].fn!==t||n&&!o[c].once||r&&o[c].context!==r)&&u.push(o[c]);u.length?this._events[s]=u.length===1?u[0]:u:Lo(this,s)}return this};Je.prototype.removeAllListeners=function(e){var t;return e?(t=tt?tt+e:e,this._events[t]&&Lo(this,t)):(this._events=new Tn,this._eventsCount=0),this};Je.prototype.off=Je.prototype.removeListener;Je.prototype.addListener=Je.prototype.on;Je.prefixed=tt;Je.EventEmitter=Je;typeof uu<"u"&&(uu.exports=Je)});var o0=T((dR,s0)=>{"use strict";s0.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 qo=T(c0=>{var li=c0,FT=require("url"),a0=require("util")._extend,UT=o0(),HT=/(^|,)\s*upgrade\s*($|,)/i,pu=/^https|wss/;li.isSSL=pu;li.setupOutgoing=function(i,e,t,r){i.port=e[r||"target"].port||(pu.test(e[r||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(c){i[c]=e[r||"target"][c]}),i.method=e.method||t.method,i.headers=a0({},t.headers),e.headers&&a0(i.headers,e.headers),e.auth&&(i.auth=e.auth),e.ca&&(i.ca=e.ca),pu.test(e[r||"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"||!HT.test(i.headers.connection))&&(i.headers.connection="close"));var n=e[r||"target"],s=n&&e.prependPath!==!1&&n.path||"",o=e.toProxy?t.url:FT.parse(t.url).path||"";return o=e.ignorePath?"":o,i.path=li.urlJoin(s,o),e.changeOrigin&&(i.headers.host=UT(i.port,e[r||"target"].protocol)&&!zT(i.host)?i.host+":"+i.port:i.host),i};li.setupSocket=function(i){return i.setTimeout(0),i.setNoDelay(!0),i.setKeepAlive(!0,0),i};li.getPort=function(i){var e=i.headers.host?i.headers.host.match(/:(\d+)/):"";return e?e[1]:li.hasEncryptedConnection(i)?"443":"80"};li.hasEncryptedConnection=function(i){return!!(i.connection.encrypted||i.connection.pair)};li.urlJoin=function(){var i=Array.prototype.slice.call(arguments),e=i.length-1,t=i[e],r=t.split("?"),n;return i[e]=r.shift(),n=[i.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")],n.push.apply(n,r),n.join("?")};li.rewriteCookieProperty=function i(e,t,r){return Array.isArray(e)?e.map(function(n){return i(n,t,r)}):e.replace(new RegExp("(;\\s*"+r+"=)([^;]+)","i"),function(n,s,o){var c;if(o in t)c=t[o];else if("*"in t)c=t["*"];else return n;return c?s+c:""})};function zT(i){return!!~i.indexOf(":")}});var d0=T((hR,p0)=>{var l0=require("url"),u0=qo(),WT=/^201|30(1|2|7|8)$/;p0.exports={removeChunked:function(e,t,r){e.httpVersion==="1.0"&&delete r.headers["transfer-encoding"]},setConnection:function(e,t,r){e.httpVersion==="1.0"?r.headers.connection=e.headers.connection||"close":e.httpVersion!=="2.0"&&!r.headers.connection&&(r.headers.connection=e.headers.connection||"keep-alive")},setRedirectHostRewrite:function(e,t,r,n){if((n.hostRewrite||n.autoRewrite||n.protocolRewrite)&&r.headers.location&&WT.test(r.statusCode)){var s=l0.parse(n.target),o=l0.parse(r.headers.location);if(s.host!=o.host)return;n.hostRewrite?o.host=n.hostRewrite:n.autoRewrite&&(o.host=e.headers.host),n.protocolRewrite&&(o.protocol=n.protocolRewrite),r.headers.location=o.format()}},writeHeaders:function(e,t,r,n){var s=n.cookieDomainRewrite,o=n.cookiePathRewrite,c=n.preserveHeaderKeyCase,u,d=function(_,E){E!=null&&(s&&_.toLowerCase()==="set-cookie"&&(E=u0.rewriteCookieProperty(E,s,"domain")),o&&_.toLowerCase()==="set-cookie"&&(E=u0.rewriteCookieProperty(E,o,"path")),t.setHeader(String(_).trim(),E))};if(typeof s=="string"&&(s={"*":s}),typeof o=="string"&&(o={"*":o}),c&&r.rawHeaders!=null){u={};for(var f=0;f<r.rawHeaders.length;f+=2){var v=r.rawHeaders[f];u[v.toLowerCase()]=v}}Object.keys(r.headers).forEach(function(_){var E=r.headers[_];c&&u&&(_=u[_]||_),d(_,E)})},writeStatusCode:function(e,t,r){r.statusMessage?(t.statusCode=r.statusCode,t.statusMessage=r.statusMessage):t.statusCode=r.statusCode}}});var h0=T((mR,f0)=>{var kn;f0.exports=function(){if(!kn){try{kn=ie()("follow-redirects")}catch{}typeof kn!="function"&&(kn=function(){})}kn.apply(null,arguments)}});var y0=T((vR,Su)=>{var On=require("url"),Mn=On.URL,$T=require("http"),VT=require("https"),vu=require("stream").Writable,gu=require("assert"),m0=h0();(function(){var e=typeof process<"u",t=typeof window<"u"&&typeof document<"u",r=Vi(Error.captureStackTrace);!e&&(t||!r)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var xu=!1;try{gu(new Mn(""))}catch(i){xu=i.code==="ERR_INVALID_URL"}var KT=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],yu=["abort","aborted","connect","error","socket","timeout"],bu=Object.create(null);yu.forEach(function(i){bu[i]=function(e,t,r){this._redirectable.emit(i,e,t,r)}});var fu=An("ERR_INVALID_URL","Invalid URL",TypeError),hu=An("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),GT=An("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",hu),YT=An("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),JT=An("ERR_STREAM_WRITE_AFTER_END","write after end"),XT=vu.prototype.destroy||g0;function ct(i,e){vu.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(r){try{t._processResponse(r)}catch(n){t.emit("error",n instanceof hu?n:new hu({cause:n}))}},this._performRequest()}ct.prototype=Object.create(vu.prototype);ct.prototype.abort=function(){_u(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};ct.prototype.destroy=function(i){return _u(this._currentRequest,i),XT.call(this,i),this};ct.prototype.write=function(i,e,t){if(this._ending)throw new JT;if(!$i(i)&&!ek(i))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Vi(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 YT),this.abort())};ct.prototype.end=function(i,e,t){if(Vi(i)?(t=i,i=e=null):Vi(e)&&(t=e,e=null),!i)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var r=this,n=this._currentRequest;this.write(i,e,function(){r._ended=!0,n.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 r(o){o.setTimeout(i),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function n(o){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),s()},i),r(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",n)}return e&&this.on("timeout",e),this.socket?n(this.socket):this._currentRequest.once("socket",n),this.on("socket",r),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 r=this._currentRequest=e.request(this._options,this._onNativeResponse);r._redirectable=this;for(var n of yu)r.on(n,bu[n]);if(this._currentUrl=/^\//.test(this._options.path)?On.format(this._options):this._options.path,this._isRedirect){var s=0,o=this,c=this._requestBodyBuffers;(function u(d){if(r===o._currentRequest)if(d)o.emit("error",d);else if(s<c.length){var f=c[s++];r.finished||r.write(f.data,f.encoding,u)}else o._ended&&r.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(_u(this._currentRequest),i.destroy(),++this._redirectCount>this._options.maxRedirects)throw new GT;var r,n=this._options.beforeRedirect;n&&(r=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=[],du(/^content-/i,this._options.headers));var o=du(/^host$/i,this._options.headers),c=wu(this._currentUrl),u=o||c.host,d=/^\w+:/.test(t)?this._currentUrl:On.format(Object.assign(c,{host:u})),f=ZT(t,d);if(m0("redirecting to",f.href),this._isRedirect=!0,mu(f,this._options),(f.protocol!==c.protocol&&f.protocol!=="https:"||f.host!==u&&!QT(f.host,u))&&du(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),Vi(n)){var v={headers:i.headers,statusCode:e},_={url:d,method:s,headers:r};n(this._options,v,_),this._sanitizeOptions(this._options)}this._performRequest()};function v0(i){var e={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(i).forEach(function(r){var n=r+":",s=t[n]=i[r],o=e[r]=Object.create(s);function c(d,f,v){return tk(d)?d=mu(d):$i(d)?d=mu(wu(d)):(v=f,f=x0(d),d={protocol:n}),Vi(f)&&(v=f,f=null),f=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},d,f),f.nativeProtocols=t,!$i(f.host)&&!$i(f.hostname)&&(f.hostname="::1"),gu.equal(f.protocol,n,"protocol mismatch"),m0("options",f),new ct(f,v)}function u(d,f,v){var _=o.request(d,f,v);return _.end(),_}Object.defineProperties(o,{request:{value:c,configurable:!0,enumerable:!0,writable:!0},get:{value:u,configurable:!0,enumerable:!0,writable:!0}})}),e}function g0(){}function wu(i){var e;if(xu)e=new Mn(i);else if(e=x0(On.parse(i)),!$i(e.protocol))throw new fu({input:i});return e}function ZT(i,e){return xu?new Mn(i,e):wu(On.resolve(e,i))}function x0(i){if(/^\[/.test(i.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(i.hostname))throw new fu({input:i.href||i});if(/^\[/.test(i.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(i.host))throw new fu({input:i.href||i});return i}function mu(i,e){var t=e||{};for(var r of KT)t[r]=i[r];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 du(i,e){var t;for(var r in e)i.test(r)&&(t=e[r],delete e[r]);return t===null||typeof t>"u"?void 0:String(t).trim()}function An(i,e,t){function r(n){Vi(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,n||{}),this.code=i,this.message=this.cause?e+": "+this.cause.message:e}return r.prototype=new(t||Error),Object.defineProperties(r.prototype,{constructor:{value:r,enumerable:!1},name:{value:"Error ["+i+"]",enumerable:!1}}),r}function _u(i,e){for(var t of yu)i.removeListener(t,bu[t]);i.on("error",g0),i.destroy(e)}function QT(i,e){gu($i(i)&&$i(e));var t=i.length-e.length-1;return t>0&&i[t]==="."&&i.endsWith(e)}function $i(i){return typeof i=="string"||i instanceof String}function Vi(i){return typeof i=="function"}function ek(i){return typeof i=="object"&&"length"in i}function tk(i){return Mn&&i instanceof Mn}Su.exports=v0({http:$T,https:VT});Su.exports.wrap=v0});var w0=T((gR,b0)=>{var ik=require("http"),rk=require("https"),Rn=d0(),Fo=qo(),nk=y0();Rn=Object.keys(Rn).map(function(i){return Rn[i]});var sk={http:ik,https:rk};b0.exports={deleteLength:function(e,t,r){(e.method==="DELETE"||e.method==="OPTIONS")&&!e.headers["content-length"]&&(e.headers["content-length"]="0",delete e.headers["transfer-encoding"])},timeout:function(e,t,r){r.timeout&&e.socket.setTimeout(r.timeout)},XHeaders:function(e,t,r){if(r.xfwd){var n=e.isSpdy||Fo.hasEncryptedConnection(e),s={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Fo.getPort(e),proto:n?"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,r,n,s,o){s.emit("start",e,t,r.target||r.forward);var c=r.followRedirects?nk:sk,u=c.http,d=c.https;if(r.forward){var f=(r.forward.protocol==="https:"?d:u).request(Fo.setupOutgoing(r.ssl||{},r,e,"forward")),v=C(f,r.forward);if(e.on("error",v),f.on("error",v),(r.buffer||e).pipe(f),!r.target)return t.end()}var _=(r.target.protocol==="https:"?d:u).request(Fo.setupOutgoing(r.ssl||{},r,e));_.on("socket",function(k){s&&!_.getHeader("expect")&&s.emit("proxyReq",_,e,t,r)}),r.proxyTimeout&&_.setTimeout(r.proxyTimeout,function(){_.abort()}),e.on("aborted",function(){_.abort()});var E=C(_,r.target);e.on("error",E),_.on("error",E);function C(k,M){return function(A){if(e.socket.destroyed&&A.code==="ECONNRESET")return s.emit("econnreset",A,e,t,M),k.abort();o?o(A,e,t,M):s.emit("error",A,e,t,M)}}(r.buffer||e).pipe(_),_.on("response",function(k){if(s&&s.emit("proxyRes",k,e,t),!t.headersSent&&!r.selfHandleResponse)for(var M=0;M<Rn.length&&!Rn[M](e,t,k,r);M++);t.finished?s&&s.emit("end",e,t,k):(k.on("end",function(){s&&s.emit("end",e,t,k)}),r.selfHandleResponse||k.pipe(t))})}}});var S0=T((xR,_0)=>{var ok=require("http"),ak=require("https"),Kr=qo();_0.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,r){if(r.xfwd){var n={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Kr.getPort(e),proto:Kr.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]?",":"")+n[s]})}},stream:function(e,t,r,n,s,o){var c=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
|
|
29
|
+
`;let u=(0,sT.parseProxyResponse)(n);n.write(`${c}\r
|
|
30
|
+
`);let{connect:d,buffered:f}=await u;if(e.emit("proxyConnect",d),this.emit("proxyConnect",d,e),d.statusCode===200)return e.once("socket",oT),t.secureEndpoint?(bn("Upgrading socket connection to TLS"),sx.connect({...ax(ox(t),"host","path","port"),socket:n})):n;n.destroy();let v=new So.Socket({writable:!1});return v.readable=!0,e.once("socket",_=>{bn("Replaying proxy buffer for failed request"),(0,tT.default)(_.listenerCount("data")>0),_.push(f),_.push(null)}),v}};Eo.protocols=["http","https"];At.HttpsProxyAgent=Eo;function oT(i){i.resume()}function ax(i,...e){let t={},r;for(r in i)e.includes(r)||(t[r]=i[r]);return t}});var mx=T((SA,hx)=>{"use strict";var dx=require("url"),fx=require("https"),aT=iu(),Co=Zl(),cT=tu(),mt=xo(),lT=Jl(),px=2419200,nu="",su;function wn(){}wn.prototype.setGCMAPIKey=function(i){if(i===null){nu=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.");nu=i};wn.prototype.setVapidDetails=function(i,e,t){if(arguments.length===1&&arguments[0]===null){su=null;return}Co.validateSubject(i),Co.validatePublicKey(e),Co.validatePrivateKey(t),su={subject:i,publicKey:e,privateKey:t}};wn.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 r=nu,n=su,s=px,o={},c=mt.supportedContentEncodings.AES_128_GCM,u=mt.supportedUrgency.NORMAL,d,f,v,_;if(t){let O=["headers","gcmAPIKey","vapidDetails","TTL","contentEncoding","urgency","topic","proxy","agent","timeout"],A=Object.keys(t);for(let I=0;I<A.length;I+=1){let U=A[I];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 I=Object.keys(o).filter(function(U){return typeof t[U]<"u"});if(I.length>0)throw new Error("Duplicated headers defined ["+I.join(",")+"]. Please either define the header in thetop level options OR in the 'headers' key.")}if(t.gcmAPIKey&&(r=t.gcmAPIKey),t.vapidDetails!==void 0&&(n=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)c=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)u=t.urgency;else throw new Error("Unsupported urgency specified.");if(t.topic){if(!lT.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");d=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 fx.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 s>"u"&&(s=px);let E={method:"POST",headers:{TTL:s}};Object.keys(o).forEach(function(O){E.headers[O]=o[O]});let C=null;if(e){let O=cT.encrypt(i.keys.p256dh,i.keys.auth,e,c);E.headers["Content-Length"]=O.cipherText.length,E.headers["Content-Type"]="application/octet-stream",c===mt.supportedContentEncodings.AES_128_GCM?E.headers["Content-Encoding"]=mt.supportedContentEncodings.AES_128_GCM:c===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")),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)r?E.headers.Authorization="key="+r: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(n){let O=dx.parse(i.endpoint),A=O.protocol+"//"+O.host,I=Co.getVapidHeaders(A,n.subject,n.publicKey,n.privateKey,c);E.headers.Authorization=I.Authorization,c===mt.supportedContentEncodings.AES_GCM&&(E.headers["Crypto-Key"]?E.headers["Crypto-Key"]+=";"+I["Crypto-Key"]:E.headers["Crypto-Key"]=I["Crypto-Key"])}else M&&r&&(E.headers.Authorization="key="+r);return E.headers.Urgency=u,d&&(E.headers.Topic=d),E.body=C,E.endpoint=i.endpoint,f&&(E.proxy=f),v&&(E.agent=v),_&&(E.timeout=_),E};wn.prototype.sendNotification=function(i,e,t){let r;try{r=this.generateRequestDetails(i,e,t)}catch(n){return Promise.reject(n)}return new Promise(function(n,s){let o={},c=dx.parse(r.endpoint);if(o.hostname=c.hostname,o.port=c.port,o.path=c.path,o.headers=r.headers,o.method=r.method,r.timeout&&(o.timeout=r.timeout),r.agent&&(o.agent=r.agent),r.proxy){let{HttpsProxyAgent:d}=ux();o.agent=new d(r.proxy)}let u=fx.request(o,function(d){let f="";d.on("data",function(v){f+=v}),d.on("end",function(){d.statusCode<200||d.statusCode>299?s(new aT("Received unexpected response code",d.statusCode,d.headers,f,r.endpoint)):n({statusCode:d.statusCode,body:f,headers:d.headers})})});r.timeout&&u.on("timeout",function(){u.destroy(new Error("Socket timeout"))}),u.on("error",function(d){s(d)}),r.body&&u.write(r.body),u.end()})};hx.exports=wn});var xx=T((EA,gx)=>{"use strict";var vx=Zl(),uT=tu(),pT=mx(),dT=iu(),fT=xo(),_n=new pT;gx.exports={WebPushError:dT,supportedContentEncodings:fT.supportedContentEncodings,encrypt:uT.encrypt,getVapidHeaders:vx.getVapidHeaders,generateVAPIDKeys:vx.generateVAPIDKeys,setGCMAPIKey:_n.setGCMAPIKey,setVapidDetails:_n.setVapidDetails,generateRequestDetails:_n.generateRequestDetails,sendNotification:_n.sendNotification.bind(_n)}});var s0=T((pR,uu)=>{"use strict";var LT=Object.prototype.hasOwnProperty,tt="~";function Tn(){}Object.create&&(Tn.prototype=Object.create(null),new Tn().__proto__||(tt=!1));function qT(i,e,t){this.fn=i,this.context=e,this.once=t||!1}function n0(i,e,t,r,n){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new qT(t,r||i,n),o=tt?tt+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 Lo(i,e){--i._eventsCount===0?i._events=new Tn:delete i._events[e]}function Je(){this._events=new Tn,this._eventsCount=0}Je.prototype.eventNames=function(){var e=[],t,r;if(this._eventsCount===0)return e;for(r in t=this._events)LT.call(t,r)&&e.push(tt?r.slice(1):r);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Je.prototype.listeners=function(e){var t=tt?tt+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,s=r.length,o=new Array(s);n<s;n++)o[n]=r[n].fn;return o};Je.prototype.listenerCount=function(e){var t=tt?tt+e:e,r=this._events[t];return r?r.fn?1:r.length:0};Je.prototype.emit=function(e,t,r,n,s,o){var c=tt?tt+e:e;if(!this._events[c])return!1;var u=this._events[c],d=arguments.length,f,v;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,n),!0;case 5:return u.fn.call(u.context,t,r,n,s),!0;case 6:return u.fn.call(u.context,t,r,n,s,o),!0}for(v=1,f=new Array(d-1);v<d;v++)f[v-1]=arguments[v];u.fn.apply(u.context,f)}else{var _=u.length,E;for(v=0;v<_;v++)switch(u[v].once&&this.removeListener(e,u[v].fn,void 0,!0),d){case 1:u[v].fn.call(u[v].context);break;case 2:u[v].fn.call(u[v].context,t);break;case 3:u[v].fn.call(u[v].context,t,r);break;case 4:u[v].fn.call(u[v].context,t,r,n);break;default:if(!f)for(E=1,f=new Array(d-1);E<d;E++)f[E-1]=arguments[E];u[v].fn.apply(u[v].context,f)}}return!0};Je.prototype.on=function(e,t,r){return n0(this,e,t,r,!1)};Je.prototype.once=function(e,t,r){return n0(this,e,t,r,!0)};Je.prototype.removeListener=function(e,t,r,n){var s=tt?tt+e:e;if(!this._events[s])return this;if(!t)return Lo(this,s),this;var o=this._events[s];if(o.fn)o.fn===t&&(!n||o.once)&&(!r||o.context===r)&&Lo(this,s);else{for(var c=0,u=[],d=o.length;c<d;c++)(o[c].fn!==t||n&&!o[c].once||r&&o[c].context!==r)&&u.push(o[c]);u.length?this._events[s]=u.length===1?u[0]:u:Lo(this,s)}return this};Je.prototype.removeAllListeners=function(e){var t;return e?(t=tt?tt+e:e,this._events[t]&&Lo(this,t)):(this._events=new Tn,this._eventsCount=0),this};Je.prototype.off=Je.prototype.removeListener;Je.prototype.addListener=Je.prototype.on;Je.prefixed=tt;Je.EventEmitter=Je;typeof uu<"u"&&(uu.exports=Je)});var a0=T((dR,o0)=>{"use strict";o0.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 qo=T(l0=>{var li=l0,FT=require("url"),c0=require("util")._extend,UT=a0(),HT=/(^|,)\s*upgrade\s*($|,)/i,pu=/^https|wss/;li.isSSL=pu;li.setupOutgoing=function(i,e,t,r){i.port=e[r||"target"].port||(pu.test(e[r||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(c){i[c]=e[r||"target"][c]}),i.method=e.method||t.method,i.headers=c0({},t.headers),e.headers&&c0(i.headers,e.headers),e.auth&&(i.auth=e.auth),e.ca&&(i.ca=e.ca),pu.test(e[r||"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"||!HT.test(i.headers.connection))&&(i.headers.connection="close"));var n=e[r||"target"],s=n&&e.prependPath!==!1&&n.path||"",o=e.toProxy?t.url:FT.parse(t.url).path||"";return o=e.ignorePath?"":o,i.path=li.urlJoin(s,o),e.changeOrigin&&(i.headers.host=UT(i.port,e[r||"target"].protocol)&&!zT(i.host)?i.host+":"+i.port:i.host),i};li.setupSocket=function(i){return i.setTimeout(0),i.setNoDelay(!0),i.setKeepAlive(!0,0),i};li.getPort=function(i){var e=i.headers.host?i.headers.host.match(/:(\d+)/):"";return e?e[1]:li.hasEncryptedConnection(i)?"443":"80"};li.hasEncryptedConnection=function(i){return!!(i.connection.encrypted||i.connection.pair)};li.urlJoin=function(){var i=Array.prototype.slice.call(arguments),e=i.length-1,t=i[e],r=t.split("?"),n;return i[e]=r.shift(),n=[i.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")],n.push.apply(n,r),n.join("?")};li.rewriteCookieProperty=function i(e,t,r){return Array.isArray(e)?e.map(function(n){return i(n,t,r)}):e.replace(new RegExp("(;\\s*"+r+"=)([^;]+)","i"),function(n,s,o){var c;if(o in t)c=t[o];else if("*"in t)c=t["*"];else return n;return c?s+c:""})};function zT(i){return!!~i.indexOf(":")}});var f0=T((hR,d0)=>{var u0=require("url"),p0=qo(),WT=/^201|30(1|2|7|8)$/;d0.exports={removeChunked:function(e,t,r){e.httpVersion==="1.0"&&delete r.headers["transfer-encoding"]},setConnection:function(e,t,r){e.httpVersion==="1.0"?r.headers.connection=e.headers.connection||"close":e.httpVersion!=="2.0"&&!r.headers.connection&&(r.headers.connection=e.headers.connection||"keep-alive")},setRedirectHostRewrite:function(e,t,r,n){if((n.hostRewrite||n.autoRewrite||n.protocolRewrite)&&r.headers.location&&WT.test(r.statusCode)){var s=u0.parse(n.target),o=u0.parse(r.headers.location);if(s.host!=o.host)return;n.hostRewrite?o.host=n.hostRewrite:n.autoRewrite&&(o.host=e.headers.host),n.protocolRewrite&&(o.protocol=n.protocolRewrite),r.headers.location=o.format()}},writeHeaders:function(e,t,r,n){var s=n.cookieDomainRewrite,o=n.cookiePathRewrite,c=n.preserveHeaderKeyCase,u,d=function(_,E){E!=null&&(s&&_.toLowerCase()==="set-cookie"&&(E=p0.rewriteCookieProperty(E,s,"domain")),o&&_.toLowerCase()==="set-cookie"&&(E=p0.rewriteCookieProperty(E,o,"path")),t.setHeader(String(_).trim(),E))};if(typeof s=="string"&&(s={"*":s}),typeof o=="string"&&(o={"*":o}),c&&r.rawHeaders!=null){u={};for(var f=0;f<r.rawHeaders.length;f+=2){var v=r.rawHeaders[f];u[v.toLowerCase()]=v}}Object.keys(r.headers).forEach(function(_){var E=r.headers[_];c&&u&&(_=u[_]||_),d(_,E)})},writeStatusCode:function(e,t,r){r.statusMessage?(t.statusCode=r.statusCode,t.statusMessage=r.statusMessage):t.statusCode=r.statusCode}}});var m0=T((mR,h0)=>{var kn;h0.exports=function(){if(!kn){try{kn=ie()("follow-redirects")}catch{}typeof kn!="function"&&(kn=function(){})}kn.apply(null,arguments)}});var b0=T((vR,Su)=>{var On=require("url"),Mn=On.URL,$T=require("http"),VT=require("https"),vu=require("stream").Writable,gu=require("assert"),v0=m0();(function(){var e=typeof process<"u",t=typeof window<"u"&&typeof document<"u",r=Vi(Error.captureStackTrace);!e&&(t||!r)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var xu=!1;try{gu(new Mn(""))}catch(i){xu=i.code==="ERR_INVALID_URL"}var KT=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],yu=["abort","aborted","connect","error","socket","timeout"],bu=Object.create(null);yu.forEach(function(i){bu[i]=function(e,t,r){this._redirectable.emit(i,e,t,r)}});var fu=An("ERR_INVALID_URL","Invalid URL",TypeError),hu=An("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),GT=An("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",hu),YT=An("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),JT=An("ERR_STREAM_WRITE_AFTER_END","write after end"),XT=vu.prototype.destroy||x0;function ct(i,e){vu.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(r){try{t._processResponse(r)}catch(n){t.emit("error",n instanceof hu?n:new hu({cause:n}))}},this._performRequest()}ct.prototype=Object.create(vu.prototype);ct.prototype.abort=function(){_u(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};ct.prototype.destroy=function(i){return _u(this._currentRequest,i),XT.call(this,i),this};ct.prototype.write=function(i,e,t){if(this._ending)throw new JT;if(!$i(i)&&!ek(i))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Vi(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 YT),this.abort())};ct.prototype.end=function(i,e,t){if(Vi(i)?(t=i,i=e=null):Vi(e)&&(t=e,e=null),!i)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var r=this,n=this._currentRequest;this.write(i,e,function(){r._ended=!0,n.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 r(o){o.setTimeout(i),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function n(o){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),s()},i),r(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",n)}return e&&this.on("timeout",e),this.socket?n(this.socket):this._currentRequest.once("socket",n),this.on("socket",r),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 r=this._currentRequest=e.request(this._options,this._onNativeResponse);r._redirectable=this;for(var n of yu)r.on(n,bu[n]);if(this._currentUrl=/^\//.test(this._options.path)?On.format(this._options):this._options.path,this._isRedirect){var s=0,o=this,c=this._requestBodyBuffers;(function u(d){if(r===o._currentRequest)if(d)o.emit("error",d);else if(s<c.length){var f=c[s++];r.finished||r.write(f.data,f.encoding,u)}else o._ended&&r.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(_u(this._currentRequest),i.destroy(),++this._redirectCount>this._options.maxRedirects)throw new GT;var r,n=this._options.beforeRedirect;n&&(r=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=[],du(/^content-/i,this._options.headers));var o=du(/^host$/i,this._options.headers),c=wu(this._currentUrl),u=o||c.host,d=/^\w+:/.test(t)?this._currentUrl:On.format(Object.assign(c,{host:u})),f=ZT(t,d);if(v0("redirecting to",f.href),this._isRedirect=!0,mu(f,this._options),(f.protocol!==c.protocol&&f.protocol!=="https:"||f.host!==u&&!QT(f.host,u))&&du(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),Vi(n)){var v={headers:i.headers,statusCode:e},_={url:d,method:s,headers:r};n(this._options,v,_),this._sanitizeOptions(this._options)}this._performRequest()};function g0(i){var e={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(i).forEach(function(r){var n=r+":",s=t[n]=i[r],o=e[r]=Object.create(s);function c(d,f,v){return tk(d)?d=mu(d):$i(d)?d=mu(wu(d)):(v=f,f=y0(d),d={protocol:n}),Vi(f)&&(v=f,f=null),f=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},d,f),f.nativeProtocols=t,!$i(f.host)&&!$i(f.hostname)&&(f.hostname="::1"),gu.equal(f.protocol,n,"protocol mismatch"),v0("options",f),new ct(f,v)}function u(d,f,v){var _=o.request(d,f,v);return _.end(),_}Object.defineProperties(o,{request:{value:c,configurable:!0,enumerable:!0,writable:!0},get:{value:u,configurable:!0,enumerable:!0,writable:!0}})}),e}function x0(){}function wu(i){var e;if(xu)e=new Mn(i);else if(e=y0(On.parse(i)),!$i(e.protocol))throw new fu({input:i});return e}function ZT(i,e){return xu?new Mn(i,e):wu(On.resolve(e,i))}function y0(i){if(/^\[/.test(i.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(i.hostname))throw new fu({input:i.href||i});if(/^\[/.test(i.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(i.host))throw new fu({input:i.href||i});return i}function mu(i,e){var t=e||{};for(var r of KT)t[r]=i[r];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 du(i,e){var t;for(var r in e)i.test(r)&&(t=e[r],delete e[r]);return t===null||typeof t>"u"?void 0:String(t).trim()}function An(i,e,t){function r(n){Vi(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,n||{}),this.code=i,this.message=this.cause?e+": "+this.cause.message:e}return r.prototype=new(t||Error),Object.defineProperties(r.prototype,{constructor:{value:r,enumerable:!1},name:{value:"Error ["+i+"]",enumerable:!1}}),r}function _u(i,e){for(var t of yu)i.removeListener(t,bu[t]);i.on("error",x0),i.destroy(e)}function QT(i,e){gu($i(i)&&$i(e));var t=i.length-e.length-1;return t>0&&i[t]==="."&&i.endsWith(e)}function $i(i){return typeof i=="string"||i instanceof String}function Vi(i){return typeof i=="function"}function ek(i){return typeof i=="object"&&"length"in i}function tk(i){return Mn&&i instanceof Mn}Su.exports=g0({http:$T,https:VT});Su.exports.wrap=g0});var _0=T((gR,w0)=>{var ik=require("http"),rk=require("https"),Rn=f0(),Fo=qo(),nk=b0();Rn=Object.keys(Rn).map(function(i){return Rn[i]});var sk={http:ik,https:rk};w0.exports={deleteLength:function(e,t,r){(e.method==="DELETE"||e.method==="OPTIONS")&&!e.headers["content-length"]&&(e.headers["content-length"]="0",delete e.headers["transfer-encoding"])},timeout:function(e,t,r){r.timeout&&e.socket.setTimeout(r.timeout)},XHeaders:function(e,t,r){if(r.xfwd){var n=e.isSpdy||Fo.hasEncryptedConnection(e),s={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Fo.getPort(e),proto:n?"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,r,n,s,o){s.emit("start",e,t,r.target||r.forward);var c=r.followRedirects?nk:sk,u=c.http,d=c.https;if(r.forward){var f=(r.forward.protocol==="https:"?d:u).request(Fo.setupOutgoing(r.ssl||{},r,e,"forward")),v=C(f,r.forward);if(e.on("error",v),f.on("error",v),(r.buffer||e).pipe(f),!r.target)return t.end()}var _=(r.target.protocol==="https:"?d:u).request(Fo.setupOutgoing(r.ssl||{},r,e));_.on("socket",function(k){s&&!_.getHeader("expect")&&s.emit("proxyReq",_,e,t,r)}),r.proxyTimeout&&_.setTimeout(r.proxyTimeout,function(){_.abort()}),e.on("aborted",function(){_.abort()});var E=C(_,r.target);e.on("error",E),_.on("error",E);function C(k,M){return function(A){if(e.socket.destroyed&&A.code==="ECONNRESET")return s.emit("econnreset",A,e,t,M),k.abort();o?o(A,e,t,M):s.emit("error",A,e,t,M)}}(r.buffer||e).pipe(_),_.on("response",function(k){if(s&&s.emit("proxyRes",k,e,t),!t.headersSent&&!r.selfHandleResponse)for(var M=0;M<Rn.length&&!Rn[M](e,t,k,r);M++);t.finished?s&&s.emit("end",e,t,k):(k.on("end",function(){s&&s.emit("end",e,t,k)}),r.selfHandleResponse||k.pipe(t))})}}});var E0=T((xR,S0)=>{var ok=require("http"),ak=require("https"),Kr=qo();S0.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,r){if(r.xfwd){var n={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Kr.getPort(e),proto:Kr.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]?",":"")+n[s]})}},stream:function(e,t,r,n,s,o){var c=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
31
|
`)+`\r
|
|
32
32
|
\r
|
|
33
|
-
`};Kr.setupSocket(t),n&&n.length&&t.unshift(n);var u=(Kr.isSSL.test(r.target.protocol)?ak:ok).request(Kr.setupOutgoing(r.ssl||{},r,e));return s&&s.emit("proxyReqWs",u,e,t,r,n),u.on("error",d),u.on("response",function(f){f.upgrade||(t.write(c("HTTP/"+f.httpVersion+" "+f.statusCode+" "+f.statusMessage,f.headers)),f.pipe(t))}),u.on("upgrade",function(f,v,_){v.on("error",d),v.on("end",function(){s.emit("close",f,v,_)}),t.on("error",function(){v.end()}),Kr.setupSocket(v),_&&_.length&&v.unshift(_),t.write(c("HTTP/1.1 101 Switching Protocols",f.headers)),v.pipe(t).pipe(v),s.emit("open",v),s.emit("proxySocket",v)}),u.end();function d(f){o?o(f,e,t):s.emit("error",f,e,t),t.end()}}}});var
|
|
33
|
+
`};Kr.setupSocket(t),n&&n.length&&t.unshift(n);var u=(Kr.isSSL.test(r.target.protocol)?ak:ok).request(Kr.setupOutgoing(r.ssl||{},r,e));return s&&s.emit("proxyReqWs",u,e,t,r,n),u.on("error",d),u.on("response",function(f){f.upgrade||(t.write(c("HTTP/"+f.httpVersion+" "+f.statusCode+" "+f.statusMessage,f.headers)),f.pipe(t))}),u.on("upgrade",function(f,v,_){v.on("error",d),v.on("end",function(){s.emit("close",f,v,_)}),t.on("error",function(){v.end()}),Kr.setupSocket(v),_&&_.length&&v.unshift(_),t.write(c("HTTP/1.1 101 Switching Protocols",f.headers)),v.pipe(t).pipe(v),s.emit("open",v),s.emit("proxySocket",v)}),u.end();function d(f){o?o(f,e,t):s.emit("error",f,e,t),t.end()}}}});var R0=T((yR,A0)=>{var M0=A0.exports,C0=require("util")._extend,ck=require("url").parse,O0=s0(),lk=require("http"),uk=require("https"),T0=_0(),k0=E0();M0.Server=Ki;function Eu(i){return function(e){return function(t,r){var n=i==="ws"?this.wsPasses:this.webPasses,s=[].slice.call(arguments),o=s.length-1,c,u;typeof s[o]=="function"&&(u=s[o],o--);var d=e;if(!(s[o]instanceof Buffer)&&s[o]!==r&&(d=C0({},e),C0(d,s[o]),o--),s[o]instanceof Buffer&&(c=s[o]),["target","forward"].forEach(function(v){typeof d[v]=="string"&&(d[v]=ck(d[v]))}),!d.target&&!d.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var f=0;f<n.length&&!n[f](t,r,d,c,this,u);f++);}}}M0.createRightProxy=Eu;function Ki(i){O0.call(this),i=i||{},i.prependPath=i.prependPath!==!1,this.web=this.proxyRequest=Eu("web")(i),this.ws=this.proxyWebsocketRequest=Eu("ws")(i),this.options=i,this.webPasses=Object.keys(T0).map(function(e){return T0[e]}),this.wsPasses=Object.keys(k0).map(function(e){return k0[e]}),this.on("error",this.onError,this)}require("util").inherits(Ki,O0);Ki.prototype.onError=function(i){if(this.listeners("error").length===1)throw i};Ki.prototype.listen=function(i,e){var t=this,r=function(n,s){t.web(n,s)};return this._server=this.options.ssl?uk.createServer(this.options.ssl,r):lk.createServer(r),this.options.ws&&this._server.on("upgrade",function(n,s,o){t.ws(n,s,o)}),this._server.listen(i,e),this};Ki.prototype.close=function(i){var e=this;this._server&&this._server.close(t);function t(){e._server=null,i&&i.apply(null,arguments)}};Ki.prototype.before=function(i,e,t){if(i!=="ws"&&i!=="web")throw new Error("type must be `web` or `ws`");var r=i==="ws"?this.wsPasses:this.webPasses,n=!1;if(r.forEach(function(s,o){s.name===e&&(n=o)}),n===!1)throw new Error("No such pass");r.splice(n,0,t)};Ki.prototype.after=function(i,e,t){if(i!=="ws"&&i!=="web")throw new Error("type must be `web` or `ws`");var r=i==="ws"?this.wsPasses:this.webPasses,n=!1;if(r.forEach(function(s,o){s.name===e&&(n=o)}),n===!1)throw new Error("No such pass");r.splice(n++,0,t)}});var B0=T((bR,P0)=>{var Pn=R0().Server;function Cu(i){return new Pn(i)}Pn.createProxyServer=Cu;Pn.createServer=Cu;Pn.createProxy=Cu;P0.exports=Pn});var I0=T((wR,N0)=>{N0.exports=B0()});var Ak={};Ei(Ak,{startServer:()=>Z0});module.exports=ny(Ak);var zo=require("http"),G0=require("url"),Y0=require("child_process"),Gi=require("fs"),Ft=require("path"),J0=require("url");var Uh=L(Fh(),1),{Server:Hh,Namespace:rO,Socket:nO}=Uh.default;var zx=require("fs"),Wx=require("path"),$x=require("os");var zh=(i=0)=>e=>`\x1B[${e+i}m`,Wh=(i=0)=>e=>`\x1B[${38+i};5;${e}m`,$h=(i=0)=>(e,t,r)=>`\x1B[${38+i};2;${e};${t};${r}m`,X={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},oO=Object.keys(X.modifier),T1=Object.keys(X.color),k1=Object.keys(X.bgColor),aO=[...T1,...k1];function M1(){let i=new Map;for(let[e,t]of Object.entries(X)){for(let[r,n]of Object.entries(t))X[r]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},t[r]=X[r],i.set(n[0],n[1]);Object.defineProperty(X,e,{value:t,enumerable:!1})}return Object.defineProperty(X,"codes",{value:i,enumerable:!1}),X.color.close="\x1B[39m",X.bgColor.close="\x1B[49m",X.color.ansi=zh(),X.color.ansi256=Wh(),X.color.ansi16m=$h(),X.bgColor.ansi=zh(10),X.bgColor.ansi256=Wh(10),X.bgColor.ansi16m=$h(10),Object.defineProperties(X,{rgbToAnsi256:{value(e,t,r){return e===t&&t===r?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(r/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map(s=>s+s).join(""));let n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:e=>X.rgbToAnsi256(...X.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,r,n;if(e>=232)t=((e-232)*10+8)/255,r=t,n=t;else{e-=16;let c=e%36;t=Math.floor(e/36)/5,r=Math.floor(c/6)/5,n=c%6/5}let s=Math.max(t,r,n)*2;if(s===0)return 30;let o=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>X.ansi256ToAnsi(X.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>X.ansi256ToAnsi(X.hexToAnsi256(e)),enumerable:!1}}),X}var O1=M1(),It=O1;var qs=L(require("node:process"),1),Kh=L(require("node:os"),1),Qc=L(require("node:tty"),1);function _t(i,e=globalThis.Deno?globalThis.Deno.args:qs.default.argv){let t=i.startsWith("-")?"":i.length===1?"-":"--",r=e.indexOf(t+i),n=e.indexOf("--");return r!==-1&&(n===-1||r<n)}var{env:Z}=qs.default,Ls;_t("no-color")||_t("no-colors")||_t("color=false")||_t("color=never")?Ls=0:(_t("color")||_t("colors")||_t("color=true")||_t("color=always"))&&(Ls=1);function A1(){if("FORCE_COLOR"in Z)return Z.FORCE_COLOR==="true"?1:Z.FORCE_COLOR==="false"?0:Z.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Z.FORCE_COLOR,10),3)}function R1(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function P1(i,{streamIsTTY:e,sniffFlags:t=!0}={}){let r=A1();r!==void 0&&(Ls=r);let n=t?Ls:r;if(n===0)return 0;if(t){if(_t("color=16m")||_t("color=full")||_t("color=truecolor"))return 3;if(_t("color=256"))return 2}if("TF_BUILD"in Z&&"AGENT_NAME"in Z)return 1;if(i&&!e&&n===void 0)return 0;let s=n||0;if(Z.TERM==="dumb")return s;if(qs.default.platform==="win32"){let o=Kh.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in Z)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in Z)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in Z)||Z.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Z)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Z.TEAMCITY_VERSION)?1:0;if(Z.COLORTERM==="truecolor"||Z.TERM==="xterm-kitty"||Z.TERM==="xterm-ghostty"||Z.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Z){let o=Number.parseInt((Z.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Z.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Z.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Z.TERM)||"COLORTERM"in Z?1:s}function Vh(i,e={}){let t=P1(i,{streamIsTTY:i&&i.isTTY,...e});return R1(t)}var B1={stdout:Vh({isTTY:Qc.default.isatty(1)}),stderr:Vh({isTTY:Qc.default.isatty(2)})},Gh=B1;function Yh(i,e,t){let r=i.indexOf(e);if(r===-1)return i;let n=e.length,s=0,o="";do o+=i.slice(s,r)+e+t,s=r+n,r=i.indexOf(e,s);while(r!==-1);return o+=i.slice(s),o}function Jh(i,e,t,r){let n=0,s="";do{let o=i[r-1]==="\r";s+=i.slice(n,o?r-1:r)+e+(o?`\r
|
|
34
34
|
`:`
|
|
35
35
|
`)+t,n=r+1,r=i.indexOf(`
|
|
36
|
-
`,n)}while(r!==-1);return s+=i.slice(n),s}var{stdout:Xh,stderr:Zh}=Gh,el=Symbol("GENERATOR"),wr=Symbol("STYLER"),un=Symbol("IS_EMPTY"),Qh=["ansi","ansi","ansi256","ansi16m"],_r=Object.create(null),
|
|
37
|
-
`);return s!==-1&&(e=Jh(e,n,r,s)),r+e+n};Object.defineProperties(pn.prototype,_r);var
|
|
38
|
-
`),!0}catch(e){return console.error("[DaemonClient] Send error:",e),!1}}function fn(i,e=5e3){return new Promise((t,r)=>{let n=
|
|
39
|
-
`);rl=r.pop()||"";for(let n of r)if(n.trim())try{U1(JSON.parse(n))}catch{console.error("[DaemonClient] Invalid message:",n)}}),Vt.on("close",()=>{Sr=!1,Vt=null,dn("disconnected"),setTimeout(()=>{!Sr&&!yi&&om()},2e3)}),Vt.on("error",t=>{clearTimeout(e),console.error("[DaemonClient] \u274C Connection error:",t.message),console.error("[DaemonClient] Error code:",t.code),yi=!1,i(!1)})})}catch(i){return console.error("[DaemonClient] \u274C Connect error:",i),yi=!1,!1}}}async function am(){return om()}function Dt(){return Sr}async function cm(){return(await fn({type:"listSessions"})).sessions||[]}async function lm(i,e=80,t=24){let r=`session-${Date.now()}`;return await fn({type:"createSession",sessionId:r,name:i,cols:e,rows:t})}async function um(i){return await fn({type:"joinSession",sessionId:i})}function ol(i,e){return sl({type:"input",sessionId:i,data:e})}function pm(i,e,t){return sl({type:"resize",sessionId:i,cols:e,rows:t})}async function dm(i){return await fn({type:"deleteSession",sessionId:i})}async function fm(i,e){return await fn({type:"renameSession",sessionId:i,name:e})}var Tr=class{get type(){throw new Error("Not implemented: type")}emit(e,t){throw new Error("Not implemented: emit")}sendBinary(e){throw new Error("Not implemented: sendBinary")}isReady(){throw new Error("Not implemented: isReady")}};var $s=class extends Tr{constructor(e){super(),this._socket=e}get type(){return"ws"}isReady(){return this._socket.connected}emit(e,t){this._socket.emit(e,t)}sendBinary(e){}};var hm=L(require("node-datachannel"),1);var{PeerConnection:W1}=hm.default,$1=[{hostname:"stun.cloudflare.com",port:3478,type:"Stun"}];async function V1(i,e){try{let t=await fetch(i,{headers:{"X-API-Key":e}});if(!t.ok)throw new Error(`HTTP ${t.status}`);let{iceServers:r}=await t.json(),n=[];for(let s of r)for(let o of s.urls)if(o.startsWith("stun:")){let c=o.replace("stun:","").split(":")[0],u=parseInt(o.split(":")[2]||"3478");n.push({hostname:c,port:u,type:"Stun"})}else if(o.startsWith("turn:")||o.startsWith("turns:")){let c=o.startsWith("turns:"),d=o.replace(/^turns?:/,"").split("?")[0],f=d.split(":")[0],v=parseInt(d.split(":")[1]||(c?"5349":"3478")),_=o.includes("transport=tcp")?"Tcp":"Udp";n.push({hostname:f,port:v,type:c?"Tls":"Turn",relayType:_,username:s.username,password:s.credential})}return n}catch(t){return console.error("[WebRtcProtocol] TURN fetch failed:",t.message),null}}var Vs=class extends Tr{constructor({socketId:e,apiKey:t,turnApiUrl:r,turnRefreshInterval:n,dcMaxMessageSize:s,answerTimeout:o}){super(),this._socketId=e,this._apiKey=t,this._turnApiUrl=r,this._turnRefreshInterval=n,this._dcMaxMessageSize=s,this._answerTimeout=o,this._pc=null,this._dc=null,this._iceServers=$1,this._refreshTimer=null}get type(){return"dc"}isReady(){return!!this._dc}emit(e,t){}sendBinary(e){if(!this._dc)return!1;for(let t of e)try{t.length<=this._dcMaxMessageSize&&this._dc.sendMessageBinary(t)}catch(r){return console.error("[WebRtcProtocol] sendBinary error:",r.message),!1}return!0}async init(){this._apiKey&&this._turnApiUrl&&await this._refreshTurn()}setupSignaling(e){e.on("webrtc:offer",async({sdp:t})=>{try{this._createPeer();let r=await this._processOffer(t,e);e.emit("webrtc:answer",{sdp:r})}catch(r){console.error("[WebRtcProtocol] offer error:",r.message),e.emit("webrtc:error",{message:r.message})}}),e.on("webrtc:ice-candidate",({candidate:t,mid:r})=>{try{this._pc?.addRemoteCandidate(t,r||"0")}catch(n){console.error("[WebRtcProtocol] addRemoteCandidate error:",n.message)}})}close(){clearTimeout(this._refreshTimer);try{this._pc?.close()}catch{}this._pc=null,this._dc=null}_createPeer(){try{this._pc?.close()}catch{}this._pc=null,this._dc=null;let e=new W1(`peer-${this._socketId}`,{iceServers:this._iceServers});e.onDataChannel(t=>{t.onOpen(()=>{this._dc=t}),t.onClosed(()=>{this._dc=null}),t.onError(r=>console.error(`[WebRtcProtocol] DC error [${this._socketId.slice(0,6)}]:`,r))}),this._pc=e}_processOffer(e,t){return new Promise((r,n)=>{this._pc.onLocalDescription((s,o)=>{o==="answer"&&r(s)}),this._pc.onLocalCandidate((s,o)=>{s&&t.emit("webrtc:ice-candidate",{candidate:s,mid:o})});try{this._pc.setRemoteDescription(e,"offer"),this._pc.setLocalDescription()}catch(s){n(s)}setTimeout(()=>n(new Error("Answer timeout")),this._answerTimeout)})}async _refreshTurn(){let e=await V1(this._turnApiUrl,this._apiKey);e?.length&&(this._iceServers=e,console.log(`[WebRtcProtocol] TURN credentials loaded (${e.length} servers)`)),clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(()=>this._refreshTurn(),this._turnRefreshInterval)}};var Ks=class{constructor(e,t){this._ws=new $s(e),this._rtc=null,t.enableWebRTC&&(this._rtc=new Vs({socketId:e.id,apiKey:t.apiKey||null,turnApiUrl:t.turnApiUrl||null,turnRefreshInterval:t.turnRefreshInterval,dcMaxMessageSize:t.dcMaxMessageSize,answerTimeout:t.answerTimeout}),this._dcChunkSize=t.dcChunkSize,this._dcMaxTilesPerFrame=t.dcMaxTilesPerFrame)}get type(){return this._rtc?.isReady()?"dc":"ws"}async init(){await this._rtc?.init()}setupSignaling(e){this._rtc?.setupSignaling(e)}emit(e,t){this._ws.emit(e,t)}sendTiles(e,t){let{tiles:r}=e;if(this._rtc?.isReady()&&r?.length>0&&t){if(r.length>this._dcMaxTilesPerFrame){this._ws.emit("tiles-data",e);return}let n=e.timestamp??Date.now(),s=[];for(let o=0;o<r.length;o+=this._dcChunkSize)s.push(t(r.slice(o,o+this._dcChunkSize),n));this._rtc.sendBinary(s);return}this._ws.emit("tiles-data",e)}close(){this._rtc?.close()}};kr();var{enableWebRTC:J1,enableTurn:Mm,turnApiUrl:X1,turnRefreshInterval:Z1,dcMaxMessageSize:Q1,dcChunkSize:eE,dcMaxTilesPerFrame:tE,answerTimeout:iE}=$e.webrtc,si=null;function rE(){return process.env.CODESPACES==="true"||process.env.GITPOD_WORKSPACE_ID||process.platform==="linux"&&!process.env.DISPLAY}async function Bm(){if(si!==null)return si;if(rE())return si=!1,console.log("\u2705 Remote desktop not available (headless environment)"),si;try{let i=await import("@hurdlegroup/robotjs");(i.default||i).getScreenSize(),si=!0}catch{si=!1,console.log("\u2705 Remote desktop not available (no display or robotjs not installed)")}return si}function ml(){return si===!0}var ji=null,Nm=null,Im=null,Dm=null,jm=null,Lm=null,qm=null,ni=null,Om=null,Am=null,Rm=null,Pm=null;async function nE(){if(ji)return!0;try{let i=await import("@hurdlegroup/robotjs");ji=i.default||i;let{TileManager:e}=await Promise.resolve().then(()=>(gm(),vm)),{ResourceManager:t}=await Promise.resolve().then(()=>(ym(),xm)),{ScreenUpdateHelper:r}=await Promise.resolve().then(()=>(wm(),bm)),{MouseHandler:n}=await Promise.resolve().then(()=>(Sm(),_m)),{KeyboardHandler:s}=await Promise.resolve().then(()=>(Cm(),Em)),{ScreenHandler:o}=await Promise.resolve().then(()=>(km(),Tm));return Nm=e,Im=t,Dm=r,jm=n,Lm=s,qm=o,ji.setMouseDelay(2),ji.setKeyboardDelay(2),!0}catch(i){return console.error("\u274C Failed to load remote modules:",i.message),!1}}async function Fm(i,e){if(!si){i.emit("remote:unavailable");return}if(!await nE()){i.emit("remote:unavailable");return}ni||(ni=new Im,Om=new Dm(ni),Am=new jm(ji,ni),Rm=new Lm(ji,ni),Pm=new qm(ni,Om),ni.startResourceMonitoring());let r=i.handshake.auth?.apiKey,n=new Nm(ji);ni.addClient(i.id,{tileManager:n,screenInterval:null,authenticated:!0,apiKey:r});let s=new Ks(i,{enableWebRTC:J1,apiKey:Mm?e:null,turnApiUrl:Mm?X1:null,turnRefreshInterval:Z1,dcMaxMessageSize:Q1,dcChunkSize:eE,dcMaxTilesPerFrame:tE,answerTimeout:iE});await s.init(),s.setupSignaling(i);let o=c=>c;Am.setupMouseHandlers(i,o),Rm.setupKeyboardHandlers(i,o),Pm.setupScreenHandlers(i,o,s),i.on("disconnect",()=>{ni.removeClient(i.id),s.close()}),i.emit("remote:ready"),console.log("\u{1F5A5}\uFE0F Remote handlers attached:",i.id)}var bi=L(require("fs"),1),vl=L(require("path"),1),Xs=0,hn=null,sE=6e4,oE={name:"9Remote",postCreateCommand:"npm install -g 9remote@latest",postAttachCommand:"9remote start",forwardPorts:[2208],portsAttributes:{2208:{label:"9Remote Server",onAutoForward:"notify"}}};function oi(){return process.env.CODESPACES==="true"}function Um(){return oi()?{isCodespaces:!0,codespaceName:process.env.CODESPACE_NAME||"unknown",workspacePath:process.env.CODESPACE_VSCODE_FOLDER||process.cwd()}:null}function Hm(){Xs++,oi()&&Xs===1&&aE()}function zm(){Xs--,oi()&&Xs===0&&cE()}function aE(){hn||(hn=setInterval(()=>{process.memoryUsage()},sE))}function cE(){hn&&(console.log("\u23F8\uFE0F Stopping Codespaces heartbeat"),clearInterval(hn),hn=null)}function Wm(i){return vl.default.join(i,".devcontainer","devcontainer.json")}function $m(i){try{let e=Wm(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 Vm(i,e){try{let t=vl.default.join(i,".devcontainer"),r=Wm(i);bi.default.existsSync(t)||bi.default.mkdirSync(t,{recursive:!0});let n={...oE};if(bi.default.existsSync(r))try{n={...JSON.parse(bi.default.readFileSync(r,"utf8"))}}catch{}return e?(n.postAttachCommand="9remote start",n.postCreateCommand||(n.postCreateCommand="npm install -g 9remote@latest")):delete n.postAttachCommand,bi.default.writeFileSync(r,JSON.stringify(n,null,2)),{success:!0,enabled:e}}catch(t){return{success:!1,error:t.message}}}var Or=L(require("os"),1),Ye=L(require("fs"),1),Li=L(require("path"),1),Ar=Li.default.join(Or.default.homedir(),".9remote","buffers"),Zs=Li.default.join(Or.default.homedir(),".9remote","sessions.json"),Qs="/tmp/9remote-uploads";Ye.default.existsSync(Qs)||Ye.default.mkdirSync(Qs,{recursive:!0});function eo(){return process.platform==="win32"?process.env.COMSPEC||"powershell.exe":process.env.SHELL||"/bin/zsh"}function gl(i){return i?"/workspaces":Or.default.homedir()}function xl(){let i=Or.default.homedir(),e=Or.default.userInfo().username,t=eo(),r={...process.env};if(Object.assign(r,{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:r.TMPDIR||(process.platform==="win32"?r.TEMP||r.TMP:"/tmp"),__CF_USER_TEXT_ENCODING:r.__CF_USER_TEXT_ENCODING,XPC_FLAGS:r.XPC_FLAGS,XPC_SERVICE_NAME:r.XPC_SERVICE_NAME,SSH_AUTH_SOCK:r.SSH_AUTH_SOCK,TERM_PROGRAM:"9Remote",TERM_PROGRAM_VERSION:"1.0.0",ITERM_SESSION_ID:`9remote-${Date.now()}`,SHLVL:"1"}),t.includes("bash")){let n=r.PROMPT_COMMAND||"";r.PROMPT_COMMAND=`printf "\\e]7;file://%s\\a" "\${HOSTNAME}\${PWD}"${n?`; ${n}`:""}`}return r}function Km(){Ye.default.existsSync(Ar)||Ye.default.mkdirSync(Ar,{recursive:!0})}function yl(i,e,t){if(t==="buffer"){Km();try{Ye.default.writeFileSync(Li.default.join(Ar,`${i}.buf`),e.join(""),"utf8")}catch(r){console.log(`\u26A0\uFE0F Failed to save buffer for ${i}:`,r.message)}}}function Gm(i,e){if(e!=="buffer")return null;let t=Li.default.join(Ar,`${i}.buf`);try{if(Ye.default.existsSync(t))return Ye.default.readFileSync(t,"utf8")}catch(r){console.log(`\u26A0\uFE0F Failed to load buffer for ${i}:`,r.message)}return null}function bl(i){let e=Li.default.join(Ar,`${i}.buf`);try{Ye.default.existsSync(e)&&Ye.default.unlinkSync(e)}catch{}}function Ym(){Km();try{return Ye.default.readdirSync(Ar).filter(i=>i.endsWith(".buf")).map(i=>i.replace(".buf",""))}catch{return[]}}function Jm(){try{if(Ye.default.existsSync(Zs))return JSON.parse(Ye.default.readFileSync(Zs,"utf8"))}catch(i){console.log("\u26A0\uFE0F Failed to load session metadata:",i.message)}return{}}function wl(i){try{let e={};for(let[r,n]of i)e[r]={name:n.name,createdAt:n.createdAt};let t=Li.default.dirname(Zs);Ye.default.existsSync(t)||Ye.default.mkdirSync(t,{recursive:!0}),Ye.default.writeFileSync(Zs,JSON.stringify(e,null,2),"utf8")}catch(e){console.log("\u26A0\uFE0F Failed to save session metadata:",e.message)}}var _l=L(require("node-pty"),1);var lE=50*1024,qi="daemon";function Xm(i,e,t,r,n){let s=null;i.onData(o=>{t.buffer.push(o);let c=t.buffer.reduce((u,d)=>u+d.length,0);for(;c>lE&&t.buffer.length>1;)c-=t.buffer.shift().length;r.emit("output",{sessionId:e,data:Buffer.from(o,"utf-8")}),qi==="buffer"&&(s&&clearTimeout(s),s=setTimeout(()=>yl(e,t.buffer,qi),2e3))}),i.onExit(({exitCode:o})=>{console.log(`PTY exited: sessionId=${e}, code=${o}`),qi==="buffer"&&t.buffer.length>0&&yl(e,t.buffer,qi),n.delete(e),bl(e),r.emit("sessionClosed",e)})}function Zm(i,e,t){i.on("getSessions",r=>{let n=[];for(let[s,o]of t)n.push({id:s,name:o.name,createdAt:o.createdAt,restored:o.restored||!1});r(n)}),i.on("createSession",async({name:r},n)=>{let s=`session-${Date.now()}`,o=xl();o.NINE_REMOTE_SESSION_ID=s;let c=gl(oi());try{if(qi==="daemon"&&Dt()){let _=await lm(r,80,24);_.success?(t.set(_.sessionId,{daemon:!0,name:r||`Terminal ${t.size+1}`,createdAt:Date.now(),cwd:_.cwd}),n({success:!0,sessionId:_.sessionId})):n({success:!1,error:_.error});return}let u=eo(),d=process.platform==="win32"?[]:["-l"],f=_l.default.spawn(u,d,{name:"xterm-256color",cols:80,rows:24,cwd:c,env:o,useConpty:!1}),v={pty:f,name:r||`Terminal ${t.size+1}`,createdAt:Date.now(),buffer:[],cwd:c};Xm(f,s,v,e,t),t.set(s,v),n({success:!0,sessionId:s})}catch(u){console.error("Failed to create session:",u),n({success:!1,error:u.message})}}),i.on("joinSession",async(r,n)=>{let s=t.get(r);if(!s)return n({success:!1,error:"Session not found"});if(s.daemon&&Dt()){try{let o=await um(r);n({success:o.success,name:o.name,cwd:o.cwd,error:o.error})}catch(o){n({success:!1,error:o.message})}return}if(s.needsRestore&&qi==="buffer")try{let o=eo(),c=process.platform==="win32"?[]:["-l"],u=gl(oi()),d=_l.default.spawn(o,c,{name:"xterm-256color",cols:80,rows:24,cwd:u,env:xl(),useConpty:!1});s.pty=d,s.needsRestore=!1,s.cwd=u;let f=Gm(r,qi);f&&(s.buffer=[f]),Xm(d,r,s,e,t),console.log(`\u2705 Restored PTY session: ${r}`)}catch(o){return console.error("Failed to restore session:",o),n({success:!1,error:"Failed to restore session"})}s.buffer?.length>0&&i.emit("output",{sessionId:r,data:Buffer.from(s.buffer.join(""),"utf-8")}),n({success:!0,name:s.name,cwd:s.cwd})}),i.on("deleteSession",async(r,n)=>{let s=t.get(r);if(!s)return n({success:!1,error:"Session not found"});if(s.daemon&&Dt()){try{await dm(r),t.delete(r),n({success:!0})}catch(o){n({success:!1,error:o.message})}return}s.pty&&s.pty.kill(),t.delete(r),bl(r),e.emit("sessionClosed",r),wl(t),n({success:!0})}),i.on("renameSession",async({sessionId:r,name:n},s)=>{let o=t.get(r);if(!o)return s({success:!1,error:"Session not found"});if(o.daemon&&Dt()){try{await fm(r,n),o.name=n,s({success:!0})}catch(c){s({success:!1,error:c.message})}return}o.name=n,e.emit("session-renamed",{sessionId:r,name:n}),wl(t),s({success:!0})})}var Qm=L(require("fs"),1),ev=L(require("path"),1);function tv(i,e){i.on("input",({sessionId:t,data:r})=>{if(!t)return;let n=e.get(t);if(n){if(n.daemon&&Dt())return ol(t,r);n.pty&&n.pty.write(Buffer.isBuffer(r)?r.toString("utf-8"):r)}}),i.on("resize",({sessionId:t,cols:r,rows:n})=>{if(!t)return;let s=e.get(t);if(s){if(s.daemon&&Dt())return pm(t,r,n);if(s.pty)try{s.pty.resize(r,n)}catch(o){console.log(`Resize failed for ${t}: ${o.message}`)}}}),i.on("upload-file",({sessionId:t,filename:r,size:n,content:s})=>{if(!t)return;let o=e.get(t);if(o)try{let c=r.replace(/[^a-zA-Z0-9._-]/g,"_"),u=ev.default.join(Qs,`${Date.now()}_${c}`);Qm.default.writeFileSync(u,Buffer.from(s,"base64")),console.log(`\u{1F4CE} File uploaded: ${u} (${n} bytes)`),o.daemon&&Dt()?ol(t,u):o.pty&&o.pty.write(u)}catch(c){console.error("File upload error:",c),i.emit("output",{sessionId:t,data:Buffer.from(`\r
|
|
36
|
+
`,n)}while(r!==-1);return s+=i.slice(n),s}var{stdout:Xh,stderr:Zh}=Gh,el=Symbol("GENERATOR"),wr=Symbol("STYLER"),un=Symbol("IS_EMPTY"),Qh=["ansi","ansi","ansi256","ansi16m"],_r=Object.create(null),N1=(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=Xh?Xh.level:0;i.level=e.level===void 0?t:e.level};var I1=i=>{let e=(...t)=>t.join(" ");return N1(e,i),Object.setPrototypeOf(e,pn.prototype),e};function pn(i){return I1(i)}Object.setPrototypeOf(pn.prototype,Function.prototype);for(let[i,e]of Object.entries(It))_r[i]={get(){let t=Fs(this,il(e.open,e.close,this[wr]),this[un]);return Object.defineProperty(this,i,{value:t}),t}};_r.visible={get(){let i=Fs(this,this[wr],!0);return Object.defineProperty(this,"visible",{value:i}),i}};var tl=(i,e,t,...r)=>i==="rgb"?e==="ansi16m"?It[t].ansi16m(...r):e==="ansi256"?It[t].ansi256(It.rgbToAnsi256(...r)):It[t].ansi(It.rgbToAnsi(...r)):i==="hex"?tl("rgb",e,t,...It.hexToRgb(...r)):It[t][i](...r),D1=["rgb","hex","ansi256"];for(let i of D1){_r[i]={get(){let{level:t}=this;return function(...r){let n=il(tl(i,Qh[t],"color",...r),It.color.close,this[wr]);return Fs(this,n,this[un])}}};let e="bg"+i[0].toUpperCase()+i.slice(1);_r[e]={get(){let{level:t}=this;return function(...r){let n=il(tl(i,Qh[t],"bgColor",...r),It.bgColor.close,this[wr]);return Fs(this,n,this[un])}}}}var j1=Object.defineProperties(()=>{},{..._r,level:{enumerable:!0,get(){return this[el].level},set(i){this[el].level=i}}}),il=(i,e,t)=>{let r,n;return t===void 0?(r=i,n=e):(r=t.openAll+i,n=e+t.closeAll),{open:i,close:e,openAll:r,closeAll:n,parent:t}},Fs=(i,e,t)=>{let r=(...n)=>L1(r,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(r,j1),r[el]=i,r[wr]=e,r[un]=t,r},L1=(i,e)=>{if(i.level<=0||!e)return i[un]?"":e;let t=i[wr];if(t===void 0)return e;let{openAll:r,closeAll:n}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=Yh(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
|
|
37
|
+
`);return s!==-1&&(e=Jh(e,n,r,s)),r+e+n};Object.defineProperties(pn.prototype,_r);var q1=pn(),hO=pn({level:Zh?Zh.level:0});var $t=q1;var nl=L(require("net"),1),St=L(require("fs"),1),Di=L(require("path"),1),im=L(require("os"),1),rm=require("child_process"),nm=require("url"),zs=Di.default.dirname((0,nm.fileURLToPath)(__importMetaUrl)),Er=Di.default.join(im.default.homedir(),".9remote"),Us=process.platform==="win32"?"\\\\.\\pipe\\9remote-pty":Di.default.join(Er,"pty-daemon.sock"),em=Di.default.join(zs,"ptyDaemon.js"),tm=Di.default.join(zs,"ptyDaemon.cjs"),Vt=null,Sr=!1,yi=!1,rl="",F1=0,Cr=new Map,Hs=new Map;function U1(){return++F1}function Ws(i,e){Hs.has(i)||Hs.set(i,[]),Hs.get(i).push(e)}function dn(i,e){let t=Hs.get(i);if(t)for(let r of t)try{r(e)}catch(n){console.error(`[DaemonClient] Error in ${i} handler:`,n)}}function sl(i){if(!Vt||!Sr)return!1;try{return Vt.write(JSON.stringify(i)+`
|
|
38
|
+
`),!0}catch(e){return console.error("[DaemonClient] Send error:",e),!1}}function fn(i,e=5e3){return new Promise((t,r)=>{let n=U1();i.requestId=n;let s=setTimeout(()=>{Cr.delete(n),r(new Error("Request timeout"))},e);Cr.set(n,{resolve:t,reject:r,timer:s}),sl(i)||(clearTimeout(s),Cr.delete(n),r(new Error("Not connected to daemon")))})}function H1(i){let{type:e,requestId:t,...r}=i;if(t&&Cr.has(t)){let{resolve:n,timer:s}=Cr.get(t);clearTimeout(s),Cr.delete(t),n({type:e,...r});return}switch(e){case"output":dn("output",{sessionId:r.sessionId,data:Buffer.from(r.data,"base64")});break;case"sessionClosed":dn("sessionClosed",r.sessionId);break;case"sessionRenamed":dn("sessionRenamed",{sessionId:r.sessionId,name:r.name});break;case"pong":break;default:console.log("[DaemonClient] Unknown message:",e)}}function sm(){return new Promise(i=>{let e=nl.default.connect(Us),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"&&St.default.existsSync(Us))try{St.default.unlinkSync(Us)}catch{}i(!1)})})}function z1(){return St.default.existsSync(Er)||St.default.mkdirSync(Er,{recursive:!0}),St.default.existsSync(em)?{script:em,cwd:zs}:St.default.existsSync(tm)?{script:tm,cwd:zs}:(console.error("[DaemonClient] \u274C Daemon script not found"),null)}async function W1(){if(!St.default.existsSync(Er))try{St.default.mkdirSync(Er,{recursive:!0})}catch(o){return console.error("[DaemonClient] Failed to create socket directory:",o.message),!1}let i=z1();if(!i)return!1;let{script:e,cwd:t}=i,r=Di.default.join(Er,"daemon.log"),n;try{n=St.default.openSync(r,"w")}catch(o){console.error("[DaemonClient] Failed to open log file:",o.message),n="ignore"}if((0,rm.spawn)("node",[e],{detached:!0,stdio:["ignore",n,n],cwd:t}).unref(),typeof n=="number")try{St.default.closeSync(n)}catch{}for(let o=0;o<20;o++)if(await new Promise(c=>setTimeout(c,100)),await sm())return!0;console.error("[DaemonClient] \u274C Failed to start daemon");try{let o=St.default.readFileSync(r,"utf8");o.trim()&&(console.error("[DaemonClient] Daemon log:"),console.error(o))}catch{}return!1}async function om(){if(!(Sr||yi)){yi=!0;try{return!await sm()&&!await W1()?(console.error("[DaemonClient] \u274C Failed to start daemon"),yi=!1,!1):new Promise(i=>{let e=setTimeout(()=>{console.error("[DaemonClient] \u274C Connection timeout after 5s"),Vt&&Vt.destroy(),yi=!1,i(!1)},5e3);Vt=nl.default.connect(Us),Vt.on("connect",()=>{clearTimeout(e),Sr=!0,yi=!1,dn("connected"),i(!0)}),Vt.on("data",t=>{rl+=t.toString();let r=rl.split(`
|
|
39
|
+
`);rl=r.pop()||"";for(let n of r)if(n.trim())try{H1(JSON.parse(n))}catch{console.error("[DaemonClient] Invalid message:",n)}}),Vt.on("close",()=>{Sr=!1,Vt=null,dn("disconnected"),setTimeout(()=>{!Sr&&!yi&&om()},2e3)}),Vt.on("error",t=>{clearTimeout(e),console.error("[DaemonClient] \u274C Connection error:",t.message),console.error("[DaemonClient] Error code:",t.code),yi=!1,i(!1)})})}catch(i){return console.error("[DaemonClient] \u274C Connect error:",i),yi=!1,!1}}}async function am(){return om()}function Dt(){return Sr}async function cm(){return(await fn({type:"listSessions"})).sessions||[]}async function lm(i,e=80,t=24){let r=`session-${Date.now()}`;return await fn({type:"createSession",sessionId:r,name:i,cols:e,rows:t})}async function um(i){return await fn({type:"joinSession",sessionId:i})}function ol(i,e){return sl({type:"input",sessionId:i,data:e})}function pm(i,e,t){return sl({type:"resize",sessionId:i,cols:e,rows:t})}async function dm(i){return await fn({type:"deleteSession",sessionId:i})}async function fm(i,e){return await fn({type:"renameSession",sessionId:i,name:e})}var Tr=class{get type(){throw new Error("Not implemented: type")}emit(e,t){throw new Error("Not implemented: emit")}sendBinary(e){throw new Error("Not implemented: sendBinary")}isReady(){throw new Error("Not implemented: isReady")}};var $s=class extends Tr{constructor(e){super(),this._socket=e}get type(){return"ws"}isReady(){return this._socket.connected}emit(e,t){this._socket.emit(e,t)}sendBinary(e){}};var hm=L(require("node-datachannel"),1);var{PeerConnection:$1}=hm.default,V1=[{hostname:"stun.cloudflare.com",port:3478,type:"Stun"}];async function K1(i,e){try{let t=await fetch(i,{headers:{"X-API-Key":e}});if(!t.ok)throw new Error(`HTTP ${t.status}`);let{iceServers:r}=await t.json(),n=[];for(let s of r)for(let o of s.urls)if(o.startsWith("stun:")){let c=o.replace("stun:","").split(":")[0],u=parseInt(o.split(":")[2]||"3478");n.push({hostname:c,port:u,type:"Stun"})}else if(o.startsWith("turn:")||o.startsWith("turns:")){let c=o.startsWith("turns:"),d=o.replace(/^turns?:/,"").split("?")[0],f=d.split(":")[0],v=parseInt(d.split(":")[1]||(c?"5349":"3478")),_=o.includes("transport=tcp")?"Tcp":"Udp";n.push({hostname:f,port:v,type:c?"Tls":"Turn",relayType:_,username:s.username,password:s.credential})}return n}catch(t){return console.error("[WebRtcProtocol] TURN fetch failed:",t.message),null}}var Vs=class extends Tr{constructor({socketId:e,apiKey:t,turnApiUrl:r,turnRefreshInterval:n,dcMaxMessageSize:s,answerTimeout:o}){super(),this._socketId=e,this._apiKey=t,this._turnApiUrl=r,this._turnRefreshInterval=n,this._dcMaxMessageSize=s,this._answerTimeout=o,this._pc=null,this._dc=null,this._iceServers=V1,this._refreshTimer=null}get type(){return"dc"}isReady(){return!!this._dc}emit(e,t){}sendBinary(e){if(!this._dc)return!1;for(let t of e)try{t.length<=this._dcMaxMessageSize&&this._dc.sendMessageBinary(t)}catch(r){return console.error("[WebRtcProtocol] sendBinary error:",r.message),!1}return!0}async init(){this._apiKey&&this._turnApiUrl&&await this._refreshTurn()}setupSignaling(e){e.on("webrtc:offer",async({sdp:t})=>{try{this._createPeer();let r=await this._processOffer(t,e);e.emit("webrtc:answer",{sdp:r})}catch(r){console.error("[WebRtcProtocol] offer error:",r.message),e.emit("webrtc:error",{message:r.message})}}),e.on("webrtc:ice-candidate",({candidate:t,mid:r})=>{try{this._pc?.addRemoteCandidate(t,r||"0")}catch(n){console.error("[WebRtcProtocol] addRemoteCandidate error:",n.message)}})}close(){clearTimeout(this._refreshTimer);try{this._pc?.close()}catch{}this._pc=null,this._dc=null}_createPeer(){try{this._pc?.close()}catch{}this._pc=null,this._dc=null;let e=new $1(`peer-${this._socketId}`,{iceServers:this._iceServers});e.onDataChannel(t=>{t.onOpen(()=>{this._dc=t}),t.onClosed(()=>{this._dc=null}),t.onError(r=>console.error(`[WebRtcProtocol] DC error [${this._socketId.slice(0,6)}]:`,r))}),this._pc=e}_processOffer(e,t){return new Promise((r,n)=>{this._pc.onLocalDescription((s,o)=>{o==="answer"&&r(s)}),this._pc.onLocalCandidate((s,o)=>{s&&t.emit("webrtc:ice-candidate",{candidate:s,mid:o})});try{this._pc.setRemoteDescription(e,"offer"),this._pc.setLocalDescription()}catch(s){n(s)}setTimeout(()=>n(new Error("Answer timeout")),this._answerTimeout)})}async _refreshTurn(){let e=await K1(this._turnApiUrl,this._apiKey);e?.length&&(this._iceServers=e,console.log(`[WebRtcProtocol] TURN credentials loaded (${e.length} servers)`)),clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(()=>this._refreshTurn(),this._turnRefreshInterval)}};var Ks=class{constructor(e,t){this._ws=new $s(e),this._rtc=null,t.enableWebRTC&&(this._rtc=new Vs({socketId:e.id,apiKey:t.apiKey||null,turnApiUrl:t.turnApiUrl||null,turnRefreshInterval:t.turnRefreshInterval,dcMaxMessageSize:t.dcMaxMessageSize,answerTimeout:t.answerTimeout}),this._dcChunkSize=t.dcChunkSize,this._dcMaxTilesPerFrame=t.dcMaxTilesPerFrame)}get type(){return this._rtc?.isReady()?"dc":"ws"}async init(){await this._rtc?.init()}setupSignaling(e){this._rtc?.setupSignaling(e)}emit(e,t){this._ws.emit(e,t)}sendTiles(e,t){let{tiles:r}=e;if(this._rtc?.isReady()&&r?.length>0&&t){if(r.length>this._dcMaxTilesPerFrame){this._ws.emit("tiles-data",e);return}let n=e.timestamp??Date.now(),s=[];for(let o=0;o<r.length;o+=this._dcChunkSize)s.push(t(r.slice(o,o+this._dcChunkSize),n));this._rtc.sendBinary(s);return}this._ws.emit("tiles-data",e)}close(){this._rtc?.close()}};kr();var{enableWebRTC:X1,enableTurn:Mm,turnApiUrl:Z1,turnRefreshInterval:Q1,dcMaxMessageSize:eE,dcChunkSize:tE,dcMaxTilesPerFrame:iE,answerTimeout:rE}=$e.webrtc,si=null;function nE(){return process.env.CODESPACES==="true"||process.env.GITPOD_WORKSPACE_ID||process.platform==="linux"&&!process.env.DISPLAY}async function Bm(){if(si!==null)return si;if(nE())return si=!1,console.log("\u2705 Remote desktop not available (headless environment)"),si;try{let i=await import("@hurdlegroup/robotjs");(i.default||i).getScreenSize(),si=!0}catch{si=!1,console.log("\u2705 Remote desktop not available (no display or robotjs not installed)")}return si}function ml(){return si===!0}var ji=null,Nm=null,Im=null,Dm=null,jm=null,Lm=null,qm=null,ni=null,Om=null,Am=null,Rm=null,Pm=null;async function sE(){if(ji)return!0;try{let i=await import("@hurdlegroup/robotjs");ji=i.default||i;let{TileManager:e}=await Promise.resolve().then(()=>(gm(),vm)),{ResourceManager:t}=await Promise.resolve().then(()=>(ym(),xm)),{ScreenUpdateHelper:r}=await Promise.resolve().then(()=>(wm(),bm)),{MouseHandler:n}=await Promise.resolve().then(()=>(Sm(),_m)),{KeyboardHandler:s}=await Promise.resolve().then(()=>(Cm(),Em)),{ScreenHandler:o}=await Promise.resolve().then(()=>(km(),Tm));return Nm=e,Im=t,Dm=r,jm=n,Lm=s,qm=o,ji.setMouseDelay(2),ji.setKeyboardDelay(2),!0}catch(i){return console.error("\u274C Failed to load remote modules:",i.message),!1}}async function Fm(i,e){if(!si){i.emit("remote:unavailable");return}if(!await sE()){i.emit("remote:unavailable");return}ni||(ni=new Im,Om=new Dm(ni),Am=new jm(ji,ni),Rm=new Lm(ji,ni),Pm=new qm(ni,Om),ni.startResourceMonitoring());let r=i.handshake.auth?.apiKey,n=new Nm(ji);ni.addClient(i.id,{tileManager:n,screenInterval:null,authenticated:!0,apiKey:r});let s=new Ks(i,{enableWebRTC:X1,apiKey:Mm?e:null,turnApiUrl:Mm?Z1:null,turnRefreshInterval:Q1,dcMaxMessageSize:eE,dcChunkSize:tE,dcMaxTilesPerFrame:iE,answerTimeout:rE});await s.init(),s.setupSignaling(i);let o=c=>c;Am.setupMouseHandlers(i,o),Rm.setupKeyboardHandlers(i,o),Pm.setupScreenHandlers(i,o,s),i.on("disconnect",()=>{ni.removeClient(i.id),s.close()}),i.emit("remote:ready"),console.log("\u{1F5A5}\uFE0F Remote handlers attached:",i.id)}var bi=L(require("fs"),1),vl=L(require("path"),1),Xs=0,hn=null,oE=6e4,aE={name:"9Remote",postCreateCommand:"npm install -g 9remote@latest",postAttachCommand:"9remote start",forwardPorts:[2208],portsAttributes:{2208:{label:"9Remote Server",onAutoForward:"notify"}}};function oi(){return process.env.CODESPACES==="true"}function Um(){return oi()?{isCodespaces:!0,codespaceName:process.env.CODESPACE_NAME||"unknown",workspacePath:process.env.CODESPACE_VSCODE_FOLDER||process.cwd()}:null}function Hm(){Xs++,oi()&&Xs===1&&cE()}function zm(){Xs--,oi()&&Xs===0&&lE()}function cE(){hn||(hn=setInterval(()=>{process.memoryUsage()},oE))}function lE(){hn&&(console.log("\u23F8\uFE0F Stopping Codespaces heartbeat"),clearInterval(hn),hn=null)}function Wm(i){return vl.default.join(i,".devcontainer","devcontainer.json")}function $m(i){try{let e=Wm(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 Vm(i,e){try{let t=vl.default.join(i,".devcontainer"),r=Wm(i);bi.default.existsSync(t)||bi.default.mkdirSync(t,{recursive:!0});let n={...aE};if(bi.default.existsSync(r))try{n={...JSON.parse(bi.default.readFileSync(r,"utf8"))}}catch{}return e?(n.postAttachCommand="9remote start",n.postCreateCommand||(n.postCreateCommand="npm install -g 9remote@latest")):delete n.postAttachCommand,bi.default.writeFileSync(r,JSON.stringify(n,null,2)),{success:!0,enabled:e}}catch(t){return{success:!1,error:t.message}}}var Or=L(require("os"),1),Ye=L(require("fs"),1),Li=L(require("path"),1),Ar=Li.default.join(Or.default.homedir(),".9remote","buffers"),Zs=Li.default.join(Or.default.homedir(),".9remote","sessions.json"),Qs="/tmp/9remote-uploads";Ye.default.existsSync(Qs)||Ye.default.mkdirSync(Qs,{recursive:!0});function eo(){return process.platform==="win32"?process.env.COMSPEC||"powershell.exe":process.env.SHELL||"/bin/zsh"}function gl(i){return i?"/workspaces":Or.default.homedir()}function xl(){let i=Or.default.homedir(),e=Or.default.userInfo().username,t=eo(),r={...process.env};if(Object.assign(r,{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:r.TMPDIR||(process.platform==="win32"?r.TEMP||r.TMP:"/tmp"),__CF_USER_TEXT_ENCODING:r.__CF_USER_TEXT_ENCODING,XPC_FLAGS:r.XPC_FLAGS,XPC_SERVICE_NAME:r.XPC_SERVICE_NAME,SSH_AUTH_SOCK:r.SSH_AUTH_SOCK,TERM_PROGRAM:"9Remote",TERM_PROGRAM_VERSION:"1.0.0",ITERM_SESSION_ID:`9remote-${Date.now()}`,SHLVL:"1"}),t.includes("bash")){let n=r.PROMPT_COMMAND||"";r.PROMPT_COMMAND=`printf "\\e]7;file://%s\\a" "\${HOSTNAME}\${PWD}"${n?`; ${n}`:""}`}return r}function Km(){Ye.default.existsSync(Ar)||Ye.default.mkdirSync(Ar,{recursive:!0})}function yl(i,e,t){if(t==="buffer"){Km();try{Ye.default.writeFileSync(Li.default.join(Ar,`${i}.buf`),e.join(""),"utf8")}catch(r){console.log(`\u26A0\uFE0F Failed to save buffer for ${i}:`,r.message)}}}function Gm(i,e){if(e!=="buffer")return null;let t=Li.default.join(Ar,`${i}.buf`);try{if(Ye.default.existsSync(t))return Ye.default.readFileSync(t,"utf8")}catch(r){console.log(`\u26A0\uFE0F Failed to load buffer for ${i}:`,r.message)}return null}function bl(i){let e=Li.default.join(Ar,`${i}.buf`);try{Ye.default.existsSync(e)&&Ye.default.unlinkSync(e)}catch{}}function Ym(){Km();try{return Ye.default.readdirSync(Ar).filter(i=>i.endsWith(".buf")).map(i=>i.replace(".buf",""))}catch{return[]}}function Jm(){try{if(Ye.default.existsSync(Zs))return JSON.parse(Ye.default.readFileSync(Zs,"utf8"))}catch(i){console.log("\u26A0\uFE0F Failed to load session metadata:",i.message)}return{}}function wl(i){try{let e={};for(let[r,n]of i)e[r]={name:n.name,createdAt:n.createdAt};let t=Li.default.dirname(Zs);Ye.default.existsSync(t)||Ye.default.mkdirSync(t,{recursive:!0}),Ye.default.writeFileSync(Zs,JSON.stringify(e,null,2),"utf8")}catch(e){console.log("\u26A0\uFE0F Failed to save session metadata:",e.message)}}var _l=L(require("node-pty"),1);var uE=50*1024,qi="daemon";function Xm(i,e,t,r,n){let s=null;i.onData(o=>{t.buffer.push(o);let c=t.buffer.reduce((u,d)=>u+d.length,0);for(;c>uE&&t.buffer.length>1;)c-=t.buffer.shift().length;r.emit("output",{sessionId:e,data:Buffer.from(o,"utf-8")}),qi==="buffer"&&(s&&clearTimeout(s),s=setTimeout(()=>yl(e,t.buffer,qi),2e3))}),i.onExit(({exitCode:o})=>{console.log(`PTY exited: sessionId=${e}, code=${o}`),qi==="buffer"&&t.buffer.length>0&&yl(e,t.buffer,qi),n.delete(e),bl(e),r.emit("sessionClosed",e)})}function Zm(i,e,t){i.on("getSessions",r=>{let n=[];for(let[s,o]of t)n.push({id:s,name:o.name,createdAt:o.createdAt,restored:o.restored||!1});r(n)}),i.on("createSession",async({name:r},n)=>{let s=`session-${Date.now()}`,o=xl();o.NINE_REMOTE_SESSION_ID=s;let c=gl(oi());try{if(qi==="daemon"&&Dt()){let _=await lm(r,80,24);_.success?(t.set(_.sessionId,{daemon:!0,name:r||`Terminal ${t.size+1}`,createdAt:Date.now(),cwd:_.cwd}),n({success:!0,sessionId:_.sessionId})):n({success:!1,error:_.error});return}let u=eo(),d=process.platform==="win32"?[]:["-l"],f=_l.default.spawn(u,d,{name:"xterm-256color",cols:80,rows:24,cwd:c,env:o,useConpty:!1}),v={pty:f,name:r||`Terminal ${t.size+1}`,createdAt:Date.now(),buffer:[],cwd:c};Xm(f,s,v,e,t),t.set(s,v),n({success:!0,sessionId:s})}catch(u){console.error("Failed to create session:",u),n({success:!1,error:u.message})}}),i.on("joinSession",async(r,n)=>{let s=t.get(r);if(!s)return n({success:!1,error:"Session not found"});if(s.daemon&&Dt()){try{let o=await um(r);n({success:o.success,name:o.name,cwd:o.cwd,error:o.error})}catch(o){n({success:!1,error:o.message})}return}if(s.needsRestore&&qi==="buffer")try{let o=eo(),c=process.platform==="win32"?[]:["-l"],u=gl(oi()),d=_l.default.spawn(o,c,{name:"xterm-256color",cols:80,rows:24,cwd:u,env:xl(),useConpty:!1});s.pty=d,s.needsRestore=!1,s.cwd=u;let f=Gm(r,qi);f&&(s.buffer=[f]),Xm(d,r,s,e,t),console.log(`\u2705 Restored PTY session: ${r}`)}catch(o){return console.error("Failed to restore session:",o),n({success:!1,error:"Failed to restore session"})}s.buffer?.length>0&&i.emit("output",{sessionId:r,data:Buffer.from(s.buffer.join(""),"utf-8")}),n({success:!0,name:s.name,cwd:s.cwd})}),i.on("deleteSession",async(r,n)=>{let s=t.get(r);if(!s)return n({success:!1,error:"Session not found"});if(s.daemon&&Dt()){try{await dm(r),t.delete(r),n({success:!0})}catch(o){n({success:!1,error:o.message})}return}s.pty&&s.pty.kill(),t.delete(r),bl(r),e.emit("sessionClosed",r),wl(t),n({success:!0})}),i.on("renameSession",async({sessionId:r,name:n},s)=>{let o=t.get(r);if(!o)return s({success:!1,error:"Session not found"});if(o.daemon&&Dt()){try{await fm(r,n),o.name=n,s({success:!0})}catch(c){s({success:!1,error:c.message})}return}o.name=n,e.emit("session-renamed",{sessionId:r,name:n}),wl(t),s({success:!0})})}var Qm=L(require("fs"),1),ev=L(require("path"),1);function tv(i,e){i.on("input",({sessionId:t,data:r})=>{if(!t)return;let n=e.get(t);if(n){if(n.daemon&&Dt())return ol(t,r);n.pty&&n.pty.write(Buffer.isBuffer(r)?r.toString("utf-8"):r)}}),i.on("resize",({sessionId:t,cols:r,rows:n})=>{if(!t)return;let s=e.get(t);if(s){if(s.daemon&&Dt())return pm(t,r,n);if(s.pty)try{s.pty.resize(r,n)}catch(o){console.log(`Resize failed for ${t}: ${o.message}`)}}}),i.on("upload-file",({sessionId:t,filename:r,size:n,content:s})=>{if(!t)return;let o=e.get(t);if(o)try{let c=r.replace(/[^a-zA-Z0-9._-]/g,"_"),u=ev.default.join(Qs,`${Date.now()}_${c}`);Qm.default.writeFileSync(u,Buffer.from(s,"base64")),console.log(`\u{1F4CE} File uploaded: ${u} (${n} bytes)`),o.daemon&&Dt()?ol(t,u):o.pty&&o.pty.write(u)}catch(c){console.error("File upload error:",c),i.emit("output",{sessionId:t,data:Buffer.from(`\r
|
|
40
40
|
Error uploading file: ${c.message}\r
|
|
41
|
-
`,"utf-8")})}})}var ou=L(require("os"),1),qt=L(require("fs"),1),Sn=L(require("path"),1),To=L(xx(),1),ko=Sn.default.join(ou.default.homedir(),".9remote","vapid.json"),Mo=Sn.default.join(ou.default.homedir(),".9remote","push-subscriptions.json"),CA=1800*1e3,ot=[];function
|
|
41
|
+
`,"utf-8")})}})}var ou=L(require("os"),1),qt=L(require("fs"),1),Sn=L(require("path"),1),To=L(xx(),1),ko=Sn.default.join(ou.default.homedir(),".9remote","vapid.json"),Mo=Sn.default.join(ou.default.homedir(),".9remote","push-subscriptions.json"),CA=1800*1e3,ot=[];function hT(){try{if(qt.default.existsSync(ko))return JSON.parse(qt.default.readFileSync(ko,"utf8"))}catch{}return null}function mT(i){let e=Sn.default.dirname(ko);qt.default.existsSync(e)||qt.default.mkdirSync(e,{recursive:!0}),qt.default.writeFileSync(ko,JSON.stringify(i,null,2),"utf8")}function vT(){let i=hT();if(!i){let e=To.default.generateVAPIDKeys();i={publicKey:e.publicKey,privateKey:e.privateKey},mT(i)}return To.default.setVapidDetails("mailto:admin@9remote.cc",i.publicKey,i.privateKey),i}function gT(){try{qt.default.existsSync(Mo)&&(ot=JSON.parse(qt.default.readFileSync(Mo,"utf8")))}catch{ot=[]}}function En(){try{let i=Sn.default.dirname(Mo);qt.default.existsSync(i)||qt.default.mkdirSync(i,{recursive:!0}),qt.default.writeFileSync(Mo,JSON.stringify(ot,null,2),"utf8")}catch(i){console.error("Failed to save push subscriptions:",i.message)}}function yx(i,e){ot=ot.filter(t=>t.endpoint!==i.endpoint),ot.push({...i,socketId:e,lastConnectedAt:Date.now()}),En()}function bx(i){ot=ot.filter(e=>e.endpoint!==i),En()}function wx(i){for(let e of ot)e.socketId===i&&(e.disconnectedAt=Date.now());En()}function _x(i,e){for(let t of ot)t.endpoint===e&&(t.socketId=i,t.disconnectedAt=null,t.lastConnectedAt=Date.now());En()}async function Sx(i){let t={claude:"Claude",codex:"Codex",gemini:"Gemini"}[i.tool]||"AI";console.log(`\u{1F514} Sending push notification: ${i.type} ${t}`);let r=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}}),n=[],s=ot.reduce((c,u)=>(c?.lastConnectedAt??0)>=(u?.lastConnectedAt??0)?c:u,null),o=s?[s]:[];console.log(`\u{1F4E4} sendPush: total=${ot.length} target=${o.length>0?s.endpoint.slice(0,50)+"...":"none"}`);for(let c of o)try{await To.default.sendNotification({endpoint:c.endpoint,keys:c.keys},r),console.log(` \u2705 Push sent to ${c.endpoint.slice(0,50)}...`)}catch(u){console.log(` \u274C Push failed: ${u.statusCode} ${u.message}`),(u.statusCode===410||u.statusCode===404)&&n.push(c.endpoint)}n.length>0&&(ot=ot.filter(c=>!n.includes(c.endpoint)),En())}var xT=vT();gT();function Ex(){return xT.publicKey}var Oo=L(require("os"),1),Ve=L(require("fs"),1),$r=L(require("path"),1);function Ao(){return $r.default.join(Oo.default.homedir(),".claude","settings.json")}function Ro(){return $r.default.join(Oo.default.homedir(),".codex","config.toml")}function Po(){return $r.default.join(Oo.default.homedir(),".gemini","settings.json")}function Wr(i){try{if(Ve.default.existsSync(i))return JSON.parse(Ve.default.readFileSync(i,"utf8"))}catch{}return{}}function Bo(i,e){let t=$r.default.dirname(i);Ve.default.existsSync(t)||Ve.default.mkdirSync(t,{recursive:!0}),Ve.default.writeFileSync(i,JSON.stringify(e,null,2),"utf8")}function yT(){let i=Ao(),e=Wr(i),t='command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "http://localhost:2208/api/notify?type=stop&sessionId=$NINE_REMOTE_SESSION_ID&tool=claude" > /dev/null 2>&1 & true',r='command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "http://localhost:2208/api/notify?type=notification&sessionId=$NINE_REMOTE_SESSION_ID&tool=claude" > /dev/null 2>&1 & true';return e.hooks={...e.hooks,Stop:[{matcher:"",hooks:[{type:"command",command:t}]}],Notification:[{matcher:"permission_prompt|idle_prompt",hooks:[{type:"command",command:r}]}]},Bo(i,e),{success:!0}}function bT(){let i=Ao(),e=Wr(i);return e.hooks&&(delete e.hooks.Stop,delete e.hooks.Notification,Object.keys(e.hooks).length===0&&delete e.hooks),Bo(i,e),{success:!0}}function wT(){let i=Ro(),e=$r.default.dirname(i);Ve.default.existsSync(e)||Ve.default.mkdirSync(e,{recursive:!0});let t='command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "http://localhost:2208/api/notify?type=stop&sessionId=$NINE_REMOTE_SESSION_ID&tool=codex" > /dev/null 2>&1 & true',r="";return Ve.default.existsSync(i)&&(r=Ve.default.readFileSync(i,"utf8"),r=r.replace(/\n?# 9Remote notification\nnotify\s*=.*\n?/g,"")),r+=`
|
|
42
42
|
# 9Remote notification
|
|
43
43
|
notify = ["bash", "-c", "${t}"]
|
|
44
|
-
`,Ve.default.writeFileSync(i,r,"utf8"),{success:!0}}function
|
|
44
|
+
`,Ve.default.writeFileSync(i,r,"utf8"),{success:!0}}function _T(){let i=Ro();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 ST(){let i=Po(),e=Wr(i),t='command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "http://localhost:2208/api/notify?type=stop&sessionId=$NINE_REMOTE_SESSION_ID&tool=gemini" > /dev/null 2>&1 & true',r='command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "http://localhost:2208/api/notify?type=notification&sessionId=$NINE_REMOTE_SESSION_ID&tool=gemini" > /dev/null 2>&1 & true';return e.hooks={...e.hooks,enabled:!0,AfterAgent:[{matcher:"",hooks:[{type:"command",command:t}]}],Notification:[{matcher:"",hooks:[{type:"command",command:r}]}]},e.tools||(e.tools={}),e.tools.enableHooks=!0,Bo(i,e),{success:!0}}function ET(){let i=Po(),e=Wr(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),Bo(i,e),{success:!0}}function CT(i){switch(i){case"claude":{let e=Wr(Ao());return!!(e.hooks?.Stop||e.hooks?.Notification)}case"codex":{let e=Ro();return Ve.default.existsSync(e)?Ve.default.readFileSync(e,"utf8").includes("# 9Remote notification"):!1}case"gemini":{let e=Wr(Po());return!!(e.hooks?.AfterAgent||e.hooks?.Notification)}default:return!1}}function TT(i){let e={claude:Ao().replace("/settings.json",""),codex:Ro().replace("/config.toml",""),gemini:Po().replace("/settings.json","")};return Ve.default.existsSync(e[i])}function Cx(i){switch(i){case"claude":return yT();case"codex":return wT();case"gemini":return ST();default:return{success:!1,error:"Unknown tool"}}}function Tx(i){switch(i){case"claude":return bT();case"codex":return _T();case"gemini":return ET();default:return{success:!1,error:"Unknown tool"}}}function kx(){let i=["claude","codex","gemini"],e={};for(let t of i)e[t]={installed:TT(t),enabled:CT(t)};return e}var au={};function Mx(i,e){au[i]=e}function Ox(i){delete au[i]}function Ax(){return{...au}}function Rx(i){i.on("getNotificationState",()=>{i.emit("notificationState",Ax())}),i.on("clearNotification",e=>{e&&(Ox(e),i.broadcast.emit("notificationCleared",e))}),i.on("getVapidKey",e=>e(Ex())),i.on("pushSubscribe",e=>{e?.endpoint&&(_x(i.id,e.endpoint),yx(e,i.id))}),i.on("pushUnsubscribe",e=>{e&&bx(e)}),i.on("enableHook",async({tool:e},t)=>{try{t(await Cx(e))}catch(r){t({success:!1,error:r.message})}}),i.on("disableHook",async({tool:e},t)=>{try{t(await Tx(e))}catch(r){t({success:!1,error:r.message})}}),i.on("getHookStatus",e=>e(kx())),i.on("getAutoStartStatus",e=>{if(!oi())return e({success:!1,error:"Not in Codespaces"});let t=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();e({success:!0,...$m(t)})}),i.on("setAutoStart",({enabled:e},t)=>{if(!oi())return t({success:!1,error:"Not in Codespaces"});let r=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();t(Vm(r,e))})}var kT=$t.rgb(230,138,110),cu="daemon",zi=new Map;async function Px(){if(cu==="daemon")if(!await am())console.error("\u274C Failed to connect to PTY daemon, falling back to buffer mode");else{let r=await cm();for(let s of r)zi.set(s.id,{daemon:!0,name:s.name,createdAt:s.createdAt});let n=r.length;console.log(kT(n>0?`\u2705 Connected to daemon with ${n} session(s)`:"\u2705 Connected to PTY daemon"));return}console.log("\u{1F4E6} Buffer persistence mode - scrollback enabled");let i=Ym(),e=Jm();for(let t of i){let r=e[t]||{};zi.set(t,{pty:null,name:r.name||`Terminal ${zi.size+1}`,createdAt:r.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 Bx(i,e){cu==="daemon"&&(Ws("output",({sessionId:t,data:r})=>i.emit("output",{sessionId:t,data:r})),Ws("sessionClosed",t=>{zi.delete(t),i.emit("sessionClosed",t)}),Ws("sessionRenamed",({sessionId:t,name:r})=>{let n=zi.get(t);n&&(n.name=r),i.emit("session-renamed",{sessionId:t,name:r})})),i.on("connection",t=>{let r=t.handshake.auth?.connectionMode||"tunnel";console.log(`\u{1F4DF} Terminal client connected: ${t.id} [${r}]`),Hm(),t.emit("serverInfo",{remoteAvailable:ml(),daemonMode:cu==="daemon"&&Dt(),platform:process.platform,...Um()}),Zm(t,i,zi),tv(t,zi),Rx(t),ml()&&Fm(t,e).catch(n=>{console.error("\u274C Failed to setup remote handlers:",n.message)}),t.on("disconnect",()=>{console.log(`\u{1F4DF} Terminal client disconnected: ${t.id}`),wx(t.id),zm()})})}var ee=L(require("fs"),1),Cn=L(require("path"),1),Vr=L(require("os"),1),Ix=require("child_process");var Nx=["node_modules",".git"],No=[".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 Dx(i){return Nx.includes(i)}function lu(i){return No.includes(Cn.default.extname(i).toLowerCase())}function MT(i,e){return i.isDirectory()?"folder":lu(e)?"binary":"file"}function Io(i){return i<1024?`${i}B`:i<1024*1024?`${(i/1024).toFixed(1)}KB`:`${(i/(1024*1024)).toFixed(1)}MB`}function jx(i,e,t,r=50){if(!(t.length>=r))try{for(let n of ee.default.readdirSync(i)){if(t.length>=r)return;if(n.startsWith(".")||Dx(n))continue;let s=Cn.default.join(i,n);try{let o=ee.default.statSync(s);o.isDirectory()?jx(s,e,t,r):n.toLowerCase().includes(e.toLowerCase())&&t.push({name:n,path:s,type:lu(n)?"binary":"file",size:o.size,sizeFormatted:Io(o.size)})}catch{}}}catch{}}function OT(){if(process.platform!=="win32")return[];try{return(0,Ix.execSync)("wmic logicaldisk get name",{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).split(/\r?\n/).map(e=>e.trim()).filter(e=>/^[A-Z]:$/.test(e)).map(e=>({letter:e[0],path:e+"\\"}))}catch{return"CDEFGHIJ".split("").map(i=>`${i}:\\`).filter(i=>ee.default.existsSync(i)).map(i=>({letter:i[0],path:i}))}}function Lx(i){i.on("getSystemInfo",e=>{let t=process.platform;e({success:!0,platform:t,isWindows:t==="win32",drives:t==="win32"?OT():[],homedir:Vr.default.homedir()})}),i.on("getFiles",({dirPath:e},t)=>{try{let r=e||Vr.default.homedir(),n=r.startsWith("~")?r.replace("~",Vr.default.homedir()):r;if(!ee.default.existsSync(n))return t({success:!1,error:"Directory not found"});let s=[];for(let o of ee.default.readdirSync(n))if(!(o.startsWith(".")&&o!==".env"&&o!==".env.example")&&!Dx(o))try{let c=Cn.default.join(n,o),u=ee.default.statSync(c);s.push({name:o,path:c,type:MT(u,o),size:u.isFile()?u.size:null,sizeFormatted:u.isFile()?Io(u.size):null,modified:u.mtime.getTime()})}catch{}s.sort((o,c)=>o.type==="folder"&&c.type!=="folder"?-1:o.type!=="folder"&&c.type==="folder"?1:o.name.localeCompare(c.name)),t({success:!0,files:s,currentPath:n,parentPath:Cn.default.dirname(n)})}catch(r){t({success:!1,error:r.message})}}),i.on("searchFiles",({workspace:e,query:t},r)=>{try{if(!t||t.length<2)return r({success:!0,files:[]});let n=(e||Vr.default.homedir()).replace(/^~/,Vr.default.homedir());if(!ee.default.existsSync(n))return r({success:!1,error:"Workspace not found"});let s=[];jx(n,t,s,50),s.sort((o,c)=>{let u=o.name.toLowerCase()===t.toLowerCase(),d=c.name.toLowerCase()===t.toLowerCase();return u&&!d?-1:!u&&d?1:o.path.length-c.path.length}),r({success:!0,files:s})}catch(n){r({success:!1,error:n.message})}}),i.on("readFile",({filePath:e},t)=>{try{if(!ee.default.existsSync(e))return t({success:!1,error:"File not found"});let r=ee.default.statSync(e);if(r.size>512e3)return t({success:!1,error:`File too large (${Io(r.size)}). Max ${Io(512e3)}`});if(lu(e))return t({success:!1,error:"Cannot open binary file"});t({success:!0,content:ee.default.readFileSync(e,"utf-8")})}catch(r){t({success:!1,error:r.message})}}),i.on("writeFile",({filePath:e,content:t},r)=>{try{ee.default.writeFileSync(e,t,"utf-8"),r({success:!0})}catch(n){r({success:!1,error:n.message})}}),i.on("createItem",({itemPath:e,type:t},r)=>{try{if(ee.default.existsSync(e))return r({success:!1,error:"Item already exists"});t==="folder"?ee.default.mkdirSync(e,{recursive:!0}):ee.default.writeFileSync(e,"","utf-8"),r({success:!0})}catch(n){r({success:!1,error:n.message})}}),i.on("deleteItem",({itemPath:e},t)=>{try{if(!ee.default.existsSync(e))return t({success:!1,error:"Item not found"});ee.default.statSync(e).isDirectory()?ee.default.rmSync(e,{recursive:!0}):ee.default.unlinkSync(e),t({success:!0})}catch(r){t({success:!1,error:r.message})}}),i.on("renameItem",({oldPath:e,newPath:t},r)=>{try{if(!ee.default.existsSync(e))return r({success:!1,error:"Item not found"});if(ee.default.existsSync(t))return r({success:!1,error:"Target already exists"});ee.default.renameSync(e,t),r({success:!0})}catch(n){r({success:!1,error:n.message})}})}var at=L(require("fs"),1),Wi=L(require("path"),1),ci=require("child_process");function qx(i){return No.includes(Wi.default.extname(i).toLowerCase())}function Fx(i){i.on("gitStatus",({repoPath:e},t)=>{try{let r=(0,ci.execSync)("git status --porcelain",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),n={};try{(0,ci.execSync)("git diff HEAD --numstat",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim().split(`
|
|
45
45
|
`).filter(Boolean).forEach(c=>{let u=c.split(" ");u.length>=3&&(n[u[2]]={added:u[0]==="-"?0:parseInt(u[0],10)||0,deleted:u[1]==="-"?0:parseInt(u[1],10)||0})})}catch{}let s=[];for(let o of r.trim().split(`
|
|
46
46
|
`).filter(Boolean)){let c=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!c)continue;let u=c[1],d=c[2];if(!d)continue;let f;u.includes("?")?f="?":u.includes("A")?f="A":u.includes("D")?f="D":u.includes("M")?f="M":u.includes("R")?f="R":f=u.trim()[0]||"?";let v=n[d]||{added:0,deleted:0};if(f==="?")try{let _=Wi.default.join(e,d);if(at.default.existsSync(_)&&!qx(d)){let E=at.default.readFileSync(_,"utf-8");v.added=E.split(`
|
|
47
47
|
`).length,v.deleted=0}}catch{}s.push({status:f,path:d,added:v.added,deleted:v.deleted})}t({success:!0,files:s})}catch{t({success:!1,error:"Not a git repository or git not available"})}}),i.on("gitFileStatus",({repoPath:e,filePath:t},r)=>{try{let n=Wi.default.relative(e,t),o=(0,ci.execSync)(`git status --porcelain -- "${n}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();if(!o)return r({success:!0,status:null});let c=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!c)return r({success:!0,status:null});let u=c[1],d;u.includes("?")?d="?":u.includes("A")?d="A":u.includes("D")?d="D":u.includes("M")?d="M":u.includes("R")?d="R":d=u.trim()[0]||"?",r({success:!0,status:d,file:n})}catch{r({success:!0,status:null})}}),i.on("gitDiff",({repoPath:e,file:t,status:r},n)=>{try{let s="";if(t&&r==="?"){let o=Wi.default.join(e,t);if(at.default.existsSync(o)){let u=at.default.readFileSync(o,"utf-8").split(`
|
|
@@ -60,8 +60,8 @@ new file mode 100644
|
|
|
60
60
|
+++ b/${u}
|
|
61
61
|
@@ -0,0 +1,${_.length} @@
|
|
62
62
|
${_.map(E=>`+${E}`).join(`
|
|
63
|
-
`)}`}}catch{}}}n({success:!0,diff:s})}catch(s){n({success:!1,error:s.message})}}),i.on("gitDiscard",({repoPath:e,file:t,status:r},n)=>{try{if(!t)return n({success:!1,error:"No file specified"});let s=Wi.default.join(e,t);r==="?"?at.default.existsSync(s)&&(at.default.statSync(s).isDirectory()?at.default.rmSync(s,{recursive:!0}):at.default.unlinkSync(s)):r==="A"?((0,ci.execSync)(`git reset HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),at.default.existsSync(s)&&at.default.unlinkSync(s)):(0,ci.execSync)(`git checkout HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),n({success:!0})}catch(s){n({success:!1,error:s.message})}})}function Ux(i){i.on("connection",e=>{Lx(e),Fx(e)})}function
|
|
64
|
-
`);for(let s of n){let o=s.match(/[:\*\]](\d{2,5})(?:\s|$)/g);if(o)for(let c of o){let u=parseInt(c.replace(/[:\*\]\s]/g,""),10);u>0&&u<=65535&&(u===80||u===443||u>=1024)&&e.add(u)}}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 PT(i,e=2e3){return new Promise(t=>{let r=
|
|
63
|
+
`)}`}}catch{}}}n({success:!0,diff:s})}catch(s){n({success:!1,error:s.message})}}),i.on("gitDiscard",({repoPath:e,file:t,status:r},n)=>{try{if(!t)return n({success:!1,error:"No file specified"});let s=Wi.default.join(e,t);r==="?"?at.default.existsSync(s)&&(at.default.statSync(s).isDirectory()?at.default.rmSync(s,{recursive:!0}):at.default.unlinkSync(s)):r==="A"?((0,ci.execSync)(`git reset HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),at.default.existsSync(s)&&at.default.unlinkSync(s)):(0,ci.execSync)(`git checkout HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),n({success:!0})}catch(s){n({success:!1,error:s.message})}})}function Ux(i){i.on("connection",e=>{Lx(e),Fx(e)})}function Hx(){try{let i=(0,Wx.join)((0,$x.homedir)(),".9remote","keys.json");return JSON.parse((0,zx.readFileSync)(i,"utf8")).key||null}catch{return null}}var Vx=null;function jo(){return Vx}async function Kx(i){let e=new Hh(i,{cors:{origin:"*",methods:["GET","POST"],credentials:!0,allowedHeaders:["*"]},transports:["websocket","polling"],allowEIO3:!0,allowUpgrades:!0,pingTimeout:6e4,pingInterval:25e3});return e.use((t,r)=>{let n=Hx();if(!n||t.handshake.auth?.apiKey===n)return r();r(new Error("unauthorized"))}),await Bm(),Bx(e,Hx()),Ux(e),Vx=e,e}var Gx=L(require("http"),1),Yx=L(require("https"),1),Jx=require("child_process"),Xx=require("util"),AT=(0,Xx.promisify)(Jx.exec);async function RT(){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:r}=await AT(t),n=r.split(`
|
|
64
|
+
`);for(let s of n){let o=s.match(/[:\*\]](\d{2,5})(?:\s|$)/g);if(o)for(let c of o){let u=parseInt(c.replace(/[:\*\]\s]/g,""),10);u>0&&u<=65535&&(u===80||u===443||u>=1024)&&e.add(u)}}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 PT(i,e=2e3){return new Promise(t=>{let r=Gx.default.request({host:"localhost",port:i,method:"GET",path:"/",timeout:e},n=>{n.on("data",()=>{}),n.on("end",()=>{}),t({active:!0,protocol:"http",status:n.statusCode})});r.on("error",n=>{t({active:!1,error:n.message})}),r.on("timeout",()=>{r.destroy(),t({active:!1,error:"timeout"})}),r.end()})}function BT(i,e=2e3){return new Promise(t=>{let r=Yx.default.request({host:"localhost",port:i,method:"GET",path:"/",timeout:e,rejectUnauthorized:!1},n=>{n.on("data",()=>{}),n.on("end",()=>{}),t({active:!0,protocol:"https",status:n.statusCode})});r.on("error",n=>{t({active:!1,error:n.message})}),r.on("timeout",()=>{r.destroy(),t({active:!1,error:"timeout"})}),r.end()})}async function NT(i){let[e,t]=await Promise.all([PT(i),BT(i)]);return t.active?{port:i,...t}:e.active?{port:i,...e}:{port:i,active:!1}}async function Zx(){let i=await RT();return(await Promise.all(i.map(t=>NT(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,r)=>t.port-r.port)}var Qx=L(require("crypto"),1),IT=process.env.API_KEY_SECRET||"9remote-api-key-secret";function DT(i,e){return Qx.default.createHmac("sha256",IT).update(i+e).digest("hex").slice(0,8)}function jT(i){if(!i||!i.startsWith("sk-"))return null;let e=i.split("-");if(e.length===4){let[,t,r,n]=e,s=DT(t,r);return n!==s?null:{machineId:t,keyId:r}}return null}function e0(i){return jT(i)!==null}async function t0(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 r=t.slice(7);if(!e0(r)){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Invalid API key"}));return}let n=await Zx();e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify(n))}function i0(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 r0(i,e){return i.method==="OPTIONS"?(e.writeHead(200),e.end(),!0):!1}var Gr=require("zlib"),q0=L(I0(),1);var pk=["data:","javascript:","#","mailto:","blob:"],dk=["href","src","action","srcset","poster","data","formaction","data-src","data-href","data-url","data-background"];function Uo(i,e){return!i||pk.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 D0(i,e){let t=`/proxy/${e}`,r=new RegExp(`(${dk.join("|")})=(["'])([^"']*?)\\2`,"gi");return i=i.replace(r,(n,s,o,c)=>{if(s.toLowerCase()==="srcset"){let u=c.split(",").map(d=>{let[f,...v]=d.trim().split(/\s+/),_=Uo(f,e);return v.length?`${_} ${v.join(" ")}`:_}).join(", ");return`${s}=${o}${u}${o}`}return`${s}=${o}${Uo(c,e)}${o}`}),i=i.replace(/url\(\s*(["']?)(\/_next\/[^)"']+)\1\s*\)/gi,(n,s,o)=>`url(${s}${t}${o}${s})`),i=i.replace(/"(\/_next\/[^"]+)"/g,(n,s)=>`"${t}${s}"`),i}function j0(i){let e=`/proxy/${i}`;return`
|
|
65
65
|
// Service Worker for 9Remote Proxy - Port ${i}
|
|
66
66
|
const PROXY_BASE = '${e}';
|
|
67
67
|
const TARGET_PORT = ${i};
|
|
@@ -116,7 +116,7 @@ self.addEventListener('fetch', (event) => {
|
|
|
116
116
|
|
|
117
117
|
event.respondWith(fetch(new Request(newUrl, requestInit)));
|
|
118
118
|
});
|
|
119
|
-
`}function
|
|
119
|
+
`}function L0(i){return`
|
|
120
120
|
<script data-proxy-injected="true">
|
|
121
121
|
(function() {
|
|
122
122
|
if (window.__proxySwRegistered) return;
|
|
@@ -158,7 +158,7 @@ self.addEventListener('fetch', (event) => {
|
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
})();
|
|
161
|
-
</script>`}var Tu=new Set;function
|
|
161
|
+
</script>`}var Tu=new Set;function F0(i){Tu.add(String(i))}function U0(i){Tu.delete(String(i))}function fk(i){return Tu.has(String(i))}function hk(i){switch(i){case"gzip":return(0,Gr.createGunzip)();case"deflate":return(0,Gr.createInflate)();case"br":return(0,Gr.createBrotliDecompress)();default:return null}}function mk(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 H0(){let i=q0.default.createProxyServer({selfHandleResponse:!0});return i.on("proxyRes",(e,t,r)=>{let n=t._proxyTargetPort,s=e.headers["content-type"]||"",o=e.headers["content-encoding"]||"",c=s.includes("text/html"),u={...e.headers};if(u.location&&(u.location=Uo(u.location,n)),s.includes("application/json")||s.includes("text/x-component")){r.writeHead(e.statusCode,u),e.pipe(r);return}if(s.includes("javascript")||s.includes("text/javascript")){r.writeHead(e.statusCode,u),e.pipe(r);return}if(!c){r.writeHead(e.statusCode,u),e.pipe(r);return}delete u["content-length"],delete u["content-encoding"];let v=hk(o),_=v?e.pipe(v):e,E=[];_.on("data",C=>E.push(C)),_.on("error",C=>{console.error("[Proxy] Decompress error:",C.message),r.writeHead(502),r.end("Bad Gateway: Decompression failed")}),_.on("end",()=>{let C=Buffer.concat(E).toString("utf8");C=D0(C,n);let k=L0(n);C=mk(C,k),r.writeHead(e.statusCode,u),r.end(C)})}),i}function z0(i,e,t,r,n,s){if(n==="/sw.js"){let o=j0(r);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(!fk(r)){t.writeHead(401,{"Content-Type":"text/html"}),t.end(`
|
|
162
162
|
<!DOCTYPE html>
|
|
163
163
|
<html>
|
|
164
164
|
<head><title>Unauthorized</title></head>
|
|
@@ -169,12 +169,12 @@ self.addEventListener('fetch', (event) => {
|
|
|
169
169
|
</div>
|
|
170
170
|
</body>
|
|
171
171
|
</html>
|
|
172
|
-
`);return}e._proxyTargetPort=r,e.url=n+(s||""),i.web(e,t,{target:`http://localhost:${r}`,changeOrigin:!0},o=>{t.writeHead(502),t.end(`Bad Gateway: ${o.message}`)})}var Bn=(0,
|
|
172
|
+
`);return}e._proxyTargetPort=r,e.url=n+(s||""),i.web(e,t,{target:`http://localhost:${r}`,changeOrigin:!0},o=>{t.writeHead(502),t.end(`Bad Gateway: ${o.message}`)})}var Bn=(0,J0.fileURLToPath)(new URL(".",__importMetaUrl)),vk=process.env.NODE_ENV==="development",gk=5173,ku=(0,Gi.existsSync)((0,Ft.join)(Bn,"ui","dist"))?(0,Ft.join)(Bn,"ui","dist"):(0,Ft.join)(Bn,"ui"),xk={".html":"text/html",".js":"application/javascript",".css":"text/css",".svg":"image/svg+xml",".png":"image/png",".ico":"image/x-icon",".woff2":"font/woff2",".woff":"font/woff"},yk="9remote",bk=`https://registry.npmjs.org/${yk}/latest`;function wk(i,e){let t=(0,zo.request)({hostname:"localhost",port:gk,path:i.url,method:i.method,headers:i.headers},r=>{e.writeHead(r.statusCode,r.headers),r.pipe(e)});t.on("error",()=>{e.writeHead(502),e.end("Vite dev server not ready yet, please wait...")}),i.pipe(t)}function W0(i,e){if(!(0,Gi.existsSync)(e))return!1;let t=(0,Ft.extname)(e),r=xk[t]||"application/octet-stream";return i.setHeader("Content-Type",r),i.writeHead(200),i.end((0,Gi.readFileSync)(e)),!0}async function _k(i){try{let e=await fetch(bk);if(!e.ok)return;let{version:t}=await e.json();t&&t!==i&&X0("updateAvailable",{version:t})}catch{}}var Nn={step:0,tunnelUrl:"",oneTimeKey:"",qrUrl:"",latency:null,uptime:null},Ho=new Set;function X0(i,e){let t=`data: ${JSON.stringify({type:i,...e})}
|
|
173
173
|
|
|
174
174
|
`;for(let r of Ho)try{r.write(t)}catch{Ho.delete(r)}}function Sk(i,e){e.setHeader("Content-Type","text/event-stream"),e.setHeader("Cache-Control","no-cache"),e.setHeader("Connection","keep-alive"),e.writeHead(200),e.write(`data: ${JSON.stringify({type:"state",...Nn})}
|
|
175
175
|
|
|
176
|
-
`),Ho.add(e),i.on("close",()=>Ho.delete(e))}function Ek(i){try{let e=JSON.parse(i||"{}");Nn={...Nn,...e},
|
|
177
|
-
\u{1F6D1} Received ${n}, shutting down gracefully...`));let s=setTimeout(()=>{console.log($t.red("\u26A0\uFE0F Forced exit after 5s timeout")),process.exit(1)},5e3);try{e.close(()=>{console.log($t.gray("\u2713 HTTP server closed"))});let o=jo();o&&(o.emit("server:shutdown"),o.close(()=>{console.log($t.gray("\u2713 Socket.IO closed"))})),await new Promise(c=>setTimeout(c,500)),clearTimeout(s),console.log($t.green("\u2705 Server stopped cleanly")),process.exit(0)}catch(o){console.error($t.red("\u274C Error during shutdown:"),o),clearTimeout(s),process.exit(1)}};return process.on("SIGINT",()=>r("SIGINT")),process.on("SIGTERM",()=>r("SIGTERM")),process.platform==="win32"&&process.on("SIGBREAK",()=>r("SIGBREAK")),e}
|
|
176
|
+
`),Ho.add(e),i.on("close",()=>Ho.delete(e))}function Ek(i){try{let e=JSON.parse(i||"{}");Nn={...Nn,...e},X0("state",Nn)}catch{}}var Ck=$t.rgb(230,138,110);function Tk(){return process.env.CODESPACES==="true"}async function kk(i,e){if(i.method!=="POST"){e.writeHead(405),e.end(JSON.stringify({error:"Method not allowed"}));return}if(!Tk()){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 r=jo();r&&r.emit("codespace:stopping"),e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify({success:!0,message:"Stopping codespace..."})),setTimeout(()=>{(0,Y0.exec)(`gh codespace stop -c ${t}`,n=>{n&&console.error("Failed to stop codespace:",n)})},500)}var Mk="localhost",$0=parseInt(process.env.PORT||"2208",10),V0={},Ok=1e4;function K0(i,e,t,r){let n=Date.now(),s,o,c;if(r)s=r.type||"stop",o=r.sessionId||"",c=r.tool||"claude";else try{let d=JSON.parse(t||"{}");s=d.type||"stop",o=d.sessionId||"",c=d.tool||"claude"}catch{e.writeHead(400),e.end(JSON.stringify({error:"Invalid JSON"}));return}let u=jo();if(u){let d={type:s,sessionId:o,tool:c,timestamp:n};if(o&&o){Mx(o,d),u.emit("chatNotification",d);let f=`${c}:${s}`;n-(V0[f]||0)<Ok||(V0[f]=n,u.timeout(5e3).emit("chatNotificationAck",d,(_,E)=>{let C=u.sockets.sockets.size;!(!_&&E&&E.length>0)&&C===0&&Sx(d)}))}}e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify({success:!0}))}async function Z0(){await Px();let i=H0(),e=(0,zo.createServer)(async(n,s)=>{if(i0(s),!r0(n,s))try{let o=(0,G0.parse)(n.url,!0),{pathname:c,search:u}=o,d=n.socket.remoteAddress==="127.0.0.1"||n.socket.remoteAddress==="::1";if((c==="/api/ui/events"||c==="/api/ui/state"||!c.startsWith("/api/")&&!c.startsWith("/proxy/")&&!c.startsWith("/socket.io"))&&!d){s.writeHead(403),s.end(JSON.stringify({error:"forbidden"}));return}if(c==="/api/ui/events"){Sk(n,s);return}if(c==="/api/ui/state"&&n.method==="POST"){let v="";n.on("data",_=>v+=_),n.on("end",()=>{Ek(v),s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({ok:!0}))});return}if(c==="/api/ui/state"&&n.method==="GET"){s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify(Nn));return}if(c==="/api/health"){s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({status:"ok",timestamp:Date.now()}));return}if(c==="/api/version"){let v=JSON.parse((0,Gi.readFileSync)((0,Ft.join)(Bn,"..","package.json"),"utf8"));s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({version:v.version}));return}if(!c.startsWith("/api/")&&!c.startsWith("/proxy/")&&!c.startsWith("/socket.io")){if(vk){wk(n,s);return}let v=c==="/"||c===""?(0,Ft.join)(ku,"index.html"):(0,Ft.join)(ku,c);if(W0(s,v)||W0(s,(0,Ft.join)(ku,"index.html")))return}if(c==="/api/local-sites"){await t0(n,s);return}if(c==="/api/codespace/stop"){await kk(n,s);return}if(c==="/api/notify"&&n.method==="POST"){let v="";n.on("data",_=>v+=_),n.on("end",()=>{K0(n,s,v)});return}if(c==="/api/notify"&&n.method==="GET"){K0(n,s,null,o.query);return}if(c==="/api/proxy/start"&&n.method==="POST"){let v="";n.on("data",_=>v+=_),n.on("end",()=>{let{port:_}=JSON.parse(v||"{}");_?(F0(_),s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({success:!0}))):(s.writeHead(400),s.end(JSON.stringify({error:"Port required"})))});return}if(c==="/api/proxy/end"&&n.method==="POST"){let v="";n.on("data",_=>v+=_),n.on("end",()=>{let{port:_}=JSON.parse(v||"{}");_?(U0(_),s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({success:!0}))):(s.writeHead(400),s.end(JSON.stringify({error:"Port required"})))});return}if(c.startsWith("/proxy/")){let v=c.match(/^\/proxy\/(\d+)(\/.*)?$/);if(v){z0(i,n,s,v[1],v[2]||"/",u);return}}s.writeHead(404),s.end(JSON.stringify({error:"Not found"}))}catch(o){console.error("Error:",n.url,o),s.statusCode=500,s.end("Internal server error")}});await Kx(e),e.listen($0,n=>{if(n)throw n;console.log(Ck(`\u2705 Server ready on http://${Mk}:${$0}`));let s=JSON.parse((0,Gi.readFileSync)((0,Ft.join)(Bn,"..","package.json"),"utf8"));_k(s.version)});let t=!1,r=async n=>{if(t)return;t=!0,console.log($t.yellow(`
|
|
177
|
+
\u{1F6D1} Received ${n}, shutting down gracefully...`));let s=setTimeout(()=>{console.log($t.red("\u26A0\uFE0F Forced exit after 5s timeout")),process.exit(1)},5e3);try{e.close(()=>{console.log($t.gray("\u2713 HTTP server closed"))});let o=jo();o&&(o.emit("server:shutdown"),o.close(()=>{console.log($t.gray("\u2713 Socket.IO closed"))})),await new Promise(c=>setTimeout(c,500)),clearTimeout(s),console.log($t.green("\u2705 Server stopped cleanly")),process.exit(0)}catch(o){console.error($t.red("\u274C Error during shutdown:"),o),clearTimeout(s),process.exit(1)}};return process.on("SIGINT",()=>r("SIGINT")),process.on("SIGTERM",()=>r("SIGTERM")),process.platform==="win32"&&process.on("SIGBREAK",()=>r("SIGBREAK")),e}Z0();0&&(module.exports={startServer});
|
|
178
178
|
/*! Bundled license information:
|
|
179
179
|
|
|
180
180
|
negotiator/index.js:
|