@loaders.gl/i3s 4.4.0-alpha.1 → 4.4.0-alpha.2

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.
@@ -91,12 +91,12 @@ caused by: `+Br.fullStack(r):e.stack};Br.errorFromList=function(e){return wt.arr
91
91
  `,a(o),a(n.body),a(`\r
92
92
  `)}),a("--"+t.boundary+"--"),t.request.postambleCRLF&&a(`\r
93
93
  `),i};_u.prototype.onRequest=function(e){var r=this,t=r.isChunked(e),i=e.data||e;r.setHeaders(t),r.chunked=t,r.body=r.build(i,t)};u4.Multipart=_u});var h4=B(p4=>{"use strict";var f4=require("url"),rU=/^https?:/;function fp(e){this.request=e,this.followRedirect=!0,this.followRedirects=!0,this.followAllRedirects=!1,this.followOriginalHttpMethod=!1,this.allowRedirect=function(){return!0},this.maxRedirects=10,this.redirects=[],this.redirectsFollowed=0,this.removeRefererHeader=!1}fp.prototype.onRequest=function(e){var r=this;e.maxRedirects!==void 0&&(r.maxRedirects=e.maxRedirects),typeof e.followRedirect=="function"&&(r.allowRedirect=e.followRedirect),e.followRedirect!==void 0&&(r.followRedirects=!!e.followRedirect),e.followAllRedirects!==void 0&&(r.followAllRedirects=e.followAllRedirects),(r.followRedirects||r.followAllRedirects)&&(r.redirects=r.redirects||[]),e.removeRefererHeader!==void 0&&(r.removeRefererHeader=e.removeRefererHeader),e.followOriginalHttpMethod!==void 0&&(r.followOriginalHttpMethod=e.followOriginalHttpMethod)};fp.prototype.redirectTo=function(e){var r=this,t=r.request,i=null;if(e.statusCode>=300&&e.statusCode<400&&e.caseless.has("location")){var a=e.caseless.get("location");if(t.debug("redirect",a),r.followAllRedirects)i=a;else if(r.followRedirects)switch(t.method){case"PATCH":case"PUT":case"POST":case"DELETE":break;default:i=a;break}}else if(e.statusCode===401){var n=t._auth.onResponse(e);n&&(t.setHeader("authorization",n),i=t.uri)}return i};fp.prototype.onResponse=function(e){var r=this,t=r.request,i=r.redirectTo(e);if(!i||!r.allowRedirect.call(t,e))return!1;if(t.debug("redirect to",i),e.resume&&e.resume(),r.redirectsFollowed>=r.maxRedirects)return t.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+t.uri.href)),!1;r.redirectsFollowed+=1,rU.test(i)||(i=f4.resolve(t.uri.href,i));var a=t.uri;return t.uri=f4.parse(i),t.uri.protocol!==a.protocol&&delete t.agent,r.redirects.push({statusCode:e.statusCode,redirectUri:i}),r.followAllRedirects&&t.method!=="HEAD"&&e.statusCode!==401&&e.statusCode!==307&&(t.method=r.followOriginalHttpMethod?t.method:"GET"),delete t.src,delete t.req,delete t._started,e.statusCode!==401&&e.statusCode!==307&&(delete t.body,delete t._form,t.headers&&(t.removeHeader("host"),t.removeHeader("content-type"),t.removeHeader("content-length"),t.uri.hostname!==t.originalHost.split(":")[0]&&t.removeHeader("authorization"))),r.removeRefererHeader||t.setHeader("referer",a.href),t.emit("redirect"),t.init(),!0};p4.Redirect=fp});var v4=B(tc=>{"use strict";var mee=require("net"),tU=require("tls"),zg=require("http"),d4=require("https"),aU=require("events"),iU=require("assert"),nU=require("util"),oU=As().Buffer;tc.httpOverHttp=sU;tc.httpsOverHttp=cU;tc.httpOverHttps=uU;tc.httpsOverHttps=lU;function sU(e){var r=new $i(e);return r.request=zg.request,r}function cU(e){var r=new $i(e);return r.request=zg.request,r.createSocket=m4,r.defaultPort=443,r}function uU(e){var r=new $i(e);return r.request=d4.request,r}function lU(e){var r=new $i(e);return r.request=d4.request,r.createSocket=m4,r.defaultPort=443,r}function $i(e){var r=this;r.options=e||{},r.proxyOptions=r.options.proxy||{},r.maxSockets=r.options.maxSockets||zg.Agent.defaultMaxSockets,r.requests=[],r.sockets=[],r.on("free",function(i,a,n){for(var o=0,s=r.requests.length;o<s;++o){var c=r.requests[o];if(c.host===a&&c.port===n){r.requests.splice(o,1),c.request.onSocket(i);return}}i.destroy(),r.removeSocket(i)})}nU.inherits($i,aU.EventEmitter);$i.prototype.addRequest=function(r,t){var i=this;if(typeof t=="string"&&(t={host:t,port:arguments[2],path:arguments[3]}),i.sockets.length>=this.maxSockets){i.requests.push({host:t.host,port:t.port,request:r});return}i.createConnection({host:t.host,port:t.port,request:r})};$i.prototype.createConnection=function(r){var t=this;t.createSocket(r,function(i){i.on("free",a),i.on("close",n),i.on("agentRemove",n),r.request.onSocket(i);function a(){t.emit("free",i,r.host,r.port)}function n(o){t.removeSocket(i),i.removeListener("free",a),i.removeListener("close",n),i.removeListener("agentRemove",n)}})};$i.prototype.createSocket=function(r,t){var i=this,a={};i.sockets.push(a);var n=g4({},i.proxyOptions,{method:"CONNECT",path:r.host+":"+r.port,agent:!1});n.proxyAuth&&(n.headers=n.headers||{},n.headers["Proxy-Authorization"]="Basic "+oU.from(n.proxyAuth).toString("base64")),zo("making CONNECT request");var o=i.request(n);o.useChunkedEncodingByDefault=!1,o.once("response",s),o.once("upgrade",c),o.once("connect",u),o.once("error",l),o.end();function s(h){h.upgrade=!0}function c(h,p,d){process.nextTick(function(){u(h,p,d)})}function u(h,p,d){if(o.removeAllListeners(),p.removeAllListeners(),h.statusCode===200)iU.equal(d.length,0),zo("tunneling connection has established"),i.sockets[i.sockets.indexOf(a)]=p,t(p);else{zo("tunneling socket could not be established, statusCode=%d",h.statusCode);var v=new Error("tunneling socket could not be established, statusCode="+h.statusCode);v.code="ECONNRESET",r.request.emit("error",v),i.removeSocket(a)}}function l(h){o.removeAllListeners(),zo(`tunneling socket could not be established, cause=%s
94
- `,h.message,h.stack);var p=new Error("tunneling socket could not be established, cause="+h.message);p.code="ECONNRESET",r.request.emit("error",p),i.removeSocket(a)}};$i.prototype.removeSocket=function(r){var t=this.sockets.indexOf(r);if(t!==-1){this.sockets.splice(t,1);var i=this.requests.shift();i&&this.createConnection(i)}};function m4(e,r){var t=this;$i.prototype.createSocket.call(t,e,function(i){var a=tU.connect(0,g4({},t.options,{servername:e.host,socket:i}));t.sockets[t.sockets.indexOf(i)]=a,r(a)})}function g4(e){for(var r=1,t=arguments.length;r<t;++r){var i=arguments[r];if(typeof i=="object")for(var a=Object.keys(i),n=0,o=a.length;n<o;++n){var s=a[n];i[s]!==void 0&&(e[s]=i[s])}}return e}var zo;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?zo=function(){var e=Array.prototype.slice.call(arguments);typeof e[0]=="string"?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:zo=function(){};tc.debug=zo});var _4=B(x4=>{"use strict";var fU=require("url"),pU=v4(),y4=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],b4=["proxy-authorization"];function hU(e){var r=e.port,t=e.protocol,i=e.hostname+":";return r?i+=r:t==="https:"?i+="443":i+="80",i}function dU(e,r){var t=r.reduce(function(i,a){return i[a.toLowerCase()]=!0,i},{});return Object.keys(e).filter(function(i){return t[i.toLowerCase()]}).reduce(function(i,a){return i[a]=e[a],i},{})}function mU(e,r){var t=e.proxy,i={proxy:{host:t.hostname,port:+t.port,proxyAuth:t.auth,headers:r},headers:e.headers,ca:e.ca,cert:e.cert,key:e.key,passphrase:e.passphrase,pfx:e.pfx,ciphers:e.ciphers,rejectUnauthorized:e.rejectUnauthorized,secureOptions:e.secureOptions,secureProtocol:e.secureProtocol};return i}function gU(e,r){var t=e.protocol==="https:"?"https":"http",i=r.protocol==="https:"?"Https":"Http";return[t,i].join("Over")}function vU(e){var r=e.uri,t=e.proxy,i=gU(r,t);return pU[i]}function wu(e){this.request=e,this.proxyHeaderWhiteList=y4,this.proxyHeaderExclusiveList=[],typeof e.tunnel<"u"&&(this.tunnelOverride=e.tunnel)}wu.prototype.isEnabled=function(){var e=this,r=e.request;return typeof e.tunnelOverride<"u"?e.tunnelOverride:r.uri.protocol==="https:"};wu.prototype.setup=function(e){var r=this,t=r.request;if(e=e||{},typeof t.proxy=="string"&&(t.proxy=fU.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(r.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(r.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var i=r.proxyHeaderExclusiveList.concat(b4),a=r.proxyHeaderWhiteList.concat(i),n=dU(t.headers,a);n.host=hU(t.uri),i.forEach(t.removeHeader,t);var o=vU(t),s=mU(t,n);return t.agent=o(s),!0};wu.defaultProxyHeaderWhiteList=y4;wu.defaultProxyHeaderExclusiveList=b4;x4.Tunnel=wu});var k4=B((w4,ku)=>{(function(){var e,r,t,i,a,n;typeof performance<"u"&&performance!==null&&performance.now?ku.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(ku.exports=function(){return(e()-a)/1e6},r=process.hrtime,e=function(){var o;return o=r(),o[0]*1e9+o[1]},i=e(),n=process.uptime()*1e9,a=i-n):Date.now?(ku.exports=function(){return Date.now()-t},t=Date.now()):(ku.exports=function(){return new Date().getTime()-t},t=new Date().getTime())}).call(w4)});var F4=B((yee,B4)=>{"use strict";var yU=require("http"),j4=require("https"),Su=require("url"),Ug=require("util"),hp=require("stream"),pp=require("zlib"),Ng=lw(),bU=bw(),xU=uS(),_U=Df(),T4=qf(),S4=yS(),wU=KS(),kU=Ml(),E4=ig(),SU=JS().strict,ic=Nl(),EU=mm(),AU=rE(),jU=hE().Querystring,TU=N8().Har,RU=Y8().Auth,PU=s4().OAuth,OU=c4(),CU=l4().Multipart,BU=h4().Redirect,Hg=_4().Tunnel,ac=k4(),Eu=As().Buffer,A4=ic.safeStringify,FU=ic.isReadStream,IU=ic.toBase64,MU=ic.defer,R4=ic.copy,LU=ic.version,P4=EU.jar(),O4={};function DU(e,r){var t={};for(var i in r){var a=e.indexOf(i)===-1;a&&(t[i]=r[i])}return t}function qU(e,r){var t={};for(var i in r){var a=e.indexOf(i)!==-1,n=typeof r[i]=="function";a&&n||(t[i]=r[i])}return t}function C4(){var e=this;return{uri:e.uri,method:e.method,headers:e.headers}}function zU(){var e=this;return{statusCode:e.statusCode,body:e.body,headers:e.headers,request:C4.call(e.request)}}function Sr(e){var r=this;e.har&&(r._har=new TU(r),e=r._har.options(e)),hp.Stream.call(r);var t=Object.keys(Sr.prototype),i=DU(t,e);kU(r,i),e=qU(t,e),r.readable=!0,r.writable=!0,e.method&&(r.explicitMethod=!0),r._qs=new jU(r),r._auth=new RU(r),r._oauth=new PU(r),r._multipart=new CU(r),r._redirect=new BU(r),r._tunnel=new Hg(r),r.init(e)}Ug.inherits(Sr,hp.Stream);Sr.debug=process.env.NODE_DEBUG&&/\brequest\b/.test(process.env.NODE_DEBUG);function zt(){Sr.debug&&console.error("REQUEST %s",Ug.format.apply(Ug,arguments))}Sr.prototype.debug=zt;Sr.prototype.init=function(e){var r=this;e||(e={}),r.headers=r.headers?R4(r.headers):{};for(var t in r.headers)typeof r.headers[t]>"u"&&delete r.headers[t];if(T4.httpify(r,r.headers),r.method||(r.method=e.method||"GET"),r.localAddress||(r.localAddress=e.localAddress),r._qs.init(e),zt(e),!r.pool&&r.pool!==!1&&(r.pool=O4),r.dests=r.dests||[],r.__isRequestRequest=!0,!r._callback&&r.callback&&(r._callback=r.callback,r.callback=function(){r._callbackCalled||(r._callbackCalled=!0,r._callback.apply(r,arguments))},r.on("error",r.callback.bind()),r.on("complete",r.callback.bind(r,null))),!r.uri&&r.url&&(r.uri=r.url,delete r.url),r.baseUrl){if(typeof r.baseUrl!="string")return r.emit("error",new Error("options.baseUrl must be a string"));if(typeof r.uri!="string")return r.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(r.uri.indexOf("//")===0||r.uri.indexOf("://")!==-1)return r.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var i=r.baseUrl.lastIndexOf("/")===r.baseUrl.length-1,a=r.uri.indexOf("/")===0;i&&a?r.uri=r.baseUrl+r.uri.slice(1):i||a?r.uri=r.baseUrl+r.uri:r.uri===""?r.uri=r.baseUrl:r.uri=r.baseUrl+"/"+r.uri,delete r.baseUrl}if(!r.uri)return r.emit("error",new Error("options.uri is a required argument"));if(typeof r.uri=="string"&&(r.uri=Su.parse(r.uri)),r.uri.href||(r.uri.href=Su.format(r.uri)),r.uri.protocol==="unix:")return r.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if(r.uri.host==="unix"&&r.enableUnixSocket(),r.strictSSL===!1&&(r.rejectUnauthorized=!1),r.uri.pathname||(r.uri.pathname="/"),!(r.uri.host||r.uri.hostname&&r.uri.port)&&!r.uri.isUnix){var n=Su.format(r.uri),o='Invalid URI "'+n+'"';return Object.keys(e).length===0&&(o+=". This can be caused by a crappy redirection."),r.abort(),r.emit("error",new Error(o))}if(r.hasOwnProperty("proxy")||(r.proxy=AU(r.uri)),r.tunnel=r._tunnel.isEnabled(),r.proxy&&r._tunnel.setup(e),r._redirect.onRequest(e),r.setHost=!1,!r.hasHeader("host")){var s=r.originalHostHeaderName||"host";r.setHeader(s,r.uri.host),r.uri.port&&(r.uri.port==="80"&&r.uri.protocol==="http:"||r.uri.port==="443"&&r.uri.protocol==="https:")&&r.setHeader(s,r.uri.hostname),r.setHost=!0}if(r.jar(r._jar||e.jar),r.uri.port||(r.uri.protocol==="http:"?r.uri.port=80:r.uri.protocol==="https:"&&(r.uri.port=443)),r.proxy&&!r.tunnel?(r.port=r.proxy.port,r.host=r.proxy.hostname):(r.port=r.uri.port,r.host=r.uri.hostname),e.form&&r.form(e.form),e.formData){var c=e.formData,u=r.form(),l=function(P,C){C&&C.hasOwnProperty("value")&&C.hasOwnProperty("options")?u.append(P,C.value,C.options):u.append(P,C)};for(var h in c)if(c.hasOwnProperty(h)){var p=c[h];if(p instanceof Array)for(var d=0;d<p.length;d++)l(h,p[d]);else l(h,p)}}if(e.qs&&r.qs(e.qs),r.uri.path?r.path=r.uri.path:r.path=r.uri.pathname+(r.uri.search||""),r.path.length===0&&(r.path="/"),e.aws&&r.aws(e.aws),e.hawk&&r.hawk(e.hawk),e.httpSignature&&r.httpSignature(e.httpSignature),e.auth&&(Object.prototype.hasOwnProperty.call(e.auth,"username")&&(e.auth.user=e.auth.username),Object.prototype.hasOwnProperty.call(e.auth,"password")&&(e.auth.pass=e.auth.password),r.auth(e.auth.user,e.auth.pass,e.auth.sendImmediately,e.auth.bearer)),r.gzip&&!r.hasHeader("accept-encoding")&&r.setHeader("accept-encoding","gzip, deflate"),r.uri.auth&&!r.hasHeader("authorization")){var v=r.uri.auth.split(":").map(function(P){return r._qs.unescape(P)});r.auth(v[0],v.slice(1).join(":"),!0)}if(!r.tunnel&&r.proxy&&r.proxy.auth&&!r.hasHeader("proxy-authorization")){var x=r.proxy.auth.split(":").map(function(P){return r._qs.unescape(P)}),y="Basic "+IU(x.join(":"));r.setHeader("proxy-authorization",y)}r.proxy&&!r.tunnel&&(r.path=r.uri.protocol+"//"+r.uri.host+r.path),e.json&&r.json(e.json),e.multipart&&r.multipart(e.multipart),e.time&&(r.timing=!0,r.elapsedTime=r.elapsedTime||0);function E(){if(SU(r.body)&&(r.body=Eu.from(r.body)),!r.hasHeader("content-length")){var P;typeof r.body=="string"?P=Eu.byteLength(r.body):Array.isArray(r.body)?P=r.body.reduce(function(C,I){return C+I.length},0):P=r.body.length,P?r.setHeader("content-length",P):r.emit("error",new Error("Argument error, options.body."))}}r.body&&!E4(r.body)&&E(),e.oauth?r.oauth(e.oauth):r._oauth.params&&r.hasHeader("authorization")&&r.oauth(r._oauth.params);var A=r.proxy&&!r.tunnel?r.proxy.protocol:r.uri.protocol,S={"http:":yU,"https:":j4},R=r.httpModules||{};if(r.httpModule=R[A]||S[A],!r.httpModule)return r.emit("error",new Error("Invalid protocol: "+A));if(e.ca&&(r.ca=e.ca),!r.agent)if(e.agentOptions&&(r.agentOptions=e.agentOptions),e.agentClass)r.agentClass=e.agentClass;else if(e.forever){var j=LU();j.major===0&&j.minor<=10?r.agentClass=A==="http:"?S4:S4.SSL:(r.agentClass=r.httpModule.Agent,r.agentOptions=r.agentOptions||{},r.agentOptions.keepAlive=!0)}else r.agentClass=r.httpModule.Agent;r.pool===!1?r.agent=!1:r.agent=r.agent||r.getNewAgent(),r.on("pipe",function(P){if(r.ntick&&r._started&&r.emit("error",new Error("You cannot pipe to this stream after the outbound request has started.")),r.src=P,FU(P))r.hasHeader("content-type")||r.setHeader("content-type",_U.lookup(P.path));else{if(P.headers)for(var C in P.headers)r.hasHeader(C)||r.setHeader(C,P.headers[C]);r._json&&!r.hasHeader("content-type")&&r.setHeader("content-type","application/json"),P.method&&!r.explicitMethod&&(r.method=P.method)}}),MU(function(){if(!r._aborted){var P=function(){if(r._form&&(r._auth.hasAuth?r._auth.hasAuth&&r._auth.sentAuth&&r._form.pipe(r):r._form.pipe(r)),r._multipart&&r._multipart.chunked&&r._multipart.body.pipe(r),r.body)E4(r.body)?r.body.pipe(r):(E(),Array.isArray(r.body)?r.body.forEach(function(C){r.write(C)}):r.write(r.body),r.end());else if(r.requestBodyStream)console.warn("options.requestBodyStream is deprecated, please pass the request object to stream.pipe."),r.requestBodyStream.pipe(r);else if(!r.src){if(r._auth.hasAuth&&!r._auth.sentAuth){r.end();return}r.method!=="GET"&&typeof r.method<"u"&&r.setHeader("content-length",0),r.end()}};r._form&&!r.hasHeader("content-length")?(r.setHeader(r._form.getHeaders(),!0),r._form.getLength(function(C,I){!C&&!isNaN(I)&&r.setHeader("content-length",I),P()})):P(),r.ntick=!0}})};Sr.prototype.getNewAgent=function(){var e=this,r=e.agentClass,t={};if(e.agentOptions)for(var i in e.agentOptions)t[i]=e.agentOptions[i];e.ca&&(t.ca=e.ca),e.ciphers&&(t.ciphers=e.ciphers),e.secureProtocol&&(t.secureProtocol=e.secureProtocol),e.secureOptions&&(t.secureOptions=e.secureOptions),typeof e.rejectUnauthorized<"u"&&(t.rejectUnauthorized=e.rejectUnauthorized),e.cert&&e.key&&(t.key=e.key,t.cert=e.cert),e.pfx&&(t.pfx=e.pfx),e.passphrase&&(t.passphrase=e.passphrase);var a="";r!==e.httpModule.Agent&&(a+=r.name);var n=e.proxy;typeof n=="string"&&(n=Su.parse(n));var o=n&&n.protocol==="https:"||this.uri.protocol==="https:";return o&&(t.ca&&(a&&(a+=":"),a+=t.ca),typeof t.rejectUnauthorized<"u"&&(a&&(a+=":"),a+=t.rejectUnauthorized),t.cert&&(a&&(a+=":"),a+=t.cert.toString("ascii")+t.key.toString("ascii")),t.pfx&&(a&&(a+=":"),a+=t.pfx.toString("ascii")),t.ciphers&&(a&&(a+=":"),a+=t.ciphers),t.secureProtocol&&(a&&(a+=":"),a+=t.secureProtocol),t.secureOptions&&(a&&(a+=":"),a+=t.secureOptions)),e.pool===O4&&!a&&Object.keys(t).length===0&&e.httpModule.globalAgent?e.httpModule.globalAgent:(a=e.uri.protocol+a,e.pool[a]||(e.pool[a]=new r(t),e.pool.maxSockets&&(e.pool[a].maxSockets=e.pool.maxSockets)),e.pool[a])};Sr.prototype.start=function(){var e=this;if(e.timing)var r=new Date().getTime(),t=ac();if(!e._aborted){e._started=!0,e.method=e.method||"GET",e.href=e.uri.href,e.src&&e.src.stat&&e.src.stat.size&&!e.hasHeader("content-length")&&e.setHeader("content-length",e.src.stat.size),e._aws&&e.aws(e._aws,!0);var i=R4(e);delete i.auth,zt("make request",e.uri.href),delete i.timeout;try{e.req=e.httpModule.request(i)}catch(n){e.emit("error",n);return}e.timing&&(e.startTime=r,e.startTimeNow=t,e.timings={});var a;e.timeout&&!e.timeoutTimer&&(e.timeout<0?a=0:typeof e.timeout=="number"&&isFinite(e.timeout)&&(a=e.timeout)),e.req.on("response",e.onRequestResponse.bind(e)),e.req.on("error",e.onRequestError.bind(e)),e.req.on("drain",function(){e.emit("drain")}),e.req.on("socket",function(n){var o=n._connecting||n.connecting;if(e.timing&&(e.timings.socket=ac()-e.startTimeNow,o)){var s=function(){e.timings.lookup=ac()-e.startTimeNow},c=function(){e.timings.connect=ac()-e.startTimeNow};n.once("lookup",s),n.once("connect",c),e.req.once("error",function(){n.removeListener("lookup",s),n.removeListener("connect",c)})}var u=function(){e.req.setTimeout(a,function(){if(e.req){e.abort();var h=new Error("ESOCKETTIMEDOUT");h.code="ESOCKETTIMEDOUT",h.connect=!1,e.emit("error",h)}})};if(a!==void 0)if(o){var l=function(){n.removeListener("connect",l),e.clearTimeout(),u()};n.on("connect",l),e.req.on("error",function(h){n.removeListener("connect",l)}),e.timeoutTimer=setTimeout(function(){n.removeListener("connect",l),e.abort();var h=new Error("ETIMEDOUT");h.code="ETIMEDOUT",h.connect=!0,e.emit("error",h)},a)}else u();e.emit("socket",n)}),e.emit("request",e.req)}};Sr.prototype.onRequestError=function(e){var r=this;if(!r._aborted){if(r.req&&r.req._reusedSocket&&e.code==="ECONNRESET"&&r.agent.addRequestNoreuse){r.agent={addRequest:r.agent.addRequestNoreuse.bind(r.agent)},r.start(),r.req.end();return}r.clearTimeout(),r.emit("error",e)}};Sr.prototype.onRequestResponse=function(e){var r=this;if(r.timing&&(r.timings.response=ac()-r.startTimeNow),zt("onRequestResponse",r.uri.href,e.statusCode,e.headers),e.on("end",function(){r.timing&&(r.timings.end=ac()-r.startTimeNow,e.timingStart=r.startTime,r.timings.socket||(r.timings.socket=0),r.timings.lookup||(r.timings.lookup=r.timings.socket),r.timings.connect||(r.timings.connect=r.timings.lookup),r.timings.response||(r.timings.response=r.timings.connect),zt("elapsed time",r.timings.end),r.elapsedTime+=Math.round(r.timings.end),e.elapsedTime=r.elapsedTime,e.timings=r.timings,e.timingPhases={wait:r.timings.socket,dns:r.timings.lookup-r.timings.socket,tcp:r.timings.connect-r.timings.lookup,firstByte:r.timings.response-r.timings.connect,download:r.timings.end-r.timings.response,total:r.timings.end}),zt("response end",r.uri.href,e.statusCode,e.headers)}),r._aborted){zt("aborted",r.uri.href),e.resume();return}if(r.response=e,e.request=r,e.toJSON=zU,r.httpModule===j4&&r.strictSSL&&(!e.hasOwnProperty("socket")||!e.socket.authorized)){zt("strict ssl error",r.uri.href);var t=e.hasOwnProperty("socket")?e.socket.authorizationError:r.uri.href+" does not support SSL";r.emit("error",new Error("SSL Error: "+t));return}r.originalHost=r.getHeader("host"),r.originalHostHeaderName||(r.originalHostHeaderName=r.hasHeader("host")),r.setHost&&r.removeHeader("host"),r.clearTimeout();var i=r._jar&&r._jar.setCookie?r._jar:P4,a=function(l){try{i.setCookie(l,r.uri.href,{ignoreError:!0})}catch(h){r.emit("error",h)}};if(e.caseless=T4(e.headers),e.caseless.has("set-cookie")&&!r._disableCookies){var n=e.caseless.has("set-cookie");Array.isArray(e.headers[n])?e.headers[n].forEach(a):a(e.headers[n])}if(!r._redirect.onResponse(e)){{e.on("close",function(){r._ended||r.response.emit("end")}),e.once("end",function(){r._ended=!0});var o=function(l){return r.method==="HEAD"||l>=100&&l<200||l===204||l===304},s;if(r.gzip&&!o(e.statusCode)){var c=e.headers["content-encoding"]||"identity";c=c.trim().toLowerCase();var u={flush:pp.Z_SYNC_FLUSH,finishFlush:pp.Z_SYNC_FLUSH};c==="gzip"?(s=pp.createGunzip(u),e.pipe(s)):c==="deflate"?(s=pp.createInflate(u),e.pipe(s)):(c!=="identity"&&zt("ignoring unrecognized Content-Encoding "+c),s=e)}else s=e;r.encoding&&(r.dests.length!==0?console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid."):s.setEncoding(r.encoding)),r._paused&&s.pause(),r.responseContent=s,r.emit("response",e),r.dests.forEach(function(l){r.pipeDest(l)}),s.on("data",function(l){r.timing&&!r.responseStarted&&(r.responseStartTime=new Date().getTime(),e.responseStartTime=r.responseStartTime),r._destdata=!0,r.emit("data",l)}),s.once("end",function(l){r.emit("end",l)}),s.on("error",function(l){r.emit("error",l)}),s.on("close",function(){r.emit("close")}),r.callback?r.readResponseBody(e):r.on("end",function(){if(r._aborted){zt("aborted",r.uri.href);return}r.emit("complete",e)})}zt("finish init function",r.uri.href)}};Sr.prototype.readResponseBody=function(e){var r=this;zt("reading response's body");var t=[],i=0,a=[];r.on("data",function(n){Eu.isBuffer(n)?n.length&&(i+=n.length,t.push(n)):a.push(n)}),r.on("end",function(){if(zt("end event",r.uri.href),r._aborted){zt("aborted",r.uri.href),t=[],i=0;return}if(i?(zt("has body",r.uri.href,i),e.body=Eu.concat(t,i),r.encoding!==null&&(e.body=e.body.toString(r.encoding)),t=[],i=0):a.length&&(r.encoding==="utf8"&&a[0].length>0&&a[0][0]==="\uFEFF"&&(a[0]=a[0].substring(1)),e.body=a.join("")),r._json)try{e.body=JSON.parse(e.body,r._jsonReviver)}catch{zt("invalid JSON received",r.uri.href)}zt("emitting complete",r.uri.href),typeof e.body>"u"&&!r._json&&(e.body=r.encoding===null?Eu.alloc(0):""),r.emit("complete",e,e.body)})};Sr.prototype.abort=function(){var e=this;e._aborted=!0,e.req?e.req.abort():e.response&&e.response.destroy(),e.clearTimeout(),e.emit("abort")};Sr.prototype.pipeDest=function(e){var r=this,t=r.response;if(e.headers&&!e.headersSent){if(t.caseless.has("content-type")){var i=t.caseless.has("content-type");e.setHeader?e.setHeader(i,t.headers[i]):e.headers[i]=t.headers[i]}if(t.caseless.has("content-length")){var a=t.caseless.has("content-length");e.setHeader?e.setHeader(a,t.headers[a]):e.headers[a]=t.headers[a]}}if(e.setHeader&&!e.headersSent){for(var n in t.headers)(!r.gzip||n!=="content-encoding")&&e.setHeader(n,t.headers[n]);e.statusCode=t.statusCode}r.pipefilter&&r.pipefilter(t,e)};Sr.prototype.qs=function(e,r){var t=this,i;!r&&t.uri.query?i=t._qs.parse(t.uri.query):i={};for(var a in e)i[a]=e[a];var n=t._qs.stringify(i);return n===""||(t.uri=Su.parse(t.uri.href.split("?")[0]+"?"+n),t.url=t.uri,t.path=t.uri.path,t.uri.host==="unix"&&t.enableUnixSocket()),t};Sr.prototype.form=function(e){var r=this;return e?(/^application\/x-www-form-urlencoded\b/.test(r.getHeader("content-type"))||r.setHeader("content-type","application/x-www-form-urlencoded"),r.body=typeof e=="string"?r._qs.rfc3986(e.toString("utf8")):r._qs.stringify(e).toString("utf8"),r):(r._form=new wU,r._form.on("error",function(t){t.message="form-data: "+t.message,r.emit("error",t),r.abort()}),r._form)};Sr.prototype.multipart=function(e){var r=this;return r._multipart.onRequest(e),r._multipart.chunked||(r.body=r._multipart.body),r};Sr.prototype.json=function(e){var r=this;return r.hasHeader("accept")||r.setHeader("accept","application/json"),typeof r.jsonReplacer=="function"&&(r._jsonReplacer=r.jsonReplacer),r._json=!0,typeof e=="boolean"?r.body!==void 0&&(/^application\/x-www-form-urlencoded\b/.test(r.getHeader("content-type"))?r.body=r._qs.rfc3986(r.body):r.body=A4(r.body,r._jsonReplacer),r.hasHeader("content-type")||r.setHeader("content-type","application/json")):(r.body=A4(e,r._jsonReplacer),r.hasHeader("content-type")||r.setHeader("content-type","application/json")),typeof r.jsonReviver=="function"&&(r._jsonReviver=r.jsonReviver),r};Sr.prototype.getHeader=function(e,r){var t=this,i,a,n;return r||(r=t.headers),Object.keys(r).forEach(function(o){o.length===e.length&&(a=new RegExp(e,"i"),n=o.match(a),n&&(i=r[o]))}),i};Sr.prototype.enableUnixSocket=function(){var e=this.uri.path.split(":"),r=e[0],t=e[1];this.socketPath=r,this.uri.pathname=t,this.uri.path=t,this.uri.host=r,this.uri.hostname=r,this.uri.isUnix=!0};Sr.prototype.auth=function(e,r,t,i){var a=this;return a._auth.onRequest(e,r,t,i),a};Sr.prototype.aws=function(e,r){var t=this;if(!r)return t._aws=e,t;if(e.sign_version===4||e.sign_version==="4"){var i={host:t.uri.host,path:t.uri.path,method:t.method,headers:t.headers,body:t.body};e.service&&(i.service=e.service);var a=bU.sign(i,{accessKeyId:e.key,secretAccessKey:e.secret,sessionToken:e.session});t.setHeader("authorization",a.headers.Authorization),t.setHeader("x-amz-date",a.headers["X-Amz-Date"]),a.headers["X-Amz-Security-Token"]&&t.setHeader("x-amz-security-token",a.headers["X-Amz-Security-Token"])}else{var n=new Date;t.setHeader("date",n.toUTCString());var o={key:e.key,secret:e.secret,verb:t.method.toUpperCase(),date:n,contentType:t.getHeader("content-type")||"",md5:t.getHeader("content-md5")||"",amazonHeaders:Ng.canonicalizeHeaders(t.headers)},s=t.uri.path;e.bucket&&s?o.resource="/"+e.bucket+s:e.bucket&&!s?o.resource="/"+e.bucket:!e.bucket&&s?o.resource=s:!e.bucket&&!s&&(o.resource="/"),o.resource=Ng.canonicalizeResource(o.resource),t.setHeader("authorization",Ng.authorization(o))}return t};Sr.prototype.httpSignature=function(e){var r=this;return xU.signRequest({getHeader:function(t){return r.getHeader(t,r.headers)},setHeader:function(t,i){r.setHeader(t,i)},method:r.method,path:r.path},e),zt("httpSignature authorization",r.getHeader("authorization")),r};Sr.prototype.hawk=function(e){var r=this;r.setHeader("Authorization",OU.header(r.uri,r.method,e))};Sr.prototype.oauth=function(e){var r=this;return r._oauth.onRequest(e),r};Sr.prototype.jar=function(e){var r=this,t;if(r._redirect.redirectsFollowed===0&&(r.originalCookieHeader=r.getHeader("cookie")),!e)t=!1,r._disableCookies=!0;else{var i=e.getCookieString?e:P4,a=r.uri.href;i&&(t=i.getCookieString(a))}return t&&t.length&&(r.originalCookieHeader?r.setHeader("cookie",r.originalCookieHeader+"; "+t):r.setHeader("cookie",t)),r._jar=e,r};Sr.prototype.pipe=function(e,r){var t=this;if(t.response)if(t._destdata)t.emit("error",new Error("You cannot pipe after data has been emitted from the response."));else if(t._ended)t.emit("error",new Error("You cannot pipe after the response has been ended."));else return hp.Stream.prototype.pipe.call(t,e,r),t.pipeDest(e),e;else return t.dests.push(e),hp.Stream.prototype.pipe.call(t,e,r),e};Sr.prototype.write=function(){var e=this;if(!e._aborted&&(e._started||e.start(),e.req))return e.req.write.apply(e.req,arguments)};Sr.prototype.end=function(e){var r=this;r._aborted||(e&&r.write(e),r._started||r.start(),r.req&&r.req.end())};Sr.prototype.pause=function(){var e=this;e.responseContent?e.responseContent.pause.apply(e.responseContent,arguments):e._paused=!0};Sr.prototype.resume=function(){var e=this;e.responseContent?e.responseContent.resume.apply(e.responseContent,arguments):e._paused=!1};Sr.prototype.destroy=function(){var e=this;this.clearTimeout(),e._ended?e.response&&e.response.destroy():e.end()};Sr.prototype.clearTimeout=function(){this.timeoutTimer&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)};Sr.defaultProxyHeaderWhiteList=Hg.defaultProxyHeaderWhiteList.slice();Sr.defaultProxyHeaderExclusiveList=Hg.defaultProxyHeaderExclusiveList.slice();Sr.prototype.toJSON=C4;B4.exports=Sr});var L4=B((bee,M4)=>{"use strict";var Au=Ml(),I4=mm(),NU=Nl(),UU=NU.paramsHaveRequestBody;function dp(e,r,t){typeof r=="function"&&(t=r);var i={};return r!==null&&typeof r=="object"?Au(i,r,{uri:e}):typeof e=="string"?Au(i,{uri:e}):Au(i,e),i.callback=t||i.callback,i}function dt(e,r,t){if(typeof e>"u")throw new Error("undefined is not a valid uri or options object.");var i=dp(e,r,t);if(i.method==="HEAD"&&UU(i))throw new Error("HTTP HEAD requests MUST NOT include a request body.");return new dt.Request(i)}function fo(e){var r=e.toUpperCase();return function(t,i,a){var n=dp(t,i,a);return n.method=r,dt(n,n.callback)}}dt.get=fo("get");dt.head=fo("head");dt.options=fo("options");dt.post=fo("post");dt.put=fo("put");dt.patch=fo("patch");dt.del=fo("delete");dt.delete=fo("delete");dt.jar=function(e){return I4.jar(e)};dt.cookie=function(e){return I4.parse(e)};function Vg(e,r,t,i){return function(a,n,o){var s=dp(a,n,o),c={};return Au(!0,c,r,s),c.pool=s.pool||r.pool,i&&(c.method=i.toUpperCase()),typeof t=="function"&&(e=t),e(c,c.callback)}}dt.defaults=function(e,r){var t=this;e=e||{},typeof e=="function"&&(r=e,e={});var i=Vg(t,e,r),a=["get","head","post","put","patch","del","delete"];return a.forEach(function(n){i[n]=Vg(t[n],e,r,n)}),i.cookie=Vg(t.cookie,e,r),i.jar=t.jar,i.defaults=t.defaults,i};dt.forever=function(e,r){var t={};return r&&Au(t,r),e&&(t.agentOptions=e),t.forever=!0,dt.defaults(t)};M4.exports=dt;dt.Request=F4();dt.initParams=dp;Object.defineProperty(dt,"debug",{enumerable:!0,get:function(){return dt.Request.debug},set:function(e){dt.Request.debug=e}})});var q4=B((xee,D4)=>{D4.exports=HU;function HU(e){if(!/^data\:/i.test(e))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');e=e.replace(/\r?\n/g,"");var r=e.indexOf(",");if(r===-1||r<=4)throw new TypeError("malformed data: URI");for(var t=e.substring(5,r).split(";"),i=!1,a="US-ASCII",n=0;n<t.length;n++)t[n]=="base64"?i=!0:t[n].indexOf("charset=")==0&&(a=t[n].substring(8));var o=unescape(e.substring(r+1)),s=i?"base64":"ascii",c=new Buffer(o,s);return c.type=t[0]||"text/plain",c.charset=a,c}});var U4=B((_ee,N4)=>{var VU=q4();function GU(e){return{mimeType:$U(KU(e)),data:VU(e)}}function KU(e){return e.substring(5,e.indexOf(";"))}var z4=/^(\w+\/)+/;function $U(e){e=e.toLowerCase();var r=e.match(z4);return!r||!(r=r[1])?e:e.replace(z4,r)}N4.exports=GU});var V4=B((kee,H4)=>{"use strict";var ju=Cc(),wee=require("path"),WU=c2().PNG,XU=wd(),YU=h2(),QU=m2().GifReader,JU=x2(),ZU=require("fs"),eH=L4(),rH=Df(),tH=U4();function aH(e,r){var t=new WU;t.parse(e,function(i,a){if(i){r(i);return}r(null,ju(new Uint8Array(a.data),[a.width|0,a.height|0,4],[4,4*a.width|0,1],0))})}function iH(e,r){var t;try{t=XU.decode(e)}catch(n){r(n);return}if(!t){r(new Error("Error decoding jpeg"));return}var i=[t.height,t.width,4],a=ju(t.data,i);r(null,a.transpose(1,0))}function nH(e,r){var t;try{t=new QU(e)}catch(s){r(s);return}if(t.numFrames()>0){var i=[t.numFrames(),t.height,t.width,4];try{var a=new Uint8Array(i[0]*i[1]*i[2]*i[3])}catch(s){r(s);return}var n=ju(a,i);try{for(var o=0;o<t.numFrames();++o)t.decodeAndBlitFrameRGBA(o,a.subarray(n.index(o,0,0,0),n.index(o+1,0,0,0)))}catch(s){r(s);return}r(null,n.transpose(0,2,1))}else{var i=[t.height,t.width,4],a=new Uint8Array(i[0]*i[1]*i[2]),n=ju(a,i);try{t.decodeAndBlitFrameRGBA(0,a)}catch(l){r(l);return}r(null,n.transpose(1,0))}}function oH(e,r){var t=new JU(e);try{t.init()}catch(s){r(s);return}var i=t.getData(),a=[i.getHeight(),i.getWidth(),4],n=new Uint8Array(a[0]*a[1]*a[2]),o=ju(n,a);YU(i,o),r(null,o.transpose(1,0))}function mp(e,r,t){switch(e){case"image/png":aH(r,t);break;case"image/jpg":case"image/jpeg":iH(r,t);break;case"image/gif":nH(r,t);break;case"image/bmp":oH(r,t);break;default:t(new Error("Unsupported file type: "+e))}}H4.exports=function(r,t,i){if(i||(i=t,t=""),Buffer.isBuffer(r)){if(!t){i(new Error("Invalid file type"));return}mp(t,r,i)}else if(r.indexOf("data:")===0)try{var a=tH(r);a?process.nextTick(function(){mp(t||a.mimeType,a.data,i)}):process.nextTick(function(){i(new Error("Error parsing data URI"))})}catch(n){process.nextTick(function(){i(n)})}else r.indexOf("http://")===0||r.indexOf("https://")===0?eH({url:r,encoding:null},function(n,o,s){if(n){i(n);return}if(t=t,t||(o.getHeader!==void 0?t=o.getHeader("content-type"):o.headers!==void 0&&(t=o.headers["content-type"])),!t){i(new Error("Invalid content-type"));return}mp(t,s,i)}):ZU.readFile(r,function(n,o){if(n){i(n);return}if(t=t||rH.lookup(r),!t){i(new Error("Invalid file type"));return}mp(t,o,i)})}});var oy=typeof process!="object"||String(process)!=="[object process]"||process.browser;var sy={ibm866:[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,9617,9618,9619,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9561,9560,9554,9555,9579,9578,9496,9484,9608,9604,9612,9616,9600,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1025,1105,1028,1108,1031,1111,1038,1118,176,8729,183,8730,8470,164,9632,160],"iso-8859-2":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,728,321,164,317,346,167,168,352,350,356,377,173,381,379,176,261,731,322,180,318,347,711,184,353,351,357,378,733,382,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"iso-8859-3":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,294,728,163,164,null,292,167,168,304,350,286,308,173,null,379,176,295,178,179,180,181,293,183,184,305,351,287,309,189,null,380,192,193,194,null,196,266,264,199,200,201,202,203,204,205,206,207,null,209,210,211,212,288,214,215,284,217,218,219,220,364,348,223,224,225,226,null,228,267,265,231,232,233,234,235,236,237,238,239,null,241,242,243,244,289,246,247,285,249,250,251,252,365,349,729],"iso-8859-4":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,312,342,164,296,315,167,168,352,274,290,358,173,381,175,176,261,731,343,180,297,316,711,184,353,275,291,359,330,382,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,298,272,325,332,310,212,213,214,215,216,370,218,219,220,360,362,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,299,273,326,333,311,244,245,246,247,248,371,250,251,252,361,363,729],"iso-8859-5":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,173,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8470,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,167,1118,1119],"iso-8859-6":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,null,null,164,null,null,null,null,null,null,null,1548,173,null,null,null,null,null,null,null,null,null,null,null,null,null,1563,null,null,null,1567,null,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,null,null,null,null,null,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,null,null,null,null,null,null,null,null,null,null,null,null,null],"iso-8859-7":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8216,8217,163,8364,8367,166,167,168,169,890,171,172,173,null,8213,176,177,178,179,900,901,902,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"iso-8859-8":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,162,163,164,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8215,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"iso-8859-10":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,274,290,298,296,310,167,315,272,352,358,381,173,362,330,176,261,275,291,299,297,311,183,316,273,353,359,382,8213,363,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,207,208,325,332,211,212,213,214,360,216,370,218,219,220,221,222,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,239,240,326,333,243,244,245,246,361,248,371,250,251,252,253,254,312],"iso-8859-13":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8221,162,163,164,8222,166,167,216,169,342,171,172,173,174,198,176,177,178,179,8220,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,8217],"iso-8859-14":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,7682,7683,163,266,267,7690,167,7808,169,7810,7691,7922,173,174,376,7710,7711,288,289,7744,7745,182,7766,7809,7767,7811,7776,7923,7812,7813,7777,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,372,209,210,211,212,213,214,7786,216,217,218,219,220,221,374,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,373,241,242,243,244,245,246,7787,248,249,250,251,252,253,375,255],"iso-8859-15":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,8364,165,352,167,353,169,170,171,172,173,174,175,176,177,178,179,381,181,182,183,382,185,186,187,338,339,376,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"iso-8859-16":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,261,321,8364,8222,352,167,353,169,536,171,377,173,378,379,176,177,268,322,381,8221,182,183,382,269,537,187,338,339,376,380,192,193,194,258,196,262,198,199,200,201,202,203,204,205,206,207,272,323,210,211,212,336,214,346,368,217,218,219,220,280,538,223,224,225,226,259,228,263,230,231,232,233,234,235,236,237,238,239,273,324,242,243,244,337,246,347,369,249,250,251,252,281,539,255],"koi8-r":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,1025,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],"koi8-u":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,1108,9556,1110,1111,9559,9560,9561,9562,9563,1169,1118,9566,9567,9568,9569,1025,1028,9571,1030,1031,9574,9575,9576,9577,9578,1168,1038,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],macintosh:[196,197,199,201,209,214,220,225,224,226,228,227,229,231,233,232,234,235,237,236,238,239,241,243,242,244,246,245,250,249,251,252,8224,176,162,163,167,8226,182,223,174,169,8482,180,168,8800,198,216,8734,177,8804,8805,165,181,8706,8721,8719,960,8747,170,186,937,230,248,191,161,172,8730,402,8776,8710,171,187,8230,160,192,195,213,338,339,8211,8212,8220,8221,8216,8217,247,9674,255,376,8260,8364,8249,8250,64257,64258,8225,183,8218,8222,8240,194,202,193,203,200,205,206,207,204,211,212,63743,210,218,219,217,305,710,732,175,728,729,730,184,733,731,711],"windows-874":[8364,129,130,131,132,8230,134,135,136,137,138,139,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,153,154,155,156,157,158,159,160,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,null,null,null,null,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,null,null,null,null],"windows-1250":[8364,129,8218,131,8222,8230,8224,8225,136,8240,352,8249,346,356,381,377,144,8216,8217,8220,8221,8226,8211,8212,152,8482,353,8250,347,357,382,378,160,711,728,321,164,260,166,167,168,169,350,171,172,173,174,379,176,177,731,322,180,181,182,183,184,261,351,187,317,733,318,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"windows-1251":[1026,1027,8218,1107,8222,8230,8224,8225,8364,8240,1033,8249,1034,1036,1035,1039,1106,8216,8217,8220,8221,8226,8211,8212,152,8482,1113,8250,1114,1116,1115,1119,160,1038,1118,1032,164,1168,166,167,1025,169,1028,171,172,173,174,1031,176,177,1030,1110,1169,181,182,183,1105,8470,1108,187,1112,1029,1109,1111,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103],"windows-1252":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"windows-1253":[8364,129,8218,402,8222,8230,8224,8225,136,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,157,158,159,160,901,902,163,164,165,166,167,168,169,null,171,172,173,174,8213,176,177,178,179,900,181,182,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"windows-1254":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,286,209,210,211,212,213,214,215,216,217,218,219,220,304,350,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,287,241,242,243,244,245,246,247,248,249,250,251,252,305,351,255],"windows-1255":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,156,157,158,159,160,161,162,163,8362,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,191,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1520,1521,1522,1523,1524,null,null,null,null,null,null,null,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"windows-1256":[8364,1662,8218,402,8222,8230,8224,8225,710,8240,1657,8249,338,1670,1688,1672,1711,8216,8217,8220,8221,8226,8211,8212,1705,8482,1681,8250,339,8204,8205,1722,160,1548,162,163,164,165,166,167,168,169,1726,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,1563,187,188,189,190,1567,1729,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,215,1591,1592,1593,1594,1600,1601,1602,1603,224,1604,226,1605,1606,1607,1608,231,232,233,234,235,1609,1610,238,239,1611,1612,1613,1614,244,1615,1616,247,1617,249,1618,251,252,8206,8207,1746],"windows-1257":[8364,129,8218,131,8222,8230,8224,8225,136,8240,138,8249,140,168,711,184,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,175,731,159,160,null,162,163,164,null,166,167,216,169,342,171,172,173,174,198,176,177,178,179,180,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,729],"windows-1258":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,258,196,197,198,199,200,201,202,203,768,205,206,207,272,209,777,211,212,416,214,215,216,217,218,219,220,431,771,223,224,225,226,259,228,229,230,231,232,233,234,235,769,237,238,239,273,241,803,243,244,417,246,247,248,249,250,251,252,432,8363,255],"x-mac-cyrillic":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,8224,176,1168,163,167,8226,182,1030,174,169,8482,1026,1106,8800,1027,1107,8734,177,8804,8805,1110,181,1169,1032,1028,1108,1031,1111,1033,1113,1034,1114,1112,1029,172,8730,402,8776,8710,171,187,8230,160,1035,1115,1036,1116,1109,8211,8212,8220,8221,8216,8217,247,8222,1038,1118,1039,1119,8470,1025,1105,1103,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,8364]};globalThis["encoding-indexes"]=sy||{};function hr(e,r,t){return r<=e&&e<=t}function iR(e,r){return e.indexOf(r)!==-1}var cn=Math.floor;function xl(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function nR(e){for(var r=String(e),t=r.length,i=0,a=[];i<t;){var n=r.charCodeAt(i);if(n<55296||n>57343)a.push(n);else if(56320<=n&&n<=57343)a.push(65533);else if(55296<=n&&n<=56319)if(i===t-1)a.push(65533);else{var o=r.charCodeAt(i+1);if(56320<=o&&o<=57343){var s=n&1023,c=o&1023;a.push(65536+(s<<10)+c),i+=1}else a.push(65533)}i+=1}return a}function oR(e){for(var r="",t=0;t<e.length;++t){var i=e[t];i<=65535?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode((i>>10)+55296,(i&1023)+56320))}return r}function za(e){return 0<=e&&e<=127}var qa=za,jr=-1;function zh(e){this.tokens=[].slice.call(e),this.tokens.reverse()}zh.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():jr},prepend:function(e){if(Array.isArray(e))for(var r=e;r.length;)this.tokens.push(r.pop());else this.tokens.push(e)},push:function(e){if(Array.isArray(e))for(var r=e;r.length;)this.tokens.unshift(r.shift());else this.tokens.unshift(e)}};var Hr=-1;function Ar(e,r){if(e)throw TypeError("Decoder error");return r||65533}function oi(e){throw TypeError("The code point "+e+" could not be encoded.")}function sR(){}sR.prototype={handler:function(e,r){}};function cR(){}cR.prototype={handler:function(e,r){}};function Dh(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(qh,e)?qh[e]:null}var cy=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],qh={};cy.forEach(function(e){e.encodings.forEach(function(r){r.labels.forEach(function(t){qh[t]=r})})});var ma={},ga={};function hs(e,r){return r&&r[e]||null}function ds(e,r){var t=r.indexOf(e);return t===-1?null:t}function sa(e){if(!("encoding-indexes"in globalThis))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return globalThis["encoding-indexes"][e]}function uR(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var r=0,t=0,i=sa("gb18030-ranges"),a;for(a=0;a<i.length;++a){var n=i[a];if(n[0]<=e)r=n[0],t=n[1];else break}return t+e-r}function lR(e){if(e===59335)return 7457;var r=0,t=0,i=sa("gb18030-ranges"),a;for(a=0;a<i.length;++a){var n=i[a];if(n[1]<=e)r=n[1],t=n[0];else break}return t+e-r}function fR(e){Mh=Mh||sa("jis0208").map(function(t,i){return hr(i,8272,8835)?null:t});var r=Mh;return r.indexOf(e)}var Mh;function pR(e){Lh=Lh||sa("big5").map(function(t,i){return i<(161-129)*157?null:t});var r=Lh;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?r.lastIndexOf(e):ds(e,r)}var Lh,uy="utf-8";function wo(e,r){if(!(this instanceof wo))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):uy,r=xl(r),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var t=Dh(e);if(t===null||t.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!ga[t.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var i=this;return i._encoding=t,Boolean(r.fatal)&&(i._error_mode="fatal"),Boolean(r.ignoreBOM)&&(i._ignoreBOM=!0),Object.defineProperty||(this.encoding=i._encoding.name.toLowerCase(),this.fatal=i._error_mode==="fatal",this.ignoreBOM=i._ignoreBOM),i}Object.defineProperty&&(Object.defineProperty(wo.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(wo.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(wo.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));wo.prototype.decode=function(r,t){var i;typeof r=="object"&&r instanceof ArrayBuffer?i=new Uint8Array(r):typeof r=="object"&&"buffer"in r&&r.buffer instanceof ArrayBuffer?i=new Uint8Array(r.buffer,r.byteOffset,r.byteLength):i=new Uint8Array(0),t=xl(t),this._do_not_flush||(this._decoder=ga[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(t.stream);for(var a=new zh(i),n=[],o;;){var s=a.read();if(s===jr||(o=this._decoder.handler(a,s),o===Hr))break;o!==null&&(Array.isArray(o)?n.push.apply(n,o):n.push(o))}if(!this._do_not_flush){do{if(o=this._decoder.handler(a,a.read()),o===Hr)break;o!==null&&(Array.isArray(o)?n.push.apply(n,o):n.push(o))}while(!a.endOfStream());this._decoder=null}function c(u){return iR(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(u.length>0&&u[0]===65279?(this._BOMseen=!0,u.shift()):u.length>0&&(this._BOMseen=!0)),oR(u)}return c.call(this,n)};function Sc(e,r){if(!(this instanceof Sc))throw TypeError("Called as a function. Did you forget 'new'?");r=xl(r),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(r.fatal)?"fatal":"replacement";var t=this;if(Boolean(r.NONSTANDARD_allowLegacyEncoding)){e=e!==void 0?String(e):uy;var i=Dh(e);if(i===null||i.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!ma[i.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");t._encoding=i}else t._encoding=Dh("utf-8"),e!==void 0&&"console"in globalThis&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=t._encoding.name.toLowerCase()),t}Object.defineProperty&&Object.defineProperty(Sc.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});Sc.prototype.encode=function(r,t){r=r===void 0?"":String(r),t=xl(t),this._do_not_flush||(this._encoder=ma[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(t.stream);for(var i=new zh(nR(r)),a=[],n;;){var o=i.read();if(o===jr||(n=this._encoder.handler(i,o),n===Hr))break;Array.isArray(n)?a.push.apply(a,n):a.push(n)}if(!this._do_not_flush){for(;n=this._encoder.handler(i,i.read()),n!==Hr;)Array.isArray(n)?a.push.apply(a,n):a.push(n);this._encoder=null}return new Uint8Array(a)};function hR(e){var r=e.fatal,t=0,i=0,a=0,n=128,o=191;this.handler=function(s,c){if(c===jr&&a!==0)return a=0,Ar(r);if(c===jr)return Hr;if(a===0){if(hr(c,0,127))return c;if(hr(c,194,223))a=1,t=c&31;else if(hr(c,224,239))c===224&&(n=160),c===237&&(o=159),a=2,t=c&15;else if(hr(c,240,244))c===240&&(n=144),c===244&&(o=143),a=3,t=c&7;else return Ar(r);return null}if(!hr(c,n,o))return t=a=i=0,n=128,o=191,s.prepend(c),Ar(r);if(n=128,o=191,t=t<<6|c&63,i+=1,i!==a)return null;var u=t;return t=a=i=0,u}}function dR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i))return i;var a,n;hr(i,128,2047)?(a=1,n=192):hr(i,2048,65535)?(a=2,n=224):hr(i,65536,1114111)&&(a=3,n=240);for(var o=[(i>>6*a)+n];a>0;){var s=i>>6*(a-1);o.push(128|s&63),a-=1}return o}}ma["UTF-8"]=function(e){return new dR(e)};ga["UTF-8"]=function(e){return new hR(e)};function mR(e,r){var t=r.fatal;this.handler=function(i,a){if(a===jr)return Hr;if(za(a))return a;var n=e[a-128];return n===null?Ar(t):n}}function gR(e,r){var t=r.fatal;this.handler=function(i,a){if(a===jr)return Hr;if(qa(a))return a;var n=ds(a,e);return n===null&&oi(a),n+128}}(function(){"encoding-indexes"in globalThis&&cy.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(r){var t=r.name,i=sa(t.toLowerCase());ga[t]=function(a){return new mR(i,a)},ma[t]=function(a){return new gR(i,a)}})})})();ga.GBK=function(e){return new ly(e)};ma.GBK=function(e){return new fy(e,!0)};function ly(e){var r=e.fatal,t=0,i=0,a=0;this.handler=function(n,o){if(o===jr&&t===0&&i===0&&a===0)return Hr;o===jr&&(t!==0||i!==0||a!==0)&&(t=0,i=0,a=0,Ar(r));var s;if(a!==0){s=null,hr(o,48,57)&&(s=uR((((t-129)*10+i-48)*126+a-129)*10+o-48));var c=[i,a,o];return t=0,i=0,a=0,s===null?(n.prepend(c),Ar(r)):s}if(i!==0)return hr(o,129,254)?(a=o,null):(n.prepend([i,o]),t=0,i=0,Ar(r));if(t!==0){if(hr(o,48,57))return i=o,null;var u=t,l=null;t=0;var h=o<127?64:65;return(hr(o,64,126)||hr(o,128,254))&&(l=(u-129)*190+(o-h)),s=l===null?null:hs(l,sa("gb18030")),s===null&&za(o)&&n.prepend(o),s===null?Ar(r):s}return za(o)?o:o===128?8364:hr(o,129,254)?(t=o,null):Ar(r)}}function fy(e,r){var t=e.fatal;this.handler=function(i,a){if(a===jr)return Hr;if(qa(a))return a;if(a===58853)return oi(a);if(r&&a===8364)return 128;var n=ds(a,sa("gb18030"));if(n!==null){var o=cn(n/190)+129,s=n%190,c=s<63?64:65;return[o,s+c]}if(r)return oi(a);n=lR(a);var u=cn(n/10/126/10);n=n-u*10*126*10;var l=cn(n/10/126);n=n-l*10*126;var h=cn(n/10),p=n-h*10;return[u+129,l+48,h+129,p+48]}}ma.gb18030=function(e){return new fy(e)};ga.gb18030=function(e){return new ly(e)};function vR(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===jr&&t!==0)return t=0,Ar(r);if(a===jr&&t===0)return Hr;if(t!==0){var n=t,o=null;t=0;var s=a<127?64:98;switch((hr(a,64,126)||hr(a,161,254))&&(o=(n-129)*157+(a-s)),o){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var c=o===null?null:hs(o,sa("big5"));return c===null&&za(a)&&i.prepend(a),c===null?Ar(r):c}return za(a)?a:hr(a,129,254)?(t=a,null):Ar(r)}}function yR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i))return i;var a=pR(i);if(a===null)return oi(i);var n=cn(a/157)+129;if(n<161)return oi(i);var o=a%157,s=o<63?64:98;return[n,o+s]}}ma.Big5=function(e){return new yR(e)};ga.Big5=function(e){return new vR(e)};function bR(e){var r=e.fatal,t=!1,i=0;this.handler=function(a,n){if(n===jr&&i!==0)return i=0,Ar(r);if(n===jr&&i===0)return Hr;if(i===142&&hr(n,161,223))return i=0,65377-161+n;if(i===143&&hr(n,161,254))return t=!0,i=n,null;if(i!==0){var o=i;i=0;var s=null;return hr(o,161,254)&&hr(n,161,254)&&(s=hs((o-161)*94+(n-161),sa(t?"jis0212":"jis0208"))),t=!1,hr(n,161,254)||a.prepend(n),s===null?Ar(r):s}return za(n)?n:n===142||n===143||hr(n,161,254)?(i=n,null):Ar(r)}}function xR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i))return i;if(i===165)return 92;if(i===8254)return 126;if(hr(i,65377,65439))return[142,i-65377+161];i===8722&&(i=65293);var a=ds(i,sa("jis0208"));if(a===null)return oi(i);var n=cn(a/94)+161,o=a%94+161;return[n,o]}}ma["EUC-JP"]=function(e){return new xR(e)};ga["EUC-JP"]=function(e){return new bR(e)};function _R(e){var r=e.fatal,t={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},i=t.ASCII,a=t.ASCII,n=0,o=!1;this.handler=function(s,c){switch(i){default:case t.ASCII:return c===27?(i=t.EscapeStart,null):hr(c,0,127)&&c!==14&&c!==15&&c!==27?(o=!1,c):c===jr?Hr:(o=!1,Ar(r));case t.Roman:return c===27?(i=t.EscapeStart,null):c===92?(o=!1,165):c===126?(o=!1,8254):hr(c,0,127)&&c!==14&&c!==15&&c!==27&&c!==92&&c!==126?(o=!1,c):c===jr?Hr:(o=!1,Ar(r));case t.Katakana:return c===27?(i=t.EscapeStart,null):hr(c,33,95)?(o=!1,65377-33+c):c===jr?Hr:(o=!1,Ar(r));case t.LeadByte:return c===27?(i=t.EscapeStart,null):hr(c,33,126)?(o=!1,n=c,i=t.TrailByte,null):c===jr?Hr:(o=!1,Ar(r));case t.TrailByte:if(c===27)return i=t.EscapeStart,Ar(r);if(hr(c,33,126)){i=t.LeadByte;var u=(n-33)*94+c-33,l=hs(u,sa("jis0208"));return l===null?Ar(r):l}return c===jr?(i=t.LeadByte,s.prepend(c),Ar(r)):(i=t.LeadByte,Ar(r));case t.EscapeStart:return c===36||c===40?(n=c,i=t.Escape,null):(s.prepend(c),o=!1,i=a,Ar(r));case t.Escape:var h=n;n=0;var p=null;if(h===40&&c===66&&(p=t.ASCII),h===40&&c===74&&(p=t.Roman),h===40&&c===73&&(p=t.Katakana),h===36&&(c===64||c===66)&&(p=t.LeadByte),p!==null){i=i=p;var d=o;return o=!0,d?Ar(r):null}return s.prepend([h,c]),o=!1,i=a,Ar(r)}}}function wR(e){var r=e.fatal,t={ASCII:0,Roman:1,jis0208:2},i=t.ASCII;this.handler=function(a,n){if(n===jr&&i!==t.ASCII)return a.prepend(n),i=t.ASCII,[27,40,66];if(n===jr&&i===t.ASCII)return Hr;if((i===t.ASCII||i===t.Roman)&&(n===14||n===15||n===27))return oi(65533);if(i===t.ASCII&&qa(n))return n;if(i===t.Roman&&(qa(n)&&n!==92&&n!==126||n==165||n==8254)){if(qa(n))return n;if(n===165)return 92;if(n===8254)return 126}if(qa(n)&&i!==t.ASCII)return a.prepend(n),i=t.ASCII,[27,40,66];if((n===165||n===8254)&&i!==t.Roman)return a.prepend(n),i=t.Roman,[27,40,74];n===8722&&(n=65293);var o=ds(n,sa("jis0208"));if(o===null)return oi(n);if(i!==t.jis0208)return a.prepend(n),i=t.jis0208,[27,36,66];var s=cn(o/94)+33,c=o%94+33;return[s,c]}}ma["ISO-2022-JP"]=function(e){return new wR(e)};ga["ISO-2022-JP"]=function(e){return new _R(e)};function kR(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===jr&&t!==0)return t=0,Ar(r);if(a===jr&&t===0)return Hr;if(t!==0){var n=t,o=null;t=0;var s=a<127?64:65,c=n<160?129:193;if((hr(a,64,126)||hr(a,128,252))&&(o=(n-c)*188+a-s),hr(o,8836,10715))return 57344-8836+o;var u=o===null?null:hs(o,sa("jis0208"));return u===null&&za(a)&&i.prepend(a),u===null?Ar(r):u}return za(a)||a===128?a:hr(a,161,223)?65377-161+a:hr(a,129,159)||hr(a,224,252)?(t=a,null):Ar(r)}}function SR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i)||i===128)return i;if(i===165)return 92;if(i===8254)return 126;if(hr(i,65377,65439))return i-65377+161;i===8722&&(i=65293);var a=fR(i);if(a===null)return oi(i);var n=cn(a/188),o=n<31?129:193,s=a%188,c=s<63?64:65;return[n+o,s+c]}}ma.Shift_JIS=function(e){return new SR(e)};ga.Shift_JIS=function(e){return new kR(e)};function ER(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===jr&&t!==0)return t=0,Ar(r);if(a===jr&&t===0)return Hr;if(t!==0){var n=t,o=null;t=0,hr(a,65,254)&&(o=(n-129)*190+(a-65));var s=o===null?null:hs(o,sa("euc-kr"));return o===null&&za(a)&&i.prepend(a),s===null?Ar(r):s}return za(a)?a:hr(a,129,254)?(t=a,null):Ar(r)}}function AR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i))return i;var a=ds(i,sa("euc-kr"));if(a===null)return oi(i);var n=cn(a/190)+129,o=a%190+65;return[n,o]}}ma["EUC-KR"]=function(e){return new AR(e)};ga["EUC-KR"]=function(e){return new ER(e)};function bl(e,r){var t=e>>8,i=e&255;return r?[t,i]:[i,t]}function py(e,r){var t=r.fatal,i=null,a=null;this.handler=function(n,o){if(o===jr&&(i!==null||a!==null))return Ar(t);if(o===jr&&i===null&&a===null)return Hr;if(i===null)return i=o,null;var s;if(e?s=(i<<8)+o:s=(o<<8)+i,i=null,a!==null){var c=a;return a=null,hr(s,56320,57343)?65536+(c-55296)*1024+(s-56320):(n.prepend(bl(s,e)),Ar(t))}return hr(s,55296,56319)?(a=s,null):hr(s,56320,57343)?Ar(t):s}}function hy(e,r){var t=r.fatal;this.handler=function(i,a){if(a===jr)return Hr;if(hr(a,0,65535))return bl(a,e);var n=bl((a-65536>>10)+55296,e),o=bl((a-65536&1023)+56320,e);return n.concat(o)}}ma["UTF-16BE"]=function(e){return new hy(!0,e)};ga["UTF-16BE"]=function(e){return new py(!0,e)};ma["UTF-16LE"]=function(e){return new hy(!1,e)};ga["UTF-16LE"]=function(e){return new py(!1,e)};function jR(e){var r=e.fatal;this.handler=function(t,i){return i===jr?Hr:za(i)?i:63360+i-128}}function TR(e){var r=e.fatal;this.handler=function(t,i){return i===jr?Hr:qa(i)?i:hr(i,63360,63487)?i-63360+128:oi(i)}}ma["x-user-defined"]=function(e){return new TR(e)};ga["x-user-defined"]=function(e){return new jR(e)};function Ec(e){return Buffer.from(e).toString("base64")}function Nh(e){return Buffer.from(e,"base64").toString("ascii")}var f_=Xt(u_(),1),p_=Xt(Cc(),1);function l_(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function $9(e,r){let t=r.type?r.type.replace("image/",""):"jpeg",i=(0,p_.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,f_.default)(i,t,r)}function h_(e,r){let t=$9(e,r);return new Promise(i=>{let a=[];t.on("data",n=>a.push(n)),t.on("end",()=>{let n=Buffer.concat(a);i(l_(n))})})}var G4=Xt(V4(),1),Gg=["image/png","image/jpeg","image/gif"];async function Kg(e,r){if(!r)throw new Error("MIMEType is required to parse image under Node.js");let t=e instanceof Buffer?e:Buffer.from(e);return await sH(t,r)}function sH(e,r){return new Promise(t=>(0,G4.default)(e,r,(i,a)=>{if(i)throw i;let n=[...a.shape],o=a.shape.length===4?a.shape.shift():1,s=a.data instanceof Buffer?new Uint8Array(a.data):a.data;t({shape:n,data:s,width:a.shape[0],height:a.shape[1],components:a.shape[2],layers:o?[o]:[]})}))}async function $g(e,r,t,i){return i._parse(e,r,t,i)}function ki(e,r){if(!e)throw new Error(r||"loader assertion failed.")}var Wi={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},cH=Wi.self||Wi.window||Wi.global||{},uH=Wi.window||Wi.self||Wi.global||{},lH=Wi.global||Wi.self||Wi.window||{},fH=Wi.document||{};var No=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var K4=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),pH=K4&&parseFloat(K4[1])||0;var gp=globalThis,hH=globalThis.document||{},vp=globalThis.process||{},dH=globalThis.console,Tee=globalThis.navigator||{};function $4(e){var i,a;if(typeof window<"u"&&((i=window.process)==null?void 0:i.type)==="renderer"||typeof process<"u"&&Boolean((a=process.versions)==null?void 0:a.electron))return!0;let r=typeof navigator<"u"&&navigator.userAgent,t=e||r;return Boolean(t&&t.indexOf("Electron")>=0)}function Uo(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||$4()}var Wg="4.0.7";function gH(e){try{let r=window[e],t="__storage_test__";return r.setItem(t,t),r.removeItem(t),r}catch{return null}}var yp=class{constructor(r,t,i="sessionStorage"){this.storage=gH(i),this.id=r,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(r){if(Object.assign(this.config,r),this.storage){let t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let r={};if(this.storage){let t=this.storage.getItem(this.id);r=t?JSON.parse(t):{}}return Object.assign(this.config,r),this}};function W4(e){let r;return e<10?r=`${e.toFixed(2)}ms`:e<100?r=`${e.toFixed(1)}ms`:e<1e3?r=`${e.toFixed(0)}ms`:r=`${(e/1e3).toFixed(2)}s`,r}function X4(e,r=8){let t=Math.max(r-e.length,0);return`${" ".repeat(t)}${e}`}var bp;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(bp||(bp={}));var vH=10;function Y4(e){return typeof e!="string"?e:(e=e.toUpperCase(),bp[e]||bp.WHITE)}function Q4(e,r,t){return!Uo&&typeof e=="string"&&(r&&(e=`\x1B[${Y4(r)}m${e}\x1B[39m`),t&&(e=`\x1B[${Y4(t)+vH}m${e}\x1B[49m`)),e}function J4(e,r=["constructor"]){let t=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(t),a=e;for(let n of i){let o=a[n];typeof o=="function"&&(r.find(s=>n===s)||(a[n]=o.bind(e)))}}function Tu(e,r){if(!e)throw new Error(r||"Assertion failed")}function Ho(){var r,t,i,a,n;let e;if(Uo()&&gp.performance)e=(i=(t=(r=gp)==null?void 0:r.performance)==null?void 0:t.now)==null?void 0:i.call(t);else if("hrtime"in vp){let o=(n=(a=vp)==null?void 0:a.hrtime)==null?void 0:n.call(a);e=o[0]*1e3+o[1]/1e6}else e=Date.now();return e}var nc={debug:Uo()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},yH={enabled:!0,level:0};function oc(){}var Z4={},e5={once:!0},Xi=class{constructor({id:r}={id:""}){this.VERSION=Wg,this._startTs=Ho(),this._deltaTs=Ho(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=r,this.userData={},this._storage=new yp(`__probe-${this.id}__`,yH),this.timeStamp(`${this.id} started`),J4(this),Object.seal(this)}set level(r){this.setLevel(r)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Ho()-this._startTs).toPrecision(10))}getDelta(){return Number((Ho()-this._deltaTs).toPrecision(10))}set priority(r){this.level=r}get priority(){return this.level}getPriority(){return this.level}enable(r=!0){return this._storage.setConfiguration({enabled:r}),this}setLevel(r){return this._storage.setConfiguration({level:r}),this}get(r){return this._storage.config[r]}set(r,t){this._storage.setConfiguration({[r]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(r,t){if(!r)throw new Error(t||"Assertion failed")}warn(r){return this._getLogFunction(0,r,nc.warn,arguments,e5)}error(r){return this._getLogFunction(0,r,nc.error,arguments)}deprecated(r,t){return this.warn(`\`${r}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(r,t){return this.error(`\`${r}\` has been removed. Use \`${t}\` instead`)}probe(r,t){return this._getLogFunction(r,t,nc.log,arguments,{time:!0,once:!0})}log(r,t){return this._getLogFunction(r,t,nc.debug,arguments)}info(r,t){return this._getLogFunction(r,t,console.info,arguments)}once(r,t){return this._getLogFunction(r,t,nc.debug||nc.info,arguments,e5)}table(r,t,i){return t?this._getLogFunction(r,t,console.table||oc,i&&[i],{tag:xH(t)}):oc}time(r,t){return this._getLogFunction(r,t,console.time?console.time:console.info)}timeEnd(r,t){return this._getLogFunction(r,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(r,t){return this._getLogFunction(r,t,console.timeStamp||oc)}group(r,t,i={collapsed:!1}){let a=r5({logLevel:r,message:t,opts:i}),{collapsed:n}=i;return a.method=(n?console.groupCollapsed:console.group)||console.info,this._getLogFunction(a)}groupCollapsed(r,t,i={}){return this.group(r,t,Object.assign({},i,{collapsed:!0}))}groupEnd(r){return this._getLogFunction(r,"",console.groupEnd||oc)}withGroup(r,t,i){this.group(r,t)();try{i()}finally{this.groupEnd(r)()}}trace(){console.trace&&console.trace()}_shouldLog(r){return this.isEnabled()&&this.getLevel()>=t5(r)}_getLogFunction(r,t,i,a,n){if(this._shouldLog(r)){n=r5({logLevel:r,message:t,args:a,opts:n}),i=i||n.method,Tu(i),n.total=this.getTotal(),n.delta=this.getDelta(),this._deltaTs=Ho();let o=n.tag||n.message;if(n.once&&o)if(!Z4[o])Z4[o]=Ho();else return oc;return t=bH(this.id,n.message,n),i.bind(console,t,...n.args)}return oc}};Xi.VERSION=Wg;function t5(e){if(!e)return 0;let r;switch(typeof e){case"number":r=e;break;case"object":r=e.logLevel||e.priority||0;break;default:return 0}return Tu(Number.isFinite(r)&&r>=0),r}function r5(e){let{logLevel:r,message:t}=e;e.logLevel=t5(r);let i=e.args?Array.from(e.args):[];for(;i.length&&i.shift()!==t;);switch(typeof r){case"string":case"function":t!==void 0&&i.unshift(t),e.message=r;break;case"object":Object.assign(e,r);break;default:}typeof e.message=="function"&&(e.message=e.message());let a=typeof e.message;return Tu(a==="string"||a==="object"),Object.assign(e,{args:i},e.opts)}function bH(e,r,t){if(typeof r=="string"){let i=t.time?X4(W4(t.total)):"";r=t.time?`${e}: ${i} ${r}`:`${e}: ${r}`,r=Q4(r,t.color,t.background)}return r}function xH(e){for(let r in e)for(let t in e[r])return t||"untitled";return"empty"}globalThis.probe={};var Zee=new Xi({id:"@probe.gl/log"});var Xg="4.4.0-alpha.0",_H=Xg[0]>="0"&&Xg[0]<="9"?`v${Xg}`:"";function wH(){let e=new Xi({id:"loaders.gl"});return globalThis.loaders=globalThis.loaders||{},globalThis.loaders.log=e,globalThis.loaders.version=_H,globalThis.probe=globalThis.probe||{},globalThis.probe.loaders=e,e}var Yg=wH();function Qg(e,r){return a5(e||{},r)}function a5(e,r,t=0){if(t>3)return r;let i={...e};for(let[a,n]of Object.entries(r))n&&typeof n=="object"&&!Array.isArray(n)?i[a]=a5(i[a]||{},r[a],t+1):i[a]=r[a];return i}function Jg(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function Zg(e){var t,i;return((i=(t=globalThis.loaders)==null?void 0:t.modules)==null?void 0:i[e])||null}var i5="beta";function kH(){var e;return(e=globalThis._loadersgl_)!=null&&e.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.4.0-alpha.0"),globalThis._loadersgl_.version}var xp=kH();function Wt(e,r){if(!e)throw new Error(r||"loaders.gl assertion failed.")}var Yi={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},lre=Yi.self||Yi.window||Yi.global||{},fre=Yi.window||Yi.self||Yi.global||{},pre=Yi.global||Yi.self||Yi.window||{},hre=Yi.document||{};var Nt=typeof process!="object"||String(process)!=="[object process]"||process.browser,Ru=typeof importScripts=="function",o5=typeof window<"u"&&typeof window.orientation<"u",n5=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),dre=n5&&parseFloat(n5[1])||0;var Pu=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(r,t){this.name=r,this.workerThread=t,this.result=new Promise((i,a)=>{this._resolve=i,this._reject=a})}postMessage(r,t){this.workerThread.postMessage({source:"loaders.gl",type:r,payload:t})}done(r){Wt(this.isRunning),this.isRunning=!1,this._resolve(r)}error(r){Wt(this.isRunning),this.isRunning=!1,this._reject(r)}};var po={};yl(po,{NodeWorker:()=>Cu,parentPort:()=>ev});var Ou=Xt(require("worker_threads"),1);kc(po,require("worker_threads"));var ev=Ou==null?void 0:Ou.parentPort,Cu=Ou.Worker;var rv=new Map;function s5(e){Wt(e.source&&!e.url||!e.source&&e.url);let r=rv.get(e.source||e.url);return r||(e.url&&(r=SH(e.url),rv.set(e.url,r)),e.source&&(r=c5(e.source),rv.set(e.source,r))),Wt(r),r}function SH(e){if(!e.startsWith("http"))return e;let r=EH(e);return c5(r)}function c5(e){let r=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(r)}function EH(e){return`try {
94
+ `,h.message,h.stack);var p=new Error("tunneling socket could not be established, cause="+h.message);p.code="ECONNRESET",r.request.emit("error",p),i.removeSocket(a)}};$i.prototype.removeSocket=function(r){var t=this.sockets.indexOf(r);if(t!==-1){this.sockets.splice(t,1);var i=this.requests.shift();i&&this.createConnection(i)}};function m4(e,r){var t=this;$i.prototype.createSocket.call(t,e,function(i){var a=tU.connect(0,g4({},t.options,{servername:e.host,socket:i}));t.sockets[t.sockets.indexOf(i)]=a,r(a)})}function g4(e){for(var r=1,t=arguments.length;r<t;++r){var i=arguments[r];if(typeof i=="object")for(var a=Object.keys(i),n=0,o=a.length;n<o;++n){var s=a[n];i[s]!==void 0&&(e[s]=i[s])}}return e}var zo;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?zo=function(){var e=Array.prototype.slice.call(arguments);typeof e[0]=="string"?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:zo=function(){};tc.debug=zo});var _4=B(x4=>{"use strict";var fU=require("url"),pU=v4(),y4=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],b4=["proxy-authorization"];function hU(e){var r=e.port,t=e.protocol,i=e.hostname+":";return r?i+=r:t==="https:"?i+="443":i+="80",i}function dU(e,r){var t=r.reduce(function(i,a){return i[a.toLowerCase()]=!0,i},{});return Object.keys(e).filter(function(i){return t[i.toLowerCase()]}).reduce(function(i,a){return i[a]=e[a],i},{})}function mU(e,r){var t=e.proxy,i={proxy:{host:t.hostname,port:+t.port,proxyAuth:t.auth,headers:r},headers:e.headers,ca:e.ca,cert:e.cert,key:e.key,passphrase:e.passphrase,pfx:e.pfx,ciphers:e.ciphers,rejectUnauthorized:e.rejectUnauthorized,secureOptions:e.secureOptions,secureProtocol:e.secureProtocol};return i}function gU(e,r){var t=e.protocol==="https:"?"https":"http",i=r.protocol==="https:"?"Https":"Http";return[t,i].join("Over")}function vU(e){var r=e.uri,t=e.proxy,i=gU(r,t);return pU[i]}function wu(e){this.request=e,this.proxyHeaderWhiteList=y4,this.proxyHeaderExclusiveList=[],typeof e.tunnel<"u"&&(this.tunnelOverride=e.tunnel)}wu.prototype.isEnabled=function(){var e=this,r=e.request;return typeof e.tunnelOverride<"u"?e.tunnelOverride:r.uri.protocol==="https:"};wu.prototype.setup=function(e){var r=this,t=r.request;if(e=e||{},typeof t.proxy=="string"&&(t.proxy=fU.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(r.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(r.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var i=r.proxyHeaderExclusiveList.concat(b4),a=r.proxyHeaderWhiteList.concat(i),n=dU(t.headers,a);n.host=hU(t.uri),i.forEach(t.removeHeader,t);var o=vU(t),s=mU(t,n);return t.agent=o(s),!0};wu.defaultProxyHeaderWhiteList=y4;wu.defaultProxyHeaderExclusiveList=b4;x4.Tunnel=wu});var k4=B((w4,ku)=>{(function(){var e,r,t,i,a,n;typeof performance<"u"&&performance!==null&&performance.now?ku.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(ku.exports=function(){return(e()-a)/1e6},r=process.hrtime,e=function(){var o;return o=r(),o[0]*1e9+o[1]},i=e(),n=process.uptime()*1e9,a=i-n):Date.now?(ku.exports=function(){return Date.now()-t},t=Date.now()):(ku.exports=function(){return new Date().getTime()-t},t=new Date().getTime())}).call(w4)});var F4=B((yee,B4)=>{"use strict";var yU=require("http"),j4=require("https"),Su=require("url"),Ug=require("util"),hp=require("stream"),pp=require("zlib"),Ng=lw(),bU=bw(),xU=uS(),_U=Df(),T4=qf(),S4=yS(),wU=KS(),kU=Ml(),E4=ig(),SU=JS().strict,ic=Nl(),EU=mm(),AU=rE(),jU=hE().Querystring,TU=N8().Har,RU=Y8().Auth,PU=s4().OAuth,OU=c4(),CU=l4().Multipart,BU=h4().Redirect,Hg=_4().Tunnel,ac=k4(),Eu=As().Buffer,A4=ic.safeStringify,FU=ic.isReadStream,IU=ic.toBase64,MU=ic.defer,R4=ic.copy,LU=ic.version,P4=EU.jar(),O4={};function DU(e,r){var t={};for(var i in r){var a=e.indexOf(i)===-1;a&&(t[i]=r[i])}return t}function qU(e,r){var t={};for(var i in r){var a=e.indexOf(i)!==-1,n=typeof r[i]=="function";a&&n||(t[i]=r[i])}return t}function C4(){var e=this;return{uri:e.uri,method:e.method,headers:e.headers}}function zU(){var e=this;return{statusCode:e.statusCode,body:e.body,headers:e.headers,request:C4.call(e.request)}}function Sr(e){var r=this;e.har&&(r._har=new TU(r),e=r._har.options(e)),hp.Stream.call(r);var t=Object.keys(Sr.prototype),i=DU(t,e);kU(r,i),e=qU(t,e),r.readable=!0,r.writable=!0,e.method&&(r.explicitMethod=!0),r._qs=new jU(r),r._auth=new RU(r),r._oauth=new PU(r),r._multipart=new CU(r),r._redirect=new BU(r),r._tunnel=new Hg(r),r.init(e)}Ug.inherits(Sr,hp.Stream);Sr.debug=process.env.NODE_DEBUG&&/\brequest\b/.test(process.env.NODE_DEBUG);function zt(){Sr.debug&&console.error("REQUEST %s",Ug.format.apply(Ug,arguments))}Sr.prototype.debug=zt;Sr.prototype.init=function(e){var r=this;e||(e={}),r.headers=r.headers?R4(r.headers):{};for(var t in r.headers)typeof r.headers[t]>"u"&&delete r.headers[t];if(T4.httpify(r,r.headers),r.method||(r.method=e.method||"GET"),r.localAddress||(r.localAddress=e.localAddress),r._qs.init(e),zt(e),!r.pool&&r.pool!==!1&&(r.pool=O4),r.dests=r.dests||[],r.__isRequestRequest=!0,!r._callback&&r.callback&&(r._callback=r.callback,r.callback=function(){r._callbackCalled||(r._callbackCalled=!0,r._callback.apply(r,arguments))},r.on("error",r.callback.bind()),r.on("complete",r.callback.bind(r,null))),!r.uri&&r.url&&(r.uri=r.url,delete r.url),r.baseUrl){if(typeof r.baseUrl!="string")return r.emit("error",new Error("options.baseUrl must be a string"));if(typeof r.uri!="string")return r.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(r.uri.indexOf("//")===0||r.uri.indexOf("://")!==-1)return r.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var i=r.baseUrl.lastIndexOf("/")===r.baseUrl.length-1,a=r.uri.indexOf("/")===0;i&&a?r.uri=r.baseUrl+r.uri.slice(1):i||a?r.uri=r.baseUrl+r.uri:r.uri===""?r.uri=r.baseUrl:r.uri=r.baseUrl+"/"+r.uri,delete r.baseUrl}if(!r.uri)return r.emit("error",new Error("options.uri is a required argument"));if(typeof r.uri=="string"&&(r.uri=Su.parse(r.uri)),r.uri.href||(r.uri.href=Su.format(r.uri)),r.uri.protocol==="unix:")return r.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if(r.uri.host==="unix"&&r.enableUnixSocket(),r.strictSSL===!1&&(r.rejectUnauthorized=!1),r.uri.pathname||(r.uri.pathname="/"),!(r.uri.host||r.uri.hostname&&r.uri.port)&&!r.uri.isUnix){var n=Su.format(r.uri),o='Invalid URI "'+n+'"';return Object.keys(e).length===0&&(o+=". This can be caused by a crappy redirection."),r.abort(),r.emit("error",new Error(o))}if(r.hasOwnProperty("proxy")||(r.proxy=AU(r.uri)),r.tunnel=r._tunnel.isEnabled(),r.proxy&&r._tunnel.setup(e),r._redirect.onRequest(e),r.setHost=!1,!r.hasHeader("host")){var s=r.originalHostHeaderName||"host";r.setHeader(s,r.uri.host),r.uri.port&&(r.uri.port==="80"&&r.uri.protocol==="http:"||r.uri.port==="443"&&r.uri.protocol==="https:")&&r.setHeader(s,r.uri.hostname),r.setHost=!0}if(r.jar(r._jar||e.jar),r.uri.port||(r.uri.protocol==="http:"?r.uri.port=80:r.uri.protocol==="https:"&&(r.uri.port=443)),r.proxy&&!r.tunnel?(r.port=r.proxy.port,r.host=r.proxy.hostname):(r.port=r.uri.port,r.host=r.uri.hostname),e.form&&r.form(e.form),e.formData){var c=e.formData,u=r.form(),l=function(P,C){C&&C.hasOwnProperty("value")&&C.hasOwnProperty("options")?u.append(P,C.value,C.options):u.append(P,C)};for(var h in c)if(c.hasOwnProperty(h)){var p=c[h];if(p instanceof Array)for(var d=0;d<p.length;d++)l(h,p[d]);else l(h,p)}}if(e.qs&&r.qs(e.qs),r.uri.path?r.path=r.uri.path:r.path=r.uri.pathname+(r.uri.search||""),r.path.length===0&&(r.path="/"),e.aws&&r.aws(e.aws),e.hawk&&r.hawk(e.hawk),e.httpSignature&&r.httpSignature(e.httpSignature),e.auth&&(Object.prototype.hasOwnProperty.call(e.auth,"username")&&(e.auth.user=e.auth.username),Object.prototype.hasOwnProperty.call(e.auth,"password")&&(e.auth.pass=e.auth.password),r.auth(e.auth.user,e.auth.pass,e.auth.sendImmediately,e.auth.bearer)),r.gzip&&!r.hasHeader("accept-encoding")&&r.setHeader("accept-encoding","gzip, deflate"),r.uri.auth&&!r.hasHeader("authorization")){var v=r.uri.auth.split(":").map(function(P){return r._qs.unescape(P)});r.auth(v[0],v.slice(1).join(":"),!0)}if(!r.tunnel&&r.proxy&&r.proxy.auth&&!r.hasHeader("proxy-authorization")){var x=r.proxy.auth.split(":").map(function(P){return r._qs.unescape(P)}),y="Basic "+IU(x.join(":"));r.setHeader("proxy-authorization",y)}r.proxy&&!r.tunnel&&(r.path=r.uri.protocol+"//"+r.uri.host+r.path),e.json&&r.json(e.json),e.multipart&&r.multipart(e.multipart),e.time&&(r.timing=!0,r.elapsedTime=r.elapsedTime||0);function E(){if(SU(r.body)&&(r.body=Eu.from(r.body)),!r.hasHeader("content-length")){var P;typeof r.body=="string"?P=Eu.byteLength(r.body):Array.isArray(r.body)?P=r.body.reduce(function(C,I){return C+I.length},0):P=r.body.length,P?r.setHeader("content-length",P):r.emit("error",new Error("Argument error, options.body."))}}r.body&&!E4(r.body)&&E(),e.oauth?r.oauth(e.oauth):r._oauth.params&&r.hasHeader("authorization")&&r.oauth(r._oauth.params);var A=r.proxy&&!r.tunnel?r.proxy.protocol:r.uri.protocol,S={"http:":yU,"https:":j4},R=r.httpModules||{};if(r.httpModule=R[A]||S[A],!r.httpModule)return r.emit("error",new Error("Invalid protocol: "+A));if(e.ca&&(r.ca=e.ca),!r.agent)if(e.agentOptions&&(r.agentOptions=e.agentOptions),e.agentClass)r.agentClass=e.agentClass;else if(e.forever){var j=LU();j.major===0&&j.minor<=10?r.agentClass=A==="http:"?S4:S4.SSL:(r.agentClass=r.httpModule.Agent,r.agentOptions=r.agentOptions||{},r.agentOptions.keepAlive=!0)}else r.agentClass=r.httpModule.Agent;r.pool===!1?r.agent=!1:r.agent=r.agent||r.getNewAgent(),r.on("pipe",function(P){if(r.ntick&&r._started&&r.emit("error",new Error("You cannot pipe to this stream after the outbound request has started.")),r.src=P,FU(P))r.hasHeader("content-type")||r.setHeader("content-type",_U.lookup(P.path));else{if(P.headers)for(var C in P.headers)r.hasHeader(C)||r.setHeader(C,P.headers[C]);r._json&&!r.hasHeader("content-type")&&r.setHeader("content-type","application/json"),P.method&&!r.explicitMethod&&(r.method=P.method)}}),MU(function(){if(!r._aborted){var P=function(){if(r._form&&(r._auth.hasAuth?r._auth.hasAuth&&r._auth.sentAuth&&r._form.pipe(r):r._form.pipe(r)),r._multipart&&r._multipart.chunked&&r._multipart.body.pipe(r),r.body)E4(r.body)?r.body.pipe(r):(E(),Array.isArray(r.body)?r.body.forEach(function(C){r.write(C)}):r.write(r.body),r.end());else if(r.requestBodyStream)console.warn("options.requestBodyStream is deprecated, please pass the request object to stream.pipe."),r.requestBodyStream.pipe(r);else if(!r.src){if(r._auth.hasAuth&&!r._auth.sentAuth){r.end();return}r.method!=="GET"&&typeof r.method<"u"&&r.setHeader("content-length",0),r.end()}};r._form&&!r.hasHeader("content-length")?(r.setHeader(r._form.getHeaders(),!0),r._form.getLength(function(C,I){!C&&!isNaN(I)&&r.setHeader("content-length",I),P()})):P(),r.ntick=!0}})};Sr.prototype.getNewAgent=function(){var e=this,r=e.agentClass,t={};if(e.agentOptions)for(var i in e.agentOptions)t[i]=e.agentOptions[i];e.ca&&(t.ca=e.ca),e.ciphers&&(t.ciphers=e.ciphers),e.secureProtocol&&(t.secureProtocol=e.secureProtocol),e.secureOptions&&(t.secureOptions=e.secureOptions),typeof e.rejectUnauthorized<"u"&&(t.rejectUnauthorized=e.rejectUnauthorized),e.cert&&e.key&&(t.key=e.key,t.cert=e.cert),e.pfx&&(t.pfx=e.pfx),e.passphrase&&(t.passphrase=e.passphrase);var a="";r!==e.httpModule.Agent&&(a+=r.name);var n=e.proxy;typeof n=="string"&&(n=Su.parse(n));var o=n&&n.protocol==="https:"||this.uri.protocol==="https:";return o&&(t.ca&&(a&&(a+=":"),a+=t.ca),typeof t.rejectUnauthorized<"u"&&(a&&(a+=":"),a+=t.rejectUnauthorized),t.cert&&(a&&(a+=":"),a+=t.cert.toString("ascii")+t.key.toString("ascii")),t.pfx&&(a&&(a+=":"),a+=t.pfx.toString("ascii")),t.ciphers&&(a&&(a+=":"),a+=t.ciphers),t.secureProtocol&&(a&&(a+=":"),a+=t.secureProtocol),t.secureOptions&&(a&&(a+=":"),a+=t.secureOptions)),e.pool===O4&&!a&&Object.keys(t).length===0&&e.httpModule.globalAgent?e.httpModule.globalAgent:(a=e.uri.protocol+a,e.pool[a]||(e.pool[a]=new r(t),e.pool.maxSockets&&(e.pool[a].maxSockets=e.pool.maxSockets)),e.pool[a])};Sr.prototype.start=function(){var e=this;if(e.timing)var r=new Date().getTime(),t=ac();if(!e._aborted){e._started=!0,e.method=e.method||"GET",e.href=e.uri.href,e.src&&e.src.stat&&e.src.stat.size&&!e.hasHeader("content-length")&&e.setHeader("content-length",e.src.stat.size),e._aws&&e.aws(e._aws,!0);var i=R4(e);delete i.auth,zt("make request",e.uri.href),delete i.timeout;try{e.req=e.httpModule.request(i)}catch(n){e.emit("error",n);return}e.timing&&(e.startTime=r,e.startTimeNow=t,e.timings={});var a;e.timeout&&!e.timeoutTimer&&(e.timeout<0?a=0:typeof e.timeout=="number"&&isFinite(e.timeout)&&(a=e.timeout)),e.req.on("response",e.onRequestResponse.bind(e)),e.req.on("error",e.onRequestError.bind(e)),e.req.on("drain",function(){e.emit("drain")}),e.req.on("socket",function(n){var o=n._connecting||n.connecting;if(e.timing&&(e.timings.socket=ac()-e.startTimeNow,o)){var s=function(){e.timings.lookup=ac()-e.startTimeNow},c=function(){e.timings.connect=ac()-e.startTimeNow};n.once("lookup",s),n.once("connect",c),e.req.once("error",function(){n.removeListener("lookup",s),n.removeListener("connect",c)})}var u=function(){e.req.setTimeout(a,function(){if(e.req){e.abort();var h=new Error("ESOCKETTIMEDOUT");h.code="ESOCKETTIMEDOUT",h.connect=!1,e.emit("error",h)}})};if(a!==void 0)if(o){var l=function(){n.removeListener("connect",l),e.clearTimeout(),u()};n.on("connect",l),e.req.on("error",function(h){n.removeListener("connect",l)}),e.timeoutTimer=setTimeout(function(){n.removeListener("connect",l),e.abort();var h=new Error("ETIMEDOUT");h.code="ETIMEDOUT",h.connect=!0,e.emit("error",h)},a)}else u();e.emit("socket",n)}),e.emit("request",e.req)}};Sr.prototype.onRequestError=function(e){var r=this;if(!r._aborted){if(r.req&&r.req._reusedSocket&&e.code==="ECONNRESET"&&r.agent.addRequestNoreuse){r.agent={addRequest:r.agent.addRequestNoreuse.bind(r.agent)},r.start(),r.req.end();return}r.clearTimeout(),r.emit("error",e)}};Sr.prototype.onRequestResponse=function(e){var r=this;if(r.timing&&(r.timings.response=ac()-r.startTimeNow),zt("onRequestResponse",r.uri.href,e.statusCode,e.headers),e.on("end",function(){r.timing&&(r.timings.end=ac()-r.startTimeNow,e.timingStart=r.startTime,r.timings.socket||(r.timings.socket=0),r.timings.lookup||(r.timings.lookup=r.timings.socket),r.timings.connect||(r.timings.connect=r.timings.lookup),r.timings.response||(r.timings.response=r.timings.connect),zt("elapsed time",r.timings.end),r.elapsedTime+=Math.round(r.timings.end),e.elapsedTime=r.elapsedTime,e.timings=r.timings,e.timingPhases={wait:r.timings.socket,dns:r.timings.lookup-r.timings.socket,tcp:r.timings.connect-r.timings.lookup,firstByte:r.timings.response-r.timings.connect,download:r.timings.end-r.timings.response,total:r.timings.end}),zt("response end",r.uri.href,e.statusCode,e.headers)}),r._aborted){zt("aborted",r.uri.href),e.resume();return}if(r.response=e,e.request=r,e.toJSON=zU,r.httpModule===j4&&r.strictSSL&&(!e.hasOwnProperty("socket")||!e.socket.authorized)){zt("strict ssl error",r.uri.href);var t=e.hasOwnProperty("socket")?e.socket.authorizationError:r.uri.href+" does not support SSL";r.emit("error",new Error("SSL Error: "+t));return}r.originalHost=r.getHeader("host"),r.originalHostHeaderName||(r.originalHostHeaderName=r.hasHeader("host")),r.setHost&&r.removeHeader("host"),r.clearTimeout();var i=r._jar&&r._jar.setCookie?r._jar:P4,a=function(l){try{i.setCookie(l,r.uri.href,{ignoreError:!0})}catch(h){r.emit("error",h)}};if(e.caseless=T4(e.headers),e.caseless.has("set-cookie")&&!r._disableCookies){var n=e.caseless.has("set-cookie");Array.isArray(e.headers[n])?e.headers[n].forEach(a):a(e.headers[n])}if(!r._redirect.onResponse(e)){{e.on("close",function(){r._ended||r.response.emit("end")}),e.once("end",function(){r._ended=!0});var o=function(l){return r.method==="HEAD"||l>=100&&l<200||l===204||l===304},s;if(r.gzip&&!o(e.statusCode)){var c=e.headers["content-encoding"]||"identity";c=c.trim().toLowerCase();var u={flush:pp.Z_SYNC_FLUSH,finishFlush:pp.Z_SYNC_FLUSH};c==="gzip"?(s=pp.createGunzip(u),e.pipe(s)):c==="deflate"?(s=pp.createInflate(u),e.pipe(s)):(c!=="identity"&&zt("ignoring unrecognized Content-Encoding "+c),s=e)}else s=e;r.encoding&&(r.dests.length!==0?console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid."):s.setEncoding(r.encoding)),r._paused&&s.pause(),r.responseContent=s,r.emit("response",e),r.dests.forEach(function(l){r.pipeDest(l)}),s.on("data",function(l){r.timing&&!r.responseStarted&&(r.responseStartTime=new Date().getTime(),e.responseStartTime=r.responseStartTime),r._destdata=!0,r.emit("data",l)}),s.once("end",function(l){r.emit("end",l)}),s.on("error",function(l){r.emit("error",l)}),s.on("close",function(){r.emit("close")}),r.callback?r.readResponseBody(e):r.on("end",function(){if(r._aborted){zt("aborted",r.uri.href);return}r.emit("complete",e)})}zt("finish init function",r.uri.href)}};Sr.prototype.readResponseBody=function(e){var r=this;zt("reading response's body");var t=[],i=0,a=[];r.on("data",function(n){Eu.isBuffer(n)?n.length&&(i+=n.length,t.push(n)):a.push(n)}),r.on("end",function(){if(zt("end event",r.uri.href),r._aborted){zt("aborted",r.uri.href),t=[],i=0;return}if(i?(zt("has body",r.uri.href,i),e.body=Eu.concat(t,i),r.encoding!==null&&(e.body=e.body.toString(r.encoding)),t=[],i=0):a.length&&(r.encoding==="utf8"&&a[0].length>0&&a[0][0]==="\uFEFF"&&(a[0]=a[0].substring(1)),e.body=a.join("")),r._json)try{e.body=JSON.parse(e.body,r._jsonReviver)}catch{zt("invalid JSON received",r.uri.href)}zt("emitting complete",r.uri.href),typeof e.body>"u"&&!r._json&&(e.body=r.encoding===null?Eu.alloc(0):""),r.emit("complete",e,e.body)})};Sr.prototype.abort=function(){var e=this;e._aborted=!0,e.req?e.req.abort():e.response&&e.response.destroy(),e.clearTimeout(),e.emit("abort")};Sr.prototype.pipeDest=function(e){var r=this,t=r.response;if(e.headers&&!e.headersSent){if(t.caseless.has("content-type")){var i=t.caseless.has("content-type");e.setHeader?e.setHeader(i,t.headers[i]):e.headers[i]=t.headers[i]}if(t.caseless.has("content-length")){var a=t.caseless.has("content-length");e.setHeader?e.setHeader(a,t.headers[a]):e.headers[a]=t.headers[a]}}if(e.setHeader&&!e.headersSent){for(var n in t.headers)(!r.gzip||n!=="content-encoding")&&e.setHeader(n,t.headers[n]);e.statusCode=t.statusCode}r.pipefilter&&r.pipefilter(t,e)};Sr.prototype.qs=function(e,r){var t=this,i;!r&&t.uri.query?i=t._qs.parse(t.uri.query):i={};for(var a in e)i[a]=e[a];var n=t._qs.stringify(i);return n===""||(t.uri=Su.parse(t.uri.href.split("?")[0]+"?"+n),t.url=t.uri,t.path=t.uri.path,t.uri.host==="unix"&&t.enableUnixSocket()),t};Sr.prototype.form=function(e){var r=this;return e?(/^application\/x-www-form-urlencoded\b/.test(r.getHeader("content-type"))||r.setHeader("content-type","application/x-www-form-urlencoded"),r.body=typeof e=="string"?r._qs.rfc3986(e.toString("utf8")):r._qs.stringify(e).toString("utf8"),r):(r._form=new wU,r._form.on("error",function(t){t.message="form-data: "+t.message,r.emit("error",t),r.abort()}),r._form)};Sr.prototype.multipart=function(e){var r=this;return r._multipart.onRequest(e),r._multipart.chunked||(r.body=r._multipart.body),r};Sr.prototype.json=function(e){var r=this;return r.hasHeader("accept")||r.setHeader("accept","application/json"),typeof r.jsonReplacer=="function"&&(r._jsonReplacer=r.jsonReplacer),r._json=!0,typeof e=="boolean"?r.body!==void 0&&(/^application\/x-www-form-urlencoded\b/.test(r.getHeader("content-type"))?r.body=r._qs.rfc3986(r.body):r.body=A4(r.body,r._jsonReplacer),r.hasHeader("content-type")||r.setHeader("content-type","application/json")):(r.body=A4(e,r._jsonReplacer),r.hasHeader("content-type")||r.setHeader("content-type","application/json")),typeof r.jsonReviver=="function"&&(r._jsonReviver=r.jsonReviver),r};Sr.prototype.getHeader=function(e,r){var t=this,i,a,n;return r||(r=t.headers),Object.keys(r).forEach(function(o){o.length===e.length&&(a=new RegExp(e,"i"),n=o.match(a),n&&(i=r[o]))}),i};Sr.prototype.enableUnixSocket=function(){var e=this.uri.path.split(":"),r=e[0],t=e[1];this.socketPath=r,this.uri.pathname=t,this.uri.path=t,this.uri.host=r,this.uri.hostname=r,this.uri.isUnix=!0};Sr.prototype.auth=function(e,r,t,i){var a=this;return a._auth.onRequest(e,r,t,i),a};Sr.prototype.aws=function(e,r){var t=this;if(!r)return t._aws=e,t;if(e.sign_version===4||e.sign_version==="4"){var i={host:t.uri.host,path:t.uri.path,method:t.method,headers:t.headers,body:t.body};e.service&&(i.service=e.service);var a=bU.sign(i,{accessKeyId:e.key,secretAccessKey:e.secret,sessionToken:e.session});t.setHeader("authorization",a.headers.Authorization),t.setHeader("x-amz-date",a.headers["X-Amz-Date"]),a.headers["X-Amz-Security-Token"]&&t.setHeader("x-amz-security-token",a.headers["X-Amz-Security-Token"])}else{var n=new Date;t.setHeader("date",n.toUTCString());var o={key:e.key,secret:e.secret,verb:t.method.toUpperCase(),date:n,contentType:t.getHeader("content-type")||"",md5:t.getHeader("content-md5")||"",amazonHeaders:Ng.canonicalizeHeaders(t.headers)},s=t.uri.path;e.bucket&&s?o.resource="/"+e.bucket+s:e.bucket&&!s?o.resource="/"+e.bucket:!e.bucket&&s?o.resource=s:!e.bucket&&!s&&(o.resource="/"),o.resource=Ng.canonicalizeResource(o.resource),t.setHeader("authorization",Ng.authorization(o))}return t};Sr.prototype.httpSignature=function(e){var r=this;return xU.signRequest({getHeader:function(t){return r.getHeader(t,r.headers)},setHeader:function(t,i){r.setHeader(t,i)},method:r.method,path:r.path},e),zt("httpSignature authorization",r.getHeader("authorization")),r};Sr.prototype.hawk=function(e){var r=this;r.setHeader("Authorization",OU.header(r.uri,r.method,e))};Sr.prototype.oauth=function(e){var r=this;return r._oauth.onRequest(e),r};Sr.prototype.jar=function(e){var r=this,t;if(r._redirect.redirectsFollowed===0&&(r.originalCookieHeader=r.getHeader("cookie")),!e)t=!1,r._disableCookies=!0;else{var i=e.getCookieString?e:P4,a=r.uri.href;i&&(t=i.getCookieString(a))}return t&&t.length&&(r.originalCookieHeader?r.setHeader("cookie",r.originalCookieHeader+"; "+t):r.setHeader("cookie",t)),r._jar=e,r};Sr.prototype.pipe=function(e,r){var t=this;if(t.response)if(t._destdata)t.emit("error",new Error("You cannot pipe after data has been emitted from the response."));else if(t._ended)t.emit("error",new Error("You cannot pipe after the response has been ended."));else return hp.Stream.prototype.pipe.call(t,e,r),t.pipeDest(e),e;else return t.dests.push(e),hp.Stream.prototype.pipe.call(t,e,r),e};Sr.prototype.write=function(){var e=this;if(!e._aborted&&(e._started||e.start(),e.req))return e.req.write.apply(e.req,arguments)};Sr.prototype.end=function(e){var r=this;r._aborted||(e&&r.write(e),r._started||r.start(),r.req&&r.req.end())};Sr.prototype.pause=function(){var e=this;e.responseContent?e.responseContent.pause.apply(e.responseContent,arguments):e._paused=!0};Sr.prototype.resume=function(){var e=this;e.responseContent?e.responseContent.resume.apply(e.responseContent,arguments):e._paused=!1};Sr.prototype.destroy=function(){var e=this;this.clearTimeout(),e._ended?e.response&&e.response.destroy():e.end()};Sr.prototype.clearTimeout=function(){this.timeoutTimer&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)};Sr.defaultProxyHeaderWhiteList=Hg.defaultProxyHeaderWhiteList.slice();Sr.defaultProxyHeaderExclusiveList=Hg.defaultProxyHeaderExclusiveList.slice();Sr.prototype.toJSON=C4;B4.exports=Sr});var L4=B((bee,M4)=>{"use strict";var Au=Ml(),I4=mm(),NU=Nl(),UU=NU.paramsHaveRequestBody;function dp(e,r,t){typeof r=="function"&&(t=r);var i={};return r!==null&&typeof r=="object"?Au(i,r,{uri:e}):typeof e=="string"?Au(i,{uri:e}):Au(i,e),i.callback=t||i.callback,i}function dt(e,r,t){if(typeof e>"u")throw new Error("undefined is not a valid uri or options object.");var i=dp(e,r,t);if(i.method==="HEAD"&&UU(i))throw new Error("HTTP HEAD requests MUST NOT include a request body.");return new dt.Request(i)}function fo(e){var r=e.toUpperCase();return function(t,i,a){var n=dp(t,i,a);return n.method=r,dt(n,n.callback)}}dt.get=fo("get");dt.head=fo("head");dt.options=fo("options");dt.post=fo("post");dt.put=fo("put");dt.patch=fo("patch");dt.del=fo("delete");dt.delete=fo("delete");dt.jar=function(e){return I4.jar(e)};dt.cookie=function(e){return I4.parse(e)};function Vg(e,r,t,i){return function(a,n,o){var s=dp(a,n,o),c={};return Au(!0,c,r,s),c.pool=s.pool||r.pool,i&&(c.method=i.toUpperCase()),typeof t=="function"&&(e=t),e(c,c.callback)}}dt.defaults=function(e,r){var t=this;e=e||{},typeof e=="function"&&(r=e,e={});var i=Vg(t,e,r),a=["get","head","post","put","patch","del","delete"];return a.forEach(function(n){i[n]=Vg(t[n],e,r,n)}),i.cookie=Vg(t.cookie,e,r),i.jar=t.jar,i.defaults=t.defaults,i};dt.forever=function(e,r){var t={};return r&&Au(t,r),e&&(t.agentOptions=e),t.forever=!0,dt.defaults(t)};M4.exports=dt;dt.Request=F4();dt.initParams=dp;Object.defineProperty(dt,"debug",{enumerable:!0,get:function(){return dt.Request.debug},set:function(e){dt.Request.debug=e}})});var q4=B((xee,D4)=>{D4.exports=HU;function HU(e){if(!/^data\:/i.test(e))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');e=e.replace(/\r?\n/g,"");var r=e.indexOf(",");if(r===-1||r<=4)throw new TypeError("malformed data: URI");for(var t=e.substring(5,r).split(";"),i=!1,a="US-ASCII",n=0;n<t.length;n++)t[n]=="base64"?i=!0:t[n].indexOf("charset=")==0&&(a=t[n].substring(8));var o=unescape(e.substring(r+1)),s=i?"base64":"ascii",c=new Buffer(o,s);return c.type=t[0]||"text/plain",c.charset=a,c}});var U4=B((_ee,N4)=>{var VU=q4();function GU(e){return{mimeType:$U(KU(e)),data:VU(e)}}function KU(e){return e.substring(5,e.indexOf(";"))}var z4=/^(\w+\/)+/;function $U(e){e=e.toLowerCase();var r=e.match(z4);return!r||!(r=r[1])?e:e.replace(z4,r)}N4.exports=GU});var V4=B((kee,H4)=>{"use strict";var ju=Cc(),wee=require("path"),WU=c2().PNG,XU=wd(),YU=h2(),QU=m2().GifReader,JU=x2(),ZU=require("fs"),eH=L4(),rH=Df(),tH=U4();function aH(e,r){var t=new WU;t.parse(e,function(i,a){if(i){r(i);return}r(null,ju(new Uint8Array(a.data),[a.width|0,a.height|0,4],[4,4*a.width|0,1],0))})}function iH(e,r){var t;try{t=XU.decode(e)}catch(n){r(n);return}if(!t){r(new Error("Error decoding jpeg"));return}var i=[t.height,t.width,4],a=ju(t.data,i);r(null,a.transpose(1,0))}function nH(e,r){var t;try{t=new QU(e)}catch(s){r(s);return}if(t.numFrames()>0){var i=[t.numFrames(),t.height,t.width,4];try{var a=new Uint8Array(i[0]*i[1]*i[2]*i[3])}catch(s){r(s);return}var n=ju(a,i);try{for(var o=0;o<t.numFrames();++o)t.decodeAndBlitFrameRGBA(o,a.subarray(n.index(o,0,0,0),n.index(o+1,0,0,0)))}catch(s){r(s);return}r(null,n.transpose(0,2,1))}else{var i=[t.height,t.width,4],a=new Uint8Array(i[0]*i[1]*i[2]),n=ju(a,i);try{t.decodeAndBlitFrameRGBA(0,a)}catch(l){r(l);return}r(null,n.transpose(1,0))}}function oH(e,r){var t=new JU(e);try{t.init()}catch(s){r(s);return}var i=t.getData(),a=[i.getHeight(),i.getWidth(),4],n=new Uint8Array(a[0]*a[1]*a[2]),o=ju(n,a);YU(i,o),r(null,o.transpose(1,0))}function mp(e,r,t){switch(e){case"image/png":aH(r,t);break;case"image/jpg":case"image/jpeg":iH(r,t);break;case"image/gif":nH(r,t);break;case"image/bmp":oH(r,t);break;default:t(new Error("Unsupported file type: "+e))}}H4.exports=function(r,t,i){if(i||(i=t,t=""),Buffer.isBuffer(r)){if(!t){i(new Error("Invalid file type"));return}mp(t,r,i)}else if(r.indexOf("data:")===0)try{var a=tH(r);a?process.nextTick(function(){mp(t||a.mimeType,a.data,i)}):process.nextTick(function(){i(new Error("Error parsing data URI"))})}catch(n){process.nextTick(function(){i(n)})}else r.indexOf("http://")===0||r.indexOf("https://")===0?eH({url:r,encoding:null},function(n,o,s){if(n){i(n);return}if(t=t,t||(o.getHeader!==void 0?t=o.getHeader("content-type"):o.headers!==void 0&&(t=o.headers["content-type"])),!t){i(new Error("Invalid content-type"));return}mp(t,s,i)}):ZU.readFile(r,function(n,o){if(n){i(n);return}if(t=t||rH.lookup(r),!t){i(new Error("Invalid file type"));return}mp(t,o,i)})}});var oy=typeof process!="object"||String(process)!=="[object process]"||process.browser;var sy={ibm866:[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,9617,9618,9619,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9561,9560,9554,9555,9579,9578,9496,9484,9608,9604,9612,9616,9600,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1025,1105,1028,1108,1031,1111,1038,1118,176,8729,183,8730,8470,164,9632,160],"iso-8859-2":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,728,321,164,317,346,167,168,352,350,356,377,173,381,379,176,261,731,322,180,318,347,711,184,353,351,357,378,733,382,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"iso-8859-3":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,294,728,163,164,null,292,167,168,304,350,286,308,173,null,379,176,295,178,179,180,181,293,183,184,305,351,287,309,189,null,380,192,193,194,null,196,266,264,199,200,201,202,203,204,205,206,207,null,209,210,211,212,288,214,215,284,217,218,219,220,364,348,223,224,225,226,null,228,267,265,231,232,233,234,235,236,237,238,239,null,241,242,243,244,289,246,247,285,249,250,251,252,365,349,729],"iso-8859-4":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,312,342,164,296,315,167,168,352,274,290,358,173,381,175,176,261,731,343,180,297,316,711,184,353,275,291,359,330,382,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,298,272,325,332,310,212,213,214,215,216,370,218,219,220,360,362,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,299,273,326,333,311,244,245,246,247,248,371,250,251,252,361,363,729],"iso-8859-5":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,173,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8470,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,167,1118,1119],"iso-8859-6":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,null,null,164,null,null,null,null,null,null,null,1548,173,null,null,null,null,null,null,null,null,null,null,null,null,null,1563,null,null,null,1567,null,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,null,null,null,null,null,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,null,null,null,null,null,null,null,null,null,null,null,null,null],"iso-8859-7":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8216,8217,163,8364,8367,166,167,168,169,890,171,172,173,null,8213,176,177,178,179,900,901,902,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"iso-8859-8":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,162,163,164,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8215,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"iso-8859-10":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,274,290,298,296,310,167,315,272,352,358,381,173,362,330,176,261,275,291,299,297,311,183,316,273,353,359,382,8213,363,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,207,208,325,332,211,212,213,214,360,216,370,218,219,220,221,222,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,239,240,326,333,243,244,245,246,361,248,371,250,251,252,253,254,312],"iso-8859-13":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8221,162,163,164,8222,166,167,216,169,342,171,172,173,174,198,176,177,178,179,8220,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,8217],"iso-8859-14":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,7682,7683,163,266,267,7690,167,7808,169,7810,7691,7922,173,174,376,7710,7711,288,289,7744,7745,182,7766,7809,7767,7811,7776,7923,7812,7813,7777,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,372,209,210,211,212,213,214,7786,216,217,218,219,220,221,374,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,373,241,242,243,244,245,246,7787,248,249,250,251,252,253,375,255],"iso-8859-15":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,8364,165,352,167,353,169,170,171,172,173,174,175,176,177,178,179,381,181,182,183,382,185,186,187,338,339,376,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"iso-8859-16":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,261,321,8364,8222,352,167,353,169,536,171,377,173,378,379,176,177,268,322,381,8221,182,183,382,269,537,187,338,339,376,380,192,193,194,258,196,262,198,199,200,201,202,203,204,205,206,207,272,323,210,211,212,336,214,346,368,217,218,219,220,280,538,223,224,225,226,259,228,263,230,231,232,233,234,235,236,237,238,239,273,324,242,243,244,337,246,347,369,249,250,251,252,281,539,255],"koi8-r":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,1025,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],"koi8-u":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,1108,9556,1110,1111,9559,9560,9561,9562,9563,1169,1118,9566,9567,9568,9569,1025,1028,9571,1030,1031,9574,9575,9576,9577,9578,1168,1038,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],macintosh:[196,197,199,201,209,214,220,225,224,226,228,227,229,231,233,232,234,235,237,236,238,239,241,243,242,244,246,245,250,249,251,252,8224,176,162,163,167,8226,182,223,174,169,8482,180,168,8800,198,216,8734,177,8804,8805,165,181,8706,8721,8719,960,8747,170,186,937,230,248,191,161,172,8730,402,8776,8710,171,187,8230,160,192,195,213,338,339,8211,8212,8220,8221,8216,8217,247,9674,255,376,8260,8364,8249,8250,64257,64258,8225,183,8218,8222,8240,194,202,193,203,200,205,206,207,204,211,212,63743,210,218,219,217,305,710,732,175,728,729,730,184,733,731,711],"windows-874":[8364,129,130,131,132,8230,134,135,136,137,138,139,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,153,154,155,156,157,158,159,160,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,null,null,null,null,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,null,null,null,null],"windows-1250":[8364,129,8218,131,8222,8230,8224,8225,136,8240,352,8249,346,356,381,377,144,8216,8217,8220,8221,8226,8211,8212,152,8482,353,8250,347,357,382,378,160,711,728,321,164,260,166,167,168,169,350,171,172,173,174,379,176,177,731,322,180,181,182,183,184,261,351,187,317,733,318,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"windows-1251":[1026,1027,8218,1107,8222,8230,8224,8225,8364,8240,1033,8249,1034,1036,1035,1039,1106,8216,8217,8220,8221,8226,8211,8212,152,8482,1113,8250,1114,1116,1115,1119,160,1038,1118,1032,164,1168,166,167,1025,169,1028,171,172,173,174,1031,176,177,1030,1110,1169,181,182,183,1105,8470,1108,187,1112,1029,1109,1111,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103],"windows-1252":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"windows-1253":[8364,129,8218,402,8222,8230,8224,8225,136,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,157,158,159,160,901,902,163,164,165,166,167,168,169,null,171,172,173,174,8213,176,177,178,179,900,181,182,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"windows-1254":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,286,209,210,211,212,213,214,215,216,217,218,219,220,304,350,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,287,241,242,243,244,245,246,247,248,249,250,251,252,305,351,255],"windows-1255":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,156,157,158,159,160,161,162,163,8362,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,191,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1520,1521,1522,1523,1524,null,null,null,null,null,null,null,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"windows-1256":[8364,1662,8218,402,8222,8230,8224,8225,710,8240,1657,8249,338,1670,1688,1672,1711,8216,8217,8220,8221,8226,8211,8212,1705,8482,1681,8250,339,8204,8205,1722,160,1548,162,163,164,165,166,167,168,169,1726,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,1563,187,188,189,190,1567,1729,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,215,1591,1592,1593,1594,1600,1601,1602,1603,224,1604,226,1605,1606,1607,1608,231,232,233,234,235,1609,1610,238,239,1611,1612,1613,1614,244,1615,1616,247,1617,249,1618,251,252,8206,8207,1746],"windows-1257":[8364,129,8218,131,8222,8230,8224,8225,136,8240,138,8249,140,168,711,184,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,175,731,159,160,null,162,163,164,null,166,167,216,169,342,171,172,173,174,198,176,177,178,179,180,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,729],"windows-1258":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,258,196,197,198,199,200,201,202,203,768,205,206,207,272,209,777,211,212,416,214,215,216,217,218,219,220,431,771,223,224,225,226,259,228,229,230,231,232,233,234,235,769,237,238,239,273,241,803,243,244,417,246,247,248,249,250,251,252,432,8363,255],"x-mac-cyrillic":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,8224,176,1168,163,167,8226,182,1030,174,169,8482,1026,1106,8800,1027,1107,8734,177,8804,8805,1110,181,1169,1032,1028,1108,1031,1111,1033,1113,1034,1114,1112,1029,172,8730,402,8776,8710,171,187,8230,160,1035,1115,1036,1116,1109,8211,8212,8220,8221,8216,8217,247,8222,1038,1118,1039,1119,8470,1025,1105,1103,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,8364]};globalThis["encoding-indexes"]=sy||{};function hr(e,r,t){return r<=e&&e<=t}function iR(e,r){return e.indexOf(r)!==-1}var cn=Math.floor;function xl(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function nR(e){for(var r=String(e),t=r.length,i=0,a=[];i<t;){var n=r.charCodeAt(i);if(n<55296||n>57343)a.push(n);else if(56320<=n&&n<=57343)a.push(65533);else if(55296<=n&&n<=56319)if(i===t-1)a.push(65533);else{var o=r.charCodeAt(i+1);if(56320<=o&&o<=57343){var s=n&1023,c=o&1023;a.push(65536+(s<<10)+c),i+=1}else a.push(65533)}i+=1}return a}function oR(e){for(var r="",t=0;t<e.length;++t){var i=e[t];i<=65535?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode((i>>10)+55296,(i&1023)+56320))}return r}function za(e){return 0<=e&&e<=127}var qa=za,jr=-1;function zh(e){this.tokens=[].slice.call(e),this.tokens.reverse()}zh.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():jr},prepend:function(e){if(Array.isArray(e))for(var r=e;r.length;)this.tokens.push(r.pop());else this.tokens.push(e)},push:function(e){if(Array.isArray(e))for(var r=e;r.length;)this.tokens.unshift(r.shift());else this.tokens.unshift(e)}};var Hr=-1;function Ar(e,r){if(e)throw TypeError("Decoder error");return r||65533}function oi(e){throw TypeError("The code point "+e+" could not be encoded.")}function sR(){}sR.prototype={handler:function(e,r){}};function cR(){}cR.prototype={handler:function(e,r){}};function Dh(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(qh,e)?qh[e]:null}var cy=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],qh={};cy.forEach(function(e){e.encodings.forEach(function(r){r.labels.forEach(function(t){qh[t]=r})})});var ma={},ga={};function hs(e,r){return r&&r[e]||null}function ds(e,r){var t=r.indexOf(e);return t===-1?null:t}function sa(e){if(!("encoding-indexes"in globalThis))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return globalThis["encoding-indexes"][e]}function uR(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var r=0,t=0,i=sa("gb18030-ranges"),a;for(a=0;a<i.length;++a){var n=i[a];if(n[0]<=e)r=n[0],t=n[1];else break}return t+e-r}function lR(e){if(e===59335)return 7457;var r=0,t=0,i=sa("gb18030-ranges"),a;for(a=0;a<i.length;++a){var n=i[a];if(n[1]<=e)r=n[1],t=n[0];else break}return t+e-r}function fR(e){Mh=Mh||sa("jis0208").map(function(t,i){return hr(i,8272,8835)?null:t});var r=Mh;return r.indexOf(e)}var Mh;function pR(e){Lh=Lh||sa("big5").map(function(t,i){return i<(161-129)*157?null:t});var r=Lh;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?r.lastIndexOf(e):ds(e,r)}var Lh,uy="utf-8";function wo(e,r){if(!(this instanceof wo))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):uy,r=xl(r),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var t=Dh(e);if(t===null||t.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!ga[t.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var i=this;return i._encoding=t,Boolean(r.fatal)&&(i._error_mode="fatal"),Boolean(r.ignoreBOM)&&(i._ignoreBOM=!0),Object.defineProperty||(this.encoding=i._encoding.name.toLowerCase(),this.fatal=i._error_mode==="fatal",this.ignoreBOM=i._ignoreBOM),i}Object.defineProperty&&(Object.defineProperty(wo.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(wo.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(wo.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));wo.prototype.decode=function(r,t){var i;typeof r=="object"&&r instanceof ArrayBuffer?i=new Uint8Array(r):typeof r=="object"&&"buffer"in r&&r.buffer instanceof ArrayBuffer?i=new Uint8Array(r.buffer,r.byteOffset,r.byteLength):i=new Uint8Array(0),t=xl(t),this._do_not_flush||(this._decoder=ga[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(t.stream);for(var a=new zh(i),n=[],o;;){var s=a.read();if(s===jr||(o=this._decoder.handler(a,s),o===Hr))break;o!==null&&(Array.isArray(o)?n.push.apply(n,o):n.push(o))}if(!this._do_not_flush){do{if(o=this._decoder.handler(a,a.read()),o===Hr)break;o!==null&&(Array.isArray(o)?n.push.apply(n,o):n.push(o))}while(!a.endOfStream());this._decoder=null}function c(u){return iR(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(u.length>0&&u[0]===65279?(this._BOMseen=!0,u.shift()):u.length>0&&(this._BOMseen=!0)),oR(u)}return c.call(this,n)};function Sc(e,r){if(!(this instanceof Sc))throw TypeError("Called as a function. Did you forget 'new'?");r=xl(r),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(r.fatal)?"fatal":"replacement";var t=this;if(Boolean(r.NONSTANDARD_allowLegacyEncoding)){e=e!==void 0?String(e):uy;var i=Dh(e);if(i===null||i.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!ma[i.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");t._encoding=i}else t._encoding=Dh("utf-8"),e!==void 0&&"console"in globalThis&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=t._encoding.name.toLowerCase()),t}Object.defineProperty&&Object.defineProperty(Sc.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});Sc.prototype.encode=function(r,t){r=r===void 0?"":String(r),t=xl(t),this._do_not_flush||(this._encoder=ma[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(t.stream);for(var i=new zh(nR(r)),a=[],n;;){var o=i.read();if(o===jr||(n=this._encoder.handler(i,o),n===Hr))break;Array.isArray(n)?a.push.apply(a,n):a.push(n)}if(!this._do_not_flush){for(;n=this._encoder.handler(i,i.read()),n!==Hr;)Array.isArray(n)?a.push.apply(a,n):a.push(n);this._encoder=null}return new Uint8Array(a)};function hR(e){var r=e.fatal,t=0,i=0,a=0,n=128,o=191;this.handler=function(s,c){if(c===jr&&a!==0)return a=0,Ar(r);if(c===jr)return Hr;if(a===0){if(hr(c,0,127))return c;if(hr(c,194,223))a=1,t=c&31;else if(hr(c,224,239))c===224&&(n=160),c===237&&(o=159),a=2,t=c&15;else if(hr(c,240,244))c===240&&(n=144),c===244&&(o=143),a=3,t=c&7;else return Ar(r);return null}if(!hr(c,n,o))return t=a=i=0,n=128,o=191,s.prepend(c),Ar(r);if(n=128,o=191,t=t<<6|c&63,i+=1,i!==a)return null;var u=t;return t=a=i=0,u}}function dR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i))return i;var a,n;hr(i,128,2047)?(a=1,n=192):hr(i,2048,65535)?(a=2,n=224):hr(i,65536,1114111)&&(a=3,n=240);for(var o=[(i>>6*a)+n];a>0;){var s=i>>6*(a-1);o.push(128|s&63),a-=1}return o}}ma["UTF-8"]=function(e){return new dR(e)};ga["UTF-8"]=function(e){return new hR(e)};function mR(e,r){var t=r.fatal;this.handler=function(i,a){if(a===jr)return Hr;if(za(a))return a;var n=e[a-128];return n===null?Ar(t):n}}function gR(e,r){var t=r.fatal;this.handler=function(i,a){if(a===jr)return Hr;if(qa(a))return a;var n=ds(a,e);return n===null&&oi(a),n+128}}(function(){"encoding-indexes"in globalThis&&cy.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(r){var t=r.name,i=sa(t.toLowerCase());ga[t]=function(a){return new mR(i,a)},ma[t]=function(a){return new gR(i,a)}})})})();ga.GBK=function(e){return new ly(e)};ma.GBK=function(e){return new fy(e,!0)};function ly(e){var r=e.fatal,t=0,i=0,a=0;this.handler=function(n,o){if(o===jr&&t===0&&i===0&&a===0)return Hr;o===jr&&(t!==0||i!==0||a!==0)&&(t=0,i=0,a=0,Ar(r));var s;if(a!==0){s=null,hr(o,48,57)&&(s=uR((((t-129)*10+i-48)*126+a-129)*10+o-48));var c=[i,a,o];return t=0,i=0,a=0,s===null?(n.prepend(c),Ar(r)):s}if(i!==0)return hr(o,129,254)?(a=o,null):(n.prepend([i,o]),t=0,i=0,Ar(r));if(t!==0){if(hr(o,48,57))return i=o,null;var u=t,l=null;t=0;var h=o<127?64:65;return(hr(o,64,126)||hr(o,128,254))&&(l=(u-129)*190+(o-h)),s=l===null?null:hs(l,sa("gb18030")),s===null&&za(o)&&n.prepend(o),s===null?Ar(r):s}return za(o)?o:o===128?8364:hr(o,129,254)?(t=o,null):Ar(r)}}function fy(e,r){var t=e.fatal;this.handler=function(i,a){if(a===jr)return Hr;if(qa(a))return a;if(a===58853)return oi(a);if(r&&a===8364)return 128;var n=ds(a,sa("gb18030"));if(n!==null){var o=cn(n/190)+129,s=n%190,c=s<63?64:65;return[o,s+c]}if(r)return oi(a);n=lR(a);var u=cn(n/10/126/10);n=n-u*10*126*10;var l=cn(n/10/126);n=n-l*10*126;var h=cn(n/10),p=n-h*10;return[u+129,l+48,h+129,p+48]}}ma.gb18030=function(e){return new fy(e)};ga.gb18030=function(e){return new ly(e)};function vR(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===jr&&t!==0)return t=0,Ar(r);if(a===jr&&t===0)return Hr;if(t!==0){var n=t,o=null;t=0;var s=a<127?64:98;switch((hr(a,64,126)||hr(a,161,254))&&(o=(n-129)*157+(a-s)),o){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var c=o===null?null:hs(o,sa("big5"));return c===null&&za(a)&&i.prepend(a),c===null?Ar(r):c}return za(a)?a:hr(a,129,254)?(t=a,null):Ar(r)}}function yR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i))return i;var a=pR(i);if(a===null)return oi(i);var n=cn(a/157)+129;if(n<161)return oi(i);var o=a%157,s=o<63?64:98;return[n,o+s]}}ma.Big5=function(e){return new yR(e)};ga.Big5=function(e){return new vR(e)};function bR(e){var r=e.fatal,t=!1,i=0;this.handler=function(a,n){if(n===jr&&i!==0)return i=0,Ar(r);if(n===jr&&i===0)return Hr;if(i===142&&hr(n,161,223))return i=0,65377-161+n;if(i===143&&hr(n,161,254))return t=!0,i=n,null;if(i!==0){var o=i;i=0;var s=null;return hr(o,161,254)&&hr(n,161,254)&&(s=hs((o-161)*94+(n-161),sa(t?"jis0212":"jis0208"))),t=!1,hr(n,161,254)||a.prepend(n),s===null?Ar(r):s}return za(n)?n:n===142||n===143||hr(n,161,254)?(i=n,null):Ar(r)}}function xR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i))return i;if(i===165)return 92;if(i===8254)return 126;if(hr(i,65377,65439))return[142,i-65377+161];i===8722&&(i=65293);var a=ds(i,sa("jis0208"));if(a===null)return oi(i);var n=cn(a/94)+161,o=a%94+161;return[n,o]}}ma["EUC-JP"]=function(e){return new xR(e)};ga["EUC-JP"]=function(e){return new bR(e)};function _R(e){var r=e.fatal,t={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},i=t.ASCII,a=t.ASCII,n=0,o=!1;this.handler=function(s,c){switch(i){default:case t.ASCII:return c===27?(i=t.EscapeStart,null):hr(c,0,127)&&c!==14&&c!==15&&c!==27?(o=!1,c):c===jr?Hr:(o=!1,Ar(r));case t.Roman:return c===27?(i=t.EscapeStart,null):c===92?(o=!1,165):c===126?(o=!1,8254):hr(c,0,127)&&c!==14&&c!==15&&c!==27&&c!==92&&c!==126?(o=!1,c):c===jr?Hr:(o=!1,Ar(r));case t.Katakana:return c===27?(i=t.EscapeStart,null):hr(c,33,95)?(o=!1,65377-33+c):c===jr?Hr:(o=!1,Ar(r));case t.LeadByte:return c===27?(i=t.EscapeStart,null):hr(c,33,126)?(o=!1,n=c,i=t.TrailByte,null):c===jr?Hr:(o=!1,Ar(r));case t.TrailByte:if(c===27)return i=t.EscapeStart,Ar(r);if(hr(c,33,126)){i=t.LeadByte;var u=(n-33)*94+c-33,l=hs(u,sa("jis0208"));return l===null?Ar(r):l}return c===jr?(i=t.LeadByte,s.prepend(c),Ar(r)):(i=t.LeadByte,Ar(r));case t.EscapeStart:return c===36||c===40?(n=c,i=t.Escape,null):(s.prepend(c),o=!1,i=a,Ar(r));case t.Escape:var h=n;n=0;var p=null;if(h===40&&c===66&&(p=t.ASCII),h===40&&c===74&&(p=t.Roman),h===40&&c===73&&(p=t.Katakana),h===36&&(c===64||c===66)&&(p=t.LeadByte),p!==null){i=i=p;var d=o;return o=!0,d?Ar(r):null}return s.prepend([h,c]),o=!1,i=a,Ar(r)}}}function wR(e){var r=e.fatal,t={ASCII:0,Roman:1,jis0208:2},i=t.ASCII;this.handler=function(a,n){if(n===jr&&i!==t.ASCII)return a.prepend(n),i=t.ASCII,[27,40,66];if(n===jr&&i===t.ASCII)return Hr;if((i===t.ASCII||i===t.Roman)&&(n===14||n===15||n===27))return oi(65533);if(i===t.ASCII&&qa(n))return n;if(i===t.Roman&&(qa(n)&&n!==92&&n!==126||n==165||n==8254)){if(qa(n))return n;if(n===165)return 92;if(n===8254)return 126}if(qa(n)&&i!==t.ASCII)return a.prepend(n),i=t.ASCII,[27,40,66];if((n===165||n===8254)&&i!==t.Roman)return a.prepend(n),i=t.Roman,[27,40,74];n===8722&&(n=65293);var o=ds(n,sa("jis0208"));if(o===null)return oi(n);if(i!==t.jis0208)return a.prepend(n),i=t.jis0208,[27,36,66];var s=cn(o/94)+33,c=o%94+33;return[s,c]}}ma["ISO-2022-JP"]=function(e){return new wR(e)};ga["ISO-2022-JP"]=function(e){return new _R(e)};function kR(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===jr&&t!==0)return t=0,Ar(r);if(a===jr&&t===0)return Hr;if(t!==0){var n=t,o=null;t=0;var s=a<127?64:65,c=n<160?129:193;if((hr(a,64,126)||hr(a,128,252))&&(o=(n-c)*188+a-s),hr(o,8836,10715))return 57344-8836+o;var u=o===null?null:hs(o,sa("jis0208"));return u===null&&za(a)&&i.prepend(a),u===null?Ar(r):u}return za(a)||a===128?a:hr(a,161,223)?65377-161+a:hr(a,129,159)||hr(a,224,252)?(t=a,null):Ar(r)}}function SR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i)||i===128)return i;if(i===165)return 92;if(i===8254)return 126;if(hr(i,65377,65439))return i-65377+161;i===8722&&(i=65293);var a=fR(i);if(a===null)return oi(i);var n=cn(a/188),o=n<31?129:193,s=a%188,c=s<63?64:65;return[n+o,s+c]}}ma.Shift_JIS=function(e){return new SR(e)};ga.Shift_JIS=function(e){return new kR(e)};function ER(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===jr&&t!==0)return t=0,Ar(r);if(a===jr&&t===0)return Hr;if(t!==0){var n=t,o=null;t=0,hr(a,65,254)&&(o=(n-129)*190+(a-65));var s=o===null?null:hs(o,sa("euc-kr"));return o===null&&za(a)&&i.prepend(a),s===null?Ar(r):s}return za(a)?a:hr(a,129,254)?(t=a,null):Ar(r)}}function AR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i))return i;var a=ds(i,sa("euc-kr"));if(a===null)return oi(i);var n=cn(a/190)+129,o=a%190+65;return[n,o]}}ma["EUC-KR"]=function(e){return new AR(e)};ga["EUC-KR"]=function(e){return new ER(e)};function bl(e,r){var t=e>>8,i=e&255;return r?[t,i]:[i,t]}function py(e,r){var t=r.fatal,i=null,a=null;this.handler=function(n,o){if(o===jr&&(i!==null||a!==null))return Ar(t);if(o===jr&&i===null&&a===null)return Hr;if(i===null)return i=o,null;var s;if(e?s=(i<<8)+o:s=(o<<8)+i,i=null,a!==null){var c=a;return a=null,hr(s,56320,57343)?65536+(c-55296)*1024+(s-56320):(n.prepend(bl(s,e)),Ar(t))}return hr(s,55296,56319)?(a=s,null):hr(s,56320,57343)?Ar(t):s}}function hy(e,r){var t=r.fatal;this.handler=function(i,a){if(a===jr)return Hr;if(hr(a,0,65535))return bl(a,e);var n=bl((a-65536>>10)+55296,e),o=bl((a-65536&1023)+56320,e);return n.concat(o)}}ma["UTF-16BE"]=function(e){return new hy(!0,e)};ga["UTF-16BE"]=function(e){return new py(!0,e)};ma["UTF-16LE"]=function(e){return new hy(!1,e)};ga["UTF-16LE"]=function(e){return new py(!1,e)};function jR(e){var r=e.fatal;this.handler=function(t,i){return i===jr?Hr:za(i)?i:63360+i-128}}function TR(e){var r=e.fatal;this.handler=function(t,i){return i===jr?Hr:qa(i)?i:hr(i,63360,63487)?i-63360+128:oi(i)}}ma["x-user-defined"]=function(e){return new TR(e)};ga["x-user-defined"]=function(e){return new jR(e)};function Ec(e){return Buffer.from(e).toString("base64")}function Nh(e){return Buffer.from(e,"base64").toString("ascii")}var f_=Xt(u_(),1),p_=Xt(Cc(),1);function l_(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function $9(e,r){let t=r.type?r.type.replace("image/",""):"jpeg",i=(0,p_.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,f_.default)(i,t,r)}function h_(e,r){let t=$9(e,r);return new Promise(i=>{let a=[];t.on("data",n=>a.push(n)),t.on("end",()=>{let n=Buffer.concat(a);i(l_(n))})})}var G4=Xt(V4(),1),Gg=["image/png","image/jpeg","image/gif"];async function Kg(e,r){if(!r)throw new Error("MIMEType is required to parse image under Node.js");let t=e instanceof Buffer?e:Buffer.from(e);return await sH(t,r)}function sH(e,r){return new Promise(t=>(0,G4.default)(e,r,(i,a)=>{if(i)throw i;let n=[...a.shape],o=a.shape.length===4?a.shape.shift():1,s=a.data instanceof Buffer?new Uint8Array(a.data):a.data;t({shape:n,data:s,width:a.shape[0],height:a.shape[1],components:a.shape[2],layers:o?[o]:[]})}))}async function $g(e,r,t,i){return i._parse(e,r,t,i)}function ki(e,r){if(!e)throw new Error(r||"loader assertion failed.")}var Wi={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},cH=Wi.self||Wi.window||Wi.global||{},uH=Wi.window||Wi.self||Wi.global||{},lH=Wi.global||Wi.self||Wi.window||{},fH=Wi.document||{};var No=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var K4=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),pH=K4&&parseFloat(K4[1])||0;var gp=globalThis,hH=globalThis.document||{},vp=globalThis.process||{},dH=globalThis.console,Tee=globalThis.navigator||{};function $4(e){var i,a;if(typeof window<"u"&&((i=window.process)==null?void 0:i.type)==="renderer"||typeof process<"u"&&Boolean((a=process.versions)==null?void 0:a.electron))return!0;let r=typeof navigator<"u"&&navigator.userAgent,t=e||r;return Boolean(t&&t.indexOf("Electron")>=0)}function Uo(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||$4()}var Wg="4.0.7";function gH(e){try{let r=window[e],t="__storage_test__";return r.setItem(t,t),r.removeItem(t),r}catch{return null}}var yp=class{constructor(r,t,i="sessionStorage"){this.storage=gH(i),this.id=r,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(r){if(Object.assign(this.config,r),this.storage){let t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let r={};if(this.storage){let t=this.storage.getItem(this.id);r=t?JSON.parse(t):{}}return Object.assign(this.config,r),this}};function W4(e){let r;return e<10?r=`${e.toFixed(2)}ms`:e<100?r=`${e.toFixed(1)}ms`:e<1e3?r=`${e.toFixed(0)}ms`:r=`${(e/1e3).toFixed(2)}s`,r}function X4(e,r=8){let t=Math.max(r-e.length,0);return`${" ".repeat(t)}${e}`}var bp;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(bp||(bp={}));var vH=10;function Y4(e){return typeof e!="string"?e:(e=e.toUpperCase(),bp[e]||bp.WHITE)}function Q4(e,r,t){return!Uo&&typeof e=="string"&&(r&&(e=`\x1B[${Y4(r)}m${e}\x1B[39m`),t&&(e=`\x1B[${Y4(t)+vH}m${e}\x1B[49m`)),e}function J4(e,r=["constructor"]){let t=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(t),a=e;for(let n of i){let o=a[n];typeof o=="function"&&(r.find(s=>n===s)||(a[n]=o.bind(e)))}}function Tu(e,r){if(!e)throw new Error(r||"Assertion failed")}function Ho(){var r,t,i,a,n;let e;if(Uo()&&gp.performance)e=(i=(t=(r=gp)==null?void 0:r.performance)==null?void 0:t.now)==null?void 0:i.call(t);else if("hrtime"in vp){let o=(n=(a=vp)==null?void 0:a.hrtime)==null?void 0:n.call(a);e=o[0]*1e3+o[1]/1e6}else e=Date.now();return e}var nc={debug:Uo()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},yH={enabled:!0,level:0};function oc(){}var Z4={},e5={once:!0},Xi=class{constructor({id:r}={id:""}){this.VERSION=Wg,this._startTs=Ho(),this._deltaTs=Ho(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=r,this.userData={},this._storage=new yp(`__probe-${this.id}__`,yH),this.timeStamp(`${this.id} started`),J4(this),Object.seal(this)}set level(r){this.setLevel(r)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Ho()-this._startTs).toPrecision(10))}getDelta(){return Number((Ho()-this._deltaTs).toPrecision(10))}set priority(r){this.level=r}get priority(){return this.level}getPriority(){return this.level}enable(r=!0){return this._storage.setConfiguration({enabled:r}),this}setLevel(r){return this._storage.setConfiguration({level:r}),this}get(r){return this._storage.config[r]}set(r,t){this._storage.setConfiguration({[r]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(r,t){if(!r)throw new Error(t||"Assertion failed")}warn(r){return this._getLogFunction(0,r,nc.warn,arguments,e5)}error(r){return this._getLogFunction(0,r,nc.error,arguments)}deprecated(r,t){return this.warn(`\`${r}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(r,t){return this.error(`\`${r}\` has been removed. Use \`${t}\` instead`)}probe(r,t){return this._getLogFunction(r,t,nc.log,arguments,{time:!0,once:!0})}log(r,t){return this._getLogFunction(r,t,nc.debug,arguments)}info(r,t){return this._getLogFunction(r,t,console.info,arguments)}once(r,t){return this._getLogFunction(r,t,nc.debug||nc.info,arguments,e5)}table(r,t,i){return t?this._getLogFunction(r,t,console.table||oc,i&&[i],{tag:xH(t)}):oc}time(r,t){return this._getLogFunction(r,t,console.time?console.time:console.info)}timeEnd(r,t){return this._getLogFunction(r,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(r,t){return this._getLogFunction(r,t,console.timeStamp||oc)}group(r,t,i={collapsed:!1}){let a=r5({logLevel:r,message:t,opts:i}),{collapsed:n}=i;return a.method=(n?console.groupCollapsed:console.group)||console.info,this._getLogFunction(a)}groupCollapsed(r,t,i={}){return this.group(r,t,Object.assign({},i,{collapsed:!0}))}groupEnd(r){return this._getLogFunction(r,"",console.groupEnd||oc)}withGroup(r,t,i){this.group(r,t)();try{i()}finally{this.groupEnd(r)()}}trace(){console.trace&&console.trace()}_shouldLog(r){return this.isEnabled()&&this.getLevel()>=t5(r)}_getLogFunction(r,t,i,a,n){if(this._shouldLog(r)){n=r5({logLevel:r,message:t,args:a,opts:n}),i=i||n.method,Tu(i),n.total=this.getTotal(),n.delta=this.getDelta(),this._deltaTs=Ho();let o=n.tag||n.message;if(n.once&&o)if(!Z4[o])Z4[o]=Ho();else return oc;return t=bH(this.id,n.message,n),i.bind(console,t,...n.args)}return oc}};Xi.VERSION=Wg;function t5(e){if(!e)return 0;let r;switch(typeof e){case"number":r=e;break;case"object":r=e.logLevel||e.priority||0;break;default:return 0}return Tu(Number.isFinite(r)&&r>=0),r}function r5(e){let{logLevel:r,message:t}=e;e.logLevel=t5(r);let i=e.args?Array.from(e.args):[];for(;i.length&&i.shift()!==t;);switch(typeof r){case"string":case"function":t!==void 0&&i.unshift(t),e.message=r;break;case"object":Object.assign(e,r);break;default:}typeof e.message=="function"&&(e.message=e.message());let a=typeof e.message;return Tu(a==="string"||a==="object"),Object.assign(e,{args:i},e.opts)}function bH(e,r,t){if(typeof r=="string"){let i=t.time?X4(W4(t.total)):"";r=t.time?`${e}: ${i} ${r}`:`${e}: ${r}`,r=Q4(r,t.color,t.background)}return r}function xH(e){for(let r in e)for(let t in e[r])return t||"untitled";return"empty"}globalThis.probe={};var Zee=new Xi({id:"@probe.gl/log"});var Xg="4.4.0-alpha.1",_H=Xg[0]>="0"&&Xg[0]<="9"?`v${Xg}`:"";function wH(){let e=new Xi({id:"loaders.gl"});return globalThis.loaders=globalThis.loaders||{},globalThis.loaders.log=e,globalThis.loaders.version=_H,globalThis.probe=globalThis.probe||{},globalThis.probe.loaders=e,e}var Yg=wH();function Qg(e,r){return a5(e||{},r)}function a5(e,r,t=0){if(t>3)return r;let i={...e};for(let[a,n]of Object.entries(r))n&&typeof n=="object"&&!Array.isArray(n)?i[a]=a5(i[a]||{},r[a],t+1):i[a]=r[a];return i}function Jg(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function Zg(e){var t,i;return((i=(t=globalThis.loaders)==null?void 0:t.modules)==null?void 0:i[e])||null}var i5="beta";function kH(){var e;return(e=globalThis._loadersgl_)!=null&&e.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.4.0-alpha.1"),globalThis._loadersgl_.version}var xp=kH();function Wt(e,r){if(!e)throw new Error(r||"loaders.gl assertion failed.")}var Yi={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},lre=Yi.self||Yi.window||Yi.global||{},fre=Yi.window||Yi.self||Yi.global||{},pre=Yi.global||Yi.self||Yi.window||{},hre=Yi.document||{};var Nt=typeof process!="object"||String(process)!=="[object process]"||process.browser,Ru=typeof importScripts=="function",o5=typeof window<"u"&&typeof window.orientation<"u",n5=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),dre=n5&&parseFloat(n5[1])||0;var Pu=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(r,t){this.name=r,this.workerThread=t,this.result=new Promise((i,a)=>{this._resolve=i,this._reject=a})}postMessage(r,t){this.workerThread.postMessage({source:"loaders.gl",type:r,payload:t})}done(r){Wt(this.isRunning),this.isRunning=!1,this._resolve(r)}error(r){Wt(this.isRunning),this.isRunning=!1,this._reject(r)}};var po={};yl(po,{NodeWorker:()=>Cu,parentPort:()=>ev});var Ou=Xt(require("worker_threads"),1);kc(po,require("worker_threads"));var ev=Ou==null?void 0:Ou.parentPort,Cu=Ou.Worker;var rv=new Map;function s5(e){Wt(e.source&&!e.url||!e.source&&e.url);let r=rv.get(e.source||e.url);return r||(e.url&&(r=SH(e.url),rv.set(e.url,r)),e.source&&(r=c5(e.source),rv.set(e.source,r))),Wt(r),r}function SH(e){if(!e.startsWith("http"))return e;let r=EH(e);return c5(r)}function c5(e){let r=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(r)}function EH(e){return`try {
95
95
  importScripts('${e}');
96
96
  } catch (error) {
97
97
  console.error(error);
98
98
  throw error;
99
- }`}function Bu(e,r=!0,t){let i=t||new Set;if(e){if(u5(e))i.add(e);else if(u5(e.buffer))i.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(let a in e)Bu(e[a],r,i)}}return t===void 0?Array.from(i):[]}function u5(e){return e?e instanceof ArrayBuffer||typeof MessagePort<"u"&&e instanceof MessagePort||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas:!1}var tv=()=>{},ho=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&Nt||typeof Cu<"u"&&!Nt}constructor(r){let{name:t,source:i,url:a}=r;Wt(i||a),this.name=t,this.source=i,this.url=a,this.onMessage=tv,this.onError=n=>console.log(n),this.worker=Nt?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=tv,this.onError=tv,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(r,t){t=t||Bu(r),this.worker.postMessage(r,t)}_getErrorFromErrorEvent(r){let t="Failed to load ";return t+=`worker ${this.name} from ${this.url}. `,r.message&&(t+=`${r.message} in `),r.lineno&&(t+=`:${r.lineno}:${r.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=s5({source:this.source,url:this.url});let r=new Worker(this._loadableURL,{name:this.name});return r.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},r.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},r.onmessageerror=t=>console.error(t),r}_createNodeWorker(){let r;if(this.url){let i=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;r=new Cu(i,{eval:!1})}else if(this.source)r=new Cu(this.source,{eval:!0});else throw new Error("no worker");return r.on("message",t=>{this.onMessage(t)}),r.on("error",t=>{this.onError(t)}),r.on("exit",t=>{}),r}};var Fu=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return ho.isSupported()}constructor(r){this.source=r.source,this.url=r.url,this.setProps(r)}destroy(){this.idleQueue.forEach(r=>r.destroy()),this.isDestroyed=!0}setProps(r){this.props={...this.props,...r},r.name!==void 0&&(this.name=r.name),r.maxConcurrency!==void 0&&(this.maxConcurrency=r.maxConcurrency),r.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=r.maxMobileConcurrency),r.reuseWorkers!==void 0&&(this.reuseWorkers=r.reuseWorkers),r.onDebug!==void 0&&(this.onDebug=r.onDebug)}async startJob(r,t=(a,n,o)=>a.done(o),i=(a,n)=>a.error(n)){let a=new Promise(n=>(this.jobQueue.push({name:r,onMessage:t,onError:i,onStart:n}),this));return this._startQueuedJob(),await a}async _startQueuedJob(){if(!this.jobQueue.length)return;let r=this._getAvailableWorker();if(!r)return;let t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:r,backlog:this.jobQueue.length});let i=new Pu(t.name,r);r.onMessage=a=>t.onMessage(i,a.type,a.payload),r.onError=a=>t.onError(i,a),t.onStart(i);try{await i.result}catch(a){console.error(`Worker exception: ${a}`)}finally{this.returnWorkerToQueue(r)}}}returnWorkerToQueue(r){!Nt||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(r.destroy(),this.count--):this.idleQueue.push(r),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let r=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new ho({name:r,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return o5?this.maxMobileConcurrency:this.maxConcurrency}};var AH={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},Vo=class{props;workerPools=new Map;static isSupported(){return ho.isSupported()}static getWorkerFarm(r={}){return Vo._workerFarm=Vo._workerFarm||new Vo({}),Vo._workerFarm.setProps(r),Vo._workerFarm}constructor(r){this.props={...AH},this.setProps(r),this.workerPools=new Map}destroy(){for(let r of this.workerPools.values())r.destroy();this.workerPools=new Map}setProps(r){this.props={...this.props,...r};for(let t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(r){let{name:t,source:i,url:a}=r,n=this.workerPools.get(t);return n||(n=new Fu({name:t,source:i,url:a}),n.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,n)),n}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},mo=Vo;ny(mo,"_workerFarm");async function Go(){return ev}var av=new Map,Ca=class{static async inWorkerThread(){return typeof self<"u"||Boolean(await Go())}static set onmessage(r){async function t(i){let a=await Go(),{type:n,payload:o}=a?i:i.data;r(n,o)}Go().then(i=>{i?(i.on("message",a=>{t(a)}),i.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=t})}static async addEventListener(r){let t=av.get(r);t||(t=async a=>{if(!jH(a))return;let n=await Go(),{type:o,payload:s}=n?a:a.data;r(o,s)}),await Go()?console.error("not implemented"):globalThis.addEventListener("message",t)}static async removeEventListener(r){let t=av.get(r);av.delete(r),await Go()?console.error("not implemented"):globalThis.removeEventListener("message",t)}static async postMessage(r,t){let i={source:"loaders.gl",type:r,payload:t},a=Bu(t),n=await Go();n?n.postMessage(i,a):globalThis.postMessage(i,a)}};function jH(e){let{type:r,data:t}=e;return r==="message"&&t&&typeof t.source=="string"&&t.source.startsWith("loaders.gl")}function iv(e,r={}){let t=r[e.id]||{},i=Nt?`${e.id}-worker.js`:`${e.id}-worker-node.js`,a=t.workerUrl;if(!a&&e.id==="compression"&&(a=r.workerUrl),r._workerType==="test"&&(Nt?a=`modules/${e.module}/dist/${i}`:a=`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!a){let n=e.version;n==="latest"&&(n=i5);let o=n?`@${n}`:"";a=`https://unpkg.com/@loaders.gl/${e.module}${o}/dist/${i}`}return Wt(a),a}function nv(e,r=xp){Wt(e,"no worker provided");let t=e.version;return!(!r||!t)}var ov={};async function Qi(e,r=null,t={},i=null){return r&&(e=l5(e,r,t,i)),ov[e]=ov[e]||TH(e),await ov[e]}function l5(e,r,t={},i=null){if(!t.useLocalLibraries&&e.startsWith("http"))return e;i=i||e;let a=t.modules||{};return a[i]?a[i]:Nt?t.CDN?(Wt(t.CDN.startsWith("http")),`${t.CDN}/${r}@${xp}/dist/libs/${i}`):Ru?`../src/libs/${i}`:`modules/${r}/src/libs/${i}`:`modules/${r}/dist/libs/${i}`}async function TH(e){if(e.endsWith("wasm"))return await PH(e);if(!Nt)try{let{requireFromFile:t}=globalThis.loaders||{};return await(t==null?void 0:t(e))}catch(t){return console.error(t),null}if(Ru)return importScripts(e);let r=await OH(e);return RH(r,e)}function RH(e,r){if(!Nt){let{requireFromString:i}=globalThis.loaders||{};return i==null?void 0:i(e,r)}if(Ru)return eval.call(globalThis,e),null;let t=document.createElement("script");t.id=r;try{t.appendChild(document.createTextNode(e))}catch{t.text=e}return document.body.appendChild(t),null}async function PH(e){let{readFileAsArrayBuffer:r}=globalThis.loaders||{};return Nt||!r||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await r(e)}async function OH(e){let{readFileAsText:r}=globalThis.loaders||{};return Nt||!r||e.startsWith("http")?await(await fetch(e)).text():await r(e)}var CH=0;async function sv(e){await Ca.inWorkerThread()&&(Ca.onmessage=async(r,t)=>{switch(r){case"process":try{let{input:i,options:a={},context:n={}}=t,o=await FH({loader:e,arrayBuffer:i,options:a,context:{...n,_parse:BH}});Ca.postMessage("done",{result:o})}catch(i){let a=i instanceof Error?i.message:"";Ca.postMessage("error",{error:a})}break;default:}})}function BH(e,r,t,i){return new Promise((a,n)=>{let o=CH++,s=(u,l)=>{if(l.id===o)switch(u){case"done":Ca.removeEventListener(s),a(l.result);break;case"error":Ca.removeEventListener(s),n(l.error);break;default:}};Ca.addEventListener(s);let c={id:o,input:e,options:t};Ca.postMessage("process",c)})}async function FH({loader:e,arrayBuffer:r,options:t,context:i}){let a,n;if(e.parseSync||e.parse)a=r,n=e.parseSync||e.parse;else if(e.parseTextSync)a=new TextDecoder().decode(r),n=e.parseTextSync;else throw new Error(`Could not load data with ${e.name} loader`);return t={...t,modules:e&&e.options&&e.options.modules||{},worker:!1},await n(a,{...t},i,e)}function cv(e,r){return!mo.isSupported()||!Nt&&!(r!=null&&r._nodeWorkers)?!1:e.worker&&(r==null?void 0:r.worker)}async function uv(e,r,t,i,a){let n=e.id,o=iv(e,t),c=mo.getWorkerFarm(t).getWorkerPool({name:n,url:o});t=JSON.parse(JSON.stringify(t)),i=JSON.parse(JSON.stringify(i||{}));let u=await c.startJob("process-on-worker",IH.bind(null,a));return u.postMessage("process",{input:r,options:t,context:i}),await(await u.result).result}async function IH(e,r,t,i){switch(t){case"done":r.done(i);break;case"error":r.error(new Error(i.error));break;case"process":let{id:a,input:n,options:o}=i;try{let s=await e(n,o);r.postMessage("done",{id:a,result:s})}catch(s){let c=s instanceof Error?s.message:"unknown error";r.postMessage("error",{id:a,error:c})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}}function lv(e,r,t){if(t=t||e.byteLength,e.byteLength<t||r.byteLength<t)return!1;let i=new Uint8Array(e),a=new Uint8Array(r);for(let n=0;n<i.length;++n)if(i[n]!==a[n])return!1;return!0}function fv(...e){return f5(e)}function f5(e){let r=e.map(n=>n instanceof ArrayBuffer?new Uint8Array(n):n),t=r.reduce((n,o)=>n+o.byteLength,0),i=new Uint8Array(t),a=0;for(let n of r)i.set(n,a),a+=n.byteLength;return i.buffer}async function Iu(e){let r=[];for await(let t of e)r.push(t);return fv(...r)}var MH="",p5={};function Ko(e){for(let r in p5)if(e.startsWith(r)){let t=p5[r];e=e.replace(r,t)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${MH}${e}`),e}function h5(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function d5(e){return e&&typeof e=="object"&&e.isBuffer}function _p(e){if(d5(e))return h5(e);if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){let r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}var $o={};yl($o,{dirname:()=>qH,filename:()=>DH,join:()=>zH,resolve:()=>NH});function m5(){var r;if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=(r=window.location)==null?void 0:r.pathname;return(e==null?void 0:e.slice(0,e.lastIndexOf("/")+1))||""}function DH(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(r+1):""}function qH(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(0,r):""}function zH(...e){let r="/";return e=e.map((t,i)=>(i&&(t=t.replace(new RegExp(`^${r}`),"")),i!==e.length-1&&(t=t.replace(new RegExp(`${r}$`),"")),t)),e.join(r)}function NH(...e){let r=[];for(let n=0;n<e.length;n++)r[n]=e[n];let t="",i=!1,a;for(let n=r.length-1;n>=-1&&!i;n--){let o;n>=0?o=r[n]:(a===void 0&&(a=m5()),o=a),o.length!==0&&(t=`${o}/${t}`,i=o.charCodeAt(0)===Mu)}return t=UH(t,!i),i?`/${t}`:t.length>0?t:"."}var Mu=47,pv=46;function UH(e,r){let t="",i=-1,a=0,n,o=!1;for(let s=0;s<=e.length;++s){if(s<e.length)n=e.charCodeAt(s);else{if(n===Mu)break;n=Mu}if(n===Mu){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(t.length<2||!o||t.charCodeAt(t.length-1)!==pv||t.charCodeAt(t.length-2)!==pv){if(t.length>2){let c=t.length-1,u=c;for(;u>=0&&t.charCodeAt(u)!==Mu;--u);if(u!==c){t=u===-1?"":t.slice(0,u),i=s,a=0,o=!1;continue}}else if(t.length===2||t.length===1){t="",i=s,a=0,o=!1;continue}}r&&(t.length>0?t+="/..":t="..",o=!0)}else{let c=e.slice(i+1,s);t.length>0?t+=`/${c}`:t=c,o=!1}i=s,a=0}else n===pv&&a!==-1?++a:a=-1}return t}var En=Xt(require("fs"),1),Wo=class{handle;size;bigsize;url;constructor(r,t,i){r=Ko(r),this.handle=En.default.openSync(r,t,i);let a=En.default.fstatSync(this.handle,{bigint:!0});this.size=Number(a.size),this.bigsize=a.size,this.url=r}async close(){return new Promise((r,t)=>{En.default.close(this.handle,i=>i?t(i):r())})}async truncate(r){return new Promise((t,i)=>{En.default.ftruncate(this.handle,r,a=>{a?i(a):(this.bigsize=BigInt(r),this.size=Number(this.bigsize),t())})})}async append(r){return new Promise((t,i)=>{En.default.appendFile(this.handle,r,a=>{a?i(a):(this.bigsize=this.bigsize+BigInt(r.length),this.size=Number(this.bigsize),t())})})}async stat(){return await new Promise((r,t)=>En.default.fstat(this.handle,{bigint:!0},(i,a)=>{let n={size:Number(a.size),bigsize:a.size,isDirectory:a.isDirectory()};i?t(i):r(n)}))}async read(r,t){let i=new ArrayBuffer(t),a=BigInt(r),n=0,o=new Uint8Array(i),s;for(;t>0;){let c=await HH(this.handle,o,0,t,a);if(c===0)break;n+=c,a+=BigInt(c),t-=c,s!==void 0&&(s+=c)}return n<t?i.slice(0,n):i}async write(r,t=0,i=r.byteLength){return new Promise((a,n)=>{let o=Number(t),s=new Uint8Array(r,Number(t),i);En.default.write(this.handle,s,0,i,o,(c,u)=>c?n(c):a(u))})}};async function HH(e,r,t,i,a){return await new Promise((n,o)=>En.default.read(e,r,t,i,a,(s,c)=>s?o(s):n(c)))}var Ep=Xt(require("fs/promises"),1);var dv=Xt(require("fs"),1),hv=require("stream");var wp=Xt(require("zlib"),1),VH=e=>e&&e instanceof ArrayBuffer,GH=e=>e&&e instanceof Buffer;function kp(e,r){switch(r==null?void 0:r.get("content-encoding")){case"br":return e.pipe(wp.default.createBrotliDecompress());case"gzip":return e.pipe(wp.default.createGunzip());case"deflate":return e.pipe(wp.default.createDeflate());default:return e}}async function g5(e){let r=[];return await new Promise((t,i)=>{e.on("error",a=>i(a)),e.on("readable",()=>e.read()),e.on("data",a=>{typeof a=="string"&&i(new Error("Read stream not binary")),r.push($H(a))}),e.on("end",()=>{let a=KH(r);t(a)})})}function KH(e){let r=e.map(n=>n instanceof ArrayBuffer?new Uint8Array(n):n),t=r.reduce((n,o)=>n+o.byteLength,0),i=new Uint8Array(t),a=0;for(let n of r)i.set(n,a),a+=n.byteLength;return i.buffer}function $H(e){if(VH(e))return e;if(GH(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var WH=e=>typeof e=="boolean",v5=e=>typeof e=="function",XH=e=>e!==null&&typeof e=="object",YH=e=>XH(e)&&v5(e.read)&&v5(e.pipe)&&WH(e.readable);async function Sp(e,r){let t=/^file:\/\//;e.replace(t,"/");let i=e.split("?")[0];i=Ko(i);let a=new Headers;e.endsWith(".gz")&&(a["content-encoding"]="gzip"),e.endsWith(".br")&&(a["content-encoding"]="br");try{let n=await new Promise((h,p)=>{let d=dv.default.createReadStream(i,{encoding:null});d.once("readable",()=>h(d)),d.on("error",v=>p(v))}),o=n;YH(n)?o=kp(n,a):typeof n=="string"?o=hv.Readable.from([new TextEncoder().encode(n)]):o=hv.Readable.from([n||new ArrayBuffer(0)]);let s=200,c="OK",u=QH(i),l=new Response(o,{headers:u,status:s,statusText:c});return Object.defineProperty(l,"url",{value:e}),l}catch(n){let o=n.message,s=400,c=o,u={},l=new Response(o,{headers:u,status:s,statusText:c});return Object.defineProperty(l,"url",{value:e}),l}}function QH(e){let r={};if(!r["content-length"]){let t=dv.default.statSync(e);r["content-length"]=t.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),r["content-encoding"]="gzip"),new Headers(r)}var Ap=class{readable=!0;writable=!0;constructor(){}async readdir(r=".",t){return await Ep.default.readdir(r,t)}async stat(r){let t=await Ep.default.stat(r,{bigint:!0});return{size:Number(t.size),bigsize:t.size,isDirectory:t.isDirectory()}}async unlink(r){return await Ep.default.unlink(r)}async fetch(r,t){return await Sp(r,t)}async openReadableFile(r,t="r"){return new Wo(r,t)}async openWritableFile(r,t="w",i){return new Wo(r,t,i)}};var Lu=class{constructor(r={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(r,t="base64"){var o,s;let i=[];for await(let c of r)i.push(c),yield c;let a=await this.concatenate(i),n=await this.hash(a,t);(s=(o=this.options.crypto)==null?void 0:o.onEnd)==null||s.call(o,{hash:n})}async concatenate(r){return await Iu(r)}};var Du=Xt(require("crypto"),1),jp=class extends Lu{name="crypto-node";options;_algorithm;_hash;constructor(r){var t,i;if(super(),this.options=r,!((i=(t=this.options)==null?void 0:t.crypto)!=null&&i.algorithm))throw new Error(this.name)}async hash(r,t){var a,n,o,s;let i=(o=(n=(a=this.options)==null?void 0:a.crypto)==null?void 0:n.algorithm)==null?void 0:o.toLowerCase();try{if(!Du.createHash)throw new Error("crypto.createHash not available");let c=(s=Du.createHash)==null?void 0:s(i),u=new Uint8Array(r);return c.update(u).digest("base64")}catch(c){throw Error(`${i} hash not available. ${c}`)}}async*hashBatches(r,t="base64"){var n,o,s,c,u,l,h;if(!Du.createHash)throw new Error("crypto.createHash not available");let i=(c=Du.createHash)==null?void 0:c((s=(o=(n=this.options)==null?void 0:n.crypto)==null?void 0:o.algorithm)==null?void 0:s.toLowerCase());for await(let p of r){let d=new Uint8Array(p);i.update(d),yield p}let a=i.digest(t);(h=(l=(u=this.options)==null?void 0:u.crypto)==null?void 0:l.onEnd)==null||h.call(l,{hash:a})}};var XA=require("node:process");var y5=Xt(require("stream"),1),mv=class{},JH=y5.Readable||mv;function vv(e,r){let t=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new gv(t,r)}var gv=class extends JH{_pulling;_bytesMode;_iterator;constructor(r,t){super(t),this._iterator=r,this._pulling=!1,this._bytesMode=!t||!t.objectMode}async _read(r){this._pulling||(this._pulling=!0,this._pulling=await this._pull(r,this._iterator))}async _destroy(r,t){var i,a,n,o;this._iterator&&(r?await((a=(i=this._iterator)==null?void 0:i.throw)==null?void 0:a.call(i,r)):await((o=(n=this._iterator)==null?void 0:n.return)==null?void 0:o.call(n,r)),t==null||t(null))}async _pull(r,t){var n;let i=this._bytesMode,a=null;for(;this.readable&&!(a=await t.next()).done&&(r!==null&&(r-=i&&ArrayBuffer.isView(a.value)?a.value.byteLength:1),!(!this.push(new Uint8Array(a.value))||r<=0)););return(a!=null&&a.done||!this.readable)&&(this.push(null)||!0)&&((n=t==null?void 0:t.return)==null||n.call(t)),!this.readable}};function Vu(){}function mt(e){return typeof e=="object"&&e!==null||typeof e=="function"}var D5=Vu;function Pr(e,r){try{Object.defineProperty(e,"name",{value:r,configurable:!0})}catch{}}var Lv=Promise,ZH=Promise.resolve.bind(Lv),eV=Promise.prototype.then,rV=Promise.reject.bind(Lv),tV=ZH;function kt(e){return new Lv(e)}function Or(e){return kt(r=>r(e))}function $e(e){return rV(e)}function rn(e,r,t){return eV.call(e,r,t)}function wa(e,r,t){rn(rn(e,r,t),void 0,D5)}function yv(e,r){wa(e,r)}function jv(e,r){wa(e,void 0,r)}function On(e,r,t){return rn(e,r,t)}function dc(e){rn(e,void 0,D5)}var es=e=>{if(typeof queueMicrotask=="function")es=queueMicrotask;else{let r=Or(void 0);es=t=>rn(r,t)}return es(e)};function rs(e,r,t){if(typeof e!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,r,t)}function Bn(e,r,t){try{return Or(rs(e,r,t))}catch(i){return $e(i)}}var ka=class{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(r){let t=this._back,i=t;t._elements.length===16383&&(i={_elements:[],_next:void 0}),t._elements.push(r),i!==t&&(this._back=i,t._next=i),++this._size}shift(){let r=this._front,t=r,i=this._cursor,a=i+1,n=r._elements,o=n[i];return a===16384&&(t=r._next,a=0),--this._size,this._cursor=a,r!==t&&(this._front=t),n[i]=void 0,o}forEach(r){let t=this._cursor,i=this._front,a=i._elements;for(;!(t===a.length&&i._next===void 0||t===a.length&&(i=i._next,a=i._elements,t=0,a.length===0));)r(a[t]),++t}peek(){let r=this._front,t=this._cursor;return r._elements[t]}},q5=Symbol("[[AbortSteps]]"),z5=Symbol("[[ErrorSteps]]"),Dv=Symbol("[[CancelSteps]]"),qv=Symbol("[[PullSteps]]"),zv=Symbol("[[ReleaseSteps]]");function N5(e,r){e._ownerReadableStream=r,r._reader=e,r._state==="readable"?Tv(e):r._state==="closed"?function(t){Tv(t),H5(t)}(e):U5(e,r._storedError)}function Nv(e,r){return Si(e._ownerReadableStream,r)}function Pn(e){let r=e._ownerReadableStream;r._state==="readable"?Uv(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(t,i){U5(t,i)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),r._readableStreamController[zv](),r._reader=void 0,e._ownerReadableStream=void 0}function Up(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function Tv(e){e._closedPromise=kt((r,t)=>{e._closedPromise_resolve=r,e._closedPromise_reject=t})}function U5(e,r){Tv(e),Uv(e,r)}function Uv(e,r){e._closedPromise_reject!==void 0&&(dc(e._closedPromise),e._closedPromise_reject(r),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function H5(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var b5=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},aV=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function tn(e,r){if(e!==void 0&&typeof(t=e)!="object"&&typeof t!="function")throw new TypeError(`${r} is not an object.`);var t}function Ja(e,r){if(typeof e!="function")throw new TypeError(`${r} is not a function.`)}function V5(e,r){if(!function(t){return typeof t=="object"&&t!==null||typeof t=="function"}(e))throw new TypeError(`${r} is not an object.`)}function Cn(e,r,t){if(e===void 0)throw new TypeError(`Parameter ${r} is required in '${t}'.`)}function Rv(e,r,t){if(e===void 0)throw new TypeError(`${r} is required in '${t}'.`)}function Hv(e){return Number(e)}function x5(e){return e===0?0:e}function Vv(e,r){let t=Number.MAX_SAFE_INTEGER,i=Number(e);if(i=x5(i),!b5(i))throw new TypeError(`${r} is not a finite number`);if(i=function(a){return x5(aV(a))}(i),i<0||i>t)throw new TypeError(`${r} is outside the accepted range of 0 to ${t}, inclusive`);return b5(i)&&i!==0?i:0}function Gv(e,r){if(!go(e))throw new TypeError(`${r} is not a ReadableStream.`)}function uc(e){return new An(e)}function G5(e,r){e._reader._readRequests.push(r)}function Kv(e,r,t){let i=e._reader._readRequests.shift();t?i._closeSteps():i._chunkSteps(r)}function Yp(e){return e._reader._readRequests.length}function K5(e){let r=e._reader;return r!==void 0&&!!vo(r)}var An=class{constructor(r){if(Cn(r,1,"ReadableStreamDefaultReader"),Gv(r,"First parameter"),bo(r))throw new TypeError("This stream has already been locked for exclusive reading by another reader");N5(this,r),this._readRequests=new ka}get closed(){return vo(this)?this._closedPromise:$e(Tp("closed"))}cancel(r=void 0){return vo(this)?this._ownerReadableStream===void 0?$e(Up("cancel")):Nv(this,r):$e(Tp("cancel"))}read(){if(!vo(this))return $e(Tp("read"));if(this._ownerReadableStream===void 0)return $e(Up("read from"));let r,t,i=kt((a,n)=>{r=a,t=n});return Gu(this,{_chunkSteps:a=>r({value:a,done:!1}),_closeSteps:()=>r({value:void 0,done:!0}),_errorSteps:a=>t(a)}),i}releaseLock(){if(!vo(this))throw Tp("releaseLock");this._ownerReadableStream!==void 0&&function(r){Pn(r);let t=new TypeError("Reader was released");$5(r,t)}(this)}};function vo(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")&&e instanceof An}function Gu(e,r){let t=e._ownerReadableStream;t._disturbed=!0,t._state==="closed"?r._closeSteps():t._state==="errored"?r._errorSteps(t._storedError):t._readableStreamController[qv](r)}function $5(e,r){let t=e._readRequests;e._readRequests=new ka,t.forEach(i=>{i._errorSteps(r)})}function Tp(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}var bv,xv,_v;function zu(e){return e.slice()}function W5(e,r,t,i,a){new Uint8Array(e).set(new Uint8Array(t,i,a),r)}Object.defineProperties(An.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),Pr(An.prototype.cancel,"cancel"),Pr(An.prototype.read,"read"),Pr(An.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(An.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});var ts=e=>(ts=typeof e.transfer=="function"?r=>r.transfer():typeof structuredClone=="function"?r=>structuredClone(r,{transfer:[r]}):r=>r,ts(e)),as=e=>(as=typeof e.detached=="boolean"?r=>r.detached:r=>r.byteLength===0,as(e));function X5(e,r,t){if(e.slice)return e.slice(r,t);let i=t-r,a=new ArrayBuffer(i);return W5(a,0,e,r,i),a}function Nu(e,r){let t=e[r];if(t!=null){if(typeof t!="function")throw new TypeError(`${String(r)} is not a function`);return t}}function _5(e){try{let r=e.done,t=e.value;return rn(tV(t),i=>({done:r,value:i}))}catch(r){return $e(r)}}var Zu=(_v=(bv=Symbol.asyncIterator)!==null&&bv!==void 0?bv:(xv=Symbol.for)===null||xv===void 0?void 0:xv.call(Symbol,"Symbol.asyncIterator"))!==null&&_v!==void 0?_v:"@@asyncIterator";function Y5(e,r="sync",t){if(t===void 0)if(r==="async"){if((t=Nu(e,Zu))===void 0)return function(a){let n={next(){let o;try{o=Q5(a)}catch(s){return $e(s)}return _5(o)},return(o){let s;try{let c=Nu(a.iterator,"return");if(c===void 0)return Or({done:!0,value:o});s=rs(c,a.iterator,[o])}catch(c){return $e(c)}return mt(s)?_5(s):$e(new TypeError("The iterator.return() method must return an object"))}};return{iterator:n,nextMethod:n.next,done:!1}}(Y5(e,"sync",Nu(e,Symbol.iterator)))}else t=Nu(e,Symbol.iterator);if(t===void 0)throw new TypeError("The object is not iterable");let i=rs(t,e,[]);if(!mt(i))throw new TypeError("The iterator method must return an object");return{iterator:i,nextMethod:i.next,done:!1}}function Q5(e){let r=rs(e.nextMethod,e.iterator,[]);if(!mt(r))throw new TypeError("The iterator.next() method must return an object");return r}var Hp=class{constructor(r,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=r,this._preventCancel=t}next(){let r=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?On(this._ongoingPromise,r,r):r(),this._ongoingPromise}return(r){let t=()=>this._returnSteps(r);return this._ongoingPromise?On(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let r=this._reader,t,i,a=kt((n,o)=>{t=n,i=o});return Gu(r,{_chunkSteps:n=>{this._ongoingPromise=void 0,es(()=>t({value:n,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,Pn(r),t({value:void 0,done:!0})},_errorSteps:n=>{this._ongoingPromise=void 0,this._isFinished=!0,Pn(r),i(n)}}),a}_returnSteps(r){if(this._isFinished)return Promise.resolve({value:r,done:!0});this._isFinished=!0;let t=this._reader;if(!this._preventCancel){let i=Nv(t,r);return Pn(t),On(i,()=>({value:r,done:!0}))}return Pn(t),Or({value:r,done:!0})}},J5={next(){return w5(this)?this._asyncIteratorImpl.next():$e(k5("next"))},return(e){return w5(this)?this._asyncIteratorImpl.return(e):$e(k5("return"))},[Zu](){return this}};function w5(e){if(!mt(e)||!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof Hp}catch{return!1}}function k5(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}Object.defineProperty(J5,Zu,{enumerable:!1});var Z5=Number.isNaN||function(e){return e!=e};function S5(e){let r=X5(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(r)}function Pv(e){let r=e._queue.shift();return e._queueTotalSize-=r.size,e._queueTotalSize<0&&(e._queueTotalSize=0),r.value}function $v(e,r,t){if(typeof(i=t)!="number"||Z5(i)||i<0||t===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");var i;e._queue.push({value:r,size:t}),e._queueTotalSize+=t}function xo(e){e._queue=new ka,e._queueTotalSize=0}function eA(e){return e===DataView}var yo=class{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!wv(this))throw kv("view");return this._view}respond(r){if(!wv(this))throw kv("respond");if(Cn(r,1,"respond"),r=Vv(r,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(as(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");Dp(this._associatedReadableByteStreamController,r)}respondWithNewView(r){if(!wv(this))throw kv("respondWithNewView");if(Cn(r,1,"respondWithNewView"),!ArrayBuffer.isView(r))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(as(r.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");qp(this._associatedReadableByteStreamController,r)}};Object.defineProperties(yo.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),Pr(yo.prototype.respond,"respond"),Pr(yo.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(yo.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var Zi=class{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Jo(this))throw qu("byobRequest");return Bv(this)}get desiredSize(){if(!Jo(this))throw qu("desiredSize");return lA(this)}close(){if(!Jo(this))throw qu("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let r=this._controlledReadableByteStream._state;if(r!=="readable")throw new TypeError(`The stream (in ${r} state) is not in the readable state and cannot be closed`);Uu(this)}enqueue(r){if(!Jo(this))throw qu("enqueue");if(Cn(r,1,"enqueue"),!ArrayBuffer.isView(r))throw new TypeError("chunk must be an array buffer view");if(r.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(r.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let t=this._controlledReadableByteStream._state;if(t!=="readable")throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be enqueued to`);Lp(this,r)}error(r=void 0){if(!Jo(this))throw qu("error");Qa(this,r)}[Dv](r){rA(this),xo(this);let t=this._cancelAlgorithm(r);return Qp(this),t}[qv](r){let t=this._controlledReadableByteStream;if(this._queueTotalSize>0)return void uA(this,r);let i=this._autoAllocateChunkSize;if(i!==void 0){let a;try{a=new ArrayBuffer(i)}catch(o){return void r._errorSteps(o)}let n={buffer:a,bufferByteLength:i,byteOffset:0,byteLength:i,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(n)}G5(t,r),os(this)}[zv](){if(this._pendingPullIntos.length>0){let r=this._pendingPullIntos.peek();r.readerType="none",this._pendingPullIntos=new ka,this._pendingPullIntos.push(r)}}};function Jo(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")&&e instanceof Zi}function wv(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")&&e instanceof yo}function os(e){if(function(t){let i=t._controlledReadableByteStream;return i._state!=="readable"||t._closeRequested||!t._started?!1:!!(K5(i)&&Yp(i)>0||Xv(i)&&hA(i)>0||lA(t)>0)}(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,wa(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,os(e)),null),t=>(Qa(e,t),null))}}function rA(e){Wv(e),e._pendingPullIntos=new ka}function Ov(e,r){let t=!1;e._state==="closed"&&(t=!0);let i=tA(r);r.readerType==="default"?Kv(e,i,t):function(a,n,o){let s=a._reader,c=s._readIntoRequests.shift();o?c._closeSteps(n):c._chunkSteps(n)}(e,i,t)}function tA(e){let r=e.bytesFilled,t=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,r/t)}function Mp(e,r,t,i){e._queue.push({buffer:r,byteOffset:t,byteLength:i}),e._queueTotalSize+=i}function aA(e,r,t,i){let a;try{a=X5(r,t,t+i)}catch(n){throw Qa(e,n),n}Mp(e,a,0,i)}function iA(e,r){r.bytesFilled>0&&aA(e,r.buffer,r.byteOffset,r.bytesFilled),lc(e)}function nA(e,r){let t=Math.min(e._queueTotalSize,r.byteLength-r.bytesFilled),i=r.bytesFilled+t,a=t,n=!1,o=i-i%r.elementSize;o>=r.minimumFill&&(a=o-r.bytesFilled,n=!0);let s=e._queue;for(;a>0;){let c=s.peek(),u=Math.min(a,c.byteLength),l=r.byteOffset+r.bytesFilled;W5(r.buffer,l,c.buffer,c.byteOffset,u),c.byteLength===u?s.shift():(c.byteOffset+=u,c.byteLength-=u),e._queueTotalSize-=u,oA(e,u,r),a-=u}return n}function oA(e,r,t){t.bytesFilled+=r}function sA(e){e._queueTotalSize===0&&e._closeRequested?(Qp(e),el(e._controlledReadableByteStream)):os(e)}function Wv(e){e._byobRequest!==null&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function Cv(e){for(;e._pendingPullIntos.length>0;){if(e._queueTotalSize===0)return;let r=e._pendingPullIntos.peek();nA(e,r)&&(lc(e),Ov(e._controlledReadableByteStream,r))}}function iV(e,r,t,i){let a=e._controlledReadableByteStream,n=r.constructor,o=function(p){return eA(p)?1:p.BYTES_PER_ELEMENT}(n),{byteOffset:s,byteLength:c}=r,u=t*o,l;try{l=ts(r.buffer)}catch(p){return void i._errorSteps(p)}let h={buffer:l,bufferByteLength:l.byteLength,byteOffset:s,byteLength:c,bytesFilled:0,minimumFill:u,elementSize:o,viewConstructor:n,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(h),void E5(a,i);if(a._state!=="closed"){if(e._queueTotalSize>0){if(nA(e,h)){let p=tA(h);return sA(e),void i._chunkSteps(p)}if(e._closeRequested){let p=new TypeError("Insufficient bytes to fill elements in the given buffer");return Qa(e,p),void i._errorSteps(p)}}e._pendingPullIntos.push(h),E5(a,i),os(e)}else{let p=new n(h.buffer,h.byteOffset,0);i._closeSteps(p)}}function cA(e,r){let t=e._pendingPullIntos.peek();Wv(e),e._controlledReadableByteStream._state==="closed"?function(i,a){a.readerType==="none"&&lc(i);let n=i._controlledReadableByteStream;if(Xv(n))for(;hA(n)>0;)Ov(n,lc(i))}(e,t):function(i,a,n){if(oA(0,a,n),n.readerType==="none")return iA(i,n),void Cv(i);if(n.bytesFilled<n.minimumFill)return;lc(i);let o=n.bytesFilled%n.elementSize;if(o>0){let s=n.byteOffset+n.bytesFilled;aA(i,n.buffer,s-o,o)}n.bytesFilled-=o,Ov(i._controlledReadableByteStream,n),Cv(i)}(e,r,t),os(e)}function lc(e){return e._pendingPullIntos.shift()}function Qp(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Uu(e){let r=e._controlledReadableByteStream;if(!e._closeRequested&&r._state==="readable")if(e._queueTotalSize>0)e._closeRequested=!0;else{if(e._pendingPullIntos.length>0){let t=e._pendingPullIntos.peek();if(t.bytesFilled%t.elementSize!=0){let i=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Qa(e,i),i}}Qp(e),el(r)}}function Lp(e,r){let t=e._controlledReadableByteStream;if(e._closeRequested||t._state!=="readable")return;let{buffer:i,byteOffset:a,byteLength:n}=r;if(as(i))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let o=ts(i);if(e._pendingPullIntos.length>0){let s=e._pendingPullIntos.peek();if(as(s.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Wv(e),s.buffer=ts(s.buffer),s.readerType==="none"&&iA(e,s)}K5(t)?(function(s){let c=s._controlledReadableByteStream._reader;for(;c._readRequests.length>0;){if(s._queueTotalSize===0)return;uA(s,c._readRequests.shift())}}(e),Yp(t)===0?Mp(e,o,a,n):(e._pendingPullIntos.length>0&&lc(e),Kv(t,new Uint8Array(o,a,n),!1))):Xv(t)?(Mp(e,o,a,n),Cv(e)):Mp(e,o,a,n),os(e)}function Qa(e,r){let t=e._controlledReadableByteStream;t._state==="readable"&&(rA(e),xo(e),Qp(e),BA(t,r))}function uA(e,r){let t=e._queue.shift();e._queueTotalSize-=t.byteLength,sA(e);let i=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);r._chunkSteps(i)}function Bv(e){if(e._byobRequest===null&&e._pendingPullIntos.length>0){let r=e._pendingPullIntos.peek(),t=new Uint8Array(r.buffer,r.byteOffset+r.bytesFilled,r.byteLength-r.bytesFilled),i=Object.create(yo.prototype);(function(a,n,o){a._associatedReadableByteStreamController=n,a._view=o})(i,e,t),e._byobRequest=i}return e._byobRequest}function lA(e){let r=e._controlledReadableByteStream._state;return r==="errored"?null:r==="closed"?0:e._strategyHWM-e._queueTotalSize}function Dp(e,r){let t=e._pendingPullIntos.peek();if(e._controlledReadableByteStream._state==="closed"){if(r!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(r===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(t.bytesFilled+r>t.byteLength)throw new RangeError("bytesWritten out of range")}t.buffer=ts(t.buffer),cA(e,r)}function qp(e,r){let t=e._pendingPullIntos.peek();if(e._controlledReadableByteStream._state==="closed"){if(r.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(r.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(t.byteOffset+t.bytesFilled!==r.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(t.bufferByteLength!==r.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(t.bytesFilled+r.byteLength>t.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let i=r.byteLength;t.buffer=ts(r.buffer),cA(e,i)}function fA(e,r,t,i,a,n,o){r._controlledReadableByteStream=e,r._pullAgain=!1,r._pulling=!1,r._byobRequest=null,r._queue=r._queueTotalSize=void 0,xo(r),r._closeRequested=!1,r._started=!1,r._strategyHWM=n,r._pullAlgorithm=i,r._cancelAlgorithm=a,r._autoAllocateChunkSize=o,r._pendingPullIntos=new ka,e._readableStreamController=r,wa(Or(t()),()=>(r._started=!0,os(r),null),s=>(Qa(r,s),null))}function kv(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function qu(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function nV(e,r){if((e=`${e}`)!="byob")throw new TypeError(`${r} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function pA(e){return new jn(e)}function E5(e,r){e._reader._readIntoRequests.push(r)}function hA(e){return e._reader._readIntoRequests.length}function Xv(e){let r=e._reader;return r!==void 0&&!!Zo(r)}Object.defineProperties(Zi.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),Pr(Zi.prototype.close,"close"),Pr(Zi.prototype.enqueue,"enqueue"),Pr(Zi.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Zi.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});var jn=class{constructor(r){if(Cn(r,1,"ReadableStreamBYOBReader"),Gv(r,"First parameter"),bo(r))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Jo(r._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");N5(this,r),this._readIntoRequests=new ka}get closed(){return Zo(this)?this._closedPromise:$e(Rp("closed"))}cancel(r=void 0){return Zo(this)?this._ownerReadableStream===void 0?$e(Up("cancel")):Nv(this,r):$e(Rp("cancel"))}read(r,t={}){if(!Zo(this))return $e(Rp("read"));if(!ArrayBuffer.isView(r))return $e(new TypeError("view must be an array buffer view"));if(r.byteLength===0)return $e(new TypeError("view must have non-zero byteLength"));if(r.buffer.byteLength===0)return $e(new TypeError("view's buffer must have non-zero byteLength"));if(as(r.buffer))return $e(new TypeError("view's buffer has been detached"));let i;try{i=function(c,u){var l;return tn(c,u),{min:Vv((l=c==null?void 0:c.min)!==null&&l!==void 0?l:1,`${u} has member 'min' that`)}}(t,"options")}catch(c){return $e(c)}let a=i.min;if(a===0)return $e(new TypeError("options.min must be greater than 0"));if(function(c){return eA(c.constructor)}(r)){if(a>r.byteLength)return $e(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(a>r.length)return $e(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return $e(Up("read from"));let n,o,s=kt((c,u)=>{n=c,o=u});return dA(this,r,a,{_chunkSteps:c=>n({value:c,done:!1}),_closeSteps:c=>n({value:c,done:!0}),_errorSteps:c=>o(c)}),s}releaseLock(){if(!Zo(this))throw Rp("releaseLock");this._ownerReadableStream!==void 0&&function(r){Pn(r);let t=new TypeError("Reader was released");mA(r,t)}(this)}};function Zo(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")&&e instanceof jn}function dA(e,r,t,i){let a=e._ownerReadableStream;a._disturbed=!0,a._state==="errored"?i._errorSteps(a._storedError):iV(a._readableStreamController,r,t,i)}function mA(e,r){let t=e._readIntoRequests;e._readIntoRequests=new ka,t.forEach(i=>{i._errorSteps(r)})}function Rp(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function Ku(e,r){let{highWaterMark:t}=e;if(t===void 0)return r;if(Z5(t)||t<0)throw new RangeError("Invalid highWaterMark");return t}function Vp(e){let{size:r}=e;return r||(()=>1)}function Gp(e,r){tn(e,r);let t=e==null?void 0:e.highWaterMark,i=e==null?void 0:e.size;return{highWaterMark:t===void 0?void 0:Hv(t),size:i===void 0?void 0:oV(i,`${r} has member 'size' that`)}}function oV(e,r){return Ja(e,r),t=>Hv(e(t))}function sV(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}function cV(e,r,t){return Ja(e,t),()=>Bn(e,r,[])}function uV(e,r,t){return Ja(e,t),i=>rs(e,r,[i])}function lV(e,r,t){return Ja(e,t),(i,a)=>Bn(e,r,[i,a])}function gA(e,r){if(!cc(e))throw new TypeError(`${r} is not a WritableStream.`)}Object.defineProperties(jn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),Pr(jn.prototype.cancel,"cancel"),Pr(jn.prototype.read,"read"),Pr(jn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(jn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});var fV=typeof AbortController=="function",Tn=class{constructor(r={},t={}){r===void 0?r=null:V5(r,"First parameter");let i=Gp(t,"Second parameter"),a=function(o,s){tn(o,s);let c=o==null?void 0:o.abort,u=o==null?void 0:o.close,l=o==null?void 0:o.start,h=o==null?void 0:o.type,p=o==null?void 0:o.write;return{abort:c===void 0?void 0:sV(c,o,`${s} has member 'abort' that`),close:u===void 0?void 0:cV(u,o,`${s} has member 'close' that`),start:l===void 0?void 0:uV(l,o,`${s} has member 'start' that`),write:p===void 0?void 0:lV(p,o,`${s} has member 'write' that`),type:h}}(r,"First parameter");if(yA(this),a.type!==void 0)throw new RangeError("Invalid type is specified");let n=Vp(i);(function(o,s,c,u){let l=Object.create(is.prototype),h,p,d,v;h=s.start!==void 0?()=>s.start(l):()=>{},p=s.write!==void 0?x=>s.write(x,l):()=>Or(void 0),d=s.close!==void 0?()=>s.close():()=>Or(void 0),v=s.abort!==void 0?x=>s.abort(x):()=>Or(void 0),EA(o,l,h,p,d,v,c,u)})(this,a,Ku(i,1),n)}get locked(){if(!cc(this))throw Op("locked");return fc(this)}abort(r=void 0){return cc(this)?fc(this)?$e(new TypeError("Cannot abort a stream that already has a writer")):Kp(this,r):$e(Op("abort"))}close(){return cc(this)?fc(this)?$e(new TypeError("Cannot close a stream that already has a writer")):an(this)?$e(new TypeError("Cannot close an already-closing stream")):bA(this):$e(Op("close"))}getWriter(){if(!cc(this))throw Op("getWriter");return vA(this)}};function vA(e){return new Ji(e)}function yA(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new ka,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function cc(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")&&e instanceof Tn}function fc(e){return e._writer!==void 0}function Kp(e,r){var t;if(e._state==="closed"||e._state==="errored")return Or(void 0);e._writableStreamController._abortReason=r,(t=e._writableStreamController._abortController)===null||t===void 0||t.abort(r);let i=e._state;if(i==="closed"||i==="errored")return Or(void 0);if(e._pendingAbortRequest!==void 0)return e._pendingAbortRequest._promise;let a=!1;i==="erroring"&&(a=!0,r=void 0);let n=kt((o,s)=>{e._pendingAbortRequest={_promise:void 0,_resolve:o,_reject:s,_reason:r,_wasAlreadyErroring:a}});return e._pendingAbortRequest._promise=n,a||Yv(e,r),n}function bA(e){let r=e._state;if(r==="closed"||r==="errored")return $e(new TypeError(`The stream (in ${r} state) is not in the writable state and cannot be closed`));let t=kt((n,o)=>{let s={_resolve:n,_reject:o};e._closeRequest=s}),i=e._writer;var a;return i!==void 0&&e._backpressure&&r==="writable"&&r1(i),$v(a=e._writableStreamController,SA,0),Jp(a),t}function Fv(e,r){e._state!=="writable"?Qv(e):Yv(e,r)}function Yv(e,r){let t=e._writableStreamController;e._state="erroring",e._storedError=r;let i=e._writer;i!==void 0&&_A(i,r),!function(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}(e)&&t._started&&Qv(e)}function Qv(e){e._state="errored",e._writableStreamController[z5]();let r=e._storedError;if(e._writeRequests.forEach(i=>{i._reject(r)}),e._writeRequests=new ka,e._pendingAbortRequest===void 0)return void Pp(e);let t=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,t._wasAlreadyErroring)return t._reject(r),void Pp(e);wa(e._writableStreamController[q5](t._reason),()=>(t._resolve(),Pp(e),null),i=>(t._reject(i),Pp(e),null))}function an(e){return e._closeRequest!==void 0||e._inFlightCloseRequest!==void 0}function Pp(e){e._closeRequest!==void 0&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);let r=e._writer;r!==void 0&&e1(r,e._storedError)}function Jv(e,r){let t=e._writer;t!==void 0&&r!==e._backpressure&&(r?function(i){Zp(i)}(t):r1(t)),e._backpressure=r}Object.defineProperties(Tn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),Pr(Tn.prototype.abort,"abort"),Pr(Tn.prototype.close,"close"),Pr(Tn.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Tn.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});var Ji=class{constructor(r){if(Cn(r,1,"WritableStreamDefaultWriter"),gA(r,"First parameter"),fc(r))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=r,r._writer=this;let t=r._state;if(t==="writable")!an(r)&&r._backpressure?Zp(this):A5(this),zp(this);else if(t==="erroring")Iv(this,r._storedError),zp(this);else if(t==="closed")A5(this),zp(i=this),RA(i);else{let a=r._storedError;Iv(this,a),TA(this,a)}var i}get closed(){return Xo(this)?this._closedPromise:$e(Yo("closed"))}get desiredSize(){if(!Xo(this))throw Yo("desiredSize");if(this._ownerWritableStream===void 0)throw Hu("desiredSize");return function(r){let t=r._ownerWritableStream,i=t._state;return i==="errored"||i==="erroring"?null:i==="closed"?0:AA(t._writableStreamController)}(this)}get ready(){return Xo(this)?this._readyPromise:$e(Yo("ready"))}abort(r=void 0){return Xo(this)?this._ownerWritableStream===void 0?$e(Hu("abort")):function(t,i){return Kp(t._ownerWritableStream,i)}(this,r):$e(Yo("abort"))}close(){if(!Xo(this))return $e(Yo("close"));let r=this._ownerWritableStream;return r===void 0?$e(Hu("close")):an(r)?$e(new TypeError("Cannot close an already-closing stream")):xA(this)}releaseLock(){if(!Xo(this))throw Yo("releaseLock");this._ownerWritableStream!==void 0&&wA(this)}write(r=void 0){return Xo(this)?this._ownerWritableStream===void 0?$e(Hu("write to")):kA(this,r):$e(Yo("write"))}};function Xo(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")&&e instanceof Ji}function xA(e){return bA(e._ownerWritableStream)}function pV(e,r){e._closedPromiseState==="pending"?e1(e,r):function(t,i){TA(t,i)}(e,r)}function _A(e,r){e._readyPromiseState==="pending"?PA(e,r):function(t,i){Iv(t,i)}(e,r)}function wA(e){let r=e._ownerWritableStream,t=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");_A(e,t),pV(e,t),r._writer=void 0,e._ownerWritableStream=void 0}function kA(e,r){let t=e._ownerWritableStream,i=t._writableStreamController,a=function(s,c){try{return s._strategySizeAlgorithm(c)}catch(u){return $u(s,u),1}}(i,r);if(t!==e._ownerWritableStream)return $e(Hu("write to"));let n=t._state;if(n==="errored")return $e(t._storedError);if(an(t)||n==="closed")return $e(new TypeError("The stream is closing or closed and cannot be written to"));if(n==="erroring")return $e(t._storedError);let o=function(s){return kt((c,u)=>{let l={_resolve:c,_reject:u};s._writeRequests.push(l)})}(t);return function(s,c,u){try{$v(s,c,u)}catch(h){return void $u(s,h)}let l=s._controlledWritableStream;!an(l)&&l._state==="writable"&&Jv(l,Zv(s)),Jp(s)}(i,r,a),o}Object.defineProperties(Ji.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),Pr(Ji.prototype.abort,"abort"),Pr(Ji.prototype.close,"close"),Pr(Ji.prototype.releaseLock,"releaseLock"),Pr(Ji.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ji.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});var SA={},is=class{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!Sv(this))throw Ev("abortReason");return this._abortReason}get signal(){if(!Sv(this))throw Ev("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(r=void 0){if(!Sv(this))throw Ev("error");this._controlledWritableStream._state==="writable"&&jA(this,r)}[q5](r){let t=this._abortAlgorithm(r);return $p(this),t}[z5](){xo(this)}};function Sv(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")&&e instanceof is}function EA(e,r,t,i,a,n,o,s){r._controlledWritableStream=e,e._writableStreamController=r,r._queue=void 0,r._queueTotalSize=void 0,xo(r),r._abortReason=void 0,r._abortController=function(){if(fV)return new AbortController}(),r._started=!1,r._strategySizeAlgorithm=s,r._strategyHWM=o,r._writeAlgorithm=i,r._closeAlgorithm=a,r._abortAlgorithm=n;let c=Zv(r);Jv(e,c),wa(Or(t()),()=>(r._started=!0,Jp(r),null),u=>(r._started=!0,Fv(e,u),null))}function $p(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function AA(e){return e._strategyHWM-e._queueTotalSize}function Jp(e){let r=e._controlledWritableStream;if(!e._started||r._inFlightWriteRequest!==void 0)return;if(r._state==="erroring")return void Qv(r);if(e._queue.length===0)return;let t=e._queue.peek().value;t===SA?function(i){let a=i._controlledWritableStream;(function(o){o._inFlightCloseRequest=o._closeRequest,o._closeRequest=void 0})(a),Pv(i);let n=i._closeAlgorithm();$p(i),wa(n,()=>(function(o){o._inFlightCloseRequest._resolve(void 0),o._inFlightCloseRequest=void 0,o._state==="erroring"&&(o._storedError=void 0,o._pendingAbortRequest!==void 0&&(o._pendingAbortRequest._resolve(),o._pendingAbortRequest=void 0)),o._state="closed";let s=o._writer;s!==void 0&&RA(s)}(a),null),o=>(function(s,c){s._inFlightCloseRequest._reject(c),s._inFlightCloseRequest=void 0,s._pendingAbortRequest!==void 0&&(s._pendingAbortRequest._reject(c),s._pendingAbortRequest=void 0),Fv(s,c)}(a,o),null))}(e):function(i,a){let n=i._controlledWritableStream;(function(s){s._inFlightWriteRequest=s._writeRequests.shift()})(n);let o=i._writeAlgorithm(a);wa(o,()=>{(function(c){c._inFlightWriteRequest._resolve(void 0),c._inFlightWriteRequest=void 0})(n);let s=n._state;if(Pv(i),!an(n)&&s==="writable"){let c=Zv(i);Jv(n,c)}return Jp(i),null},s=>(n._state==="writable"&&$p(i),function(c,u){c._inFlightWriteRequest._reject(u),c._inFlightWriteRequest=void 0,Fv(c,u)}(n,s),null))}(e,t)}function $u(e,r){e._controlledWritableStream._state==="writable"&&jA(e,r)}function Zv(e){return AA(e)<=0}function jA(e,r){let t=e._controlledWritableStream;$p(e),Yv(t,r)}function Op(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function Ev(e){return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function Yo(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function Hu(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function zp(e){e._closedPromise=kt((r,t)=>{e._closedPromise_resolve=r,e._closedPromise_reject=t,e._closedPromiseState="pending"})}function TA(e,r){zp(e),e1(e,r)}function e1(e,r){e._closedPromise_reject!==void 0&&(dc(e._closedPromise),e._closedPromise_reject(r),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function RA(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function Zp(e){e._readyPromise=kt((r,t)=>{e._readyPromise_resolve=r,e._readyPromise_reject=t}),e._readyPromiseState="pending"}function Iv(e,r){Zp(e),PA(e,r)}function A5(e){Zp(e),r1(e)}function PA(e,r){e._readyPromise_reject!==void 0&&(dc(e._readyPromise),e._readyPromise_reject(r),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function r1(e){e._readyPromise_resolve!==void 0&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(is.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(is.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});var j5=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof global<"u"?global:void 0,hV=function(){let e=j5==null?void 0:j5.DOMException;return function(r){if(typeof r!="function"&&typeof r!="object"||r.name!=="DOMException")return!1;try{return new r,!0}catch{return!1}}(e)?e:void 0}()||function(){let e=function(r,t){this.message=r||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return Pr(e,"DOMException"),e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}();function T5(e,r,t,i,a,n){let o=uc(e),s=vA(r);e._disturbed=!0;let c=!1,u=Or(void 0);return kt((l,h)=>{let p;if(n!==void 0){if(p=()=>{let j=n.reason!==void 0?n.reason:new hV("Aborted","AbortError"),P=[];i||P.push(()=>r._state==="writable"?Kp(r,j):Or(void 0)),a||P.push(()=>e._state==="readable"?Si(e,j):Or(void 0)),A(()=>Promise.all(P.map(C=>C())),!0,j)},n.aborted)return void p();n.addEventListener("abort",p)}var d,v,x;if(E(e,o._closedPromise,j=>(i?S(!0,j):A(()=>Kp(r,j),!0,j),null)),E(r,s._closedPromise,j=>(a?S(!0,j):A(()=>Si(e,j),!0,j),null)),d=e,v=o._closedPromise,x=()=>(t?S():A(()=>function(j){let P=j._ownerWritableStream,C=P._state;return an(P)||C==="closed"?Or(void 0):C==="errored"?$e(P._storedError):xA(j)}(s)),null),d._state==="closed"?x():yv(v,x),an(r)||r._state==="closed"){let j=new TypeError("the destination writable stream closed before all data could be piped to it");a?S(!0,j):A(()=>Si(e,j),!0,j)}function y(){let j=u;return rn(u,()=>j!==u?y():void 0)}function E(j,P,C){j._state==="errored"?C(j._storedError):jv(P,C)}function A(j,P,C){function I(){return wa(j(),()=>R(P,C),F=>R(!0,F)),null}c||(c=!0,r._state!=="writable"||an(r)?I():yv(y(),I))}function S(j,P){c||(c=!0,r._state!=="writable"||an(r)?R(j,P):yv(y(),()=>R(j,P)))}function R(j,P){return wA(s),Pn(o),n!==void 0&&n.removeEventListener("abort",p),j?h(P):l(void 0),null}dc(kt((j,P)=>{(function C(I){I?j():rn(c?Or(!0):rn(s._readyPromise,()=>kt((F,H)=>{Gu(o,{_chunkSteps:z=>{u=rn(kA(s,z),void 0,Vu),F(!1)},_closeSteps:()=>F(!0),_errorSteps:H})})),C,P)})(!1)}))})}var en=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Cp(this))throw Bp("desiredSize");return t1(this)}close(){if(!Cp(this))throw Bp("close");if(!hc(this))throw new TypeError("The stream is not in a state that permits close");ns(this)}enqueue(r=void 0){if(!Cp(this))throw Bp("enqueue");if(!hc(this))throw new TypeError("The stream is not in a state that permits enqueue");return pc(this,r)}error(r=void 0){if(!Cp(this))throw Bp("error");Ei(this,r)}[Dv](r){xo(this);let t=this._cancelAlgorithm(r);return Wp(this),t}[qv](r){let t=this._controlledReadableStream;if(this._queue.length>0){let i=Pv(this);this._closeRequested&&this._queue.length===0?(Wp(this),el(t)):Wu(this),r._chunkSteps(i)}else G5(t,r),Wu(this)}[zv](){}};function Cp(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")&&e instanceof en}function Wu(e){if(OA(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,wa(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Wu(e)),null),r=>(Ei(e,r),null))}}function OA(e){let r=e._controlledReadableStream;return!hc(e)||!e._started?!1:bo(r)&&Yp(r)>0?!0:t1(e)>0}function Wp(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function ns(e){if(!hc(e))return;let r=e._controlledReadableStream;e._closeRequested=!0,e._queue.length===0&&(Wp(e),el(r))}function pc(e,r){if(!hc(e))return;let t=e._controlledReadableStream;if(bo(t)&&Yp(t)>0)Kv(t,r,!1);else{let i;try{i=e._strategySizeAlgorithm(r)}catch(a){throw Ei(e,a),a}try{$v(e,r,i)}catch(a){throw Ei(e,a),a}}Wu(e)}function Ei(e,r){let t=e._controlledReadableStream;t._state==="readable"&&(xo(e),Wp(e),BA(t,r))}function t1(e){let r=e._controlledReadableStream._state;return r==="errored"?null:r==="closed"?0:e._strategyHWM-e._queueTotalSize}function hc(e){let r=e._controlledReadableStream._state;return!e._closeRequested&&r==="readable"}function CA(e,r,t,i,a,n,o){r._controlledReadableStream=e,r._queue=void 0,r._queueTotalSize=void 0,xo(r),r._started=!1,r._closeRequested=!1,r._pullAgain=!1,r._pulling=!1,r._strategySizeAlgorithm=o,r._strategyHWM=n,r._pullAlgorithm=i,r._cancelAlgorithm=a,e._readableStreamController=r,wa(Or(t()),()=>(r._started=!0,Wu(r),null),s=>(Ei(r,s),null))}function Bp(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function dV(e,r){return Jo(e._readableStreamController)?function(t){let i,a,n,o,s,c=uc(t),u=!1,l=!1,h=!1,p=!1,d=!1,v=kt(C=>{s=C});function x(C){jv(C._closedPromise,I=>(C!==c||(Qa(n._readableStreamController,I),Qa(o._readableStreamController,I),p&&d||s(void 0)),null))}function y(){Zo(c)&&(Pn(c),c=uc(t),x(c)),Gu(c,{_chunkSteps:C=>{es(()=>{l=!1,h=!1;let I=C,F=C;if(!p&&!d)try{F=S5(C)}catch(H){return Qa(n._readableStreamController,H),Qa(o._readableStreamController,H),void s(Si(t,H))}p||Lp(n._readableStreamController,I),d||Lp(o._readableStreamController,F),u=!1,l?A():h&&S()})},_closeSteps:()=>{u=!1,p||Uu(n._readableStreamController),d||Uu(o._readableStreamController),n._readableStreamController._pendingPullIntos.length>0&&Dp(n._readableStreamController,0),o._readableStreamController._pendingPullIntos.length>0&&Dp(o._readableStreamController,0),p&&d||s(void 0)},_errorSteps:()=>{u=!1}})}function E(C,I){vo(c)&&(Pn(c),c=pA(t),x(c));let F=I?o:n,H=I?n:o;dA(c,C,1,{_chunkSteps:z=>{es(()=>{l=!1,h=!1;let G=I?d:p;if(I?p:d)G||qp(F._readableStreamController,z);else{let D;try{D=S5(z)}catch(V){return Qa(F._readableStreamController,V),Qa(H._readableStreamController,V),void s(Si(t,V))}G||qp(F._readableStreamController,z),Lp(H._readableStreamController,D)}u=!1,l?A():h&&S()})},_closeSteps:z=>{u=!1;let G=I?d:p,D=I?p:d;G||Uu(F._readableStreamController),D||Uu(H._readableStreamController),z!==void 0&&(G||qp(F._readableStreamController,z),!D&&H._readableStreamController._pendingPullIntos.length>0&&Dp(H._readableStreamController,0)),G&&D||s(void 0)},_errorSteps:()=>{u=!1}})}function A(){if(u)return l=!0,Or(void 0);u=!0;let C=Bv(n._readableStreamController);return C===null?y():E(C._view,!1),Or(void 0)}function S(){if(u)return h=!0,Or(void 0);u=!0;let C=Bv(o._readableStreamController);return C===null?y():E(C._view,!0),Or(void 0)}function R(C){if(p=!0,i=C,d){let I=zu([i,a]),F=Si(t,I);s(F)}return v}function j(C){if(d=!0,a=C,p){let I=zu([i,a]),F=Si(t,I);s(F)}return v}function P(){}return n=P5(P,A,R),o=P5(P,S,j),x(c),[n,o]}(e):function(t,i){let a=uc(t),n,o,s,c,u,l=!1,h=!1,p=!1,d=!1,v=kt(S=>{u=S});function x(){return l?(h=!0,Or(void 0)):(l=!0,Gu(a,{_chunkSteps:S=>{es(()=>{h=!1;let R=S,j=S;p||pc(s._readableStreamController,R),d||pc(c._readableStreamController,j),l=!1,h&&x()})},_closeSteps:()=>{l=!1,p||ns(s._readableStreamController),d||ns(c._readableStreamController),p&&d||u(void 0)},_errorSteps:()=>{l=!1}}),Or(void 0))}function y(S){if(p=!0,n=S,d){let R=zu([n,o]),j=Si(t,R);u(j)}return v}function E(S){if(d=!0,o=S,p){let R=zu([n,o]),j=Si(t,R);u(j)}return v}function A(){}return s=Xu(A,x,y),c=Xu(A,x,E),jv(a._closedPromise,S=>(Ei(s._readableStreamController,S),Ei(c._readableStreamController,S),p&&d||u(void 0),null)),[s,c]}(e)}function mV(e){return mt(r=e)&&r.getReader!==void 0?function(t){let i;function a(){let o;try{o=t.read()}catch(s){return $e(s)}return On(o,s=>{if(!mt(s))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(s.done)ns(i._readableStreamController);else{let c=s.value;pc(i._readableStreamController,c)}})}function n(o){try{return Or(t.cancel(o))}catch(s){return $e(s)}}return i=Xu(Vu,a,n,0),i}(e.getReader()):function(t){let i,a=Y5(t,"async");function n(){let s;try{s=Q5(a)}catch(c){return $e(c)}return On(Or(s),c=>{if(!mt(c))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(c.done)ns(i._readableStreamController);else{let u=c.value;pc(i._readableStreamController,u)}})}function o(s){let c=a.iterator,u;try{u=Nu(c,"return")}catch(l){return $e(l)}return u===void 0?Or(void 0):On(Bn(u,c,[s]),l=>{if(!mt(l))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return i=Xu(Vu,n,o,0),i}(e);var r}function gV(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}function vV(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}function yV(e,r,t){return Ja(e,t),i=>rs(e,r,[i])}function bV(e,r){if((e=`${e}`)!="bytes")throw new TypeError(`${r} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function R5(e,r){tn(e,r);let t=e==null?void 0:e.preventAbort,i=e==null?void 0:e.preventCancel,a=e==null?void 0:e.preventClose,n=e==null?void 0:e.signal;return n!==void 0&&function(o,s){if(!function(c){if(typeof c!="object"||c===null)return!1;try{return typeof c.aborted=="boolean"}catch{return!1}}(o))throw new TypeError(`${s} is not an AbortSignal.`)}(n,`${r} has member 'signal' that`),{preventAbort:Boolean(t),preventCancel:Boolean(i),preventClose:Boolean(a),signal:n}}Object.defineProperties(en.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),Pr(en.prototype.close,"close"),Pr(en.prototype.enqueue,"enqueue"),Pr(en.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(en.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});var Bt=class{constructor(r={},t={}){r===void 0?r=null:V5(r,"First parameter");let i=Gp(t,"Second parameter"),a=function(n,o){tn(n,o);let s=n,c=s==null?void 0:s.autoAllocateChunkSize,u=s==null?void 0:s.cancel,l=s==null?void 0:s.pull,h=s==null?void 0:s.start,p=s==null?void 0:s.type;return{autoAllocateChunkSize:c===void 0?void 0:Vv(c,`${o} has member 'autoAllocateChunkSize' that`),cancel:u===void 0?void 0:gV(u,s,`${o} has member 'cancel' that`),pull:l===void 0?void 0:vV(l,s,`${o} has member 'pull' that`),start:h===void 0?void 0:yV(h,s,`${o} has member 'start' that`),type:p===void 0?void 0:bV(p,`${o} has member 'type' that`)}}(r,"First parameter");if(a1(this),a.type==="bytes"){if(i.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");(function(n,o,s){let c=Object.create(Zi.prototype),u,l,h;u=o.start!==void 0?()=>o.start(c):()=>{},l=o.pull!==void 0?()=>o.pull(c):()=>Or(void 0),h=o.cancel!==void 0?d=>o.cancel(d):()=>Or(void 0);let p=o.autoAllocateChunkSize;if(p===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");fA(n,c,u,l,h,s,p)})(this,a,Ku(i,0))}else{let n=Vp(i);(function(o,s,c,u){let l=Object.create(en.prototype),h,p,d;h=s.start!==void 0?()=>s.start(l):()=>{},p=s.pull!==void 0?()=>s.pull(l):()=>Or(void 0),d=s.cancel!==void 0?v=>s.cancel(v):()=>Or(void 0),CA(o,l,h,p,d,c,u)})(this,a,Ku(i,1),n)}}get locked(){if(!go(this))throw Qo("locked");return bo(this)}cancel(r=void 0){return go(this)?bo(this)?$e(new TypeError("Cannot cancel a stream that already has a reader")):Si(this,r):$e(Qo("cancel"))}getReader(r=void 0){if(!go(this))throw Qo("getReader");return function(t,i){tn(t,i);let a=t==null?void 0:t.mode;return{mode:a===void 0?void 0:nV(a,`${i} has member 'mode' that`)}}(r,"First parameter").mode===void 0?uc(this):pA(this)}pipeThrough(r,t={}){if(!go(this))throw Qo("pipeThrough");Cn(r,1,"pipeThrough");let i=function(n,o){tn(n,o);let s=n==null?void 0:n.readable;Rv(s,"readable","ReadableWritablePair"),Gv(s,`${o} has member 'readable' that`);let c=n==null?void 0:n.writable;return Rv(c,"writable","ReadableWritablePair"),gA(c,`${o} has member 'writable' that`),{readable:s,writable:c}}(r,"First parameter"),a=R5(t,"Second parameter");if(bo(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(fc(i.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return dc(T5(this,i.writable,a.preventClose,a.preventAbort,a.preventCancel,a.signal)),i.readable}pipeTo(r,t={}){if(!go(this))return $e(Qo("pipeTo"));if(r===void 0)return $e("Parameter 1 is required in 'pipeTo'.");if(!cc(r))return $e(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let i;try{i=R5(t,"Second parameter")}catch(a){return $e(a)}return bo(this)?$e(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):fc(r)?$e(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):T5(this,r,i.preventClose,i.preventAbort,i.preventCancel,i.signal)}tee(){if(!go(this))throw Qo("tee");return zu(dV(this))}values(r=void 0){if(!go(this))throw Qo("values");return function(t,i){let a=uc(t),n=new Hp(a,i),o=Object.create(J5);return o._asyncIteratorImpl=n,o}(this,function(t,i){tn(t,i);let a=t==null?void 0:t.preventCancel;return{preventCancel:Boolean(a)}}(r,"First parameter").preventCancel)}[Zu](r){return this.values(r)}static from(r){return mV(r)}};function Xu(e,r,t,i=1,a=()=>1){let n=Object.create(Bt.prototype);return a1(n),CA(n,Object.create(en.prototype),e,r,t,i,a),n}function P5(e,r,t){let i=Object.create(Bt.prototype);return a1(i),fA(i,Object.create(Zi.prototype),e,r,t,0,void 0),i}function a1(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function go(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")&&e instanceof Bt}function bo(e){return e._reader!==void 0}function Si(e,r){if(e._disturbed=!0,e._state==="closed")return Or(void 0);if(e._state==="errored")return $e(e._storedError);el(e);let t=e._reader;if(t!==void 0&&Zo(t)){let i=t._readIntoRequests;t._readIntoRequests=new ka,i.forEach(a=>{a._closeSteps(void 0)})}return On(e._readableStreamController[Dv](r),Vu)}function el(e){e._state="closed";let r=e._reader;if(r!==void 0&&(H5(r),vo(r))){let t=r._readRequests;r._readRequests=new ka,t.forEach(i=>{i._closeSteps()})}}function BA(e,r){e._state="errored",e._storedError=r;let t=e._reader;t!==void 0&&(Uv(t,r),vo(t)?$5(t,r):mA(t,r))}function Qo(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function FA(e,r){tn(e,r);let t=e==null?void 0:e.highWaterMark;return Rv(t,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Hv(t)}}Object.defineProperties(Bt,{from:{enumerable:!0}}),Object.defineProperties(Bt.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),Pr(Bt.from,"from"),Pr(Bt.prototype.cancel,"cancel"),Pr(Bt.prototype.getReader,"getReader"),Pr(Bt.prototype.pipeThrough,"pipeThrough"),Pr(Bt.prototype.pipeTo,"pipeTo"),Pr(Bt.prototype.tee,"tee"),Pr(Bt.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Bt.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(Bt.prototype,Zu,{value:Bt.prototype.values,writable:!0,configurable:!0});var IA=e=>e.byteLength;Pr(IA,"size");var Yu=class{constructor(r){Cn(r,1,"ByteLengthQueuingStrategy"),r=FA(r,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=r.highWaterMark}get highWaterMark(){if(!C5(this))throw O5("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!C5(this))throw O5("size");return IA}};function O5(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function C5(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")&&e instanceof Yu}Object.defineProperties(Yu.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Yu.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});var MA=()=>1;Pr(MA,"size");var Qu=class{constructor(r){Cn(r,1,"CountQueuingStrategy"),r=FA(r,"First parameter"),this._countQueuingStrategyHighWaterMark=r.highWaterMark}get highWaterMark(){if(!F5(this))throw B5("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!F5(this))throw B5("size");return MA}};function B5(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function F5(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")&&e instanceof Qu}function xV(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}function _V(e,r,t){return Ja(e,t),i=>rs(e,r,[i])}function wV(e,r,t){return Ja(e,t),(i,a)=>Bn(e,r,[i,a])}function kV(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}Object.defineProperties(Qu.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Qu.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});var Ju=class{constructor(r={},t={},i={}){r===void 0&&(r=null);let a=Gp(t,"Second parameter"),n=Gp(i,"Third parameter"),o=function(p,d){tn(p,d);let v=p==null?void 0:p.cancel,x=p==null?void 0:p.flush,y=p==null?void 0:p.readableType,E=p==null?void 0:p.start,A=p==null?void 0:p.transform,S=p==null?void 0:p.writableType;return{cancel:v===void 0?void 0:kV(v,p,`${d} has member 'cancel' that`),flush:x===void 0?void 0:xV(x,p,`${d} has member 'flush' that`),readableType:y,start:E===void 0?void 0:_V(E,p,`${d} has member 'start' that`),transform:A===void 0?void 0:wV(A,p,`${d} has member 'transform' that`),writableType:S}}(r,"First parameter");if(o.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(o.writableType!==void 0)throw new RangeError("Invalid writableType specified");let s=Ku(n,0),c=Vp(n),u=Ku(a,1),l=Vp(a),h;(function(p,d,v,x,y,E){function A(){return d}function S(I){return function(F,H){let z=F._transformStreamController;return F._backpressure?On(F._backpressureChangePromise,()=>{let G=F._writable;if(G._state==="erroring")throw G._storedError;return M5(z,H)}):M5(z,H)}(p,I)}function R(I){return function(F,H){let z=F._transformStreamController;if(z._finishPromise!==void 0)return z._finishPromise;let G=F._readable;z._finishPromise=kt((V,$)=>{z._finishPromise_resolve=V,z._finishPromise_reject=$});let D=z._cancelAlgorithm(H);return Np(z),wa(D,()=>(G._state==="errored"?sc(z,G._storedError):(Ei(G._readableStreamController,H),Av(z)),null),V=>(Ei(G._readableStreamController,V),sc(z,V),null)),z._finishPromise}(p,I)}function j(){return function(I){let F=I._transformStreamController;if(F._finishPromise!==void 0)return F._finishPromise;let H=I._readable;F._finishPromise=kt((G,D)=>{F._finishPromise_resolve=G,F._finishPromise_reject=D});let z=F._flushAlgorithm();return Np(F),wa(z,()=>(H._state==="errored"?sc(F,H._storedError):(ns(H._readableStreamController),Av(F)),null),G=>(Ei(H._readableStreamController,G),sc(F,G),null)),F._finishPromise}(p)}function P(){return function(I){return Xp(I,!1),I._backpressureChangePromise}(p)}function C(I){return function(F,H){let z=F._transformStreamController;if(z._finishPromise!==void 0)return z._finishPromise;let G=F._writable;z._finishPromise=kt((V,$)=>{z._finishPromise_resolve=V,z._finishPromise_reject=$});let D=z._cancelAlgorithm(H);return Np(z),wa(D,()=>(G._state==="errored"?sc(z,G._storedError):($u(G._writableStreamController,H),Mv(F),Av(z)),null),V=>($u(G._writableStreamController,V),Mv(F),sc(z,V),null)),z._finishPromise}(p,I)}p._writable=function(I,F,H,z,G=1,D=()=>1){let V=Object.create(Tn.prototype);return yA(V),EA(V,Object.create(is.prototype),I,F,H,z,G,D),V}(A,S,j,R,v,x),p._readable=Xu(A,P,C,y,E),p._backpressure=void 0,p._backpressureChangePromise=void 0,p._backpressureChangePromise_resolve=void 0,Xp(p,!0),p._transformStreamController=void 0})(this,kt(p=>{h=p}),u,l,s,c),function(p,d){let v=Object.create(Rn.prototype),x,y,E;x=d.transform!==void 0?A=>d.transform(A,v):A=>{try{return DA(v,A),Or(void 0)}catch(S){return $e(S)}},y=d.flush!==void 0?()=>d.flush(v):()=>Or(void 0),E=d.cancel!==void 0?A=>d.cancel(A):()=>Or(void 0),function(A,S,R,j,P){S._controlledTransformStream=A,A._transformStreamController=S,S._transformAlgorithm=R,S._flushAlgorithm=j,S._cancelAlgorithm=P,S._finishPromise=void 0,S._finishPromise_resolve=void 0,S._finishPromise_reject=void 0}(p,v,x,y,E)}(this,o),o.start!==void 0?h(o.start(this._transformStreamController)):h(void 0)}get readable(){if(!I5(this))throw L5("readable");return this._readable}get writable(){if(!I5(this))throw L5("writable");return this._writable}};function I5(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")&&e instanceof Ju}function LA(e,r){Ei(e._readable._readableStreamController,r),i1(e,r)}function i1(e,r){Np(e._transformStreamController),$u(e._writable._writableStreamController,r),Mv(e)}function Mv(e){e._backpressure&&Xp(e,!1)}function Xp(e,r){e._backpressureChangePromise!==void 0&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=kt(t=>{e._backpressureChangePromise_resolve=t}),e._backpressure=r}Object.defineProperties(Ju.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ju.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});var Rn=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Fp(this))throw Ip("desiredSize");return t1(this._controlledTransformStream._readable._readableStreamController)}enqueue(r=void 0){if(!Fp(this))throw Ip("enqueue");DA(this,r)}error(r=void 0){if(!Fp(this))throw Ip("error");var t;t=r,LA(this._controlledTransformStream,t)}terminate(){if(!Fp(this))throw Ip("terminate");(function(r){let t=r._controlledTransformStream;ns(t._readable._readableStreamController);let i=new TypeError("TransformStream terminated");i1(t,i)})(this)}};function Fp(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")&&e instanceof Rn}function Np(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0,e._cancelAlgorithm=void 0}function DA(e,r){let t=e._controlledTransformStream,i=t._readable._readableStreamController;if(!hc(i))throw new TypeError("Readable side is not in a state that permits enqueue");try{pc(i,r)}catch(n){throw i1(t,n),t._readable._storedError}(function(n){return!OA(n)})(i)!==t._backpressure&&Xp(t,!0)}function M5(e,r){return On(e._transformAlgorithm(r),void 0,t=>{throw LA(e._controlledTransformStream,t),t})}function Ip(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function Av(e){e._finishPromise_resolve!==void 0&&(e._finishPromise_resolve(),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function sc(e,r){e._finishPromise_reject!==void 0&&(dc(e._finishPromise),e._finishPromise_reject(r),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function L5(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}Object.defineProperties(Rn.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),Pr(Rn.prototype.enqueue,"enqueue"),Pr(Rn.prototype.error,"error"),Pr(Rn.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Rn.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var eh=class extends Bt{};var rh=class{chunks;isWorking=!1;isCancelled=!1;constructor(r){this.chunks=r}start(r){this.work(r)}async work(r){let{chunks:t}=this;for(this.isWorking=!0;!this.isCancelled&&(r.desiredSize||0)>0;){let i;try{i=t.next()}catch(a){r.error(a);break}i&&(!i.done&&!this.isCancelled?r.enqueue(i.value):r.close())}this.isWorking=!1}pull(r){this.isWorking||this.work(r)}cancel(){this.isCancelled=!0}};var th=class extends eh{_chunks;constructor(r){super(new rh(r.values()),{type:"bytes"}),this._chunks=r}async*[Symbol.asyncIterator](r){let t=this.getReader();yield*this._chunks,t.releaseLock()}};var ss=class{type;size;parts;constructor(r=[],t={}){this.parts=[],this.size=0;for(let i of r)if(typeof i=="string"){let a=new TextEncoder().encode(i);this.parts.push(a),this.size+=a.byteLength}else if(i instanceof ss)this.size+=i.size,this.parts.push(...i.parts);else if(i instanceof ArrayBuffer)this.parts.push(new Uint8Array(i)),this.size+=i.byteLength;else if(i instanceof Uint8Array)this.parts.push(i),this.size+=i.byteLength;else if(ArrayBuffer.isView(i)){let{buffer:a,byteOffset:n,byteLength:o}=i;this.parts.push(new Uint8Array(a,n,o)),this.size+=o}else{let a=new TextEncoder().encode(String(i));this.parts.push(a),this.size+=a.byteLength}this.type=SV(t.type)}slice(r=0,t=this.size,i=""){let{size:a,parts:n}=this,o=r<0?Math.max(a+r,0):Math.min(r,a),s=t<0?Math.max(a+t,0):Math.min(t,a),c=Math.max(s-o,0),u=new ss([],{type:i});if(c===0)return u;let l=0,h=[];for(let p of n){let{byteLength:d}=p;if(o>0&&d<=o)o-=d,s-=d;else{let v=p.subarray(o,Math.min(d,s));if(h.push(v),l+=v.byteLength,o=0,l>=c)break}}return u.parts=h,u.size=l,u}async arrayBuffer(){return this._toArrayBuffer()}async text(){let r=new TextDecoder,t="";for(let i of this.parts)t+=r.decode(i);return t}stream(){return new th(this.parts)}toString(){return"[object Blob]"}get[Symbol.toStringTag](){return"Blob"}_toArrayBuffer(){let r=new ArrayBuffer(this.size),t=new Uint8Array(r),i=0;for(let a of this.parts)t.set(a,i),i+=a.byteLength;return r}};function SV(e=""){let r=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(r)?"":r}function EV(){return typeof Blob>"u"&&!globalThis.Blob&&(globalThis.Blob=ss),globalThis.Blob}var AV=EV();var ah=class{onload;onabort;onerror;error;onloadstart;onloadend;onprogress;readyState;result;DONE;EMPTY;LOADING;addEventListener;removeEventListener;dispatchEvent;constructor(){this.onload=null}abort(){}async readAsArrayBuffer(r){let t=await r.arrayBuffer();this.onload&&this.onload({target:{result:t}})}async readAsBinaryString(r){throw Error("Not implemented")}async readAsDataURL(r){let t=await r.text(),i=`data://;base64,${Ec(t)}`;this.onload&&this.onload({target:{result:i}})}async readAsText(r){let t=await r.text();this.onload&&this.onload({target:{result:t}})}};var ih=class extends globalThis.Blob{name="";webkitRelativePath="";lastModified;constructor(r,t,i={}){super(r,i),this.name=String(t).replace(/\//g,":"),this.lastModified=(i==null?void 0:i.lastModified)||Date.now()}get[Symbol.toStringTag](){return"File"}};function qA(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=ah),typeof File>"u"&&!globalThis.File&&(globalThis.File=ih),global}var jV=qA();var n1=Xt(require("module"),1),zA=Xt(require("path"),1),oh=Xt(require("fs"),1);async function NA(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():oh.default.readFileSync(e).buffer}async function UA(e){return e.startsWith("http")?await(await fetch(e)).text():oh.default.readFileSync(e,"utf8")}async function HA(e){if(e.startsWith("http")){let i=await(await fetch(e)).text();return nh(i)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let r=oh.default.readFileSync(e,"utf8");return nh(r)}function nh(e,r="",t){if(typeof r=="object"&&(t=r,r=""),r=r.replace("file://",""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let i=n1.default._nodeModulePaths(zA.default.dirname(r)),a=typeof module<"u"&&(module==null?void 0:module.parent),n=new n1.default(r,a);return n.filename=r,n.paths=[].concat((t==null?void 0:t.prependPaths)||[]).concat(i).concat((t==null?void 0:t.appendPaths)||[]),n._compile(e,r),a&&a.children&&a.children.splice(a.children.indexOf(n),1),n.exports}var Ai=class{map;constructor(r){this.map={},r instanceof Ai?r.forEach((t,i)=>this.append(i,t)):Array.isArray(r)?r.forEach(t=>this.append(t[0],t[1])):r&&Object.getOwnPropertyNames(r).forEach(t=>this.append(t,r[t]))}append(r,t){r=rl(r),t=VA(t);let i=this.map[r];this.map[r]=i?`${i}, ${t}`:t}delete(r){delete this.map[rl(r)]}get(r){return r=rl(r),this.has(r)?this.map[r]:null}has(r){return this.map.hasOwnProperty(rl(r))}set(r,t){this.map[rl(r)]=VA(t)}forEach(r,t=null){for(let i in this.map)this.map.hasOwnProperty(i)&&(t?r.call(t,this.map[i],i,this):r(this.map[i],i,this))}keys(){let r=[];return this.forEach(function(t,i){r.push(i)}),o1(r)}values(){let r=[];return this.forEach(function(t){r.push(t)}),o1(r)}entries(){let r=[];return this.forEach(function(t,i){r.push([i,t])}),o1(r)}*[Symbol.iterator](){yield*this.entries()}};function rl(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e)||e==="")throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function VA(e){return typeof e!="string"&&(e=String(e)),e}function o1(e){let r={next(){let t=e.shift();return{done:t===void 0,value:t}}};return r[Symbol.iterator]=function(){return r},r}function s1(e,r){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${r}`)}var u1=Xt(require("stream"),1),TV=e=>typeof e=="boolean",GA=e=>typeof e=="function",RV=e=>e!==null&&typeof e=="object",c1=e=>RV(e)&&GA(e.read)&&GA(e.pipe)&&TV(e.readable),Fn=class{ok;status;statusText;headers;url;bodyUsed=!1;_body;constructor(r,t){let{headers:i,status:a=200,statusText:n="OK",url:o}=t||{};this.url=o,this.ok=a===200,this.status=a,this.statusText=n,this.headers=new Ai((t==null?void 0:t.headers)||{}),c1(r)?this._body=kp(r,i):typeof r=="string"?this._body=u1.Readable.from([new TextEncoder().encode(r)]):this._body=u1.Readable.from([r||new ArrayBuffer(0)])}get body(){return s1(!this.bodyUsed),s1(c1(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return c1(this._body)?await g5(this._body):this._body||new ArrayBuffer(0)}async text(){let r=await this.arrayBuffer();return new TextDecoder().decode(r)}async json(){let r=await this.text();return JSON.parse(r)}async blob(){if(typeof Blob>"u")throw new Error("Blob polyfill not installed");return new Blob([await this.arrayBuffer()])}};var $A=Xt(require("http"),1),WA=Xt(require("https"),1);var PV=e=>e&&e instanceof ArrayBuffer,OV=e=>e&&e instanceof Buffer;function KA(e){let r=e.indexOf(","),t,i;return e.slice(r-7,r)===";base64"?(t=Buffer.from(e.slice(r+1),"base64"),i=e.slice(5,r-7).trim()):(t=Buffer.from(decodeURIComponent(e.slice(r+1))),i=e.slice(5,r).trim()),i?i.startsWith(";")&&(i=`text/plain${i}`):i="text/plain;charset=US-ASCII",{arrayBuffer:CV(t),mimeType:i}}function CV(e){if(PV(e))return e;if(OV(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var l1=e=>e.startsWith("data:"),BV=e=>e.startsWith("http:")||e.startsWith("https:");async function tl(e,r){try{if(globalThis.fetch!==tl&&(BV(e)||l1(e)))return await fetch(e,r);if(l1(e)){let{arrayBuffer:u,mimeType:l}=KA(e);return new Fn(u,{headers:{"content-type":l},url:e})}let t={},i=e;e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip");let a=await FV(i,r),n=DV(e,a,t),{status:o,statusText:s}=LV(a),c=!r||r.followRedirect||r.followRedirect===void 0;if(o>=300&&o<400&&n.has("location")&&c){let u=IV(e,n.get("location"));return await tl(u,r)}return new Fn(a,{headers:n,status:o,statusText:s,url:e})}catch(t){return new Fn(null,{status:400,statusText:String(t),url:e})}}async function FV(e,r){return await new Promise((t,i)=>{let a=MV(e,r),n=e.startsWith("https:")?WA.default.request(a,o=>t(o)):$A.default.request(a,o=>t(o));n.on("error",o=>i(o)),n.end()})}function IV(e,r){if(r.startsWith("http"))return r;let t=new URL(e);return t.pathname=r,t.href}function MV(e,r){let t=(r==null?void 0:r.headers)||{},i={};for(let n of Object.keys(t))i[n.toLowerCase()]=t[n];i["accept-encoding"]=i["accept-encoding"]||"gzip,br,deflate";let a=new URL(e);return{hostname:a.hostname,path:a.pathname,method:"GET",...r,...r==null?void 0:r.fetch,headers:i,port:a.port}}function LV(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function DV(e,r,t={}){let i={};if(r&&r.headers){let a=r.headers;for(let n in a){let o=a[n];i[n.toLowerCase()]=String(o)}}if(!i["content-length"]){let a=qV(e);Number.isFinite(a)&&(i["content-length"]=a)}return Object.assign(i,t),new Ai(i)}function qV(e){return l1(e)?e.length-5:null}var zV=parseInt(XA.versions.node.split(".")[0]);oy&&console.error("loaders.gl: The @loaders.gl/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=vv;globalThis.loaders.NodeFile=Wo;globalThis.loaders.NodeFileSystem=Ap;globalThis.loaders.fetchNode=Sp;globalThis.loaders.NodeHash=jp;globalThis.TextEncoder||(globalThis.TextEncoder=Sc);globalThis.TextDecoder||(globalThis.TextDecoder=wo);globalThis.ReadableStream||(globalThis.ReadableStream=ReadableStream);!("atob"in globalThis)&&Ec&&(globalThis.atob=Ec);!("btoa"in globalThis)&&Nh&&(globalThis.btoa=Nh);globalThis.loaders.encodeImageNode=h_;globalThis.loaders.parseImageNode=Kg;globalThis.loaders.imageFormatsNode=Gg;globalThis._parseImageNode=Kg;globalThis._imageFormatsNode=Gg;globalThis.loaders.readFileAsArrayBuffer=NA;globalThis.loaders.readFileAsText=UA;globalThis.loaders.requireFromFile=HA;globalThis.loaders.requireFromString=nh;zV<18&&(!("Headers"in globalThis)&&Ai&&(globalThis.Headers=Ai),!("Response"in globalThis)&&Fn&&(globalThis.Response=Fn),!("fetch"in globalThis)&&tl&&(globalThis.fetch=tl));var NV=e=>typeof e=="boolean",al=e=>typeof e=="function",cs=e=>e!==null&&typeof e=="object",f1=e=>cs(e)&&e.constructor==={}.constructor;var YA=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",QA=e=>e&&typeof e[Symbol.asyncIterator]=="function";var Za=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var ei=e=>typeof Blob<"u"&&e instanceof Blob,JA=e=>e&&typeof e=="object"&&e.isBuffer;var UV=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||cs(e)&&al(e.tee)&&al(e.cancel)&&al(e.getReader);var HV=e=>cs(e)&&al(e.read)&&al(e.pipe)&&NV(e.readable),sh=e=>UV(e)||HV(e);var ch=class extends Error{constructor(r,t){super(r),this.reason=t.reason,this.url=t.url,this.response=t.response}reason;url;response};var VV=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,GV=/^([-\w.]+\/[-\w.+]+)/;function p1(e,r){return e.toLowerCase()===r.toLowerCase()}function ZA(e){let r=GV.exec(e);return r?r[1]:e}function h1(e){let r=VV.exec(e);return r?r[1]:""}var ej=/\?.*/;function rj(e){let r=e.match(ej);return r&&r[0]}function mc(e){return e.replace(ej,"")}function tj(e){if(e.length<50)return e;let r=e.slice(e.length-15);return`${e.substr(0,32)}...${r}`}function us(e){return Za(e)?e.url:ei(e)?e.name||"":typeof e=="string"?e:""}function il(e){if(Za(e)){let r=e,t=r.headers.get("content-type")||"",i=mc(r.url);return ZA(t)||h1(i)}return ei(e)?e.type||"":typeof e=="string"?h1(e):""}function aj(e){return Za(e)?e.headers["content-length"]||-1:ei(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function uh(e){if(Za(e))return e;let r={},t=aj(e);t>=0&&(r["content-length"]=String(t));let i=us(e),a=il(e);a&&(r["content-type"]=a);let n=await $V(e);n&&(r["x-first-bytes"]=n),typeof e=="string"&&(e=new TextEncoder().encode(e));let o=new Response(e,{headers:r});return Object.defineProperty(o,"url",{value:i}),o}async function ij(e){if(!e.ok)throw await KV(e)}async function KV(e){let r=tj(e.url),t=`Failed to fetch resource (${e.status}) ${e.statusText}: ${r}`;t=t.length>100?`${t.slice(0,100)}...`:t;let i={reason:e.statusText,url:e.url,response:e};try{let a=e.headers.get("Content-Type");i.reason=!e.bodyUsed&&(a!=null&&a.includes("application/json"))?await e.json():await e.text()}catch{}return new ch(t,i)}async function $V(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let t=e.slice(0,5);return await new Promise(i=>{let a=new FileReader;a.onload=n=>{var o;return i((o=n==null?void 0:n.target)==null?void 0:o.result)},a.readAsDataURL(t)})}if(e instanceof ArrayBuffer){let t=e.slice(0,5);return`data:base64,${WV(t)}`}return null}function WV(e){let r="",t=new Uint8Array(e);for(let i=0;i<t.byteLength;i++)r+=String.fromCharCode(t[i]);return btoa(r)}function XV(e){return!YV(e)&&!QV(e)}function YV(e){return e.startsWith("http:")||e.startsWith("https:")}function QV(e){return e.startsWith("data:")}async function d1(e,r){var t,i;if(typeof e=="string"){let a=Ko(e);return XV(a)&&(t=globalThis.loaders)!=null&&t.fetchNode?(i=globalThis.loaders)==null?void 0:i.fetchNode(a,r):await fetch(a,r)}return await uh(e)}var m1=new Xi({id:"loaders.gl"}),lh=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},fh=class{console;constructor(){this.console=console}log(...r){return this.console.log.bind(this.console,...r)}info(...r){return this.console.info.bind(this.console,...r)}warn(...r){return this.console.warn.bind(this.console,...r)}error(...r){return this.console.error.bind(this.console,...r)}};var g1={fetch:null,mimeType:void 0,nothrow:!1,log:new fh,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:No,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},nj={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function v1(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state||(e._state={}),e._state}function y1(){let e=v1();return e.globalOptions=e.globalOptions||{...g1},e.globalOptions}function cj(e,r,t,i){return t=t||[],t=Array.isArray(t)?t:[t],JV(e,t),eG(r,e,i)}function JV(e,r){oj(e,null,g1,nj,r);for(let t of r){let i=e&&e[t.id]||{},a=t.options&&t.options[t.id]||{},n=t.deprecatedOptions&&t.deprecatedOptions[t.id]||{};oj(i,t.id,a,n,r)}}function oj(e,r,t,i,a){let n=r||"Top level",o=r?`${r}.`:"";for(let s in e){let c=!r&&cs(e[s]),u=s==="baseUri"&&!r,l=s==="workerUrl"&&r;if(!(s in t)&&!u&&!l){if(s in i)m1.warn(`${n} loader option '${o}${s}' no longer supported, use '${i[s]}'`)();else if(!c){let h=ZV(s,a);m1.warn(`${n} loader option '${o}${s}' not recognized. ${h}`)()}}}}function ZV(e,r){let t=e.toLowerCase(),i="";for(let a of r)for(let n in a.options){if(e===n)return`Did you mean '${a.id}.${n}'?`;let o=n.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(i=i||`Did you mean '${a.id}.${n}'?`)}return i}function eG(e,r,t){let a={...e.options||{}};return rG(a,t),a.log===null&&(a.log=new lh),sj(a,y1()),sj(a,r),a}function sj(e,r){for(let t in r)if(t in r){let i=r[t];f1(i)&&f1(e[t])?e[t]={...e[t],...r[t]}:e[t]=r[t]}}function rG(e,r){r&&!("baseUri"in e)&&(e.baseUri=r)}function nl(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function b1(e){ki(e,"null loader"),ki(nl(e),"invalid loader");let r;return Array.isArray(e)&&(r=e[1],e=e[0],e={...e,options:{...e.options,...r}}),(e!=null&&e.parseTextSync||e!=null&&e.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var tG=()=>{let e=v1();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function uj(){return tG()}var aG=/\.([^.]+)$/;async function pj(e,r=[],t,i){if(!hj(e))return null;let a=lj(e,r,{...t,nothrow:!0},i);if(a)return a;if(ei(e)&&(e=await e.slice(0,10).arrayBuffer(),a=lj(e,r,t,i)),!a&&!(t!=null&&t.nothrow))throw new Error(dj(e));return a}function lj(e,r=[],t,i){if(!hj(e))return null;if(r&&!Array.isArray(r))return b1(r);let a=[];r&&(a=a.concat(r)),t!=null&&t.ignoreRegisteredLoaders||a.push(...uj()),nG(a);let n=iG(e,a,t,i);if(!n&&!(t!=null&&t.nothrow))throw new Error(dj(e));return n}function iG(e,r,t,i){let a=us(e),n=il(e),o=mc(a)||(i==null?void 0:i.url),s=null,c="";return t!=null&&t.mimeType&&(s=x1(r,t==null?void 0:t.mimeType),c=`match forced by supplied MIME type ${t==null?void 0:t.mimeType}`),s=s||oG(r,o),c=c||(s?`matched url ${o}`:""),s=s||x1(r,n),c=c||(s?`matched MIME type ${n}`:""),s=s||cG(r,e),c=c||(s?`matched initial data ${mj(e)}`:""),t!=null&&t.fallbackMimeType&&(s=s||x1(r,t==null?void 0:t.fallbackMimeType),c=c||(s?`matched fallback MIME type ${n}`:"")),c&&Yg.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${c}.`),s}function hj(e){return!(e instanceof Response&&e.status===204)}function dj(e){let r=us(e),t=il(e),i="No valid loader found (";i+=r?`${$o.filename(r)}, `:"no url provided, ",i+=`MIME type: ${t?`"${t}"`:"not provided"}, `;let a=e?mj(e):"";return i+=a?` first bytes: "${a}"`:"first bytes: not available",i+=")",i}function nG(e){for(let r of e)b1(r)}function oG(e,r){let t=r&&aG.exec(r),i=t&&t[1];return i?sG(e,i):null}function sG(e,r){r=r.toLowerCase();for(let t of e)for(let i of t.extensions)if(i.toLowerCase()===r)return t;return null}function x1(e,r){var t;for(let i of e)if((t=i.mimeTypes)!=null&&t.some(a=>p1(r,a))||p1(r,`application/x.${i.id}`))return i;return null}function cG(e,r){if(!r)return null;for(let t of e)if(typeof r=="string"){if(uG(r,t))return t}else if(ArrayBuffer.isView(r)){if(fj(r.buffer,r.byteOffset,t))return t}else if(r instanceof ArrayBuffer&&fj(r,0,t))return t;return null}function uG(e,r){return r.testText?r.testText(e):(Array.isArray(r.tests)?r.tests:[r.tests]).some(i=>e.startsWith(i))}function fj(e,r,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(a=>lG(e,r,t,a))}function lG(e,r,t,i){if(i instanceof ArrayBuffer)return lv(i,e,i.byteLength);switch(typeof i){case"function":return i(e);case"string":let a=_1(e,r,i.length);return i===a;default:return!1}}function mj(e,r=5){return typeof e=="string"?e.slice(0,r):ArrayBuffer.isView(e)?_1(e.buffer,e.byteOffset,r):e instanceof ArrayBuffer?_1(e,0,r):""}function _1(e,r,t){if(e.byteLength<r+t)return"";let i=new DataView(e),a="";for(let n=0;n<t;n++)a+=String.fromCharCode(i.getUint8(r+n));return a}function*gj(e,r){let t=(r==null?void 0:r.chunkSize)||262144,i=0,a=new TextEncoder;for(;i<e.length;){let n=Math.min(e.length-i,t),o=e.slice(i,i+n);i+=n,yield a.encode(o)}}function*vj(e,r={}){let{chunkSize:t=262144}=r,i=0;for(;i<e.byteLength;){let a=Math.min(e.byteLength-i,t),n=new ArrayBuffer(a),o=new Uint8Array(e,i,a);new Uint8Array(n).set(o),i+=a,yield n}}async function*yj(e,r){let t=(r==null?void 0:r.chunkSize)||1048576,i=0;for(;i<e.size;){let a=i+t,n=await e.slice(i,a).arrayBuffer();i=a,yield n}}function w1(e,r){return No?fG(e,r):pG(e,r)}async function*fG(e,r){let t=e.getReader(),i;try{for(;;){let a=i||t.read();r!=null&&r._streamReadAhead&&(i=t.read());let{done:n,value:o}=await a;if(n)return;yield _p(o)}}catch{t.releaseLock()}}async function*pG(e,r){for await(let t of e)yield _p(t)}function bj(e,r){if(typeof e=="string")return gj(e,r);if(e instanceof ArrayBuffer)return vj(e,r);if(ei(e))return yj(e,r);if(sh(e))return w1(e,r);if(Za(e))return w1(e.body,r);throw new Error("makeIterator")}var xj="Cannot convert supplied data type";function hG(e,r,t){if(r.text&&typeof e=="string")return e;if(JA(e)&&(e=e.buffer),e instanceof ArrayBuffer){let i=e;return r.text&&!r.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(e)){if(r.text&&!r.binary)return new TextDecoder("utf8").decode(e);let i=e.buffer,a=e.byteLength||e.length;return(e.byteOffset!==0||a!==i.byteLength)&&(i=i.slice(e.byteOffset,e.byteOffset+a)),i}throw new Error(xj)}async function _j(e,r,t){let i=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||i)return hG(e,r,t);if(ei(e)&&(e=await uh(e)),Za(e)){let a=e;return await ij(a),r.binary?await a.arrayBuffer():await a.text()}if(sh(e)&&(e=bj(e,t)),YA(e)||QA(e))return Iu(e);throw new Error(xj)}function ph(e,r){let t=y1(),i=e||t;return typeof i.fetch=="function"?i.fetch:cs(i.fetch)?a=>d1(a,i.fetch):r!=null&&r.fetch?r==null?void 0:r.fetch:d1}function wj(e,r,t){if(t)return t;let i={fetch:ph(r,e),...e};if(i.url){let a=mc(i.url);i.baseUrl=a,i.queryString=rj(i.url),i.filename=$o.filename(a),i.baseUrl=$o.dirname(a)}return Array.isArray(i.loaders)||(i.loaders=null),i}function kj(e,r){if(e&&!Array.isArray(e))return e;let t;if(e&&(t=Array.isArray(e)?e:[e]),r&&r.loaders){let i=Array.isArray(r.loaders)?r.loaders:[r.loaders];t=t?[...t,...i]:i}return t&&t.length?t:void 0}async function In(e,r,t,i){r&&!Array.isArray(r)&&!nl(r)&&(i=void 0,t=r,r=void 0),e=await e,t=t||{};let a=us(e),o=kj(r,i),s=await pj(e,o,t);return s?(t=cj(t,s,o,a),i=wj({url:a,_parse:In,loaders:o},t,i||null),await dG(s,e,t,i)):null}async function dG(e,r,t,i){if(nv(e),t=Qg(e.options,t),Za(r)){let n=r,{ok:o,redirected:s,status:c,statusText:u,type:l,url:h}=n,p=Object.fromEntries(n.headers.entries());i.response={headers:p,ok:o,redirected:s,status:c,statusText:u,type:l,url:h}}r=await _j(r,e,t);let a=e;if(a.parseTextSync&&typeof r=="string")return a.parseTextSync(r,t,i);if(cv(e,t))return await uv(e,r,t,i,In);if(a.parseText&&typeof r=="string")return await a.parseText(r,t,i);if(a.parse)return await a.parse(r,t,i);throw Wt(!a.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function Sj(e){switch(e.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function k1(e){let r=1/0,t=1/0,i=1/0,a=-1/0,n=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],c=s&&s.length;for(let u=0;u<c;u+=3){let l=s[u],h=s[u+1],p=s[u+2];r=l<r?l:r,t=h<t?h:t,i=p<i?p:i,a=l>a?l:a,n=h>n?h:n,o=p>o?p:o}return[[r,t,i],[a,n,o]]}function S1(e,r,t){let i=Sj(r.value),a=t||Ej(r);return{name:e,type:{type:"fixed-size-list",listSize:r.size,children:[{name:"value",type:i}]},nullable:!1,metadata:a}}function Ej(e){let r={};return"byteOffset"in e&&(r.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(r.byteStride=e.byteStride.toString(10)),"normalized"in e&&(r.normalized=e.normalized.toString()),r}async function E1(e,r,t,i){let a,n;!Array.isArray(r)&&!nl(r)?(a=[],n=r,i=void 0):(a=r,n=t);let o=ph(n),s=e;return typeof e=="string"&&(s=await o(e)),ei(e)&&(s=await o(e)),Array.isArray(a)?await In(s,a,n):await In(s,a,n)}var mG=1/Math.PI*180,gG=1/180*Math.PI,vG={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...vG}};var gt=globalThis.mathgl.config;function A1(e,{precision:r=gt.precision}={}){return e=yG(e),`${parseFloat(e.toPrecision(r))}`}function _o(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function j1(e){return Aj(e)}function T1(e){return jj(e)}function Aj(e,r){return Tj(e,t=>t*gG,r)}function jj(e,r){return Tj(e,t=>t*mG,r)}function Mn(e,r,t){let i=gt.EPSILON;t&&(gt.EPSILON=t);try{if(e===r)return!0;if(_o(e)&&_o(r)){if(e.length!==r.length)return!1;for(let a=0;a<e.length;++a)if(!Mn(e[a],r[a]))return!1;return!0}return e&&e.equals?e.equals(r):r&&r.equals?r.equals(e):typeof e=="number"&&typeof r=="number"?Math.abs(e-r)<=gt.EPSILON*Math.max(1,Math.abs(e),Math.abs(r)):!1}finally{gt.EPSILON=i}}function yG(e){return Math.round(e/gt.EPSILON)*gt.EPSILON}function bG(e){return e.clone?e.clone():new Array(e.length)}function Tj(e,r,t){if(_o(e)){let i=e;t=t||bG(i);for(let a=0;a<t.length&&a<i.length;++a){let n=typeof e=="number"?e:e[a];t[a]=r(n,a,t)}return t}return r(e)}var gc=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(r,t=0){for(let i=0;i<this.ELEMENTS;++i)this[i]=r[i+t];return this.check()}toArray(r=[],t=0){for(let i=0;i<this.ELEMENTS;++i)r[t+i]=this[i];return r}toObject(r){return r}from(r){return Array.isArray(r)?this.copy(r):this.fromObject(r)}to(r){return r===this?this:_o(r)?this.toArray(r):this.toObject(r)}toTarget(r){return r?this.to(r):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(gt)}formatString(r){let t="";for(let i=0;i<this.ELEMENTS;++i)t+=(i>0?", ":"")+A1(this[i],r);return`${r.printTypes?this.constructor.name:""}[${t}]`}equals(r){if(!r||this.length!==r.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!Mn(this[t],r[t]))return!1;return!0}exactEquals(r){if(!r||this.length!==r.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==r[t])return!1;return!0}negate(){for(let r=0;r<this.ELEMENTS;++r)this[r]=-this[r];return this.check()}lerp(r,t,i){if(i===void 0)return this.lerp(this,r,t);for(let a=0;a<this.ELEMENTS;++a){let n=r[a],o=typeof t=="number"?t:t[a];this[a]=n+i*(o-n)}return this.check()}min(r){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(r[t],this[t]);return this.check()}max(r){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(r[t],this[t]);return this.check()}clamp(r,t){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],r[i]),t[i]);return this.check()}add(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]+=t[i];return this.check()}subtract(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]-=t[i];return this.check()}scale(r){if(typeof r=="number")for(let t=0;t<this.ELEMENTS;++t)this[t]*=r;else for(let t=0;t<this.ELEMENTS&&t<r.length;++t)this[t]*=r[t];return this.check()}multiplyByScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]*=r;return this.check()}check(){if(gt.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let r=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)r=r&&Number.isFinite(this[t]);return r}sub(r){return this.subtract(r)}setScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]=r;return this.check()}addScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]+=r;return this.check()}subScalar(r){return this.addScalar(-r)}multiplyScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]*=r;return this.check()}divideScalar(r){return this.multiplyByScalar(1/r)}clampScalar(r,t){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],r),t);return this.check()}get elements(){return this}};function xG(e,r){if(e.length!==r)return!1;for(let t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}function ia(e){if(!Number.isFinite(e))throw new Error(`Invalid number ${JSON.stringify(e)}`);return e}function hh(e,r,t=""){if(gt.debug&&!xG(e,r))throw new Error(`math.gl: ${t} some fields set to invalid numbers'`);return e}function ri(e,r){if(!e)throw new Error(`math.gl assertion ${r}`)}var dh=class extends gc{get x(){return this[0]}set x(r){this[0]=ia(r)}get y(){return this[1]}set y(r){this[1]=ia(r)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let r=0;for(let t=0;t<this.ELEMENTS;++t)r+=this[t]*this[t];return r}magnitudeSquared(){return this.lengthSquared()}distance(r){return Math.sqrt(this.distanceSquared(r))}distanceSquared(r){let t=0;for(let i=0;i<this.ELEMENTS;++i){let a=this[i]-r[i];t+=a*a}return ia(t)}dot(r){let t=0;for(let i=0;i<this.ELEMENTS;++i)t+=this[i]*r[i];return ia(t)}normalize(){let r=this.magnitude();if(r!==0)for(let t=0;t<this.ELEMENTS;++t)this[t]/=r;return this.check()}multiply(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]*=t[i];return this.check()}divide(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]/=t[i];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(r){return this.distance(r)}distanceToSquared(r){return this.distanceSquared(r)}getComponent(r){return ri(r>=0&&r<this.ELEMENTS,"index is out of range"),ia(this[r])}setComponent(r,t){return ri(r>=0&&r<this.ELEMENTS,"index is out of range"),this[r]=t,this.check()}addVectors(r,t){return this.copy(r).add(t)}subVectors(r,t){return this.copy(r).subtract(t)}multiplyVectors(r,t){return this.copy(r).multiply(t)}addScaledVector(r,t){return this.add(new this.constructor(r).multiplyScalar(t))}};var ji=typeof Float32Array<"u"?Float32Array:Array,ol=Math.random;function vc(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var $ne=Math.PI/180;function _G(){let e=new ji(2);return ji!=Float32Array&&(e[0]=0,e[1]=0),e}function Rj(e,r,t){let i=r[0],a=r[1];return e[0]=t[0]*i+t[4]*a+t[12],e[1]=t[1]*i+t[5]*a+t[13],e}var Wne=function(){let e=_G();return function(r,t,i,a,n,o){let s,c;for(t||(t=2),i||(i=0),a?c=Math.min(a*t+i,r.length):c=r.length,s=i;s<c;s+=t)e[0]=r[s],e[1]=r[s+1],n(e,e,o),r[s]=e[0],r[s+1]=e[1];return r}}();function Pj(e,r,t){let i=r[0],a=r[1],n=t[3]*i+t[7]*a||1;return e[0]=(t[0]*i+t[4]*a)/n,e[1]=(t[1]*i+t[5]*a)/n,e}function mh(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[3]*i+t[7]*a+t[11]*n||1;return e[0]=(t[0]*i+t[4]*a+t[8]*n)/o,e[1]=(t[1]*i+t[5]*a+t[9]*n)/o,e[2]=(t[2]*i+t[6]*a+t[10]*n)/o,e}function Oj(e,r,t){let i=r[0],a=r[1];return e[0]=t[0]*i+t[2]*a,e[1]=t[1]*i+t[3]*a,e[2]=r[2],e}var cl={};yl(cl,{add:()=>jG,angle:()=>L1,bezier:()=>NG,ceil:()=>TG,clone:()=>kG,copy:()=>EG,create:()=>Cj,cross:()=>O1,dist:()=>YG,distance:()=>Lj,div:()=>XG,divide:()=>Mj,dot:()=>P1,equals:()=>KG,exactEquals:()=>GG,floor:()=>RG,forEach:()=>eK,fromValues:()=>SG,hermite:()=>zG,inverse:()=>MG,len:()=>JG,length:()=>Bj,lerp:()=>DG,max:()=>OG,min:()=>PG,mul:()=>WG,multiply:()=>Ij,negate:()=>IG,normalize:()=>LG,random:()=>UG,rotateX:()=>F1,rotateY:()=>I1,rotateZ:()=>M1,round:()=>CG,scale:()=>BG,scaleAndAdd:()=>FG,set:()=>AG,slerp:()=>qG,sqrDist:()=>QG,sqrLen:()=>ZG,squaredDistance:()=>Dj,squaredLength:()=>qj,str:()=>VG,sub:()=>$G,subtract:()=>Fj,transformMat3:()=>C1,transformMat4:()=>sl,transformQuat:()=>B1,zero:()=>HG});function Cj(){let e=new ji(3);return ji!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function kG(e){let r=new ji(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function Bj(e){let r=e[0],t=e[1],i=e[2];return Math.sqrt(r*r+t*t+i*i)}function SG(e,r,t){let i=new ji(3);return i[0]=e,i[1]=r,i[2]=t,i}function EG(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function AG(e,r,t,i){return e[0]=r,e[1]=t,e[2]=i,e}function jG(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e}function Fj(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e}function Ij(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e}function Mj(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e[2]=r[2]/t[2],e}function TG(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e}function RG(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e}function PG(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e[2]=Math.min(r[2],t[2]),e}function OG(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e[2]=Math.max(r[2],t[2]),e}function CG(e,r){return e[0]=vc(r[0]),e[1]=vc(r[1]),e[2]=vc(r[2]),e}function BG(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e}function FG(e,r,t,i){return e[0]=r[0]+t[0]*i,e[1]=r[1]+t[1]*i,e[2]=r[2]+t[2]*i,e}function Lj(e,r){let t=r[0]-e[0],i=r[1]-e[1],a=r[2]-e[2];return Math.sqrt(t*t+i*i+a*a)}function Dj(e,r){let t=r[0]-e[0],i=r[1]-e[1],a=r[2]-e[2];return t*t+i*i+a*a}function qj(e){let r=e[0],t=e[1],i=e[2];return r*r+t*t+i*i}function IG(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e}function MG(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e}function LG(e,r){let t=r[0],i=r[1],a=r[2],n=t*t+i*i+a*a;return n>0&&(n=1/Math.sqrt(n)),e[0]=r[0]*n,e[1]=r[1]*n,e[2]=r[2]*n,e}function P1(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function O1(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[0],s=t[1],c=t[2];return e[0]=a*c-n*s,e[1]=n*o-i*c,e[2]=i*s-a*o,e}function DG(e,r,t,i){let a=r[0],n=r[1],o=r[2];return e[0]=a+i*(t[0]-a),e[1]=n+i*(t[1]-n),e[2]=o+i*(t[2]-o),e}function qG(e,r,t,i){let a=Math.acos(Math.min(Math.max(P1(r,t),-1),1)),n=Math.sin(a),o=Math.sin((1-i)*a)/n,s=Math.sin(i*a)/n;return e[0]=o*r[0]+s*t[0],e[1]=o*r[1]+s*t[1],e[2]=o*r[2]+s*t[2],e}function zG(e,r,t,i,a,n){let o=n*n,s=o*(2*n-3)+1,c=o*(n-2)+n,u=o*(n-1),l=o*(3-2*n);return e[0]=r[0]*s+t[0]*c+i[0]*u+a[0]*l,e[1]=r[1]*s+t[1]*c+i[1]*u+a[1]*l,e[2]=r[2]*s+t[2]*c+i[2]*u+a[2]*l,e}function NG(e,r,t,i,a,n){let o=1-n,s=o*o,c=n*n,u=s*o,l=3*n*s,h=3*c*o,p=c*n;return e[0]=r[0]*u+t[0]*l+i[0]*h+a[0]*p,e[1]=r[1]*u+t[1]*l+i[1]*h+a[1]*p,e[2]=r[2]*u+t[2]*l+i[2]*h+a[2]*p,e}function UG(e,r){r=r===void 0?1:r;let t=ol()*2*Math.PI,i=ol()*2-1,a=Math.sqrt(1-i*i)*r;return e[0]=Math.cos(t)*a,e[1]=Math.sin(t)*a,e[2]=i*r,e}function sl(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[3]*i+t[7]*a+t[11]*n+t[15];return o=o||1,e[0]=(t[0]*i+t[4]*a+t[8]*n+t[12])/o,e[1]=(t[1]*i+t[5]*a+t[9]*n+t[13])/o,e[2]=(t[2]*i+t[6]*a+t[10]*n+t[14])/o,e}function C1(e,r,t){let i=r[0],a=r[1],n=r[2];return e[0]=i*t[0]+a*t[3]+n*t[6],e[1]=i*t[1]+a*t[4]+n*t[7],e[2]=i*t[2]+a*t[5]+n*t[8],e}function B1(e,r,t){let i=t[0],a=t[1],n=t[2],o=t[3],s=r[0],c=r[1],u=r[2],l=a*u-n*c,h=n*s-i*u,p=i*c-a*s,d=a*p-n*h,v=n*l-i*p,x=i*h-a*l,y=o*2;return l*=y,h*=y,p*=y,d*=2,v*=2,x*=2,e[0]=s+l+d,e[1]=c+h+v,e[2]=u+p+x,e}function F1(e,r,t,i){let a=[],n=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],n[0]=a[0],n[1]=a[1]*Math.cos(i)-a[2]*Math.sin(i),n[2]=a[1]*Math.sin(i)+a[2]*Math.cos(i),e[0]=n[0]+t[0],e[1]=n[1]+t[1],e[2]=n[2]+t[2],e}function I1(e,r,t,i){let a=[],n=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],n[0]=a[2]*Math.sin(i)+a[0]*Math.cos(i),n[1]=a[1],n[2]=a[2]*Math.cos(i)-a[0]*Math.sin(i),e[0]=n[0]+t[0],e[1]=n[1]+t[1],e[2]=n[2]+t[2],e}function M1(e,r,t,i){let a=[],n=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],n[0]=a[0]*Math.cos(i)-a[1]*Math.sin(i),n[1]=a[0]*Math.sin(i)+a[1]*Math.cos(i),n[2]=a[2],e[0]=n[0]+t[0],e[1]=n[1]+t[1],e[2]=n[2]+t[2],e}function L1(e,r){let t=e[0],i=e[1],a=e[2],n=r[0],o=r[1],s=r[2],c=Math.sqrt((t*t+i*i+a*a)*(n*n+o*o+s*s)),u=c&&P1(e,r)/c;return Math.acos(Math.min(Math.max(u,-1),1))}function HG(e){return e[0]=0,e[1]=0,e[2]=0,e}function VG(e){return`vec3(${e[0]}, ${e[1]}, ${e[2]})`}function GG(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]}function KG(e,r){let t=e[0],i=e[1],a=e[2],n=r[0],o=r[1],s=r[2];return Math.abs(t-n)<=1e-6*Math.max(1,Math.abs(t),Math.abs(n))&&Math.abs(i-o)<=1e-6*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(a-s)<=1e-6*Math.max(1,Math.abs(a),Math.abs(s))}var $G=Fj,WG=Ij,XG=Mj,YG=Lj,QG=Dj,JG=Bj,ZG=qj,eK=function(){let e=Cj();return function(r,t,i,a,n,o){let s,c;for(t||(t=3),i||(i=0),a?c=Math.min(a*t+i,r.length):c=r.length,s=i;s<c;s+=t)e[0]=r[s],e[1]=r[s+1],e[2]=r[s+2],n(e,e,o),r[s]=e[0],r[s+1]=e[1],r[s+2]=e[2];return r}}();var D1=[0,0,0],gh,xr=class extends dh{static get ZERO(){return gh||(gh=new xr(0,0,0),Object.freeze(gh)),gh}constructor(r=0,t=0,i=0){super(-0,-0,-0),arguments.length===1&&_o(r)?this.copy(r):(gt.debug&&(ia(r),ia(t),ia(i)),this[0]=r,this[1]=t,this[2]=i)}set(r,t,i){return this[0]=r,this[1]=t,this[2]=i,this.check()}copy(r){return this[0]=r[0],this[1]=r[1],this[2]=r[2],this.check()}fromObject(r){return gt.debug&&(ia(r.x),ia(r.y),ia(r.z)),this[0]=r.x,this[1]=r.y,this[2]=r.z,this.check()}toObject(r){return r.x=this[0],r.y=this[1],r.z=this[2],r}get ELEMENTS(){return 3}get z(){return this[2]}set z(r){this[2]=ia(r)}angle(r){return L1(this,r)}cross(r){return O1(this,this,r),this.check()}rotateX({radians:r,origin:t=D1}){return F1(this,this,t,r),this.check()}rotateY({radians:r,origin:t=D1}){return I1(this,this,t,r),this.check()}rotateZ({radians:r,origin:t=D1}){return M1(this,this,t,r),this.check()}transform(r){return this.transformAsPoint(r)}transformAsPoint(r){return sl(this,this,r),this.check()}transformAsVector(r){return mh(this,this,r),this.check()}transformByMatrix3(r){return C1(this,this,r),this.check()}transformByMatrix2(r){return Oj(this,this,r),this.check()}transformByQuaternion(r){return B1(this,this,r),this.check()}};var vh=class extends gc{toString(){let r="[";if(gt.printRowMajor){r+="row-major:";for(let t=0;t<this.RANK;++t)for(let i=0;i<this.RANK;++i)r+=` ${this[i*this.RANK+t]}`}else{r+="column-major:";for(let t=0;t<this.ELEMENTS;++t)r+=` ${this[t]}`}return r+="]",r}getElementIndex(r,t){return t*this.RANK+r}getElement(r,t){return this[t*this.RANK+r]}setElement(r,t,i){return this[t*this.RANK+r]=ia(i),this}getColumn(r,t=new Array(this.RANK).fill(-0)){let i=r*this.RANK;for(let a=0;a<this.RANK;++a)t[a]=this[i+a];return t}setColumn(r,t){let i=r*this.RANK;for(let a=0;a<this.RANK;++a)this[i+a]=t[a];return this}};function rK(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function zj(e,r){if(e===r){let t=r[1],i=r[2],a=r[3],n=r[6],o=r[7],s=r[11];e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=t,e[6]=r[9],e[7]=r[13],e[8]=i,e[9]=n,e[11]=r[14],e[12]=a,e[13]=o,e[14]=s}else e[0]=r[0],e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=r[1],e[5]=r[5],e[6]=r[9],e[7]=r[13],e[8]=r[2],e[9]=r[6],e[10]=r[10],e[11]=r[14],e[12]=r[3],e[13]=r[7],e[14]=r[11],e[15]=r[15];return e}function Nj(e,r){let t=r[0],i=r[1],a=r[2],n=r[3],o=r[4],s=r[5],c=r[6],u=r[7],l=r[8],h=r[9],p=r[10],d=r[11],v=r[12],x=r[13],y=r[14],E=r[15],A=t*s-i*o,S=t*c-a*o,R=t*u-n*o,j=i*c-a*s,P=i*u-n*s,C=a*u-n*c,I=l*x-h*v,F=l*y-p*v,H=l*E-d*v,z=h*y-p*x,G=h*E-d*x,D=p*E-d*y,V=A*D-S*G+R*z+j*H-P*F+C*I;return V?(V=1/V,e[0]=(s*D-c*G+u*z)*V,e[1]=(a*G-i*D-n*z)*V,e[2]=(x*C-y*P+E*j)*V,e[3]=(p*P-h*C-d*j)*V,e[4]=(c*H-o*D-u*F)*V,e[5]=(t*D-a*H+n*F)*V,e[6]=(y*R-v*C-E*S)*V,e[7]=(l*C-p*R+d*S)*V,e[8]=(o*G-s*H+u*I)*V,e[9]=(i*H-t*G-n*I)*V,e[10]=(v*P-x*R+E*A)*V,e[11]=(h*R-l*P-d*A)*V,e[12]=(s*F-o*z-c*I)*V,e[13]=(t*z-i*F+a*I)*V,e[14]=(x*S-v*j-y*A)*V,e[15]=(l*j-h*S+p*A)*V,e):null}function Uj(e){let r=e[0],t=e[1],i=e[2],a=e[3],n=e[4],o=e[5],s=e[6],c=e[7],u=e[8],l=e[9],h=e[10],p=e[11],d=e[12],v=e[13],x=e[14],y=e[15],E=r*o-t*n,A=r*s-i*n,S=t*s-i*o,R=u*v-l*d,j=u*x-h*d,P=l*x-h*v,C=r*P-t*j+i*R,I=n*P-o*j+s*R,F=u*S-l*A+h*E,H=d*S-v*A+x*E;return c*C-a*I+y*F-p*H}function q1(e,r,t){let i=r[0],a=r[1],n=r[2],o=r[3],s=r[4],c=r[5],u=r[6],l=r[7],h=r[8],p=r[9],d=r[10],v=r[11],x=r[12],y=r[13],E=r[14],A=r[15],S=t[0],R=t[1],j=t[2],P=t[3];return e[0]=S*i+R*s+j*h+P*x,e[1]=S*a+R*c+j*p+P*y,e[2]=S*n+R*u+j*d+P*E,e[3]=S*o+R*l+j*v+P*A,S=t[4],R=t[5],j=t[6],P=t[7],e[4]=S*i+R*s+j*h+P*x,e[5]=S*a+R*c+j*p+P*y,e[6]=S*n+R*u+j*d+P*E,e[7]=S*o+R*l+j*v+P*A,S=t[8],R=t[9],j=t[10],P=t[11],e[8]=S*i+R*s+j*h+P*x,e[9]=S*a+R*c+j*p+P*y,e[10]=S*n+R*u+j*d+P*E,e[11]=S*o+R*l+j*v+P*A,S=t[12],R=t[13],j=t[14],P=t[15],e[12]=S*i+R*s+j*h+P*x,e[13]=S*a+R*c+j*p+P*y,e[14]=S*n+R*u+j*d+P*E,e[15]=S*o+R*l+j*v+P*A,e}function Hj(e,r,t){let i=t[0],a=t[1],n=t[2],o,s,c,u,l,h,p,d,v,x,y,E;return r===e?(e[12]=r[0]*i+r[4]*a+r[8]*n+r[12],e[13]=r[1]*i+r[5]*a+r[9]*n+r[13],e[14]=r[2]*i+r[6]*a+r[10]*n+r[14],e[15]=r[3]*i+r[7]*a+r[11]*n+r[15]):(o=r[0],s=r[1],c=r[2],u=r[3],l=r[4],h=r[5],p=r[6],d=r[7],v=r[8],x=r[9],y=r[10],E=r[11],e[0]=o,e[1]=s,e[2]=c,e[3]=u,e[4]=l,e[5]=h,e[6]=p,e[7]=d,e[8]=v,e[9]=x,e[10]=y,e[11]=E,e[12]=o*i+l*a+v*n+r[12],e[13]=s*i+h*a+x*n+r[13],e[14]=c*i+p*a+y*n+r[14],e[15]=u*i+d*a+E*n+r[15]),e}function Vj(e,r,t){let i=t[0],a=t[1],n=t[2];return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=r[3]*i,e[4]=r[4]*a,e[5]=r[5]*a,e[6]=r[6]*a,e[7]=r[7]*a,e[8]=r[8]*n,e[9]=r[9]*n,e[10]=r[10]*n,e[11]=r[11]*n,e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function Gj(e,r,t,i){let a=i[0],n=i[1],o=i[2],s=Math.sqrt(a*a+n*n+o*o),c,u,l,h,p,d,v,x,y,E,A,S,R,j,P,C,I,F,H,z,G,D,V,$;return s<1e-6?null:(s=1/s,a*=s,n*=s,o*=s,u=Math.sin(t),c=Math.cos(t),l=1-c,h=r[0],p=r[1],d=r[2],v=r[3],x=r[4],y=r[5],E=r[6],A=r[7],S=r[8],R=r[9],j=r[10],P=r[11],C=a*a*l+c,I=n*a*l+o*u,F=o*a*l-n*u,H=a*n*l-o*u,z=n*n*l+c,G=o*n*l+a*u,D=a*o*l+n*u,V=n*o*l-a*u,$=o*o*l+c,e[0]=h*C+x*I+S*F,e[1]=p*C+y*I+R*F,e[2]=d*C+E*I+j*F,e[3]=v*C+A*I+P*F,e[4]=h*H+x*z+S*G,e[5]=p*H+y*z+R*G,e[6]=d*H+E*z+j*G,e[7]=v*H+A*z+P*G,e[8]=h*D+x*V+S*$,e[9]=p*D+y*V+R*$,e[10]=d*D+E*V+j*$,e[11]=v*D+A*V+P*$,r!==e&&(e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e)}function Kj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[4],o=r[5],s=r[6],c=r[7],u=r[8],l=r[9],h=r[10],p=r[11];return r!==e&&(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[4]=n*a+u*i,e[5]=o*a+l*i,e[6]=s*a+h*i,e[7]=c*a+p*i,e[8]=u*a-n*i,e[9]=l*a-o*i,e[10]=h*a-s*i,e[11]=p*a-c*i,e}function $j(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[0],o=r[1],s=r[2],c=r[3],u=r[8],l=r[9],h=r[10],p=r[11];return r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=n*a-u*i,e[1]=o*a-l*i,e[2]=s*a-h*i,e[3]=c*a-p*i,e[8]=n*i+u*a,e[9]=o*i+l*a,e[10]=s*i+h*a,e[11]=c*i+p*a,e}function Wj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[0],o=r[1],s=r[2],c=r[3],u=r[4],l=r[5],h=r[6],p=r[7];return r!==e&&(e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=n*a+u*i,e[1]=o*a+l*i,e[2]=s*a+h*i,e[3]=c*a+p*i,e[4]=u*a-n*i,e[5]=l*a-o*i,e[6]=h*a-s*i,e[7]=p*a-c*i,e}function Xj(e,r){let t=r[0],i=r[1],a=r[2],n=r[3],o=t+t,s=i+i,c=a+a,u=t*o,l=i*o,h=i*s,p=a*o,d=a*s,v=a*c,x=n*o,y=n*s,E=n*c;return e[0]=1-h-v,e[1]=l+E,e[2]=p-y,e[3]=0,e[4]=l-E,e[5]=1-u-v,e[6]=d+x,e[7]=0,e[8]=p+y,e[9]=d-x,e[10]=1-u-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Yj(e,r,t,i,a,n,o){let s=1/(t-r),c=1/(a-i),u=1/(n-o);return e[0]=n*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n*2*c,e[6]=0,e[7]=0,e[8]=(t+r)*s,e[9]=(a+i)*c,e[10]=(o+n)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*n*2*u,e[15]=0,e}function tK(e,r,t,i,a){let n=1/Math.tan(r/2);if(e[0]=n/t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let o=1/(i-a);e[10]=(a+i)*o,e[14]=2*a*i*o}else e[10]=-1,e[14]=-2*i;return e}var Qj=tK;function aK(e,r,t,i,a,n,o){let s=1/(r-t),c=1/(i-a),u=1/(n-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(r+t)*s,e[13]=(a+i)*c,e[14]=(o+n)*u,e[15]=1,e}var Jj=aK;function Zj(e,r,t,i){let a,n,o,s,c,u,l,h,p,d,v=r[0],x=r[1],y=r[2],E=i[0],A=i[1],S=i[2],R=t[0],j=t[1],P=t[2];return Math.abs(v-R)<1e-6&&Math.abs(x-j)<1e-6&&Math.abs(y-P)<1e-6?rK(e):(h=v-R,p=x-j,d=y-P,a=1/Math.sqrt(h*h+p*p+d*d),h*=a,p*=a,d*=a,n=A*d-S*p,o=S*h-E*d,s=E*p-A*h,a=Math.sqrt(n*n+o*o+s*s),a?(a=1/a,n*=a,o*=a,s*=a):(n=0,o=0,s=0),c=p*s-d*o,u=d*n-h*s,l=h*o-p*n,a=Math.sqrt(c*c+u*u+l*l),a?(a=1/a,c*=a,u*=a,l*=a):(c=0,u=0,l=0),e[0]=n,e[1]=c,e[2]=h,e[3]=0,e[4]=o,e[5]=u,e[6]=p,e[7]=0,e[8]=s,e[9]=l,e[10]=d,e[11]=0,e[12]=-(n*v+o*x+s*y),e[13]=-(c*v+u*x+l*y),e[14]=-(h*v+p*x+d*y),e[15]=1,e)}function nK(){let e=new ji(4);return ji!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function eT(e,r,t){let i=r[0],a=r[1],n=r[2],o=r[3];return e[0]=t[0]*i+t[4]*a+t[8]*n+t[12]*o,e[1]=t[1]*i+t[5]*a+t[9]*n+t[13]*o,e[2]=t[2]*i+t[6]*a+t[10]*n+t[14]*o,e[3]=t[3]*i+t[7]*a+t[11]*n+t[15]*o,e}var ooe=function(){let e=nK();return function(r,t,i,a,n,o){let s,c;for(t||(t=4),i||(i=0),a?c=Math.min(a*t+i,r.length):c=r.length,s=i;s<c;s+=t)e[0]=r[s],e[1]=r[s+1],e[2]=r[s+2],e[3]=r[s+3],n(e,e,o),r[s]=e[0],r[s+1]=e[1],r[s+2]=e[2],r[s+3]=e[3];return r}}();var U1;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(U1||(U1={}));var sK=45*Math.PI/180,cK=1,z1=.1,N1=500,uK=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),ti=class extends vh{static get IDENTITY(){return fK()}static get ZERO(){return lK()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return U1}constructor(r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(r)?this.copy(r):this.identity()}copy(r){return this[0]=r[0],this[1]=r[1],this[2]=r[2],this[3]=r[3],this[4]=r[4],this[5]=r[5],this[6]=r[6],this[7]=r[7],this[8]=r[8],this[9]=r[9],this[10]=r[10],this[11]=r[11],this[12]=r[12],this[13]=r[13],this[14]=r[14],this[15]=r[15],this.check()}set(r,t,i,a,n,o,s,c,u,l,h,p,d,v,x,y){return this[0]=r,this[1]=t,this[2]=i,this[3]=a,this[4]=n,this[5]=o,this[6]=s,this[7]=c,this[8]=u,this[9]=l,this[10]=h,this[11]=p,this[12]=d,this[13]=v,this[14]=x,this[15]=y,this.check()}setRowMajor(r,t,i,a,n,o,s,c,u,l,h,p,d,v,x,y){return this[0]=r,this[1]=n,this[2]=u,this[3]=d,this[4]=t,this[5]=o,this[6]=l,this[7]=v,this[8]=i,this[9]=s,this[10]=h,this[11]=x,this[12]=a,this[13]=c,this[14]=p,this[15]=y,this.check()}toRowMajor(r){return r[0]=this[0],r[1]=this[4],r[2]=this[8],r[3]=this[12],r[4]=this[1],r[5]=this[5],r[6]=this[9],r[7]=this[13],r[8]=this[2],r[9]=this[6],r[10]=this[10],r[11]=this[14],r[12]=this[3],r[13]=this[7],r[14]=this[11],r[15]=this[15],r}identity(){return this.copy(uK)}fromObject(r){return this.check()}fromQuaternion(r){return Xj(this,r),this.check()}frustum(r){let{left:t,right:i,bottom:a,top:n,near:o=z1,far:s=N1}=r;return s===1/0?pK(this,t,i,a,n,o):Yj(this,t,i,a,n,o,s),this.check()}lookAt(r){let{eye:t,center:i=[0,0,0],up:a=[0,1,0]}=r;return Zj(this,t,i,a),this.check()}ortho(r){let{left:t,right:i,bottom:a,top:n,near:o=z1,far:s=N1}=r;return Jj(this,t,i,a,n,o,s),this.check()}orthographic(r){let{fovy:t=sK,aspect:i=cK,focalDistance:a=1,near:n=z1,far:o=N1}=r;rT(t);let s=t/2,c=a*Math.tan(s),u=c*i;return this.ortho({left:-u,right:u,bottom:-c,top:c,near:n,far:o})}perspective(r){let{fovy:t=45*Math.PI/180,aspect:i=1,near:a=.1,far:n=500}=r;return rT(t),Qj(this,t,i,a,n),this.check()}determinant(){return Uj(this)}getScale(r=[-0,-0,-0]){return r[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),r[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),r[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),r}getTranslation(r=[-0,-0,-0]){return r[0]=this[12],r[1]=this[13],r[2]=this[14],r}getRotation(r,t){r=r||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];let i=this.getScale(t),a=1/i[0],n=1/i[1],o=1/i[2];return r[0]=this[0]*a,r[1]=this[1]*n,r[2]=this[2]*o,r[3]=0,r[4]=this[4]*a,r[5]=this[5]*n,r[6]=this[6]*o,r[7]=0,r[8]=this[8]*a,r[9]=this[9]*n,r[10]=this[10]*o,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}getRotationMatrix3(r,t){r=r||[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];let i=this.getScale(t),a=1/i[0],n=1/i[1],o=1/i[2];return r[0]=this[0]*a,r[1]=this[1]*n,r[2]=this[2]*o,r[3]=this[4]*a,r[4]=this[5]*n,r[5]=this[6]*o,r[6]=this[8]*a,r[7]=this[9]*n,r[8]=this[10]*o,r}transpose(){return zj(this,this),this.check()}invert(){return Nj(this,this),this.check()}multiplyLeft(r){return q1(this,r,this),this.check()}multiplyRight(r){return q1(this,this,r),this.check()}rotateX(r){return Kj(this,this,r),this.check()}rotateY(r){return $j(this,this,r),this.check()}rotateZ(r){return Wj(this,this,r),this.check()}rotateXYZ(r){return this.rotateX(r[0]).rotateY(r[1]).rotateZ(r[2])}rotateAxis(r,t){return Gj(this,this,r,t),this.check()}scale(r){return Vj(this,this,Array.isArray(r)?r:[r,r,r]),this.check()}translate(r){return Hj(this,this,r),this.check()}transform(r,t){return r.length===4?(t=eT(t||[-0,-0,-0,-0],r,this),hh(t,4),t):this.transformAsPoint(r,t)}transformAsPoint(r,t){let{length:i}=r,a;switch(i){case 2:a=Rj(t||[-0,-0],r,this);break;case 3:a=sl(t||[-0,-0,-0],r,this);break;default:throw new Error("Illegal vector")}return hh(a,r.length),a}transformAsVector(r,t){let i;switch(r.length){case 2:i=Pj(t||[-0,-0],r,this);break;case 3:i=mh(t||[-0,-0,-0],r,this);break;default:throw new Error("Illegal vector")}return hh(i,r.length),i}transformPoint(r,t){return this.transformAsPoint(r,t)}transformVector(r,t){return this.transformAsPoint(r,t)}transformDirection(r,t){return this.transformAsVector(r,t)}makeRotationX(r){return this.identity().rotateX(r)}makeTranslation(r,t,i){return this.identity().translate([r,t,i])}},yh,bh;function lK(){return yh||(yh=new ti([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(yh)),yh}function fK(){return bh||(bh=new ti,Object.freeze(bh)),bh}function rT(e){if(e>Math.PI*2)throw Error("expected radians")}function pK(e,r,t,i,a,n){let o=2*n/(t-r),s=2*n/(a-i),c=(t+r)/(t-r),u=(a+i)/(a-i),l=-1,h=-1,p=-2*n;return e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=c,e[9]=u,e[10]=l,e[11]=h,e[12]=0,e[13]=0,e[14]=p,e[15]=0,e}var ls={};yl(ls,{EPSILON1:()=>hK,EPSILON10:()=>wK,EPSILON11:()=>kK,EPSILON12:()=>SK,EPSILON13:()=>EK,EPSILON14:()=>AK,EPSILON15:()=>jK,EPSILON16:()=>TK,EPSILON17:()=>RK,EPSILON18:()=>PK,EPSILON19:()=>OK,EPSILON2:()=>dK,EPSILON20:()=>CK,EPSILON3:()=>mK,EPSILON4:()=>gK,EPSILON5:()=>vK,EPSILON6:()=>yK,EPSILON7:()=>bK,EPSILON8:()=>xK,EPSILON9:()=>_K,PI_OVER_FOUR:()=>FK,PI_OVER_SIX:()=>IK,PI_OVER_TWO:()=>BK,TWO_PI:()=>MK});var hK=.1,dK=.01,mK=.001,gK=1e-4,vK=1e-5,yK=1e-6,bK=1e-7,xK=1e-8,_K=1e-9,wK=1e-10,kK=1e-11,SK=1e-12,EK=1e-13,AK=1e-14,jK=1e-15,TK=1e-16,RK=1e-17,PK=1e-18,OK=1e-19,CK=1e-20,BK=Math.PI/2,FK=Math.PI/4,IK=Math.PI/6,MK=Math.PI*2;var Dn=6356752314245179e-9,LK={radii:[6378137,6378137,Dn],radiiSquared:[6378137*6378137,6378137*6378137,Dn*Dn],oneOverRadii:[1/6378137,1/6378137,1/Dn],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Dn*Dn)],maximumRadius:Math.max(6378137,6378137,Dn),centerToleranceSquared:.1};function xh(e){return e}var Loe=new xr;function DK(e,r=[],t=xh){return"longitude"in e?(r[0]=t(e.longitude),r[1]=t(e.latitude),r[2]=e.height):"x"in e?(r[0]=t(e.x),r[1]=t(e.y),r[2]=e.z):(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]),r}function tT(e,r=[]){return DK(e,r,gt._cartographicRadians?xh:j1)}function qK(e,r,t=xh){return"longitude"in r?(r.longitude=t(e[0]),r.latitude=t(e[1]),r.height=e[2]):"x"in r?(r.x=t(e[0]),r.y=t(e[1]),r.z=e[2]):(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]),r}function aT(e,r){return qK(e,r,gt._cartographicRadians?xh:T1)}var iT=1e-14,zK=new xr,nT={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},H1={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},ul={east:new xr,north:new xr,up:new xr,west:new xr,south:new xr,down:new xr},NK=new xr,UK=new xr,HK=new xr;function V1(e,r,t,i,a,n){let o=nT[r]&&nT[r][t];ri(o&&(!i||i===o));let s,c,u,l=zK.copy(a);if(Mn(l.x,0,iT)&&Mn(l.y,0,iT)){let p=Math.sign(l.z);s=NK.fromArray(H1[r]),r!=="east"&&r!=="west"&&s.scale(p),c=UK.fromArray(H1[t]),t!=="east"&&t!=="west"&&c.scale(p),u=HK.fromArray(H1[i]),i!=="east"&&i!=="west"&&u.scale(p)}else{let{up:p,east:d,north:v}=ul;d.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,p),v.copy(p).cross(d);let{down:x,west:y,south:E}=ul;x.copy(p).scale(-1),y.copy(d).scale(-1),E.copy(v).scale(-1),s=ul[r],c=ul[t],u=ul[i]}return n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=c.x,n[5]=c.y,n[6]=c.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=l.x,n[13]=l.y,n[14]=l.z,n[15]=1,n}var yc=new xr,VK=new xr,GK=new xr;function oT(e,r,t=[]){let{oneOverRadii:i,oneOverRadiiSquared:a,centerToleranceSquared:n}=r;yc.from(e);let o=yc.x,s=yc.y,c=yc.z,u=i.x,l=i.y,h=i.z,p=o*o*u*u,d=s*s*l*l,v=c*c*h*h,x=p+d+v,y=Math.sqrt(1/x);if(!Number.isFinite(y))return;let E=VK;if(E.copy(e).scale(y),x<n)return E.to(t);let A=a.x,S=a.y,R=a.z,j=GK;j.set(E.x*A*2,E.y*S*2,E.z*R*2);let P=(1-y)*yc.len()/(.5*j.len()),C=0,I,F,H,z;do{P-=C,I=1/(1+P*A),F=1/(1+P*S),H=1/(1+P*R);let G=I*I,D=F*F,V=H*H,$=G*I,ge=D*F,le=V*H;z=p*G+d*D+v*V-1;let de=-2*(p*$*A+d*ge*S+v*le*R);C=z/de}while(Math.abs(z)>ls.EPSILON12);return yc.scale([I,F,H]).to(t)}var _h=new xr,sT=new xr,WK=new xr,Ti=new xr,XK=new xr,wh=new xr,qn=class{constructor(r=0,t=0,i=0){this.centerToleranceSquared=ls.EPSILON1,ri(r>=0),ri(t>=0),ri(i>=0),this.radii=new xr(r,t,i),this.radiiSquared=new xr(r*r,t*t,i*i),this.radiiToTheFourth=new xr(r*r*r*r,t*t*t*t,i*i*i*i),this.oneOverRadii=new xr(r===0?0:1/r,t===0?0:1/t,i===0?0:1/i),this.oneOverRadiiSquared=new xr(r===0?0:1/(r*r),t===0?0:1/(t*t),i===0?0:1/(i*i)),this.minimumRadius=Math.min(r,t,i),this.maximumRadius=Math.max(r,t,i),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(r){return this===r||Boolean(r&&this.radii.equals(r.radii))}toString(){return this.radii.toString()}cartographicToCartesian(r,t=[0,0,0]){let i=sT,a=WK,[,,n]=r;this.geodeticSurfaceNormalCartographic(r,i),a.copy(this.radiiSquared).scale(i);let o=Math.sqrt(i.dot(a));return a.scale(1/o),i.scale(n),a.add(i),a.to(t)}cartesianToCartographic(r,t=[0,0,0]){wh.from(r);let i=this.scaleToGeodeticSurface(wh,Ti);if(!i)return;let a=this.geodeticSurfaceNormal(i,sT),n=XK;n.copy(wh).subtract(i);let o=Math.atan2(a.y,a.x),s=Math.asin(a.z),c=Math.sign(cl.dot(n,wh))*cl.length(n);return aT([o,s,c],t)}eastNorthUpToFixedFrame(r,t=new ti){return V1(this,"east","north","up",r,t)}localFrameToFixedFrame(r,t,i,a,n=new ti){return V1(this,r,t,i,a,n)}geocentricSurfaceNormal(r,t=[0,0,0]){return _h.from(r).normalize().to(t)}geodeticSurfaceNormalCartographic(r,t=[0,0,0]){let i=tT(r),a=i[0],n=i[1],o=Math.cos(n);return _h.set(o*Math.cos(a),o*Math.sin(a),Math.sin(n)).normalize(),_h.to(t)}geodeticSurfaceNormal(r,t=[0,0,0]){return _h.from(r).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(r,t){return oT(r,this,t)}scaleToGeocentricSurface(r,t=[0,0,0]){Ti.from(r);let i=Ti.x,a=Ti.y,n=Ti.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(i*i*o.x+a*a*o.y+n*n*o.z);return Ti.multiplyScalar(s).to(t)}transformPositionToScaledSpace(r,t=[0,0,0]){return Ti.from(r).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(r,t=[0,0,0]){return Ti.from(r).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(r,t=0,i=[0,0,0]){ri(Mn(this.radii.x,this.radii.y,ls.EPSILON15)),ri(this.radii.z>0),Ti.from(r);let a=Ti.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(a)>=this.radii.z-t))return Ti.set(0,0,a).to(i)}};qn.WGS84=new qn(6378137,6378137,Dn);var cT="4.4.0-alpha.0";var uT,YK=(uT=globalThis.loaders)==null?void 0:uT.parseImageNode,G1=typeof Image<"u",K1=typeof ImageBitmap<"u",QK=Boolean(YK),$1=No?!0:QK;function lT(e){switch(e){case"auto":return K1||G1||$1;case"imagebitmap":return K1;case"image":return G1;case"data":return $1;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function fT(){if(K1)return"imagebitmap";if(G1)return"image";if($1)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function JK(e){let r=ZK(e);if(!r)throw new Error("Not an image");return r}function pT(e){switch(JK(e)){case"data":return e;case"image":case"imagebitmap":let r=document.createElement("canvas"),t=r.getContext("2d");if(!t)throw new Error("getImageData");return r.width=e.width,r.height=e.height,t.drawImage(e,0,0),t.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function ZK(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var e$=/^data:image\/svg\+xml/,r$=/\.svg((\?|#).*)?$/;function kh(e){return e&&(e$.test(e)||r$.test(e))}function hT(e,r){if(kh(r)){let i=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(i=unescape(encodeURIComponent(i)))}catch(n){throw new Error(n.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return W1(e,r)}function W1(e,r){if(kh(r))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function Sh(e,r,t){let i=hT(e,t),a=self.URL||self.webkitURL,n=typeof i!="string"&&a.createObjectURL(i);try{return await t$(n||i,r)}finally{n&&a.revokeObjectURL(n)}}async function t$(e,r){let t=new Image;return t.src=e,r.image&&r.image.decode&&t.decode?(await t.decode(),t):await new Promise((i,a)=>{try{t.onload=()=>i(t),t.onerror=n=>{let o=n instanceof Error?n.message:"error";a(new Error(o))}}catch(n){a(n)}})}var a$={},dT=!0;async function mT(e,r,t){let i;kh(t)?i=await Sh(e,r,t):i=W1(e,t);let a=r&&r.imagebitmap;return await i$(i,a)}async function i$(e,r=null){if((n$(r)||!dT)&&(r=null),r)try{return await createImageBitmap(e,r)}catch(t){console.warn(t),dT=!1}return await createImageBitmap(e)}function n$(e){for(let r in e||a$)return!1;return!0}function gT(e){return!u$(e,"ftyp",4)||!(e[8]&96)?null:o$(e)}function o$(e){switch(s$(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function s$(e,r,t){return String.fromCharCode(...e.slice(r,t))}function c$(e){return[...e].map(r=>r.charCodeAt(0))}function u$(e,r,t=0){let i=c$(r);for(let a=0;a<i.length;++a)if(i[a]!==e[a+t])return!1;return!0}var nn=!1,ll=!0;function Eh(e){let r=fl(e);return f$(r)||d$(r)||p$(r)||h$(r)||l$(r)}function l$(e){let r=new Uint8Array(e instanceof DataView?e.buffer:e),t=gT(r);return t?{mimeType:t.mimeType,width:0,height:0}:null}function f$(e){let r=fl(e);return r.byteLength>=24&&r.getUint32(0,nn)===2303741511?{mimeType:"image/png",width:r.getUint32(16,nn),height:r.getUint32(20,nn)}:null}function p$(e){let r=fl(e);return r.byteLength>=10&&r.getUint32(0,nn)===1195984440?{mimeType:"image/gif",width:r.getUint16(6,ll),height:r.getUint16(8,ll)}:null}function h$(e){let r=fl(e);return r.byteLength>=14&&r.getUint16(0,nn)===16973&&r.getUint32(2,ll)===r.byteLength?{mimeType:"image/bmp",width:r.getUint32(18,ll),height:r.getUint32(22,ll)}:null}function d$(e){let r=fl(e);if(!(r.byteLength>=3&&r.getUint16(0,nn)===65496&&r.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:a}=m$(),n=2;for(;n+9<r.byteLength;){let o=r.getUint16(n,nn);if(a.has(o))return{mimeType:"image/jpeg",height:r.getUint16(n+5,nn),width:r.getUint16(n+7,nn)};if(!i.has(o))return null;n+=2,n+=r.getUint16(n,nn)}return null}function m$(){let e=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)e.add(t);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function fl(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}async function vT(e,r){var a;let{mimeType:t}=Eh(e)||{},i=(a=globalThis.loaders)==null?void 0:a.parseImageNode;return ki(i),await i(e,t)}async function yT(e,r,t){r=r||{};let a=(r.image||{}).type||"auto",{url:n}=t||{},o=g$(a),s;switch(o){case"imagebitmap":s=await mT(e,r,n);break;case"image":s=await Sh(e,r,n);break;case"data":s=await vT(e,r);break;default:ki(!1)}return a==="data"&&(s=pT(s)),s}function g$(e){switch(e){case"auto":case"data":return fT();default:return lT(e),e}}var v$=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],y$=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],b$={image:{type:"auto",decode:!0}},Ah={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:cT,mimeTypes:y$,extensions:v$,parse:yT,tests:[e=>Boolean(Eh(new DataView(e)))],options:b$};var x$="1.5.6",_$="1.4.1",X1=`https://www.gstatic.com/draco/versioned/decoders/${x$}`,Sa={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},Y1={[Sa.DECODER]:`${X1}/${Sa.DECODER}`,[Sa.DECODER_WASM]:`${X1}/${Sa.DECODER_WASM}`,[Sa.FALLBACK_DECODER]:`${X1}/${Sa.FALLBACK_DECODER}`,[Sa.ENCODER]:`https://raw.githubusercontent.com/google/draco/${_$}/javascript/${Sa.ENCODER}`},Q1;async function bT(e){let r=e.modules||{};return r.draco3d?Q1||=r.draco3d.createDecoderModule({}).then(t=>({draco:t})):Q1||=w$(e),await Q1}async function w$(e){let r,t;switch(e.draco&&e.draco.decoderType){case"js":r=await Qi(Y1[Sa.FALLBACK_DECODER],"draco",e,Sa.FALLBACK_DECODER);break;case"wasm":default:[r,t]=await Promise.all([await Qi(Y1[Sa.DECODER],"draco",e,Sa.DECODER),await Qi(Y1[Sa.DECODER_WASM],"draco",e,Sa.DECODER_WASM)])}return r=r||globalThis.DracoDecoderModule,await k$(r,t)}function k$(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e({...t,onModuleLoaded:a=>i({draco:a})})})}var xT="4.4.0-alpha.0";function wT(e,r,t){let i=kT(r.metadata),a=[],n=S$(r.attributes);for(let o in e){let s=e[o],c=_T(o,s,n[o]);a.push(c)}if(t){let o=_T("indices",t);a.push(o)}return{fields:a,metadata:i}}function S$(e){let r={};for(let t in e){let i=e[t];r[i.name||"undefined"]=i}return r}function _T(e,r,t){let i=t?kT(t.metadata):void 0;return S1(e,r,i)}function kT(e){Object.entries(e);let r={};for(let t in e)r[`${t}.string`]=JSON.stringify(e[t]);return r}var ST={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},E$={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},A$=4,pl=class{draco;decoder;metadataQuerier;constructor(r){this.draco=r,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(r,t={}){let i=new this.draco.DecoderBuffer;i.Init(new Int8Array(r),r.byteLength),this._disableAttributeTransforms(t);let a=this.decoder.GetEncodedGeometryType(i),n=a===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(a){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,n);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,n);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!n.ptr){let p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}let s=this._getDracoLoaderData(n,a,t),c=this._getMeshData(n,s,t),u=k1(c.attributes),l=wT(c.attributes,s,c.indices);return{loader:"draco",loaderData:s,header:{vertexCount:n.num_points(),boundingBox:u},...c,schema:l}}finally{this.draco.destroy(i),n&&this.draco.destroy(n)}}_getDracoLoaderData(r,t,i){let a=this._getTopLevelMetadata(r),n=this._getDracoAttributes(r,i);return{geometry_type:t,num_attributes:r.num_attributes(),num_points:r.num_points(),num_faces:r instanceof this.draco.Mesh?r.num_faces():0,metadata:a,attributes:n}}_getDracoAttributes(r,t){let i={};for(let a=0;a<r.num_attributes();a++){let n=this.decoder.GetAttribute(r,a),o=this._getAttributeMetadata(r,a);i[n.unique_id()]={unique_id:n.unique_id(),attribute_type:n.attribute_type(),data_type:n.data_type(),num_components:n.num_components(),byte_offset:n.byte_offset(),byte_stride:n.byte_stride(),normalized:n.normalized(),attribute_index:a,metadata:o};let s=this._getQuantizationTransform(n,t);s&&(i[n.unique_id()].quantization_transform=s);let c=this._getOctahedronTransform(n,t);c&&(i[n.unique_id()].octahedron_transform=c)}return i}_getMeshData(r,t,i){let a=this._getMeshAttributes(t,r,i);if(!a.POSITION)throw new Error("DRACO: No position attribute found.");if(r instanceof this.draco.Mesh)switch(i.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:a,indices:{value:this._getTriangleStripIndices(r),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:a,indices:{value:this._getTriangleListIndices(r),size:1}}}return{topology:"point-list",mode:0,attributes:a}}_getMeshAttributes(r,t,i){let a={};for(let n of Object.values(r.attributes)){let o=this._deduceAttributeName(n,i);n.name=o;let s=this._getAttributeValues(t,n);if(s){let{value:c,size:u}=s;a[o]={value:c,size:u,byteOffset:n.byte_offset,byteStride:n.byte_stride,normalized:n.normalized}}}return a}_getTriangleListIndices(r){let i=r.num_faces()*3,a=i*A$,n=this.draco._malloc(a);try{return this.decoder.GetTrianglesUInt32Array(r,a,n),new Uint32Array(this.draco.HEAPF32.buffer,n,i).slice()}finally{this.draco._free(n)}}_getTriangleStripIndices(r){let t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(r,t),R$(t)}finally{this.draco.destroy(t)}}_getAttributeValues(r,t){let i=E$[t.data_type];if(!i)return console.warn(`DRACO: Unsupported attribute type ${t.data_type}`),null;let a=t.num_components,o=r.num_points()*a,s=o*i.BYTES_PER_ELEMENT,c=j$(this.draco,i),u,l=this.draco._malloc(s);try{let h=this.decoder.GetAttribute(r,t.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(r,h,c,s,l),u=new i(this.draco.HEAPF32.buffer,l,o).slice()}finally{this.draco._free(l)}return{value:u,size:a}}_deduceAttributeName(r,t){let i=r.unique_id;for(let[o,s]of Object.entries(t.extraAttributes||{}))if(s===i)return o;let a=r.attribute_type;for(let o in ST)if(this.draco[o]===a)return ST[o];let n=t.attributeNameEntry||"name";return r.metadata[n]?r.metadata[n].string:`CUSTOM_ATTRIBUTE_${i}`}_getTopLevelMetadata(r){let t=this.decoder.GetMetadata(r);return this._getDracoMetadata(t)}_getAttributeMetadata(r,t){let i=this.decoder.GetAttributeMetadata(r,t);return this._getDracoMetadata(i)}_getDracoMetadata(r){if(!r||!r.ptr)return{};let t={},i=this.metadataQuerier.NumEntries(r);for(let a=0;a<i;a++){let n=this.metadataQuerier.GetEntryName(r,a);t[n]=this._getDracoMetadataField(r,n)}return t}_getDracoMetadataField(r,t){let i=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(r,t,i);let a=T$(i);return{int:this.metadataQuerier.GetIntEntry(r,t),string:this.metadataQuerier.GetStringEntry(r,t),double:this.metadataQuerier.GetDoubleEntry(r,t),intArray:a}}finally{this.draco.destroy(i)}}_disableAttributeTransforms(r){let{quantizedAttributes:t=[],octahedronAttributes:i=[]}=r,a=[...t,...i];for(let n of a)this.decoder.SkipAttributeTransform(this.draco[n])}_getQuantizationTransform(r,t){let{quantizedAttributes:i=[]}=t,a=r.attribute_type();if(i.map(o=>this.decoder[o]).includes(a)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(r))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map(s=>o.min_value(s))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(r,t){let{octahedronAttributes:i=[]}=t,a=r.attribute_type();if(i.map(o=>this.decoder[o]).includes(a)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(r))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}};function j$(e,r){switch(r){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}function T$(e){let r=e.size(),t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=e.GetValue(i);return t}function R$(e){let r=e.size(),t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=e.GetValue(i);return t}var ET={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:xT,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}},J1={...ET,parse:P$};async function P$(e,r){let{draco:t}=await bT(r),i=new pl(t);try{return i.parseSync(e,r==null?void 0:r.draco)}finally{i.destroy()}}var jh="4.4.0-alpha.0";var Th={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},AT;async function ey(e){Jg(e.modules);let r=Zg("basis");return r||(AT||=O$(e),await AT)}async function O$(e){let r=null,t=null;return[r,t]=await Promise.all([await Qi(Th.TRANSCODER,"textures",e),await Qi(Th.TRANSCODER_WASM,"textures",e)]),r=r||globalThis.BASIS,await C$(r,t)}function C$(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e(t).then(a=>{let{BasisFile:n,initializeBasis:o}=a;o(),i({BasisFile:n})})})}var Z1;async function ry(e){let r=e.modules||{};return r.basisEncoder?r.basisEncoder:(Z1=Z1||B$(e),await Z1)}async function B$(e){let r=null,t=null;return[r,t]=await Promise.all([await Qi(Th.ENCODER,"textures",e),await Qi(Th.ENCODER_WASM,"textures",e)]),r=r||globalThis.BASIS,await F$(r,t)}function F$(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e(t).then(a=>{let{BasisFile:n,KTX2File:o,initializeBasis:s,BasisEncoder:c}=a;s(),i({BasisFile:n,KTX2File:o,BasisEncoder:c})})})}var re={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};var I$=["","WEBKIT_","MOZ_"],jT={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},Rh=null;function TT(e){if(!Rh){e=e||M$()||void 0,Rh=new Set;for(let r of I$)for(let t in jT)if(e&&e.getExtension(`${r}${t}`)){let i=jT[t];Rh.add(i)}}return Rh}function M$(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var ty=class{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}},fs=class{constructor(r,t,i,a){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(r.buffer,r.byteOffset+t,i),this._littleEndian=a,this._offset=0}_nextUint8(){let r=this._dataView.getUint8(this._offset);return this._offset+=1,r}_nextUint16(){let r=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,r}_nextUint32(){let r=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,r}_nextUint64(){let r=this._dataView.getUint32(this._offset,this._littleEndian),t=this._dataView.getUint32(this._offset+4,this._littleEndian),i=r+2**32*t;return this._offset+=8,i}_nextInt32(){let r=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,r}_nextUint8Array(r){let t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,r);return this._offset+=r,t}_skip(r){return this._offset+=r,this}_scan(r,t=0){let i=this._offset,a=0;for(;this._dataView.getUint8(this._offset)!==t&&a<r;)a++,this._offset++;return a<r&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+i,a)}};var Wse=new Uint8Array([0]),ha=[171,75,84,88,32,50,48,187,13,10,26,10];function RT(e){return new TextDecoder().decode(e)}function PT(e){let r=new Uint8Array(e.buffer,e.byteOffset,ha.length);if(r[0]!==ha[0]||r[1]!==ha[1]||r[2]!==ha[2]||r[3]!==ha[3]||r[4]!==ha[4]||r[5]!==ha[5]||r[6]!==ha[6]||r[7]!==ha[7]||r[8]!==ha[8]||r[9]!==ha[9]||r[10]!==ha[10]||r[11]!==ha[11])throw new Error("Missing KTX 2.0 identifier.");let t=new ty,i=17*Uint32Array.BYTES_PER_ELEMENT,a=new fs(e,ha.length,i,!0);t.vkFormat=a._nextUint32(),t.typeSize=a._nextUint32(),t.pixelWidth=a._nextUint32(),t.pixelHeight=a._nextUint32(),t.pixelDepth=a._nextUint32(),t.layerCount=a._nextUint32(),t.faceCount=a._nextUint32();let n=a._nextUint32();t.supercompressionScheme=a._nextUint32();let o=a._nextUint32(),s=a._nextUint32(),c=a._nextUint32(),u=a._nextUint32(),l=a._nextUint64(),h=a._nextUint64(),p=n*3*8,d=new fs(e,ha.length+i,p,!0);for(let ie=0;ie<n;ie++)t.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});let v=new fs(e,o,s,!0),x={vendorId:v._skip(4)._nextUint16(),descriptorType:v._nextUint16(),versionNumber:v._nextUint16(),descriptorBlockSize:v._nextUint16(),colorModel:v._nextUint8(),colorPrimaries:v._nextUint8(),transferFunction:v._nextUint8(),flags:v._nextUint8(),texelBlockDimension:[v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8()],bytesPlane:[v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8()],samples:[]},y=6,E=4,A=(x.descriptorBlockSize/4-y)/E;for(let ie=0;ie<A;ie++){let we={bitOffset:v._nextUint16(),bitLength:v._nextUint8(),channelType:v._nextUint8(),samplePosition:[v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};we.channelType&64?(we.sampleLower=v._nextInt32(),we.sampleUpper=v._nextInt32()):(we.sampleLower=v._nextUint32(),we.sampleUpper=v._nextUint32()),x.samples[ie]=we}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(x);let S=new fs(e,c,u,!0);for(;S._offset<u;){let ie=S._nextUint32(),we=S._scan(ie),Te=RT(we);if(t.keyValue[Te]=S._nextUint8Array(ie-we.byteLength-1),Te.match(/^ktx/i)){let U=RT(t.keyValue[Te]);t.keyValue[Te]=U.substring(0,U.lastIndexOf("\0"))}let Se=ie%4?4-ie%4:0;S._skip(Se)}if(h<=0)return t;let R=new fs(e,l,h,!0),j=R._nextUint16(),P=R._nextUint16(),C=R._nextUint32(),I=R._nextUint32(),F=R._nextUint32(),H=R._nextUint32(),z=[];for(let ie=0;ie<n;ie++)z.push({imageFlags:R._nextUint32(),rgbSliceByteOffset:R._nextUint32(),rgbSliceByteLength:R._nextUint32(),alphaSliceByteOffset:R._nextUint32(),alphaSliceByteLength:R._nextUint32()});let G=l+R._offset,D=G+C,V=D+I,$=V+F,ge=new Uint8Array(e.buffer,e.byteOffset+G,C),le=new Uint8Array(e.buffer,e.byteOffset+D,I),oe=new Uint8Array(e.buffer,e.byteOffset+V,F),de=new Uint8Array(e.buffer,e.byteOffset+$,H);return t.globalData={endpointCount:j,selectorCount:P,imageDescs:z,endpointsData:ge,selectorsData:le,tablesData:oe,extendedData:de},t}function bc(e,r){let t=new Array(r.mipMapLevels),i=r.width,a=r.height,n=0;for(let o=0;o<r.mipMapLevels;++o){let s=D$(r,i,a,e,o),c=L$(e,o,n,s);t[o]={compressed:!0,format:r.internalFormat,data:c,width:i,height:a,levelSize:s},i=Math.max(1,i>>1),a=Math.max(1,a>>1),n+=s}return t}function L$(e,r,t,i){return Array.isArray(e)?e[r].levelData:new Uint8Array(e.buffer,e.byteOffset+t,i)}function D$(e,r,t,i,a){return Array.isArray(i)?e.sizeFunction(i[a]):e.sizeFunction(r,t)}var q$={131:re.COMPRESSED_RGB_S3TC_DXT1_EXT,132:re.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:re.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:re.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:re.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:re.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:re.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:re.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:re.COMPRESSED_RED_RGTC1_EXT,140:re.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:re.COMPRESSED_RED_GREEN_RGTC2_EXT,142:re.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:re.COMPRESSED_RGB8_ETC2,148:re.COMPRESSED_SRGB8_ETC2,149:re.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:re.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:re.COMPRESSED_RGBA8_ETC2_EAC,152:re.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:re.COMPRESSED_R11_EAC,154:re.COMPRESSED_SIGNED_R11_EAC,155:re.COMPRESSED_RG11_EAC,156:re.COMPRESSED_SIGNED_RG11_EAC,157:re.COMPRESSED_RGBA_ASTC_4x4_KHR,158:re.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:re.COMPRESSED_RGBA_ASTC_5x4_KHR,160:re.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:re.COMPRESSED_RGBA_ASTC_5x5_KHR,162:re.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:re.COMPRESSED_RGBA_ASTC_6x5_KHR,164:re.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:re.COMPRESSED_RGBA_ASTC_6x6_KHR,166:re.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:re.COMPRESSED_RGBA_ASTC_8x5_KHR,168:re.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:re.COMPRESSED_RGBA_ASTC_8x6_KHR,170:re.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:re.COMPRESSED_RGBA_ASTC_8x8_KHR,172:re.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:re.COMPRESSED_RGBA_ASTC_10x5_KHR,174:re.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:re.COMPRESSED_RGBA_ASTC_10x6_KHR,176:re.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:re.COMPRESSED_RGBA_ASTC_10x8_KHR,178:re.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:re.COMPRESSED_RGBA_ASTC_10x10_KHR,180:re.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:re.COMPRESSED_RGBA_ASTC_12x10_KHR,182:re.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:re.COMPRESSED_RGBA_ASTC_12x12_KHR,184:re.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:re.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:re.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:re.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:re.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:re.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:re.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:re.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:re.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:re.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:re.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:re.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:re.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:re.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:re.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:re.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:re.COMPRESSED_RGBA_ASTC_12x12_KHR};function OT(e){return q$[e]}var Ba=[171,75,84,88,32,50,48,187,13,10,26,10];function Ph(e){let r=new Uint8Array(e);return!(r.byteLength<Ba.length||r[0]!==Ba[0]||r[1]!==Ba[1]||r[2]!==Ba[2]||r[3]!==Ba[3]||r[4]!==Ba[4]||r[5]!==Ba[5]||r[6]!==Ba[6]||r[7]!==Ba[7]||r[8]!==Ba[8]||r[9]!==Ba[9]||r[10]!==Ba[10]||r[11]!==Ba[11])}function CT(e){let r=new Uint8Array(e),t=PT(r),i=Math.max(1,t.levels.length),a=t.pixelWidth,n=t.pixelHeight,o=OT(t.vkFormat);return bc(t.levels,{mipMapLevels:i,width:a,height:n,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var z$={etc1:{basisFormat:0,compressed:!0,format:re.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:re.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:re.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:re.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:re.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:re.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function Oh(e,r){if(r.basis.containerFormat==="auto"){if(Ph(e)){let i=await ry(r);return BT(i.KTX2File,e,r)}let{BasisFile:t}=await ey(r);return ay(t,e,r)}switch(r.basis.module){case"encoder":let t=await ry(r);switch(r.basis.containerFormat){case"ktx2":return BT(t.KTX2File,e,r);case"basis":default:return ay(t.BasisFile,e,r)}case"transcoder":default:let{BasisFile:i}=await ey(r);return ay(i,e,r)}}function ay(e,r,t){let i=new e(new Uint8Array(r));try{if(!i.startTranscoding())throw new Error("Failed to start basis transcoding");let a=i.getNumImages(),n=[];for(let o=0;o<a;o++){let s=i.getNumLevels(o),c=[];for(let u=0;u<s;u++)c.push(N$(i,o,u,t));n.push(c)}return n}finally{i.close(),i.delete()}}function N$(e,r,t,i){let a=e.getImageWidth(r,t),n=e.getImageHeight(r,t),o=e.getHasAlpha(),{compressed:s,format:c,basisFormat:u}=FT(i,o),l=e.getImageTranscodedSizeInBytes(r,t,u),h=new Uint8Array(l);if(!e.transcodeImage(h,r,t,u,0,0))throw new Error("failed to start Basis transcoding");return{width:a,height:n,data:h,compressed:s,format:c,hasAlpha:o}}function BT(e,r,t){let i=new e(new Uint8Array(r));try{if(!i.startTranscoding())throw new Error("failed to start KTX2 transcoding");let a=i.getLevels(),n=[];for(let o=0;o<a;o++)n.push(U$(i,o,t));return[n]}finally{i.close(),i.delete()}}function U$(e,r,t){let{alphaFlag:i,height:a,width:n}=e.getImageLevelInfo(r,0,0),{compressed:o,format:s,basisFormat:c}=FT(t,i),u=e.getImageTranscodedSizeInBytes(r,0,0,c),l=new Uint8Array(u);if(!e.transcodeImage(l,r,0,0,c,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:n,height:a,data:l,compressed:o,levelSize:u,hasAlpha:i,format:s}}function FT(e,r){let t=e&&e.basis&&e.basis.format;return t==="auto"&&(t=H$()),typeof t=="object"&&(t=r?t.alpha:t.noAlpha),t=t.toLowerCase(),z$[t]}function H$(){let e=TT();return e.has("astc")?"astc-4x4":e.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:e.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:e.has("etc1")?"etc1":e.has("etc2")?"etc2":"rgb565"}var IT={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:jh,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},hl={...IT,parse:Oh};var Fa={MAGIC_NUMBER:542327876,HEADER_LENGTH:31,MAGIC_NUMBER_INDEX:0,HEADER_SIZE_INDEX:1,HEADER_FLAGS_INDEX:2,HEADER_HEIGHT_INDEX:3,HEADER_WIDTH_INDEX:4,MIPMAPCOUNT_INDEX:7,HEADER_PF_FLAGS_INDEX:20,HEADER_PF_FOURCC_INDEX:21,DDSD_MIPMAPCOUNT:131072,DDPF_FOURCC:4},V$={DXT1:re.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:re.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:re.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":re.COMPRESSED_RGB_ATC_WEBGL,ATCA:re.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:re.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},G$=DT,K$=Ch,$$=Ch,W$={DXT1:DT,DXT3:Ch,DXT5:Ch,"ATC ":G$,ATCA:K$,ATCI:$$};function MT(e){return new Uint32Array(e,0,Fa.HEADER_LENGTH)[Fa.MAGIC_NUMBER_INDEX]===Fa.MAGIC_NUMBER}function LT(e){let r=new Int32Array(e,0,Fa.HEADER_LENGTH),t=r[Fa.HEADER_PF_FOURCC_INDEX];ki(Boolean(r[Fa.HEADER_PF_FLAGS_INDEX]&Fa.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let i=X$(t),a=V$[i],n=W$[i];ki(a&&n,`DDS: Unknown pixel format ${t}`);let o=1;r[Fa.HEADER_FLAGS_INDEX]&Fa.DDSD_MIPMAPCOUNT&&(o=Math.max(1,r[Fa.MIPMAPCOUNT_INDEX]));let s=r[Fa.HEADER_WIDTH_INDEX],c=r[Fa.HEADER_HEIGHT_INDEX],u=r[Fa.HEADER_SIZE_INDEX]+4,l=new Uint8Array(e,u);return bc(l,{mipMapLevels:o,width:s,height:c,sizeFunction:n,internalFormat:a})}function DT(e,r){return(e+3>>2)*(r+3>>2)*8}function Ch(e,r){return(e+3>>2)*(r+3>>2)*16}function X$(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var ai={MAGIC_NUMBER:55727696,MAGIC_NUMBER_EXTRA:1347834371,HEADER_LENGTH:13,HEADER_SIZE:52,MAGIC_NUMBER_INDEX:0,PIXEL_FORMAT_INDEX:2,COLOUR_SPACE_INDEX:4,HEIGHT_INDEX:6,WIDTH_INDEX:7,MIPMAPCOUNT_INDEX:11,METADATA_SIZE_INDEX:12},Y$={0:[re.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[re.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[re.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[re.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[re.COMPRESSED_RGB_ETC1_WEBGL],7:[re.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[re.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[re.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[re.COMPRESSED_RGB8_ETC2],23:[re.COMPRESSED_RGBA8_ETC2_EAC],24:[re.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[re.COMPRESSED_R11_EAC],26:[re.COMPRESSED_RG11_EAC],27:[re.COMPRESSED_RGBA_ASTC_4X4_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[re.COMPRESSED_RGBA_ASTC_5X4_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[re.COMPRESSED_RGBA_ASTC_5X5_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[re.COMPRESSED_RGBA_ASTC_6X5_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[re.COMPRESSED_RGBA_ASTC_6X6_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[re.COMPRESSED_RGBA_ASTC_8X5_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[re.COMPRESSED_RGBA_ASTC_8X6_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[re.COMPRESSED_RGBA_ASTC_8X8_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[re.COMPRESSED_RGBA_ASTC_10X5_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[re.COMPRESSED_RGBA_ASTC_10X6_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[re.COMPRESSED_RGBA_ASTC_10X8_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[re.COMPRESSED_RGBA_ASTC_10X10_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[re.COMPRESSED_RGBA_ASTC_12X10_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[re.COMPRESSED_RGBA_ASTC_12X12_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},Q$={0:qT,1:qT,2:zT,3:zT,6:dl,7:dl,9:ml,11:ml,22:dl,23:ml,24:dl,25:dl,26:ml,27:ml,28:J$,29:Z$,30:eW,31:rW,32:tW,33:aW,34:iW,35:nW,36:oW,37:sW,38:cW,39:uW,40:lW};function NT(e){let t=new Uint32Array(e,0,ai.HEADER_LENGTH)[ai.MAGIC_NUMBER_INDEX];return t===ai.MAGIC_NUMBER||t===ai.MAGIC_NUMBER_EXTRA}function UT(e){let r=new Uint32Array(e,0,ai.HEADER_LENGTH),t=r[ai.PIXEL_FORMAT_INDEX],i=r[ai.COLOUR_SPACE_INDEX],a=Y$[t]||[],n=a.length>1&&i?a[1]:a[0],o=Q$[t],s=r[ai.MIPMAPCOUNT_INDEX],c=r[ai.WIDTH_INDEX],u=r[ai.HEIGHT_INDEX],l=ai.HEADER_SIZE+r[ai.METADATA_SIZE_INDEX],h=new Uint8Array(e,l);return bc(h,{mipMapLevels:s,width:c,height:u,sizeFunction:o,internalFormat:n})}function qT(e,r){return e=Math.max(e,16),r=Math.max(r,8),e*r/4}function zT(e,r){return e=Math.max(e,8),r=Math.max(r,8),e*r/2}function dl(e,r){return Math.floor((e+3)/4)*Math.floor((r+3)/4)*8}function ml(e,r){return Math.floor((e+3)/4)*Math.floor((r+3)/4)*16}function J$(e,r){return Math.floor((e+4)/5)*Math.floor((r+3)/4)*16}function Z$(e,r){return Math.floor((e+4)/5)*Math.floor((r+4)/5)*16}function eW(e,r){return Math.floor((e+5)/6)*Math.floor((r+4)/5)*16}function rW(e,r){return Math.floor((e+5)/6)*Math.floor((r+5)/6)*16}function tW(e,r){return Math.floor((e+7)/8)*Math.floor((r+4)/5)*16}function aW(e,r){return Math.floor((e+7)/8)*Math.floor((r+5)/6)*16}function iW(e,r){return Math.floor((e+7)/8)*Math.floor((r+7)/8)*16}function nW(e,r){return Math.floor((e+9)/10)*Math.floor((r+4)/5)*16}function oW(e,r){return Math.floor((e+9)/10)*Math.floor((r+5)/6)*16}function sW(e,r){return Math.floor((e+9)/10)*Math.floor((r+7)/8)*16}function cW(e,r){return Math.floor((e+9)/10)*Math.floor((r+9)/10)*16}function uW(e,r){return Math.floor((e+11)/12)*Math.floor((r+9)/10)*16}function lW(e,r){return Math.floor((e+11)/12)*Math.floor((r+11)/12)*16}function HT(e){if(Ph(e))return CT(e);if(MT(e))return LT(e);if(NT(e))return UT(e);throw new Error("Texture container format not recognized")}var VT={dataType:null,batchType:null,name:"Texture Containers",id:"compressed-texture",module:"textures",version:jh,worker:!0,extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0,options:{"compressed-texture":{libraryPath:"libs/",useBasis:!1}}},Bh={...VT,parse:async(e,r)=>{var t;return(t=r==null?void 0:r["compressed-texture"])!=null&&t.useBasis?(r.basis={format:{alpha:"BC3",noAlpha:"BC1"},...r.basis,containerFormat:"ktx2",module:"encoder"},(await Oh(e,r))[0]):HT(e)}};function GT(e,r=null){return r?`${e}?token=${r}`:e}var fW={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},pW={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},ps={...fW,...pW};function iy(e){switch(e){case"UInt8":return Uint8Array;case"UInt16":return Uint16Array;case"UInt32":return Uint32Array;case"Float32":return Float32Array;case"UInt64":return Float64Array;default:throw new Error(`parse i3s tile content: unknown type of data: ${e}`)}}var KT={UInt8:ps.UNSIGNED_BYTE,UInt16:ps.UNSIGNED_SHORT,Float32:ps.FLOAT,UInt32:ps.UNSIGNED_INT,UInt64:ps.DOUBLE};function xc(e){switch(e){case"UInt8":return 1;case"UInt16":case"Int16":return 2;case"UInt32":case"Int32":case"Float32":return 4;case"UInt64":case"Int64":case"Float64":return 8;default:throw new Error(`parse i3s tile content: unknown size of data: ${e}`)}}var Fh=new xr([0,0,0]);function hW(e){switch(e){case"ktx-etc2":case"dds":return Bh;case"ktx2":return hl;case"jpg":case"png":default:return Ah}}var dW="i3s-attribute-type";async function YT(e,r,t,i,a){var o;let n={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new ti,coordinateSystem:0,byteLength:0,texture:null};if(r.textureUrl){let s=GT(r.textureUrl,(o=i==null?void 0:i.i3s)==null?void 0:o.token),c=hW(r.textureFormat),h=await(await((a==null?void 0:a.fetch)||fetch)(s)).arrayBuffer();if(i!=null&&i.i3s.decodeTextures){if(c===Ah){let p={...r.textureLoaderOptions,image:{type:"data"}};try{let d=await $g(h,[],p,a);n.texture=d}catch{let v=await In(h,c,p,a);n.texture=v}}else if(c===Bh||c===hl){let p=await E1(h,c,r.textureLoaderOptions);c===hl&&(p=p[0]),n.texture={compressed:!0,mipmaps:!1,width:p[0].width,height:p[0].height,data:p}}}else n.texture=h}return n.material=kW(r.materialDefinition,n.texture),n.material&&(n.texture=null),await mW(e,n,r,t,i)}async function mW(e,r,t,i,a){var h,p;let n=e.byteLength,o,s,c=0,u=0,l;if(t.isDracoGeometry){let d=await In(e,J1,{draco:{attributeNameEntry:dW}});s=d.header.vertexCount,l=(h=d.indices)==null?void 0:h.value;let{POSITION:v,NORMAL:x,COLOR_0:y,TEXCOORD_0:E,["feature-index"]:A,["uv-region"]:S}=d.attributes;o={position:v,normal:x,color:y,uv0:E,uvRegion:S,id:A},gW(o,d);let R=jW(A);R&&AW(o,R)}else{let{vertexAttributes:d,ordering:v,featureAttributes:x,featureAttributeOrder:y}=i.store.defaultGeometrySchema,E=yW(e,i);c=E.byteOffset,s=E.vertexCount,u=E.featureCount;let{attributes:A,byteOffset:S}=WT(e,c,d,s,v),{attributes:R}=WT(e,S,x,u,y);EW(R),o=vW(A,R)}if(!((p=a==null?void 0:a.i3s)!=null&&p.coordinateSystem)||a.i3s.coordinateSystem===2){let d=xW(o.position,t);r.modelMatrix=d.invert(),r.coordinateSystem=2}else r.modelMatrix=wW(o.position),r.coordinateSystem=3;r.attributes={positions:o.position,normals:o.normal,colors:$T(o.color),texCoords:o.uv0,uvRegions:$T(o.uvRegion||o.region)},r.indices=l||null,o.id&&o.id.value&&(r.featureIds=o.id.value);for(let d in r.attributes)r.attributes[d]||delete r.attributes[d];return r.vertexCount=s,r.byteLength=n,r}function gW(e,r){for(let t in r.loaderData.attributes){let i=r.loaderData.attributes[t];switch(i.name){case"POSITION":e.position.metadata=i.metadata;break;case"feature-index":e.id.metadata=i.metadata;break;default:break}}}function vW(e,r){return{...e,...r}}function $T(e){return e&&(e.normalized=!0,e)}function yW(e,r){let t=0,i=0,a=0;for(let{property:n,type:o}of r.store.defaultGeometrySchema.header){let s=iy(o);switch(n){case"vertexCount".toString():i=new s(e,0,4)[0],t+=xc(o);break;case"featureCount".toString():a=new s(e,4,4)[0],t+=xc(o);break;default:break}}return{vertexCount:i,featureCount:a,byteOffset:t}}function WT(e,r,t,i,a){let n={};for(let o of a)if(t[o]){let{valueType:s,valuesPerElement:c}=t[o];if(r+i*c*xc(s)<=e.byteLength){let u=e.slice(r),l;if(s==="UInt64")l=bW(u,i*c,xc(s));else{let h=iy(s);l=new h(u,0,i*c)}switch(n[o]={value:l,type:KT[s],size:c},o){case"color":n.color.normalized=!0;break;case"position":case"region":case"normal":default:}r=r+i*c*xc(s)}else if(o!=="uv0")break}return{attributes:n,byteOffset:r}}function bW(e,r,t){let i=[],a=new DataView(e),n=0;for(let o=0;o<r;o++){let s=a.getUint32(n,!0),c=a.getUint32(n+4,!0),u=s+2**32*c;i.push(u),n+=t}return new Uint32Array(i)}function xW(e,r){let t=r.mbs,i=e.value,a=e.metadata,n=new ti,o=new xr(t[0],t[1],t[2]),s=new xr;return qn.WGS84.cartographicToCartesian(o,s),qn.WGS84.eastNorthUpToFixedFrame(s,n),e.value=_W(i,a,o),n}function _W(e,r={},t){let i=new Float64Array(e.length),a=r["i3s-scale_x"]&&r["i3s-scale_x"].double||1,n=r["i3s-scale_y"]&&r["i3s-scale_y"].double||1;for(let o=0;o<i.length;o+=3)i[o]=e[o]*a+t.x,i[o+1]=e[o+1]*n+t.y,i[o+2]=e[o+2]+t.z;for(let o=0;o<i.length;o+=3)qn.WGS84.cartographicToCartesian(i.subarray(o,o+3),Fh),i[o]=Fh.x,i[o+1]=Fh.y,i[o+2]=Fh.z;return i}function wW(e){var n,o;let r=e.metadata,t=((n=r==null?void 0:r["i3s-scale_x"])==null?void 0:n.double)||1,i=((o=r==null?void 0:r["i3s-scale_y"])==null?void 0:o.double)||1,a=new ti;return a[0]=t,a[5]=i,a}function kW(e,r){let t;return e?t={...e,pbrMetallicRoughness:e.pbrMetallicRoughness?{...e.pbrMetallicRoughness}:{baseColorFactor:[255,255,255,255]}}:(t={pbrMetallicRoughness:{}},r?t.pbrMetallicRoughness.baseColorTexture={texCoord:0}:t.pbrMetallicRoughness.baseColorFactor=[255,255,255,255]),t.alphaCutoff=t.alphaCutoff||.25,t.alphaMode&&(t.alphaMode=t.alphaMode.toUpperCase()),t.emissiveFactor&&(t.emissiveFactor=XT(t.emissiveFactor)),t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorFactor&&(t.pbrMetallicRoughness.baseColorFactor=XT(t.pbrMetallicRoughness.baseColorFactor)),r&&SW(t,r),t}function XT(e){let r=[...e];for(let t=0;t<e.length;t++)r[t]=e[t]/255;return r}function SW(e,r){let t={source:{image:r}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture={...e.pbrMetallicRoughness.baseColorTexture,texture:t}:e.emissiveTexture?e.emissiveTexture={...e.emissiveTexture,texture:t}:e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture={...e.pbrMetallicRoughness.metallicRoughnessTexture,texture:t}:e.normalTexture?e.normalTexture={...e.normalTexture,texture:t}:e.occlusionTexture&&(e.occlusionTexture={...e.occlusionTexture,texture:t})}function EW(e){let{id:r,faceRange:t}=e;if(!r||!t)return;let i=r.value,a=t.value,n=a[a.length-1]+1,o=new Uint32Array(n*3),s=0,c=0;for(let u=1;u<a.length;u+=2){let l=Number(i[s]),h=a[u],p=a[u-1],d=h-p+1,v=c+d*3;o.fill(l,c,v),s++,c=v}e.id.value=o}function AW(e,r){let t=e.id.value,i=new Float32Array(t.length);for(let a=0;a<t.length;a++)i[a]=r[t[a]];e.id.value=i}function jW(e){var r,t;return(t=(r=e==null?void 0:e.metadata)==null?void 0:r["i3s-feature-ids"])==null?void 0:t.intArray}var TW="4.4.0-alpha.0",QT={dataType:null,batchType:null,name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:TW,mimeTypes:["application/octet-stream"],parse:RW,extensions:["bin"],options:{"i3s-content":{}}};async function RW(e,r,t){let{tile:i,_tileOptions:a,tileset:n,_tilesetOptions:o}=(r==null?void 0:r.i3s)||{},s=a||i,c=o||n;return!s||!c?null:await YT(e,s,c,r,t)}sv(QT);
99
+ }`}function Bu(e,r=!0,t){let i=t||new Set;if(e){if(u5(e))i.add(e);else if(u5(e.buffer))i.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(let a in e)Bu(e[a],r,i)}}return t===void 0?Array.from(i):[]}function u5(e){return e?e instanceof ArrayBuffer||typeof MessagePort<"u"&&e instanceof MessagePort||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas:!1}var tv=()=>{},ho=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&Nt||typeof Cu<"u"&&!Nt}constructor(r){let{name:t,source:i,url:a}=r;Wt(i||a),this.name=t,this.source=i,this.url=a,this.onMessage=tv,this.onError=n=>console.log(n),this.worker=Nt?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=tv,this.onError=tv,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(r,t){t=t||Bu(r),this.worker.postMessage(r,t)}_getErrorFromErrorEvent(r){let t="Failed to load ";return t+=`worker ${this.name} from ${this.url}. `,r.message&&(t+=`${r.message} in `),r.lineno&&(t+=`:${r.lineno}:${r.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=s5({source:this.source,url:this.url});let r=new Worker(this._loadableURL,{name:this.name});return r.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},r.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},r.onmessageerror=t=>console.error(t),r}_createNodeWorker(){let r;if(this.url){let i=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;r=new Cu(i,{eval:!1})}else if(this.source)r=new Cu(this.source,{eval:!0});else throw new Error("no worker");return r.on("message",t=>{this.onMessage(t)}),r.on("error",t=>{this.onError(t)}),r.on("exit",t=>{}),r}};var Fu=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return ho.isSupported()}constructor(r){this.source=r.source,this.url=r.url,this.setProps(r)}destroy(){this.idleQueue.forEach(r=>r.destroy()),this.isDestroyed=!0}setProps(r){this.props={...this.props,...r},r.name!==void 0&&(this.name=r.name),r.maxConcurrency!==void 0&&(this.maxConcurrency=r.maxConcurrency),r.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=r.maxMobileConcurrency),r.reuseWorkers!==void 0&&(this.reuseWorkers=r.reuseWorkers),r.onDebug!==void 0&&(this.onDebug=r.onDebug)}async startJob(r,t=(a,n,o)=>a.done(o),i=(a,n)=>a.error(n)){let a=new Promise(n=>(this.jobQueue.push({name:r,onMessage:t,onError:i,onStart:n}),this));return this._startQueuedJob(),await a}async _startQueuedJob(){if(!this.jobQueue.length)return;let r=this._getAvailableWorker();if(!r)return;let t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:r,backlog:this.jobQueue.length});let i=new Pu(t.name,r);r.onMessage=a=>t.onMessage(i,a.type,a.payload),r.onError=a=>t.onError(i,a),t.onStart(i);try{await i.result}catch(a){console.error(`Worker exception: ${a}`)}finally{this.returnWorkerToQueue(r)}}}returnWorkerToQueue(r){!Nt||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(r.destroy(),this.count--):this.idleQueue.push(r),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let r=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new ho({name:r,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return o5?this.maxMobileConcurrency:this.maxConcurrency}};var AH={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},Vo=class{props;workerPools=new Map;static isSupported(){return ho.isSupported()}static getWorkerFarm(r={}){return Vo._workerFarm=Vo._workerFarm||new Vo({}),Vo._workerFarm.setProps(r),Vo._workerFarm}constructor(r){this.props={...AH},this.setProps(r),this.workerPools=new Map}destroy(){for(let r of this.workerPools.values())r.destroy();this.workerPools=new Map}setProps(r){this.props={...this.props,...r};for(let t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(r){let{name:t,source:i,url:a}=r,n=this.workerPools.get(t);return n||(n=new Fu({name:t,source:i,url:a}),n.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,n)),n}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},mo=Vo;ny(mo,"_workerFarm");async function Go(){return ev}var av=new Map,Ca=class{static async inWorkerThread(){return typeof self<"u"||Boolean(await Go())}static set onmessage(r){async function t(i){let a=await Go(),{type:n,payload:o}=a?i:i.data;r(n,o)}Go().then(i=>{i?(i.on("message",a=>{t(a)}),i.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=t})}static async addEventListener(r){let t=av.get(r);t||(t=async a=>{if(!jH(a))return;let n=await Go(),{type:o,payload:s}=n?a:a.data;r(o,s)}),await Go()?console.error("not implemented"):globalThis.addEventListener("message",t)}static async removeEventListener(r){let t=av.get(r);av.delete(r),await Go()?console.error("not implemented"):globalThis.removeEventListener("message",t)}static async postMessage(r,t){let i={source:"loaders.gl",type:r,payload:t},a=Bu(t),n=await Go();n?n.postMessage(i,a):globalThis.postMessage(i,a)}};function jH(e){let{type:r,data:t}=e;return r==="message"&&t&&typeof t.source=="string"&&t.source.startsWith("loaders.gl")}function iv(e,r={}){let t=r[e.id]||{},i=Nt?`${e.id}-worker.js`:`${e.id}-worker-node.js`,a=t.workerUrl;if(!a&&e.id==="compression"&&(a=r.workerUrl),r._workerType==="test"&&(Nt?a=`modules/${e.module}/dist/${i}`:a=`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!a){let n=e.version;n==="latest"&&(n=i5);let o=n?`@${n}`:"";a=`https://unpkg.com/@loaders.gl/${e.module}${o}/dist/${i}`}return Wt(a),a}function nv(e,r=xp){Wt(e,"no worker provided");let t=e.version;return!(!r||!t)}var ov={};async function Qi(e,r=null,t={},i=null){return r&&(e=l5(e,r,t,i)),ov[e]=ov[e]||TH(e),await ov[e]}function l5(e,r,t={},i=null){if(!t.useLocalLibraries&&e.startsWith("http"))return e;i=i||e;let a=t.modules||{};return a[i]?a[i]:Nt?t.CDN?(Wt(t.CDN.startsWith("http")),`${t.CDN}/${r}@${xp}/dist/libs/${i}`):Ru?`../src/libs/${i}`:`modules/${r}/src/libs/${i}`:`modules/${r}/dist/libs/${i}`}async function TH(e){if(e.endsWith("wasm"))return await PH(e);if(!Nt)try{let{requireFromFile:t}=globalThis.loaders||{};return await(t==null?void 0:t(e))}catch(t){return console.error(t),null}if(Ru)return importScripts(e);let r=await OH(e);return RH(r,e)}function RH(e,r){if(!Nt){let{requireFromString:i}=globalThis.loaders||{};return i==null?void 0:i(e,r)}if(Ru)return eval.call(globalThis,e),null;let t=document.createElement("script");t.id=r;try{t.appendChild(document.createTextNode(e))}catch{t.text=e}return document.body.appendChild(t),null}async function PH(e){let{readFileAsArrayBuffer:r}=globalThis.loaders||{};return Nt||!r||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await r(e)}async function OH(e){let{readFileAsText:r}=globalThis.loaders||{};return Nt||!r||e.startsWith("http")?await(await fetch(e)).text():await r(e)}var CH=0;async function sv(e){await Ca.inWorkerThread()&&(Ca.onmessage=async(r,t)=>{switch(r){case"process":try{let{input:i,options:a={},context:n={}}=t,o=await FH({loader:e,arrayBuffer:i,options:a,context:{...n,_parse:BH}});Ca.postMessage("done",{result:o})}catch(i){let a=i instanceof Error?i.message:"";Ca.postMessage("error",{error:a})}break;default:}})}function BH(e,r,t,i){return new Promise((a,n)=>{let o=CH++,s=(u,l)=>{if(l.id===o)switch(u){case"done":Ca.removeEventListener(s),a(l.result);break;case"error":Ca.removeEventListener(s),n(l.error);break;default:}};Ca.addEventListener(s);let c={id:o,input:e,options:t};Ca.postMessage("process",c)})}async function FH({loader:e,arrayBuffer:r,options:t,context:i}){let a,n;if(e.parseSync||e.parse)a=r,n=e.parseSync||e.parse;else if(e.parseTextSync)a=new TextDecoder().decode(r),n=e.parseTextSync;else throw new Error(`Could not load data with ${e.name} loader`);return t={...t,modules:e&&e.options&&e.options.modules||{},worker:!1},await n(a,{...t},i,e)}function cv(e,r){return!mo.isSupported()||!Nt&&!(r!=null&&r._nodeWorkers)?!1:e.worker&&(r==null?void 0:r.worker)}async function uv(e,r,t,i,a){let n=e.id,o=iv(e,t),c=mo.getWorkerFarm(t).getWorkerPool({name:n,url:o});t=JSON.parse(JSON.stringify(t)),i=JSON.parse(JSON.stringify(i||{}));let u=await c.startJob("process-on-worker",IH.bind(null,a));return u.postMessage("process",{input:r,options:t,context:i}),await(await u.result).result}async function IH(e,r,t,i){switch(t){case"done":r.done(i);break;case"error":r.error(new Error(i.error));break;case"process":let{id:a,input:n,options:o}=i;try{let s=await e(n,o);r.postMessage("done",{id:a,result:s})}catch(s){let c=s instanceof Error?s.message:"unknown error";r.postMessage("error",{id:a,error:c})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}}function lv(e,r,t){if(t=t||e.byteLength,e.byteLength<t||r.byteLength<t)return!1;let i=new Uint8Array(e),a=new Uint8Array(r);for(let n=0;n<i.length;++n)if(i[n]!==a[n])return!1;return!0}function fv(...e){return f5(e)}function f5(e){let r=e.map(n=>n instanceof ArrayBuffer?new Uint8Array(n):n),t=r.reduce((n,o)=>n+o.byteLength,0),i=new Uint8Array(t),a=0;for(let n of r)i.set(n,a),a+=n.byteLength;return i.buffer}async function Iu(e){let r=[];for await(let t of e)r.push(t);return fv(...r)}var MH="",p5={};function Ko(e){for(let r in p5)if(e.startsWith(r)){let t=p5[r];e=e.replace(r,t)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${MH}${e}`),e}function h5(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function d5(e){return e&&typeof e=="object"&&e.isBuffer}function _p(e){if(d5(e))return h5(e);if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){let r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}var $o={};yl($o,{dirname:()=>qH,filename:()=>DH,join:()=>zH,resolve:()=>NH});function m5(){var r;if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=(r=window.location)==null?void 0:r.pathname;return(e==null?void 0:e.slice(0,e.lastIndexOf("/")+1))||""}function DH(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(r+1):""}function qH(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(0,r):""}function zH(...e){let r="/";return e=e.map((t,i)=>(i&&(t=t.replace(new RegExp(`^${r}`),"")),i!==e.length-1&&(t=t.replace(new RegExp(`${r}$`),"")),t)),e.join(r)}function NH(...e){let r=[];for(let n=0;n<e.length;n++)r[n]=e[n];let t="",i=!1,a;for(let n=r.length-1;n>=-1&&!i;n--){let o;n>=0?o=r[n]:(a===void 0&&(a=m5()),o=a),o.length!==0&&(t=`${o}/${t}`,i=o.charCodeAt(0)===Mu)}return t=UH(t,!i),i?`/${t}`:t.length>0?t:"."}var Mu=47,pv=46;function UH(e,r){let t="",i=-1,a=0,n,o=!1;for(let s=0;s<=e.length;++s){if(s<e.length)n=e.charCodeAt(s);else{if(n===Mu)break;n=Mu}if(n===Mu){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(t.length<2||!o||t.charCodeAt(t.length-1)!==pv||t.charCodeAt(t.length-2)!==pv){if(t.length>2){let c=t.length-1,u=c;for(;u>=0&&t.charCodeAt(u)!==Mu;--u);if(u!==c){t=u===-1?"":t.slice(0,u),i=s,a=0,o=!1;continue}}else if(t.length===2||t.length===1){t="",i=s,a=0,o=!1;continue}}r&&(t.length>0?t+="/..":t="..",o=!0)}else{let c=e.slice(i+1,s);t.length>0?t+=`/${c}`:t=c,o=!1}i=s,a=0}else n===pv&&a!==-1?++a:a=-1}return t}var En=Xt(require("fs"),1),Wo=class{handle;size;bigsize;url;constructor(r,t,i){r=Ko(r),this.handle=En.default.openSync(r,t,i);let a=En.default.fstatSync(this.handle,{bigint:!0});this.size=Number(a.size),this.bigsize=a.size,this.url=r}async close(){return new Promise((r,t)=>{En.default.close(this.handle,i=>i?t(i):r())})}async truncate(r){return new Promise((t,i)=>{En.default.ftruncate(this.handle,r,a=>{a?i(a):(this.bigsize=BigInt(r),this.size=Number(this.bigsize),t())})})}async append(r){return new Promise((t,i)=>{En.default.appendFile(this.handle,r,a=>{a?i(a):(this.bigsize=this.bigsize+BigInt(r.length),this.size=Number(this.bigsize),t())})})}async stat(){return await new Promise((r,t)=>En.default.fstat(this.handle,{bigint:!0},(i,a)=>{let n={size:Number(a.size),bigsize:a.size,isDirectory:a.isDirectory()};i?t(i):r(n)}))}async read(r,t){let i=new ArrayBuffer(t),a=BigInt(r),n=0,o=new Uint8Array(i),s;for(;t>0;){let c=await HH(this.handle,o,0,t,a);if(c===0)break;n+=c,a+=BigInt(c),t-=c,s!==void 0&&(s+=c)}return n<t?i.slice(0,n):i}async write(r,t=0,i=r.byteLength){return new Promise((a,n)=>{let o=Number(t),s=new Uint8Array(r,Number(t),i);En.default.write(this.handle,s,0,i,o,(c,u)=>c?n(c):a(u))})}};async function HH(e,r,t,i,a){return await new Promise((n,o)=>En.default.read(e,r,t,i,a,(s,c)=>s?o(s):n(c)))}var Ep=Xt(require("fs/promises"),1);var dv=Xt(require("fs"),1),hv=require("stream");var wp=Xt(require("zlib"),1),VH=e=>e&&e instanceof ArrayBuffer,GH=e=>e&&e instanceof Buffer;function kp(e,r){switch(r==null?void 0:r.get("content-encoding")){case"br":return e.pipe(wp.default.createBrotliDecompress());case"gzip":return e.pipe(wp.default.createGunzip());case"deflate":return e.pipe(wp.default.createDeflate());default:return e}}async function g5(e){let r=[];return await new Promise((t,i)=>{e.on("error",a=>i(a)),e.on("readable",()=>e.read()),e.on("data",a=>{typeof a=="string"&&i(new Error("Read stream not binary")),r.push($H(a))}),e.on("end",()=>{let a=KH(r);t(a)})})}function KH(e){let r=e.map(n=>n instanceof ArrayBuffer?new Uint8Array(n):n),t=r.reduce((n,o)=>n+o.byteLength,0),i=new Uint8Array(t),a=0;for(let n of r)i.set(n,a),a+=n.byteLength;return i.buffer}function $H(e){if(VH(e))return e;if(GH(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var WH=e=>typeof e=="boolean",v5=e=>typeof e=="function",XH=e=>e!==null&&typeof e=="object",YH=e=>XH(e)&&v5(e.read)&&v5(e.pipe)&&WH(e.readable);async function Sp(e,r){let t=/^file:\/\//;e.replace(t,"/");let i=e.split("?")[0];i=Ko(i);let a=new Headers;e.endsWith(".gz")&&(a["content-encoding"]="gzip"),e.endsWith(".br")&&(a["content-encoding"]="br");try{let n=await new Promise((h,p)=>{let d=dv.default.createReadStream(i,{encoding:null});d.once("readable",()=>h(d)),d.on("error",v=>p(v))}),o=n;YH(n)?o=kp(n,a):typeof n=="string"?o=hv.Readable.from([new TextEncoder().encode(n)]):o=hv.Readable.from([n||new ArrayBuffer(0)]);let s=200,c="OK",u=QH(i),l=new Response(o,{headers:u,status:s,statusText:c});return Object.defineProperty(l,"url",{value:e}),l}catch(n){let o=n.message,s=400,c=o,u={},l=new Response(o,{headers:u,status:s,statusText:c});return Object.defineProperty(l,"url",{value:e}),l}}function QH(e){let r={};if(!r["content-length"]){let t=dv.default.statSync(e);r["content-length"]=t.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),r["content-encoding"]="gzip"),new Headers(r)}var Ap=class{readable=!0;writable=!0;constructor(){}async readdir(r=".",t){return await Ep.default.readdir(r,t)}async stat(r){let t=await Ep.default.stat(r,{bigint:!0});return{size:Number(t.size),bigsize:t.size,isDirectory:t.isDirectory()}}async unlink(r){return await Ep.default.unlink(r)}async fetch(r,t){return await Sp(r,t)}async openReadableFile(r,t="r"){return new Wo(r,t)}async openWritableFile(r,t="w",i){return new Wo(r,t,i)}};var Lu=class{constructor(r={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(r,t="base64"){var o,s;let i=[];for await(let c of r)i.push(c),yield c;let a=await this.concatenate(i),n=await this.hash(a,t);(s=(o=this.options.crypto)==null?void 0:o.onEnd)==null||s.call(o,{hash:n})}async concatenate(r){return await Iu(r)}};var Du=Xt(require("crypto"),1),jp=class extends Lu{name="crypto-node";options;_algorithm;_hash;constructor(r){var t,i;if(super(),this.options=r,!((i=(t=this.options)==null?void 0:t.crypto)!=null&&i.algorithm))throw new Error(this.name)}async hash(r,t){var a,n,o,s;let i=(o=(n=(a=this.options)==null?void 0:a.crypto)==null?void 0:n.algorithm)==null?void 0:o.toLowerCase();try{if(!Du.createHash)throw new Error("crypto.createHash not available");let c=(s=Du.createHash)==null?void 0:s(i),u=new Uint8Array(r);return c.update(u).digest("base64")}catch(c){throw Error(`${i} hash not available. ${c}`)}}async*hashBatches(r,t="base64"){var n,o,s,c,u,l,h;if(!Du.createHash)throw new Error("crypto.createHash not available");let i=(c=Du.createHash)==null?void 0:c((s=(o=(n=this.options)==null?void 0:n.crypto)==null?void 0:o.algorithm)==null?void 0:s.toLowerCase());for await(let p of r){let d=new Uint8Array(p);i.update(d),yield p}let a=i.digest(t);(h=(l=(u=this.options)==null?void 0:u.crypto)==null?void 0:l.onEnd)==null||h.call(l,{hash:a})}};var XA=require("node:process");var y5=Xt(require("stream"),1),mv=class{},JH=y5.Readable||mv;function vv(e,r){let t=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new gv(t,r)}var gv=class extends JH{_pulling;_bytesMode;_iterator;constructor(r,t){super(t),this._iterator=r,this._pulling=!1,this._bytesMode=!t||!t.objectMode}async _read(r){this._pulling||(this._pulling=!0,this._pulling=await this._pull(r,this._iterator))}async _destroy(r,t){var i,a,n,o;this._iterator&&(r?await((a=(i=this._iterator)==null?void 0:i.throw)==null?void 0:a.call(i,r)):await((o=(n=this._iterator)==null?void 0:n.return)==null?void 0:o.call(n,r)),t==null||t(null))}async _pull(r,t){var n;let i=this._bytesMode,a=null;for(;this.readable&&!(a=await t.next()).done&&(r!==null&&(r-=i&&ArrayBuffer.isView(a.value)?a.value.byteLength:1),!(!this.push(new Uint8Array(a.value))||r<=0)););return(a!=null&&a.done||!this.readable)&&(this.push(null)||!0)&&((n=t==null?void 0:t.return)==null||n.call(t)),!this.readable}};function Vu(){}function mt(e){return typeof e=="object"&&e!==null||typeof e=="function"}var D5=Vu;function Pr(e,r){try{Object.defineProperty(e,"name",{value:r,configurable:!0})}catch{}}var Lv=Promise,ZH=Promise.resolve.bind(Lv),eV=Promise.prototype.then,rV=Promise.reject.bind(Lv),tV=ZH;function kt(e){return new Lv(e)}function Or(e){return kt(r=>r(e))}function $e(e){return rV(e)}function rn(e,r,t){return eV.call(e,r,t)}function wa(e,r,t){rn(rn(e,r,t),void 0,D5)}function yv(e,r){wa(e,r)}function jv(e,r){wa(e,void 0,r)}function On(e,r,t){return rn(e,r,t)}function dc(e){rn(e,void 0,D5)}var es=e=>{if(typeof queueMicrotask=="function")es=queueMicrotask;else{let r=Or(void 0);es=t=>rn(r,t)}return es(e)};function rs(e,r,t){if(typeof e!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,r,t)}function Bn(e,r,t){try{return Or(rs(e,r,t))}catch(i){return $e(i)}}var ka=class{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(r){let t=this._back,i=t;t._elements.length===16383&&(i={_elements:[],_next:void 0}),t._elements.push(r),i!==t&&(this._back=i,t._next=i),++this._size}shift(){let r=this._front,t=r,i=this._cursor,a=i+1,n=r._elements,o=n[i];return a===16384&&(t=r._next,a=0),--this._size,this._cursor=a,r!==t&&(this._front=t),n[i]=void 0,o}forEach(r){let t=this._cursor,i=this._front,a=i._elements;for(;!(t===a.length&&i._next===void 0||t===a.length&&(i=i._next,a=i._elements,t=0,a.length===0));)r(a[t]),++t}peek(){let r=this._front,t=this._cursor;return r._elements[t]}},q5=Symbol("[[AbortSteps]]"),z5=Symbol("[[ErrorSteps]]"),Dv=Symbol("[[CancelSteps]]"),qv=Symbol("[[PullSteps]]"),zv=Symbol("[[ReleaseSteps]]");function N5(e,r){e._ownerReadableStream=r,r._reader=e,r._state==="readable"?Tv(e):r._state==="closed"?function(t){Tv(t),H5(t)}(e):U5(e,r._storedError)}function Nv(e,r){return Si(e._ownerReadableStream,r)}function Pn(e){let r=e._ownerReadableStream;r._state==="readable"?Uv(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(t,i){U5(t,i)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),r._readableStreamController[zv](),r._reader=void 0,e._ownerReadableStream=void 0}function Up(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function Tv(e){e._closedPromise=kt((r,t)=>{e._closedPromise_resolve=r,e._closedPromise_reject=t})}function U5(e,r){Tv(e),Uv(e,r)}function Uv(e,r){e._closedPromise_reject!==void 0&&(dc(e._closedPromise),e._closedPromise_reject(r),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function H5(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var b5=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},aV=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function tn(e,r){if(e!==void 0&&typeof(t=e)!="object"&&typeof t!="function")throw new TypeError(`${r} is not an object.`);var t}function Ja(e,r){if(typeof e!="function")throw new TypeError(`${r} is not a function.`)}function V5(e,r){if(!function(t){return typeof t=="object"&&t!==null||typeof t=="function"}(e))throw new TypeError(`${r} is not an object.`)}function Cn(e,r,t){if(e===void 0)throw new TypeError(`Parameter ${r} is required in '${t}'.`)}function Rv(e,r,t){if(e===void 0)throw new TypeError(`${r} is required in '${t}'.`)}function Hv(e){return Number(e)}function x5(e){return e===0?0:e}function Vv(e,r){let t=Number.MAX_SAFE_INTEGER,i=Number(e);if(i=x5(i),!b5(i))throw new TypeError(`${r} is not a finite number`);if(i=function(a){return x5(aV(a))}(i),i<0||i>t)throw new TypeError(`${r} is outside the accepted range of 0 to ${t}, inclusive`);return b5(i)&&i!==0?i:0}function Gv(e,r){if(!go(e))throw new TypeError(`${r} is not a ReadableStream.`)}function uc(e){return new An(e)}function G5(e,r){e._reader._readRequests.push(r)}function Kv(e,r,t){let i=e._reader._readRequests.shift();t?i._closeSteps():i._chunkSteps(r)}function Yp(e){return e._reader._readRequests.length}function K5(e){let r=e._reader;return r!==void 0&&!!vo(r)}var An=class{constructor(r){if(Cn(r,1,"ReadableStreamDefaultReader"),Gv(r,"First parameter"),bo(r))throw new TypeError("This stream has already been locked for exclusive reading by another reader");N5(this,r),this._readRequests=new ka}get closed(){return vo(this)?this._closedPromise:$e(Tp("closed"))}cancel(r=void 0){return vo(this)?this._ownerReadableStream===void 0?$e(Up("cancel")):Nv(this,r):$e(Tp("cancel"))}read(){if(!vo(this))return $e(Tp("read"));if(this._ownerReadableStream===void 0)return $e(Up("read from"));let r,t,i=kt((a,n)=>{r=a,t=n});return Gu(this,{_chunkSteps:a=>r({value:a,done:!1}),_closeSteps:()=>r({value:void 0,done:!0}),_errorSteps:a=>t(a)}),i}releaseLock(){if(!vo(this))throw Tp("releaseLock");this._ownerReadableStream!==void 0&&function(r){Pn(r);let t=new TypeError("Reader was released");$5(r,t)}(this)}};function vo(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")&&e instanceof An}function Gu(e,r){let t=e._ownerReadableStream;t._disturbed=!0,t._state==="closed"?r._closeSteps():t._state==="errored"?r._errorSteps(t._storedError):t._readableStreamController[qv](r)}function $5(e,r){let t=e._readRequests;e._readRequests=new ka,t.forEach(i=>{i._errorSteps(r)})}function Tp(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}var bv,xv,_v;function zu(e){return e.slice()}function W5(e,r,t,i,a){new Uint8Array(e).set(new Uint8Array(t,i,a),r)}Object.defineProperties(An.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),Pr(An.prototype.cancel,"cancel"),Pr(An.prototype.read,"read"),Pr(An.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(An.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});var ts=e=>(ts=typeof e.transfer=="function"?r=>r.transfer():typeof structuredClone=="function"?r=>structuredClone(r,{transfer:[r]}):r=>r,ts(e)),as=e=>(as=typeof e.detached=="boolean"?r=>r.detached:r=>r.byteLength===0,as(e));function X5(e,r,t){if(e.slice)return e.slice(r,t);let i=t-r,a=new ArrayBuffer(i);return W5(a,0,e,r,i),a}function Nu(e,r){let t=e[r];if(t!=null){if(typeof t!="function")throw new TypeError(`${String(r)} is not a function`);return t}}function _5(e){try{let r=e.done,t=e.value;return rn(tV(t),i=>({done:r,value:i}))}catch(r){return $e(r)}}var Zu=(_v=(bv=Symbol.asyncIterator)!==null&&bv!==void 0?bv:(xv=Symbol.for)===null||xv===void 0?void 0:xv.call(Symbol,"Symbol.asyncIterator"))!==null&&_v!==void 0?_v:"@@asyncIterator";function Y5(e,r="sync",t){if(t===void 0)if(r==="async"){if((t=Nu(e,Zu))===void 0)return function(a){let n={next(){let o;try{o=Q5(a)}catch(s){return $e(s)}return _5(o)},return(o){let s;try{let c=Nu(a.iterator,"return");if(c===void 0)return Or({done:!0,value:o});s=rs(c,a.iterator,[o])}catch(c){return $e(c)}return mt(s)?_5(s):$e(new TypeError("The iterator.return() method must return an object"))}};return{iterator:n,nextMethod:n.next,done:!1}}(Y5(e,"sync",Nu(e,Symbol.iterator)))}else t=Nu(e,Symbol.iterator);if(t===void 0)throw new TypeError("The object is not iterable");let i=rs(t,e,[]);if(!mt(i))throw new TypeError("The iterator method must return an object");return{iterator:i,nextMethod:i.next,done:!1}}function Q5(e){let r=rs(e.nextMethod,e.iterator,[]);if(!mt(r))throw new TypeError("The iterator.next() method must return an object");return r}var Hp=class{constructor(r,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=r,this._preventCancel=t}next(){let r=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?On(this._ongoingPromise,r,r):r(),this._ongoingPromise}return(r){let t=()=>this._returnSteps(r);return this._ongoingPromise?On(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let r=this._reader,t,i,a=kt((n,o)=>{t=n,i=o});return Gu(r,{_chunkSteps:n=>{this._ongoingPromise=void 0,es(()=>t({value:n,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,Pn(r),t({value:void 0,done:!0})},_errorSteps:n=>{this._ongoingPromise=void 0,this._isFinished=!0,Pn(r),i(n)}}),a}_returnSteps(r){if(this._isFinished)return Promise.resolve({value:r,done:!0});this._isFinished=!0;let t=this._reader;if(!this._preventCancel){let i=Nv(t,r);return Pn(t),On(i,()=>({value:r,done:!0}))}return Pn(t),Or({value:r,done:!0})}},J5={next(){return w5(this)?this._asyncIteratorImpl.next():$e(k5("next"))},return(e){return w5(this)?this._asyncIteratorImpl.return(e):$e(k5("return"))},[Zu](){return this}};function w5(e){if(!mt(e)||!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof Hp}catch{return!1}}function k5(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}Object.defineProperty(J5,Zu,{enumerable:!1});var Z5=Number.isNaN||function(e){return e!=e};function S5(e){let r=X5(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(r)}function Pv(e){let r=e._queue.shift();return e._queueTotalSize-=r.size,e._queueTotalSize<0&&(e._queueTotalSize=0),r.value}function $v(e,r,t){if(typeof(i=t)!="number"||Z5(i)||i<0||t===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");var i;e._queue.push({value:r,size:t}),e._queueTotalSize+=t}function xo(e){e._queue=new ka,e._queueTotalSize=0}function eA(e){return e===DataView}var yo=class{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!wv(this))throw kv("view");return this._view}respond(r){if(!wv(this))throw kv("respond");if(Cn(r,1,"respond"),r=Vv(r,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(as(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");Dp(this._associatedReadableByteStreamController,r)}respondWithNewView(r){if(!wv(this))throw kv("respondWithNewView");if(Cn(r,1,"respondWithNewView"),!ArrayBuffer.isView(r))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(as(r.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");qp(this._associatedReadableByteStreamController,r)}};Object.defineProperties(yo.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),Pr(yo.prototype.respond,"respond"),Pr(yo.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(yo.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var Zi=class{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Jo(this))throw qu("byobRequest");return Bv(this)}get desiredSize(){if(!Jo(this))throw qu("desiredSize");return lA(this)}close(){if(!Jo(this))throw qu("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let r=this._controlledReadableByteStream._state;if(r!=="readable")throw new TypeError(`The stream (in ${r} state) is not in the readable state and cannot be closed`);Uu(this)}enqueue(r){if(!Jo(this))throw qu("enqueue");if(Cn(r,1,"enqueue"),!ArrayBuffer.isView(r))throw new TypeError("chunk must be an array buffer view");if(r.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(r.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let t=this._controlledReadableByteStream._state;if(t!=="readable")throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be enqueued to`);Lp(this,r)}error(r=void 0){if(!Jo(this))throw qu("error");Qa(this,r)}[Dv](r){rA(this),xo(this);let t=this._cancelAlgorithm(r);return Qp(this),t}[qv](r){let t=this._controlledReadableByteStream;if(this._queueTotalSize>0)return void uA(this,r);let i=this._autoAllocateChunkSize;if(i!==void 0){let a;try{a=new ArrayBuffer(i)}catch(o){return void r._errorSteps(o)}let n={buffer:a,bufferByteLength:i,byteOffset:0,byteLength:i,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(n)}G5(t,r),os(this)}[zv](){if(this._pendingPullIntos.length>0){let r=this._pendingPullIntos.peek();r.readerType="none",this._pendingPullIntos=new ka,this._pendingPullIntos.push(r)}}};function Jo(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")&&e instanceof Zi}function wv(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")&&e instanceof yo}function os(e){if(function(t){let i=t._controlledReadableByteStream;return i._state!=="readable"||t._closeRequested||!t._started?!1:!!(K5(i)&&Yp(i)>0||Xv(i)&&hA(i)>0||lA(t)>0)}(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,wa(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,os(e)),null),t=>(Qa(e,t),null))}}function rA(e){Wv(e),e._pendingPullIntos=new ka}function Ov(e,r){let t=!1;e._state==="closed"&&(t=!0);let i=tA(r);r.readerType==="default"?Kv(e,i,t):function(a,n,o){let s=a._reader,c=s._readIntoRequests.shift();o?c._closeSteps(n):c._chunkSteps(n)}(e,i,t)}function tA(e){let r=e.bytesFilled,t=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,r/t)}function Mp(e,r,t,i){e._queue.push({buffer:r,byteOffset:t,byteLength:i}),e._queueTotalSize+=i}function aA(e,r,t,i){let a;try{a=X5(r,t,t+i)}catch(n){throw Qa(e,n),n}Mp(e,a,0,i)}function iA(e,r){r.bytesFilled>0&&aA(e,r.buffer,r.byteOffset,r.bytesFilled),lc(e)}function nA(e,r){let t=Math.min(e._queueTotalSize,r.byteLength-r.bytesFilled),i=r.bytesFilled+t,a=t,n=!1,o=i-i%r.elementSize;o>=r.minimumFill&&(a=o-r.bytesFilled,n=!0);let s=e._queue;for(;a>0;){let c=s.peek(),u=Math.min(a,c.byteLength),l=r.byteOffset+r.bytesFilled;W5(r.buffer,l,c.buffer,c.byteOffset,u),c.byteLength===u?s.shift():(c.byteOffset+=u,c.byteLength-=u),e._queueTotalSize-=u,oA(e,u,r),a-=u}return n}function oA(e,r,t){t.bytesFilled+=r}function sA(e){e._queueTotalSize===0&&e._closeRequested?(Qp(e),el(e._controlledReadableByteStream)):os(e)}function Wv(e){e._byobRequest!==null&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function Cv(e){for(;e._pendingPullIntos.length>0;){if(e._queueTotalSize===0)return;let r=e._pendingPullIntos.peek();nA(e,r)&&(lc(e),Ov(e._controlledReadableByteStream,r))}}function iV(e,r,t,i){let a=e._controlledReadableByteStream,n=r.constructor,o=function(p){return eA(p)?1:p.BYTES_PER_ELEMENT}(n),{byteOffset:s,byteLength:c}=r,u=t*o,l;try{l=ts(r.buffer)}catch(p){return void i._errorSteps(p)}let h={buffer:l,bufferByteLength:l.byteLength,byteOffset:s,byteLength:c,bytesFilled:0,minimumFill:u,elementSize:o,viewConstructor:n,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(h),void E5(a,i);if(a._state!=="closed"){if(e._queueTotalSize>0){if(nA(e,h)){let p=tA(h);return sA(e),void i._chunkSteps(p)}if(e._closeRequested){let p=new TypeError("Insufficient bytes to fill elements in the given buffer");return Qa(e,p),void i._errorSteps(p)}}e._pendingPullIntos.push(h),E5(a,i),os(e)}else{let p=new n(h.buffer,h.byteOffset,0);i._closeSteps(p)}}function cA(e,r){let t=e._pendingPullIntos.peek();Wv(e),e._controlledReadableByteStream._state==="closed"?function(i,a){a.readerType==="none"&&lc(i);let n=i._controlledReadableByteStream;if(Xv(n))for(;hA(n)>0;)Ov(n,lc(i))}(e,t):function(i,a,n){if(oA(0,a,n),n.readerType==="none")return iA(i,n),void Cv(i);if(n.bytesFilled<n.minimumFill)return;lc(i);let o=n.bytesFilled%n.elementSize;if(o>0){let s=n.byteOffset+n.bytesFilled;aA(i,n.buffer,s-o,o)}n.bytesFilled-=o,Ov(i._controlledReadableByteStream,n),Cv(i)}(e,r,t),os(e)}function lc(e){return e._pendingPullIntos.shift()}function Qp(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Uu(e){let r=e._controlledReadableByteStream;if(!e._closeRequested&&r._state==="readable")if(e._queueTotalSize>0)e._closeRequested=!0;else{if(e._pendingPullIntos.length>0){let t=e._pendingPullIntos.peek();if(t.bytesFilled%t.elementSize!=0){let i=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Qa(e,i),i}}Qp(e),el(r)}}function Lp(e,r){let t=e._controlledReadableByteStream;if(e._closeRequested||t._state!=="readable")return;let{buffer:i,byteOffset:a,byteLength:n}=r;if(as(i))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let o=ts(i);if(e._pendingPullIntos.length>0){let s=e._pendingPullIntos.peek();if(as(s.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Wv(e),s.buffer=ts(s.buffer),s.readerType==="none"&&iA(e,s)}K5(t)?(function(s){let c=s._controlledReadableByteStream._reader;for(;c._readRequests.length>0;){if(s._queueTotalSize===0)return;uA(s,c._readRequests.shift())}}(e),Yp(t)===0?Mp(e,o,a,n):(e._pendingPullIntos.length>0&&lc(e),Kv(t,new Uint8Array(o,a,n),!1))):Xv(t)?(Mp(e,o,a,n),Cv(e)):Mp(e,o,a,n),os(e)}function Qa(e,r){let t=e._controlledReadableByteStream;t._state==="readable"&&(rA(e),xo(e),Qp(e),BA(t,r))}function uA(e,r){let t=e._queue.shift();e._queueTotalSize-=t.byteLength,sA(e);let i=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);r._chunkSteps(i)}function Bv(e){if(e._byobRequest===null&&e._pendingPullIntos.length>0){let r=e._pendingPullIntos.peek(),t=new Uint8Array(r.buffer,r.byteOffset+r.bytesFilled,r.byteLength-r.bytesFilled),i=Object.create(yo.prototype);(function(a,n,o){a._associatedReadableByteStreamController=n,a._view=o})(i,e,t),e._byobRequest=i}return e._byobRequest}function lA(e){let r=e._controlledReadableByteStream._state;return r==="errored"?null:r==="closed"?0:e._strategyHWM-e._queueTotalSize}function Dp(e,r){let t=e._pendingPullIntos.peek();if(e._controlledReadableByteStream._state==="closed"){if(r!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(r===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(t.bytesFilled+r>t.byteLength)throw new RangeError("bytesWritten out of range")}t.buffer=ts(t.buffer),cA(e,r)}function qp(e,r){let t=e._pendingPullIntos.peek();if(e._controlledReadableByteStream._state==="closed"){if(r.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(r.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(t.byteOffset+t.bytesFilled!==r.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(t.bufferByteLength!==r.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(t.bytesFilled+r.byteLength>t.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let i=r.byteLength;t.buffer=ts(r.buffer),cA(e,i)}function fA(e,r,t,i,a,n,o){r._controlledReadableByteStream=e,r._pullAgain=!1,r._pulling=!1,r._byobRequest=null,r._queue=r._queueTotalSize=void 0,xo(r),r._closeRequested=!1,r._started=!1,r._strategyHWM=n,r._pullAlgorithm=i,r._cancelAlgorithm=a,r._autoAllocateChunkSize=o,r._pendingPullIntos=new ka,e._readableStreamController=r,wa(Or(t()),()=>(r._started=!0,os(r),null),s=>(Qa(r,s),null))}function kv(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function qu(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function nV(e,r){if((e=`${e}`)!="byob")throw new TypeError(`${r} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function pA(e){return new jn(e)}function E5(e,r){e._reader._readIntoRequests.push(r)}function hA(e){return e._reader._readIntoRequests.length}function Xv(e){let r=e._reader;return r!==void 0&&!!Zo(r)}Object.defineProperties(Zi.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),Pr(Zi.prototype.close,"close"),Pr(Zi.prototype.enqueue,"enqueue"),Pr(Zi.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Zi.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});var jn=class{constructor(r){if(Cn(r,1,"ReadableStreamBYOBReader"),Gv(r,"First parameter"),bo(r))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Jo(r._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");N5(this,r),this._readIntoRequests=new ka}get closed(){return Zo(this)?this._closedPromise:$e(Rp("closed"))}cancel(r=void 0){return Zo(this)?this._ownerReadableStream===void 0?$e(Up("cancel")):Nv(this,r):$e(Rp("cancel"))}read(r,t={}){if(!Zo(this))return $e(Rp("read"));if(!ArrayBuffer.isView(r))return $e(new TypeError("view must be an array buffer view"));if(r.byteLength===0)return $e(new TypeError("view must have non-zero byteLength"));if(r.buffer.byteLength===0)return $e(new TypeError("view's buffer must have non-zero byteLength"));if(as(r.buffer))return $e(new TypeError("view's buffer has been detached"));let i;try{i=function(c,u){var l;return tn(c,u),{min:Vv((l=c==null?void 0:c.min)!==null&&l!==void 0?l:1,`${u} has member 'min' that`)}}(t,"options")}catch(c){return $e(c)}let a=i.min;if(a===0)return $e(new TypeError("options.min must be greater than 0"));if(function(c){return eA(c.constructor)}(r)){if(a>r.byteLength)return $e(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(a>r.length)return $e(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return $e(Up("read from"));let n,o,s=kt((c,u)=>{n=c,o=u});return dA(this,r,a,{_chunkSteps:c=>n({value:c,done:!1}),_closeSteps:c=>n({value:c,done:!0}),_errorSteps:c=>o(c)}),s}releaseLock(){if(!Zo(this))throw Rp("releaseLock");this._ownerReadableStream!==void 0&&function(r){Pn(r);let t=new TypeError("Reader was released");mA(r,t)}(this)}};function Zo(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")&&e instanceof jn}function dA(e,r,t,i){let a=e._ownerReadableStream;a._disturbed=!0,a._state==="errored"?i._errorSteps(a._storedError):iV(a._readableStreamController,r,t,i)}function mA(e,r){let t=e._readIntoRequests;e._readIntoRequests=new ka,t.forEach(i=>{i._errorSteps(r)})}function Rp(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function Ku(e,r){let{highWaterMark:t}=e;if(t===void 0)return r;if(Z5(t)||t<0)throw new RangeError("Invalid highWaterMark");return t}function Vp(e){let{size:r}=e;return r||(()=>1)}function Gp(e,r){tn(e,r);let t=e==null?void 0:e.highWaterMark,i=e==null?void 0:e.size;return{highWaterMark:t===void 0?void 0:Hv(t),size:i===void 0?void 0:oV(i,`${r} has member 'size' that`)}}function oV(e,r){return Ja(e,r),t=>Hv(e(t))}function sV(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}function cV(e,r,t){return Ja(e,t),()=>Bn(e,r,[])}function uV(e,r,t){return Ja(e,t),i=>rs(e,r,[i])}function lV(e,r,t){return Ja(e,t),(i,a)=>Bn(e,r,[i,a])}function gA(e,r){if(!cc(e))throw new TypeError(`${r} is not a WritableStream.`)}Object.defineProperties(jn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),Pr(jn.prototype.cancel,"cancel"),Pr(jn.prototype.read,"read"),Pr(jn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(jn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});var fV=typeof AbortController=="function",Tn=class{constructor(r={},t={}){r===void 0?r=null:V5(r,"First parameter");let i=Gp(t,"Second parameter"),a=function(o,s){tn(o,s);let c=o==null?void 0:o.abort,u=o==null?void 0:o.close,l=o==null?void 0:o.start,h=o==null?void 0:o.type,p=o==null?void 0:o.write;return{abort:c===void 0?void 0:sV(c,o,`${s} has member 'abort' that`),close:u===void 0?void 0:cV(u,o,`${s} has member 'close' that`),start:l===void 0?void 0:uV(l,o,`${s} has member 'start' that`),write:p===void 0?void 0:lV(p,o,`${s} has member 'write' that`),type:h}}(r,"First parameter");if(yA(this),a.type!==void 0)throw new RangeError("Invalid type is specified");let n=Vp(i);(function(o,s,c,u){let l=Object.create(is.prototype),h,p,d,v;h=s.start!==void 0?()=>s.start(l):()=>{},p=s.write!==void 0?x=>s.write(x,l):()=>Or(void 0),d=s.close!==void 0?()=>s.close():()=>Or(void 0),v=s.abort!==void 0?x=>s.abort(x):()=>Or(void 0),EA(o,l,h,p,d,v,c,u)})(this,a,Ku(i,1),n)}get locked(){if(!cc(this))throw Op("locked");return fc(this)}abort(r=void 0){return cc(this)?fc(this)?$e(new TypeError("Cannot abort a stream that already has a writer")):Kp(this,r):$e(Op("abort"))}close(){return cc(this)?fc(this)?$e(new TypeError("Cannot close a stream that already has a writer")):an(this)?$e(new TypeError("Cannot close an already-closing stream")):bA(this):$e(Op("close"))}getWriter(){if(!cc(this))throw Op("getWriter");return vA(this)}};function vA(e){return new Ji(e)}function yA(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new ka,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function cc(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")&&e instanceof Tn}function fc(e){return e._writer!==void 0}function Kp(e,r){var t;if(e._state==="closed"||e._state==="errored")return Or(void 0);e._writableStreamController._abortReason=r,(t=e._writableStreamController._abortController)===null||t===void 0||t.abort(r);let i=e._state;if(i==="closed"||i==="errored")return Or(void 0);if(e._pendingAbortRequest!==void 0)return e._pendingAbortRequest._promise;let a=!1;i==="erroring"&&(a=!0,r=void 0);let n=kt((o,s)=>{e._pendingAbortRequest={_promise:void 0,_resolve:o,_reject:s,_reason:r,_wasAlreadyErroring:a}});return e._pendingAbortRequest._promise=n,a||Yv(e,r),n}function bA(e){let r=e._state;if(r==="closed"||r==="errored")return $e(new TypeError(`The stream (in ${r} state) is not in the writable state and cannot be closed`));let t=kt((n,o)=>{let s={_resolve:n,_reject:o};e._closeRequest=s}),i=e._writer;var a;return i!==void 0&&e._backpressure&&r==="writable"&&r1(i),$v(a=e._writableStreamController,SA,0),Jp(a),t}function Fv(e,r){e._state!=="writable"?Qv(e):Yv(e,r)}function Yv(e,r){let t=e._writableStreamController;e._state="erroring",e._storedError=r;let i=e._writer;i!==void 0&&_A(i,r),!function(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}(e)&&t._started&&Qv(e)}function Qv(e){e._state="errored",e._writableStreamController[z5]();let r=e._storedError;if(e._writeRequests.forEach(i=>{i._reject(r)}),e._writeRequests=new ka,e._pendingAbortRequest===void 0)return void Pp(e);let t=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,t._wasAlreadyErroring)return t._reject(r),void Pp(e);wa(e._writableStreamController[q5](t._reason),()=>(t._resolve(),Pp(e),null),i=>(t._reject(i),Pp(e),null))}function an(e){return e._closeRequest!==void 0||e._inFlightCloseRequest!==void 0}function Pp(e){e._closeRequest!==void 0&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);let r=e._writer;r!==void 0&&e1(r,e._storedError)}function Jv(e,r){let t=e._writer;t!==void 0&&r!==e._backpressure&&(r?function(i){Zp(i)}(t):r1(t)),e._backpressure=r}Object.defineProperties(Tn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),Pr(Tn.prototype.abort,"abort"),Pr(Tn.prototype.close,"close"),Pr(Tn.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Tn.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});var Ji=class{constructor(r){if(Cn(r,1,"WritableStreamDefaultWriter"),gA(r,"First parameter"),fc(r))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=r,r._writer=this;let t=r._state;if(t==="writable")!an(r)&&r._backpressure?Zp(this):A5(this),zp(this);else if(t==="erroring")Iv(this,r._storedError),zp(this);else if(t==="closed")A5(this),zp(i=this),RA(i);else{let a=r._storedError;Iv(this,a),TA(this,a)}var i}get closed(){return Xo(this)?this._closedPromise:$e(Yo("closed"))}get desiredSize(){if(!Xo(this))throw Yo("desiredSize");if(this._ownerWritableStream===void 0)throw Hu("desiredSize");return function(r){let t=r._ownerWritableStream,i=t._state;return i==="errored"||i==="erroring"?null:i==="closed"?0:AA(t._writableStreamController)}(this)}get ready(){return Xo(this)?this._readyPromise:$e(Yo("ready"))}abort(r=void 0){return Xo(this)?this._ownerWritableStream===void 0?$e(Hu("abort")):function(t,i){return Kp(t._ownerWritableStream,i)}(this,r):$e(Yo("abort"))}close(){if(!Xo(this))return $e(Yo("close"));let r=this._ownerWritableStream;return r===void 0?$e(Hu("close")):an(r)?$e(new TypeError("Cannot close an already-closing stream")):xA(this)}releaseLock(){if(!Xo(this))throw Yo("releaseLock");this._ownerWritableStream!==void 0&&wA(this)}write(r=void 0){return Xo(this)?this._ownerWritableStream===void 0?$e(Hu("write to")):kA(this,r):$e(Yo("write"))}};function Xo(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")&&e instanceof Ji}function xA(e){return bA(e._ownerWritableStream)}function pV(e,r){e._closedPromiseState==="pending"?e1(e,r):function(t,i){TA(t,i)}(e,r)}function _A(e,r){e._readyPromiseState==="pending"?PA(e,r):function(t,i){Iv(t,i)}(e,r)}function wA(e){let r=e._ownerWritableStream,t=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");_A(e,t),pV(e,t),r._writer=void 0,e._ownerWritableStream=void 0}function kA(e,r){let t=e._ownerWritableStream,i=t._writableStreamController,a=function(s,c){try{return s._strategySizeAlgorithm(c)}catch(u){return $u(s,u),1}}(i,r);if(t!==e._ownerWritableStream)return $e(Hu("write to"));let n=t._state;if(n==="errored")return $e(t._storedError);if(an(t)||n==="closed")return $e(new TypeError("The stream is closing or closed and cannot be written to"));if(n==="erroring")return $e(t._storedError);let o=function(s){return kt((c,u)=>{let l={_resolve:c,_reject:u};s._writeRequests.push(l)})}(t);return function(s,c,u){try{$v(s,c,u)}catch(h){return void $u(s,h)}let l=s._controlledWritableStream;!an(l)&&l._state==="writable"&&Jv(l,Zv(s)),Jp(s)}(i,r,a),o}Object.defineProperties(Ji.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),Pr(Ji.prototype.abort,"abort"),Pr(Ji.prototype.close,"close"),Pr(Ji.prototype.releaseLock,"releaseLock"),Pr(Ji.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ji.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});var SA={},is=class{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!Sv(this))throw Ev("abortReason");return this._abortReason}get signal(){if(!Sv(this))throw Ev("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(r=void 0){if(!Sv(this))throw Ev("error");this._controlledWritableStream._state==="writable"&&jA(this,r)}[q5](r){let t=this._abortAlgorithm(r);return $p(this),t}[z5](){xo(this)}};function Sv(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")&&e instanceof is}function EA(e,r,t,i,a,n,o,s){r._controlledWritableStream=e,e._writableStreamController=r,r._queue=void 0,r._queueTotalSize=void 0,xo(r),r._abortReason=void 0,r._abortController=function(){if(fV)return new AbortController}(),r._started=!1,r._strategySizeAlgorithm=s,r._strategyHWM=o,r._writeAlgorithm=i,r._closeAlgorithm=a,r._abortAlgorithm=n;let c=Zv(r);Jv(e,c),wa(Or(t()),()=>(r._started=!0,Jp(r),null),u=>(r._started=!0,Fv(e,u),null))}function $p(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function AA(e){return e._strategyHWM-e._queueTotalSize}function Jp(e){let r=e._controlledWritableStream;if(!e._started||r._inFlightWriteRequest!==void 0)return;if(r._state==="erroring")return void Qv(r);if(e._queue.length===0)return;let t=e._queue.peek().value;t===SA?function(i){let a=i._controlledWritableStream;(function(o){o._inFlightCloseRequest=o._closeRequest,o._closeRequest=void 0})(a),Pv(i);let n=i._closeAlgorithm();$p(i),wa(n,()=>(function(o){o._inFlightCloseRequest._resolve(void 0),o._inFlightCloseRequest=void 0,o._state==="erroring"&&(o._storedError=void 0,o._pendingAbortRequest!==void 0&&(o._pendingAbortRequest._resolve(),o._pendingAbortRequest=void 0)),o._state="closed";let s=o._writer;s!==void 0&&RA(s)}(a),null),o=>(function(s,c){s._inFlightCloseRequest._reject(c),s._inFlightCloseRequest=void 0,s._pendingAbortRequest!==void 0&&(s._pendingAbortRequest._reject(c),s._pendingAbortRequest=void 0),Fv(s,c)}(a,o),null))}(e):function(i,a){let n=i._controlledWritableStream;(function(s){s._inFlightWriteRequest=s._writeRequests.shift()})(n);let o=i._writeAlgorithm(a);wa(o,()=>{(function(c){c._inFlightWriteRequest._resolve(void 0),c._inFlightWriteRequest=void 0})(n);let s=n._state;if(Pv(i),!an(n)&&s==="writable"){let c=Zv(i);Jv(n,c)}return Jp(i),null},s=>(n._state==="writable"&&$p(i),function(c,u){c._inFlightWriteRequest._reject(u),c._inFlightWriteRequest=void 0,Fv(c,u)}(n,s),null))}(e,t)}function $u(e,r){e._controlledWritableStream._state==="writable"&&jA(e,r)}function Zv(e){return AA(e)<=0}function jA(e,r){let t=e._controlledWritableStream;$p(e),Yv(t,r)}function Op(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function Ev(e){return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function Yo(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function Hu(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function zp(e){e._closedPromise=kt((r,t)=>{e._closedPromise_resolve=r,e._closedPromise_reject=t,e._closedPromiseState="pending"})}function TA(e,r){zp(e),e1(e,r)}function e1(e,r){e._closedPromise_reject!==void 0&&(dc(e._closedPromise),e._closedPromise_reject(r),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function RA(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function Zp(e){e._readyPromise=kt((r,t)=>{e._readyPromise_resolve=r,e._readyPromise_reject=t}),e._readyPromiseState="pending"}function Iv(e,r){Zp(e),PA(e,r)}function A5(e){Zp(e),r1(e)}function PA(e,r){e._readyPromise_reject!==void 0&&(dc(e._readyPromise),e._readyPromise_reject(r),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function r1(e){e._readyPromise_resolve!==void 0&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(is.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(is.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});var j5=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof global<"u"?global:void 0,hV=function(){let e=j5==null?void 0:j5.DOMException;return function(r){if(typeof r!="function"&&typeof r!="object"||r.name!=="DOMException")return!1;try{return new r,!0}catch{return!1}}(e)?e:void 0}()||function(){let e=function(r,t){this.message=r||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return Pr(e,"DOMException"),e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}();function T5(e,r,t,i,a,n){let o=uc(e),s=vA(r);e._disturbed=!0;let c=!1,u=Or(void 0);return kt((l,h)=>{let p;if(n!==void 0){if(p=()=>{let j=n.reason!==void 0?n.reason:new hV("Aborted","AbortError"),P=[];i||P.push(()=>r._state==="writable"?Kp(r,j):Or(void 0)),a||P.push(()=>e._state==="readable"?Si(e,j):Or(void 0)),A(()=>Promise.all(P.map(C=>C())),!0,j)},n.aborted)return void p();n.addEventListener("abort",p)}var d,v,x;if(E(e,o._closedPromise,j=>(i?S(!0,j):A(()=>Kp(r,j),!0,j),null)),E(r,s._closedPromise,j=>(a?S(!0,j):A(()=>Si(e,j),!0,j),null)),d=e,v=o._closedPromise,x=()=>(t?S():A(()=>function(j){let P=j._ownerWritableStream,C=P._state;return an(P)||C==="closed"?Or(void 0):C==="errored"?$e(P._storedError):xA(j)}(s)),null),d._state==="closed"?x():yv(v,x),an(r)||r._state==="closed"){let j=new TypeError("the destination writable stream closed before all data could be piped to it");a?S(!0,j):A(()=>Si(e,j),!0,j)}function y(){let j=u;return rn(u,()=>j!==u?y():void 0)}function E(j,P,C){j._state==="errored"?C(j._storedError):jv(P,C)}function A(j,P,C){function I(){return wa(j(),()=>R(P,C),F=>R(!0,F)),null}c||(c=!0,r._state!=="writable"||an(r)?I():yv(y(),I))}function S(j,P){c||(c=!0,r._state!=="writable"||an(r)?R(j,P):yv(y(),()=>R(j,P)))}function R(j,P){return wA(s),Pn(o),n!==void 0&&n.removeEventListener("abort",p),j?h(P):l(void 0),null}dc(kt((j,P)=>{(function C(I){I?j():rn(c?Or(!0):rn(s._readyPromise,()=>kt((F,H)=>{Gu(o,{_chunkSteps:z=>{u=rn(kA(s,z),void 0,Vu),F(!1)},_closeSteps:()=>F(!0),_errorSteps:H})})),C,P)})(!1)}))})}var en=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Cp(this))throw Bp("desiredSize");return t1(this)}close(){if(!Cp(this))throw Bp("close");if(!hc(this))throw new TypeError("The stream is not in a state that permits close");ns(this)}enqueue(r=void 0){if(!Cp(this))throw Bp("enqueue");if(!hc(this))throw new TypeError("The stream is not in a state that permits enqueue");return pc(this,r)}error(r=void 0){if(!Cp(this))throw Bp("error");Ei(this,r)}[Dv](r){xo(this);let t=this._cancelAlgorithm(r);return Wp(this),t}[qv](r){let t=this._controlledReadableStream;if(this._queue.length>0){let i=Pv(this);this._closeRequested&&this._queue.length===0?(Wp(this),el(t)):Wu(this),r._chunkSteps(i)}else G5(t,r),Wu(this)}[zv](){}};function Cp(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")&&e instanceof en}function Wu(e){if(OA(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,wa(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Wu(e)),null),r=>(Ei(e,r),null))}}function OA(e){let r=e._controlledReadableStream;return!hc(e)||!e._started?!1:bo(r)&&Yp(r)>0?!0:t1(e)>0}function Wp(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function ns(e){if(!hc(e))return;let r=e._controlledReadableStream;e._closeRequested=!0,e._queue.length===0&&(Wp(e),el(r))}function pc(e,r){if(!hc(e))return;let t=e._controlledReadableStream;if(bo(t)&&Yp(t)>0)Kv(t,r,!1);else{let i;try{i=e._strategySizeAlgorithm(r)}catch(a){throw Ei(e,a),a}try{$v(e,r,i)}catch(a){throw Ei(e,a),a}}Wu(e)}function Ei(e,r){let t=e._controlledReadableStream;t._state==="readable"&&(xo(e),Wp(e),BA(t,r))}function t1(e){let r=e._controlledReadableStream._state;return r==="errored"?null:r==="closed"?0:e._strategyHWM-e._queueTotalSize}function hc(e){let r=e._controlledReadableStream._state;return!e._closeRequested&&r==="readable"}function CA(e,r,t,i,a,n,o){r._controlledReadableStream=e,r._queue=void 0,r._queueTotalSize=void 0,xo(r),r._started=!1,r._closeRequested=!1,r._pullAgain=!1,r._pulling=!1,r._strategySizeAlgorithm=o,r._strategyHWM=n,r._pullAlgorithm=i,r._cancelAlgorithm=a,e._readableStreamController=r,wa(Or(t()),()=>(r._started=!0,Wu(r),null),s=>(Ei(r,s),null))}function Bp(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function dV(e,r){return Jo(e._readableStreamController)?function(t){let i,a,n,o,s,c=uc(t),u=!1,l=!1,h=!1,p=!1,d=!1,v=kt(C=>{s=C});function x(C){jv(C._closedPromise,I=>(C!==c||(Qa(n._readableStreamController,I),Qa(o._readableStreamController,I),p&&d||s(void 0)),null))}function y(){Zo(c)&&(Pn(c),c=uc(t),x(c)),Gu(c,{_chunkSteps:C=>{es(()=>{l=!1,h=!1;let I=C,F=C;if(!p&&!d)try{F=S5(C)}catch(H){return Qa(n._readableStreamController,H),Qa(o._readableStreamController,H),void s(Si(t,H))}p||Lp(n._readableStreamController,I),d||Lp(o._readableStreamController,F),u=!1,l?A():h&&S()})},_closeSteps:()=>{u=!1,p||Uu(n._readableStreamController),d||Uu(o._readableStreamController),n._readableStreamController._pendingPullIntos.length>0&&Dp(n._readableStreamController,0),o._readableStreamController._pendingPullIntos.length>0&&Dp(o._readableStreamController,0),p&&d||s(void 0)},_errorSteps:()=>{u=!1}})}function E(C,I){vo(c)&&(Pn(c),c=pA(t),x(c));let F=I?o:n,H=I?n:o;dA(c,C,1,{_chunkSteps:z=>{es(()=>{l=!1,h=!1;let G=I?d:p;if(I?p:d)G||qp(F._readableStreamController,z);else{let D;try{D=S5(z)}catch(V){return Qa(F._readableStreamController,V),Qa(H._readableStreamController,V),void s(Si(t,V))}G||qp(F._readableStreamController,z),Lp(H._readableStreamController,D)}u=!1,l?A():h&&S()})},_closeSteps:z=>{u=!1;let G=I?d:p,D=I?p:d;G||Uu(F._readableStreamController),D||Uu(H._readableStreamController),z!==void 0&&(G||qp(F._readableStreamController,z),!D&&H._readableStreamController._pendingPullIntos.length>0&&Dp(H._readableStreamController,0)),G&&D||s(void 0)},_errorSteps:()=>{u=!1}})}function A(){if(u)return l=!0,Or(void 0);u=!0;let C=Bv(n._readableStreamController);return C===null?y():E(C._view,!1),Or(void 0)}function S(){if(u)return h=!0,Or(void 0);u=!0;let C=Bv(o._readableStreamController);return C===null?y():E(C._view,!0),Or(void 0)}function R(C){if(p=!0,i=C,d){let I=zu([i,a]),F=Si(t,I);s(F)}return v}function j(C){if(d=!0,a=C,p){let I=zu([i,a]),F=Si(t,I);s(F)}return v}function P(){}return n=P5(P,A,R),o=P5(P,S,j),x(c),[n,o]}(e):function(t,i){let a=uc(t),n,o,s,c,u,l=!1,h=!1,p=!1,d=!1,v=kt(S=>{u=S});function x(){return l?(h=!0,Or(void 0)):(l=!0,Gu(a,{_chunkSteps:S=>{es(()=>{h=!1;let R=S,j=S;p||pc(s._readableStreamController,R),d||pc(c._readableStreamController,j),l=!1,h&&x()})},_closeSteps:()=>{l=!1,p||ns(s._readableStreamController),d||ns(c._readableStreamController),p&&d||u(void 0)},_errorSteps:()=>{l=!1}}),Or(void 0))}function y(S){if(p=!0,n=S,d){let R=zu([n,o]),j=Si(t,R);u(j)}return v}function E(S){if(d=!0,o=S,p){let R=zu([n,o]),j=Si(t,R);u(j)}return v}function A(){}return s=Xu(A,x,y),c=Xu(A,x,E),jv(a._closedPromise,S=>(Ei(s._readableStreamController,S),Ei(c._readableStreamController,S),p&&d||u(void 0),null)),[s,c]}(e)}function mV(e){return mt(r=e)&&r.getReader!==void 0?function(t){let i;function a(){let o;try{o=t.read()}catch(s){return $e(s)}return On(o,s=>{if(!mt(s))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(s.done)ns(i._readableStreamController);else{let c=s.value;pc(i._readableStreamController,c)}})}function n(o){try{return Or(t.cancel(o))}catch(s){return $e(s)}}return i=Xu(Vu,a,n,0),i}(e.getReader()):function(t){let i,a=Y5(t,"async");function n(){let s;try{s=Q5(a)}catch(c){return $e(c)}return On(Or(s),c=>{if(!mt(c))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(c.done)ns(i._readableStreamController);else{let u=c.value;pc(i._readableStreamController,u)}})}function o(s){let c=a.iterator,u;try{u=Nu(c,"return")}catch(l){return $e(l)}return u===void 0?Or(void 0):On(Bn(u,c,[s]),l=>{if(!mt(l))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return i=Xu(Vu,n,o,0),i}(e);var r}function gV(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}function vV(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}function yV(e,r,t){return Ja(e,t),i=>rs(e,r,[i])}function bV(e,r){if((e=`${e}`)!="bytes")throw new TypeError(`${r} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function R5(e,r){tn(e,r);let t=e==null?void 0:e.preventAbort,i=e==null?void 0:e.preventCancel,a=e==null?void 0:e.preventClose,n=e==null?void 0:e.signal;return n!==void 0&&function(o,s){if(!function(c){if(typeof c!="object"||c===null)return!1;try{return typeof c.aborted=="boolean"}catch{return!1}}(o))throw new TypeError(`${s} is not an AbortSignal.`)}(n,`${r} has member 'signal' that`),{preventAbort:Boolean(t),preventCancel:Boolean(i),preventClose:Boolean(a),signal:n}}Object.defineProperties(en.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),Pr(en.prototype.close,"close"),Pr(en.prototype.enqueue,"enqueue"),Pr(en.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(en.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});var Bt=class{constructor(r={},t={}){r===void 0?r=null:V5(r,"First parameter");let i=Gp(t,"Second parameter"),a=function(n,o){tn(n,o);let s=n,c=s==null?void 0:s.autoAllocateChunkSize,u=s==null?void 0:s.cancel,l=s==null?void 0:s.pull,h=s==null?void 0:s.start,p=s==null?void 0:s.type;return{autoAllocateChunkSize:c===void 0?void 0:Vv(c,`${o} has member 'autoAllocateChunkSize' that`),cancel:u===void 0?void 0:gV(u,s,`${o} has member 'cancel' that`),pull:l===void 0?void 0:vV(l,s,`${o} has member 'pull' that`),start:h===void 0?void 0:yV(h,s,`${o} has member 'start' that`),type:p===void 0?void 0:bV(p,`${o} has member 'type' that`)}}(r,"First parameter");if(a1(this),a.type==="bytes"){if(i.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");(function(n,o,s){let c=Object.create(Zi.prototype),u,l,h;u=o.start!==void 0?()=>o.start(c):()=>{},l=o.pull!==void 0?()=>o.pull(c):()=>Or(void 0),h=o.cancel!==void 0?d=>o.cancel(d):()=>Or(void 0);let p=o.autoAllocateChunkSize;if(p===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");fA(n,c,u,l,h,s,p)})(this,a,Ku(i,0))}else{let n=Vp(i);(function(o,s,c,u){let l=Object.create(en.prototype),h,p,d;h=s.start!==void 0?()=>s.start(l):()=>{},p=s.pull!==void 0?()=>s.pull(l):()=>Or(void 0),d=s.cancel!==void 0?v=>s.cancel(v):()=>Or(void 0),CA(o,l,h,p,d,c,u)})(this,a,Ku(i,1),n)}}get locked(){if(!go(this))throw Qo("locked");return bo(this)}cancel(r=void 0){return go(this)?bo(this)?$e(new TypeError("Cannot cancel a stream that already has a reader")):Si(this,r):$e(Qo("cancel"))}getReader(r=void 0){if(!go(this))throw Qo("getReader");return function(t,i){tn(t,i);let a=t==null?void 0:t.mode;return{mode:a===void 0?void 0:nV(a,`${i} has member 'mode' that`)}}(r,"First parameter").mode===void 0?uc(this):pA(this)}pipeThrough(r,t={}){if(!go(this))throw Qo("pipeThrough");Cn(r,1,"pipeThrough");let i=function(n,o){tn(n,o);let s=n==null?void 0:n.readable;Rv(s,"readable","ReadableWritablePair"),Gv(s,`${o} has member 'readable' that`);let c=n==null?void 0:n.writable;return Rv(c,"writable","ReadableWritablePair"),gA(c,`${o} has member 'writable' that`),{readable:s,writable:c}}(r,"First parameter"),a=R5(t,"Second parameter");if(bo(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(fc(i.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return dc(T5(this,i.writable,a.preventClose,a.preventAbort,a.preventCancel,a.signal)),i.readable}pipeTo(r,t={}){if(!go(this))return $e(Qo("pipeTo"));if(r===void 0)return $e("Parameter 1 is required in 'pipeTo'.");if(!cc(r))return $e(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let i;try{i=R5(t,"Second parameter")}catch(a){return $e(a)}return bo(this)?$e(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):fc(r)?$e(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):T5(this,r,i.preventClose,i.preventAbort,i.preventCancel,i.signal)}tee(){if(!go(this))throw Qo("tee");return zu(dV(this))}values(r=void 0){if(!go(this))throw Qo("values");return function(t,i){let a=uc(t),n=new Hp(a,i),o=Object.create(J5);return o._asyncIteratorImpl=n,o}(this,function(t,i){tn(t,i);let a=t==null?void 0:t.preventCancel;return{preventCancel:Boolean(a)}}(r,"First parameter").preventCancel)}[Zu](r){return this.values(r)}static from(r){return mV(r)}};function Xu(e,r,t,i=1,a=()=>1){let n=Object.create(Bt.prototype);return a1(n),CA(n,Object.create(en.prototype),e,r,t,i,a),n}function P5(e,r,t){let i=Object.create(Bt.prototype);return a1(i),fA(i,Object.create(Zi.prototype),e,r,t,0,void 0),i}function a1(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function go(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")&&e instanceof Bt}function bo(e){return e._reader!==void 0}function Si(e,r){if(e._disturbed=!0,e._state==="closed")return Or(void 0);if(e._state==="errored")return $e(e._storedError);el(e);let t=e._reader;if(t!==void 0&&Zo(t)){let i=t._readIntoRequests;t._readIntoRequests=new ka,i.forEach(a=>{a._closeSteps(void 0)})}return On(e._readableStreamController[Dv](r),Vu)}function el(e){e._state="closed";let r=e._reader;if(r!==void 0&&(H5(r),vo(r))){let t=r._readRequests;r._readRequests=new ka,t.forEach(i=>{i._closeSteps()})}}function BA(e,r){e._state="errored",e._storedError=r;let t=e._reader;t!==void 0&&(Uv(t,r),vo(t)?$5(t,r):mA(t,r))}function Qo(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function FA(e,r){tn(e,r);let t=e==null?void 0:e.highWaterMark;return Rv(t,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Hv(t)}}Object.defineProperties(Bt,{from:{enumerable:!0}}),Object.defineProperties(Bt.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),Pr(Bt.from,"from"),Pr(Bt.prototype.cancel,"cancel"),Pr(Bt.prototype.getReader,"getReader"),Pr(Bt.prototype.pipeThrough,"pipeThrough"),Pr(Bt.prototype.pipeTo,"pipeTo"),Pr(Bt.prototype.tee,"tee"),Pr(Bt.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Bt.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(Bt.prototype,Zu,{value:Bt.prototype.values,writable:!0,configurable:!0});var IA=e=>e.byteLength;Pr(IA,"size");var Yu=class{constructor(r){Cn(r,1,"ByteLengthQueuingStrategy"),r=FA(r,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=r.highWaterMark}get highWaterMark(){if(!C5(this))throw O5("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!C5(this))throw O5("size");return IA}};function O5(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function C5(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")&&e instanceof Yu}Object.defineProperties(Yu.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Yu.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});var MA=()=>1;Pr(MA,"size");var Qu=class{constructor(r){Cn(r,1,"CountQueuingStrategy"),r=FA(r,"First parameter"),this._countQueuingStrategyHighWaterMark=r.highWaterMark}get highWaterMark(){if(!F5(this))throw B5("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!F5(this))throw B5("size");return MA}};function B5(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function F5(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")&&e instanceof Qu}function xV(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}function _V(e,r,t){return Ja(e,t),i=>rs(e,r,[i])}function wV(e,r,t){return Ja(e,t),(i,a)=>Bn(e,r,[i,a])}function kV(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}Object.defineProperties(Qu.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Qu.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});var Ju=class{constructor(r={},t={},i={}){r===void 0&&(r=null);let a=Gp(t,"Second parameter"),n=Gp(i,"Third parameter"),o=function(p,d){tn(p,d);let v=p==null?void 0:p.cancel,x=p==null?void 0:p.flush,y=p==null?void 0:p.readableType,E=p==null?void 0:p.start,A=p==null?void 0:p.transform,S=p==null?void 0:p.writableType;return{cancel:v===void 0?void 0:kV(v,p,`${d} has member 'cancel' that`),flush:x===void 0?void 0:xV(x,p,`${d} has member 'flush' that`),readableType:y,start:E===void 0?void 0:_V(E,p,`${d} has member 'start' that`),transform:A===void 0?void 0:wV(A,p,`${d} has member 'transform' that`),writableType:S}}(r,"First parameter");if(o.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(o.writableType!==void 0)throw new RangeError("Invalid writableType specified");let s=Ku(n,0),c=Vp(n),u=Ku(a,1),l=Vp(a),h;(function(p,d,v,x,y,E){function A(){return d}function S(I){return function(F,H){let z=F._transformStreamController;return F._backpressure?On(F._backpressureChangePromise,()=>{let G=F._writable;if(G._state==="erroring")throw G._storedError;return M5(z,H)}):M5(z,H)}(p,I)}function R(I){return function(F,H){let z=F._transformStreamController;if(z._finishPromise!==void 0)return z._finishPromise;let G=F._readable;z._finishPromise=kt((V,$)=>{z._finishPromise_resolve=V,z._finishPromise_reject=$});let D=z._cancelAlgorithm(H);return Np(z),wa(D,()=>(G._state==="errored"?sc(z,G._storedError):(Ei(G._readableStreamController,H),Av(z)),null),V=>(Ei(G._readableStreamController,V),sc(z,V),null)),z._finishPromise}(p,I)}function j(){return function(I){let F=I._transformStreamController;if(F._finishPromise!==void 0)return F._finishPromise;let H=I._readable;F._finishPromise=kt((G,D)=>{F._finishPromise_resolve=G,F._finishPromise_reject=D});let z=F._flushAlgorithm();return Np(F),wa(z,()=>(H._state==="errored"?sc(F,H._storedError):(ns(H._readableStreamController),Av(F)),null),G=>(Ei(H._readableStreamController,G),sc(F,G),null)),F._finishPromise}(p)}function P(){return function(I){return Xp(I,!1),I._backpressureChangePromise}(p)}function C(I){return function(F,H){let z=F._transformStreamController;if(z._finishPromise!==void 0)return z._finishPromise;let G=F._writable;z._finishPromise=kt((V,$)=>{z._finishPromise_resolve=V,z._finishPromise_reject=$});let D=z._cancelAlgorithm(H);return Np(z),wa(D,()=>(G._state==="errored"?sc(z,G._storedError):($u(G._writableStreamController,H),Mv(F),Av(z)),null),V=>($u(G._writableStreamController,V),Mv(F),sc(z,V),null)),z._finishPromise}(p,I)}p._writable=function(I,F,H,z,G=1,D=()=>1){let V=Object.create(Tn.prototype);return yA(V),EA(V,Object.create(is.prototype),I,F,H,z,G,D),V}(A,S,j,R,v,x),p._readable=Xu(A,P,C,y,E),p._backpressure=void 0,p._backpressureChangePromise=void 0,p._backpressureChangePromise_resolve=void 0,Xp(p,!0),p._transformStreamController=void 0})(this,kt(p=>{h=p}),u,l,s,c),function(p,d){let v=Object.create(Rn.prototype),x,y,E;x=d.transform!==void 0?A=>d.transform(A,v):A=>{try{return DA(v,A),Or(void 0)}catch(S){return $e(S)}},y=d.flush!==void 0?()=>d.flush(v):()=>Or(void 0),E=d.cancel!==void 0?A=>d.cancel(A):()=>Or(void 0),function(A,S,R,j,P){S._controlledTransformStream=A,A._transformStreamController=S,S._transformAlgorithm=R,S._flushAlgorithm=j,S._cancelAlgorithm=P,S._finishPromise=void 0,S._finishPromise_resolve=void 0,S._finishPromise_reject=void 0}(p,v,x,y,E)}(this,o),o.start!==void 0?h(o.start(this._transformStreamController)):h(void 0)}get readable(){if(!I5(this))throw L5("readable");return this._readable}get writable(){if(!I5(this))throw L5("writable");return this._writable}};function I5(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")&&e instanceof Ju}function LA(e,r){Ei(e._readable._readableStreamController,r),i1(e,r)}function i1(e,r){Np(e._transformStreamController),$u(e._writable._writableStreamController,r),Mv(e)}function Mv(e){e._backpressure&&Xp(e,!1)}function Xp(e,r){e._backpressureChangePromise!==void 0&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=kt(t=>{e._backpressureChangePromise_resolve=t}),e._backpressure=r}Object.defineProperties(Ju.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ju.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});var Rn=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Fp(this))throw Ip("desiredSize");return t1(this._controlledTransformStream._readable._readableStreamController)}enqueue(r=void 0){if(!Fp(this))throw Ip("enqueue");DA(this,r)}error(r=void 0){if(!Fp(this))throw Ip("error");var t;t=r,LA(this._controlledTransformStream,t)}terminate(){if(!Fp(this))throw Ip("terminate");(function(r){let t=r._controlledTransformStream;ns(t._readable._readableStreamController);let i=new TypeError("TransformStream terminated");i1(t,i)})(this)}};function Fp(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")&&e instanceof Rn}function Np(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0,e._cancelAlgorithm=void 0}function DA(e,r){let t=e._controlledTransformStream,i=t._readable._readableStreamController;if(!hc(i))throw new TypeError("Readable side is not in a state that permits enqueue");try{pc(i,r)}catch(n){throw i1(t,n),t._readable._storedError}(function(n){return!OA(n)})(i)!==t._backpressure&&Xp(t,!0)}function M5(e,r){return On(e._transformAlgorithm(r),void 0,t=>{throw LA(e._controlledTransformStream,t),t})}function Ip(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function Av(e){e._finishPromise_resolve!==void 0&&(e._finishPromise_resolve(),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function sc(e,r){e._finishPromise_reject!==void 0&&(dc(e._finishPromise),e._finishPromise_reject(r),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function L5(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}Object.defineProperties(Rn.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),Pr(Rn.prototype.enqueue,"enqueue"),Pr(Rn.prototype.error,"error"),Pr(Rn.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Rn.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var eh=class extends Bt{};var rh=class{chunks;isWorking=!1;isCancelled=!1;constructor(r){this.chunks=r}start(r){this.work(r)}async work(r){let{chunks:t}=this;for(this.isWorking=!0;!this.isCancelled&&(r.desiredSize||0)>0;){let i;try{i=t.next()}catch(a){r.error(a);break}i&&(!i.done&&!this.isCancelled?r.enqueue(i.value):r.close())}this.isWorking=!1}pull(r){this.isWorking||this.work(r)}cancel(){this.isCancelled=!0}};var th=class extends eh{_chunks;constructor(r){super(new rh(r.values()),{type:"bytes"}),this._chunks=r}async*[Symbol.asyncIterator](r){let t=this.getReader();yield*this._chunks,t.releaseLock()}};var ss=class{type;size;parts;constructor(r=[],t={}){this.parts=[],this.size=0;for(let i of r)if(typeof i=="string"){let a=new TextEncoder().encode(i);this.parts.push(a),this.size+=a.byteLength}else if(i instanceof ss)this.size+=i.size,this.parts.push(...i.parts);else if(i instanceof ArrayBuffer)this.parts.push(new Uint8Array(i)),this.size+=i.byteLength;else if(i instanceof Uint8Array)this.parts.push(i),this.size+=i.byteLength;else if(ArrayBuffer.isView(i)){let{buffer:a,byteOffset:n,byteLength:o}=i;this.parts.push(new Uint8Array(a,n,o)),this.size+=o}else{let a=new TextEncoder().encode(String(i));this.parts.push(a),this.size+=a.byteLength}this.type=SV(t.type)}slice(r=0,t=this.size,i=""){let{size:a,parts:n}=this,o=r<0?Math.max(a+r,0):Math.min(r,a),s=t<0?Math.max(a+t,0):Math.min(t,a),c=Math.max(s-o,0),u=new ss([],{type:i});if(c===0)return u;let l=0,h=[];for(let p of n){let{byteLength:d}=p;if(o>0&&d<=o)o-=d,s-=d;else{let v=p.subarray(o,Math.min(d,s));if(h.push(v),l+=v.byteLength,o=0,l>=c)break}}return u.parts=h,u.size=l,u}async arrayBuffer(){return this._toArrayBuffer()}async text(){let r=new TextDecoder,t="";for(let i of this.parts)t+=r.decode(i);return t}stream(){return new th(this.parts)}toString(){return"[object Blob]"}get[Symbol.toStringTag](){return"Blob"}_toArrayBuffer(){let r=new ArrayBuffer(this.size),t=new Uint8Array(r),i=0;for(let a of this.parts)t.set(a,i),i+=a.byteLength;return r}};function SV(e=""){let r=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(r)?"":r}function EV(){return typeof Blob>"u"&&!globalThis.Blob&&(globalThis.Blob=ss),globalThis.Blob}var AV=EV();var ah=class{onload;onabort;onerror;error;onloadstart;onloadend;onprogress;readyState;result;DONE;EMPTY;LOADING;addEventListener;removeEventListener;dispatchEvent;constructor(){this.onload=null}abort(){}async readAsArrayBuffer(r){let t=await r.arrayBuffer();this.onload&&this.onload({target:{result:t}})}async readAsBinaryString(r){throw Error("Not implemented")}async readAsDataURL(r){let t=await r.text(),i=`data://;base64,${Ec(t)}`;this.onload&&this.onload({target:{result:i}})}async readAsText(r){let t=await r.text();this.onload&&this.onload({target:{result:t}})}};var ih=class extends globalThis.Blob{name="";webkitRelativePath="";lastModified;constructor(r,t,i={}){super(r,i),this.name=String(t).replace(/\//g,":"),this.lastModified=(i==null?void 0:i.lastModified)||Date.now()}get[Symbol.toStringTag](){return"File"}};function qA(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=ah),typeof File>"u"&&!globalThis.File&&(globalThis.File=ih),global}var jV=qA();var n1=Xt(require("module"),1),zA=Xt(require("path"),1),oh=Xt(require("fs"),1);async function NA(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():oh.default.readFileSync(e).buffer}async function UA(e){return e.startsWith("http")?await(await fetch(e)).text():oh.default.readFileSync(e,"utf8")}async function HA(e){if(e.startsWith("http")){let i=await(await fetch(e)).text();return nh(i)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let r=oh.default.readFileSync(e,"utf8");return nh(r)}function nh(e,r="",t){if(typeof r=="object"&&(t=r,r=""),r=r.replace("file://",""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let i=n1.default._nodeModulePaths(zA.default.dirname(r)),a=typeof module<"u"&&(module==null?void 0:module.parent),n=new n1.default(r,a);return n.filename=r,n.paths=[].concat((t==null?void 0:t.prependPaths)||[]).concat(i).concat((t==null?void 0:t.appendPaths)||[]),n._compile(e,r),a&&a.children&&a.children.splice(a.children.indexOf(n),1),n.exports}var Ai=class{map;constructor(r){this.map={},r instanceof Ai?r.forEach((t,i)=>this.append(i,t)):Array.isArray(r)?r.forEach(t=>this.append(t[0],t[1])):r&&Object.getOwnPropertyNames(r).forEach(t=>this.append(t,r[t]))}append(r,t){r=rl(r),t=VA(t);let i=this.map[r];this.map[r]=i?`${i}, ${t}`:t}delete(r){delete this.map[rl(r)]}get(r){return r=rl(r),this.has(r)?this.map[r]:null}has(r){return this.map.hasOwnProperty(rl(r))}set(r,t){this.map[rl(r)]=VA(t)}forEach(r,t=null){for(let i in this.map)this.map.hasOwnProperty(i)&&(t?r.call(t,this.map[i],i,this):r(this.map[i],i,this))}keys(){let r=[];return this.forEach(function(t,i){r.push(i)}),o1(r)}values(){let r=[];return this.forEach(function(t){r.push(t)}),o1(r)}entries(){let r=[];return this.forEach(function(t,i){r.push([i,t])}),o1(r)}*[Symbol.iterator](){yield*this.entries()}};function rl(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e)||e==="")throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function VA(e){return typeof e!="string"&&(e=String(e)),e}function o1(e){let r={next(){let t=e.shift();return{done:t===void 0,value:t}}};return r[Symbol.iterator]=function(){return r},r}function s1(e,r){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${r}`)}var u1=Xt(require("stream"),1),TV=e=>typeof e=="boolean",GA=e=>typeof e=="function",RV=e=>e!==null&&typeof e=="object",c1=e=>RV(e)&&GA(e.read)&&GA(e.pipe)&&TV(e.readable),Fn=class{ok;status;statusText;headers;url;bodyUsed=!1;_body;constructor(r,t){let{headers:i,status:a=200,statusText:n="OK",url:o}=t||{};this.url=o,this.ok=a===200,this.status=a,this.statusText=n,this.headers=new Ai((t==null?void 0:t.headers)||{}),c1(r)?this._body=kp(r,i):typeof r=="string"?this._body=u1.Readable.from([new TextEncoder().encode(r)]):this._body=u1.Readable.from([r||new ArrayBuffer(0)])}get body(){return s1(!this.bodyUsed),s1(c1(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return c1(this._body)?await g5(this._body):this._body||new ArrayBuffer(0)}async text(){let r=await this.arrayBuffer();return new TextDecoder().decode(r)}async json(){let r=await this.text();return JSON.parse(r)}async blob(){if(typeof Blob>"u")throw new Error("Blob polyfill not installed");return new Blob([await this.arrayBuffer()])}};var $A=Xt(require("http"),1),WA=Xt(require("https"),1);var PV=e=>e&&e instanceof ArrayBuffer,OV=e=>e&&e instanceof Buffer;function KA(e){let r=e.indexOf(","),t,i;return e.slice(r-7,r)===";base64"?(t=Buffer.from(e.slice(r+1),"base64"),i=e.slice(5,r-7).trim()):(t=Buffer.from(decodeURIComponent(e.slice(r+1))),i=e.slice(5,r).trim()),i?i.startsWith(";")&&(i=`text/plain${i}`):i="text/plain;charset=US-ASCII",{arrayBuffer:CV(t),mimeType:i}}function CV(e){if(PV(e))return e;if(OV(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var l1=e=>e.startsWith("data:"),BV=e=>e.startsWith("http:")||e.startsWith("https:");async function tl(e,r){try{if(globalThis.fetch!==tl&&(BV(e)||l1(e)))return await fetch(e,r);if(l1(e)){let{arrayBuffer:u,mimeType:l}=KA(e);return new Fn(u,{headers:{"content-type":l},url:e})}let t={},i=e;e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip");let a=await FV(i,r),n=DV(e,a,t),{status:o,statusText:s}=LV(a),c=!r||r.followRedirect||r.followRedirect===void 0;if(o>=300&&o<400&&n.has("location")&&c){let u=IV(e,n.get("location"));return await tl(u,r)}return new Fn(a,{headers:n,status:o,statusText:s,url:e})}catch(t){return new Fn(null,{status:400,statusText:String(t),url:e})}}async function FV(e,r){return await new Promise((t,i)=>{let a=MV(e,r),n=e.startsWith("https:")?WA.default.request(a,o=>t(o)):$A.default.request(a,o=>t(o));n.on("error",o=>i(o)),n.end()})}function IV(e,r){if(r.startsWith("http"))return r;let t=new URL(e);return t.pathname=r,t.href}function MV(e,r){let t=(r==null?void 0:r.headers)||{},i={};for(let n of Object.keys(t))i[n.toLowerCase()]=t[n];i["accept-encoding"]=i["accept-encoding"]||"gzip,br,deflate";let a=new URL(e);return{hostname:a.hostname,path:a.pathname,method:"GET",...r,...r==null?void 0:r.fetch,headers:i,port:a.port}}function LV(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function DV(e,r,t={}){let i={};if(r&&r.headers){let a=r.headers;for(let n in a){let o=a[n];i[n.toLowerCase()]=String(o)}}if(!i["content-length"]){let a=qV(e);Number.isFinite(a)&&(i["content-length"]=a)}return Object.assign(i,t),new Ai(i)}function qV(e){return l1(e)?e.length-5:null}var zV=parseInt(XA.versions.node.split(".")[0]);oy&&console.error("loaders.gl: The @loaders.gl/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=vv;globalThis.loaders.NodeFile=Wo;globalThis.loaders.NodeFileSystem=Ap;globalThis.loaders.fetchNode=Sp;globalThis.loaders.NodeHash=jp;globalThis.TextEncoder||(globalThis.TextEncoder=Sc);globalThis.TextDecoder||(globalThis.TextDecoder=wo);globalThis.ReadableStream||(globalThis.ReadableStream=ReadableStream);!("atob"in globalThis)&&Ec&&(globalThis.atob=Ec);!("btoa"in globalThis)&&Nh&&(globalThis.btoa=Nh);globalThis.loaders.encodeImageNode=h_;globalThis.loaders.parseImageNode=Kg;globalThis.loaders.imageFormatsNode=Gg;globalThis._parseImageNode=Kg;globalThis._imageFormatsNode=Gg;globalThis.loaders.readFileAsArrayBuffer=NA;globalThis.loaders.readFileAsText=UA;globalThis.loaders.requireFromFile=HA;globalThis.loaders.requireFromString=nh;zV<18&&(!("Headers"in globalThis)&&Ai&&(globalThis.Headers=Ai),!("Response"in globalThis)&&Fn&&(globalThis.Response=Fn),!("fetch"in globalThis)&&tl&&(globalThis.fetch=tl));var NV=e=>typeof e=="boolean",al=e=>typeof e=="function",cs=e=>e!==null&&typeof e=="object",f1=e=>cs(e)&&e.constructor==={}.constructor;var YA=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",QA=e=>e&&typeof e[Symbol.asyncIterator]=="function";var Za=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var ei=e=>typeof Blob<"u"&&e instanceof Blob,JA=e=>e&&typeof e=="object"&&e.isBuffer;var UV=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||cs(e)&&al(e.tee)&&al(e.cancel)&&al(e.getReader);var HV=e=>cs(e)&&al(e.read)&&al(e.pipe)&&NV(e.readable),sh=e=>UV(e)||HV(e);var ch=class extends Error{constructor(r,t){super(r),this.reason=t.reason,this.url=t.url,this.response=t.response}reason;url;response};var VV=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,GV=/^([-\w.]+\/[-\w.+]+)/;function p1(e,r){return e.toLowerCase()===r.toLowerCase()}function ZA(e){let r=GV.exec(e);return r?r[1]:e}function h1(e){let r=VV.exec(e);return r?r[1]:""}var ej=/\?.*/;function rj(e){let r=e.match(ej);return r&&r[0]}function mc(e){return e.replace(ej,"")}function tj(e){if(e.length<50)return e;let r=e.slice(e.length-15);return`${e.substr(0,32)}...${r}`}function us(e){return Za(e)?e.url:ei(e)?e.name||"":typeof e=="string"?e:""}function il(e){if(Za(e)){let r=e,t=r.headers.get("content-type")||"",i=mc(r.url);return ZA(t)||h1(i)}return ei(e)?e.type||"":typeof e=="string"?h1(e):""}function aj(e){return Za(e)?e.headers["content-length"]||-1:ei(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function uh(e){if(Za(e))return e;let r={},t=aj(e);t>=0&&(r["content-length"]=String(t));let i=us(e),a=il(e);a&&(r["content-type"]=a);let n=await $V(e);n&&(r["x-first-bytes"]=n),typeof e=="string"&&(e=new TextEncoder().encode(e));let o=new Response(e,{headers:r});return Object.defineProperty(o,"url",{value:i}),o}async function ij(e){if(!e.ok)throw await KV(e)}async function KV(e){let r=tj(e.url),t=`Failed to fetch resource (${e.status}) ${e.statusText}: ${r}`;t=t.length>100?`${t.slice(0,100)}...`:t;let i={reason:e.statusText,url:e.url,response:e};try{let a=e.headers.get("Content-Type");i.reason=!e.bodyUsed&&(a!=null&&a.includes("application/json"))?await e.json():await e.text()}catch{}return new ch(t,i)}async function $V(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let t=e.slice(0,5);return await new Promise(i=>{let a=new FileReader;a.onload=n=>{var o;return i((o=n==null?void 0:n.target)==null?void 0:o.result)},a.readAsDataURL(t)})}if(e instanceof ArrayBuffer){let t=e.slice(0,5);return`data:base64,${WV(t)}`}return null}function WV(e){let r="",t=new Uint8Array(e);for(let i=0;i<t.byteLength;i++)r+=String.fromCharCode(t[i]);return btoa(r)}function XV(e){return!YV(e)&&!QV(e)}function YV(e){return e.startsWith("http:")||e.startsWith("https:")}function QV(e){return e.startsWith("data:")}async function d1(e,r){var t,i;if(typeof e=="string"){let a=Ko(e);return XV(a)&&(t=globalThis.loaders)!=null&&t.fetchNode?(i=globalThis.loaders)==null?void 0:i.fetchNode(a,r):await fetch(a,r)}return await uh(e)}var m1=new Xi({id:"loaders.gl"}),lh=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},fh=class{console;constructor(){this.console=console}log(...r){return this.console.log.bind(this.console,...r)}info(...r){return this.console.info.bind(this.console,...r)}warn(...r){return this.console.warn.bind(this.console,...r)}error(...r){return this.console.error.bind(this.console,...r)}};var g1={fetch:null,mimeType:void 0,nothrow:!1,log:new fh,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:No,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},nj={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function v1(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state||(e._state={}),e._state}function y1(){let e=v1();return e.globalOptions=e.globalOptions||{...g1},e.globalOptions}function cj(e,r,t,i){return t=t||[],t=Array.isArray(t)?t:[t],JV(e,t),eG(r,e,i)}function JV(e,r){oj(e,null,g1,nj,r);for(let t of r){let i=e&&e[t.id]||{},a=t.options&&t.options[t.id]||{},n=t.deprecatedOptions&&t.deprecatedOptions[t.id]||{};oj(i,t.id,a,n,r)}}function oj(e,r,t,i,a){let n=r||"Top level",o=r?`${r}.`:"";for(let s in e){let c=!r&&cs(e[s]),u=s==="baseUri"&&!r,l=s==="workerUrl"&&r;if(!(s in t)&&!u&&!l){if(s in i)m1.warn(`${n} loader option '${o}${s}' no longer supported, use '${i[s]}'`)();else if(!c){let h=ZV(s,a);m1.warn(`${n} loader option '${o}${s}' not recognized. ${h}`)()}}}}function ZV(e,r){let t=e.toLowerCase(),i="";for(let a of r)for(let n in a.options){if(e===n)return`Did you mean '${a.id}.${n}'?`;let o=n.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(i=i||`Did you mean '${a.id}.${n}'?`)}return i}function eG(e,r,t){let a={...e.options||{}};return rG(a,t),a.log===null&&(a.log=new lh),sj(a,y1()),sj(a,r),a}function sj(e,r){for(let t in r)if(t in r){let i=r[t];f1(i)&&f1(e[t])?e[t]={...e[t],...r[t]}:e[t]=r[t]}}function rG(e,r){r&&!("baseUri"in e)&&(e.baseUri=r)}function nl(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function b1(e){ki(e,"null loader"),ki(nl(e),"invalid loader");let r;return Array.isArray(e)&&(r=e[1],e=e[0],e={...e,options:{...e.options,...r}}),(e!=null&&e.parseTextSync||e!=null&&e.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var tG=()=>{let e=v1();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function uj(){return tG()}var aG=/\.([^.]+)$/;async function pj(e,r=[],t,i){if(!hj(e))return null;let a=lj(e,r,{...t,nothrow:!0},i);if(a)return a;if(ei(e)&&(e=await e.slice(0,10).arrayBuffer(),a=lj(e,r,t,i)),!a&&!(t!=null&&t.nothrow))throw new Error(dj(e));return a}function lj(e,r=[],t,i){if(!hj(e))return null;if(r&&!Array.isArray(r))return b1(r);let a=[];r&&(a=a.concat(r)),t!=null&&t.ignoreRegisteredLoaders||a.push(...uj()),nG(a);let n=iG(e,a,t,i);if(!n&&!(t!=null&&t.nothrow))throw new Error(dj(e));return n}function iG(e,r,t,i){let a=us(e),n=il(e),o=mc(a)||(i==null?void 0:i.url),s=null,c="";return t!=null&&t.mimeType&&(s=x1(r,t==null?void 0:t.mimeType),c=`match forced by supplied MIME type ${t==null?void 0:t.mimeType}`),s=s||oG(r,o),c=c||(s?`matched url ${o}`:""),s=s||x1(r,n),c=c||(s?`matched MIME type ${n}`:""),s=s||cG(r,e),c=c||(s?`matched initial data ${mj(e)}`:""),t!=null&&t.fallbackMimeType&&(s=s||x1(r,t==null?void 0:t.fallbackMimeType),c=c||(s?`matched fallback MIME type ${n}`:"")),c&&Yg.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${c}.`),s}function hj(e){return!(e instanceof Response&&e.status===204)}function dj(e){let r=us(e),t=il(e),i="No valid loader found (";i+=r?`${$o.filename(r)}, `:"no url provided, ",i+=`MIME type: ${t?`"${t}"`:"not provided"}, `;let a=e?mj(e):"";return i+=a?` first bytes: "${a}"`:"first bytes: not available",i+=")",i}function nG(e){for(let r of e)b1(r)}function oG(e,r){let t=r&&aG.exec(r),i=t&&t[1];return i?sG(e,i):null}function sG(e,r){r=r.toLowerCase();for(let t of e)for(let i of t.extensions)if(i.toLowerCase()===r)return t;return null}function x1(e,r){var t;for(let i of e)if((t=i.mimeTypes)!=null&&t.some(a=>p1(r,a))||p1(r,`application/x.${i.id}`))return i;return null}function cG(e,r){if(!r)return null;for(let t of e)if(typeof r=="string"){if(uG(r,t))return t}else if(ArrayBuffer.isView(r)){if(fj(r.buffer,r.byteOffset,t))return t}else if(r instanceof ArrayBuffer&&fj(r,0,t))return t;return null}function uG(e,r){return r.testText?r.testText(e):(Array.isArray(r.tests)?r.tests:[r.tests]).some(i=>e.startsWith(i))}function fj(e,r,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(a=>lG(e,r,t,a))}function lG(e,r,t,i){if(i instanceof ArrayBuffer)return lv(i,e,i.byteLength);switch(typeof i){case"function":return i(e);case"string":let a=_1(e,r,i.length);return i===a;default:return!1}}function mj(e,r=5){return typeof e=="string"?e.slice(0,r):ArrayBuffer.isView(e)?_1(e.buffer,e.byteOffset,r):e instanceof ArrayBuffer?_1(e,0,r):""}function _1(e,r,t){if(e.byteLength<r+t)return"";let i=new DataView(e),a="";for(let n=0;n<t;n++)a+=String.fromCharCode(i.getUint8(r+n));return a}function*gj(e,r){let t=(r==null?void 0:r.chunkSize)||262144,i=0,a=new TextEncoder;for(;i<e.length;){let n=Math.min(e.length-i,t),o=e.slice(i,i+n);i+=n,yield a.encode(o)}}function*vj(e,r={}){let{chunkSize:t=262144}=r,i=0;for(;i<e.byteLength;){let a=Math.min(e.byteLength-i,t),n=new ArrayBuffer(a),o=new Uint8Array(e,i,a);new Uint8Array(n).set(o),i+=a,yield n}}async function*yj(e,r){let t=(r==null?void 0:r.chunkSize)||1048576,i=0;for(;i<e.size;){let a=i+t,n=await e.slice(i,a).arrayBuffer();i=a,yield n}}function w1(e,r){return No?fG(e,r):pG(e,r)}async function*fG(e,r){let t=e.getReader(),i;try{for(;;){let a=i||t.read();r!=null&&r._streamReadAhead&&(i=t.read());let{done:n,value:o}=await a;if(n)return;yield _p(o)}}catch{t.releaseLock()}}async function*pG(e,r){for await(let t of e)yield _p(t)}function bj(e,r){if(typeof e=="string")return gj(e,r);if(e instanceof ArrayBuffer)return vj(e,r);if(ei(e))return yj(e,r);if(sh(e))return w1(e,r);if(Za(e))return w1(e.body,r);throw new Error("makeIterator")}var xj="Cannot convert supplied data type";function hG(e,r,t){if(r.text&&typeof e=="string")return e;if(JA(e)&&(e=e.buffer),e instanceof ArrayBuffer){let i=e;return r.text&&!r.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(e)){if(r.text&&!r.binary)return new TextDecoder("utf8").decode(e);let i=e.buffer,a=e.byteLength||e.length;return(e.byteOffset!==0||a!==i.byteLength)&&(i=i.slice(e.byteOffset,e.byteOffset+a)),i}throw new Error(xj)}async function _j(e,r,t){let i=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||i)return hG(e,r,t);if(ei(e)&&(e=await uh(e)),Za(e)){let a=e;return await ij(a),r.binary?await a.arrayBuffer():await a.text()}if(sh(e)&&(e=bj(e,t)),YA(e)||QA(e))return Iu(e);throw new Error(xj)}function ph(e,r){let t=y1(),i=e||t;return typeof i.fetch=="function"?i.fetch:cs(i.fetch)?a=>d1(a,i.fetch):r!=null&&r.fetch?r==null?void 0:r.fetch:d1}function wj(e,r,t){if(t)return t;let i={fetch:ph(r,e),...e};if(i.url){let a=mc(i.url);i.baseUrl=a,i.queryString=rj(i.url),i.filename=$o.filename(a),i.baseUrl=$o.dirname(a)}return Array.isArray(i.loaders)||(i.loaders=null),i}function kj(e,r){if(e&&!Array.isArray(e))return e;let t;if(e&&(t=Array.isArray(e)?e:[e]),r&&r.loaders){let i=Array.isArray(r.loaders)?r.loaders:[r.loaders];t=t?[...t,...i]:i}return t&&t.length?t:void 0}async function In(e,r,t,i){r&&!Array.isArray(r)&&!nl(r)&&(i=void 0,t=r,r=void 0),e=await e,t=t||{};let a=us(e),o=kj(r,i),s=await pj(e,o,t);return s?(t=cj(t,s,o,a),i=wj({url:a,_parse:In,loaders:o},t,i||null),await dG(s,e,t,i)):null}async function dG(e,r,t,i){if(nv(e),t=Qg(e.options,t),Za(r)){let n=r,{ok:o,redirected:s,status:c,statusText:u,type:l,url:h}=n,p=Object.fromEntries(n.headers.entries());i.response={headers:p,ok:o,redirected:s,status:c,statusText:u,type:l,url:h}}r=await _j(r,e,t);let a=e;if(a.parseTextSync&&typeof r=="string")return a.parseTextSync(r,t,i);if(cv(e,t))return await uv(e,r,t,i,In);if(a.parseText&&typeof r=="string")return await a.parseText(r,t,i);if(a.parse)return await a.parse(r,t,i);throw Wt(!a.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function Sj(e){switch(e.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function k1(e){let r=1/0,t=1/0,i=1/0,a=-1/0,n=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],c=s&&s.length;for(let u=0;u<c;u+=3){let l=s[u],h=s[u+1],p=s[u+2];r=l<r?l:r,t=h<t?h:t,i=p<i?p:i,a=l>a?l:a,n=h>n?h:n,o=p>o?p:o}return[[r,t,i],[a,n,o]]}function S1(e,r,t){let i=Sj(r.value),a=t||Ej(r);return{name:e,type:{type:"fixed-size-list",listSize:r.size,children:[{name:"value",type:i}]},nullable:!1,metadata:a}}function Ej(e){let r={};return"byteOffset"in e&&(r.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(r.byteStride=e.byteStride.toString(10)),"normalized"in e&&(r.normalized=e.normalized.toString()),r}async function E1(e,r,t,i){let a,n;!Array.isArray(r)&&!nl(r)?(a=[],n=r,i=void 0):(a=r,n=t);let o=ph(n),s=e;return typeof e=="string"&&(s=await o(e)),ei(e)&&(s=await o(e)),Array.isArray(a)?await In(s,a,n):await In(s,a,n)}var mG=1/Math.PI*180,gG=1/180*Math.PI,vG={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...vG}};var gt=globalThis.mathgl.config;function A1(e,{precision:r=gt.precision}={}){return e=yG(e),`${parseFloat(e.toPrecision(r))}`}function _o(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function j1(e){return Aj(e)}function T1(e){return jj(e)}function Aj(e,r){return Tj(e,t=>t*gG,r)}function jj(e,r){return Tj(e,t=>t*mG,r)}function Mn(e,r,t){let i=gt.EPSILON;t&&(gt.EPSILON=t);try{if(e===r)return!0;if(_o(e)&&_o(r)){if(e.length!==r.length)return!1;for(let a=0;a<e.length;++a)if(!Mn(e[a],r[a]))return!1;return!0}return e&&e.equals?e.equals(r):r&&r.equals?r.equals(e):typeof e=="number"&&typeof r=="number"?Math.abs(e-r)<=gt.EPSILON*Math.max(1,Math.abs(e),Math.abs(r)):!1}finally{gt.EPSILON=i}}function yG(e){return Math.round(e/gt.EPSILON)*gt.EPSILON}function bG(e){return e.clone?e.clone():new Array(e.length)}function Tj(e,r,t){if(_o(e)){let i=e;t=t||bG(i);for(let a=0;a<t.length&&a<i.length;++a){let n=typeof e=="number"?e:e[a];t[a]=r(n,a,t)}return t}return r(e)}var gc=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(r,t=0){for(let i=0;i<this.ELEMENTS;++i)this[i]=r[i+t];return this.check()}toArray(r=[],t=0){for(let i=0;i<this.ELEMENTS;++i)r[t+i]=this[i];return r}toObject(r){return r}from(r){return Array.isArray(r)?this.copy(r):this.fromObject(r)}to(r){return r===this?this:_o(r)?this.toArray(r):this.toObject(r)}toTarget(r){return r?this.to(r):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(gt)}formatString(r){let t="";for(let i=0;i<this.ELEMENTS;++i)t+=(i>0?", ":"")+A1(this[i],r);return`${r.printTypes?this.constructor.name:""}[${t}]`}equals(r){if(!r||this.length!==r.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!Mn(this[t],r[t]))return!1;return!0}exactEquals(r){if(!r||this.length!==r.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==r[t])return!1;return!0}negate(){for(let r=0;r<this.ELEMENTS;++r)this[r]=-this[r];return this.check()}lerp(r,t,i){if(i===void 0)return this.lerp(this,r,t);for(let a=0;a<this.ELEMENTS;++a){let n=r[a],o=typeof t=="number"?t:t[a];this[a]=n+i*(o-n)}return this.check()}min(r){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(r[t],this[t]);return this.check()}max(r){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(r[t],this[t]);return this.check()}clamp(r,t){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],r[i]),t[i]);return this.check()}add(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]+=t[i];return this.check()}subtract(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]-=t[i];return this.check()}scale(r){if(typeof r=="number")for(let t=0;t<this.ELEMENTS;++t)this[t]*=r;else for(let t=0;t<this.ELEMENTS&&t<r.length;++t)this[t]*=r[t];return this.check()}multiplyByScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]*=r;return this.check()}check(){if(gt.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let r=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)r=r&&Number.isFinite(this[t]);return r}sub(r){return this.subtract(r)}setScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]=r;return this.check()}addScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]+=r;return this.check()}subScalar(r){return this.addScalar(-r)}multiplyScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]*=r;return this.check()}divideScalar(r){return this.multiplyByScalar(1/r)}clampScalar(r,t){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],r),t);return this.check()}get elements(){return this}};function xG(e,r){if(e.length!==r)return!1;for(let t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}function ia(e){if(!Number.isFinite(e))throw new Error(`Invalid number ${JSON.stringify(e)}`);return e}function hh(e,r,t=""){if(gt.debug&&!xG(e,r))throw new Error(`math.gl: ${t} some fields set to invalid numbers'`);return e}function ri(e,r){if(!e)throw new Error(`math.gl assertion ${r}`)}var dh=class extends gc{get x(){return this[0]}set x(r){this[0]=ia(r)}get y(){return this[1]}set y(r){this[1]=ia(r)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let r=0;for(let t=0;t<this.ELEMENTS;++t)r+=this[t]*this[t];return r}magnitudeSquared(){return this.lengthSquared()}distance(r){return Math.sqrt(this.distanceSquared(r))}distanceSquared(r){let t=0;for(let i=0;i<this.ELEMENTS;++i){let a=this[i]-r[i];t+=a*a}return ia(t)}dot(r){let t=0;for(let i=0;i<this.ELEMENTS;++i)t+=this[i]*r[i];return ia(t)}normalize(){let r=this.magnitude();if(r!==0)for(let t=0;t<this.ELEMENTS;++t)this[t]/=r;return this.check()}multiply(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]*=t[i];return this.check()}divide(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]/=t[i];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(r){return this.distance(r)}distanceToSquared(r){return this.distanceSquared(r)}getComponent(r){return ri(r>=0&&r<this.ELEMENTS,"index is out of range"),ia(this[r])}setComponent(r,t){return ri(r>=0&&r<this.ELEMENTS,"index is out of range"),this[r]=t,this.check()}addVectors(r,t){return this.copy(r).add(t)}subVectors(r,t){return this.copy(r).subtract(t)}multiplyVectors(r,t){return this.copy(r).multiply(t)}addScaledVector(r,t){return this.add(new this.constructor(r).multiplyScalar(t))}};var ji=typeof Float32Array<"u"?Float32Array:Array,ol=Math.random;function vc(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var $ne=Math.PI/180;function _G(){let e=new ji(2);return ji!=Float32Array&&(e[0]=0,e[1]=0),e}function Rj(e,r,t){let i=r[0],a=r[1];return e[0]=t[0]*i+t[4]*a+t[12],e[1]=t[1]*i+t[5]*a+t[13],e}var Wne=function(){let e=_G();return function(r,t,i,a,n,o){let s,c;for(t||(t=2),i||(i=0),a?c=Math.min(a*t+i,r.length):c=r.length,s=i;s<c;s+=t)e[0]=r[s],e[1]=r[s+1],n(e,e,o),r[s]=e[0],r[s+1]=e[1];return r}}();function Pj(e,r,t){let i=r[0],a=r[1],n=t[3]*i+t[7]*a||1;return e[0]=(t[0]*i+t[4]*a)/n,e[1]=(t[1]*i+t[5]*a)/n,e}function mh(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[3]*i+t[7]*a+t[11]*n||1;return e[0]=(t[0]*i+t[4]*a+t[8]*n)/o,e[1]=(t[1]*i+t[5]*a+t[9]*n)/o,e[2]=(t[2]*i+t[6]*a+t[10]*n)/o,e}function Oj(e,r,t){let i=r[0],a=r[1];return e[0]=t[0]*i+t[2]*a,e[1]=t[1]*i+t[3]*a,e[2]=r[2],e}var cl={};yl(cl,{add:()=>jG,angle:()=>L1,bezier:()=>NG,ceil:()=>TG,clone:()=>kG,copy:()=>EG,create:()=>Cj,cross:()=>O1,dist:()=>YG,distance:()=>Lj,div:()=>XG,divide:()=>Mj,dot:()=>P1,equals:()=>KG,exactEquals:()=>GG,floor:()=>RG,forEach:()=>eK,fromValues:()=>SG,hermite:()=>zG,inverse:()=>MG,len:()=>JG,length:()=>Bj,lerp:()=>DG,max:()=>OG,min:()=>PG,mul:()=>WG,multiply:()=>Ij,negate:()=>IG,normalize:()=>LG,random:()=>UG,rotateX:()=>F1,rotateY:()=>I1,rotateZ:()=>M1,round:()=>CG,scale:()=>BG,scaleAndAdd:()=>FG,set:()=>AG,slerp:()=>qG,sqrDist:()=>QG,sqrLen:()=>ZG,squaredDistance:()=>Dj,squaredLength:()=>qj,str:()=>VG,sub:()=>$G,subtract:()=>Fj,transformMat3:()=>C1,transformMat4:()=>sl,transformQuat:()=>B1,zero:()=>HG});function Cj(){let e=new ji(3);return ji!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function kG(e){let r=new ji(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function Bj(e){let r=e[0],t=e[1],i=e[2];return Math.sqrt(r*r+t*t+i*i)}function SG(e,r,t){let i=new ji(3);return i[0]=e,i[1]=r,i[2]=t,i}function EG(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function AG(e,r,t,i){return e[0]=r,e[1]=t,e[2]=i,e}function jG(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e}function Fj(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e}function Ij(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e}function Mj(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e[2]=r[2]/t[2],e}function TG(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e}function RG(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e}function PG(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e[2]=Math.min(r[2],t[2]),e}function OG(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e[2]=Math.max(r[2],t[2]),e}function CG(e,r){return e[0]=vc(r[0]),e[1]=vc(r[1]),e[2]=vc(r[2]),e}function BG(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e}function FG(e,r,t,i){return e[0]=r[0]+t[0]*i,e[1]=r[1]+t[1]*i,e[2]=r[2]+t[2]*i,e}function Lj(e,r){let t=r[0]-e[0],i=r[1]-e[1],a=r[2]-e[2];return Math.sqrt(t*t+i*i+a*a)}function Dj(e,r){let t=r[0]-e[0],i=r[1]-e[1],a=r[2]-e[2];return t*t+i*i+a*a}function qj(e){let r=e[0],t=e[1],i=e[2];return r*r+t*t+i*i}function IG(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e}function MG(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e}function LG(e,r){let t=r[0],i=r[1],a=r[2],n=t*t+i*i+a*a;return n>0&&(n=1/Math.sqrt(n)),e[0]=r[0]*n,e[1]=r[1]*n,e[2]=r[2]*n,e}function P1(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function O1(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[0],s=t[1],c=t[2];return e[0]=a*c-n*s,e[1]=n*o-i*c,e[2]=i*s-a*o,e}function DG(e,r,t,i){let a=r[0],n=r[1],o=r[2];return e[0]=a+i*(t[0]-a),e[1]=n+i*(t[1]-n),e[2]=o+i*(t[2]-o),e}function qG(e,r,t,i){let a=Math.acos(Math.min(Math.max(P1(r,t),-1),1)),n=Math.sin(a),o=Math.sin((1-i)*a)/n,s=Math.sin(i*a)/n;return e[0]=o*r[0]+s*t[0],e[1]=o*r[1]+s*t[1],e[2]=o*r[2]+s*t[2],e}function zG(e,r,t,i,a,n){let o=n*n,s=o*(2*n-3)+1,c=o*(n-2)+n,u=o*(n-1),l=o*(3-2*n);return e[0]=r[0]*s+t[0]*c+i[0]*u+a[0]*l,e[1]=r[1]*s+t[1]*c+i[1]*u+a[1]*l,e[2]=r[2]*s+t[2]*c+i[2]*u+a[2]*l,e}function NG(e,r,t,i,a,n){let o=1-n,s=o*o,c=n*n,u=s*o,l=3*n*s,h=3*c*o,p=c*n;return e[0]=r[0]*u+t[0]*l+i[0]*h+a[0]*p,e[1]=r[1]*u+t[1]*l+i[1]*h+a[1]*p,e[2]=r[2]*u+t[2]*l+i[2]*h+a[2]*p,e}function UG(e,r){r=r===void 0?1:r;let t=ol()*2*Math.PI,i=ol()*2-1,a=Math.sqrt(1-i*i)*r;return e[0]=Math.cos(t)*a,e[1]=Math.sin(t)*a,e[2]=i*r,e}function sl(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[3]*i+t[7]*a+t[11]*n+t[15];return o=o||1,e[0]=(t[0]*i+t[4]*a+t[8]*n+t[12])/o,e[1]=(t[1]*i+t[5]*a+t[9]*n+t[13])/o,e[2]=(t[2]*i+t[6]*a+t[10]*n+t[14])/o,e}function C1(e,r,t){let i=r[0],a=r[1],n=r[2];return e[0]=i*t[0]+a*t[3]+n*t[6],e[1]=i*t[1]+a*t[4]+n*t[7],e[2]=i*t[2]+a*t[5]+n*t[8],e}function B1(e,r,t){let i=t[0],a=t[1],n=t[2],o=t[3],s=r[0],c=r[1],u=r[2],l=a*u-n*c,h=n*s-i*u,p=i*c-a*s,d=a*p-n*h,v=n*l-i*p,x=i*h-a*l,y=o*2;return l*=y,h*=y,p*=y,d*=2,v*=2,x*=2,e[0]=s+l+d,e[1]=c+h+v,e[2]=u+p+x,e}function F1(e,r,t,i){let a=[],n=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],n[0]=a[0],n[1]=a[1]*Math.cos(i)-a[2]*Math.sin(i),n[2]=a[1]*Math.sin(i)+a[2]*Math.cos(i),e[0]=n[0]+t[0],e[1]=n[1]+t[1],e[2]=n[2]+t[2],e}function I1(e,r,t,i){let a=[],n=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],n[0]=a[2]*Math.sin(i)+a[0]*Math.cos(i),n[1]=a[1],n[2]=a[2]*Math.cos(i)-a[0]*Math.sin(i),e[0]=n[0]+t[0],e[1]=n[1]+t[1],e[2]=n[2]+t[2],e}function M1(e,r,t,i){let a=[],n=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],n[0]=a[0]*Math.cos(i)-a[1]*Math.sin(i),n[1]=a[0]*Math.sin(i)+a[1]*Math.cos(i),n[2]=a[2],e[0]=n[0]+t[0],e[1]=n[1]+t[1],e[2]=n[2]+t[2],e}function L1(e,r){let t=e[0],i=e[1],a=e[2],n=r[0],o=r[1],s=r[2],c=Math.sqrt((t*t+i*i+a*a)*(n*n+o*o+s*s)),u=c&&P1(e,r)/c;return Math.acos(Math.min(Math.max(u,-1),1))}function HG(e){return e[0]=0,e[1]=0,e[2]=0,e}function VG(e){return`vec3(${e[0]}, ${e[1]}, ${e[2]})`}function GG(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]}function KG(e,r){let t=e[0],i=e[1],a=e[2],n=r[0],o=r[1],s=r[2];return Math.abs(t-n)<=1e-6*Math.max(1,Math.abs(t),Math.abs(n))&&Math.abs(i-o)<=1e-6*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(a-s)<=1e-6*Math.max(1,Math.abs(a),Math.abs(s))}var $G=Fj,WG=Ij,XG=Mj,YG=Lj,QG=Dj,JG=Bj,ZG=qj,eK=function(){let e=Cj();return function(r,t,i,a,n,o){let s,c;for(t||(t=3),i||(i=0),a?c=Math.min(a*t+i,r.length):c=r.length,s=i;s<c;s+=t)e[0]=r[s],e[1]=r[s+1],e[2]=r[s+2],n(e,e,o),r[s]=e[0],r[s+1]=e[1],r[s+2]=e[2];return r}}();var D1=[0,0,0],gh,xr=class extends dh{static get ZERO(){return gh||(gh=new xr(0,0,0),Object.freeze(gh)),gh}constructor(r=0,t=0,i=0){super(-0,-0,-0),arguments.length===1&&_o(r)?this.copy(r):(gt.debug&&(ia(r),ia(t),ia(i)),this[0]=r,this[1]=t,this[2]=i)}set(r,t,i){return this[0]=r,this[1]=t,this[2]=i,this.check()}copy(r){return this[0]=r[0],this[1]=r[1],this[2]=r[2],this.check()}fromObject(r){return gt.debug&&(ia(r.x),ia(r.y),ia(r.z)),this[0]=r.x,this[1]=r.y,this[2]=r.z,this.check()}toObject(r){return r.x=this[0],r.y=this[1],r.z=this[2],r}get ELEMENTS(){return 3}get z(){return this[2]}set z(r){this[2]=ia(r)}angle(r){return L1(this,r)}cross(r){return O1(this,this,r),this.check()}rotateX({radians:r,origin:t=D1}){return F1(this,this,t,r),this.check()}rotateY({radians:r,origin:t=D1}){return I1(this,this,t,r),this.check()}rotateZ({radians:r,origin:t=D1}){return M1(this,this,t,r),this.check()}transform(r){return this.transformAsPoint(r)}transformAsPoint(r){return sl(this,this,r),this.check()}transformAsVector(r){return mh(this,this,r),this.check()}transformByMatrix3(r){return C1(this,this,r),this.check()}transformByMatrix2(r){return Oj(this,this,r),this.check()}transformByQuaternion(r){return B1(this,this,r),this.check()}};var vh=class extends gc{toString(){let r="[";if(gt.printRowMajor){r+="row-major:";for(let t=0;t<this.RANK;++t)for(let i=0;i<this.RANK;++i)r+=` ${this[i*this.RANK+t]}`}else{r+="column-major:";for(let t=0;t<this.ELEMENTS;++t)r+=` ${this[t]}`}return r+="]",r}getElementIndex(r,t){return t*this.RANK+r}getElement(r,t){return this[t*this.RANK+r]}setElement(r,t,i){return this[t*this.RANK+r]=ia(i),this}getColumn(r,t=new Array(this.RANK).fill(-0)){let i=r*this.RANK;for(let a=0;a<this.RANK;++a)t[a]=this[i+a];return t}setColumn(r,t){let i=r*this.RANK;for(let a=0;a<this.RANK;++a)this[i+a]=t[a];return this}};function rK(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function zj(e,r){if(e===r){let t=r[1],i=r[2],a=r[3],n=r[6],o=r[7],s=r[11];e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=t,e[6]=r[9],e[7]=r[13],e[8]=i,e[9]=n,e[11]=r[14],e[12]=a,e[13]=o,e[14]=s}else e[0]=r[0],e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=r[1],e[5]=r[5],e[6]=r[9],e[7]=r[13],e[8]=r[2],e[9]=r[6],e[10]=r[10],e[11]=r[14],e[12]=r[3],e[13]=r[7],e[14]=r[11],e[15]=r[15];return e}function Nj(e,r){let t=r[0],i=r[1],a=r[2],n=r[3],o=r[4],s=r[5],c=r[6],u=r[7],l=r[8],h=r[9],p=r[10],d=r[11],v=r[12],x=r[13],y=r[14],E=r[15],A=t*s-i*o,S=t*c-a*o,R=t*u-n*o,j=i*c-a*s,P=i*u-n*s,C=a*u-n*c,I=l*x-h*v,F=l*y-p*v,H=l*E-d*v,z=h*y-p*x,G=h*E-d*x,D=p*E-d*y,V=A*D-S*G+R*z+j*H-P*F+C*I;return V?(V=1/V,e[0]=(s*D-c*G+u*z)*V,e[1]=(a*G-i*D-n*z)*V,e[2]=(x*C-y*P+E*j)*V,e[3]=(p*P-h*C-d*j)*V,e[4]=(c*H-o*D-u*F)*V,e[5]=(t*D-a*H+n*F)*V,e[6]=(y*R-v*C-E*S)*V,e[7]=(l*C-p*R+d*S)*V,e[8]=(o*G-s*H+u*I)*V,e[9]=(i*H-t*G-n*I)*V,e[10]=(v*P-x*R+E*A)*V,e[11]=(h*R-l*P-d*A)*V,e[12]=(s*F-o*z-c*I)*V,e[13]=(t*z-i*F+a*I)*V,e[14]=(x*S-v*j-y*A)*V,e[15]=(l*j-h*S+p*A)*V,e):null}function Uj(e){let r=e[0],t=e[1],i=e[2],a=e[3],n=e[4],o=e[5],s=e[6],c=e[7],u=e[8],l=e[9],h=e[10],p=e[11],d=e[12],v=e[13],x=e[14],y=e[15],E=r*o-t*n,A=r*s-i*n,S=t*s-i*o,R=u*v-l*d,j=u*x-h*d,P=l*x-h*v,C=r*P-t*j+i*R,I=n*P-o*j+s*R,F=u*S-l*A+h*E,H=d*S-v*A+x*E;return c*C-a*I+y*F-p*H}function q1(e,r,t){let i=r[0],a=r[1],n=r[2],o=r[3],s=r[4],c=r[5],u=r[6],l=r[7],h=r[8],p=r[9],d=r[10],v=r[11],x=r[12],y=r[13],E=r[14],A=r[15],S=t[0],R=t[1],j=t[2],P=t[3];return e[0]=S*i+R*s+j*h+P*x,e[1]=S*a+R*c+j*p+P*y,e[2]=S*n+R*u+j*d+P*E,e[3]=S*o+R*l+j*v+P*A,S=t[4],R=t[5],j=t[6],P=t[7],e[4]=S*i+R*s+j*h+P*x,e[5]=S*a+R*c+j*p+P*y,e[6]=S*n+R*u+j*d+P*E,e[7]=S*o+R*l+j*v+P*A,S=t[8],R=t[9],j=t[10],P=t[11],e[8]=S*i+R*s+j*h+P*x,e[9]=S*a+R*c+j*p+P*y,e[10]=S*n+R*u+j*d+P*E,e[11]=S*o+R*l+j*v+P*A,S=t[12],R=t[13],j=t[14],P=t[15],e[12]=S*i+R*s+j*h+P*x,e[13]=S*a+R*c+j*p+P*y,e[14]=S*n+R*u+j*d+P*E,e[15]=S*o+R*l+j*v+P*A,e}function Hj(e,r,t){let i=t[0],a=t[1],n=t[2],o,s,c,u,l,h,p,d,v,x,y,E;return r===e?(e[12]=r[0]*i+r[4]*a+r[8]*n+r[12],e[13]=r[1]*i+r[5]*a+r[9]*n+r[13],e[14]=r[2]*i+r[6]*a+r[10]*n+r[14],e[15]=r[3]*i+r[7]*a+r[11]*n+r[15]):(o=r[0],s=r[1],c=r[2],u=r[3],l=r[4],h=r[5],p=r[6],d=r[7],v=r[8],x=r[9],y=r[10],E=r[11],e[0]=o,e[1]=s,e[2]=c,e[3]=u,e[4]=l,e[5]=h,e[6]=p,e[7]=d,e[8]=v,e[9]=x,e[10]=y,e[11]=E,e[12]=o*i+l*a+v*n+r[12],e[13]=s*i+h*a+x*n+r[13],e[14]=c*i+p*a+y*n+r[14],e[15]=u*i+d*a+E*n+r[15]),e}function Vj(e,r,t){let i=t[0],a=t[1],n=t[2];return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=r[3]*i,e[4]=r[4]*a,e[5]=r[5]*a,e[6]=r[6]*a,e[7]=r[7]*a,e[8]=r[8]*n,e[9]=r[9]*n,e[10]=r[10]*n,e[11]=r[11]*n,e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function Gj(e,r,t,i){let a=i[0],n=i[1],o=i[2],s=Math.sqrt(a*a+n*n+o*o),c,u,l,h,p,d,v,x,y,E,A,S,R,j,P,C,I,F,H,z,G,D,V,$;return s<1e-6?null:(s=1/s,a*=s,n*=s,o*=s,u=Math.sin(t),c=Math.cos(t),l=1-c,h=r[0],p=r[1],d=r[2],v=r[3],x=r[4],y=r[5],E=r[6],A=r[7],S=r[8],R=r[9],j=r[10],P=r[11],C=a*a*l+c,I=n*a*l+o*u,F=o*a*l-n*u,H=a*n*l-o*u,z=n*n*l+c,G=o*n*l+a*u,D=a*o*l+n*u,V=n*o*l-a*u,$=o*o*l+c,e[0]=h*C+x*I+S*F,e[1]=p*C+y*I+R*F,e[2]=d*C+E*I+j*F,e[3]=v*C+A*I+P*F,e[4]=h*H+x*z+S*G,e[5]=p*H+y*z+R*G,e[6]=d*H+E*z+j*G,e[7]=v*H+A*z+P*G,e[8]=h*D+x*V+S*$,e[9]=p*D+y*V+R*$,e[10]=d*D+E*V+j*$,e[11]=v*D+A*V+P*$,r!==e&&(e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e)}function Kj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[4],o=r[5],s=r[6],c=r[7],u=r[8],l=r[9],h=r[10],p=r[11];return r!==e&&(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[4]=n*a+u*i,e[5]=o*a+l*i,e[6]=s*a+h*i,e[7]=c*a+p*i,e[8]=u*a-n*i,e[9]=l*a-o*i,e[10]=h*a-s*i,e[11]=p*a-c*i,e}function $j(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[0],o=r[1],s=r[2],c=r[3],u=r[8],l=r[9],h=r[10],p=r[11];return r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=n*a-u*i,e[1]=o*a-l*i,e[2]=s*a-h*i,e[3]=c*a-p*i,e[8]=n*i+u*a,e[9]=o*i+l*a,e[10]=s*i+h*a,e[11]=c*i+p*a,e}function Wj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[0],o=r[1],s=r[2],c=r[3],u=r[4],l=r[5],h=r[6],p=r[7];return r!==e&&(e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=n*a+u*i,e[1]=o*a+l*i,e[2]=s*a+h*i,e[3]=c*a+p*i,e[4]=u*a-n*i,e[5]=l*a-o*i,e[6]=h*a-s*i,e[7]=p*a-c*i,e}function Xj(e,r){let t=r[0],i=r[1],a=r[2],n=r[3],o=t+t,s=i+i,c=a+a,u=t*o,l=i*o,h=i*s,p=a*o,d=a*s,v=a*c,x=n*o,y=n*s,E=n*c;return e[0]=1-h-v,e[1]=l+E,e[2]=p-y,e[3]=0,e[4]=l-E,e[5]=1-u-v,e[6]=d+x,e[7]=0,e[8]=p+y,e[9]=d-x,e[10]=1-u-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Yj(e,r,t,i,a,n,o){let s=1/(t-r),c=1/(a-i),u=1/(n-o);return e[0]=n*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n*2*c,e[6]=0,e[7]=0,e[8]=(t+r)*s,e[9]=(a+i)*c,e[10]=(o+n)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*n*2*u,e[15]=0,e}function tK(e,r,t,i,a){let n=1/Math.tan(r/2);if(e[0]=n/t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let o=1/(i-a);e[10]=(a+i)*o,e[14]=2*a*i*o}else e[10]=-1,e[14]=-2*i;return e}var Qj=tK;function aK(e,r,t,i,a,n,o){let s=1/(r-t),c=1/(i-a),u=1/(n-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(r+t)*s,e[13]=(a+i)*c,e[14]=(o+n)*u,e[15]=1,e}var Jj=aK;function Zj(e,r,t,i){let a,n,o,s,c,u,l,h,p,d,v=r[0],x=r[1],y=r[2],E=i[0],A=i[1],S=i[2],R=t[0],j=t[1],P=t[2];return Math.abs(v-R)<1e-6&&Math.abs(x-j)<1e-6&&Math.abs(y-P)<1e-6?rK(e):(h=v-R,p=x-j,d=y-P,a=1/Math.sqrt(h*h+p*p+d*d),h*=a,p*=a,d*=a,n=A*d-S*p,o=S*h-E*d,s=E*p-A*h,a=Math.sqrt(n*n+o*o+s*s),a?(a=1/a,n*=a,o*=a,s*=a):(n=0,o=0,s=0),c=p*s-d*o,u=d*n-h*s,l=h*o-p*n,a=Math.sqrt(c*c+u*u+l*l),a?(a=1/a,c*=a,u*=a,l*=a):(c=0,u=0,l=0),e[0]=n,e[1]=c,e[2]=h,e[3]=0,e[4]=o,e[5]=u,e[6]=p,e[7]=0,e[8]=s,e[9]=l,e[10]=d,e[11]=0,e[12]=-(n*v+o*x+s*y),e[13]=-(c*v+u*x+l*y),e[14]=-(h*v+p*x+d*y),e[15]=1,e)}function nK(){let e=new ji(4);return ji!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function eT(e,r,t){let i=r[0],a=r[1],n=r[2],o=r[3];return e[0]=t[0]*i+t[4]*a+t[8]*n+t[12]*o,e[1]=t[1]*i+t[5]*a+t[9]*n+t[13]*o,e[2]=t[2]*i+t[6]*a+t[10]*n+t[14]*o,e[3]=t[3]*i+t[7]*a+t[11]*n+t[15]*o,e}var ooe=function(){let e=nK();return function(r,t,i,a,n,o){let s,c;for(t||(t=4),i||(i=0),a?c=Math.min(a*t+i,r.length):c=r.length,s=i;s<c;s+=t)e[0]=r[s],e[1]=r[s+1],e[2]=r[s+2],e[3]=r[s+3],n(e,e,o),r[s]=e[0],r[s+1]=e[1],r[s+2]=e[2],r[s+3]=e[3];return r}}();var U1;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(U1||(U1={}));var sK=45*Math.PI/180,cK=1,z1=.1,N1=500,uK=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),ti=class extends vh{static get IDENTITY(){return fK()}static get ZERO(){return lK()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return U1}constructor(r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(r)?this.copy(r):this.identity()}copy(r){return this[0]=r[0],this[1]=r[1],this[2]=r[2],this[3]=r[3],this[4]=r[4],this[5]=r[5],this[6]=r[6],this[7]=r[7],this[8]=r[8],this[9]=r[9],this[10]=r[10],this[11]=r[11],this[12]=r[12],this[13]=r[13],this[14]=r[14],this[15]=r[15],this.check()}set(r,t,i,a,n,o,s,c,u,l,h,p,d,v,x,y){return this[0]=r,this[1]=t,this[2]=i,this[3]=a,this[4]=n,this[5]=o,this[6]=s,this[7]=c,this[8]=u,this[9]=l,this[10]=h,this[11]=p,this[12]=d,this[13]=v,this[14]=x,this[15]=y,this.check()}setRowMajor(r,t,i,a,n,o,s,c,u,l,h,p,d,v,x,y){return this[0]=r,this[1]=n,this[2]=u,this[3]=d,this[4]=t,this[5]=o,this[6]=l,this[7]=v,this[8]=i,this[9]=s,this[10]=h,this[11]=x,this[12]=a,this[13]=c,this[14]=p,this[15]=y,this.check()}toRowMajor(r){return r[0]=this[0],r[1]=this[4],r[2]=this[8],r[3]=this[12],r[4]=this[1],r[5]=this[5],r[6]=this[9],r[7]=this[13],r[8]=this[2],r[9]=this[6],r[10]=this[10],r[11]=this[14],r[12]=this[3],r[13]=this[7],r[14]=this[11],r[15]=this[15],r}identity(){return this.copy(uK)}fromObject(r){return this.check()}fromQuaternion(r){return Xj(this,r),this.check()}frustum(r){let{left:t,right:i,bottom:a,top:n,near:o=z1,far:s=N1}=r;return s===1/0?pK(this,t,i,a,n,o):Yj(this,t,i,a,n,o,s),this.check()}lookAt(r){let{eye:t,center:i=[0,0,0],up:a=[0,1,0]}=r;return Zj(this,t,i,a),this.check()}ortho(r){let{left:t,right:i,bottom:a,top:n,near:o=z1,far:s=N1}=r;return Jj(this,t,i,a,n,o,s),this.check()}orthographic(r){let{fovy:t=sK,aspect:i=cK,focalDistance:a=1,near:n=z1,far:o=N1}=r;rT(t);let s=t/2,c=a*Math.tan(s),u=c*i;return this.ortho({left:-u,right:u,bottom:-c,top:c,near:n,far:o})}perspective(r){let{fovy:t=45*Math.PI/180,aspect:i=1,near:a=.1,far:n=500}=r;return rT(t),Qj(this,t,i,a,n),this.check()}determinant(){return Uj(this)}getScale(r=[-0,-0,-0]){return r[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),r[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),r[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),r}getTranslation(r=[-0,-0,-0]){return r[0]=this[12],r[1]=this[13],r[2]=this[14],r}getRotation(r,t){r=r||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];let i=this.getScale(t),a=1/i[0],n=1/i[1],o=1/i[2];return r[0]=this[0]*a,r[1]=this[1]*n,r[2]=this[2]*o,r[3]=0,r[4]=this[4]*a,r[5]=this[5]*n,r[6]=this[6]*o,r[7]=0,r[8]=this[8]*a,r[9]=this[9]*n,r[10]=this[10]*o,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}getRotationMatrix3(r,t){r=r||[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];let i=this.getScale(t),a=1/i[0],n=1/i[1],o=1/i[2];return r[0]=this[0]*a,r[1]=this[1]*n,r[2]=this[2]*o,r[3]=this[4]*a,r[4]=this[5]*n,r[5]=this[6]*o,r[6]=this[8]*a,r[7]=this[9]*n,r[8]=this[10]*o,r}transpose(){return zj(this,this),this.check()}invert(){return Nj(this,this),this.check()}multiplyLeft(r){return q1(this,r,this),this.check()}multiplyRight(r){return q1(this,this,r),this.check()}rotateX(r){return Kj(this,this,r),this.check()}rotateY(r){return $j(this,this,r),this.check()}rotateZ(r){return Wj(this,this,r),this.check()}rotateXYZ(r){return this.rotateX(r[0]).rotateY(r[1]).rotateZ(r[2])}rotateAxis(r,t){return Gj(this,this,r,t),this.check()}scale(r){return Vj(this,this,Array.isArray(r)?r:[r,r,r]),this.check()}translate(r){return Hj(this,this,r),this.check()}transform(r,t){return r.length===4?(t=eT(t||[-0,-0,-0,-0],r,this),hh(t,4),t):this.transformAsPoint(r,t)}transformAsPoint(r,t){let{length:i}=r,a;switch(i){case 2:a=Rj(t||[-0,-0],r,this);break;case 3:a=sl(t||[-0,-0,-0],r,this);break;default:throw new Error("Illegal vector")}return hh(a,r.length),a}transformAsVector(r,t){let i;switch(r.length){case 2:i=Pj(t||[-0,-0],r,this);break;case 3:i=mh(t||[-0,-0,-0],r,this);break;default:throw new Error("Illegal vector")}return hh(i,r.length),i}transformPoint(r,t){return this.transformAsPoint(r,t)}transformVector(r,t){return this.transformAsPoint(r,t)}transformDirection(r,t){return this.transformAsVector(r,t)}makeRotationX(r){return this.identity().rotateX(r)}makeTranslation(r,t,i){return this.identity().translate([r,t,i])}},yh,bh;function lK(){return yh||(yh=new ti([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(yh)),yh}function fK(){return bh||(bh=new ti,Object.freeze(bh)),bh}function rT(e){if(e>Math.PI*2)throw Error("expected radians")}function pK(e,r,t,i,a,n){let o=2*n/(t-r),s=2*n/(a-i),c=(t+r)/(t-r),u=(a+i)/(a-i),l=-1,h=-1,p=-2*n;return e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=c,e[9]=u,e[10]=l,e[11]=h,e[12]=0,e[13]=0,e[14]=p,e[15]=0,e}var ls={};yl(ls,{EPSILON1:()=>hK,EPSILON10:()=>wK,EPSILON11:()=>kK,EPSILON12:()=>SK,EPSILON13:()=>EK,EPSILON14:()=>AK,EPSILON15:()=>jK,EPSILON16:()=>TK,EPSILON17:()=>RK,EPSILON18:()=>PK,EPSILON19:()=>OK,EPSILON2:()=>dK,EPSILON20:()=>CK,EPSILON3:()=>mK,EPSILON4:()=>gK,EPSILON5:()=>vK,EPSILON6:()=>yK,EPSILON7:()=>bK,EPSILON8:()=>xK,EPSILON9:()=>_K,PI_OVER_FOUR:()=>FK,PI_OVER_SIX:()=>IK,PI_OVER_TWO:()=>BK,TWO_PI:()=>MK});var hK=.1,dK=.01,mK=.001,gK=1e-4,vK=1e-5,yK=1e-6,bK=1e-7,xK=1e-8,_K=1e-9,wK=1e-10,kK=1e-11,SK=1e-12,EK=1e-13,AK=1e-14,jK=1e-15,TK=1e-16,RK=1e-17,PK=1e-18,OK=1e-19,CK=1e-20,BK=Math.PI/2,FK=Math.PI/4,IK=Math.PI/6,MK=Math.PI*2;var Dn=6356752314245179e-9,LK={radii:[6378137,6378137,Dn],radiiSquared:[6378137*6378137,6378137*6378137,Dn*Dn],oneOverRadii:[1/6378137,1/6378137,1/Dn],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Dn*Dn)],maximumRadius:Math.max(6378137,6378137,Dn),centerToleranceSquared:.1};function xh(e){return e}var Loe=new xr;function DK(e,r=[],t=xh){return"longitude"in e?(r[0]=t(e.longitude),r[1]=t(e.latitude),r[2]=e.height):"x"in e?(r[0]=t(e.x),r[1]=t(e.y),r[2]=e.z):(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]),r}function tT(e,r=[]){return DK(e,r,gt._cartographicRadians?xh:j1)}function qK(e,r,t=xh){return"longitude"in r?(r.longitude=t(e[0]),r.latitude=t(e[1]),r.height=e[2]):"x"in r?(r.x=t(e[0]),r.y=t(e[1]),r.z=e[2]):(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]),r}function aT(e,r){return qK(e,r,gt._cartographicRadians?xh:T1)}var iT=1e-14,zK=new xr,nT={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},H1={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},ul={east:new xr,north:new xr,up:new xr,west:new xr,south:new xr,down:new xr},NK=new xr,UK=new xr,HK=new xr;function V1(e,r,t,i,a,n){let o=nT[r]&&nT[r][t];ri(o&&(!i||i===o));let s,c,u,l=zK.copy(a);if(Mn(l.x,0,iT)&&Mn(l.y,0,iT)){let p=Math.sign(l.z);s=NK.fromArray(H1[r]),r!=="east"&&r!=="west"&&s.scale(p),c=UK.fromArray(H1[t]),t!=="east"&&t!=="west"&&c.scale(p),u=HK.fromArray(H1[i]),i!=="east"&&i!=="west"&&u.scale(p)}else{let{up:p,east:d,north:v}=ul;d.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,p),v.copy(p).cross(d);let{down:x,west:y,south:E}=ul;x.copy(p).scale(-1),y.copy(d).scale(-1),E.copy(v).scale(-1),s=ul[r],c=ul[t],u=ul[i]}return n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=c.x,n[5]=c.y,n[6]=c.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=l.x,n[13]=l.y,n[14]=l.z,n[15]=1,n}var yc=new xr,VK=new xr,GK=new xr;function oT(e,r,t=[]){let{oneOverRadii:i,oneOverRadiiSquared:a,centerToleranceSquared:n}=r;yc.from(e);let o=yc.x,s=yc.y,c=yc.z,u=i.x,l=i.y,h=i.z,p=o*o*u*u,d=s*s*l*l,v=c*c*h*h,x=p+d+v,y=Math.sqrt(1/x);if(!Number.isFinite(y))return;let E=VK;if(E.copy(e).scale(y),x<n)return E.to(t);let A=a.x,S=a.y,R=a.z,j=GK;j.set(E.x*A*2,E.y*S*2,E.z*R*2);let P=(1-y)*yc.len()/(.5*j.len()),C=0,I,F,H,z;do{P-=C,I=1/(1+P*A),F=1/(1+P*S),H=1/(1+P*R);let G=I*I,D=F*F,V=H*H,$=G*I,ge=D*F,le=V*H;z=p*G+d*D+v*V-1;let de=-2*(p*$*A+d*ge*S+v*le*R);C=z/de}while(Math.abs(z)>ls.EPSILON12);return yc.scale([I,F,H]).to(t)}var _h=new xr,sT=new xr,WK=new xr,Ti=new xr,XK=new xr,wh=new xr,qn=class{constructor(r=0,t=0,i=0){this.centerToleranceSquared=ls.EPSILON1,ri(r>=0),ri(t>=0),ri(i>=0),this.radii=new xr(r,t,i),this.radiiSquared=new xr(r*r,t*t,i*i),this.radiiToTheFourth=new xr(r*r*r*r,t*t*t*t,i*i*i*i),this.oneOverRadii=new xr(r===0?0:1/r,t===0?0:1/t,i===0?0:1/i),this.oneOverRadiiSquared=new xr(r===0?0:1/(r*r),t===0?0:1/(t*t),i===0?0:1/(i*i)),this.minimumRadius=Math.min(r,t,i),this.maximumRadius=Math.max(r,t,i),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(r){return this===r||Boolean(r&&this.radii.equals(r.radii))}toString(){return this.radii.toString()}cartographicToCartesian(r,t=[0,0,0]){let i=sT,a=WK,[,,n]=r;this.geodeticSurfaceNormalCartographic(r,i),a.copy(this.radiiSquared).scale(i);let o=Math.sqrt(i.dot(a));return a.scale(1/o),i.scale(n),a.add(i),a.to(t)}cartesianToCartographic(r,t=[0,0,0]){wh.from(r);let i=this.scaleToGeodeticSurface(wh,Ti);if(!i)return;let a=this.geodeticSurfaceNormal(i,sT),n=XK;n.copy(wh).subtract(i);let o=Math.atan2(a.y,a.x),s=Math.asin(a.z),c=Math.sign(cl.dot(n,wh))*cl.length(n);return aT([o,s,c],t)}eastNorthUpToFixedFrame(r,t=new ti){return V1(this,"east","north","up",r,t)}localFrameToFixedFrame(r,t,i,a,n=new ti){return V1(this,r,t,i,a,n)}geocentricSurfaceNormal(r,t=[0,0,0]){return _h.from(r).normalize().to(t)}geodeticSurfaceNormalCartographic(r,t=[0,0,0]){let i=tT(r),a=i[0],n=i[1],o=Math.cos(n);return _h.set(o*Math.cos(a),o*Math.sin(a),Math.sin(n)).normalize(),_h.to(t)}geodeticSurfaceNormal(r,t=[0,0,0]){return _h.from(r).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(r,t){return oT(r,this,t)}scaleToGeocentricSurface(r,t=[0,0,0]){Ti.from(r);let i=Ti.x,a=Ti.y,n=Ti.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(i*i*o.x+a*a*o.y+n*n*o.z);return Ti.multiplyScalar(s).to(t)}transformPositionToScaledSpace(r,t=[0,0,0]){return Ti.from(r).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(r,t=[0,0,0]){return Ti.from(r).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(r,t=0,i=[0,0,0]){ri(Mn(this.radii.x,this.radii.y,ls.EPSILON15)),ri(this.radii.z>0),Ti.from(r);let a=Ti.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(a)>=this.radii.z-t))return Ti.set(0,0,a).to(i)}};qn.WGS84=new qn(6378137,6378137,Dn);var cT="4.4.0-alpha.1";var uT,YK=(uT=globalThis.loaders)==null?void 0:uT.parseImageNode,G1=typeof Image<"u",K1=typeof ImageBitmap<"u",QK=Boolean(YK),$1=No?!0:QK;function lT(e){switch(e){case"auto":return K1||G1||$1;case"imagebitmap":return K1;case"image":return G1;case"data":return $1;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function fT(){if(K1)return"imagebitmap";if(G1)return"image";if($1)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function JK(e){let r=ZK(e);if(!r)throw new Error("Not an image");return r}function pT(e){switch(JK(e)){case"data":return e;case"image":case"imagebitmap":let r=document.createElement("canvas"),t=r.getContext("2d");if(!t)throw new Error("getImageData");return r.width=e.width,r.height=e.height,t.drawImage(e,0,0),t.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function ZK(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var e$=/^data:image\/svg\+xml/,r$=/\.svg((\?|#).*)?$/;function kh(e){return e&&(e$.test(e)||r$.test(e))}function hT(e,r){if(kh(r)){let i=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(i=unescape(encodeURIComponent(i)))}catch(n){throw new Error(n.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return W1(e,r)}function W1(e,r){if(kh(r))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function Sh(e,r,t){let i=hT(e,t),a=self.URL||self.webkitURL,n=typeof i!="string"&&a.createObjectURL(i);try{return await t$(n||i,r)}finally{n&&a.revokeObjectURL(n)}}async function t$(e,r){let t=new Image;return t.src=e,r.image&&r.image.decode&&t.decode?(await t.decode(),t):await new Promise((i,a)=>{try{t.onload=()=>i(t),t.onerror=n=>{let o=n instanceof Error?n.message:"error";a(new Error(o))}}catch(n){a(n)}})}var a$={},dT=!0;async function mT(e,r,t){let i;kh(t)?i=await Sh(e,r,t):i=W1(e,t);let a=r&&r.imagebitmap;return await i$(i,a)}async function i$(e,r=null){if((n$(r)||!dT)&&(r=null),r)try{return await createImageBitmap(e,r)}catch(t){console.warn(t),dT=!1}return await createImageBitmap(e)}function n$(e){for(let r in e||a$)return!1;return!0}function gT(e){return!u$(e,"ftyp",4)||!(e[8]&96)?null:o$(e)}function o$(e){switch(s$(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function s$(e,r,t){return String.fromCharCode(...e.slice(r,t))}function c$(e){return[...e].map(r=>r.charCodeAt(0))}function u$(e,r,t=0){let i=c$(r);for(let a=0;a<i.length;++a)if(i[a]!==e[a+t])return!1;return!0}var nn=!1,ll=!0;function Eh(e){let r=fl(e);return f$(r)||d$(r)||p$(r)||h$(r)||l$(r)}function l$(e){let r=new Uint8Array(e instanceof DataView?e.buffer:e),t=gT(r);return t?{mimeType:t.mimeType,width:0,height:0}:null}function f$(e){let r=fl(e);return r.byteLength>=24&&r.getUint32(0,nn)===2303741511?{mimeType:"image/png",width:r.getUint32(16,nn),height:r.getUint32(20,nn)}:null}function p$(e){let r=fl(e);return r.byteLength>=10&&r.getUint32(0,nn)===1195984440?{mimeType:"image/gif",width:r.getUint16(6,ll),height:r.getUint16(8,ll)}:null}function h$(e){let r=fl(e);return r.byteLength>=14&&r.getUint16(0,nn)===16973&&r.getUint32(2,ll)===r.byteLength?{mimeType:"image/bmp",width:r.getUint32(18,ll),height:r.getUint32(22,ll)}:null}function d$(e){let r=fl(e);if(!(r.byteLength>=3&&r.getUint16(0,nn)===65496&&r.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:a}=m$(),n=2;for(;n+9<r.byteLength;){let o=r.getUint16(n,nn);if(a.has(o))return{mimeType:"image/jpeg",height:r.getUint16(n+5,nn),width:r.getUint16(n+7,nn)};if(!i.has(o))return null;n+=2,n+=r.getUint16(n,nn)}return null}function m$(){let e=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)e.add(t);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function fl(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}async function vT(e,r){var a;let{mimeType:t}=Eh(e)||{},i=(a=globalThis.loaders)==null?void 0:a.parseImageNode;return ki(i),await i(e,t)}async function yT(e,r,t){r=r||{};let a=(r.image||{}).type||"auto",{url:n}=t||{},o=g$(a),s;switch(o){case"imagebitmap":s=await mT(e,r,n);break;case"image":s=await Sh(e,r,n);break;case"data":s=await vT(e,r);break;default:ki(!1)}return a==="data"&&(s=pT(s)),s}function g$(e){switch(e){case"auto":case"data":return fT();default:return lT(e),e}}var v$=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],y$=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],b$={image:{type:"auto",decode:!0}},Ah={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:cT,mimeTypes:y$,extensions:v$,parse:yT,tests:[e=>Boolean(Eh(new DataView(e)))],options:b$};var x$="1.5.6",_$="1.4.1",X1=`https://www.gstatic.com/draco/versioned/decoders/${x$}`,Sa={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},Y1={[Sa.DECODER]:`${X1}/${Sa.DECODER}`,[Sa.DECODER_WASM]:`${X1}/${Sa.DECODER_WASM}`,[Sa.FALLBACK_DECODER]:`${X1}/${Sa.FALLBACK_DECODER}`,[Sa.ENCODER]:`https://raw.githubusercontent.com/google/draco/${_$}/javascript/${Sa.ENCODER}`},Q1;async function bT(e){let r=e.modules||{};return r.draco3d?Q1||=r.draco3d.createDecoderModule({}).then(t=>({draco:t})):Q1||=w$(e),await Q1}async function w$(e){let r,t;switch(e.draco&&e.draco.decoderType){case"js":r=await Qi(Y1[Sa.FALLBACK_DECODER],"draco",e,Sa.FALLBACK_DECODER);break;case"wasm":default:[r,t]=await Promise.all([await Qi(Y1[Sa.DECODER],"draco",e,Sa.DECODER),await Qi(Y1[Sa.DECODER_WASM],"draco",e,Sa.DECODER_WASM)])}return r=r||globalThis.DracoDecoderModule,await k$(r,t)}function k$(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e({...t,onModuleLoaded:a=>i({draco:a})})})}var xT="4.4.0-alpha.1";function wT(e,r,t){let i=kT(r.metadata),a=[],n=S$(r.attributes);for(let o in e){let s=e[o],c=_T(o,s,n[o]);a.push(c)}if(t){let o=_T("indices",t);a.push(o)}return{fields:a,metadata:i}}function S$(e){let r={};for(let t in e){let i=e[t];r[i.name||"undefined"]=i}return r}function _T(e,r,t){let i=t?kT(t.metadata):void 0;return S1(e,r,i)}function kT(e){Object.entries(e);let r={};for(let t in e)r[`${t}.string`]=JSON.stringify(e[t]);return r}var ST={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},E$={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},A$=4,pl=class{draco;decoder;metadataQuerier;constructor(r){this.draco=r,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(r,t={}){let i=new this.draco.DecoderBuffer;i.Init(new Int8Array(r),r.byteLength),this._disableAttributeTransforms(t);let a=this.decoder.GetEncodedGeometryType(i),n=a===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(a){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,n);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,n);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!n.ptr){let p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}let s=this._getDracoLoaderData(n,a,t),c=this._getMeshData(n,s,t),u=k1(c.attributes),l=wT(c.attributes,s,c.indices);return{loader:"draco",loaderData:s,header:{vertexCount:n.num_points(),boundingBox:u},...c,schema:l}}finally{this.draco.destroy(i),n&&this.draco.destroy(n)}}_getDracoLoaderData(r,t,i){let a=this._getTopLevelMetadata(r),n=this._getDracoAttributes(r,i);return{geometry_type:t,num_attributes:r.num_attributes(),num_points:r.num_points(),num_faces:r instanceof this.draco.Mesh?r.num_faces():0,metadata:a,attributes:n}}_getDracoAttributes(r,t){let i={};for(let a=0;a<r.num_attributes();a++){let n=this.decoder.GetAttribute(r,a),o=this._getAttributeMetadata(r,a);i[n.unique_id()]={unique_id:n.unique_id(),attribute_type:n.attribute_type(),data_type:n.data_type(),num_components:n.num_components(),byte_offset:n.byte_offset(),byte_stride:n.byte_stride(),normalized:n.normalized(),attribute_index:a,metadata:o};let s=this._getQuantizationTransform(n,t);s&&(i[n.unique_id()].quantization_transform=s);let c=this._getOctahedronTransform(n,t);c&&(i[n.unique_id()].octahedron_transform=c)}return i}_getMeshData(r,t,i){let a=this._getMeshAttributes(t,r,i);if(!a.POSITION)throw new Error("DRACO: No position attribute found.");if(r instanceof this.draco.Mesh)switch(i.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:a,indices:{value:this._getTriangleStripIndices(r),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:a,indices:{value:this._getTriangleListIndices(r),size:1}}}return{topology:"point-list",mode:0,attributes:a}}_getMeshAttributes(r,t,i){let a={};for(let n of Object.values(r.attributes)){let o=this._deduceAttributeName(n,i);n.name=o;let s=this._getAttributeValues(t,n);if(s){let{value:c,size:u}=s;a[o]={value:c,size:u,byteOffset:n.byte_offset,byteStride:n.byte_stride,normalized:n.normalized}}}return a}_getTriangleListIndices(r){let i=r.num_faces()*3,a=i*A$,n=this.draco._malloc(a);try{return this.decoder.GetTrianglesUInt32Array(r,a,n),new Uint32Array(this.draco.HEAPF32.buffer,n,i).slice()}finally{this.draco._free(n)}}_getTriangleStripIndices(r){let t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(r,t),R$(t)}finally{this.draco.destroy(t)}}_getAttributeValues(r,t){let i=E$[t.data_type];if(!i)return console.warn(`DRACO: Unsupported attribute type ${t.data_type}`),null;let a=t.num_components,o=r.num_points()*a,s=o*i.BYTES_PER_ELEMENT,c=j$(this.draco,i),u,l=this.draco._malloc(s);try{let h=this.decoder.GetAttribute(r,t.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(r,h,c,s,l),u=new i(this.draco.HEAPF32.buffer,l,o).slice()}finally{this.draco._free(l)}return{value:u,size:a}}_deduceAttributeName(r,t){let i=r.unique_id;for(let[o,s]of Object.entries(t.extraAttributes||{}))if(s===i)return o;let a=r.attribute_type;for(let o in ST)if(this.draco[o]===a)return ST[o];let n=t.attributeNameEntry||"name";return r.metadata[n]?r.metadata[n].string:`CUSTOM_ATTRIBUTE_${i}`}_getTopLevelMetadata(r){let t=this.decoder.GetMetadata(r);return this._getDracoMetadata(t)}_getAttributeMetadata(r,t){let i=this.decoder.GetAttributeMetadata(r,t);return this._getDracoMetadata(i)}_getDracoMetadata(r){if(!r||!r.ptr)return{};let t={},i=this.metadataQuerier.NumEntries(r);for(let a=0;a<i;a++){let n=this.metadataQuerier.GetEntryName(r,a);t[n]=this._getDracoMetadataField(r,n)}return t}_getDracoMetadataField(r,t){let i=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(r,t,i);let a=T$(i);return{int:this.metadataQuerier.GetIntEntry(r,t),string:this.metadataQuerier.GetStringEntry(r,t),double:this.metadataQuerier.GetDoubleEntry(r,t),intArray:a}}finally{this.draco.destroy(i)}}_disableAttributeTransforms(r){let{quantizedAttributes:t=[],octahedronAttributes:i=[]}=r,a=[...t,...i];for(let n of a)this.decoder.SkipAttributeTransform(this.draco[n])}_getQuantizationTransform(r,t){let{quantizedAttributes:i=[]}=t,a=r.attribute_type();if(i.map(o=>this.decoder[o]).includes(a)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(r))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map(s=>o.min_value(s))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(r,t){let{octahedronAttributes:i=[]}=t,a=r.attribute_type();if(i.map(o=>this.decoder[o]).includes(a)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(r))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}};function j$(e,r){switch(r){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}function T$(e){let r=e.size(),t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=e.GetValue(i);return t}function R$(e){let r=e.size(),t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=e.GetValue(i);return t}var ET={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:xT,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}},J1={...ET,parse:P$};async function P$(e,r){let{draco:t}=await bT(r),i=new pl(t);try{return i.parseSync(e,r==null?void 0:r.draco)}finally{i.destroy()}}var jh="4.4.0-alpha.1";var Th={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},AT;async function ey(e){Jg(e.modules);let r=Zg("basis");return r||(AT||=O$(e),await AT)}async function O$(e){let r=null,t=null;return[r,t]=await Promise.all([await Qi(Th.TRANSCODER,"textures",e),await Qi(Th.TRANSCODER_WASM,"textures",e)]),r=r||globalThis.BASIS,await C$(r,t)}function C$(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e(t).then(a=>{let{BasisFile:n,initializeBasis:o}=a;o(),i({BasisFile:n})})})}var Z1;async function ry(e){let r=e.modules||{};return r.basisEncoder?r.basisEncoder:(Z1=Z1||B$(e),await Z1)}async function B$(e){let r=null,t=null;return[r,t]=await Promise.all([await Qi(Th.ENCODER,"textures",e),await Qi(Th.ENCODER_WASM,"textures",e)]),r=r||globalThis.BASIS,await F$(r,t)}function F$(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e(t).then(a=>{let{BasisFile:n,KTX2File:o,initializeBasis:s,BasisEncoder:c}=a;s(),i({BasisFile:n,KTX2File:o,BasisEncoder:c})})})}var re={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};var I$=["","WEBKIT_","MOZ_"],jT={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},Rh=null;function TT(e){if(!Rh){e=e||M$()||void 0,Rh=new Set;for(let r of I$)for(let t in jT)if(e&&e.getExtension(`${r}${t}`)){let i=jT[t];Rh.add(i)}}return Rh}function M$(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var ty=class{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}},fs=class{constructor(r,t,i,a){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(r.buffer,r.byteOffset+t,i),this._littleEndian=a,this._offset=0}_nextUint8(){let r=this._dataView.getUint8(this._offset);return this._offset+=1,r}_nextUint16(){let r=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,r}_nextUint32(){let r=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,r}_nextUint64(){let r=this._dataView.getUint32(this._offset,this._littleEndian),t=this._dataView.getUint32(this._offset+4,this._littleEndian),i=r+2**32*t;return this._offset+=8,i}_nextInt32(){let r=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,r}_nextUint8Array(r){let t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,r);return this._offset+=r,t}_skip(r){return this._offset+=r,this}_scan(r,t=0){let i=this._offset,a=0;for(;this._dataView.getUint8(this._offset)!==t&&a<r;)a++,this._offset++;return a<r&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+i,a)}};var Wse=new Uint8Array([0]),ha=[171,75,84,88,32,50,48,187,13,10,26,10];function RT(e){return new TextDecoder().decode(e)}function PT(e){let r=new Uint8Array(e.buffer,e.byteOffset,ha.length);if(r[0]!==ha[0]||r[1]!==ha[1]||r[2]!==ha[2]||r[3]!==ha[3]||r[4]!==ha[4]||r[5]!==ha[5]||r[6]!==ha[6]||r[7]!==ha[7]||r[8]!==ha[8]||r[9]!==ha[9]||r[10]!==ha[10]||r[11]!==ha[11])throw new Error("Missing KTX 2.0 identifier.");let t=new ty,i=17*Uint32Array.BYTES_PER_ELEMENT,a=new fs(e,ha.length,i,!0);t.vkFormat=a._nextUint32(),t.typeSize=a._nextUint32(),t.pixelWidth=a._nextUint32(),t.pixelHeight=a._nextUint32(),t.pixelDepth=a._nextUint32(),t.layerCount=a._nextUint32(),t.faceCount=a._nextUint32();let n=a._nextUint32();t.supercompressionScheme=a._nextUint32();let o=a._nextUint32(),s=a._nextUint32(),c=a._nextUint32(),u=a._nextUint32(),l=a._nextUint64(),h=a._nextUint64(),p=n*3*8,d=new fs(e,ha.length+i,p,!0);for(let ie=0;ie<n;ie++)t.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});let v=new fs(e,o,s,!0),x={vendorId:v._skip(4)._nextUint16(),descriptorType:v._nextUint16(),versionNumber:v._nextUint16(),descriptorBlockSize:v._nextUint16(),colorModel:v._nextUint8(),colorPrimaries:v._nextUint8(),transferFunction:v._nextUint8(),flags:v._nextUint8(),texelBlockDimension:[v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8()],bytesPlane:[v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8()],samples:[]},y=6,E=4,A=(x.descriptorBlockSize/4-y)/E;for(let ie=0;ie<A;ie++){let we={bitOffset:v._nextUint16(),bitLength:v._nextUint8(),channelType:v._nextUint8(),samplePosition:[v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};we.channelType&64?(we.sampleLower=v._nextInt32(),we.sampleUpper=v._nextInt32()):(we.sampleLower=v._nextUint32(),we.sampleUpper=v._nextUint32()),x.samples[ie]=we}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(x);let S=new fs(e,c,u,!0);for(;S._offset<u;){let ie=S._nextUint32(),we=S._scan(ie),Te=RT(we);if(t.keyValue[Te]=S._nextUint8Array(ie-we.byteLength-1),Te.match(/^ktx/i)){let U=RT(t.keyValue[Te]);t.keyValue[Te]=U.substring(0,U.lastIndexOf("\0"))}let Se=ie%4?4-ie%4:0;S._skip(Se)}if(h<=0)return t;let R=new fs(e,l,h,!0),j=R._nextUint16(),P=R._nextUint16(),C=R._nextUint32(),I=R._nextUint32(),F=R._nextUint32(),H=R._nextUint32(),z=[];for(let ie=0;ie<n;ie++)z.push({imageFlags:R._nextUint32(),rgbSliceByteOffset:R._nextUint32(),rgbSliceByteLength:R._nextUint32(),alphaSliceByteOffset:R._nextUint32(),alphaSliceByteLength:R._nextUint32()});let G=l+R._offset,D=G+C,V=D+I,$=V+F,ge=new Uint8Array(e.buffer,e.byteOffset+G,C),le=new Uint8Array(e.buffer,e.byteOffset+D,I),oe=new Uint8Array(e.buffer,e.byteOffset+V,F),de=new Uint8Array(e.buffer,e.byteOffset+$,H);return t.globalData={endpointCount:j,selectorCount:P,imageDescs:z,endpointsData:ge,selectorsData:le,tablesData:oe,extendedData:de},t}function bc(e,r){let t=new Array(r.mipMapLevels),i=r.width,a=r.height,n=0;for(let o=0;o<r.mipMapLevels;++o){let s=D$(r,i,a,e,o),c=L$(e,o,n,s);t[o]={compressed:!0,format:r.internalFormat,data:c,width:i,height:a,levelSize:s},i=Math.max(1,i>>1),a=Math.max(1,a>>1),n+=s}return t}function L$(e,r,t,i){return Array.isArray(e)?e[r].levelData:new Uint8Array(e.buffer,e.byteOffset+t,i)}function D$(e,r,t,i,a){return Array.isArray(i)?e.sizeFunction(i[a]):e.sizeFunction(r,t)}var q$={131:re.COMPRESSED_RGB_S3TC_DXT1_EXT,132:re.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:re.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:re.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:re.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:re.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:re.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:re.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:re.COMPRESSED_RED_RGTC1_EXT,140:re.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:re.COMPRESSED_RED_GREEN_RGTC2_EXT,142:re.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:re.COMPRESSED_RGB8_ETC2,148:re.COMPRESSED_SRGB8_ETC2,149:re.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:re.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:re.COMPRESSED_RGBA8_ETC2_EAC,152:re.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:re.COMPRESSED_R11_EAC,154:re.COMPRESSED_SIGNED_R11_EAC,155:re.COMPRESSED_RG11_EAC,156:re.COMPRESSED_SIGNED_RG11_EAC,157:re.COMPRESSED_RGBA_ASTC_4x4_KHR,158:re.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:re.COMPRESSED_RGBA_ASTC_5x4_KHR,160:re.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:re.COMPRESSED_RGBA_ASTC_5x5_KHR,162:re.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:re.COMPRESSED_RGBA_ASTC_6x5_KHR,164:re.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:re.COMPRESSED_RGBA_ASTC_6x6_KHR,166:re.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:re.COMPRESSED_RGBA_ASTC_8x5_KHR,168:re.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:re.COMPRESSED_RGBA_ASTC_8x6_KHR,170:re.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:re.COMPRESSED_RGBA_ASTC_8x8_KHR,172:re.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:re.COMPRESSED_RGBA_ASTC_10x5_KHR,174:re.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:re.COMPRESSED_RGBA_ASTC_10x6_KHR,176:re.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:re.COMPRESSED_RGBA_ASTC_10x8_KHR,178:re.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:re.COMPRESSED_RGBA_ASTC_10x10_KHR,180:re.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:re.COMPRESSED_RGBA_ASTC_12x10_KHR,182:re.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:re.COMPRESSED_RGBA_ASTC_12x12_KHR,184:re.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:re.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:re.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:re.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:re.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:re.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:re.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:re.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:re.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:re.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:re.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:re.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:re.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:re.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:re.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:re.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:re.COMPRESSED_RGBA_ASTC_12x12_KHR};function OT(e){return q$[e]}var Ba=[171,75,84,88,32,50,48,187,13,10,26,10];function Ph(e){let r=new Uint8Array(e);return!(r.byteLength<Ba.length||r[0]!==Ba[0]||r[1]!==Ba[1]||r[2]!==Ba[2]||r[3]!==Ba[3]||r[4]!==Ba[4]||r[5]!==Ba[5]||r[6]!==Ba[6]||r[7]!==Ba[7]||r[8]!==Ba[8]||r[9]!==Ba[9]||r[10]!==Ba[10]||r[11]!==Ba[11])}function CT(e){let r=new Uint8Array(e),t=PT(r),i=Math.max(1,t.levels.length),a=t.pixelWidth,n=t.pixelHeight,o=OT(t.vkFormat);return bc(t.levels,{mipMapLevels:i,width:a,height:n,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var z$={etc1:{basisFormat:0,compressed:!0,format:re.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:re.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:re.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:re.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:re.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:re.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function Oh(e,r){if(r.basis.containerFormat==="auto"){if(Ph(e)){let i=await ry(r);return BT(i.KTX2File,e,r)}let{BasisFile:t}=await ey(r);return ay(t,e,r)}switch(r.basis.module){case"encoder":let t=await ry(r);switch(r.basis.containerFormat){case"ktx2":return BT(t.KTX2File,e,r);case"basis":default:return ay(t.BasisFile,e,r)}case"transcoder":default:let{BasisFile:i}=await ey(r);return ay(i,e,r)}}function ay(e,r,t){let i=new e(new Uint8Array(r));try{if(!i.startTranscoding())throw new Error("Failed to start basis transcoding");let a=i.getNumImages(),n=[];for(let o=0;o<a;o++){let s=i.getNumLevels(o),c=[];for(let u=0;u<s;u++)c.push(N$(i,o,u,t));n.push(c)}return n}finally{i.close(),i.delete()}}function N$(e,r,t,i){let a=e.getImageWidth(r,t),n=e.getImageHeight(r,t),o=e.getHasAlpha(),{compressed:s,format:c,basisFormat:u}=FT(i,o),l=e.getImageTranscodedSizeInBytes(r,t,u),h=new Uint8Array(l);if(!e.transcodeImage(h,r,t,u,0,0))throw new Error("failed to start Basis transcoding");return{width:a,height:n,data:h,compressed:s,format:c,hasAlpha:o}}function BT(e,r,t){let i=new e(new Uint8Array(r));try{if(!i.startTranscoding())throw new Error("failed to start KTX2 transcoding");let a=i.getLevels(),n=[];for(let o=0;o<a;o++)n.push(U$(i,o,t));return[n]}finally{i.close(),i.delete()}}function U$(e,r,t){let{alphaFlag:i,height:a,width:n}=e.getImageLevelInfo(r,0,0),{compressed:o,format:s,basisFormat:c}=FT(t,i),u=e.getImageTranscodedSizeInBytes(r,0,0,c),l=new Uint8Array(u);if(!e.transcodeImage(l,r,0,0,c,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:n,height:a,data:l,compressed:o,levelSize:u,hasAlpha:i,format:s}}function FT(e,r){let t=e&&e.basis&&e.basis.format;return t==="auto"&&(t=H$()),typeof t=="object"&&(t=r?t.alpha:t.noAlpha),t=t.toLowerCase(),z$[t]}function H$(){let e=TT();return e.has("astc")?"astc-4x4":e.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:e.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:e.has("etc1")?"etc1":e.has("etc2")?"etc2":"rgb565"}var IT={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:jh,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},hl={...IT,parse:Oh};var Fa={MAGIC_NUMBER:542327876,HEADER_LENGTH:31,MAGIC_NUMBER_INDEX:0,HEADER_SIZE_INDEX:1,HEADER_FLAGS_INDEX:2,HEADER_HEIGHT_INDEX:3,HEADER_WIDTH_INDEX:4,MIPMAPCOUNT_INDEX:7,HEADER_PF_FLAGS_INDEX:20,HEADER_PF_FOURCC_INDEX:21,DDSD_MIPMAPCOUNT:131072,DDPF_FOURCC:4},V$={DXT1:re.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:re.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:re.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":re.COMPRESSED_RGB_ATC_WEBGL,ATCA:re.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:re.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},G$=DT,K$=Ch,$$=Ch,W$={DXT1:DT,DXT3:Ch,DXT5:Ch,"ATC ":G$,ATCA:K$,ATCI:$$};function MT(e){return new Uint32Array(e,0,Fa.HEADER_LENGTH)[Fa.MAGIC_NUMBER_INDEX]===Fa.MAGIC_NUMBER}function LT(e){let r=new Int32Array(e,0,Fa.HEADER_LENGTH),t=r[Fa.HEADER_PF_FOURCC_INDEX];ki(Boolean(r[Fa.HEADER_PF_FLAGS_INDEX]&Fa.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let i=X$(t),a=V$[i],n=W$[i];ki(a&&n,`DDS: Unknown pixel format ${t}`);let o=1;r[Fa.HEADER_FLAGS_INDEX]&Fa.DDSD_MIPMAPCOUNT&&(o=Math.max(1,r[Fa.MIPMAPCOUNT_INDEX]));let s=r[Fa.HEADER_WIDTH_INDEX],c=r[Fa.HEADER_HEIGHT_INDEX],u=r[Fa.HEADER_SIZE_INDEX]+4,l=new Uint8Array(e,u);return bc(l,{mipMapLevels:o,width:s,height:c,sizeFunction:n,internalFormat:a})}function DT(e,r){return(e+3>>2)*(r+3>>2)*8}function Ch(e,r){return(e+3>>2)*(r+3>>2)*16}function X$(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var ai={MAGIC_NUMBER:55727696,MAGIC_NUMBER_EXTRA:1347834371,HEADER_LENGTH:13,HEADER_SIZE:52,MAGIC_NUMBER_INDEX:0,PIXEL_FORMAT_INDEX:2,COLOUR_SPACE_INDEX:4,HEIGHT_INDEX:6,WIDTH_INDEX:7,MIPMAPCOUNT_INDEX:11,METADATA_SIZE_INDEX:12},Y$={0:[re.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[re.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[re.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[re.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[re.COMPRESSED_RGB_ETC1_WEBGL],7:[re.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[re.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[re.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[re.COMPRESSED_RGB8_ETC2],23:[re.COMPRESSED_RGBA8_ETC2_EAC],24:[re.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[re.COMPRESSED_R11_EAC],26:[re.COMPRESSED_RG11_EAC],27:[re.COMPRESSED_RGBA_ASTC_4X4_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[re.COMPRESSED_RGBA_ASTC_5X4_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[re.COMPRESSED_RGBA_ASTC_5X5_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[re.COMPRESSED_RGBA_ASTC_6X5_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[re.COMPRESSED_RGBA_ASTC_6X6_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[re.COMPRESSED_RGBA_ASTC_8X5_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[re.COMPRESSED_RGBA_ASTC_8X6_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[re.COMPRESSED_RGBA_ASTC_8X8_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[re.COMPRESSED_RGBA_ASTC_10X5_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[re.COMPRESSED_RGBA_ASTC_10X6_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[re.COMPRESSED_RGBA_ASTC_10X8_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[re.COMPRESSED_RGBA_ASTC_10X10_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[re.COMPRESSED_RGBA_ASTC_12X10_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[re.COMPRESSED_RGBA_ASTC_12X12_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},Q$={0:qT,1:qT,2:zT,3:zT,6:dl,7:dl,9:ml,11:ml,22:dl,23:ml,24:dl,25:dl,26:ml,27:ml,28:J$,29:Z$,30:eW,31:rW,32:tW,33:aW,34:iW,35:nW,36:oW,37:sW,38:cW,39:uW,40:lW};function NT(e){let t=new Uint32Array(e,0,ai.HEADER_LENGTH)[ai.MAGIC_NUMBER_INDEX];return t===ai.MAGIC_NUMBER||t===ai.MAGIC_NUMBER_EXTRA}function UT(e){let r=new Uint32Array(e,0,ai.HEADER_LENGTH),t=r[ai.PIXEL_FORMAT_INDEX],i=r[ai.COLOUR_SPACE_INDEX],a=Y$[t]||[],n=a.length>1&&i?a[1]:a[0],o=Q$[t],s=r[ai.MIPMAPCOUNT_INDEX],c=r[ai.WIDTH_INDEX],u=r[ai.HEIGHT_INDEX],l=ai.HEADER_SIZE+r[ai.METADATA_SIZE_INDEX],h=new Uint8Array(e,l);return bc(h,{mipMapLevels:s,width:c,height:u,sizeFunction:o,internalFormat:n})}function qT(e,r){return e=Math.max(e,16),r=Math.max(r,8),e*r/4}function zT(e,r){return e=Math.max(e,8),r=Math.max(r,8),e*r/2}function dl(e,r){return Math.floor((e+3)/4)*Math.floor((r+3)/4)*8}function ml(e,r){return Math.floor((e+3)/4)*Math.floor((r+3)/4)*16}function J$(e,r){return Math.floor((e+4)/5)*Math.floor((r+3)/4)*16}function Z$(e,r){return Math.floor((e+4)/5)*Math.floor((r+4)/5)*16}function eW(e,r){return Math.floor((e+5)/6)*Math.floor((r+4)/5)*16}function rW(e,r){return Math.floor((e+5)/6)*Math.floor((r+5)/6)*16}function tW(e,r){return Math.floor((e+7)/8)*Math.floor((r+4)/5)*16}function aW(e,r){return Math.floor((e+7)/8)*Math.floor((r+5)/6)*16}function iW(e,r){return Math.floor((e+7)/8)*Math.floor((r+7)/8)*16}function nW(e,r){return Math.floor((e+9)/10)*Math.floor((r+4)/5)*16}function oW(e,r){return Math.floor((e+9)/10)*Math.floor((r+5)/6)*16}function sW(e,r){return Math.floor((e+9)/10)*Math.floor((r+7)/8)*16}function cW(e,r){return Math.floor((e+9)/10)*Math.floor((r+9)/10)*16}function uW(e,r){return Math.floor((e+11)/12)*Math.floor((r+9)/10)*16}function lW(e,r){return Math.floor((e+11)/12)*Math.floor((r+11)/12)*16}function HT(e){if(Ph(e))return CT(e);if(MT(e))return LT(e);if(NT(e))return UT(e);throw new Error("Texture container format not recognized")}var VT={dataType:null,batchType:null,name:"Texture Containers",id:"compressed-texture",module:"textures",version:jh,worker:!0,extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0,options:{"compressed-texture":{libraryPath:"libs/",useBasis:!1}}},Bh={...VT,parse:async(e,r)=>{var t;return(t=r==null?void 0:r["compressed-texture"])!=null&&t.useBasis?(r.basis={format:{alpha:"BC3",noAlpha:"BC1"},...r.basis,containerFormat:"ktx2",module:"encoder"},(await Oh(e,r))[0]):HT(e)}};function GT(e,r=null){return r?`${e}?token=${r}`:e}var fW={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},pW={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},ps={...fW,...pW};function iy(e){switch(e){case"UInt8":return Uint8Array;case"UInt16":return Uint16Array;case"UInt32":return Uint32Array;case"Float32":return Float32Array;case"UInt64":return Float64Array;default:throw new Error(`parse i3s tile content: unknown type of data: ${e}`)}}var KT={UInt8:ps.UNSIGNED_BYTE,UInt16:ps.UNSIGNED_SHORT,Float32:ps.FLOAT,UInt32:ps.UNSIGNED_INT,UInt64:ps.DOUBLE};function xc(e){switch(e){case"UInt8":return 1;case"UInt16":case"Int16":return 2;case"UInt32":case"Int32":case"Float32":return 4;case"UInt64":case"Int64":case"Float64":return 8;default:throw new Error(`parse i3s tile content: unknown size of data: ${e}`)}}var Fh=new xr([0,0,0]);function hW(e){switch(e){case"ktx-etc2":case"dds":return Bh;case"ktx2":return hl;case"jpg":case"png":default:return Ah}}var dW="i3s-attribute-type";async function YT(e,r,t,i,a){var o;let n={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new ti,coordinateSystem:0,byteLength:0,texture:null};if(r.textureUrl){let s=GT(r.textureUrl,(o=i==null?void 0:i.i3s)==null?void 0:o.token),c=hW(r.textureFormat),h=await(await((a==null?void 0:a.fetch)||fetch)(s)).arrayBuffer();if(i!=null&&i.i3s.decodeTextures){if(c===Ah){let p={...r.textureLoaderOptions,image:{type:"data"}};try{let d=await $g(h,[],p,a);n.texture=d}catch{let v=await In(h,c,p,a);n.texture=v}}else if(c===Bh||c===hl){let p=await E1(h,c,r.textureLoaderOptions);c===hl&&(p=p[0]),n.texture={compressed:!0,mipmaps:!1,width:p[0].width,height:p[0].height,data:p}}}else n.texture=h}return n.material=kW(r.materialDefinition,n.texture),n.material&&(n.texture=null),await mW(e,n,r,t,i)}async function mW(e,r,t,i,a){var h,p;let n=e.byteLength,o,s,c=0,u=0,l;if(t.isDracoGeometry){let d=await In(e,J1,{draco:{attributeNameEntry:dW}});s=d.header.vertexCount,l=(h=d.indices)==null?void 0:h.value;let{POSITION:v,NORMAL:x,COLOR_0:y,TEXCOORD_0:E,["feature-index"]:A,["uv-region"]:S}=d.attributes;o={position:v,normal:x,color:y,uv0:E,uvRegion:S,id:A},gW(o,d);let R=jW(A);R&&AW(o,R)}else{let{vertexAttributes:d,ordering:v,featureAttributes:x,featureAttributeOrder:y}=i.store.defaultGeometrySchema,E=yW(e,i);c=E.byteOffset,s=E.vertexCount,u=E.featureCount;let{attributes:A,byteOffset:S}=WT(e,c,d,s,v),{attributes:R}=WT(e,S,x,u,y);EW(R),o=vW(A,R)}if(!((p=a==null?void 0:a.i3s)!=null&&p.coordinateSystem)||a.i3s.coordinateSystem===2){let d=xW(o.position,t);r.modelMatrix=d.invert(),r.coordinateSystem=2}else r.modelMatrix=wW(o.position),r.coordinateSystem=3;r.attributes={positions:o.position,normals:o.normal,colors:$T(o.color),texCoords:o.uv0,uvRegions:$T(o.uvRegion||o.region)},r.indices=l||null,o.id&&o.id.value&&(r.featureIds=o.id.value);for(let d in r.attributes)r.attributes[d]||delete r.attributes[d];return r.vertexCount=s,r.byteLength=n,r}function gW(e,r){for(let t in r.loaderData.attributes){let i=r.loaderData.attributes[t];switch(i.name){case"POSITION":e.position.metadata=i.metadata;break;case"feature-index":e.id.metadata=i.metadata;break;default:break}}}function vW(e,r){return{...e,...r}}function $T(e){return e&&(e.normalized=!0,e)}function yW(e,r){let t=0,i=0,a=0;for(let{property:n,type:o}of r.store.defaultGeometrySchema.header){let s=iy(o);switch(n){case"vertexCount".toString():i=new s(e,0,4)[0],t+=xc(o);break;case"featureCount".toString():a=new s(e,4,4)[0],t+=xc(o);break;default:break}}return{vertexCount:i,featureCount:a,byteOffset:t}}function WT(e,r,t,i,a){let n={};for(let o of a)if(t[o]){let{valueType:s,valuesPerElement:c}=t[o];if(r+i*c*xc(s)<=e.byteLength){let u=e.slice(r),l;if(s==="UInt64")l=bW(u,i*c,xc(s));else{let h=iy(s);l=new h(u,0,i*c)}switch(n[o]={value:l,type:KT[s],size:c},o){case"color":n.color.normalized=!0;break;case"position":case"region":case"normal":default:}r=r+i*c*xc(s)}else if(o!=="uv0")break}return{attributes:n,byteOffset:r}}function bW(e,r,t){let i=[],a=new DataView(e),n=0;for(let o=0;o<r;o++){let s=a.getUint32(n,!0),c=a.getUint32(n+4,!0),u=s+2**32*c;i.push(u),n+=t}return new Uint32Array(i)}function xW(e,r){let t=r.mbs,i=e.value,a=e.metadata,n=new ti,o=new xr(t[0],t[1],t[2]),s=new xr;return qn.WGS84.cartographicToCartesian(o,s),qn.WGS84.eastNorthUpToFixedFrame(s,n),e.value=_W(i,a,o),n}function _W(e,r={},t){let i=new Float64Array(e.length),a=r["i3s-scale_x"]&&r["i3s-scale_x"].double||1,n=r["i3s-scale_y"]&&r["i3s-scale_y"].double||1;for(let o=0;o<i.length;o+=3)i[o]=e[o]*a+t.x,i[o+1]=e[o+1]*n+t.y,i[o+2]=e[o+2]+t.z;for(let o=0;o<i.length;o+=3)qn.WGS84.cartographicToCartesian(i.subarray(o,o+3),Fh),i[o]=Fh.x,i[o+1]=Fh.y,i[o+2]=Fh.z;return i}function wW(e){var n,o;let r=e.metadata,t=((n=r==null?void 0:r["i3s-scale_x"])==null?void 0:n.double)||1,i=((o=r==null?void 0:r["i3s-scale_y"])==null?void 0:o.double)||1,a=new ti;return a[0]=t,a[5]=i,a}function kW(e,r){let t;return e?t={...e,pbrMetallicRoughness:e.pbrMetallicRoughness?{...e.pbrMetallicRoughness}:{baseColorFactor:[255,255,255,255]}}:(t={pbrMetallicRoughness:{}},r?t.pbrMetallicRoughness.baseColorTexture={texCoord:0}:t.pbrMetallicRoughness.baseColorFactor=[255,255,255,255]),t.alphaCutoff=t.alphaCutoff||.25,t.alphaMode&&(t.alphaMode=t.alphaMode.toUpperCase()),t.emissiveFactor&&(t.emissiveFactor=XT(t.emissiveFactor)),t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorFactor&&(t.pbrMetallicRoughness.baseColorFactor=XT(t.pbrMetallicRoughness.baseColorFactor)),r&&SW(t,r),t}function XT(e){let r=[...e];for(let t=0;t<e.length;t++)r[t]=e[t]/255;return r}function SW(e,r){let t={source:{image:r}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture={...e.pbrMetallicRoughness.baseColorTexture,texture:t}:e.emissiveTexture?e.emissiveTexture={...e.emissiveTexture,texture:t}:e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture={...e.pbrMetallicRoughness.metallicRoughnessTexture,texture:t}:e.normalTexture?e.normalTexture={...e.normalTexture,texture:t}:e.occlusionTexture&&(e.occlusionTexture={...e.occlusionTexture,texture:t})}function EW(e){let{id:r,faceRange:t}=e;if(!r||!t)return;let i=r.value,a=t.value,n=a[a.length-1]+1,o=new Uint32Array(n*3),s=0,c=0;for(let u=1;u<a.length;u+=2){let l=Number(i[s]),h=a[u],p=a[u-1],d=h-p+1,v=c+d*3;o.fill(l,c,v),s++,c=v}e.id.value=o}function AW(e,r){let t=e.id.value,i=new Float32Array(t.length);for(let a=0;a<t.length;a++)i[a]=r[t[a]];e.id.value=i}function jW(e){var r,t;return(t=(r=e==null?void 0:e.metadata)==null?void 0:r["i3s-feature-ids"])==null?void 0:t.intArray}var TW="4.4.0-alpha.1",QT={dataType:null,batchType:null,name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:TW,mimeTypes:["application/octet-stream"],parse:RW,extensions:["bin"],options:{"i3s-content":{}}};async function RW(e,r,t){let{tile:i,_tileOptions:a,tileset:n,_tilesetOptions:o}=(r==null?void 0:r.i3s)||{},s=a||i,c=o||n;return!s||!c?null:await YT(e,s,c,r,t)}sv(QT);
100
100
  /*! Bundled license information:
101
101
 
102
102
  is-buffer/index.js: