@loaders.gl/i3s 4.0.2 → 4.0.3

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.
@@ -92,12 +92,12 @@ caused by: `+Wr.fullStack(r):e.stack};Wr.errorFromList=function(e){return Nt.arr
92
92
  `)}),a("--"+t.boundary+"--"),t.request.postambleCRLF&&a(`\r
93
93
  `),i};jc.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)};K6.Multipart=jc});var Z6=D(Q6=>{"use strict";var X6=require("url"),bN=/^https?:/;function gp(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}gp.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)};gp.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};gp.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,bN.test(i)||(i=X6.resolve(t.uri.href,i));var a=t.uri;return t.uri=X6.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};Q6.Redirect=gp});var t5=D(nu=>{"use strict";var nJ=require("net"),yN=require("tls"),Dg=require("http"),J6=require("https"),xN=require("events"),wN=require("assert"),_N=require("util"),kN=Ps().Buffer;nu.httpOverHttp=SN;nu.httpsOverHttp=EN;nu.httpOverHttps=jN;nu.httpsOverHttps=AN;function SN(e){var r=new dn(e);return r.request=Dg.request,r}function EN(e){var r=new dn(e);return r.request=Dg.request,r.createSocket=e5,r.defaultPort=443,r}function jN(e){var r=new dn(e);return r.request=J6.request,r}function AN(e){var r=new dn(e);return r.request=J6.request,r.createSocket=e5,r.defaultPort=443,r}function dn(e){var r=this;r.options=e||{},r.proxyOptions=r.options.proxy||{},r.maxSockets=r.options.maxSockets||Dg.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 u=r.requests[o];if(u.host===a&&u.port===n){r.requests.splice(o,1),u.request.onSocket(i);return}}i.destroy(),r.removeSocket(i)})}_N.inherits(dn,xN.EventEmitter);dn.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})};dn.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)}})};dn.prototype.createSocket=function(r,t){var i=this,a={};i.sockets.push(a);var n=r5({},i.proxyOptions,{method:"CONNECT",path:r.host+":"+r.port,agent:!1});n.proxyAuth&&(n.headers=n.headers||{},n.headers["Proxy-Authorization"]="Basic "+kN.from(n.proxyAuth).toString("base64")),Xo("making CONNECT request");var o=i.request(n);o.useChunkedEncodingByDefault=!1,o.once("response",s),o.once("upgrade",u),o.once("connect",l),o.once("error",f),o.end();function s(h){h.upgrade=!0}function u(h,d,m){process.nextTick(function(){l(h,d,m)})}function l(h,d,m){if(o.removeAllListeners(),d.removeAllListeners(),h.statusCode===200)wN.equal(m.length,0),Xo("tunneling connection has established"),i.sockets[i.sockets.indexOf(a)]=d,t(d);else{Xo("tunneling socket could not be established, statusCode=%d",h.statusCode);var y=new Error("tunneling socket could not be established, statusCode="+h.statusCode);y.code="ECONNRESET",r.request.emit("error",y),i.removeSocket(a)}}function f(h){o.removeAllListeners(),Xo(`tunneling socket could not be established, cause=%s
94
94
  `,h.message,h.stack);var d=new Error("tunneling socket could not be established, cause="+h.message);d.code="ECONNRESET",r.request.emit("error",d),i.removeSocket(a)}};dn.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 e5(e,r){var t=this;dn.prototype.createSocket.call(t,e,function(i){var a=yN.connect(0,r5({},t.options,{servername:e.host,socket:i}));t.sockets[t.sockets.indexOf(i)]=a,r(a)})}function r5(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 Xo;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?Xo=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)}:Xo=function(){};nu.debug=Xo});var o5=D(n5=>{"use strict";var TN=require("url"),PN=t5(),a5=["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"],i5=["proxy-authorization"];function RN(e){var r=e.port,t=e.protocol,i=e.hostname+":";return r?i+=r:t==="https:"?i+="443":i+="80",i}function CN(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 ON(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 IN(e,r){var t=e.protocol==="https:"?"https":"http",i=r.protocol==="https:"?"Https":"Http";return[t,i].join("Over")}function BN(e){var r=e.uri,t=e.proxy,i=IN(r,t);return PN[i]}function Ac(e){this.request=e,this.proxyHeaderWhiteList=a5,this.proxyHeaderExclusiveList=[],typeof e.tunnel<"u"&&(this.tunnelOverride=e.tunnel)}Ac.prototype.isEnabled=function(){var e=this,r=e.request;return typeof e.tunnelOverride<"u"?e.tunnelOverride:r.uri.protocol==="https:"};Ac.prototype.setup=function(e){var r=this,t=r.request;if(e=e||{},typeof t.proxy=="string"&&(t.proxy=TN.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(i5),a=r.proxyHeaderWhiteList.concat(i),n=CN(t.headers,a);n.host=RN(t.uri),i.forEach(t.removeHeader,t);var o=BN(t),s=ON(t,n);return t.agent=o(s),!0};Ac.defaultProxyHeaderWhiteList=a5;Ac.defaultProxyHeaderExclusiveList=i5;n5.Tunnel=Ac});var u5=D((s5,Tc)=>{(function(){var e,r,t,i,a,n;typeof performance<"u"&&performance!==null&&performance.now?Tc.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Tc.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?(Tc.exports=function(){return Date.now()-t},t=Date.now()):(Tc.exports=function(){return new Date().getTime()-t},t=new Date().getTime())}).call(s5)});var y5=D((uJ,b5)=>{"use strict";var FN=require("http"),p5=require("https"),Pc=require("url"),qg=require("util"),bp=require("stream"),vp=require("zlib"),Lg=Kw(),DN=i_(),LN=K3(),qN=Hf(),d5=Gf(),c5=aS(),MN=CS(),zN=Nl(),l5=eg(),NN=LS().strict,su=Vl(),UN=fm(),HN=zS(),GN=ZS().Querystring,WN=j6().Har,VN=F6().Auth,$N=V6().OAuth,KN=$6(),YN=Y6().Multipart,XN=Z6().Redirect,Mg=o5().Tunnel,ou=u5(),Rc=Ps().Buffer,f5=su.safeStringify,QN=su.isReadStream,ZN=su.toBase64,JN=su.defer,h5=su.copy,eU=su.version,m5=UN.jar(),g5={};function rU(e,r){var t={};for(var i in r){var a=e.indexOf(i)===-1;a&&(t[i]=r[i])}return t}function tU(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 v5(){var e=this;return{uri:e.uri,method:e.method,headers:e.headers}}function aU(){var e=this;return{statusCode:e.statusCode,body:e.body,headers:e.headers,request:v5.call(e.request)}}function Lr(e){var r=this;e.har&&(r._har=new WN(r),e=r._har.options(e)),bp.Stream.call(r);var t=Object.keys(Lr.prototype),i=rU(t,e);zN(r,i),e=tU(t,e),r.readable=!0,r.writable=!0,e.method&&(r.explicitMethod=!0),r._qs=new GN(r),r._auth=new VN(r),r._oauth=new $N(r),r._multipart=new YN(r),r._redirect=new XN(r),r._tunnel=new Mg(r),r.init(e)}qg.inherits(Lr,bp.Stream);Lr.debug=process.env.NODE_DEBUG&&/\brequest\b/.test(process.env.NODE_DEBUG);function na(){Lr.debug&&console.error("REQUEST %s",qg.format.apply(qg,arguments))}Lr.prototype.debug=na;Lr.prototype.init=function(e){var r=this;e||(e={}),r.headers=r.headers?h5(r.headers):{};for(var t in r.headers)typeof r.headers[t]>"u"&&delete r.headers[t];if(d5.httpify(r,r.headers),r.method||(r.method=e.method||"GET"),r.localAddress||(r.localAddress=e.localAddress),r._qs.init(e),na(e),!r.pool&&r.pool!==!1&&(r.pool=g5),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=Pc.parse(r.uri)),r.uri.href||(r.uri.href=Pc.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=Pc.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=HN(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 u=e.formData,l=r.form(),f=function(I,F){F&&F.hasOwnProperty("value")&&F.hasOwnProperty("options")?l.append(I,F.value,F.options):l.append(I,F)};for(var h in u)if(u.hasOwnProperty(h)){var d=u[h];if(d instanceof Array)for(var m=0;m<d.length;m++)f(h,d[m]);else f(h,d)}}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 y=r.uri.auth.split(":").map(function(I){return r._qs.unescape(I)});r.auth(y[0],y.slice(1).join(":"),!0)}if(!r.tunnel&&r.proxy&&r.proxy.auth&&!r.hasHeader("proxy-authorization")){var k=r.proxy.auth.split(":").map(function(I){return r._qs.unescape(I)}),x="Basic "+ZN(k.join(":"));r.setHeader("proxy-authorization",x)}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 A(){if(NN(r.body)&&(r.body=Rc.from(r.body)),!r.hasHeader("content-length")){var I;typeof r.body=="string"?I=Rc.byteLength(r.body):Array.isArray(r.body)?I=r.body.reduce(function(F,H){return F+H.length},0):I=r.body.length,I?r.setHeader("content-length",I):r.emit("error",new Error("Argument error, options.body."))}}r.body&&!l5(r.body)&&A(),e.oauth?r.oauth(e.oauth):r._oauth.params&&r.hasHeader("authorization")&&r.oauth(r._oauth.params);var P=r.proxy&&!r.tunnel?r.proxy.protocol:r.uri.protocol,T={"http:":FN,"https:":p5},B=r.httpModules||{};if(r.httpModule=B[P]||T[P],!r.httpModule)return r.emit("error",new Error("Invalid protocol: "+P));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 C=eU();C.major===0&&C.minor<=10?r.agentClass=P==="http:"?c5:c5.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(I){if(r.ntick&&r._started&&r.emit("error",new Error("You cannot pipe to this stream after the outbound request has started.")),r.src=I,QN(I))r.hasHeader("content-type")||r.setHeader("content-type",qN.lookup(I.path));else{if(I.headers)for(var F in I.headers)r.hasHeader(F)||r.setHeader(F,I.headers[F]);r._json&&!r.hasHeader("content-type")&&r.setHeader("content-type","application/json"),I.method&&!r.explicitMethod&&(r.method=I.method)}}),JN(function(){if(!r._aborted){var I=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)l5(r.body)?r.body.pipe(r):(A(),Array.isArray(r.body)?r.body.forEach(function(F){r.write(F)}):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(F,H){!F&&!isNaN(H)&&r.setHeader("content-length",H),I()})):I(),r.ntick=!0}})};Lr.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=Pc.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===g5&&!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])};Lr.prototype.start=function(){var e=this;if(e.timing)var r=new Date().getTime(),t=ou();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=h5(e);delete i.auth,na("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=ou()-e.startTimeNow,o)){var s=function(){e.timings.lookup=ou()-e.startTimeNow},u=function(){e.timings.connect=ou()-e.startTimeNow};n.once("lookup",s),n.once("connect",u),e.req.once("error",function(){n.removeListener("lookup",s),n.removeListener("connect",u)})}var l=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 f=function(){n.removeListener("connect",f),e.clearTimeout(),l()};n.on("connect",f),e.req.on("error",function(h){n.removeListener("connect",f)}),e.timeoutTimer=setTimeout(function(){n.removeListener("connect",f),e.abort();var h=new Error("ETIMEDOUT");h.code="ETIMEDOUT",h.connect=!0,e.emit("error",h)},a)}else l();e.emit("socket",n)}),e.emit("request",e.req)}};Lr.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)}};Lr.prototype.onRequestResponse=function(e){var r=this;if(r.timing&&(r.timings.response=ou()-r.startTimeNow),na("onRequestResponse",r.uri.href,e.statusCode,e.headers),e.on("end",function(){r.timing&&(r.timings.end=ou()-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),na("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}),na("response end",r.uri.href,e.statusCode,e.headers)}),r._aborted){na("aborted",r.uri.href),e.resume();return}if(r.response=e,e.request=r,e.toJSON=aU,r.httpModule===p5&&r.strictSSL&&(!e.hasOwnProperty("socket")||!e.socket.authorized)){na("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:m5,a=function(f){try{i.setCookie(f,r.uri.href,{ignoreError:!0})}catch(h){r.emit("error",h)}};if(e.caseless=d5(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(f){return r.method==="HEAD"||f>=100&&f<200||f===204||f===304},s;if(r.gzip&&!o(e.statusCode)){var u=e.headers["content-encoding"]||"identity";u=u.trim().toLowerCase();var l={flush:vp.Z_SYNC_FLUSH,finishFlush:vp.Z_SYNC_FLUSH};u==="gzip"?(s=vp.createGunzip(l),e.pipe(s)):u==="deflate"?(s=vp.createInflate(l),e.pipe(s)):(u!=="identity"&&na("ignoring unrecognized Content-Encoding "+u),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(f){r.pipeDest(f)}),s.on("data",function(f){r.timing&&!r.responseStarted&&(r.responseStartTime=new Date().getTime(),e.responseStartTime=r.responseStartTime),r._destdata=!0,r.emit("data",f)}),s.once("end",function(f){r.emit("end",f)}),s.on("error",function(f){r.emit("error",f)}),s.on("close",function(){r.emit("close")}),r.callback?r.readResponseBody(e):r.on("end",function(){if(r._aborted){na("aborted",r.uri.href);return}r.emit("complete",e)})}na("finish init function",r.uri.href)}};Lr.prototype.readResponseBody=function(e){var r=this;na("reading response's body");var t=[],i=0,a=[];r.on("data",function(n){Rc.isBuffer(n)?n.length&&(i+=n.length,t.push(n)):a.push(n)}),r.on("end",function(){if(na("end event",r.uri.href),r._aborted){na("aborted",r.uri.href),t=[],i=0;return}if(i?(na("has body",r.uri.href,i),e.body=Rc.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{na("invalid JSON received",r.uri.href)}na("emitting complete",r.uri.href),typeof e.body>"u"&&!r._json&&(e.body=r.encoding===null?Rc.alloc(0):""),r.emit("complete",e,e.body)})};Lr.prototype.abort=function(){var e=this;e._aborted=!0,e.req?e.req.abort():e.response&&e.response.destroy(),e.clearTimeout(),e.emit("abort")};Lr.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)};Lr.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=Pc.parse(t.uri.href.split("?")[0]+"?"+n),t.url=t.uri,t.path=t.uri.path,t.uri.host==="unix"&&t.enableUnixSocket()),t};Lr.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 MN,r._form.on("error",function(t){t.message="form-data: "+t.message,r.emit("error",t),r.abort()}),r._form)};Lr.prototype.multipart=function(e){var r=this;return r._multipart.onRequest(e),r._multipart.chunked||(r.body=r._multipart.body),r};Lr.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=f5(r.body,r._jsonReplacer),r.hasHeader("content-type")||r.setHeader("content-type","application/json")):(r.body=f5(e,r._jsonReplacer),r.hasHeader("content-type")||r.setHeader("content-type","application/json")),typeof r.jsonReviver=="function"&&(r._jsonReviver=r.jsonReviver),r};Lr.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};Lr.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};Lr.prototype.auth=function(e,r,t,i){var a=this;return a._auth.onRequest(e,r,t,i),a};Lr.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=DN.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:Lg.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=Lg.canonicalizeResource(o.resource),t.setHeader("authorization",Lg.authorization(o))}return t};Lr.prototype.httpSignature=function(e){var r=this;return LN.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),na("httpSignature authorization",r.getHeader("authorization")),r};Lr.prototype.hawk=function(e){var r=this;r.setHeader("Authorization",KN.header(r.uri,r.method,e))};Lr.prototype.oauth=function(e){var r=this;return r._oauth.onRequest(e),r};Lr.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:m5,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};Lr.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 bp.Stream.prototype.pipe.call(t,e,r),t.pipeDest(e),e;else return t.dests.push(e),bp.Stream.prototype.pipe.call(t,e,r),e};Lr.prototype.write=function(){var e=this;if(!e._aborted&&(e._started||e.start(),e.req))return e.req.write.apply(e.req,arguments)};Lr.prototype.end=function(e){var r=this;r._aborted||(e&&r.write(e),r._started||r.start(),r.req&&r.req.end())};Lr.prototype.pause=function(){var e=this;e.responseContent?e.responseContent.pause.apply(e.responseContent,arguments):e._paused=!0};Lr.prototype.resume=function(){var e=this;e.responseContent?e.responseContent.resume.apply(e.responseContent,arguments):e._paused=!1};Lr.prototype.destroy=function(){var e=this;this.clearTimeout(),e._ended?e.response&&e.response.destroy():e.end()};Lr.prototype.clearTimeout=function(){this.timeoutTimer&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)};Lr.defaultProxyHeaderWhiteList=Mg.defaultProxyHeaderWhiteList.slice();Lr.defaultProxyHeaderExclusiveList=Mg.defaultProxyHeaderExclusiveList.slice();Lr.prototype.toJSON=v5;b5.exports=Lr});var _5=D((cJ,w5)=>{"use strict";var Cc=Nl(),x5=fm(),iU=Vl(),nU=iU.paramsHaveRequestBody;function yp(e,r,t){typeof r=="function"&&(t=r);var i={};return r!==null&&typeof r=="object"?Cc(i,r,{uri:e}):typeof e=="string"?Cc(i,{uri:e}):Cc(i,e),i.callback=t||i.callback,i}function It(e,r,t){if(typeof e>"u")throw new Error("undefined is not a valid uri or options object.");var i=yp(e,r,t);if(i.method==="HEAD"&&nU(i))throw new Error("HTTP HEAD requests MUST NOT include a request body.");return new It.Request(i)}function _o(e){var r=e.toUpperCase();return function(t,i,a){var n=yp(t,i,a);return n.method=r,It(n,n.callback)}}It.get=_o("get");It.head=_o("head");It.options=_o("options");It.post=_o("post");It.put=_o("put");It.patch=_o("patch");It.del=_o("delete");It.delete=_o("delete");It.jar=function(e){return x5.jar(e)};It.cookie=function(e){return x5.parse(e)};function zg(e,r,t,i){return function(a,n,o){var s=yp(a,n,o),u={};return Cc(!0,u,r,s),u.pool=s.pool||r.pool,i&&(u.method=i.toUpperCase()),typeof t=="function"&&(e=t),e(u,u.callback)}}It.defaults=function(e,r){var t=this;e=e||{},typeof e=="function"&&(r=e,e={});var i=zg(t,e,r),a=["get","head","post","put","patch","del","delete"];return a.forEach(function(n){i[n]=zg(t[n],e,r,n)}),i.cookie=zg(t.cookie,e,r),i.jar=t.jar,i.defaults=t.defaults,i};It.forever=function(e,r){var t={};return r&&Cc(t,r),e&&(t.agentOptions=e),t.forever=!0,It.defaults(t)};w5.exports=It;It.Request=y5();It.initParams=yp;Object.defineProperty(It,"debug",{enumerable:!0,get:function(){return It.Request.debug},set:function(e){It.Request.debug=e}})});var S5=D((lJ,k5)=>{k5.exports=oU;function oU(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",u=new Buffer(o,s);return u.type=t[0]||"text/plain",u.charset=a,u}});var A5=D((fJ,j5)=>{var sU=S5();function uU(e){return{mimeType:lU(cU(e)),data:sU(e)}}function cU(e){return e.substring(5,e.indexOf(";"))}var E5=/^(\w+\/)+/;function lU(e){e=e.toLowerCase();var r=e.match(E5);return!r||!(r=r[1])?e:e.replace(E5,r)}j5.exports=uU});var P5=D((dJ,T5)=>{"use strict";var Oc=Lu(),pJ=require("path"),fU=V2().PNG,pU=bh(),dU=Q2(),hU=J2().GifReader,mU=iw(),gU=require("fs"),vU=_5(),bU=Hf(),yU=A5();function xU(e,r){var t=new fU;t.parse(e,function(i,a){if(i){r(i);return}r(null,Oc(new Uint8Array(a.data),[a.width|0,a.height|0,4],[4,4*a.width|0,1],0))})}function wU(e,r){var t;try{t=pU.decode(e)}catch(n){r(n);return}if(!t){r(new Error("Error decoding jpeg"));return}var i=[t.height,t.width,4],a=Oc(t.data,i);r(null,a.transpose(1,0))}function _U(e,r){var t;try{t=new hU(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=Oc(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=Oc(a,i);try{t.decodeAndBlitFrameRGBA(0,a)}catch(f){r(f);return}r(null,n.transpose(1,0))}}function kU(e,r){var t=new mU(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=Oc(n,a);dU(i,o),r(null,o.transpose(1,0))}function xp(e,r,t){switch(e){case"image/png":xU(r,t);break;case"image/jpg":case"image/jpeg":wU(r,t);break;case"image/gif":_U(r,t);break;case"image/bmp":kU(r,t);break;default:t(new Error("Unsupported file type: "+e))}}T5.exports=function(r,t,i){if(i||(i=t,t=""),Buffer.isBuffer(r)){if(!t){i(new Error("Invalid file type"));return}xp(t,r,i)}else if(r.indexOf("data:")===0)try{var a=yU(r);a?process.nextTick(function(){xp(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?vU({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}xp(t,s,i)}):gU.readFile(r,function(n,o){if(n){i(n);return}if(t=t||bU.lookup(r),!t){i(new Error("Invalid file type"));return}xp(t,o,i)})}});var X5=D((Cp,Y5)=>{(function(e,r){typeof Cp=="object"&&typeof Y5<"u"?r(Cp):typeof define=="function"&&define.amd?define(["exports"],r):(e=typeof globalThis<"u"?globalThis:e||self,r(e.WebStreamsPolyfill={}))})(Cp,function(e){"use strict";var r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol:function(c){return"Symbol("+c+")"};function t(){}function i(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}var a=i();function n(c){return typeof c=="object"&&c!==null||typeof c=="function"}var o=t,s=Promise,u=Promise.prototype.then,l=Promise.resolve.bind(s),f=Promise.reject.bind(s);function h(c){return new s(c)}function d(c){return l(c)}function m(c){return f(c)}function y(c,g,E){return u.call(c,g,E)}function k(c,g,E){y(y(c,g,E),void 0,o)}function x(c,g){k(c,g)}function A(c,g){k(c,void 0,g)}function P(c,g,E){return y(c,g,E)}function T(c){y(c,void 0,o)}var B=function(){var c=a&&a.queueMicrotask;if(typeof c=="function")return c;var g=d(void 0);return function(E){return y(g,E)}}();function C(c,g,E){if(typeof c!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(c,g,E)}function I(c,g,E){try{return d(C(c,g,E))}catch(L){return m(L)}}var F=16384,H=function(){function c(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}return Object.defineProperty(c.prototype,"length",{get:function(){return this._size},enumerable:!1,configurable:!0}),c.prototype.push=function(g){var E=this._back,L=E;E._elements.length===F-1&&(L={_elements:[],_next:void 0}),E._elements.push(g),L!==E&&(this._back=L,E._next=L),++this._size},c.prototype.shift=function(){var g=this._front,E=g,L=this._cursor,Y=L+1,se=g._elements,xe=se[L];return Y===F&&(E=g._next,Y=0),--this._size,this._cursor=Y,g!==E&&(this._front=E),se[L]=void 0,xe},c.prototype.forEach=function(g){for(var E=this._cursor,L=this._front,Y=L._elements;(E!==Y.length||L._next!==void 0)&&!(E===Y.length&&(L=L._next,Y=L._elements,E=0,Y.length===0));)g(Y[E]),++E},c.prototype.peek=function(){var g=this._front,E=this._cursor;return g._elements[E]},c}();function N(c,g){c._ownerReadableStream=g,g._reader=c,g._state==="readable"?U(c):g._state==="closed"?Z(c):$(c,g._storedError)}function K(c,g){var E=c._ownerReadableStream;return wi(E,g)}function V(c){c._ownerReadableStream._state==="readable"?le(c,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):ve(c,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),c._ownerReadableStream._reader=void 0,c._ownerReadableStream=void 0}function X(c){return new TypeError("Cannot "+c+" a stream using a released reader")}function U(c){c._closedPromise=h(function(g,E){c._closedPromise_resolve=g,c._closedPromise_reject=E})}function $(c,g){U(c),le(c,g)}function Z(c){U(c),fe(c)}function le(c,g){c._closedPromise_reject!==void 0&&(T(c._closedPromise),c._closedPromise_reject(g),c._closedPromise_resolve=void 0,c._closedPromise_reject=void 0)}function ve(c,g){$(c,g)}function fe(c){c._closedPromise_resolve!==void 0&&(c._closedPromise_resolve(void 0),c._closedPromise_resolve=void 0,c._closedPromise_reject=void 0)}var we=r("[[AbortSteps]]"),ye=r("[[ErrorSteps]]"),Me=r("[[CancelSteps]]"),ze=r("[[PullSteps]]"),Ie=Number.isFinite||function(c){return typeof c=="number"&&isFinite(c)},W=Math.trunc||function(c){return c<0?Math.ceil(c):Math.floor(c)};function ke(c){return typeof c=="object"||typeof c=="function"}function Qe(c,g){if(c!==void 0&&!ke(c))throw new TypeError(g+" is not an object.")}function $e(c,g){if(typeof c!="function")throw new TypeError(g+" is not a function.")}function Ve(c){return typeof c=="object"&&c!==null||typeof c=="function"}function tr(c,g){if(!Ve(c))throw new TypeError(g+" is not an object.")}function Be(c,g,E){if(c===void 0)throw new TypeError("Parameter "+g+" is required in '"+E+"'.")}function de(c,g,E){if(c===void 0)throw new TypeError(g+" is required in '"+E+"'.")}function Se(c){return Number(c)}function nr(c){return c===0?0:c}function Pe(c){return nr(W(c))}function cr(c,g){var E=0,L=Number.MAX_SAFE_INTEGER,Y=Number(c);if(Y=nr(Y),!Ie(Y))throw new TypeError(g+" is not a finite number");if(Y=Pe(Y),Y<E||Y>L)throw new TypeError(g+" is outside the accepted range of "+E+" to "+L+", inclusive");return!Ie(Y)||Y===0?0:Y}function qr(c,g){if(!Vn(c))throw new TypeError(g+" is not a ReadableStream.")}function Kr(c){return new Xe(c)}function ee(c,g){c._reader._readRequests.push(g)}function Fe(c,g,E){var L=c._reader,Y=L._readRequests.shift();E?Y._closeSteps():Y._chunkSteps(g)}function Ke(c){return c._reader._readRequests.length}function Ge(c){var g=c._reader;return!(g===void 0||!er(g))}var Xe=function(){function c(g){if(Be(g,1,"ReadableStreamDefaultReader"),qr(g,"First parameter"),$n(g))throw new TypeError("This stream has already been locked for exclusive reading by another reader");N(this,g),this._readRequests=new H}return Object.defineProperty(c.prototype,"closed",{get:function(){return er(this)?this._closedPromise:m(gr("closed"))},enumerable:!1,configurable:!0}),c.prototype.cancel=function(g){return g===void 0&&(g=void 0),er(this)?this._ownerReadableStream===void 0?m(X("cancel")):K(this,g):m(gr("cancel"))},c.prototype.read=function(){if(!er(this))return m(gr("read"));if(this._ownerReadableStream===void 0)return m(X("read from"));var g,E,L=h(function(se,xe){g=se,E=xe}),Y={_chunkSteps:function(se){return g({value:se,done:!1})},_closeSteps:function(){return g({value:void 0,done:!0})},_errorSteps:function(se){return E(se)}};return or(this,Y),L},c.prototype.releaseLock=function(){if(!er(this))throw gr("releaseLock");if(this._ownerReadableStream!==void 0){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");V(this)}},c}();Object.defineProperties(Xe.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Xe.prototype,r.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function er(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_readRequests")?!1:c instanceof Xe}function or(c,g){var E=c._ownerReadableStream;E._disturbed=!0,E._state==="closed"?g._closeSteps():E._state==="errored"?g._errorSteps(E._storedError):E._readableStreamController[ze](g)}function gr(c){return new TypeError("ReadableStreamDefaultReader.prototype."+c+" can only be used on a ReadableStreamDefaultReader")}var Dr,vr;typeof r.asyncIterator=="symbol"&&(vr=(Dr={},Dr[r.asyncIterator]=function(){return this},Dr),Object.defineProperty(vr,r.asyncIterator,{enumerable:!1}));var be=function(){function c(g,E){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=g,this._preventCancel=E}return c.prototype.next=function(){var g=this,E=function(){return g._nextSteps()};return this._ongoingPromise=this._ongoingPromise?P(this._ongoingPromise,E,E):E(),this._ongoingPromise},c.prototype.return=function(g){var E=this,L=function(){return E._returnSteps(g)};return this._ongoingPromise?P(this._ongoingPromise,L,L):L()},c.prototype._nextSteps=function(){var g=this;if(this._isFinished)return Promise.resolve({value:void 0,done:!0});var E=this._reader;if(E._ownerReadableStream===void 0)return m(X("iterate"));var L,Y,se=h(function(Je,Ar){L=Je,Y=Ar}),xe={_chunkSteps:function(Je){g._ongoingPromise=void 0,B(function(){return L({value:Je,done:!1})})},_closeSteps:function(){g._ongoingPromise=void 0,g._isFinished=!0,V(E),L({value:void 0,done:!0})},_errorSteps:function(Je){g._ongoingPromise=void 0,g._isFinished=!0,V(E),Y(Je)}};return or(E,xe),se},c.prototype._returnSteps=function(g){if(this._isFinished)return Promise.resolve({value:g,done:!0});this._isFinished=!0;var E=this._reader;if(E._ownerReadableStream===void 0)return m(X("finish iterating"));if(!this._preventCancel){var L=K(E,g);return V(E),P(L,function(){return{value:g,done:!0}})}return V(E),d({value:g,done:!0})},c}(),Ye={next:function(){return Pr(this)?this._asyncIteratorImpl.next():m(lr("next"))},return:function(c){return Pr(this)?this._asyncIteratorImpl.return(c):m(lr("return"))}};vr!==void 0&&Object.setPrototypeOf(Ye,vr);function pr(c,g){var E=Kr(c),L=new be(E,g),Y=Object.create(Ye);return Y._asyncIteratorImpl=L,Y}function Pr(c){if(!n(c)||!Object.prototype.hasOwnProperty.call(c,"_asyncIteratorImpl"))return!1;try{return c._asyncIteratorImpl instanceof be}catch{return!1}}function lr(c){return new TypeError("ReadableStreamAsyncIterator."+c+" can only be used on a ReadableSteamAsyncIterator")}var br=Number.isNaN||function(c){return c!==c};function _r(c){return c.slice()}function sr(c,g,E,L,Y){new Uint8Array(c).set(new Uint8Array(E,L,Y),g)}function hr(c){return c}function Vr(c){return!1}function Cr(c,g,E){if(c.slice)return c.slice(g,E);var L=E-g,Y=new ArrayBuffer(L);return sr(Y,0,c,g,L),Y}function Et(c){return!(typeof c!="number"||br(c)||c<0)}function Ft(c){var g=Cr(c.buffer,c.byteOffset,c.byteOffset+c.byteLength);return new Uint8Array(g)}function sa(c){var g=c._queue.shift();return c._queueTotalSize-=g.size,c._queueTotalSize<0&&(c._queueTotalSize=0),g.value}function va(c,g,E){if(!Et(E)||E===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");c._queue.push({value:g,size:E}),c._queueTotalSize+=E}function rt(c){var g=c._queue.peek();return g.value}function ut(c){c._queue=new H,c._queueTotalSize=0}var mt=function(){function c(){throw new TypeError("Illegal constructor")}return Object.defineProperty(c.prototype,"view",{get:function(){if(!ua(this))throw Ne("view");return this._view},enumerable:!1,configurable:!0}),c.prototype.respond=function(g){if(!ua(this))throw Ne("respond");if(Be(g,1,"respond"),g=cr(g,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");Vr(this._view.buffer),Ze(this._associatedReadableByteStreamController,g)},c.prototype.respondWithNewView=function(g){if(!ua(this))throw Ne("respondWithNewView");if(Be(g,1,"respondWithNewView"),!ArrayBuffer.isView(g))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");Vr(g.buffer),Re(this._associatedReadableByteStreamController,g)},c}();Object.defineProperties(mt.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(mt.prototype,r.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var Dt=function(){function c(){throw new TypeError("Illegal constructor")}return Object.defineProperty(c.prototype,"byobRequest",{get:function(){if(!gt(this))throw ge("byobRequest");return Oe(this)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"desiredSize",{get:function(){if(!gt(this))throw ge("desiredSize");return ar(this)},enumerable:!1,configurable:!0}),c.prototype.close=function(){if(!gt(this))throw ge("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");var g=this._controlledReadableByteStream._state;if(g!=="readable")throw new TypeError("The stream (in "+g+" state) is not in the readable state and cannot be closed");De(this)},c.prototype.enqueue=function(g){if(!gt(this))throw ge("enqueue");if(Be(g,1,"enqueue"),!ArrayBuffer.isView(g))throw new TypeError("chunk must be an array buffer view");if(g.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(g.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");var E=this._controlledReadableByteStream._state;if(E!=="readable")throw new TypeError("The stream (in "+E+" state) is not in the readable state and cannot be enqueued to");je(this,g)},c.prototype.error=function(g){if(g===void 0&&(g=void 0),!gt(this))throw ge("error");Ce(this,g)},c.prototype[Me]=function(g){tt(this),ut(this);var E=this._cancelAlgorithm(g);return He(this),E},c.prototype[ze]=function(g){var E=this._controlledReadableByteStream;if(this._queueTotalSize>0){var L=this._queue.shift();this._queueTotalSize-=L.byteLength,_(this);var Y=new Uint8Array(L.buffer,L.byteOffset,L.byteLength);g._chunkSteps(Y);return}var se=this._autoAllocateChunkSize;if(se!==void 0){var xe=void 0;try{xe=new ArrayBuffer(se)}catch(Ar){g._errorSteps(Ar);return}var Je={buffer:xe,bufferByteLength:se,byteOffset:0,byteLength:se,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(Je)}ee(E,g),Ut(this)},c}();Object.defineProperties(Dt.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Dt.prototype,r.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function gt(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_controlledReadableByteStream")?!1:c instanceof Dt}function ua(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_associatedReadableByteStreamController")?!1:c instanceof mt}function Ut(c){var g=_e(c);if(g){if(c._pulling){c._pullAgain=!0;return}c._pulling=!0;var E=c._pullAlgorithm();k(E,function(){c._pulling=!1,c._pullAgain&&(c._pullAgain=!1,Ut(c))},function(L){Ce(c,L)})}}function tt(c){O(c),c._pendingPullIntos=new H}function Ga(c,g){var E=!1;c._state==="closed"&&(E=!0);var L=w(g);g.readerType==="default"?Fe(c,L,E):pe(c,L,E)}function w(c){var g=c.bytesFilled,E=c.elementSize;return new c.viewConstructor(c.buffer,c.byteOffset,g/E)}function b(c,g,E,L){c._queue.push({buffer:g,byteOffset:E,byteLength:L}),c._queueTotalSize+=L}function v(c,g){var E=g.elementSize,L=g.bytesFilled-g.bytesFilled%E,Y=Math.min(c._queueTotalSize,g.byteLength-g.bytesFilled),se=g.bytesFilled+Y,xe=se-se%E,Je=Y,Ar=!1;xe>L&&(Je=xe-g.bytesFilled,Ar=!0);for(var Br=c._queue;Je>0;){var Mr=Br.peek(),$r=Math.min(Je,Mr.byteLength),Lt=g.byteOffset+g.bytesFilled;sr(g.buffer,Lt,Mr.buffer,Mr.byteOffset,$r),Mr.byteLength===$r?Br.shift():(Mr.byteOffset+=$r,Mr.byteLength-=$r),c._queueTotalSize-=$r,p(c,$r,g),Je-=$r}return Ar}function p(c,g,E){E.bytesFilled+=g}function _(c){c._queueTotalSize===0&&c._closeRequested?(He(c),_u(c._controlledReadableByteStream)):Ut(c)}function O(c){c._byobRequest!==null&&(c._byobRequest._associatedReadableByteStreamController=void 0,c._byobRequest._view=null,c._byobRequest=null)}function z(c){for(;c._pendingPullIntos.length>0;){if(c._queueTotalSize===0)return;var g=c._pendingPullIntos.peek();v(c,g)&&(Ue(c),Ga(c._controlledReadableByteStream,g))}}function Q(c,g,E){var L=c._controlledReadableByteStream,Y=1;g.constructor!==DataView&&(Y=g.constructor.BYTES_PER_ELEMENT);var se=g.constructor,xe=g.buffer,Je={buffer:xe,bufferByteLength:xe.byteLength,byteOffset:g.byteOffset,byteLength:g.byteLength,bytesFilled:0,elementSize:Y,viewConstructor:se,readerType:"byob"};if(c._pendingPullIntos.length>0){c._pendingPullIntos.push(Je),re(L,E);return}if(L._state==="closed"){var Ar=new se(Je.buffer,Je.byteOffset,0);E._closeSteps(Ar);return}if(c._queueTotalSize>0){if(v(c,Je)){var Br=w(Je);_(c),E._chunkSteps(Br);return}if(c._closeRequested){var Mr=new TypeError("Insufficient bytes to fill elements in the given buffer");Ce(c,Mr),E._errorSteps(Mr);return}}c._pendingPullIntos.push(Je),re(L,E),Ut(c)}function ae(c,g){var E=c._controlledReadableByteStream;if(te(E))for(;oe(E)>0;){var L=Ue(c);Ga(E,L)}}function he(c,g,E){if(p(c,g,E),!(E.bytesFilled<E.elementSize)){Ue(c);var L=E.bytesFilled%E.elementSize;if(L>0){var Y=E.byteOffset+E.bytesFilled,se=Cr(E.buffer,Y-L,Y);b(c,se,0,se.byteLength)}E.bytesFilled-=L,Ga(c._controlledReadableByteStream,E),z(c)}}function me(c,g){var E=c._pendingPullIntos.peek();O(c);var L=c._controlledReadableByteStream._state;L==="closed"?ae(c):he(c,g,E),Ut(c)}function Ue(c){var g=c._pendingPullIntos.shift();return g}function _e(c){var g=c._controlledReadableByteStream;if(g._state!=="readable"||c._closeRequested||!c._started)return!1;if(Ge(g)&&Ke(g)>0||te(g)&&oe(g)>0)return!0;var E=ar(c);return E>0}function He(c){c._pullAlgorithm=void 0,c._cancelAlgorithm=void 0}function De(c){var g=c._controlledReadableByteStream;if(!(c._closeRequested||g._state!=="readable")){if(c._queueTotalSize>0){c._closeRequested=!0;return}if(c._pendingPullIntos.length>0){var E=c._pendingPullIntos.peek();if(E.bytesFilled>0){var L=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Ce(c,L),L}}He(c),_u(g)}}function je(c,g){var E=c._controlledReadableByteStream;if(!(c._closeRequested||E._state!=="readable")){var L=g.buffer,Y=g.byteOffset,se=g.byteLength,xe=L;if(c._pendingPullIntos.length>0){var Je=c._pendingPullIntos.peek();Vr(Je.buffer),Je.buffer=Je.buffer}if(O(c),Ge(E))if(Ke(E)===0)b(c,xe,Y,se);else{c._pendingPullIntos.length>0&&Ue(c);var Ar=new Uint8Array(xe,Y,se);Fe(E,Ar,!1)}else te(E)?(b(c,xe,Y,se),z(c)):b(c,xe,Y,se);Ut(c)}}function Ce(c,g){var E=c._controlledReadableByteStream;E._state==="readable"&&(tt(c),ut(c),He(c),O1(E,g))}function Oe(c){if(c._byobRequest===null&&c._pendingPullIntos.length>0){var g=c._pendingPullIntos.peek(),E=new Uint8Array(g.buffer,g.byteOffset+g.bytesFilled,g.byteLength-g.bytesFilled),L=Object.create(mt.prototype);qe(L,c,E),c._byobRequest=L}return c._byobRequest}function ar(c){var g=c._controlledReadableByteStream._state;return g==="errored"?null:g==="closed"?0:c._strategyHWM-c._queueTotalSize}function Ze(c,g){var E=c._pendingPullIntos.peek(),L=c._controlledReadableByteStream._state;if(L==="closed"){if(g!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(g===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(E.bytesFilled+g>E.byteLength)throw new RangeError("bytesWritten out of range")}E.buffer=E.buffer,me(c,g)}function Re(c,g){var E=c._pendingPullIntos.peek(),L=c._controlledReadableByteStream._state;if(L==="closed"){if(g.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(g.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(E.byteOffset+E.bytesFilled!==g.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(E.bufferByteLength!==g.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(E.bytesFilled+g.byteLength>E.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");var Y=g.byteLength;E.buffer=g.buffer,me(c,Y)}function Ae(c,g,E,L,Y,se,xe){g._controlledReadableByteStream=c,g._pullAgain=!1,g._pulling=!1,g._byobRequest=null,g._queue=g._queueTotalSize=void 0,ut(g),g._closeRequested=!1,g._started=!1,g._strategyHWM=se,g._pullAlgorithm=L,g._cancelAlgorithm=Y,g._autoAllocateChunkSize=xe,g._pendingPullIntos=new H,c._readableStreamController=g;var Je=E();k(d(Je),function(){g._started=!0,Ut(g)},function(Ar){Ce(g,Ar)})}function Te(c,g,E){var L=Object.create(Dt.prototype),Y=function(){},se=function(){return d(void 0)},xe=function(){return d(void 0)};g.start!==void 0&&(Y=function(){return g.start(L)}),g.pull!==void 0&&(se=function(){return g.pull(L)}),g.cancel!==void 0&&(xe=function(Ar){return g.cancel(Ar)});var Je=g.autoAllocateChunkSize;if(Je===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Ae(c,L,Y,se,xe,E,Je)}function qe(c,g,E){c._associatedReadableByteStreamController=g,c._view=E}function Ne(c){return new TypeError("ReadableStreamBYOBRequest.prototype."+c+" can only be used on a ReadableStreamBYOBRequest")}function ge(c){return new TypeError("ReadableByteStreamController.prototype."+c+" can only be used on a ReadableByteStreamController")}function J(c){return new ne(c)}function re(c,g){c._reader._readIntoRequests.push(g)}function pe(c,g,E){var L=c._reader,Y=L._readIntoRequests.shift();E?Y._closeSteps(g):Y._chunkSteps(g)}function oe(c){return c._reader._readIntoRequests.length}function te(c){var g=c._reader;return!(g===void 0||!We(g))}var ne=function(){function c(g){if(Be(g,1,"ReadableStreamBYOBReader"),qr(g,"First parameter"),$n(g))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!gt(g._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");N(this,g),this._readIntoRequests=new H}return Object.defineProperty(c.prototype,"closed",{get:function(){return We(this)?this._closedPromise:m(ir("closed"))},enumerable:!1,configurable:!0}),c.prototype.cancel=function(g){return g===void 0&&(g=void 0),We(this)?this._ownerReadableStream===void 0?m(X("cancel")):K(this,g):m(ir("cancel"))},c.prototype.read=function(g){if(!We(this))return m(ir("read"));if(!ArrayBuffer.isView(g))return m(new TypeError("view must be an array buffer view"));if(g.byteLength===0)return m(new TypeError("view must have non-zero byteLength"));if(g.buffer.byteLength===0)return m(new TypeError("view's buffer must have non-zero byteLength"));if(Vr(g.buffer),this._ownerReadableStream===void 0)return m(X("read from"));var E,L,Y=h(function(xe,Je){E=xe,L=Je}),se={_chunkSteps:function(xe){return E({value:xe,done:!1})},_closeSteps:function(xe){return E({value:xe,done:!0})},_errorSteps:function(xe){return L(xe)}};return fr(this,g,se),Y},c.prototype.releaseLock=function(){if(!We(this))throw ir("releaseLock");if(this._ownerReadableStream!==void 0){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");V(this)}},c}();Object.defineProperties(ne.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(ne.prototype,r.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function We(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_readIntoRequests")?!1:c instanceof ne}function fr(c,g,E){var L=c._ownerReadableStream;L._disturbed=!0,L._state==="errored"?E._errorSteps(L._storedError):Q(L._readableStreamController,g,E)}function ir(c){return new TypeError("ReadableStreamBYOBReader.prototype."+c+" can only be used on a ReadableStreamBYOBReader")}function ur(c,g){var E=c.highWaterMark;if(E===void 0)return g;if(br(E)||E<0)throw new RangeError("Invalid highWaterMark");return E}function M(c){var g=c.size;return g||function(){return 1}}function xr(c,g){Qe(c,g);var E=c==null?void 0:c.highWaterMark,L=c==null?void 0:c.size;return{highWaterMark:E===void 0?void 0:Se(E),size:L===void 0?void 0:Tr(L,g+" has member 'size' that")}}function Tr(c,g){return $e(c,g),function(E){return Se(c(E))}}function kr(c,g){Qe(c,g);var E=c==null?void 0:c.abort,L=c==null?void 0:c.close,Y=c==null?void 0:c.start,se=c==null?void 0:c.type,xe=c==null?void 0:c.write;return{abort:E===void 0?void 0:dr(E,c,g+" has member 'abort' that"),close:L===void 0?void 0:jr(L,c,g+" has member 'close' that"),start:Y===void 0?void 0:Sr(Y,c,g+" has member 'start' that"),write:xe===void 0?void 0:at(xe,c,g+" has member 'write' that"),type:se}}function dr(c,g,E){return $e(c,E),function(L){return I(c,g,[L])}}function jr(c,g,E){return $e(c,E),function(){return I(c,g,[])}}function Sr(c,g,E){return $e(c,E),function(L){return C(c,g,[L])}}function at(c,g,E){return $e(c,E),function(L,Y){return I(c,g,[L,Y])}}function Rr(c,g){if(!Le(c))throw new TypeError(g+" is not a WritableStream.")}function S(c){if(typeof c!="object"||c===null)return!1;try{return typeof c.aborted=="boolean"}catch{return!1}}var j=typeof AbortController=="function";function R(){if(j)return new AbortController}var G=function(){function c(g,E){g===void 0&&(g={}),E===void 0&&(E={}),g===void 0?g=null:tr(g,"First parameter");var L=xr(E,"Second parameter"),Y=kr(g,"First parameter");Ee(this);var se=Y.type;if(se!==void 0)throw new RangeError("Invalid type is specified");var xe=M(L),Je=ur(L,1);DA(this,Y,Je,xe)}return Object.defineProperty(c.prototype,"locked",{get:function(){if(!Le(this))throw fl("locked");return Or(this)},enumerable:!1,configurable:!0}),c.prototype.abort=function(g){return g===void 0&&(g=void 0),Le(this)?Or(this)?m(new TypeError("Cannot abort a stream that already has a writer")):ct(this,g):m(fl("abort"))},c.prototype.close=function(){return Le(this)?Or(this)?m(new TypeError("Cannot close a stream that already has a writer")):xi(this)?m(new TypeError("Cannot close an already-closing stream")):ca(this):m(fl("close"))},c.prototype.getWriter=function(){if(!Le(this))throw fl("getWriter");return ie(this)},c}();Object.defineProperties(G.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(G.prototype,r.toStringTag,{value:"WritableStream",configurable:!0});function ie(c){return new fs(c)}function ue(c,g,E,L,Y,se){Y===void 0&&(Y=1),se===void 0&&(se=function(){return 1});var xe=Object.create(G.prototype);Ee(xe);var Je=Object.create(To.prototype);return y1(xe,Je,c,g,E,L,Y,se),xe}function Ee(c){c._state="writable",c._storedError=void 0,c._writer=void 0,c._writableStreamController=void 0,c._writeRequests=new H,c._inFlightWriteRequest=void 0,c._closeRequest=void 0,c._inFlightCloseRequest=void 0,c._pendingAbortRequest=void 0,c._backpressure=!1}function Le(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_writableStreamController")?!1:c instanceof G}function Or(c){return c._writer!==void 0}function ct(c,g){var E;if(c._state==="closed"||c._state==="errored")return d(void 0);c._writableStreamController._abortReason=g,(E=c._writableStreamController._abortController)===null||E===void 0||E.abort();var L=c._state;if(L==="closed"||L==="errored")return d(void 0);if(c._pendingAbortRequest!==void 0)return c._pendingAbortRequest._promise;var Y=!1;L==="erroring"&&(Y=!0,g=void 0);var se=h(function(xe,Je){c._pendingAbortRequest={_promise:void 0,_resolve:xe,_reject:Je,_reason:g,_wasAlreadyErroring:Y}});return c._pendingAbortRequest._promise=se,Y||yn(c,g),se}function ca(c){var g=c._state;if(g==="closed"||g==="errored")return m(new TypeError("The stream (in "+g+" state) is not in the writable state and cannot be closed"));var E=h(function(Y,se){var xe={_resolve:Y,_reject:se};c._closeRequest=xe}),L=c._writer;return L!==void 0&&c._backpressure&&g==="writable"&&jd(L),LA(c._writableStreamController),E}function la(c){var g=h(function(E,L){var Y={_resolve:E,_reject:L};c._writeRequests.push(Y)});return g}function Ta(c,g){var E=c._state;if(E==="writable"){yn(c,g);return}ba(c)}function yn(c,g){var E=c._writableStreamController;c._state="erroring",c._storedError=g;var L=c._writer;L!==void 0&&m1(L,g),!PA(c)&&E._started&&ba(c)}function ba(c){c._state="errored",c._writableStreamController[ye]();var g=c._storedError;if(c._writeRequests.forEach(function(Y){Y._reject(g)}),c._writeRequests=new H,c._pendingAbortRequest===void 0){ul(c);return}var E=c._pendingAbortRequest;if(c._pendingAbortRequest=void 0,E._wasAlreadyErroring){E._reject(g),ul(c);return}var L=c._writableStreamController[we](E._reason);k(L,function(){E._resolve(),ul(c)},function(Y){E._reject(Y),ul(c)})}function Fa(c){c._inFlightWriteRequest._resolve(void 0),c._inFlightWriteRequest=void 0}function jo(c,g){c._inFlightWriteRequest._reject(g),c._inFlightWriteRequest=void 0,Ta(c,g)}function yi(c){c._inFlightCloseRequest._resolve(void 0),c._inFlightCloseRequest=void 0;var g=c._state;g==="erroring"&&(c._storedError=void 0,c._pendingAbortRequest!==void 0&&(c._pendingAbortRequest._resolve(),c._pendingAbortRequest=void 0)),c._state="closed";var E=c._writer;E!==void 0&&k1(E)}function ls(c,g){c._inFlightCloseRequest._reject(g),c._inFlightCloseRequest=void 0,c._pendingAbortRequest!==void 0&&(c._pendingAbortRequest._reject(g),c._pendingAbortRequest=void 0),Ta(c,g)}function xi(c){return!(c._closeRequest===void 0&&c._inFlightCloseRequest===void 0)}function PA(c){return!(c._inFlightWriteRequest===void 0&&c._inFlightCloseRequest===void 0)}function RA(c){c._inFlightCloseRequest=c._closeRequest,c._closeRequest=void 0}function CA(c){c._inFlightWriteRequest=c._writeRequests.shift()}function ul(c){c._closeRequest!==void 0&&(c._closeRequest._reject(c._storedError),c._closeRequest=void 0);var g=c._writer;g!==void 0&&Sd(g,c._storedError)}function yd(c,g){var E=c._writer;E!==void 0&&g!==c._backpressure&&(g?GA(E):jd(E)),c._backpressure=g}var fs=function(){function c(g){if(Be(g,1,"WritableStreamDefaultWriter"),Rr(g,"First parameter"),Or(g))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=g,g._writer=this;var E=g._state;if(E==="writable")!xi(g)&&g._backpressure?dl(this):S1(this),pl(this);else if(E==="erroring")Ed(this,g._storedError),pl(this);else if(E==="closed")S1(this),UA(this);else{var L=g._storedError;Ed(this,L),_1(this,L)}}return Object.defineProperty(c.prototype,"closed",{get:function(){return Ao(this)?this._closedPromise:m(Po("closed"))},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"desiredSize",{get:function(){if(!Ao(this))throw Po("desiredSize");if(this._ownerWritableStream===void 0)throw yu("desiredSize");return FA(this)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ready",{get:function(){return Ao(this)?this._readyPromise:m(Po("ready"))},enumerable:!1,configurable:!0}),c.prototype.abort=function(g){return g===void 0&&(g=void 0),Ao(this)?this._ownerWritableStream===void 0?m(yu("abort")):OA(this,g):m(Po("abort"))},c.prototype.close=function(){if(!Ao(this))return m(Po("close"));var g=this._ownerWritableStream;return g===void 0?m(yu("close")):xi(g)?m(new TypeError("Cannot close an already-closing stream")):h1(this)},c.prototype.releaseLock=function(){if(!Ao(this))throw Po("releaseLock");var g=this._ownerWritableStream;g!==void 0&&g1(this)},c.prototype.write=function(g){return g===void 0&&(g=void 0),Ao(this)?this._ownerWritableStream===void 0?m(yu("write to")):v1(this,g):m(Po("write"))},c}();Object.defineProperties(fs.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(fs.prototype,r.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function Ao(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_ownerWritableStream")?!1:c instanceof fs}function OA(c,g){var E=c._ownerWritableStream;return ct(E,g)}function h1(c){var g=c._ownerWritableStream;return ca(g)}function IA(c){var g=c._ownerWritableStream,E=g._state;return xi(g)||E==="closed"?d(void 0):E==="errored"?m(g._storedError):h1(c)}function BA(c,g){c._closedPromiseState==="pending"?Sd(c,g):HA(c,g)}function m1(c,g){c._readyPromiseState==="pending"?E1(c,g):WA(c,g)}function FA(c){var g=c._ownerWritableStream,E=g._state;return E==="errored"||E==="erroring"?null:E==="closed"?0:x1(g._writableStreamController)}function g1(c){var g=c._ownerWritableStream,E=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");m1(c,E),BA(c,E),g._writer=void 0,c._ownerWritableStream=void 0}function v1(c,g){var E=c._ownerWritableStream,L=E._writableStreamController,Y=qA(L,g);if(E!==c._ownerWritableStream)return m(yu("write to"));var se=E._state;if(se==="errored")return m(E._storedError);if(xi(E)||se==="closed")return m(new TypeError("The stream is closing or closed and cannot be written to"));if(se==="erroring")return m(E._storedError);var xe=la(E);return MA(L,g,Y),xe}var b1={},To=function(){function c(){throw new TypeError("Illegal constructor")}return Object.defineProperty(c.prototype,"abortReason",{get:function(){if(!xd(this))throw kd("abortReason");return this._abortReason},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"signal",{get:function(){if(!xd(this))throw kd("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal},enumerable:!1,configurable:!0}),c.prototype.error=function(g){if(g===void 0&&(g=void 0),!xd(this))throw kd("error");var E=this._controlledWritableStream._state;E==="writable"&&w1(this,g)},c.prototype[we]=function(g){var E=this._abortAlgorithm(g);return cl(this),E},c.prototype[ye]=function(){ut(this)},c}();Object.defineProperties(To.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(To.prototype,r.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function xd(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_controlledWritableStream")?!1:c instanceof To}function y1(c,g,E,L,Y,se,xe,Je){g._controlledWritableStream=c,c._writableStreamController=g,g._queue=void 0,g._queueTotalSize=void 0,ut(g),g._abortReason=void 0,g._abortController=R(),g._started=!1,g._strategySizeAlgorithm=Je,g._strategyHWM=xe,g._writeAlgorithm=L,g._closeAlgorithm=Y,g._abortAlgorithm=se;var Ar=_d(g);yd(c,Ar);var Br=E(),Mr=d(Br);k(Mr,function(){g._started=!0,ll(g)},function($r){g._started=!0,Ta(c,$r)})}function DA(c,g,E,L){var Y=Object.create(To.prototype),se=function(){},xe=function(){return d(void 0)},Je=function(){return d(void 0)},Ar=function(){return d(void 0)};g.start!==void 0&&(se=function(){return g.start(Y)}),g.write!==void 0&&(xe=function(Br){return g.write(Br,Y)}),g.close!==void 0&&(Je=function(){return g.close()}),g.abort!==void 0&&(Ar=function(Br){return g.abort(Br)}),y1(c,Y,se,xe,Je,Ar,E,L)}function cl(c){c._writeAlgorithm=void 0,c._closeAlgorithm=void 0,c._abortAlgorithm=void 0,c._strategySizeAlgorithm=void 0}function LA(c){va(c,b1,0),ll(c)}function qA(c,g){try{return c._strategySizeAlgorithm(g)}catch(E){return wd(c,E),1}}function x1(c){return c._strategyHWM-c._queueTotalSize}function MA(c,g,E){try{va(c,g,E)}catch(se){wd(c,se);return}var L=c._controlledWritableStream;if(!xi(L)&&L._state==="writable"){var Y=_d(c);yd(L,Y)}ll(c)}function ll(c){var g=c._controlledWritableStream;if(c._started&&g._inFlightWriteRequest===void 0){var E=g._state;if(E==="erroring"){ba(g);return}if(c._queue.length!==0){var L=rt(c);L===b1?zA(c):NA(c,L)}}}function wd(c,g){c._controlledWritableStream._state==="writable"&&w1(c,g)}function zA(c){var g=c._controlledWritableStream;RA(g),sa(c);var E=c._closeAlgorithm();cl(c),k(E,function(){yi(g)},function(L){ls(g,L)})}function NA(c,g){var E=c._controlledWritableStream;CA(E);var L=c._writeAlgorithm(g);k(L,function(){Fa(E);var Y=E._state;if(sa(c),!xi(E)&&Y==="writable"){var se=_d(c);yd(E,se)}ll(c)},function(Y){E._state==="writable"&&cl(c),jo(E,Y)})}function _d(c){var g=x1(c);return g<=0}function w1(c,g){var E=c._controlledWritableStream;cl(c),yn(E,g)}function fl(c){return new TypeError("WritableStream.prototype."+c+" can only be used on a WritableStream")}function kd(c){return new TypeError("WritableStreamDefaultController.prototype."+c+" can only be used on a WritableStreamDefaultController")}function Po(c){return new TypeError("WritableStreamDefaultWriter.prototype."+c+" can only be used on a WritableStreamDefaultWriter")}function yu(c){return new TypeError("Cannot "+c+" a stream using a released writer")}function pl(c){c._closedPromise=h(function(g,E){c._closedPromise_resolve=g,c._closedPromise_reject=E,c._closedPromiseState="pending"})}function _1(c,g){pl(c),Sd(c,g)}function UA(c){pl(c),k1(c)}function Sd(c,g){c._closedPromise_reject!==void 0&&(T(c._closedPromise),c._closedPromise_reject(g),c._closedPromise_resolve=void 0,c._closedPromise_reject=void 0,c._closedPromiseState="rejected")}function HA(c,g){_1(c,g)}function k1(c){c._closedPromise_resolve!==void 0&&(c._closedPromise_resolve(void 0),c._closedPromise_resolve=void 0,c._closedPromise_reject=void 0,c._closedPromiseState="resolved")}function dl(c){c._readyPromise=h(function(g,E){c._readyPromise_resolve=g,c._readyPromise_reject=E}),c._readyPromiseState="pending"}function Ed(c,g){dl(c),E1(c,g)}function S1(c){dl(c),jd(c)}function E1(c,g){c._readyPromise_reject!==void 0&&(T(c._readyPromise),c._readyPromise_reject(g),c._readyPromise_resolve=void 0,c._readyPromise_reject=void 0,c._readyPromiseState="rejected")}function GA(c){dl(c)}function WA(c,g){Ed(c,g)}function jd(c){c._readyPromise_resolve!==void 0&&(c._readyPromise_resolve(void 0),c._readyPromise_resolve=void 0,c._readyPromise_reject=void 0,c._readyPromiseState="fulfilled")}var j1=typeof DOMException<"u"?DOMException:void 0;function VA(c){if(!(typeof c=="function"||typeof c=="object"))return!1;try{return new c,!0}catch{return!1}}function $A(){var c=function(E,L){this.message=E||"",this.name=L||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return c.prototype=Object.create(Error.prototype),Object.defineProperty(c.prototype,"constructor",{value:c,writable:!0,configurable:!0}),c}var KA=VA(j1)?j1:$A();function A1(c,g,E,L,Y,se){var xe=Kr(c),Je=ie(g);c._disturbed=!0;var Ar=!1,Br=d(void 0);return h(function(Mr,$r){var Lt;if(se!==void 0){if(Lt=function(){var wr=new KA("Aborted","AbortError"),Yr=[];L||Yr.push(function(){return g._state==="writable"?ct(g,wr):d(void 0)}),Y||Yr.push(function(){return c._state==="readable"?wi(c,wr):d(void 0)}),Wa(function(){return Promise.all(Yr.map(function(bt){return bt()}))},!0,wr)},se.aborted){Lt();return}se.addEventListener("abort",Lt)}function _i(){return h(function(wr,Yr){function bt($i){$i?wr():y(hs(),bt,Yr)}bt(!1)})}function hs(){return Ar?d(!0):y(Je._readyPromise,function(){return h(function(wr,Yr){or(xe,{_chunkSteps:function(bt){Br=y(v1(Je,bt),void 0,t),wr(!1)},_closeSteps:function(){return wr(!0)},_errorSteps:Yr})})})}if(fa(c,xe._closedPromise,function(wr){L?wn(!0,wr):Wa(function(){return ct(g,wr)},!0,wr)}),fa(g,Je._closedPromise,function(wr){Y?wn(!0,wr):Wa(function(){return wi(c,wr)},!0,wr)}),Vi(c,xe._closedPromise,function(){E?wn():Wa(function(){return IA(Je)})}),xi(g)||g._state==="closed"){var Kn=new TypeError("the destination writable stream closed before all data could be piped to it");Y?wn(!0,Kn):Wa(function(){return wi(c,Kn)},!0,Kn)}T(_i());function Wi(){var wr=Br;return y(Br,function(){return wr!==Br?Wi():void 0})}function fa(wr,Yr,bt){wr._state==="errored"?bt(wr._storedError):A(Yr,bt)}function Vi(wr,Yr,bt){wr._state==="closed"?bt():x(Yr,bt)}function Wa(wr,Yr,bt){if(Ar)return;Ar=!0,g._state==="writable"&&!xi(g)?x(Wi(),$i):$i();function $i(){k(wr(),function(){return vt(Yr,bt)},function(Yn){return vt(!0,Yn)})}}function wn(wr,Yr){Ar||(Ar=!0,g._state==="writable"&&!xi(g)?x(Wi(),function(){return vt(wr,Yr)}):vt(wr,Yr))}function vt(wr,Yr){g1(Je),V(xe),se!==void 0&&se.removeEventListener("abort",Lt),wr?$r(Yr):Mr(void 0)}})}var Ro=function(){function c(){throw new TypeError("Illegal constructor")}return Object.defineProperty(c.prototype,"desiredSize",{get:function(){if(!hl(this))throw vl("desiredSize");return Ad(this)},enumerable:!1,configurable:!0}),c.prototype.close=function(){if(!hl(this))throw vl("close");if(!ps(this))throw new TypeError("The stream is not in a state that permits close");wu(this)},c.prototype.enqueue=function(g){if(g===void 0&&(g=void 0),!hl(this))throw vl("enqueue");if(!ps(this))throw new TypeError("The stream is not in a state that permits enqueue");return gl(this,g)},c.prototype.error=function(g){if(g===void 0&&(g=void 0),!hl(this))throw vl("error");Wn(this,g)},c.prototype[Me]=function(g){ut(this);var E=this._cancelAlgorithm(g);return ml(this),E},c.prototype[ze]=function(g){var E=this._controlledReadableStream;if(this._queue.length>0){var L=sa(this);this._closeRequested&&this._queue.length===0?(ml(this),_u(E)):xu(this),g._chunkSteps(L)}else ee(E,g),xu(this)},c}();Object.defineProperties(Ro.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Ro.prototype,r.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function hl(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_controlledReadableStream")?!1:c instanceof Ro}function xu(c){var g=T1(c);if(g){if(c._pulling){c._pullAgain=!0;return}c._pulling=!0;var E=c._pullAlgorithm();k(E,function(){c._pulling=!1,c._pullAgain&&(c._pullAgain=!1,xu(c))},function(L){Wn(c,L)})}}function T1(c){var g=c._controlledReadableStream;if(!ps(c)||!c._started)return!1;if($n(g)&&Ke(g)>0)return!0;var E=Ad(c);return E>0}function ml(c){c._pullAlgorithm=void 0,c._cancelAlgorithm=void 0,c._strategySizeAlgorithm=void 0}function wu(c){if(ps(c)){var g=c._controlledReadableStream;c._closeRequested=!0,c._queue.length===0&&(ml(c),_u(g))}}function gl(c,g){if(ps(c)){var E=c._controlledReadableStream;if($n(E)&&Ke(E)>0)Fe(E,g,!1);else{var L=void 0;try{L=c._strategySizeAlgorithm(g)}catch(Y){throw Wn(c,Y),Y}try{va(c,g,L)}catch(Y){throw Wn(c,Y),Y}}xu(c)}}function Wn(c,g){var E=c._controlledReadableStream;E._state==="readable"&&(ut(c),ml(c),O1(E,g))}function Ad(c){var g=c._controlledReadableStream._state;return g==="errored"?null:g==="closed"?0:c._strategyHWM-c._queueTotalSize}function YA(c){return!T1(c)}function ps(c){var g=c._controlledReadableStream._state;return!c._closeRequested&&g==="readable"}function P1(c,g,E,L,Y,se,xe){g._controlledReadableStream=c,g._queue=void 0,g._queueTotalSize=void 0,ut(g),g._started=!1,g._closeRequested=!1,g._pullAgain=!1,g._pulling=!1,g._strategySizeAlgorithm=xe,g._strategyHWM=se,g._pullAlgorithm=L,g._cancelAlgorithm=Y,c._readableStreamController=g;var Je=E();k(d(Je),function(){g._started=!0,xu(g)},function(Ar){Wn(g,Ar)})}function XA(c,g,E,L){var Y=Object.create(Ro.prototype),se=function(){},xe=function(){return d(void 0)},Je=function(){return d(void 0)};g.start!==void 0&&(se=function(){return g.start(Y)}),g.pull!==void 0&&(xe=function(){return g.pull(Y)}),g.cancel!==void 0&&(Je=function(Ar){return g.cancel(Ar)}),P1(c,Y,se,xe,Je,E,L)}function vl(c){return new TypeError("ReadableStreamDefaultController.prototype."+c+" can only be used on a ReadableStreamDefaultController")}function QA(c,g){return gt(c._readableStreamController)?JA(c):ZA(c)}function ZA(c,g){var E=Kr(c),L=!1,Y=!1,se=!1,xe=!1,Je,Ar,Br,Mr,$r,Lt=h(function(fa){$r=fa});function _i(){if(L)return Y=!0,d(void 0);L=!0;var fa={_chunkSteps:function(Vi){B(function(){Y=!1;var Wa=Vi,wn=Vi;se||gl(Br._readableStreamController,Wa),xe||gl(Mr._readableStreamController,wn),L=!1,Y&&_i()})},_closeSteps:function(){L=!1,se||wu(Br._readableStreamController),xe||wu(Mr._readableStreamController),(!se||!xe)&&$r(void 0)},_errorSteps:function(){L=!1}};return or(E,fa),d(void 0)}function hs(fa){if(se=!0,Je=fa,xe){var Vi=_r([Je,Ar]),Wa=wi(c,Vi);$r(Wa)}return Lt}function Kn(fa){if(xe=!0,Ar=fa,se){var Vi=_r([Je,Ar]),Wa=wi(c,Vi);$r(Wa)}return Lt}function Wi(){}return Br=Td(Wi,_i,hs),Mr=Td(Wi,_i,Kn),A(E._closedPromise,function(fa){Wn(Br._readableStreamController,fa),Wn(Mr._readableStreamController,fa),(!se||!xe)&&$r(void 0)}),[Br,Mr]}function JA(c){var g=Kr(c),E=!1,L=!1,Y=!1,se=!1,xe=!1,Je,Ar,Br,Mr,$r,Lt=h(function(vt){$r=vt});function _i(vt){A(vt._closedPromise,function(wr){vt===g&&(Ce(Br._readableStreamController,wr),Ce(Mr._readableStreamController,wr),(!se||!xe)&&$r(void 0))})}function hs(){We(g)&&(V(g),g=Kr(c),_i(g));var vt={_chunkSteps:function(wr){B(function(){L=!1,Y=!1;var Yr=wr,bt=wr;if(!se&&!xe)try{bt=Ft(wr)}catch($i){Ce(Br._readableStreamController,$i),Ce(Mr._readableStreamController,$i),$r(wi(c,$i));return}se||je(Br._readableStreamController,Yr),xe||je(Mr._readableStreamController,bt),E=!1,L?Wi():Y&&fa()})},_closeSteps:function(){E=!1,se||De(Br._readableStreamController),xe||De(Mr._readableStreamController),Br._readableStreamController._pendingPullIntos.length>0&&Ze(Br._readableStreamController,0),Mr._readableStreamController._pendingPullIntos.length>0&&Ze(Mr._readableStreamController,0),(!se||!xe)&&$r(void 0)},_errorSteps:function(){E=!1}};or(g,vt)}function Kn(vt,wr){er(g)&&(V(g),g=J(c),_i(g));var Yr=wr?Mr:Br,bt=wr?Br:Mr,$i={_chunkSteps:function(Yn){B(function(){L=!1,Y=!1;var ms=wr?xe:se,ju=wr?se:xe;if(ju)ms||Re(Yr._readableStreamController,Yn);else{var W1=void 0;try{W1=Ft(Yn)}catch(Od){Ce(Yr._readableStreamController,Od),Ce(bt._readableStreamController,Od),$r(wi(c,Od));return}ms||Re(Yr._readableStreamController,Yn),je(bt._readableStreamController,W1)}E=!1,L?Wi():Y&&fa()})},_closeSteps:function(Yn){E=!1;var ms=wr?xe:se,ju=wr?se:xe;ms||De(Yr._readableStreamController),ju||De(bt._readableStreamController),Yn!==void 0&&(ms||Re(Yr._readableStreamController,Yn),!ju&&bt._readableStreamController._pendingPullIntos.length>0&&Ze(bt._readableStreamController,0)),(!ms||!ju)&&$r(void 0)},_errorSteps:function(){E=!1}};fr(g,vt,$i)}function Wi(){if(E)return L=!0,d(void 0);E=!0;var vt=Oe(Br._readableStreamController);return vt===null?hs():Kn(vt._view,!1),d(void 0)}function fa(){if(E)return Y=!0,d(void 0);E=!0;var vt=Oe(Mr._readableStreamController);return vt===null?hs():Kn(vt._view,!0),d(void 0)}function Vi(vt){if(se=!0,Je=vt,xe){var wr=_r([Je,Ar]),Yr=wi(c,wr);$r(Yr)}return Lt}function Wa(vt){if(xe=!0,Ar=vt,se){var wr=_r([Je,Ar]),Yr=wi(c,wr);$r(Yr)}return Lt}function wn(){}return Br=C1(wn,Wi,Vi),Mr=C1(wn,fa,Wa),_i(g),[Br,Mr]}function eT(c,g){Qe(c,g);var E=c,L=E==null?void 0:E.autoAllocateChunkSize,Y=E==null?void 0:E.cancel,se=E==null?void 0:E.pull,xe=E==null?void 0:E.start,Je=E==null?void 0:E.type;return{autoAllocateChunkSize:L===void 0?void 0:cr(L,g+" has member 'autoAllocateChunkSize' that"),cancel:Y===void 0?void 0:rT(Y,E,g+" has member 'cancel' that"),pull:se===void 0?void 0:tT(se,E,g+" has member 'pull' that"),start:xe===void 0?void 0:aT(xe,E,g+" has member 'start' that"),type:Je===void 0?void 0:iT(Je,g+" has member 'type' that")}}function rT(c,g,E){return $e(c,E),function(L){return I(c,g,[L])}}function tT(c,g,E){return $e(c,E),function(L){return I(c,g,[L])}}function aT(c,g,E){return $e(c,E),function(L){return C(c,g,[L])}}function iT(c,g){if(c=""+c,c!=="bytes")throw new TypeError(g+" '"+c+"' is not a valid enumeration value for ReadableStreamType");return c}function nT(c,g){Qe(c,g);var E=c==null?void 0:c.mode;return{mode:E===void 0?void 0:oT(E,g+" has member 'mode' that")}}function oT(c,g){if(c=""+c,c!=="byob")throw new TypeError(g+" '"+c+"' is not a valid enumeration value for ReadableStreamReaderMode");return c}function sT(c,g){Qe(c,g);var E=c==null?void 0:c.preventCancel;return{preventCancel:Boolean(E)}}function R1(c,g){Qe(c,g);var E=c==null?void 0:c.preventAbort,L=c==null?void 0:c.preventCancel,Y=c==null?void 0:c.preventClose,se=c==null?void 0:c.signal;return se!==void 0&&uT(se,g+" has member 'signal' that"),{preventAbort:Boolean(E),preventCancel:Boolean(L),preventClose:Boolean(Y),signal:se}}function uT(c,g){if(!S(c))throw new TypeError(g+" is not an AbortSignal.")}function cT(c,g){Qe(c,g);var E=c==null?void 0:c.readable;de(E,"readable","ReadableWritablePair"),qr(E,g+" has member 'readable' that");var L=c==null?void 0:c.writable;return de(L,"writable","ReadableWritablePair"),Rr(L,g+" has member 'writable' that"),{readable:E,writable:L}}var xn=function(){function c(g,E){g===void 0&&(g={}),E===void 0&&(E={}),g===void 0?g=null:tr(g,"First parameter");var L=xr(E,"Second parameter"),Y=eT(g,"First parameter");if(Pd(this),Y.type==="bytes"){if(L.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");var se=ur(L,0);Te(this,Y,se)}else{var xe=M(L),se=ur(L,1);XA(this,Y,se,xe)}}return Object.defineProperty(c.prototype,"locked",{get:function(){if(!Vn(this))throw Co("locked");return $n(this)},enumerable:!1,configurable:!0}),c.prototype.cancel=function(g){return g===void 0&&(g=void 0),Vn(this)?$n(this)?m(new TypeError("Cannot cancel a stream that already has a reader")):wi(this,g):m(Co("cancel"))},c.prototype.getReader=function(g){if(g===void 0&&(g=void 0),!Vn(this))throw Co("getReader");var E=nT(g,"First parameter");return E.mode===void 0?Kr(this):J(this)},c.prototype.pipeThrough=function(g,E){if(E===void 0&&(E={}),!Vn(this))throw Co("pipeThrough");Be(g,1,"pipeThrough");var L=cT(g,"First parameter"),Y=R1(E,"Second parameter");if($n(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Or(L.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");var se=A1(this,L.writable,Y.preventClose,Y.preventAbort,Y.preventCancel,Y.signal);return T(se),L.readable},c.prototype.pipeTo=function(g,E){if(E===void 0&&(E={}),!Vn(this))return m(Co("pipeTo"));if(g===void 0)return m("Parameter 1 is required in 'pipeTo'.");if(!Le(g))return m(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));var L;try{L=R1(E,"Second parameter")}catch(Y){return m(Y)}return $n(this)?m(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Or(g)?m(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):A1(this,g,L.preventClose,L.preventAbort,L.preventCancel,L.signal)},c.prototype.tee=function(){if(!Vn(this))throw Co("tee");var g=QA(this);return _r(g)},c.prototype.values=function(g){if(g===void 0&&(g=void 0),!Vn(this))throw Co("values");var E=sT(g,"First parameter");return pr(this,E.preventCancel)},c}();Object.defineProperties(xn.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(xn.prototype,r.toStringTag,{value:"ReadableStream",configurable:!0}),typeof r.asyncIterator=="symbol"&&Object.defineProperty(xn.prototype,r.asyncIterator,{value:xn.prototype.values,writable:!0,configurable:!0});function Td(c,g,E,L,Y){L===void 0&&(L=1),Y===void 0&&(Y=function(){return 1});var se=Object.create(xn.prototype);Pd(se);var xe=Object.create(Ro.prototype);return P1(se,xe,c,g,E,L,Y),se}function C1(c,g,E){var L=Object.create(xn.prototype);Pd(L);var Y=Object.create(Dt.prototype);return Ae(L,Y,c,g,E,0,void 0),L}function Pd(c){c._state="readable",c._reader=void 0,c._storedError=void 0,c._disturbed=!1}function Vn(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_readableStreamController")?!1:c instanceof xn}function $n(c){return c._reader!==void 0}function wi(c,g){if(c._disturbed=!0,c._state==="closed")return d(void 0);if(c._state==="errored")return m(c._storedError);_u(c);var E=c._reader;E!==void 0&&We(E)&&(E._readIntoRequests.forEach(function(Y){Y._closeSteps(void 0)}),E._readIntoRequests=new H);var L=c._readableStreamController[Me](g);return P(L,t)}function _u(c){c._state="closed";var g=c._reader;g!==void 0&&(fe(g),er(g)&&(g._readRequests.forEach(function(E){E._closeSteps()}),g._readRequests=new H))}function O1(c,g){c._state="errored",c._storedError=g;var E=c._reader;E!==void 0&&(le(E,g),er(E)?(E._readRequests.forEach(function(L){L._errorSteps(g)}),E._readRequests=new H):(E._readIntoRequests.forEach(function(L){L._errorSteps(g)}),E._readIntoRequests=new H))}function Co(c){return new TypeError("ReadableStream.prototype."+c+" can only be used on a ReadableStream")}function I1(c,g){Qe(c,g);var E=c==null?void 0:c.highWaterMark;return de(E,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Se(E)}}var B1=function(c){return c.byteLength};try{Object.defineProperty(B1,"name",{value:"size",configurable:!0})}catch{}var ku=function(){function c(g){Be(g,1,"ByteLengthQueuingStrategy"),g=I1(g,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=g.highWaterMark}return Object.defineProperty(c.prototype,"highWaterMark",{get:function(){if(!D1(this))throw F1("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"size",{get:function(){if(!D1(this))throw F1("size");return B1},enumerable:!1,configurable:!0}),c}();Object.defineProperties(ku.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(ku.prototype,r.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function F1(c){return new TypeError("ByteLengthQueuingStrategy.prototype."+c+" can only be used on a ByteLengthQueuingStrategy")}function D1(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_byteLengthQueuingStrategyHighWaterMark")?!1:c instanceof ku}var L1=function(){return 1};try{Object.defineProperty(L1,"name",{value:"size",configurable:!0})}catch{}var Su=function(){function c(g){Be(g,1,"CountQueuingStrategy"),g=I1(g,"First parameter"),this._countQueuingStrategyHighWaterMark=g.highWaterMark}return Object.defineProperty(c.prototype,"highWaterMark",{get:function(){if(!M1(this))throw q1("highWaterMark");return this._countQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"size",{get:function(){if(!M1(this))throw q1("size");return L1},enumerable:!1,configurable:!0}),c}();Object.defineProperties(Su.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Su.prototype,r.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function q1(c){return new TypeError("CountQueuingStrategy.prototype."+c+" can only be used on a CountQueuingStrategy")}function M1(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_countQueuingStrategyHighWaterMark")?!1:c instanceof Su}function lT(c,g){Qe(c,g);var E=c==null?void 0:c.flush,L=c==null?void 0:c.readableType,Y=c==null?void 0:c.start,se=c==null?void 0:c.transform,xe=c==null?void 0:c.writableType;return{flush:E===void 0?void 0:fT(E,c,g+" has member 'flush' that"),readableType:L,start:Y===void 0?void 0:pT(Y,c,g+" has member 'start' that"),transform:se===void 0?void 0:dT(se,c,g+" has member 'transform' that"),writableType:xe}}function fT(c,g,E){return $e(c,E),function(L){return I(c,g,[L])}}function pT(c,g,E){return $e(c,E),function(L){return C(c,g,[L])}}function dT(c,g,E){return $e(c,E),function(L,Y){return I(c,g,[L,Y])}}var Eu=function(){function c(g,E,L){g===void 0&&(g={}),E===void 0&&(E={}),L===void 0&&(L={}),g===void 0&&(g=null);var Y=xr(E,"Second parameter"),se=xr(L,"Third parameter"),xe=lT(g,"First parameter");if(xe.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(xe.writableType!==void 0)throw new RangeError("Invalid writableType specified");var Je=ur(se,0),Ar=M(se),Br=ur(Y,1),Mr=M(Y),$r,Lt=h(function(_i){$r=_i});hT(this,Lt,Br,Mr,Je,Ar),gT(this,xe),xe.start!==void 0?$r(xe.start(this._transformStreamController)):$r(void 0)}return Object.defineProperty(c.prototype,"readable",{get:function(){if(!z1(this))throw G1("readable");return this._readable},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"writable",{get:function(){if(!z1(this))throw G1("writable");return this._writable},enumerable:!1,configurable:!0}),c}();Object.defineProperties(Eu.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Eu.prototype,r.toStringTag,{value:"TransformStream",configurable:!0});function hT(c,g,E,L,Y,se){function xe(){return g}function Je(Lt){return yT(c,Lt)}function Ar(Lt){return xT(c,Lt)}function Br(){return wT(c)}c._writable=ue(xe,Je,Br,Ar,E,L);function Mr(){return _T(c)}function $r(Lt){return yl(c,Lt),d(void 0)}c._readable=Td(xe,Mr,$r,Y,se),c._backpressure=void 0,c._backpressureChangePromise=void 0,c._backpressureChangePromise_resolve=void 0,xl(c,!0),c._transformStreamController=void 0}function z1(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_transformStreamController")?!1:c instanceof Eu}function bl(c,g){Wn(c._readable._readableStreamController,g),yl(c,g)}function yl(c,g){N1(c._transformStreamController),wd(c._writable._writableStreamController,g),c._backpressure&&xl(c,!1)}function xl(c,g){c._backpressureChangePromise!==void 0&&c._backpressureChangePromise_resolve(),c._backpressureChangePromise=h(function(E){c._backpressureChangePromise_resolve=E}),c._backpressure=g}var ds=function(){function c(){throw new TypeError("Illegal constructor")}return Object.defineProperty(c.prototype,"desiredSize",{get:function(){if(!wl(this))throw _l("desiredSize");var g=this._controlledTransformStream._readable._readableStreamController;return Ad(g)},enumerable:!1,configurable:!0}),c.prototype.enqueue=function(g){if(g===void 0&&(g=void 0),!wl(this))throw _l("enqueue");U1(this,g)},c.prototype.error=function(g){if(g===void 0&&(g=void 0),!wl(this))throw _l("error");vT(this,g)},c.prototype.terminate=function(){if(!wl(this))throw _l("terminate");bT(this)},c}();Object.defineProperties(ds.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(ds.prototype,r.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function wl(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_controlledTransformStream")?!1:c instanceof ds}function mT(c,g,E,L){g._controlledTransformStream=c,c._transformStreamController=g,g._transformAlgorithm=E,g._flushAlgorithm=L}function gT(c,g){var E=Object.create(ds.prototype),L=function(se){try{return U1(E,se),d(void 0)}catch(xe){return m(xe)}},Y=function(){return d(void 0)};g.transform!==void 0&&(L=function(se){return g.transform(se,E)}),g.flush!==void 0&&(Y=function(){return g.flush(E)}),mT(c,E,L,Y)}function N1(c){c._transformAlgorithm=void 0,c._flushAlgorithm=void 0}function U1(c,g){var E=c._controlledTransformStream,L=E._readable._readableStreamController;if(!ps(L))throw new TypeError("Readable side is not in a state that permits enqueue");try{gl(L,g)}catch(se){throw yl(E,se),E._readable._storedError}var Y=YA(L);Y!==E._backpressure&&xl(E,!0)}function vT(c,g){bl(c._controlledTransformStream,g)}function H1(c,g){var E=c._transformAlgorithm(g);return P(E,void 0,function(L){throw bl(c._controlledTransformStream,L),L})}function bT(c){var g=c._controlledTransformStream,E=g._readable._readableStreamController;wu(E);var L=new TypeError("TransformStream terminated");yl(g,L)}function yT(c,g){var E=c._transformStreamController;if(c._backpressure){var L=c._backpressureChangePromise;return P(L,function(){var Y=c._writable,se=Y._state;if(se==="erroring")throw Y._storedError;return H1(E,g)})}return H1(E,g)}function xT(c,g){return bl(c,g),d(void 0)}function wT(c){var g=c._readable,E=c._transformStreamController,L=E._flushAlgorithm();return N1(E),P(L,function(){if(g._state==="errored")throw g._storedError;wu(g._readableStreamController)},function(Y){throw bl(c,Y),g._storedError})}function _T(c){return xl(c,!1),c._backpressureChangePromise}function _l(c){return new TypeError("TransformStreamDefaultController.prototype."+c+" can only be used on a TransformStreamDefaultController")}function G1(c){return new TypeError("TransformStream.prototype."+c+" can only be used on a TransformStream")}var Rd={ReadableStream:xn,ReadableStreamDefaultController:Ro,ReadableByteStreamController:Dt,ReadableStreamBYOBRequest:mt,ReadableStreamDefaultReader:Xe,ReadableStreamBYOBReader:ne,WritableStream:G,WritableStreamDefaultController:To,WritableStreamDefaultWriter:fs,ByteLengthQueuingStrategy:ku,CountQueuingStrategy:Su,TransformStream:Eu,TransformStreamDefaultController:ds};if(typeof a<"u")for(var Cd in Rd)Object.prototype.hasOwnProperty.call(Rd,Cd)&&Object.defineProperty(a,Cd,{value:Rd[Cd],writable:!0,configurable:!0});e.ByteLengthQueuingStrategy=ku,e.CountQueuingStrategy=Su,e.ReadableByteStreamController=Dt,e.ReadableStream=xn,e.ReadableStreamBYOBReader=ne,e.ReadableStreamBYOBRequest=mt,e.ReadableStreamDefaultController=Ro,e.ReadableStreamDefaultReader=Xe,e.TransformStream=Eu,e.TransformStreamDefaultController=ds,e.WritableStream=G,e.WritableStreamDefaultController=To,e.WritableStreamDefaultWriter=fs,Object.defineProperty(e,"__esModule",{value:!0})})});var oA=D(pd=>{var u1,dd,c1,hd,Qj,l1,Zj,Jj,eA=new Uint8Array([0]),ga=[171,75,84,88,32,50,48,187,13,10,26,10];(function(e){e[e.NONE=0]="NONE",e[e.BASISLZ=1]="BASISLZ",e[e.ZSTD=2]="ZSTD",e[e.ZLIB=3]="ZLIB"})(u1||(u1={})),function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(dd||(dd={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(c1||(c1={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(hd||(hd={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(Qj||(Qj={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(l1||(l1={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(Zj||(Zj={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(Jj||(Jj={}));var rA=function(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=u1.NONE,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:dd.BASICFORMAT,versionNumber:2,descriptorBlockSize:40,colorModel:c1.UNSPECIFIED,colorPrimaries:hd.SRGB,transferFunction:hd.SRGB,flags:l1.ALPHA_STRAIGHT,texelBlockDimension:{x:4,y:4,z:1,w:1},bytesPlane:[],samples:[]}],this.keyValue={},this.globalData=null},al=function(){function e(t,i,a,n){this._dataView=new DataView(t.buffer,t.byteOffset+i,a),this._littleEndian=n,this._offset=0}var r=e.prototype;return r._nextUint8=function(){var t=this._dataView.getUint8(this._offset);return this._offset+=1,t},r._nextUint16=function(){var t=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,t},r._nextUint32=function(){var t=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,t},r._nextUint64=function(){var t=this._dataView.getUint32(this._offset,this._littleEndian),i=this._dataView.getUint32(this._offset+4,this._littleEndian),a=t+Math.pow(2,32)*i;return this._offset+=8,a},r._skip=function(t){return this._offset+=t,this},r._scan=function(t,i){i===void 0&&(i=0);for(var a=this._offset,n=0;this._dataView.getUint8(this._offset)!==i&&n<t;)n++,this._offset++;return n<t&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+a,n)},e}();function f1(){return(f1=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)}function tA(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,i=new Array(r);t<r;t++)i[t]=e[t];return i}function aA(e,r){var t;if(typeof Symbol>"u"||e[Symbol.iterator]==null){if(Array.isArray(e)||(t=function(a,n){if(a){if(typeof a=="string")return tA(a,void 0);var o=Object.prototype.toString.call(a).slice(8,-1);return o==="Object"&&a.constructor&&(o=a.constructor.name),o==="Map"||o==="Set"?Array.from(a):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?tA(a,void 0):void 0}}(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
95
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return(t=e[Symbol.iterator]()).next.bind(t)}function iA(e){return typeof TextEncoder<"u"?new TextEncoder().encode(e):Buffer.from(e)}function nA(e){return typeof TextDecoder<"u"?new TextDecoder().decode(e):Buffer.from(e).toString("utf8")}function fd(e){for(var r,t=0,i=aA(e);!(r=i()).done;)t+=r.value.byteLength;for(var a,n=new Uint8Array(t),o=0,s=aA(e);!(a=s()).done;){var u=a.value;n.set(new Uint8Array(u),o),o+=u.byteLength}return n}var TV={keepWriter:!1};pd.KTX2Container=rA,pd.read=function(e){var r=new Uint8Array(e.buffer,e.byteOffset,ga.length);if(r[0]!==ga[0]||r[1]!==ga[1]||r[2]!==ga[2]||r[3]!==ga[3]||r[4]!==ga[4]||r[5]!==ga[5]||r[6]!==ga[6]||r[7]!==ga[7]||r[8]!==ga[8]||r[9]!==ga[9]||r[10]!==ga[10]||r[11]!==ga[11])throw new Error("Missing KTX 2.0 identifier.");var t=new rA,i=17*Uint32Array.BYTES_PER_ELEMENT,a=new al(e,ga.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();var n=a._nextUint32();t.supercompressionScheme=a._nextUint32();for(var o=a._nextUint32(),s=a._nextUint32(),u=a._nextUint32(),l=a._nextUint32(),f=a._nextUint64(),h=a._nextUint64(),d=new al(e,ga.length+i,3*n*8,!0),m=0;m<n;m++)t.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});for(var y=new al(e,o,s,!0),k={vendorId:y._skip(4)._nextUint16(),descriptorType:y._nextUint16(),versionNumber:y._nextUint16(),descriptorBlockSize:y._nextUint16(),colorModel:y._nextUint8(),colorPrimaries:y._nextUint8(),transferFunction:y._nextUint8(),flags:y._nextUint8(),texelBlockDimension:{x:y._nextUint8()+1,y:y._nextUint8()+1,z:y._nextUint8()+1,w:y._nextUint8()+1},bytesPlane:[y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8()],samples:[]},x=(k.descriptorBlockSize/4-6)/4,A=0;A<x;A++)k.samples[A]={bitOffset:y._nextUint16(),bitLength:y._nextUint8(),channelID:y._nextUint8(),samplePosition:[y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8()],sampleLower:y._nextUint32(),sampleUpper:y._nextUint32()};t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(k);for(var P=new al(e,u,l,!0);P._offset<l;){var T=P._nextUint32(),B=P._scan(T),C=nA(B),I=P._scan(T-B.byteLength);t.keyValue[C]=C.match(/^ktx/i)?nA(I):I,T%4&&P._skip(4-T%4)}if(h<=0)return t;for(var F=new al(e,f,h,!0),H=F._nextUint16(),N=F._nextUint16(),K=F._nextUint32(),V=F._nextUint32(),X=F._nextUint32(),U=F._nextUint32(),$=[],Z=0;Z<n;Z++)$.push({imageFlags:F._nextUint32(),rgbSliceByteOffset:F._nextUint32(),rgbSliceByteLength:F._nextUint32(),alphaSliceByteOffset:F._nextUint32(),alphaSliceByteLength:F._nextUint32()});var le=f+F._offset,ve=le+K,fe=ve+V,we=fe+X,ye=new Uint8Array(e.buffer,e.byteOffset+le,K),Me=new Uint8Array(e.buffer,e.byteOffset+ve,V),ze=new Uint8Array(e.buffer,e.byteOffset+fe,X),Ie=new Uint8Array(e.buffer,e.byteOffset+we,U);return t.globalData={endpointCount:H,selectorCount:N,imageDescs:$,endpointsData:ye,selectorsData:Me,tablesData:ze,extendedData:Ie},t},pd.write=function(e,r){r===void 0&&(r={}),r=f1({},TV,r);var t=new ArrayBuffer(0);if(e.globalData){var i=new ArrayBuffer(20+5*e.globalData.imageDescs.length*4),a=new DataView(i);a.setUint16(0,e.globalData.endpointCount,!0),a.setUint16(2,e.globalData.selectorCount,!0),a.setUint32(4,e.globalData.endpointsData.byteLength,!0),a.setUint32(8,e.globalData.selectorsData.byteLength,!0),a.setUint32(12,e.globalData.tablesData.byteLength,!0),a.setUint32(16,e.globalData.extendedData.byteLength,!0);for(var n=0;n<e.globalData.imageDescs.length;n++){var o=e.globalData.imageDescs[n];a.setUint32(20+5*n*4+0,o.imageFlags,!0),a.setUint32(20+5*n*4+4,o.rgbSliceByteOffset,!0),a.setUint32(20+5*n*4+8,o.rgbSliceByteLength,!0),a.setUint32(20+5*n*4+12,o.alphaSliceByteOffset,!0),a.setUint32(20+5*n*4+16,o.alphaSliceByteLength,!0)}t=fd([i,e.globalData.endpointsData,e.globalData.selectorsData,e.globalData.tablesData,e.globalData.extendedData])}var s=[],u=e.keyValue;for(var l in r.keepWriter||(u=f1({},e.keyValue,{KTXwriter:"KTX-Parse v0.0.4"})),u){var f=u[l],h=iA(l),d=typeof f=="string"?iA(f):f,m=h.byteLength+1+d.byteLength+1,y=m%4?4-m%4:0;s.push(fd([new Uint32Array([m]),h,eA,d,eA,new Uint8Array(y).fill(0)]))}var k=fd(s),x=new ArrayBuffer(44),A=new DataView(x);if(e.dataFormatDescriptor.length!==1||e.dataFormatDescriptor[0].descriptorType!==dd.BASICFORMAT)throw new Error("Only BASICFORMAT Data Format Descriptor output supported.");var P=e.dataFormatDescriptor[0];A.setUint32(0,44,!0),A.setUint16(4,P.vendorId,!0),A.setUint16(6,P.descriptorType,!0),A.setUint16(8,P.versionNumber,!0),A.setUint16(10,P.descriptorBlockSize,!0),A.setUint8(12,P.colorModel),A.setUint8(13,P.colorPrimaries),A.setUint8(14,P.transferFunction),A.setUint8(15,P.flags),A.setUint8(16,P.texelBlockDimension.x-1),A.setUint8(17,P.texelBlockDimension.y-1),A.setUint8(18,P.texelBlockDimension.z-1),A.setUint8(19,P.texelBlockDimension.w-1);for(var T=0;T<8;T++)A.setUint8(20+T,P.bytesPlane[T]);for(var B=0;B<P.samples.length;B++){var C=P.samples[B],I=28+16*B;A.setUint16(I+0,C.bitOffset,!0),A.setUint8(I+2,C.bitLength),A.setUint8(I+3,C.channelID),A.setUint8(I+4,C.samplePosition[0]),A.setUint8(I+5,C.samplePosition[1]),A.setUint8(I+6,C.samplePosition[2]),A.setUint8(I+7,C.samplePosition[3]),A.setUint32(I+8,C.sampleLower,!0),A.setUint32(I+12,C.sampleUpper,!0)}var F=ga.length+68+3*e.levels.length*8,H=F+x.byteLength,N=H+k.byteLength;N%8&&(N+=8-N%8);for(var K=[],V=new DataView(new ArrayBuffer(3*e.levels.length*8)),X=N+t.byteLength,U=0;U<e.levels.length;U++){var $=e.levels[U];K.push($.levelData),V.setBigUint64(24*U+0,BigInt(X),!0),V.setBigUint64(24*U+8,BigInt($.levelData.byteLength),!0),V.setBigUint64(24*U+16,BigInt($.uncompressedByteLength),!0),X+=$.levelData.byteLength}var Z=new ArrayBuffer(68),le=new DataView(Z);return le.setUint32(0,e.vkFormat,!0),le.setUint32(4,e.typeSize,!0),le.setUint32(8,e.pixelWidth,!0),le.setUint32(12,e.pixelHeight,!0),le.setUint32(16,e.pixelDepth,!0),le.setUint32(20,e.layerCount,!0),le.setUint32(24,e.faceCount,!0),le.setUint32(28,e.levels.length,!0),le.setUint32(32,e.supercompressionScheme,!0),le.setUint32(36,F,!0),le.setUint32(40,x.byteLength,!0),le.setUint32(44,H,!0),le.setUint32(48,k.byteLength,!0),le.setBigUint64(52,BigInt(N),!0),le.setBigUint64(60,BigInt(t.byteLength),!0),new Uint8Array(fd([new Uint8Array(ga).buffer,Z,V.buffer,x,k,new ArrayBuffer(N-(H+k.byteLength)),t].concat(K)))}});var V1=typeof process!="object"||String(process)!=="[object process]"||process.browser;var $1={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"]=$1||{};function Er(e,r,t){return r<=e&&e<=t}function TT(e,r){return e.indexOf(r)!==-1}var _n=Math.floor;function El(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function PT(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,u=o&1023;a.push(65536+(s<<10)+u),i+=1}else a.push(65533)}i+=1}return a}function RT(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 ti(e){return 0<=e&&e<=127}var ri=ti,Nr=-1;function Md(e){this.tokens=[].slice.call(e),this.tokens.reverse()}Md.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Nr},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 it=-1;function zr(e,r){if(e)throw TypeError("Decoder error");return r||65533}function ki(e){throw TypeError("The code point "+e+" could not be encoded.")}function CT(){}CT.prototype={handler:function(e,r){}};function OT(){}OT.prototype={handler:function(e,r){}};function Ld(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(qd,e)?qd[e]:null}var K1=[{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"}],qd={};K1.forEach(function(e){e.encodings.forEach(function(r){r.labels.forEach(function(t){qd[t]=r})})});var Da={},La={};function gs(e,r){return r&&r[e]||null}function vs(e,r){var t=r.indexOf(e);return t===-1?null:t}function Pa(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 IT(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var r=0,t=0,i=Pa("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 BT(e){if(e===59335)return 7457;var r=0,t=0,i=Pa("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 FT(e){Fd=Fd||Pa("jis0208").map(function(t,i){return Er(i,8272,8835)?null:t});var r=Fd;return r.indexOf(e)}var Fd;function DT(e){Dd=Dd||Pa("big5").map(function(t,i){return i<(161-129)*157?null:t});var r=Dd;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?r.lastIndexOf(e):vs(e,r)}var Dd,Y1="utf-8";function Oo(e,r){if(!(this instanceof Oo))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):Y1,r=El(r),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var t=Ld(e);if(t===null||t.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!La[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(Oo.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(Oo.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(Oo.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));Oo.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=El(t),this._do_not_flush||(this._decoder=La[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(t.stream);for(var a=new Md(i),n=[],o;;){var s=a.read();if(s===Nr||(o=this._decoder.handler(a,s),o===it))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===it)break;o!==null&&(Array.isArray(o)?n.push.apply(n,o):n.push(o))}while(!a.endOfStream());this._decoder=null}function u(l){return TT(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(l.length>0&&l[0]===65279?(this._BOMseen=!0,l.shift()):l.length>0&&(this._BOMseen=!0)),RT(l)}return u.call(this,n)};function Tu(e,r){if(!(this instanceof Tu))throw TypeError("Called as a function. Did you forget 'new'?");r=El(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):Y1;var i=Ld(e);if(i===null||i.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!Da[i.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");t._encoding=i}else t._encoding=Ld("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(Tu.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});Tu.prototype.encode=function(r,t){r=r===void 0?"":String(r),t=El(t),this._do_not_flush||(this._encoder=Da[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(t.stream);for(var i=new Md(PT(r)),a=[],n;;){var o=i.read();if(o===Nr||(n=this._encoder.handler(i,o),n===it))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!==it;)Array.isArray(n)?a.push.apply(a,n):a.push(n);this._encoder=null}return new Uint8Array(a)};function LT(e){var r=e.fatal,t=0,i=0,a=0,n=128,o=191;this.handler=function(s,u){if(u===Nr&&a!==0)return a=0,zr(r);if(u===Nr)return it;if(a===0){if(Er(u,0,127))return u;if(Er(u,194,223))a=1,t=u&31;else if(Er(u,224,239))u===224&&(n=160),u===237&&(o=159),a=2,t=u&15;else if(Er(u,240,244))u===240&&(n=144),u===244&&(o=143),a=3,t=u&7;else return zr(r);return null}if(!Er(u,n,o))return t=a=i=0,n=128,o=191,s.prepend(u),zr(r);if(n=128,o=191,t=t<<6|u&63,i+=1,i!==a)return null;var l=t;return t=a=i=0,l}}function qT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i))return i;var a,n;Er(i,128,2047)?(a=1,n=192):Er(i,2048,65535)?(a=2,n=224):Er(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}}Da["UTF-8"]=function(e){return new qT(e)};La["UTF-8"]=function(e){return new LT(e)};function MT(e,r){var t=r.fatal;this.handler=function(i,a){if(a===Nr)return it;if(ti(a))return a;var n=e[a-128];return n===null?zr(t):n}}function zT(e,r){var t=r.fatal;this.handler=function(i,a){if(a===Nr)return it;if(ri(a))return a;var n=vs(a,e);return n===null&&ki(a),n+128}}(function(){"encoding-indexes"in globalThis&&K1.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(r){var t=r.name,i=Pa(t.toLowerCase());La[t]=function(a){return new MT(i,a)},Da[t]=function(a){return new zT(i,a)}})})})();La.GBK=function(e){return new X1(e)};Da.GBK=function(e){return new Q1(e,!0)};function X1(e){var r=e.fatal,t=0,i=0,a=0;this.handler=function(n,o){if(o===Nr&&t===0&&i===0&&a===0)return it;o===Nr&&(t!==0||i!==0||a!==0)&&(t=0,i=0,a=0,zr(r));var s;if(a!==0){s=null,Er(o,48,57)&&(s=IT((((t-129)*10+i-48)*126+a-129)*10+o-48));var u=[i,a,o];return t=0,i=0,a=0,s===null?(n.prepend(u),zr(r)):s}if(i!==0)return Er(o,129,254)?(a=o,null):(n.prepend([i,o]),t=0,i=0,zr(r));if(t!==0){if(Er(o,48,57))return i=o,null;var l=t,f=null;t=0;var h=o<127?64:65;return(Er(o,64,126)||Er(o,128,254))&&(f=(l-129)*190+(o-h)),s=f===null?null:gs(f,Pa("gb18030")),s===null&&ti(o)&&n.prepend(o),s===null?zr(r):s}return ti(o)?o:o===128?8364:Er(o,129,254)?(t=o,null):zr(r)}}function Q1(e,r){var t=e.fatal;this.handler=function(i,a){if(a===Nr)return it;if(ri(a))return a;if(a===58853)return ki(a);if(r&&a===8364)return 128;var n=vs(a,Pa("gb18030"));if(n!==null){var o=_n(n/190)+129,s=n%190,u=s<63?64:65;return[o,s+u]}if(r)return ki(a);n=BT(a);var l=_n(n/10/126/10);n=n-l*10*126*10;var f=_n(n/10/126);n=n-f*10*126;var h=_n(n/10),d=n-h*10;return[l+129,f+48,h+129,d+48]}}Da.gb18030=function(e){return new Q1(e)};La.gb18030=function(e){return new X1(e)};function NT(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===Nr&&t!==0)return t=0,zr(r);if(a===Nr&&t===0)return it;if(t!==0){var n=t,o=null;t=0;var s=a<127?64:98;switch((Er(a,64,126)||Er(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 u=o===null?null:gs(o,Pa("big5"));return u===null&&ti(a)&&i.prepend(a),u===null?zr(r):u}return ti(a)?a:Er(a,129,254)?(t=a,null):zr(r)}}function UT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i))return i;var a=DT(i);if(a===null)return ki(i);var n=_n(a/157)+129;if(n<161)return ki(i);var o=a%157,s=o<63?64:98;return[n,o+s]}}Da.Big5=function(e){return new UT(e)};La.Big5=function(e){return new NT(e)};function HT(e){var r=e.fatal,t=!1,i=0;this.handler=function(a,n){if(n===Nr&&i!==0)return i=0,zr(r);if(n===Nr&&i===0)return it;if(i===142&&Er(n,161,223))return i=0,65377-161+n;if(i===143&&Er(n,161,254))return t=!0,i=n,null;if(i!==0){var o=i;i=0;var s=null;return Er(o,161,254)&&Er(n,161,254)&&(s=gs((o-161)*94+(n-161),Pa(t?"jis0212":"jis0208"))),t=!1,Er(n,161,254)||a.prepend(n),s===null?zr(r):s}return ti(n)?n:n===142||n===143||Er(n,161,254)?(i=n,null):zr(r)}}function GT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i))return i;if(i===165)return 92;if(i===8254)return 126;if(Er(i,65377,65439))return[142,i-65377+161];i===8722&&(i=65293);var a=vs(i,Pa("jis0208"));if(a===null)return ki(i);var n=_n(a/94)+161,o=a%94+161;return[n,o]}}Da["EUC-JP"]=function(e){return new GT(e)};La["EUC-JP"]=function(e){return new HT(e)};function WT(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,u){switch(i){default:case t.ASCII:return u===27?(i=t.EscapeStart,null):Er(u,0,127)&&u!==14&&u!==15&&u!==27?(o=!1,u):u===Nr?it:(o=!1,zr(r));case t.Roman:return u===27?(i=t.EscapeStart,null):u===92?(o=!1,165):u===126?(o=!1,8254):Er(u,0,127)&&u!==14&&u!==15&&u!==27&&u!==92&&u!==126?(o=!1,u):u===Nr?it:(o=!1,zr(r));case t.Katakana:return u===27?(i=t.EscapeStart,null):Er(u,33,95)?(o=!1,65377-33+u):u===Nr?it:(o=!1,zr(r));case t.LeadByte:return u===27?(i=t.EscapeStart,null):Er(u,33,126)?(o=!1,n=u,i=t.TrailByte,null):u===Nr?it:(o=!1,zr(r));case t.TrailByte:if(u===27)return i=t.EscapeStart,zr(r);if(Er(u,33,126)){i=t.LeadByte;var l=(n-33)*94+u-33,f=gs(l,Pa("jis0208"));return f===null?zr(r):f}return u===Nr?(i=t.LeadByte,s.prepend(u),zr(r)):(i=t.LeadByte,zr(r));case t.EscapeStart:return u===36||u===40?(n=u,i=t.Escape,null):(s.prepend(u),o=!1,i=a,zr(r));case t.Escape:var h=n;n=0;var d=null;if(h===40&&u===66&&(d=t.ASCII),h===40&&u===74&&(d=t.Roman),h===40&&u===73&&(d=t.Katakana),h===36&&(u===64||u===66)&&(d=t.LeadByte),d!==null){i=i=d;var m=o;return o=!0,m?zr(r):null}return s.prepend([h,u]),o=!1,i=a,zr(r)}}}function VT(e){var r=e.fatal,t={ASCII:0,Roman:1,jis0208:2},i=t.ASCII;this.handler=function(a,n){if(n===Nr&&i!==t.ASCII)return a.prepend(n),i=t.ASCII,[27,40,66];if(n===Nr&&i===t.ASCII)return it;if((i===t.ASCII||i===t.Roman)&&(n===14||n===15||n===27))return ki(65533);if(i===t.ASCII&&ri(n))return n;if(i===t.Roman&&(ri(n)&&n!==92&&n!==126||n==165||n==8254)){if(ri(n))return n;if(n===165)return 92;if(n===8254)return 126}if(ri(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=vs(n,Pa("jis0208"));if(o===null)return ki(n);if(i!==t.jis0208)return a.prepend(n),i=t.jis0208,[27,36,66];var s=_n(o/94)+33,u=o%94+33;return[s,u]}}Da["ISO-2022-JP"]=function(e){return new VT(e)};La["ISO-2022-JP"]=function(e){return new WT(e)};function $T(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===Nr&&t!==0)return t=0,zr(r);if(a===Nr&&t===0)return it;if(t!==0){var n=t,o=null;t=0;var s=a<127?64:65,u=n<160?129:193;if((Er(a,64,126)||Er(a,128,252))&&(o=(n-u)*188+a-s),Er(o,8836,10715))return 57344-8836+o;var l=o===null?null:gs(o,Pa("jis0208"));return l===null&&ti(a)&&i.prepend(a),l===null?zr(r):l}return ti(a)||a===128?a:Er(a,161,223)?65377-161+a:Er(a,129,159)||Er(a,224,252)?(t=a,null):zr(r)}}function KT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i)||i===128)return i;if(i===165)return 92;if(i===8254)return 126;if(Er(i,65377,65439))return i-65377+161;i===8722&&(i=65293);var a=FT(i);if(a===null)return ki(i);var n=_n(a/188),o=n<31?129:193,s=a%188,u=s<63?64:65;return[n+o,s+u]}}Da.Shift_JIS=function(e){return new KT(e)};La.Shift_JIS=function(e){return new $T(e)};function YT(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===Nr&&t!==0)return t=0,zr(r);if(a===Nr&&t===0)return it;if(t!==0){var n=t,o=null;t=0,Er(a,65,254)&&(o=(n-129)*190+(a-65));var s=o===null?null:gs(o,Pa("euc-kr"));return o===null&&ti(a)&&i.prepend(a),s===null?zr(r):s}return ti(a)?a:Er(a,129,254)?(t=a,null):zr(r)}}function XT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i))return i;var a=vs(i,Pa("euc-kr"));if(a===null)return ki(i);var n=_n(a/190)+129,o=a%190+65;return[n,o]}}Da["EUC-KR"]=function(e){return new XT(e)};La["EUC-KR"]=function(e){return new YT(e)};function Sl(e,r){var t=e>>8,i=e&255;return r?[t,i]:[i,t]}function Z1(e,r){var t=r.fatal,i=null,a=null;this.handler=function(n,o){if(o===Nr&&(i!==null||a!==null))return zr(t);if(o===Nr&&i===null&&a===null)return it;if(i===null)return i=o,null;var s;if(e?s=(i<<8)+o:s=(o<<8)+i,i=null,a!==null){var u=a;return a=null,Er(s,56320,57343)?65536+(u-55296)*1024+(s-56320):(n.prepend(Sl(s,e)),zr(t))}return Er(s,55296,56319)?(a=s,null):Er(s,56320,57343)?zr(t):s}}function J1(e,r){var t=r.fatal;this.handler=function(i,a){if(a===Nr)return it;if(Er(a,0,65535))return Sl(a,e);var n=Sl((a-65536>>10)+55296,e),o=Sl((a-65536&1023)+56320,e);return n.concat(o)}}Da["UTF-16BE"]=function(e){return new J1(!0,e)};La["UTF-16BE"]=function(e){return new Z1(!0,e)};Da["UTF-16LE"]=function(e){return new J1(!1,e)};La["UTF-16LE"]=function(e){return new Z1(!1,e)};function QT(e){var r=e.fatal;this.handler=function(t,i){return i===Nr?it:ti(i)?i:63360+i-128}}function ZT(e){var r=e.fatal;this.handler=function(t,i){return i===Nr?it:ri(i)?i:Er(i,63360,63487)?i-63360+128:ki(i)}}Da["x-user-defined"]=function(e){return new ZT(e)};La["x-user-defined"]=function(e){return new QT(e)};function Pu(e){return Buffer.from(e).toString("base64")}function zd(e){return Buffer.from(e,"base64").toString("ascii")}var Yx=Pt($x(),1),Xx=Pt(Lu(),1);function Kx(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function pC(e,r){let t=r.type?r.type.replace("image/",""):"jpeg",i=(0,Xx.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,Yx.default)(i,t,r)}function Qx(e,r){let t=pC(e,r);return new Promise(i=>{let a=[];t.on("data",n=>a.push(n)),t.on("end",()=>{let n=Buffer.concat(a);i(Kx(n))})})}var R5=Pt(P5(),1),Ng=["image/png","image/jpeg","image/gif"];async function Ug(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 SU(t,r)}function SU(e,r){return new Promise(t=>(0,R5.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 Hg(e,r,t,i){return i._parse(e,r,t,i)}function zi(e,r){if(!e)throw new Error(r||"loader assertion failed.")}var hn={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},EU=hn.self||hn.window||hn.global||{},jU=hn.window||hn.self||hn.global||{},AU=hn.global||hn.self||hn.window||{},TU=hn.document||{};var Qo=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var C5=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),PU=C5&&parseFloat(C5[1])||0;function Gg(e,r){return O5(e||{},r)}function O5(e,r){let t={...e};for(let[i,a]of Object.entries(r))a&&typeof a=="object"&&!Array.isArray(a)?t[i]=O5(t[i]||{},r[i]):t[i]=r[i];return t}var I5="beta";function RU(){var e;return(e=globalThis._loadersgl_)!=null&&e.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.0.2"),globalThis._loadersgl_.version}var Ic=RU();function ma(e,r){if(!e)throw new Error(r||"loaders.gl assertion failed.")}var mn={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},wJ=mn.self||mn.window||mn.global||{},_J=mn.window||mn.self||mn.global||{},kJ=mn.global||mn.self||mn.window||{},SJ=mn.document||{};var oa=typeof process!="object"||String(process)!=="[object process]"||process.browser,Bc=typeof importScripts=="function",F5=typeof window<"u"&&typeof window.orientation<"u",B5=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),EJ=B5&&parseFloat(B5[1])||0;var Fc=class{constructor(r,t){this.isRunning=!0;this._resolve=()=>{};this._reject=()=>{};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){ma(this.isRunning),this.isRunning=!1,this._resolve(r)}error(r){ma(this.isRunning),this.isRunning=!1,this._reject(r)}};var uu={};Au(uu,{NodeWorker:()=>Dc});var D5=Pt(require("worker_threads"),1);kl(uu,require("worker_threads"));var Dc=D5.Worker;var Wg=new Map;function L5(e){ma(e.source&&!e.url||!e.source&&e.url);let r=Wg.get(e.source||e.url);return r||(e.url&&(r=CU(e.url),Wg.set(e.url,r)),e.source&&(r=q5(e.source),Wg.set(e.source,r))),ma(r),r}function CU(e){if(!e.startsWith("http"))return e;let r=OU(e);return q5(r)}function q5(e){let r=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(r)}function OU(e){return`try {
95
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return(t=e[Symbol.iterator]()).next.bind(t)}function iA(e){return typeof TextEncoder<"u"?new TextEncoder().encode(e):Buffer.from(e)}function nA(e){return typeof TextDecoder<"u"?new TextDecoder().decode(e):Buffer.from(e).toString("utf8")}function fd(e){for(var r,t=0,i=aA(e);!(r=i()).done;)t+=r.value.byteLength;for(var a,n=new Uint8Array(t),o=0,s=aA(e);!(a=s()).done;){var u=a.value;n.set(new Uint8Array(u),o),o+=u.byteLength}return n}var TV={keepWriter:!1};pd.KTX2Container=rA,pd.read=function(e){var r=new Uint8Array(e.buffer,e.byteOffset,ga.length);if(r[0]!==ga[0]||r[1]!==ga[1]||r[2]!==ga[2]||r[3]!==ga[3]||r[4]!==ga[4]||r[5]!==ga[5]||r[6]!==ga[6]||r[7]!==ga[7]||r[8]!==ga[8]||r[9]!==ga[9]||r[10]!==ga[10]||r[11]!==ga[11])throw new Error("Missing KTX 2.0 identifier.");var t=new rA,i=17*Uint32Array.BYTES_PER_ELEMENT,a=new al(e,ga.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();var n=a._nextUint32();t.supercompressionScheme=a._nextUint32();for(var o=a._nextUint32(),s=a._nextUint32(),u=a._nextUint32(),l=a._nextUint32(),f=a._nextUint64(),h=a._nextUint64(),d=new al(e,ga.length+i,3*n*8,!0),m=0;m<n;m++)t.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});for(var y=new al(e,o,s,!0),k={vendorId:y._skip(4)._nextUint16(),descriptorType:y._nextUint16(),versionNumber:y._nextUint16(),descriptorBlockSize:y._nextUint16(),colorModel:y._nextUint8(),colorPrimaries:y._nextUint8(),transferFunction:y._nextUint8(),flags:y._nextUint8(),texelBlockDimension:{x:y._nextUint8()+1,y:y._nextUint8()+1,z:y._nextUint8()+1,w:y._nextUint8()+1},bytesPlane:[y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8()],samples:[]},x=(k.descriptorBlockSize/4-6)/4,A=0;A<x;A++)k.samples[A]={bitOffset:y._nextUint16(),bitLength:y._nextUint8(),channelID:y._nextUint8(),samplePosition:[y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8()],sampleLower:y._nextUint32(),sampleUpper:y._nextUint32()};t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(k);for(var P=new al(e,u,l,!0);P._offset<l;){var T=P._nextUint32(),B=P._scan(T),C=nA(B),I=P._scan(T-B.byteLength);t.keyValue[C]=C.match(/^ktx/i)?nA(I):I,T%4&&P._skip(4-T%4)}if(h<=0)return t;for(var F=new al(e,f,h,!0),H=F._nextUint16(),N=F._nextUint16(),K=F._nextUint32(),V=F._nextUint32(),X=F._nextUint32(),U=F._nextUint32(),$=[],Z=0;Z<n;Z++)$.push({imageFlags:F._nextUint32(),rgbSliceByteOffset:F._nextUint32(),rgbSliceByteLength:F._nextUint32(),alphaSliceByteOffset:F._nextUint32(),alphaSliceByteLength:F._nextUint32()});var le=f+F._offset,ve=le+K,fe=ve+V,we=fe+X,ye=new Uint8Array(e.buffer,e.byteOffset+le,K),Me=new Uint8Array(e.buffer,e.byteOffset+ve,V),ze=new Uint8Array(e.buffer,e.byteOffset+fe,X),Ie=new Uint8Array(e.buffer,e.byteOffset+we,U);return t.globalData={endpointCount:H,selectorCount:N,imageDescs:$,endpointsData:ye,selectorsData:Me,tablesData:ze,extendedData:Ie},t},pd.write=function(e,r){r===void 0&&(r={}),r=f1({},TV,r);var t=new ArrayBuffer(0);if(e.globalData){var i=new ArrayBuffer(20+5*e.globalData.imageDescs.length*4),a=new DataView(i);a.setUint16(0,e.globalData.endpointCount,!0),a.setUint16(2,e.globalData.selectorCount,!0),a.setUint32(4,e.globalData.endpointsData.byteLength,!0),a.setUint32(8,e.globalData.selectorsData.byteLength,!0),a.setUint32(12,e.globalData.tablesData.byteLength,!0),a.setUint32(16,e.globalData.extendedData.byteLength,!0);for(var n=0;n<e.globalData.imageDescs.length;n++){var o=e.globalData.imageDescs[n];a.setUint32(20+5*n*4+0,o.imageFlags,!0),a.setUint32(20+5*n*4+4,o.rgbSliceByteOffset,!0),a.setUint32(20+5*n*4+8,o.rgbSliceByteLength,!0),a.setUint32(20+5*n*4+12,o.alphaSliceByteOffset,!0),a.setUint32(20+5*n*4+16,o.alphaSliceByteLength,!0)}t=fd([i,e.globalData.endpointsData,e.globalData.selectorsData,e.globalData.tablesData,e.globalData.extendedData])}var s=[],u=e.keyValue;for(var l in r.keepWriter||(u=f1({},e.keyValue,{KTXwriter:"KTX-Parse v0.0.4"})),u){var f=u[l],h=iA(l),d=typeof f=="string"?iA(f):f,m=h.byteLength+1+d.byteLength+1,y=m%4?4-m%4:0;s.push(fd([new Uint32Array([m]),h,eA,d,eA,new Uint8Array(y).fill(0)]))}var k=fd(s),x=new ArrayBuffer(44),A=new DataView(x);if(e.dataFormatDescriptor.length!==1||e.dataFormatDescriptor[0].descriptorType!==dd.BASICFORMAT)throw new Error("Only BASICFORMAT Data Format Descriptor output supported.");var P=e.dataFormatDescriptor[0];A.setUint32(0,44,!0),A.setUint16(4,P.vendorId,!0),A.setUint16(6,P.descriptorType,!0),A.setUint16(8,P.versionNumber,!0),A.setUint16(10,P.descriptorBlockSize,!0),A.setUint8(12,P.colorModel),A.setUint8(13,P.colorPrimaries),A.setUint8(14,P.transferFunction),A.setUint8(15,P.flags),A.setUint8(16,P.texelBlockDimension.x-1),A.setUint8(17,P.texelBlockDimension.y-1),A.setUint8(18,P.texelBlockDimension.z-1),A.setUint8(19,P.texelBlockDimension.w-1);for(var T=0;T<8;T++)A.setUint8(20+T,P.bytesPlane[T]);for(var B=0;B<P.samples.length;B++){var C=P.samples[B],I=28+16*B;A.setUint16(I+0,C.bitOffset,!0),A.setUint8(I+2,C.bitLength),A.setUint8(I+3,C.channelID),A.setUint8(I+4,C.samplePosition[0]),A.setUint8(I+5,C.samplePosition[1]),A.setUint8(I+6,C.samplePosition[2]),A.setUint8(I+7,C.samplePosition[3]),A.setUint32(I+8,C.sampleLower,!0),A.setUint32(I+12,C.sampleUpper,!0)}var F=ga.length+68+3*e.levels.length*8,H=F+x.byteLength,N=H+k.byteLength;N%8&&(N+=8-N%8);for(var K=[],V=new DataView(new ArrayBuffer(3*e.levels.length*8)),X=N+t.byteLength,U=0;U<e.levels.length;U++){var $=e.levels[U];K.push($.levelData),V.setBigUint64(24*U+0,BigInt(X),!0),V.setBigUint64(24*U+8,BigInt($.levelData.byteLength),!0),V.setBigUint64(24*U+16,BigInt($.uncompressedByteLength),!0),X+=$.levelData.byteLength}var Z=new ArrayBuffer(68),le=new DataView(Z);return le.setUint32(0,e.vkFormat,!0),le.setUint32(4,e.typeSize,!0),le.setUint32(8,e.pixelWidth,!0),le.setUint32(12,e.pixelHeight,!0),le.setUint32(16,e.pixelDepth,!0),le.setUint32(20,e.layerCount,!0),le.setUint32(24,e.faceCount,!0),le.setUint32(28,e.levels.length,!0),le.setUint32(32,e.supercompressionScheme,!0),le.setUint32(36,F,!0),le.setUint32(40,x.byteLength,!0),le.setUint32(44,H,!0),le.setUint32(48,k.byteLength,!0),le.setBigUint64(52,BigInt(N),!0),le.setBigUint64(60,BigInt(t.byteLength),!0),new Uint8Array(fd([new Uint8Array(ga).buffer,Z,V.buffer,x,k,new ArrayBuffer(N-(H+k.byteLength)),t].concat(K)))}});var V1=typeof process!="object"||String(process)!=="[object process]"||process.browser;var $1={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"]=$1||{};function Er(e,r,t){return r<=e&&e<=t}function TT(e,r){return e.indexOf(r)!==-1}var _n=Math.floor;function El(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function PT(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,u=o&1023;a.push(65536+(s<<10)+u),i+=1}else a.push(65533)}i+=1}return a}function RT(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 ti(e){return 0<=e&&e<=127}var ri=ti,Nr=-1;function Md(e){this.tokens=[].slice.call(e),this.tokens.reverse()}Md.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Nr},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 it=-1;function zr(e,r){if(e)throw TypeError("Decoder error");return r||65533}function ki(e){throw TypeError("The code point "+e+" could not be encoded.")}function CT(){}CT.prototype={handler:function(e,r){}};function OT(){}OT.prototype={handler:function(e,r){}};function Ld(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(qd,e)?qd[e]:null}var K1=[{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"}],qd={};K1.forEach(function(e){e.encodings.forEach(function(r){r.labels.forEach(function(t){qd[t]=r})})});var Da={},La={};function gs(e,r){return r&&r[e]||null}function vs(e,r){var t=r.indexOf(e);return t===-1?null:t}function Pa(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 IT(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var r=0,t=0,i=Pa("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 BT(e){if(e===59335)return 7457;var r=0,t=0,i=Pa("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 FT(e){Fd=Fd||Pa("jis0208").map(function(t,i){return Er(i,8272,8835)?null:t});var r=Fd;return r.indexOf(e)}var Fd;function DT(e){Dd=Dd||Pa("big5").map(function(t,i){return i<(161-129)*157?null:t});var r=Dd;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?r.lastIndexOf(e):vs(e,r)}var Dd,Y1="utf-8";function Oo(e,r){if(!(this instanceof Oo))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):Y1,r=El(r),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var t=Ld(e);if(t===null||t.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!La[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(Oo.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(Oo.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(Oo.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));Oo.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=El(t),this._do_not_flush||(this._decoder=La[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(t.stream);for(var a=new Md(i),n=[],o;;){var s=a.read();if(s===Nr||(o=this._decoder.handler(a,s),o===it))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===it)break;o!==null&&(Array.isArray(o)?n.push.apply(n,o):n.push(o))}while(!a.endOfStream());this._decoder=null}function u(l){return TT(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(l.length>0&&l[0]===65279?(this._BOMseen=!0,l.shift()):l.length>0&&(this._BOMseen=!0)),RT(l)}return u.call(this,n)};function Tu(e,r){if(!(this instanceof Tu))throw TypeError("Called as a function. Did you forget 'new'?");r=El(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):Y1;var i=Ld(e);if(i===null||i.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!Da[i.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");t._encoding=i}else t._encoding=Ld("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(Tu.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});Tu.prototype.encode=function(r,t){r=r===void 0?"":String(r),t=El(t),this._do_not_flush||(this._encoder=Da[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(t.stream);for(var i=new Md(PT(r)),a=[],n;;){var o=i.read();if(o===Nr||(n=this._encoder.handler(i,o),n===it))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!==it;)Array.isArray(n)?a.push.apply(a,n):a.push(n);this._encoder=null}return new Uint8Array(a)};function LT(e){var r=e.fatal,t=0,i=0,a=0,n=128,o=191;this.handler=function(s,u){if(u===Nr&&a!==0)return a=0,zr(r);if(u===Nr)return it;if(a===0){if(Er(u,0,127))return u;if(Er(u,194,223))a=1,t=u&31;else if(Er(u,224,239))u===224&&(n=160),u===237&&(o=159),a=2,t=u&15;else if(Er(u,240,244))u===240&&(n=144),u===244&&(o=143),a=3,t=u&7;else return zr(r);return null}if(!Er(u,n,o))return t=a=i=0,n=128,o=191,s.prepend(u),zr(r);if(n=128,o=191,t=t<<6|u&63,i+=1,i!==a)return null;var l=t;return t=a=i=0,l}}function qT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i))return i;var a,n;Er(i,128,2047)?(a=1,n=192):Er(i,2048,65535)?(a=2,n=224):Er(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}}Da["UTF-8"]=function(e){return new qT(e)};La["UTF-8"]=function(e){return new LT(e)};function MT(e,r){var t=r.fatal;this.handler=function(i,a){if(a===Nr)return it;if(ti(a))return a;var n=e[a-128];return n===null?zr(t):n}}function zT(e,r){var t=r.fatal;this.handler=function(i,a){if(a===Nr)return it;if(ri(a))return a;var n=vs(a,e);return n===null&&ki(a),n+128}}(function(){"encoding-indexes"in globalThis&&K1.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(r){var t=r.name,i=Pa(t.toLowerCase());La[t]=function(a){return new MT(i,a)},Da[t]=function(a){return new zT(i,a)}})})})();La.GBK=function(e){return new X1(e)};Da.GBK=function(e){return new Q1(e,!0)};function X1(e){var r=e.fatal,t=0,i=0,a=0;this.handler=function(n,o){if(o===Nr&&t===0&&i===0&&a===0)return it;o===Nr&&(t!==0||i!==0||a!==0)&&(t=0,i=0,a=0,zr(r));var s;if(a!==0){s=null,Er(o,48,57)&&(s=IT((((t-129)*10+i-48)*126+a-129)*10+o-48));var u=[i,a,o];return t=0,i=0,a=0,s===null?(n.prepend(u),zr(r)):s}if(i!==0)return Er(o,129,254)?(a=o,null):(n.prepend([i,o]),t=0,i=0,zr(r));if(t!==0){if(Er(o,48,57))return i=o,null;var l=t,f=null;t=0;var h=o<127?64:65;return(Er(o,64,126)||Er(o,128,254))&&(f=(l-129)*190+(o-h)),s=f===null?null:gs(f,Pa("gb18030")),s===null&&ti(o)&&n.prepend(o),s===null?zr(r):s}return ti(o)?o:o===128?8364:Er(o,129,254)?(t=o,null):zr(r)}}function Q1(e,r){var t=e.fatal;this.handler=function(i,a){if(a===Nr)return it;if(ri(a))return a;if(a===58853)return ki(a);if(r&&a===8364)return 128;var n=vs(a,Pa("gb18030"));if(n!==null){var o=_n(n/190)+129,s=n%190,u=s<63?64:65;return[o,s+u]}if(r)return ki(a);n=BT(a);var l=_n(n/10/126/10);n=n-l*10*126*10;var f=_n(n/10/126);n=n-f*10*126;var h=_n(n/10),d=n-h*10;return[l+129,f+48,h+129,d+48]}}Da.gb18030=function(e){return new Q1(e)};La.gb18030=function(e){return new X1(e)};function NT(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===Nr&&t!==0)return t=0,zr(r);if(a===Nr&&t===0)return it;if(t!==0){var n=t,o=null;t=0;var s=a<127?64:98;switch((Er(a,64,126)||Er(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 u=o===null?null:gs(o,Pa("big5"));return u===null&&ti(a)&&i.prepend(a),u===null?zr(r):u}return ti(a)?a:Er(a,129,254)?(t=a,null):zr(r)}}function UT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i))return i;var a=DT(i);if(a===null)return ki(i);var n=_n(a/157)+129;if(n<161)return ki(i);var o=a%157,s=o<63?64:98;return[n,o+s]}}Da.Big5=function(e){return new UT(e)};La.Big5=function(e){return new NT(e)};function HT(e){var r=e.fatal,t=!1,i=0;this.handler=function(a,n){if(n===Nr&&i!==0)return i=0,zr(r);if(n===Nr&&i===0)return it;if(i===142&&Er(n,161,223))return i=0,65377-161+n;if(i===143&&Er(n,161,254))return t=!0,i=n,null;if(i!==0){var o=i;i=0;var s=null;return Er(o,161,254)&&Er(n,161,254)&&(s=gs((o-161)*94+(n-161),Pa(t?"jis0212":"jis0208"))),t=!1,Er(n,161,254)||a.prepend(n),s===null?zr(r):s}return ti(n)?n:n===142||n===143||Er(n,161,254)?(i=n,null):zr(r)}}function GT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i))return i;if(i===165)return 92;if(i===8254)return 126;if(Er(i,65377,65439))return[142,i-65377+161];i===8722&&(i=65293);var a=vs(i,Pa("jis0208"));if(a===null)return ki(i);var n=_n(a/94)+161,o=a%94+161;return[n,o]}}Da["EUC-JP"]=function(e){return new GT(e)};La["EUC-JP"]=function(e){return new HT(e)};function WT(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,u){switch(i){default:case t.ASCII:return u===27?(i=t.EscapeStart,null):Er(u,0,127)&&u!==14&&u!==15&&u!==27?(o=!1,u):u===Nr?it:(o=!1,zr(r));case t.Roman:return u===27?(i=t.EscapeStart,null):u===92?(o=!1,165):u===126?(o=!1,8254):Er(u,0,127)&&u!==14&&u!==15&&u!==27&&u!==92&&u!==126?(o=!1,u):u===Nr?it:(o=!1,zr(r));case t.Katakana:return u===27?(i=t.EscapeStart,null):Er(u,33,95)?(o=!1,65377-33+u):u===Nr?it:(o=!1,zr(r));case t.LeadByte:return u===27?(i=t.EscapeStart,null):Er(u,33,126)?(o=!1,n=u,i=t.TrailByte,null):u===Nr?it:(o=!1,zr(r));case t.TrailByte:if(u===27)return i=t.EscapeStart,zr(r);if(Er(u,33,126)){i=t.LeadByte;var l=(n-33)*94+u-33,f=gs(l,Pa("jis0208"));return f===null?zr(r):f}return u===Nr?(i=t.LeadByte,s.prepend(u),zr(r)):(i=t.LeadByte,zr(r));case t.EscapeStart:return u===36||u===40?(n=u,i=t.Escape,null):(s.prepend(u),o=!1,i=a,zr(r));case t.Escape:var h=n;n=0;var d=null;if(h===40&&u===66&&(d=t.ASCII),h===40&&u===74&&(d=t.Roman),h===40&&u===73&&(d=t.Katakana),h===36&&(u===64||u===66)&&(d=t.LeadByte),d!==null){i=i=d;var m=o;return o=!0,m?zr(r):null}return s.prepend([h,u]),o=!1,i=a,zr(r)}}}function VT(e){var r=e.fatal,t={ASCII:0,Roman:1,jis0208:2},i=t.ASCII;this.handler=function(a,n){if(n===Nr&&i!==t.ASCII)return a.prepend(n),i=t.ASCII,[27,40,66];if(n===Nr&&i===t.ASCII)return it;if((i===t.ASCII||i===t.Roman)&&(n===14||n===15||n===27))return ki(65533);if(i===t.ASCII&&ri(n))return n;if(i===t.Roman&&(ri(n)&&n!==92&&n!==126||n==165||n==8254)){if(ri(n))return n;if(n===165)return 92;if(n===8254)return 126}if(ri(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=vs(n,Pa("jis0208"));if(o===null)return ki(n);if(i!==t.jis0208)return a.prepend(n),i=t.jis0208,[27,36,66];var s=_n(o/94)+33,u=o%94+33;return[s,u]}}Da["ISO-2022-JP"]=function(e){return new VT(e)};La["ISO-2022-JP"]=function(e){return new WT(e)};function $T(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===Nr&&t!==0)return t=0,zr(r);if(a===Nr&&t===0)return it;if(t!==0){var n=t,o=null;t=0;var s=a<127?64:65,u=n<160?129:193;if((Er(a,64,126)||Er(a,128,252))&&(o=(n-u)*188+a-s),Er(o,8836,10715))return 57344-8836+o;var l=o===null?null:gs(o,Pa("jis0208"));return l===null&&ti(a)&&i.prepend(a),l===null?zr(r):l}return ti(a)||a===128?a:Er(a,161,223)?65377-161+a:Er(a,129,159)||Er(a,224,252)?(t=a,null):zr(r)}}function KT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i)||i===128)return i;if(i===165)return 92;if(i===8254)return 126;if(Er(i,65377,65439))return i-65377+161;i===8722&&(i=65293);var a=FT(i);if(a===null)return ki(i);var n=_n(a/188),o=n<31?129:193,s=a%188,u=s<63?64:65;return[n+o,s+u]}}Da.Shift_JIS=function(e){return new KT(e)};La.Shift_JIS=function(e){return new $T(e)};function YT(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===Nr&&t!==0)return t=0,zr(r);if(a===Nr&&t===0)return it;if(t!==0){var n=t,o=null;t=0,Er(a,65,254)&&(o=(n-129)*190+(a-65));var s=o===null?null:gs(o,Pa("euc-kr"));return o===null&&ti(a)&&i.prepend(a),s===null?zr(r):s}return ti(a)?a:Er(a,129,254)?(t=a,null):zr(r)}}function XT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i))return i;var a=vs(i,Pa("euc-kr"));if(a===null)return ki(i);var n=_n(a/190)+129,o=a%190+65;return[n,o]}}Da["EUC-KR"]=function(e){return new XT(e)};La["EUC-KR"]=function(e){return new YT(e)};function Sl(e,r){var t=e>>8,i=e&255;return r?[t,i]:[i,t]}function Z1(e,r){var t=r.fatal,i=null,a=null;this.handler=function(n,o){if(o===Nr&&(i!==null||a!==null))return zr(t);if(o===Nr&&i===null&&a===null)return it;if(i===null)return i=o,null;var s;if(e?s=(i<<8)+o:s=(o<<8)+i,i=null,a!==null){var u=a;return a=null,Er(s,56320,57343)?65536+(u-55296)*1024+(s-56320):(n.prepend(Sl(s,e)),zr(t))}return Er(s,55296,56319)?(a=s,null):Er(s,56320,57343)?zr(t):s}}function J1(e,r){var t=r.fatal;this.handler=function(i,a){if(a===Nr)return it;if(Er(a,0,65535))return Sl(a,e);var n=Sl((a-65536>>10)+55296,e),o=Sl((a-65536&1023)+56320,e);return n.concat(o)}}Da["UTF-16BE"]=function(e){return new J1(!0,e)};La["UTF-16BE"]=function(e){return new Z1(!0,e)};Da["UTF-16LE"]=function(e){return new J1(!1,e)};La["UTF-16LE"]=function(e){return new Z1(!1,e)};function QT(e){var r=e.fatal;this.handler=function(t,i){return i===Nr?it:ti(i)?i:63360+i-128}}function ZT(e){var r=e.fatal;this.handler=function(t,i){return i===Nr?it:ri(i)?i:Er(i,63360,63487)?i-63360+128:ki(i)}}Da["x-user-defined"]=function(e){return new ZT(e)};La["x-user-defined"]=function(e){return new QT(e)};function Pu(e){return Buffer.from(e).toString("base64")}function zd(e){return Buffer.from(e,"base64").toString("ascii")}var Yx=Pt($x(),1),Xx=Pt(Lu(),1);function Kx(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function pC(e,r){let t=r.type?r.type.replace("image/",""):"jpeg",i=(0,Xx.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,Yx.default)(i,t,r)}function Qx(e,r){let t=pC(e,r);return new Promise(i=>{let a=[];t.on("data",n=>a.push(n)),t.on("end",()=>{let n=Buffer.concat(a);i(Kx(n))})})}var R5=Pt(P5(),1),Ng=["image/png","image/jpeg","image/gif"];async function Ug(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 SU(t,r)}function SU(e,r){return new Promise(t=>(0,R5.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 Hg(e,r,t,i){return i._parse(e,r,t,i)}function zi(e,r){if(!e)throw new Error(r||"loader assertion failed.")}var hn={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},EU=hn.self||hn.window||hn.global||{},jU=hn.window||hn.self||hn.global||{},AU=hn.global||hn.self||hn.window||{},TU=hn.document||{};var Qo=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var C5=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),PU=C5&&parseFloat(C5[1])||0;function Gg(e,r){return O5(e||{},r)}function O5(e,r){let t={...e};for(let[i,a]of Object.entries(r))a&&typeof a=="object"&&!Array.isArray(a)?t[i]=O5(t[i]||{},r[i]):t[i]=r[i];return t}var I5="latest";function RU(){var e;return(e=globalThis._loadersgl_)!=null&&e.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.0.3"),globalThis._loadersgl_.version}var Ic=RU();function ma(e,r){if(!e)throw new Error(r||"loaders.gl assertion failed.")}var mn={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},wJ=mn.self||mn.window||mn.global||{},_J=mn.window||mn.self||mn.global||{},kJ=mn.global||mn.self||mn.window||{},SJ=mn.document||{};var oa=typeof process!="object"||String(process)!=="[object process]"||process.browser,Bc=typeof importScripts=="function",F5=typeof window<"u"&&typeof window.orientation<"u",B5=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),EJ=B5&&parseFloat(B5[1])||0;var Fc=class{constructor(r,t){this.isRunning=!0;this._resolve=()=>{};this._reject=()=>{};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){ma(this.isRunning),this.isRunning=!1,this._resolve(r)}error(r){ma(this.isRunning),this.isRunning=!1,this._reject(r)}};var uu={};Au(uu,{NodeWorker:()=>Dc});var D5=Pt(require("worker_threads"),1);kl(uu,require("worker_threads"));var Dc=D5.Worker;var Wg=new Map;function L5(e){ma(e.source&&!e.url||!e.source&&e.url);let r=Wg.get(e.source||e.url);return r||(e.url&&(r=CU(e.url),Wg.set(e.url,r)),e.source&&(r=q5(e.source),Wg.set(e.source,r))),ma(r),r}function CU(e){if(!e.startsWith("http"))return e;let r=OU(e);return q5(r)}function q5(e){let r=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(r)}function OU(e){return`try {
96
96
  importScripts('${e}');
97
97
  } catch (error) {
98
98
  console.error(error);
99
99
  throw error;
100
- }`}function Lc(e,r=!0,t){let i=t||new Set;if(e){if(M5(e))i.add(e);else if(M5(e.buffer))i.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(let a in e)Lc(e[a],r,i)}}return t===void 0?Array.from(i):[]}function M5(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 Vg=()=>{},ko=class{constructor(r){this.terminated=!1;this._loadableURL="";let{name:t,source:i,url:a}=r;ma(i||a),this.name=t,this.source=i,this.url=a,this.onMessage=Vg,this.onError=n=>console.log(n),this.worker=oa?this._createBrowserWorker():this._createNodeWorker()}static isSupported(){return typeof Worker<"u"&&oa||typeof Dc<"u"&&!oa}destroy(){this.onMessage=Vg,this.onError=Vg,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(r,t){t=t||Lc(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=L5({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 Dc(i,{eval:!1})}else if(this.source)r=new Dc(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 qc=class{constructor(r){this.name="unnamed";this.maxConcurrency=1;this.maxMobileConcurrency=1;this.onDebug=()=>{};this.reuseWorkers=!0;this.props={};this.jobQueue=[];this.idleQueue=[];this.count=0;this.isDestroyed=!1;this.source=r.source,this.url=r.url,this.setProps(r)}static isSupported(){return ko.isSupported()}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 Fc(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){!oa||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 ko({name:r,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return F5?this.maxMobileConcurrency:this.maxConcurrency}};var IU={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},Qa=class{constructor(r){this.workerPools=new Map;this.props={...IU},this.setProps(r),this.workerPools=new Map}static isSupported(){return ko.isSupported()}static getWorkerFarm(r={}){return Qa._workerFarm=Qa._workerFarm||new Qa({}),Qa._workerFarm.setProps(r),Qa._workerFarm}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 qc({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}}};async function Zo(){let parentPort;try{eval("globalThis.parentPort = require('worker_threads').parentPort"),parentPort=globalThis.parentPort}catch{try{eval("globalThis.workerThreadsPromise = import('worker_threads')");let workerThreads=await globalThis.workerThreadsPromise;parentPort=workerThreads.parentPort}catch(e){console.error(e.message)}}return parentPort}var $g=new Map,Za=class{static async inWorkerThread(){return typeof self<"u"||Boolean(await Zo())}static set onmessage(r){async function t(i){let a=await Zo(),{type:n,payload:o}=a?i:i.data;r(n,o)}Zo().then(i=>{i?(i.on("message",t),i.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=t})}static async addEventListener(r){let t=$g.get(r);t||(t=async a=>{if(!BU(a))return;let n=await Zo(),{type:o,payload:s}=n?a:a.data;r(o,s)}),await Zo()?console.error("not implemented"):globalThis.addEventListener("message",t)}static async removeEventListener(r){let t=$g.get(r);$g.delete(r),await Zo()?console.error("not implemented"):globalThis.removeEventListener("message",t)}static async postMessage(r,t){let i={source:"loaders.gl",type:r,payload:t},a=Lc(t),n=await Zo();n?n.postMessage(i,a):globalThis.postMessage(i,a)}};function BU(e){let{type:r,data:t}=e;return r==="message"&&t&&typeof t.source=="string"&&t.source.startsWith("loaders.gl")}function Kg(e,r={}){let t=r[e.id]||{},i=oa?`${e.id}-worker.js`:`${e.id}-worker-node.js`,a=t.workerUrl;if(!a&&e.id==="compression"&&(a=r.workerUrl),r._workerType==="test"&&(oa?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 ma(a),a}function Yg(e,r=Ic){ma(e,"no worker provided");let t=e.version;return!(!r||!t)}var Qg={};Au(Qg,{readFileAsArrayBuffer:()=>wp,readFileAsText:()=>_p,requireFromFile:()=>kp,requireFromString:()=>cu});var Xg=Pt(require("module"),1),z5=Pt(require("path"),1),Mc=Pt(require("fs"),1);async function wp(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():Mc.readFileSync(e).buffer}async function _p(e){return e.startsWith("http")?await(await fetch(e)).text():Mc.readFileSync(e,"utf8")}async function kp(e){if(e.startsWith("http")){let i=await(await fetch(e)).text();return cu(i)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let r=await Mc.promises.readFile(e,"utf8");return cu(r)}function cu(e,r="",t){if(typeof r=="object"&&(t=r,r=""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let i=Xg.default._nodeModulePaths(z5.dirname(r)),a=typeof module<"u"&&(module==null?void 0:module.parent),n=new Xg.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 Zg={};async function gn(e,r=null,t={},i=null){return r&&(e=N5(e,r,t,i)),Zg[e]=Zg[e]||FU(e),await Zg[e]}function N5(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]:oa?t.CDN?(ma(t.CDN.startsWith("http")),`${t.CDN}/${r}@${Ic}/dist/libs/${i}`):Bc?`../src/libs/${i}`:`modules/${r}/src/libs/${i}`:`modules/${r}/dist/libs/${i}`}async function FU(e){if(e.endsWith("wasm"))return await LU(e);if(!oa)try{return Qg&&kp&&await kp(e)}catch(t){return console.error(t),null}if(Bc)return importScripts(e);let r=await qU(e);return DU(r,e)}function DU(e,r){if(!oa)return cu&&cu(e,r);if(Bc)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 LU(e){return oa||!wp||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await wp(e)}async function qU(e){return oa||!_p||e.startsWith("http")?await(await fetch(e)).text():await _p(e)}var MU=0;async function Jg(e){await Za.inWorkerThread()&&(Za.onmessage=async(r,t)=>{switch(r){case"process":try{let{input:i,options:a={},context:n={}}=t,o=await NU({loader:e,arrayBuffer:i,options:a,context:{...n,_parse:zU}});Za.postMessage("done",{result:o})}catch(i){let a=i instanceof Error?i.message:"";Za.postMessage("error",{error:a})}break;default:}})}function zU(e,r,t,i){return new Promise((a,n)=>{let o=MU++,s=(l,f)=>{if(f.id===o)switch(l){case"done":Za.removeEventListener(s),a(f.result);break;case"error":Za.removeEventListener(s),n(f.error);break;default:}};Za.addEventListener(s);let u={id:o,input:e,options:t};Za.postMessage("process",u)})}async function NU({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 ev(e,r){return!Qa.isSupported()||!oa&&!(r!=null&&r._nodeWorkers)?!1:e.worker&&(r==null?void 0:r.worker)}async function rv(e,r,t,i,a){let n=e.id,o=Kg(e,t),u=Qa.getWorkerFarm(t).getWorkerPool({name:n,url:o});t=JSON.parse(JSON.stringify(t)),i=JSON.parse(JSON.stringify(i||{}));let l=await u.startJob("process-on-worker",UU.bind(null,a));return l.postMessage("process",{input:r,options:t,context:i}),await(await l.result).result}async function UU(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 u=s instanceof Error?s.message:"unknown error";r.postMessage("error",{id:a,error:u})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}}function tv(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 av(...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 zc(e){let r=[];for await(let t of e)r.push(t);return av(...r)}function So(e){return So=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},So(e)}function iv(e,r){if(So(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var i=t.call(e,r||"default");if(So(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function nv(e){var r=iv(e,"string");return So(r)==="symbol"?r:String(r)}function ht(e,r,t){return r=nv(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var HU="",U5={};function Jo(e){for(let r in U5)if(e.startsWith(r)){let t=U5[r];e=e.replace(r,t)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${HU}${e}`),e}function H5(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function G5(e){return e&&typeof e=="object"&&e.isBuffer}function Sp(e){if(G5(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 es={};Au(es,{dirname:()=>VU,filename:()=>WU,join:()=>$U,resolve:()=>KU});function W5(){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 WU(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(r+1):""}function VU(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(0,r):""}function $U(...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 KU(...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=W5()),o=a),o.length!==0&&(t=`${o}/${t}`,i=o.charCodeAt(0)===Nc)}return t=YU(t,!i),i?`/${t}`:t.length>0?t:"."}var Nc=47,ov=46;function YU(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===Nc)break;n=Nc}if(n===Nc){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(t.length<2||!o||t.charCodeAt(t.length-1)!==ov||t.charCodeAt(t.length-2)!==ov){if(t.length>2){let u=t.length-1,l=u;for(;l>=0&&t.charCodeAt(l)!==Nc;--l);if(l!==u){t=l===-1?"":t.slice(0,l),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 u=e.slice(i+1,s);t.length>0?t+=`/${u}`:t=u,o=!1}i=s,a=0}else n===ov&&a!==-1?++a:a=-1}return t}var rs=Pt(require("fs"),1),ts=class{constructor(r,t,i){r=Jo(r),this.handle=rs.default.openSync(r,t,i);let a=rs.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)=>{rs.default.close(this.handle,i=>i?t(i):r())})}async stat(){return await new Promise((r,t)=>rs.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 u=await XU(this.handle,o,0,t,a);if(u===0)break;n+=u,a+=BigInt(u),t-=u,s!==void 0&&(s+=u)}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);rs.default.write(this.handle,s,0,i,o,(u,l)=>u?n(u):a(l))})}};async function XU(e,r,t,i,a){return await new Promise((n,o)=>rs.default.read(e,r,t,i,a,(s,u)=>s?o(s):n(u)))}var Tp=Pt(require("fs/promises"),1);var uv=Pt(require("fs"),1),sv=require("stream");var Ep=Pt(require("zlib"),1),QU=e=>e&&e instanceof ArrayBuffer,ZU=e=>e&&e instanceof Buffer;function jp(e,r){switch(r==null?void 0:r.get("content-encoding")){case"br":return e.pipe(Ep.default.createBrotliDecompress());case"gzip":return e.pipe(Ep.default.createGunzip());case"deflate":return e.pipe(Ep.default.createDeflate());default:return e}}async function V5(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(eH(a))}),e.on("end",()=>{let a=JU(r);t(a)})})}function JU(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 eH(e){if(QU(e))return e;if(ZU(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 rH=e=>typeof e=="boolean",$5=e=>typeof e=="function",tH=e=>e!==null&&typeof e=="object",aH=e=>tH(e)&&$5(e.read)&&$5(e.pipe)&&rH(e.readable);async function Ap(e,r){let t=/^file:\/\//;e.replace(t,"/");let i=e.split("?")[0];i=Jo(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,d)=>{let m=uv.default.createReadStream(i,{encoding:null});m.once("readable",()=>h(m)),m.on("error",y=>d(y))}),o=n;aH(n)?o=jp(n,a):typeof n=="string"?o=sv.Readable.from([new TextEncoder().encode(n)]):o=sv.Readable.from([n||new ArrayBuffer(0)]);let s=200,u="OK",l=iH(i),f=new Response(o,{headers:l,status:s,statusText:u});return Object.defineProperty(f,"url",{value:e}),f}catch(n){let o=n.message,s=400,u=o,l={},f=new Response(o,{headers:l,status:s,statusText:u});return Object.defineProperty(f,"url",{value:e}),f}}function iH(e){let r={};if(!r["content-length"]){let t=uv.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 Pp=class{constructor(){this.readable=!0;this.writable=!0}async readdir(r=".",t){return await Tp.default.readdir(r,t)}async stat(r){let t=await Tp.default.stat(r,{bigint:!0});return{size:Number(t.size),bigsize:t.size,isDirectory:t.isDirectory()}}async unlink(r){return await Tp.default.unlink(r)}async fetch(r,t){return await Ap(r,t)}async openReadableFile(r,t="r"){return new ts(r,t)}async openWritableFile(r,t="w",i){return new ts(r,t,i)}};var Uc=class{constructor(r={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(r,t="base64"){var o,s;let i=[];for await(let u of r)i.push(u),yield u;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 zc(r)}};var Hc=Pt(require("crypto"),1),Rp=class extends Uc{constructor(t){var i,a;super();this.name="crypto-node";if(this.options=t,!((a=(i=this.options)==null?void 0:i.crypto)!=null&&a.algorithm))throw new Error(this.name)}async hash(t,i){var n,o,s,u;let a=(s=(o=(n=this.options)==null?void 0:n.crypto)==null?void 0:o.algorithm)==null?void 0:s.toLowerCase();try{if(!Hc.createHash)throw new Error("crypto.createHash not available");let l=(u=Hc.createHash)==null?void 0:u(a),f=new Uint8Array(t);return l.update(f).digest("base64")}catch(l){throw Error(`${a} hash not available. ${l}`)}}async*hashBatches(t,i="base64"){var o,s,u,l,f,h,d;if(!Hc.createHash)throw new Error("crypto.createHash not available");let a=(l=Hc.createHash)==null?void 0:l((u=(s=(o=this.options)==null?void 0:o.crypto)==null?void 0:s.algorithm)==null?void 0:u.toLowerCase());for await(let m of t){let y=new Uint8Array(m);a.update(y),yield m}let n=a.digest(i);(d=(h=(f=this.options)==null?void 0:f.crypto)==null?void 0:h.onEnd)==null||d.call(h,{hash:n})}};var u4=require("node:process");var K5=Pt(require("stream"),1),cv=class{},nH=K5.Readable||cv;function fv(e,r){let t=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new lv(t,r)}var lv=class extends nH{constructor(t,i){super(i);this._iterator=t,this._pulling=!1,this._bytesMode=!i||!i.objectMode}async _read(t){this._pulling||(this._pulling=!0,this._pulling=await this._pull(t,this._iterator))}async _destroy(t,i){var a,n,o,s;this._iterator&&(t?await((n=(a=this._iterator)==null?void 0:a.throw)==null?void 0:n.call(a,t)):await((s=(o=this._iterator)==null?void 0:o.return)==null?void 0:s.call(o,t)),i==null||i(null))}async _pull(t,i){var o;let a=this._bytesMode,n=null;for(;this.readable&&!(n=await i.next()).done&&(t!==null&&(t-=a&&ArrayBuffer.isView(n.value)?n.value.byteLength:1),!(!this.push(new Uint8Array(n.value))||t<=0)););return(n!=null&&n.done||!this.readable)&&(this.push(null)||!0)&&((o=i==null?void 0:i.return)==null||o.call(i)),!this.readable}};var Q5=Pt(X5(),1);delete globalThis.ReadableStream;var Op=class extends Q5.ReadableStream{};var Ip=class{constructor(r){this.isWorking=!1;this.isCancelled=!1;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 Bp=class extends Op{constructor(t){super(new Ip(t.values()),{type:"bytes"});this._chunks=t}async*[Symbol.asyncIterator](t){let i=this.getReader();yield*this._chunks,i.releaseLock()}};var as=class{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 as)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=oH(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),u=Math.max(s-o,0),l=new as([],{type:i});if(u===0)return l;let f=0,h=[];for(let d of n){let{byteLength:m}=d;if(o>0&&m<=o)o-=m,s-=m;else{let y=d.subarray(o,Math.min(m,s));if(h.push(y),f+=y.byteLength,o=0,f>=u)break}}return l.parts=h,l.size=f,l}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 Bp(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 oH(e=""){let r=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(r)?"":r}function sH(){return typeof Blob>"u"&&!globalThis.Blob&&(globalThis.Blob=as),globalThis.Blob}var uH=sH();var Fp=class{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,${Pu(t)}`;this.onload&&this.onload({target:{result:i}})}async readAsText(r){let t=await r.text();this.onload&&this.onload({target:{result:t}})}};var Dp=class extends globalThis.Blob{constructor(t,i,a={}){super(t,a);this.name="";this.webkitRelativePath="";this.name=String(i).replace(/\//g,":"),this.lastModified=(a==null?void 0:a.lastModified)||Date.now()}get[Symbol.toStringTag](){return"File"}};function Z5(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=Fp),typeof File>"u"&&!globalThis.File&&(globalThis.File=Dp),global}var cH=Z5();var pv=Pt(require("module"),1),J5=Pt(require("path"),1),qp=Pt(require("fs"),1);async function e4(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():qp.default.readFileSync(e).buffer}async function r4(e){return e.startsWith("http")?await(await fetch(e)).text():qp.default.readFileSync(e,"utf8")}async function t4(e){if(e.startsWith("http")){let i=await(await fetch(e)).text();return Lp(i)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let r=await qp.default.readFileSync(e,"utf8");return Lp(r)}function Lp(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=pv.default._nodeModulePaths(J5.default.dirname(r)),a=typeof module<"u"&&(module==null?void 0:module.parent),n=new pv.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 Ni=class{constructor(r){this.map={},r instanceof Ni?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=Gc(r),t=a4(t);let i=this.map[r];this.map[r]=i?`${i}, ${t}`:t}delete(r){delete this.map[Gc(r)]}get(r){return r=Gc(r),this.has(r)?this.map[r]:null}has(r){return this.map.hasOwnProperty(Gc(r))}set(r,t){this.map[Gc(r)]=a4(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)}),dv(r)}values(){let r=[];return this.forEach(function(t){r.push(t)}),dv(r)}entries(){let r=[];return this.forEach(function(t,i){r.push([i,t])}),dv(r)}*[Symbol.iterator](){yield*this.entries()}};function Gc(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 a4(e){return typeof e!="string"&&(e=String(e)),e}function dv(e){let r={next(){let t=e.shift();return{done:t===void 0,value:t}}};return r[Symbol.iterator]=function(){return r},r}function hv(e,r){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${r}`)}var gv=Pt(require("stream"),1),lH=e=>typeof e=="boolean",i4=e=>typeof e=="function",fH=e=>e!==null&&typeof e=="object",mv=e=>fH(e)&&i4(e.read)&&i4(e.pipe)&&lH(e.readable),Mn=class{constructor(r,t){this.bodyUsed=!1;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 Ni((t==null?void 0:t.headers)||{}),mv(r)?this._body=jp(r,i):typeof r=="string"?this._body=gv.Readable.from([new TextEncoder().encode(r)]):this._body=gv.Readable.from([r||new ArrayBuffer(0)])}get body(){return hv(!this.bodyUsed),hv(mv(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return mv(this._body)?await V5(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 o4=Pt(require("http"),1),s4=Pt(require("https"),1);var pH=e=>e&&e instanceof ArrayBuffer,dH=e=>e&&e instanceof Buffer;function n4(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:hH(t),mimeType:i}}function hH(e){if(pH(e))return e;if(dH(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 vv=e=>e.startsWith("data:"),mH=e=>e.startsWith("http:")||e.startsWith("https:");async function Wc(e,r){try{if(globalThis.fetch!==Wc&&(mH(e)||vv(e)))return await fetch(e,r);if(vv(e)){let{arrayBuffer:l,mimeType:f}=n4(e);return new Mn(l,{headers:{"content-type":f},url:e})}let t={},i=e;e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip");let a=await gH(i,r),n=xH(e,a,t),{status:o,statusText:s}=yH(a),u=!r||r.followRedirect||r.followRedirect===void 0;if(o>=300&&o<400&&n.has("location")&&u){let l=vH(e,n.get("location"));return await Wc(l,r)}return new Mn(a,{headers:n,status:o,statusText:s,url:e})}catch(t){return new Mn(null,{status:400,statusText:String(t),url:e})}}async function gH(e,r){return await new Promise((t,i)=>{let a=bH(e,r),n=e.startsWith("https:")?s4.default.request(a,o=>t(o)):o4.default.request(a,o=>t(o));n.on("error",o=>i(o)),n.end()})}function vH(e,r){if(r.startsWith("http"))return r;let t=new URL(e);return t.pathname=r,t.href}function bH(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 yH(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function xH(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=wH(e);Number.isFinite(a)&&(i["content-length"]=a)}return Object.assign(i,t),new Ni(i)}function wH(e){return vv(e)?e.length-5:null}var _H=parseInt(u4.versions.node.split(".")[0]);V1&&console.error("loaders.gl: The @loaders.gl/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=fv;globalThis.loaders.NodeFile=ts;globalThis.loaders.NodeFileSystem=Pp;globalThis.loaders.fetchNode=Ap;globalThis.loaders.NodeHash=Rp;globalThis.TextEncoder||(globalThis.TextEncoder=Tu);globalThis.TextDecoder||(globalThis.TextDecoder=Oo);!("atob"in globalThis)&&Pu&&(globalThis.atob=Pu);!("btoa"in globalThis)&&zd&&(globalThis.btoa=zd);globalThis.loaders.encodeImageNode=Qx;globalThis.loaders.parseImageNode=Ug;globalThis.loaders.imageFormatsNode=Ng;globalThis._parseImageNode=Ug;globalThis._imageFormatsNode=Ng;globalThis.loaders.readFileAsArrayBuffer=e4;globalThis.loaders.readFileAsText=r4;globalThis.loaders.requireFromFile=t4;globalThis.loaders.requireFromString=Lp;_H<18&&(!("Headers"in globalThis)&&Ni&&(globalThis.Headers=Ni),!("Response"in globalThis)&&Mn&&(globalThis.Response=Mn),!("fetch"in globalThis)&&Wc&&(globalThis.fetch=Wc));var kH=e=>typeof e=="boolean",Vc=e=>typeof e=="function",is=e=>e!==null&&typeof e=="object",bv=e=>is(e)&&e.constructor==={}.constructor;var c4=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",l4=e=>e&&typeof e[Symbol.asyncIterator]=="function";var di=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var hi=e=>typeof Blob<"u"&&e instanceof Blob,f4=e=>e&&typeof e=="object"&&e.isBuffer;var SH=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||is(e)&&Vc(e.tee)&&Vc(e.cancel)&&Vc(e.getReader);var EH=e=>is(e)&&Vc(e.read)&&Vc(e.pipe)&&kH(e.readable),Mp=e=>SH(e)||EH(e);var jH=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,AH=/^([-\w.]+\/[-\w.+]+)/;function p4(e){let r=AH.exec(e);return r?r[1]:e}function yv(e){let r=jH.exec(e);return r?r[1]:""}var d4=/\?.*/;function h4(e){let r=e.match(d4);return r&&r[0]}function lu(e){return e.replace(d4,"")}function ns(e){return di(e)?e.url:hi(e)?e.name||"":typeof e=="string"?e:""}function $c(e){if(di(e)){let r=e,t=r.headers.get("content-type")||"",i=lu(r.url);return p4(t)||yv(i)}return hi(e)?e.type||"":typeof e=="string"?yv(e):""}function m4(e){return di(e)?e.headers["content-length"]||-1:hi(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function zp(e){if(di(e))return e;let r={},t=m4(e);t>=0&&(r["content-length"]=String(t));let i=ns(e),a=$c(e);a&&(r["content-type"]=a);let n=await PH(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 g4(e){if(!e.ok){let r=await TH(e);throw new Error(r)}}async function TH(e){let r=`Failed to fetch resource ${e.url} (${e.status}): `;try{let t=e.headers.get("Content-Type"),i=e.statusText;t!=null&&t.includes("application/json")&&(i+=` ${await e.text()}`),r+=i,r=r.length>60?`${r.slice(0,60)}...`:r}catch{}return r}async function PH(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,${RH(t)}`}return null}function RH(e){let r="",t=new Uint8Array(e);for(let i=0;i<t.byteLength;i++)r+=String.fromCharCode(t[i]);return btoa(r)}function CH(e){return!OH(e)&&!IH(e)}function OH(e){return e.startsWith("http:")||e.startsWith("https:")}function IH(e){return e.startsWith("data:")}async function xv(e,r){var t,i;if(typeof e=="string"){let a=Jo(e);return CH(a)&&(t=globalThis.loaders)!=null&&t.fetchNode?(i=globalThis.loaders)==null?void 0:i.fetchNode(a,r):await fetch(a,r)}return await zp(e)}function wv(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let r=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,t=e||r;return!!(t&&t.indexOf("Electron")>=0)}function Ui(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||wv()}var BH=globalThis.self||globalThis.window||globalThis.global,fu=globalThis.window||globalThis.self||globalThis.global,FH=globalThis.document||{},os=globalThis.process||{},DH=globalThis.console,Tte=globalThis.navigator||{};var Np="4.0.2",Cte=Ui();function LH(e){try{let r=window[e],t="__storage_test__";return r.setItem(t,t),r.removeItem(t),r}catch{return null}}var Up=class{constructor(r,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";ht(this,"storage",void 0),ht(this,"id",void 0),ht(this,"config",void 0),this.storage=LH(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 v4(e){let r;return e<10?r="".concat(e.toFixed(2),"ms"):e<100?r="".concat(e.toFixed(1),"ms"):e<1e3?r="".concat(e.toFixed(0),"ms"):r="".concat((e/1e3).toFixed(2),"s"),r}function b4(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,t=Math.max(r-e.length,0);return"".concat(" ".repeat(t)).concat(e)}function Hp(e,r,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,a=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(t=Math.min(t,i/e.width));let n=e.width*t,o=e.height*t,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(n/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(a,");"),"background-size:".concat(n,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(r," %c+"),s]}var Gp;(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"})(Gp||(Gp={}));var qH=10;function y4(e){return typeof e!="string"?e:(e=e.toUpperCase(),Gp[e]||Gp.WHITE)}function x4(e,r,t){if(!Ui&&typeof e=="string"){if(r){let i=y4(r);e="\x1B[".concat(i,"m").concat(e,"\x1B[39m")}if(t){let i=y4(t);e="\x1B[".concat(i+qH,"m").concat(e,"\x1B[49m")}}return e}function w4(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],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 pu(e,r){if(!e)throw new Error(r||"Assertion failed")}function ss(){let e;if(Ui()&&fu.performance){var r,t;e=fu===null||fu===void 0||(r=fu.performance)===null||r===void 0||(t=r.now)===null||t===void 0?void 0:t.call(r)}else if("hrtime"in os){var i;let a=os===null||os===void 0||(i=os.hrtime)===null||i===void 0?void 0:i.call(os);e=a[0]*1e3+a[1]/1e6}else e=Date.now();return e}var du={debug:Ui()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},MH={enabled:!0,level:0};function mi(){}var _4={},k4={once:!0},vn=class{constructor(){let{id:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};ht(this,"id",void 0),ht(this,"VERSION",Np),ht(this,"_startTs",ss()),ht(this,"_deltaTs",ss()),ht(this,"_storage",void 0),ht(this,"userData",{}),ht(this,"LOG_THROTTLE_TIMEOUT",0),this.id=r,this.userData={},this._storage=new Up("__probe-".concat(this.id,"__"),MH),this.timeStamp("".concat(this.id," started")),w4(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((ss()-this._startTs).toPrecision(10))}getDelta(){return Number((ss()-this._deltaTs).toPrecision(10))}set priority(r){this.level=r}get priority(){return this.level}getPriority(){return this.level}enable(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!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){pu(r,t)}warn(r){return this._getLogFunction(0,r,du.warn,arguments,k4)}error(r){return this._getLogFunction(0,r,du.error,arguments)}deprecated(r,t){return this.warn("`".concat(r,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}removed(r,t){return this.error("`".concat(r,"` has been removed. Use `").concat(t,"` instead"))}probe(r,t){return this._getLogFunction(r,t,du.log,arguments,{time:!0,once:!0})}log(r,t){return this._getLogFunction(r,t,du.debug,arguments)}info(r,t){return this._getLogFunction(r,t,console.info,arguments)}once(r,t){return this._getLogFunction(r,t,du.debug||du.info,arguments,k4)}table(r,t,i){return t?this._getLogFunction(r,t,console.table||mi,i&&[i],{tag:HH(t)}):mi}image(r){let{logLevel:t,priority:i,image:a,message:n="",scale:o=1}=r;return this._shouldLog(t||i)?Ui()?UH({image:a,message:n,scale:o}):NH({image:a,message:n,scale:o}):mi}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||mi)}group(r,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},a=S4({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){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(r,t,Object.assign({},i,{collapsed:!0}))}groupEnd(r){return this._getLogFunction(r,"",console.groupEnd||mi)}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()>=E4(r)}_getLogFunction(r,t,i,a,n){if(this._shouldLog(r)){n=S4({logLevel:r,message:t,args:a,opts:n}),i=i||n.method,pu(i),n.total=this.getTotal(),n.delta=this.getDelta(),this._deltaTs=ss();let o=n.tag||n.message;if(n.once&&o)if(!_4[o])_4[o]=ss();else return mi;return t=zH(this.id,n.message,n),i.bind(console,t,...n.args)}return mi}};ht(vn,"VERSION",Np);function E4(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 pu(Number.isFinite(r)&&r>=0),r}function S4(e){let{logLevel:r,message:t}=e;e.logLevel=E4(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 pu(a==="string"||a==="object"),Object.assign(e,{args:i},e.opts)}function zH(e,r,t){if(typeof r=="string"){let i=t.time?b4(v4(t.total)):"";r=t.time?"".concat(e,": ").concat(i," ").concat(r):"".concat(e,": ").concat(r),r=x4(r,t.color,t.background)}return r}function NH(e){let{image:r,message:t="",scale:i=1}=e;return console.warn("removed"),mi}function UH(e){let{image:r,message:t="",scale:i=1}=e;if(typeof r=="string"){let n=new Image;return n.onload=()=>{let o=Hp(n,t,i);console.log(...o)},n.src=r,mi}let a=r.nodeName||"";if(a.toLowerCase()==="img")return console.log(...Hp(r,t,i)),mi;if(a.toLowerCase()==="canvas"){let n=new Image;return n.onload=()=>console.log(...Hp(n,t,i)),n.src=r.toDataURL(),mi}return mi}function HH(e){for(let r in e)for(let t in e[r])return t||"untitled";return"empty"}var iae=new vn({id:"@probe.gl/log"});var _v=new vn({id:"loaders.gl"}),Wp=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},Vp=class{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 kv={fetch:null,mimeType:void 0,nothrow:!1,log:new Vp,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:Qo,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},j4={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 Sv(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state=e._state||{},e._state}function Ev(){let e=Sv();return e.globalOptions=e.globalOptions||{...kv},e.globalOptions}function P4(e,r,t,i){return t=t||[],t=Array.isArray(t)?t:[t],GH(e,t),VH(r,e,i)}function GH(e,r){A4(e,null,kv,j4,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]||{};A4(i,t.id,a,n,r)}}function A4(e,r,t,i,a){let n=r||"Top level",o=r?`${r}.`:"";for(let s in e){let u=!r&&is(e[s]),l=s==="baseUri"&&!r,f=s==="workerUrl"&&r;if(!(s in t)&&!l&&!f){if(s in i)_v.warn(`${n} loader option '${o}${s}' no longer supported, use '${i[s]}'`)();else if(!u){let h=WH(s,a);_v.warn(`${n} loader option '${o}${s}' not recognized. ${h}`)()}}}}function WH(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 VH(e,r,t){let a={...e.options||{}};return $H(a,t),a.log===null&&(a.log=new Wp),T4(a,Ev()),T4(a,r),a}function T4(e,r){for(let t in r)if(t in r){let i=r[t];bv(i)&&bv(e[t])?e[t]={...e[t],...r[t]}:e[t]=r[t]}}function $H(e,r){r&&!("baseUri"in e)&&(e.baseUri=r)}function Kc(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function jv(e){zi(e,"null loader"),zi(Kc(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 KH=()=>{let e=Sv();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function R4(){return KH()}var C4=new vn({id:"loaders.gl"});var YH=/\.([^.]+)$/;async function B4(e,r=[],t,i){if(!F4(e))return null;let a=O4(e,r,{...t,nothrow:!0},i);if(a)return a;if(hi(e)&&(e=await e.slice(0,10).arrayBuffer(),a=O4(e,r,t,i)),!a&&!(t!=null&&t.nothrow))throw new Error(D4(e));return a}function O4(e,r=[],t,i){if(!F4(e))return null;if(r&&!Array.isArray(r))return jv(r);let a=[];r&&(a=a.concat(r)),t!=null&&t.ignoreRegisteredLoaders||a.push(...R4()),QH(a);let n=XH(e,a,t,i);if(!n&&!(t!=null&&t.nothrow))throw new Error(D4(e));return n}function XH(e,r,t,i){let a=ns(e),n=$c(e),o=lu(a)||(i==null?void 0:i.url),s=null,u="";return t!=null&&t.mimeType&&(s=Av(r,t==null?void 0:t.mimeType),u=`match forced by supplied MIME type ${t==null?void 0:t.mimeType}`),s=s||ZH(r,o),u=u||(s?`matched url ${o}`:""),s=s||Av(r,n),u=u||(s?`matched MIME type ${n}`:""),s=s||eG(r,e),u=u||(s?`matched initial data ${L4(e)}`:""),t!=null&&t.fallbackMimeType&&(s=s||Av(r,t==null?void 0:t.fallbackMimeType),u=u||(s?`matched fallback MIME type ${n}`:"")),u&&C4.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${u}.`),s}function F4(e){return!(e instanceof Response&&e.status===204)}function D4(e){let r=ns(e),t=$c(e),i="No valid loader found (";i+=r?`${es.filename(r)}, `:"no url provided, ",i+=`MIME type: ${t?`"${t}"`:"not provided"}, `;let a=e?L4(e):"";return i+=a?` first bytes: "${a}"`:"first bytes: not available",i+=")",i}function QH(e){for(let r of e)jv(r)}function ZH(e,r){let t=r&&YH.exec(r),i=t&&t[1];return i?JH(e,i):null}function JH(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 Av(e,r){for(let t of e)if(t.mimeTypes&&t.mimeTypes.includes(r)||r===`application/x.${t.id}`)return t;return null}function eG(e,r){if(!r)return null;for(let t of e)if(typeof r=="string"){if(rG(r,t))return t}else if(ArrayBuffer.isView(r)){if(I4(r.buffer,r.byteOffset,t))return t}else if(r instanceof ArrayBuffer&&I4(r,0,t))return t;return null}function rG(e,r){return r.testText?r.testText(e):(Array.isArray(r.tests)?r.tests:[r.tests]).some(i=>e.startsWith(i))}function I4(e,r,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(a=>tG(e,r,t,a))}function tG(e,r,t,i){if(i instanceof ArrayBuffer)return tv(i,e,i.byteLength);switch(typeof i){case"function":return i(e);case"string":let a=Tv(e,r,i.length);return i===a;default:return!1}}function L4(e,r=5){return typeof e=="string"?e.slice(0,r):ArrayBuffer.isView(e)?Tv(e.buffer,e.byteOffset,r):e instanceof ArrayBuffer?Tv(e,0,r):""}function Tv(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*q4(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*M4(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*z4(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 Pv(e,r){return Qo?aG(e,r):iG(e,r)}async function*aG(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 Sp(o)}}catch{t.releaseLock()}}async function*iG(e,r){for await(let t of e)yield Sp(t)}function N4(e,r){if(typeof e=="string")return q4(e,r);if(e instanceof ArrayBuffer)return M4(e,r);if(hi(e))return z4(e,r);if(Mp(e))return Pv(e,r);if(di(e))return Pv(e.body,r);throw new Error("makeIterator")}var U4="Cannot convert supplied data type";function nG(e,r,t){if(r.text&&typeof e=="string")return e;if(f4(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(U4)}async function H4(e,r,t){let i=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||i)return nG(e,r,t);if(hi(e)&&(e=await zp(e)),di(e)){let a=e;return await g4(a),r.binary?await a.arrayBuffer():await a.text()}if(Mp(e)&&(e=N4(e,t)),c4(e)||l4(e))return zc(e);throw new Error(U4)}function $p(e,r){let t=Ev(),i=e||t;return typeof i.fetch=="function"?i.fetch:is(i.fetch)?a=>xv(a,i.fetch):r!=null&&r.fetch?r==null?void 0:r.fetch:xv}function G4(e,r,t){if(t)return t;let i={fetch:$p(r,e),...e};if(i.url){let a=lu(i.url);i.baseUrl=a,i.queryString=h4(i.url),i.filename=es.filename(a),i.baseUrl=es.dirname(a)}return Array.isArray(i.loaders)||(i.loaders=null),i}function W4(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 zn(e,r,t,i){r&&!Array.isArray(r)&&!Kc(r)&&(i=void 0,t=r,r=void 0),e=await e,t=t||{};let a=ns(e),o=W4(r,i),s=await B4(e,o,t);return s?(t=P4(t,s,o,a),i=G4({url:a,_parse:zn,loaders:o},t,i||null),await oG(s,e,t,i)):null}async function oG(e,r,t,i){if(Yg(e),t=Gg(e.options,t),di(r)){let n=r,{ok:o,redirected:s,status:u,statusText:l,type:f,url:h}=n,d=Object.fromEntries(n.headers.entries());i.response={headers:d,ok:o,redirected:s,status:u,statusText:l,type:f,url:h}}r=await H4(r,e,t);let a=e;if(a.parseTextSync&&typeof r=="string")return a.parseTextSync(r,t,i);if(ev(e,t))return await rv(e,r,t,i,zn);if(a.parseText&&typeof r=="string")return await a.parseText(r,t,i);if(a.parse)return await a.parse(r,t,i);throw ma(!a.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}async function Rv(e,r,t,i){let a,n;!Array.isArray(r)&&!Kc(r)?(a=[],n=r,i=void 0):(a=r,n=t);let o=$p(n),s=e;return typeof e=="string"&&(s=await o(e)),hi(e)&&(s=await o(e)),Array.isArray(a)?await zn(s,a,n):await zn(s,a,n)}var sG=1/Math.PI*180,uG=1/180*Math.PI,cG={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...cG}};var Bt=globalThis.mathgl.config;function Cv(e,{precision:r=Bt.precision}={}){return e=lG(e),"".concat(parseFloat(e.toPrecision(r)))}function Eo(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ov(e){return V4(e)}function Iv(e){return $4(e)}function V4(e,r){return K4(e,t=>t*uG,r)}function $4(e,r){return K4(e,t=>t*sG,r)}function Nn(e,r,t){let i=Bt.EPSILON;t&&(Bt.EPSILON=t);try{if(e===r)return!0;if(Eo(e)&&Eo(r)){if(e.length!==r.length)return!1;for(let a=0;a<e.length;++a)if(!Nn(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)<=Bt.EPSILON*Math.max(1,Math.abs(e),Math.abs(r)):!1}finally{Bt.EPSILON=i}}function lG(e){return Math.round(e/Bt.EPSILON)*Bt.EPSILON}function fG(e){return e.clone?e.clone():new Array(e.length)}function K4(e,r,t){if(Eo(e)){let i=e;t=t||fG(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)}function pG(e){function r(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return r.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e,r}var hu=class extends pG(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:Eo(r)?this.toArray(r):this.toObject(r)}toTarget(r){return r?this.to(r):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Bt)}formatString(r){let t="";for(let i=0;i<this.ELEMENTS;++i)t+=(i>0?", ":"")+Cv(this[i],r);return"".concat(r.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(r){if(!r||this.length!==r.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!Nn(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(Bt.debug&&!this.validate())throw new Error("math.gl: ".concat(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 dG(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 Aa(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function Kp(e,r,t=""){if(Bt.debug&&!dG(e,r))throw new Error("math.gl: ".concat(t," some fields set to invalid numbers'"));return e}function gi(e,r){if(!e)throw new Error("math.gl assertion ".concat(r))}var Yp=class extends hu{get x(){return this[0]}set x(r){this[0]=Aa(r)}get y(){return this[1]}set y(r){this[1]=Aa(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 Aa(t)}dot(r){let t=0;for(let i=0;i<this.ELEMENTS;++i)t+=this[i]*r[i];return Aa(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 gi(r>=0&&r<this.ELEMENTS,"index is out of range"),Aa(this[r])}setComponent(r,t){return gi(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 Hi=typeof Float32Array<"u"?Float32Array:Array,Yc=Math.random;function mu(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var Rie=Math.PI/180;function hG(){let e=new Hi(2);return Hi!=Float32Array&&(e[0]=0,e[1]=0),e}function Y4(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 Cie=function(){let e=hG();return function(r,t,i,a,n,o){let s,u;for(t||(t=2),i||(i=0),a?u=Math.min(a*t+i,r.length):u=r.length,s=i;s<u;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 X4(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 Xp(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 Q4(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 Qc={};Au(Qc,{add:()=>yG,angle:()=>Uv,bezier:()=>IG,ceil:()=>xG,clone:()=>mG,copy:()=>vG,create:()=>Z4,cross:()=>Dv,dist:()=>UG,distance:()=>aj,div:()=>NG,divide:()=>tj,dot:()=>Fv,equals:()=>qG,exactEquals:()=>LG,floor:()=>wG,forEach:()=>VG,fromValues:()=>gG,hermite:()=>OG,inverse:()=>TG,len:()=>GG,length:()=>J4,lerp:()=>RG,max:()=>kG,min:()=>_G,mul:()=>zG,multiply:()=>rj,negate:()=>AG,normalize:()=>PG,random:()=>BG,rotateX:()=>Mv,rotateY:()=>zv,rotateZ:()=>Nv,round:()=>SG,scale:()=>EG,scaleAndAdd:()=>jG,set:()=>bG,slerp:()=>CG,sqrDist:()=>HG,sqrLen:()=>WG,squaredDistance:()=>ij,squaredLength:()=>nj,str:()=>DG,sub:()=>MG,subtract:()=>ej,transformMat3:()=>Lv,transformMat4:()=>Xc,transformQuat:()=>qv,zero:()=>FG});function Z4(){let e=new Hi(3);return Hi!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function mG(e){let r=new Hi(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function J4(e){let r=e[0],t=e[1],i=e[2];return Math.sqrt(r*r+t*t+i*i)}function gG(e,r,t){let i=new Hi(3);return i[0]=e,i[1]=r,i[2]=t,i}function vG(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function bG(e,r,t,i){return e[0]=r,e[1]=t,e[2]=i,e}function yG(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e}function ej(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e}function rj(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e}function tj(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e[2]=r[2]/t[2],e}function xG(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e}function wG(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e}function _G(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 kG(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 SG(e,r){return e[0]=mu(r[0]),e[1]=mu(r[1]),e[2]=mu(r[2]),e}function EG(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e}function jG(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 aj(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 ij(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 nj(e){let r=e[0],t=e[1],i=e[2];return r*r+t*t+i*i}function AG(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e}function TG(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e}function PG(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 Fv(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function Dv(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[0],s=t[1],u=t[2];return e[0]=a*u-n*s,e[1]=n*o-i*u,e[2]=i*s-a*o,e}function RG(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 CG(e,r,t,i){let a=Math.acos(Math.min(Math.max(Fv(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 OG(e,r,t,i,a,n){let o=n*n,s=o*(2*n-3)+1,u=o*(n-2)+n,l=o*(n-1),f=o*(3-2*n);return e[0]=r[0]*s+t[0]*u+i[0]*l+a[0]*f,e[1]=r[1]*s+t[1]*u+i[1]*l+a[1]*f,e[2]=r[2]*s+t[2]*u+i[2]*l+a[2]*f,e}function IG(e,r,t,i,a,n){let o=1-n,s=o*o,u=n*n,l=s*o,f=3*n*s,h=3*u*o,d=u*n;return e[0]=r[0]*l+t[0]*f+i[0]*h+a[0]*d,e[1]=r[1]*l+t[1]*f+i[1]*h+a[1]*d,e[2]=r[2]*l+t[2]*f+i[2]*h+a[2]*d,e}function BG(e,r){r=r===void 0?1:r;let t=Yc()*2*Math.PI,i=Yc()*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 Xc(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 Lv(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 qv(e,r,t){let i=t[0],a=t[1],n=t[2],o=t[3],s=r[0],u=r[1],l=r[2],f=a*l-n*u,h=n*s-i*l,d=i*u-a*s,m=a*d-n*h,y=n*f-i*d,k=i*h-a*f,x=o*2;return f*=x,h*=x,d*=x,m*=2,y*=2,k*=2,e[0]=s+f+m,e[1]=u+h+y,e[2]=l+d+k,e}function Mv(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 zv(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 Nv(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 Uv(e,r){let t=e[0],i=e[1],a=e[2],n=r[0],o=r[1],s=r[2],u=Math.sqrt((t*t+i*i+a*a)*(n*n+o*o+s*s)),l=u&&Fv(e,r)/u;return Math.acos(Math.min(Math.max(l,-1),1))}function FG(e){return e[0]=0,e[1]=0,e[2]=0,e}function DG(e){return"vec3(".concat(e[0],", ").concat(e[1],", ").concat(e[2],")")}function LG(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]}function qG(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 MG=ej,zG=rj,NG=tj,UG=aj,HG=ij,GG=J4,WG=nj,VG=function(){let e=Z4();return function(r,t,i,a,n,o){let s,u;for(t||(t=3),i||(i=0),a?u=Math.min(a*t+i,r.length):u=r.length,s=i;s<u;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 Hv=[0,0,0],Qp,Ir=class extends Yp{static get ZERO(){return Qp||(Qp=new Ir(0,0,0),Object.freeze(Qp)),Qp}constructor(r=0,t=0,i=0){super(-0,-0,-0),arguments.length===1&&Eo(r)?this.copy(r):(Bt.debug&&(Aa(r),Aa(t),Aa(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 Bt.debug&&(Aa(r.x),Aa(r.y),Aa(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]=Aa(r)}angle(r){return Uv(this,r)}cross(r){return Dv(this,this,r),this.check()}rotateX({radians:r,origin:t=Hv}){return Mv(this,this,t,r),this.check()}rotateY({radians:r,origin:t=Hv}){return zv(this,this,t,r),this.check()}rotateZ({radians:r,origin:t=Hv}){return Nv(this,this,t,r),this.check()}transform(r){return this.transformAsPoint(r)}transformAsPoint(r){return Xc(this,this,r),this.check()}transformAsVector(r){return Xp(this,this,r),this.check()}transformByMatrix3(r){return Lv(this,this,r),this.check()}transformByMatrix2(r){return Q4(this,this,r),this.check()}transformByQuaternion(r){return qv(this,this,r),this.check()}};var Zp=class extends hu{toString(){let r="[";if(Bt.printRowMajor){r+="row-major:";for(let t=0;t<this.RANK;++t)for(let i=0;i<this.RANK;++i)r+=" ".concat(this[i*this.RANK+t])}else{r+="column-major:";for(let t=0;t<this.ELEMENTS;++t)r+=" ".concat(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]=Aa(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 $G(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 oj(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 sj(e,r){let t=r[0],i=r[1],a=r[2],n=r[3],o=r[4],s=r[5],u=r[6],l=r[7],f=r[8],h=r[9],d=r[10],m=r[11],y=r[12],k=r[13],x=r[14],A=r[15],P=t*s-i*o,T=t*u-a*o,B=t*l-n*o,C=i*u-a*s,I=i*l-n*s,F=a*l-n*u,H=f*k-h*y,N=f*x-d*y,K=f*A-m*y,V=h*x-d*k,X=h*A-m*k,U=d*A-m*x,$=P*U-T*X+B*V+C*K-I*N+F*H;return $?($=1/$,e[0]=(s*U-u*X+l*V)*$,e[1]=(a*X-i*U-n*V)*$,e[2]=(k*F-x*I+A*C)*$,e[3]=(d*I-h*F-m*C)*$,e[4]=(u*K-o*U-l*N)*$,e[5]=(t*U-a*K+n*N)*$,e[6]=(x*B-y*F-A*T)*$,e[7]=(f*F-d*B+m*T)*$,e[8]=(o*X-s*K+l*H)*$,e[9]=(i*K-t*X-n*H)*$,e[10]=(y*I-k*B+A*P)*$,e[11]=(h*B-f*I-m*P)*$,e[12]=(s*N-o*V-u*H)*$,e[13]=(t*V-i*N+a*H)*$,e[14]=(k*T-y*C-x*P)*$,e[15]=(f*C-h*T+d*P)*$,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],u=e[7],l=e[8],f=e[9],h=e[10],d=e[11],m=e[12],y=e[13],k=e[14],x=e[15],A=r*o-t*n,P=r*s-i*n,T=t*s-i*o,B=l*y-f*m,C=l*k-h*m,I=f*k-h*y,F=r*I-t*C+i*B,H=n*I-o*C+s*B,N=l*T-f*P+h*A,K=m*T-y*P+k*A;return u*F-a*H+x*N-d*K}function Gv(e,r,t){let i=r[0],a=r[1],n=r[2],o=r[3],s=r[4],u=r[5],l=r[6],f=r[7],h=r[8],d=r[9],m=r[10],y=r[11],k=r[12],x=r[13],A=r[14],P=r[15],T=t[0],B=t[1],C=t[2],I=t[3];return e[0]=T*i+B*s+C*h+I*k,e[1]=T*a+B*u+C*d+I*x,e[2]=T*n+B*l+C*m+I*A,e[3]=T*o+B*f+C*y+I*P,T=t[4],B=t[5],C=t[6],I=t[7],e[4]=T*i+B*s+C*h+I*k,e[5]=T*a+B*u+C*d+I*x,e[6]=T*n+B*l+C*m+I*A,e[7]=T*o+B*f+C*y+I*P,T=t[8],B=t[9],C=t[10],I=t[11],e[8]=T*i+B*s+C*h+I*k,e[9]=T*a+B*u+C*d+I*x,e[10]=T*n+B*l+C*m+I*A,e[11]=T*o+B*f+C*y+I*P,T=t[12],B=t[13],C=t[14],I=t[15],e[12]=T*i+B*s+C*h+I*k,e[13]=T*a+B*u+C*d+I*x,e[14]=T*n+B*l+C*m+I*A,e[15]=T*o+B*f+C*y+I*P,e}function cj(e,r,t){let i=t[0],a=t[1],n=t[2],o,s,u,l,f,h,d,m,y,k,x,A;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],u=r[2],l=r[3],f=r[4],h=r[5],d=r[6],m=r[7],y=r[8],k=r[9],x=r[10],A=r[11],e[0]=o,e[1]=s,e[2]=u,e[3]=l,e[4]=f,e[5]=h,e[6]=d,e[7]=m,e[8]=y,e[9]=k,e[10]=x,e[11]=A,e[12]=o*i+f*a+y*n+r[12],e[13]=s*i+h*a+k*n+r[13],e[14]=u*i+d*a+x*n+r[14],e[15]=l*i+m*a+A*n+r[15]),e}function lj(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 fj(e,r,t,i){let a=i[0],n=i[1],o=i[2],s=Math.sqrt(a*a+n*n+o*o),u,l,f,h,d,m,y,k,x,A,P,T,B,C,I,F,H,N,K,V,X,U,$,Z;return s<1e-6?null:(s=1/s,a*=s,n*=s,o*=s,l=Math.sin(t),u=Math.cos(t),f=1-u,h=r[0],d=r[1],m=r[2],y=r[3],k=r[4],x=r[5],A=r[6],P=r[7],T=r[8],B=r[9],C=r[10],I=r[11],F=a*a*f+u,H=n*a*f+o*l,N=o*a*f-n*l,K=a*n*f-o*l,V=n*n*f+u,X=o*n*f+a*l,U=a*o*f+n*l,$=n*o*f-a*l,Z=o*o*f+u,e[0]=h*F+k*H+T*N,e[1]=d*F+x*H+B*N,e[2]=m*F+A*H+C*N,e[3]=y*F+P*H+I*N,e[4]=h*K+k*V+T*X,e[5]=d*K+x*V+B*X,e[6]=m*K+A*V+C*X,e[7]=y*K+P*V+I*X,e[8]=h*U+k*$+T*Z,e[9]=d*U+x*$+B*Z,e[10]=m*U+A*$+C*Z,e[11]=y*U+P*$+I*Z,r!==e&&(e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e)}function pj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[4],o=r[5],s=r[6],u=r[7],l=r[8],f=r[9],h=r[10],d=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+l*i,e[5]=o*a+f*i,e[6]=s*a+h*i,e[7]=u*a+d*i,e[8]=l*a-n*i,e[9]=f*a-o*i,e[10]=h*a-s*i,e[11]=d*a-u*i,e}function dj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[0],o=r[1],s=r[2],u=r[3],l=r[8],f=r[9],h=r[10],d=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-l*i,e[1]=o*a-f*i,e[2]=s*a-h*i,e[3]=u*a-d*i,e[8]=n*i+l*a,e[9]=o*i+f*a,e[10]=s*i+h*a,e[11]=u*i+d*a,e}function hj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[0],o=r[1],s=r[2],u=r[3],l=r[4],f=r[5],h=r[6],d=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+l*i,e[1]=o*a+f*i,e[2]=s*a+h*i,e[3]=u*a+d*i,e[4]=l*a-n*i,e[5]=f*a-o*i,e[6]=h*a-s*i,e[7]=d*a-u*i,e}function mj(e,r){let t=r[0],i=r[1],a=r[2],n=r[3],o=t+t,s=i+i,u=a+a,l=t*o,f=i*o,h=i*s,d=a*o,m=a*s,y=a*u,k=n*o,x=n*s,A=n*u;return e[0]=1-h-y,e[1]=f+A,e[2]=d-x,e[3]=0,e[4]=f-A,e[5]=1-l-y,e[6]=m+k,e[7]=0,e[8]=d+x,e[9]=m-k,e[10]=1-l-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function gj(e,r,t,i,a,n,o){let s=1/(t-r),u=1/(a-i),l=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*u,e[6]=0,e[7]=0,e[8]=(t+r)*s,e[9]=(a+i)*u,e[10]=(o+n)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*n*2*l,e[15]=0,e}function KG(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 vj=KG;function YG(e,r,t,i,a,n,o){let s=1/(r-t),u=1/(i-a),l=1/(n-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(r+t)*s,e[13]=(a+i)*u,e[14]=(o+n)*l,e[15]=1,e}var bj=YG;function yj(e,r,t,i){let a,n,o,s,u,l,f,h,d,m,y=r[0],k=r[1],x=r[2],A=i[0],P=i[1],T=i[2],B=t[0],C=t[1],I=t[2];return Math.abs(y-B)<1e-6&&Math.abs(k-C)<1e-6&&Math.abs(x-I)<1e-6?$G(e):(h=y-B,d=k-C,m=x-I,a=1/Math.sqrt(h*h+d*d+m*m),h*=a,d*=a,m*=a,n=P*m-T*d,o=T*h-A*m,s=A*d-P*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),u=d*s-m*o,l=m*n-h*s,f=h*o-d*n,a=Math.sqrt(u*u+l*l+f*f),a?(a=1/a,u*=a,l*=a,f*=a):(u=0,l=0,f=0),e[0]=n,e[1]=u,e[2]=h,e[3]=0,e[4]=o,e[5]=l,e[6]=d,e[7]=0,e[8]=s,e[9]=f,e[10]=m,e[11]=0,e[12]=-(n*y+o*k+s*x),e[13]=-(u*y+l*k+f*x),e[14]=-(h*y+d*k+m*x),e[15]=1,e)}function XG(){let e=new Hi(4);return Hi!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function xj(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 Wie=function(){let e=XG();return function(r,t,i,a,n,o){let s,u;for(t||(t=4),i||(i=0),a?u=Math.min(a*t+i,r.length):u=r.length,s=i;s<u;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 $v;(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"})($v||($v={}));var QG=45*Math.PI/180,ZG=1,Wv=.1,Vv=500,JG=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),vi=class extends Zp{static get IDENTITY(){return rW()}static get ZERO(){return eW()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return $v}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,u,l,f,h,d,m,y,k,x){return this[0]=r,this[1]=t,this[2]=i,this[3]=a,this[4]=n,this[5]=o,this[6]=s,this[7]=u,this[8]=l,this[9]=f,this[10]=h,this[11]=d,this[12]=m,this[13]=y,this[14]=k,this[15]=x,this.check()}setRowMajor(r,t,i,a,n,o,s,u,l,f,h,d,m,y,k,x){return this[0]=r,this[1]=n,this[2]=l,this[3]=m,this[4]=t,this[5]=o,this[6]=f,this[7]=y,this[8]=i,this[9]=s,this[10]=h,this[11]=k,this[12]=a,this[13]=u,this[14]=d,this[15]=x,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(JG)}fromObject(r){return this.check()}fromQuaternion(r){return mj(this,r),this.check()}frustum(r){let{left:t,right:i,bottom:a,top:n,near:o=Wv,far:s=Vv}=r;return s===1/0?tW(this,t,i,a,n,o):gj(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 yj(this,t,i,a),this.check()}ortho(r){let{left:t,right:i,bottom:a,top:n,near:o=Wv,far:s=Vv}=r;return bj(this,t,i,a,n,o,s),this.check()}orthographic(r){let{fovy:t=QG,aspect:i=ZG,focalDistance:a=1,near:n=Wv,far:o=Vv}=r;wj(t);let s=t/2,u=a*Math.tan(s),l=u*i;return this.ortho({left:-l,right:l,bottom:-u,top:u,near:n,far:o})}perspective(r){let{fovy:t=45*Math.PI/180,aspect:i=1,near:a=.1,far:n=500}=r;return wj(t),vj(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 oj(this,this),this.check()}invert(){return sj(this,this),this.check()}multiplyLeft(r){return Gv(this,r,this),this.check()}multiplyRight(r){return Gv(this,this,r),this.check()}rotateX(r){return pj(this,this,r),this.check()}rotateY(r){return dj(this,this,r),this.check()}rotateZ(r){return hj(this,this,r),this.check()}rotateXYZ(r){return this.rotateX(r[0]).rotateY(r[1]).rotateZ(r[2])}rotateAxis(r,t){return fj(this,this,r,t),this.check()}scale(r){return lj(this,this,Array.isArray(r)?r:[r,r,r]),this.check()}translate(r){return cj(this,this,r),this.check()}transform(r,t){return r.length===4?(t=xj(t||[-0,-0,-0,-0],r,this),Kp(t,4),t):this.transformAsPoint(r,t)}transformAsPoint(r,t){let{length:i}=r,a;switch(i){case 2:a=Y4(t||[-0,-0],r,this);break;case 3:a=Xc(t||[-0,-0,-0],r,this);break;default:throw new Error("Illegal vector")}return Kp(a,r.length),a}transformAsVector(r,t){let i;switch(r.length){case 2:i=X4(t||[-0,-0],r,this);break;case 3:i=Xp(t||[-0,-0,-0],r,this);break;default:throw new Error("Illegal vector")}return Kp(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])}},Jp,ed;function eW(){return Jp||(Jp=new vi([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Jp)),Jp}function rW(){return ed||(ed=new vi,Object.freeze(ed)),ed}function wj(e){if(e>Math.PI*2)throw Error("expected radians")}function tW(e,r,t,i,a,n){let o=2*n/(t-r),s=2*n/(a-i),u=(t+r)/(t-r),l=(a+i)/(a-i),f=-1,h=-1,d=-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]=u,e[9]=l,e[10]=f,e[11]=h,e[12]=0,e[13]=0,e[14]=d,e[15]=0,e}var us={};Au(us,{EPSILON1:()=>aW,EPSILON10:()=>pW,EPSILON11:()=>dW,EPSILON12:()=>hW,EPSILON13:()=>mW,EPSILON14:()=>gW,EPSILON15:()=>vW,EPSILON16:()=>bW,EPSILON17:()=>yW,EPSILON18:()=>xW,EPSILON19:()=>wW,EPSILON2:()=>iW,EPSILON20:()=>_W,EPSILON3:()=>nW,EPSILON4:()=>oW,EPSILON5:()=>sW,EPSILON6:()=>uW,EPSILON7:()=>cW,EPSILON8:()=>lW,EPSILON9:()=>fW,PI_OVER_FOUR:()=>SW,PI_OVER_SIX:()=>EW,PI_OVER_TWO:()=>kW,TWO_PI:()=>jW});var aW=.1,iW=.01,nW=.001,oW=1e-4,sW=1e-5,uW=1e-6,cW=1e-7,lW=1e-8,fW=1e-9,pW=1e-10,dW=1e-11,hW=1e-12,mW=1e-13,gW=1e-14,vW=1e-15,bW=1e-16,yW=1e-17,xW=1e-18,wW=1e-19,_W=1e-20,kW=Math.PI/2,SW=Math.PI/4,EW=Math.PI/6,jW=Math.PI*2;var Hn=6356752314245179e-9,AW={radii:[6378137,6378137,Hn],radiiSquared:[6378137*6378137,6378137*6378137,Hn*Hn],oneOverRadii:[1/6378137,1/6378137,1/Hn],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Hn*Hn)],maximumRadius:Math.max(6378137,6378137,Hn),centerToleranceSquared:.1};function rd(e){return e}var wne=new Ir;function TW(e,r=[],t=rd){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 _j(e,r=[]){return TW(e,r,Bt._cartographicRadians?rd:Ov)}function PW(e,r,t=rd){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 kj(e,r){return PW(e,r,Bt._cartographicRadians?rd:Iv)}var Sj=1e-14,RW=new Ir,Ej={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"}},Kv={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Zc={east:new Ir,north:new Ir,up:new Ir,west:new Ir,south:new Ir,down:new Ir},CW=new Ir,OW=new Ir,IW=new Ir;function Yv(e,r,t,i,a,n){let o=Ej[r]&&Ej[r][t];gi(o&&(!i||i===o));let s,u,l,f=RW.copy(a);if(Nn(f.x,0,Sj)&&Nn(f.y,0,Sj)){let d=Math.sign(f.z);s=CW.fromArray(Kv[r]),r!=="east"&&r!=="west"&&s.scale(d),u=OW.fromArray(Kv[t]),t!=="east"&&t!=="west"&&u.scale(d),l=IW.fromArray(Kv[i]),i!=="east"&&i!=="west"&&l.scale(d)}else{let{up:d,east:m,north:y}=Zc;m.set(-f.y,f.x,0).normalize(),e.geodeticSurfaceNormal(f,d),y.copy(d).cross(m);let{down:k,west:x,south:A}=Zc;k.copy(d).scale(-1),x.copy(m).scale(-1),A.copy(y).scale(-1),s=Zc[r],u=Zc[t],l=Zc[i]}return n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=u.x,n[5]=u.y,n[6]=u.z,n[7]=0,n[8]=l.x,n[9]=l.y,n[10]=l.z,n[11]=0,n[12]=f.x,n[13]=f.y,n[14]=f.z,n[15]=1,n}var gu=new Ir,BW=new Ir,FW=new Ir;function jj(e,r,t=[]){let{oneOverRadii:i,oneOverRadiiSquared:a,centerToleranceSquared:n}=r;gu.from(e);let o=gu.x,s=gu.y,u=gu.z,l=i.x,f=i.y,h=i.z,d=o*o*l*l,m=s*s*f*f,y=u*u*h*h,k=d+m+y,x=Math.sqrt(1/k);if(!Number.isFinite(x))return;let A=BW;if(A.copy(e).scale(x),k<n)return A.to(t);let P=a.x,T=a.y,B=a.z,C=FW;C.set(A.x*P*2,A.y*T*2,A.z*B*2);let I=(1-x)*gu.len()/(.5*C.len()),F=0,H,N,K,V;do{I-=F,H=1/(1+I*P),N=1/(1+I*T),K=1/(1+I*B);let X=H*H,U=N*N,$=K*K,Z=X*H,le=U*N,ve=$*K;V=d*X+m*U+y*$-1;let we=-2*(d*Z*P+m*le*T+y*ve*B);F=V/we}while(Math.abs(V)>us.EPSILON12);return gu.scale([H,N,K]).to(t)}var td=new Ir,Aj=new Ir,qW=new Ir,Gi=new Ir,MW=new Ir,ad=new Ir,Gn=class{constructor(r=0,t=0,i=0){ht(this,"radii",void 0),ht(this,"radiiSquared",void 0),ht(this,"radiiToTheFourth",void 0),ht(this,"oneOverRadii",void 0),ht(this,"oneOverRadiiSquared",void 0),ht(this,"minimumRadius",void 0),ht(this,"maximumRadius",void 0),ht(this,"centerToleranceSquared",us.EPSILON1),ht(this,"squaredXOverSquaredZ",void 0),gi(r>=0),gi(t>=0),gi(i>=0),this.radii=new Ir(r,t,i),this.radiiSquared=new Ir(r*r,t*t,i*i),this.radiiToTheFourth=new Ir(r*r*r*r,t*t*t*t,i*i*i*i),this.oneOverRadii=new Ir(r===0?0:1/r,t===0?0:1/t,i===0?0:1/i),this.oneOverRadiiSquared=new Ir(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=Aj,a=qW,[,,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]){ad.from(r);let i=this.scaleToGeodeticSurface(ad,Gi);if(!i)return;let a=this.geodeticSurfaceNormal(i,Aj),n=MW;n.copy(ad).subtract(i);let o=Math.atan2(a.y,a.x),s=Math.asin(a.z),u=Math.sign(Qc.dot(n,ad))*Qc.length(n);return kj([o,s,u],t)}eastNorthUpToFixedFrame(r,t=new vi){return Yv(this,"east","north","up",r,t)}localFrameToFixedFrame(r,t,i,a,n=new vi){return Yv(this,r,t,i,a,n)}geocentricSurfaceNormal(r,t=[0,0,0]){return td.from(r).normalize().to(t)}geodeticSurfaceNormalCartographic(r,t=[0,0,0]){let i=_j(r),a=i[0],n=i[1],o=Math.cos(n);return td.set(o*Math.cos(a),o*Math.sin(a),Math.sin(n)).normalize(),td.to(t)}geodeticSurfaceNormal(r,t=[0,0,0]){return td.from(r).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(r,t){return jj(r,this,t)}scaleToGeocentricSurface(r,t=[0,0,0]){Gi.from(r);let i=Gi.x,a=Gi.y,n=Gi.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(i*i*o.x+a*a*o.y+n*n*o.z);return Gi.multiplyScalar(s).to(t)}transformPositionToScaledSpace(r,t=[0,0,0]){return Gi.from(r).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(r,t=[0,0,0]){return Gi.from(r).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(r,t=0,i=[0,0,0]){gi(Nn(this.radii.x,this.radii.y,us.EPSILON15)),gi(this.radii.z>0),Gi.from(r);let a=Gi.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(a)>=this.radii.z-t))return Gi.set(0,0,a).to(i)}};ht(Gn,"WGS84",new Gn(6378137,6378137,Hn));var Tj="4.0.2";var Pj,zW=(Pj=globalThis.loaders)==null?void 0:Pj.parseImageNode,Xv=typeof Image<"u",Qv=typeof ImageBitmap<"u",NW=Boolean(zW),Zv=Qo?!0:NW;function Rj(e){switch(e){case"auto":return Qv||Xv||Zv;case"imagebitmap":return Qv;case"image":return Xv;case"data":return Zv;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function Cj(){if(Qv)return"imagebitmap";if(Xv)return"image";if(Zv)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function UW(e){let r=HW(e);if(!r)throw new Error("Not an image");return r}function Oj(e){switch(UW(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 HW(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 GW=/^data:image\/svg\+xml/,WW=/\.svg((\?|#).*)?$/;function id(e){return e&&(GW.test(e)||WW.test(e))}function Ij(e,r){if(id(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 Jv(e,r)}function Jv(e,r){if(id(r))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function nd(e,r,t){let i=Ij(e,t),a=self.URL||self.webkitURL,n=typeof i!="string"&&a.createObjectURL(i);try{return await VW(n||i,r)}finally{n&&a.revokeObjectURL(n)}}async function VW(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=>a(new Error(`Could not load image ${e}: ${n}`))}catch(n){a(n)}})}var $W={},Bj=!0;async function Fj(e,r,t){let i;id(t)?i=await nd(e,r,t):i=Jv(e,t);let a=r&&r.imagebitmap;return await KW(i,a)}async function KW(e,r=null){if((YW(r)||!Bj)&&(r=null),r)try{return await createImageBitmap(e,r)}catch(t){console.warn(t),Bj=!1}return await createImageBitmap(e)}function YW(e){for(let r in e||$W)return!1;return!0}function Dj(e){return!JW(e,"ftyp",4)||!(e[8]&96)?null:XW(e)}function XW(e){switch(QW(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function QW(e,r,t){return String.fromCharCode(...e.slice(r,t))}function ZW(e){return[...e].map(r=>r.charCodeAt(0))}function JW(e,r,t=0){let i=ZW(r);for(let a=0;a<i.length;++a)if(i[a]!==e[a+t])return!1;return!0}var bn=!1,Jc=!0;function od(e){let r=el(e);return rV(r)||iV(r)||tV(r)||aV(r)||eV(r)}function eV(e){let r=new Uint8Array(e instanceof DataView?e.buffer:e),t=Dj(r);return t?{mimeType:t.mimeType,width:0,height:0}:null}function rV(e){let r=el(e);return r.byteLength>=24&&r.getUint32(0,bn)===2303741511?{mimeType:"image/png",width:r.getUint32(16,bn),height:r.getUint32(20,bn)}:null}function tV(e){let r=el(e);return r.byteLength>=10&&r.getUint32(0,bn)===1195984440?{mimeType:"image/gif",width:r.getUint16(6,Jc),height:r.getUint16(8,Jc)}:null}function aV(e){let r=el(e);return r.byteLength>=14&&r.getUint16(0,bn)===16973&&r.getUint32(2,Jc)===r.byteLength?{mimeType:"image/bmp",width:r.getUint32(18,Jc),height:r.getUint32(22,Jc)}:null}function iV(e){let r=el(e);if(!(r.byteLength>=3&&r.getUint16(0,bn)===65496&&r.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:a}=nV(),n=2;for(;n+9<r.byteLength;){let o=r.getUint16(n,bn);if(a.has(o))return{mimeType:"image/jpeg",height:r.getUint16(n+5,bn),width:r.getUint16(n+7,bn)};if(!i.has(o))return null;n+=2,n+=r.getUint16(n,bn)}return null}function nV(){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 el(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 Lj(e,r){var a;let{mimeType:t}=od(e)||{},i=(a=globalThis.loaders)==null?void 0:a.parseImageNode;return zi(i),await i(e,t)}async function qj(e,r,t){r=r||{};let a=(r.image||{}).type||"auto",{url:n}=t||{},o=oV(a),s;switch(o){case"imagebitmap":s=await Fj(e,r,n);break;case"image":s=await nd(e,r,n);break;case"data":s=await Lj(e,r);break;default:zi(!1)}return a==="data"&&(s=Oj(s)),s}function oV(e){switch(e){case"auto":case"data":return Cj();default:return Rj(e),e}}var sV=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],uV=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],cV={image:{type:"auto",decode:!0}},sd={id:"image",module:"images",name:"Images",version:Tj,mimeTypes:uV,extensions:sV,parse:qj,tests:[e=>Boolean(od(new DataView(e)))],options:cV};var Mj="4.0.2";var lV={draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},zj={name:"Draco",id:"draco",module:"draco",version:Mj,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:lV};function Nj(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 e1(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:[],u=s&&s.length;for(let l=0;l<u;l+=3){let f=s[l],h=s[l+1],d=s[l+2];r=f<r?f:r,t=h<t?h:t,i=d<i?d:i,a=f>a?f:a,n=h>n?h:n,o=d>o?d:o}return[[r,t,i],[a,n,o]]}function r1(e,r,t){let i=Nj(r.value),a=t||Uj(r);return{name:e,type:{type:"fixed-size-list",listSize:r.size,children:[{name:"value",type:i}]},nullable:!1,metadata:a}}function Uj(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}function Gj(e,r,t){let i=Wj(r.metadata),a=[],n=fV(r.attributes);for(let o in e){let s=e[o],u=Hj(o,s,n[o]);a.push(u)}if(t){let o=Hj("indices",t);a.push(o)}return{fields:a,metadata:i}}function fV(e){let r={};for(let t in e){let i=e[t];r[i.name||"undefined"]=i}return r}function Hj(e,r,t){let i=t?Wj(t.metadata):void 0;return r1(e,r,i)}function Wj(e){Object.entries(e);let r={};for(let t in e)r[`${t}.string`]=JSON.stringify(e[t]);return r}var Vj={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},pV={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},dV=4,rl=class{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 d=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(d)}let s=this._getDracoLoaderData(n,a,t),u=this._getMeshData(n,s,t),l=e1(u.attributes),f=Gj(u.attributes,s,u.indices);return{loader:"draco",loaderData:s,header:{vertexCount:n.num_points(),boundingBox:l},...u,schema:f}}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 u=this._getOctahedronTransform(n,t);u&&(i[n.unique_id()].octahedron_transform=u)}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{value:s,size:u}=this._getAttributeValues(t,n);a[o]={value:s,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*dV,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),gV(t)}finally{this.draco.destroy(t)}}_getAttributeValues(r,t){let i=pV[t.data_type],a=t.num_components,o=r.num_points()*a,s=o*i.BYTES_PER_ELEMENT,u=hV(this.draco,i),l,f=this.draco._malloc(s);try{let h=this.decoder.GetAttribute(r,t.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(r,h,u,s,f),l=new i(this.draco.HEAPF32.buffer,f,o).slice()}finally{this.draco._free(f)}return{value:l,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 Vj)if(this.draco[o]===a)return Vj[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=mV(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 hV(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 mV(e){let r=e.size(),t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=e.GetValue(i);return t}function gV(e){let r=e.size(),t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=e.GetValue(i);return t}var vV="1.5.6",bV="1.4.1",t1=`https://www.gstatic.com/draco/versioned/decoders/${vV}`,Ha={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},a1={[Ha.DECODER]:`${t1}/${Ha.DECODER}`,[Ha.DECODER_WASM]:`${t1}/${Ha.DECODER_WASM}`,[Ha.FALLBACK_DECODER]:`${t1}/${Ha.FALLBACK_DECODER}`,[Ha.ENCODER]:`https://raw.githubusercontent.com/google/draco/${bV}/javascript/${Ha.ENCODER}`},tl;async function $j(e){let r=e.modules||{};return r.draco3d?tl=tl||r.draco3d.createDecoderModule({}).then(t=>({draco:t})):tl=tl||yV(e),await tl}async function yV(e){let r,t;switch(e.draco&&e.draco.decoderType){case"js":r=await gn(a1[Ha.FALLBACK_DECODER],"draco",e,Ha.FALLBACK_DECODER);break;case"wasm":default:[r,t]=await Promise.all([await gn(a1[Ha.DECODER],"draco",e,Ha.DECODER),await gn(a1[Ha.DECODER_WASM],"draco",e,Ha.DECODER_WASM)])}return r=r||globalThis.DracoDecoderModule,await xV(r,t)}function xV(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e({...t,onModuleLoaded:a=>i({draco:a})})})}var Kj={...zj,parse:wV};async function wV(e,r){let{draco:t}=await $j(r),i=new rl(t);try{return i.parseSync(e,r==null?void 0:r.draco)}finally{i.destroy()}}var ud="4.0.2";var cd={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},i1;async function o1(e){let r=e.modules||{};return r.basis?r.basis:(i1=i1||_V(e),await i1)}async function _V(e){let r=null,t=null;return[r,t]=await Promise.all([await gn(cd.TRANSCODER,"textures",e),await gn(cd.TRANSCODER_WASM,"textures",e)]),r=r||globalThis.BASIS,await kV(r,t)}function kV(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 n1;async function s1(e){let r=e.modules||{};return r.basisEncoder?r.basisEncoder:(n1=n1||SV(e),await n1)}async function SV(e){let r=null,t=null;return[r,t]=await Promise.all([await gn(cd.ENCODER,"textures",e),await gn(cd.ENCODER_WASM,"textures",e)]),r=r||globalThis.BASIS,await EV(r,t)}function EV(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e(t).then(a=>{let{BasisFile:n,KTX2File:o,initializeBasis:s,BasisEncoder:u}=a;s(),i({BasisFile:n,KTX2File:o,BasisEncoder:u})})})}var ce={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 jV=["","WEBKIT_","MOZ_"],Yj={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"},ld=null;function Xj(e){if(!ld){e=e||AV()||void 0,ld=new Set;for(let r of jV)for(let t in Yj)if(e&&e.getExtension(`${r}${t}`)){let i=Yj[t];ld.add(i)}}return ld}function AV(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var uA=Pt(oA(),1);function vu(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=RV(r,i,a,e,o),u=PV(e,o,n,s);t[o]={compressed:!0,format:r.internalFormat,data:u,width:i,height:a,levelSize:s},i=Math.max(1,i>>1),a=Math.max(1,a>>1),n+=s}return t}function PV(e,r,t,i){return Array.isArray(e)?e[r].levelData:new Uint8Array(e.buffer,e.byteOffset+t,i)}function RV(e,r,t,i,a){return Array.isArray(i)?e.sizeFunction(i[a]):e.sizeFunction(r,t)}var CV={131:ce.COMPRESSED_RGB_S3TC_DXT1_EXT,132:ce.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:ce.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:ce.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:ce.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:ce.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:ce.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:ce.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:ce.COMPRESSED_RED_RGTC1_EXT,140:ce.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:ce.COMPRESSED_RED_GREEN_RGTC2_EXT,142:ce.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:ce.COMPRESSED_RGB8_ETC2,148:ce.COMPRESSED_SRGB8_ETC2,149:ce.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:ce.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:ce.COMPRESSED_RGBA8_ETC2_EAC,152:ce.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:ce.COMPRESSED_R11_EAC,154:ce.COMPRESSED_SIGNED_R11_EAC,155:ce.COMPRESSED_RG11_EAC,156:ce.COMPRESSED_SIGNED_RG11_EAC,157:ce.COMPRESSED_RGBA_ASTC_4x4_KHR,158:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:ce.COMPRESSED_RGBA_ASTC_5x4_KHR,160:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:ce.COMPRESSED_RGBA_ASTC_5x5_KHR,162:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:ce.COMPRESSED_RGBA_ASTC_6x5_KHR,164:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:ce.COMPRESSED_RGBA_ASTC_6x6_KHR,166:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:ce.COMPRESSED_RGBA_ASTC_8x5_KHR,168:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:ce.COMPRESSED_RGBA_ASTC_8x6_KHR,170:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:ce.COMPRESSED_RGBA_ASTC_8x8_KHR,172:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:ce.COMPRESSED_RGBA_ASTC_10x5_KHR,174:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:ce.COMPRESSED_RGBA_ASTC_10x6_KHR,176:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:ce.COMPRESSED_RGBA_ASTC_10x8_KHR,178:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:ce.COMPRESSED_RGBA_ASTC_10x10_KHR,180:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:ce.COMPRESSED_RGBA_ASTC_12x10_KHR,182:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:ce.COMPRESSED_RGBA_ASTC_12x12_KHR,184:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:ce.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:ce.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:ce.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:ce.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:ce.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:ce.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:ce.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:ce.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:ce.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:ce.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:ce.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:ce.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:ce.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:ce.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:ce.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:ce.COMPRESSED_RGBA_ASTC_12x12_KHR};function sA(e){return CV[e]}var Ja=[171,75,84,88,32,50,48,187,13,10,26,10];function md(e){let r=new Uint8Array(e);return!(r.byteLength<Ja.length||r[0]!==Ja[0]||r[1]!==Ja[1]||r[2]!==Ja[2]||r[3]!==Ja[3]||r[4]!==Ja[4]||r[5]!==Ja[5]||r[6]!==Ja[6]||r[7]!==Ja[7]||r[8]!==Ja[8]||r[9]!==Ja[9]||r[10]!==Ja[10]||r[11]!==Ja[11])}function cA(e){let r=new Uint8Array(e),t=(0,uA.read)(r),i=Math.max(1,t.levels.length),a=t.pixelWidth,n=t.pixelHeight,o=sA(t.vkFormat);return vu(t.levels,{mipMapLevels:i,width:a,height:n,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var OV={etc1:{basisFormat:0,compressed:!0,format:ce.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:ce.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:ce.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:ce.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:ce.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:ce.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 il(e,r){if(r.basis.containerFormat==="auto"){if(md(e)){let i=await s1(r);return lA(i.KTX2File,e,r)}let{BasisFile:t}=await o1(r);return p1(t,e,r)}switch(r.basis.module){case"encoder":let t=await s1(r);switch(r.basis.containerFormat){case"ktx2":return lA(t.KTX2File,e,r);case"basis":default:return p1(t.BasisFile,e,r)}case"transcoder":default:let{BasisFile:i}=await o1(r);return p1(i,e,r)}}function p1(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),u=[];for(let l=0;l<s;l++)u.push(IV(i,o,l,t));n.push(u)}return n}finally{i.close(),i.delete()}}function IV(e,r,t,i){let a=e.getImageWidth(r,t),n=e.getImageHeight(r,t),o=e.getHasAlpha(),{compressed:s,format:u,basisFormat:l}=fA(i,o),f=e.getImageTranscodedSizeInBytes(r,t,l),h=new Uint8Array(f);if(!e.transcodeImage(h,r,t,l,0,0))throw new Error("failed to start Basis transcoding");return{width:a,height:n,data:h,compressed:s,format:u,hasAlpha:o}}function lA(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(BV(i,o,t));break}return[n]}finally{i.close(),i.delete()}}function BV(e,r,t){let{alphaFlag:i,height:a,width:n}=e.getImageLevelInfo(r,0,0),{compressed:o,format:s,basisFormat:u}=fA(t,i),l=e.getImageTranscodedSizeInBytes(r,0,0,u),f=new Uint8Array(l);if(!e.transcodeImage(f,r,0,0,u,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:n,height:a,data:f,compressed:o,levelSize:l,hasAlpha:i,format:s}}function fA(e,r){let t=e&&e.basis&&e.basis.format;return t==="auto"&&(t=FV()),typeof t=="object"&&(t=r?t.alpha:t.noAlpha),t=t.toLowerCase(),OV[t]}function FV(){let e=Xj();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 pA={name:"Basis",id:"basis",module:"textures",version:ud,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"}}},nl={...pA,parse:il};var ei={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},DV={DXT1:ce.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:ce.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:ce.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":ce.COMPRESSED_RGB_ATC_WEBGL,ATCA:ce.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:ce.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},LV=mA,qV=gd,MV=gd,zV={DXT1:mA,DXT3:gd,DXT5:gd,"ATC ":LV,ATCA:qV,ATCI:MV};function dA(e){return new Uint32Array(e,0,ei.HEADER_LENGTH)[ei.MAGIC_NUMBER_INDEX]===ei.MAGIC_NUMBER}function hA(e){let r=new Int32Array(e,0,ei.HEADER_LENGTH),t=r[ei.HEADER_PF_FOURCC_INDEX];zi(Boolean(r[ei.HEADER_PF_FLAGS_INDEX]&ei.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let i=NV(t),a=DV[i],n=zV[i];zi(a&&n,`DDS: Unknown pixel format ${t}`);let o=1;r[ei.HEADER_FLAGS_INDEX]&ei.DDSD_MIPMAPCOUNT&&(o=Math.max(1,r[ei.MIPMAPCOUNT_INDEX]));let s=r[ei.HEADER_WIDTH_INDEX],u=r[ei.HEADER_HEIGHT_INDEX],l=r[ei.HEADER_SIZE_INDEX]+4,f=new Uint8Array(e,l);return vu(f,{mipMapLevels:o,width:s,height:u,sizeFunction:n,internalFormat:a})}function mA(e,r){return(e+3>>2)*(r+3>>2)*8}function gd(e,r){return(e+3>>2)*(r+3>>2)*16}function NV(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var bi={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},UV={0:[ce.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[ce.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[ce.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[ce.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[ce.COMPRESSED_RGB_ETC1_WEBGL],7:[ce.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[ce.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[ce.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[ce.COMPRESSED_RGB8_ETC2],23:[ce.COMPRESSED_RGBA8_ETC2_EAC],24:[ce.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[ce.COMPRESSED_R11_EAC],26:[ce.COMPRESSED_RG11_EAC],27:[ce.COMPRESSED_RGBA_ASTC_4X4_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[ce.COMPRESSED_RGBA_ASTC_5X4_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[ce.COMPRESSED_RGBA_ASTC_5X5_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[ce.COMPRESSED_RGBA_ASTC_6X5_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[ce.COMPRESSED_RGBA_ASTC_6X6_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[ce.COMPRESSED_RGBA_ASTC_8X5_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[ce.COMPRESSED_RGBA_ASTC_8X6_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[ce.COMPRESSED_RGBA_ASTC_8X8_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[ce.COMPRESSED_RGBA_ASTC_10X5_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[ce.COMPRESSED_RGBA_ASTC_10X6_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[ce.COMPRESSED_RGBA_ASTC_10X8_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[ce.COMPRESSED_RGBA_ASTC_10X10_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[ce.COMPRESSED_RGBA_ASTC_12X10_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[ce.COMPRESSED_RGBA_ASTC_12X12_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},HV={0:gA,1:gA,2:vA,3:vA,6:ol,7:ol,9:sl,11:sl,22:ol,23:sl,24:ol,25:ol,26:sl,27:sl,28:GV,29:WV,30:VV,31:$V,32:KV,33:YV,34:XV,35:QV,36:ZV,37:JV,38:e$,39:r$,40:t$};function bA(e){let t=new Uint32Array(e,0,bi.HEADER_LENGTH)[bi.MAGIC_NUMBER_INDEX];return t===bi.MAGIC_NUMBER||t===bi.MAGIC_NUMBER_EXTRA}function yA(e){let r=new Uint32Array(e,0,bi.HEADER_LENGTH),t=r[bi.PIXEL_FORMAT_INDEX],i=r[bi.COLOUR_SPACE_INDEX],a=UV[t]||[],n=a.length>1&&i?a[1]:a[0],o=HV[t],s=r[bi.MIPMAPCOUNT_INDEX],u=r[bi.WIDTH_INDEX],l=r[bi.HEIGHT_INDEX],f=bi.HEADER_SIZE+r[bi.METADATA_SIZE_INDEX],h=new Uint8Array(e,f);return vu(h,{mipMapLevels:s,width:u,height:l,sizeFunction:o,internalFormat:n})}function gA(e,r){return e=Math.max(e,16),r=Math.max(r,8),e*r/4}function vA(e,r){return e=Math.max(e,8),r=Math.max(r,8),e*r/2}function ol(e,r){return Math.floor((e+3)/4)*Math.floor((r+3)/4)*8}function sl(e,r){return Math.floor((e+3)/4)*Math.floor((r+3)/4)*16}function GV(e,r){return Math.floor((e+4)/5)*Math.floor((r+3)/4)*16}function WV(e,r){return Math.floor((e+4)/5)*Math.floor((r+4)/5)*16}function VV(e,r){return Math.floor((e+5)/6)*Math.floor((r+4)/5)*16}function $V(e,r){return Math.floor((e+5)/6)*Math.floor((r+5)/6)*16}function KV(e,r){return Math.floor((e+7)/8)*Math.floor((r+4)/5)*16}function YV(e,r){return Math.floor((e+7)/8)*Math.floor((r+5)/6)*16}function XV(e,r){return Math.floor((e+7)/8)*Math.floor((r+7)/8)*16}function QV(e,r){return Math.floor((e+9)/10)*Math.floor((r+4)/5)*16}function ZV(e,r){return Math.floor((e+9)/10)*Math.floor((r+5)/6)*16}function JV(e,r){return Math.floor((e+9)/10)*Math.floor((r+7)/8)*16}function e$(e,r){return Math.floor((e+9)/10)*Math.floor((r+9)/10)*16}function r$(e,r){return Math.floor((e+11)/12)*Math.floor((r+9)/10)*16}function t$(e,r){return Math.floor((e+11)/12)*Math.floor((r+11)/12)*16}function xA(e){if(md(e))return cA(e);if(dA(e))return hA(e);if(bA(e))return yA(e);throw new Error("Texture container format not recognized")}var wA={name:"Texture Containers",id:"compressed-texture",module:"textures",version:ud,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}}},vd={...wA,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 il(e,r))[0]):xA(e)}};function _A(e,r=null){return r?`${e}?token=${r}`:e}var a$={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},i$={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},cs={...a$,...i$};function d1(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 kA={UInt8:cs.UNSIGNED_BYTE,UInt16:cs.UNSIGNED_SHORT,Float32:cs.FLOAT,UInt32:cs.UNSIGNED_INT,UInt64:cs.DOUBLE};function bu(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 bd=new Ir([0,0,0]);function n$(e){switch(e){case"ktx-etc2":case"dds":return vd;case"ktx2":return nl;case"jpg":case"png":default:return sd}}var o$="i3s-attribute-type";async function AA(e,r,t,i,a){var o;let n={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new vi,coordinateSystem:0,byteLength:0,texture:null};if(r.textureUrl){let s=_A(r.textureUrl,(o=i==null?void 0:i.i3s)==null?void 0:o.token),u=n$(r.textureFormat),h=await(await((a==null?void 0:a.fetch)||fetch)(s)).arrayBuffer();if(i!=null&&i.i3s.decodeTextures){if(u===sd){let d={...r.textureLoaderOptions,image:{type:"data"}};try{let m=await Hg(h,[],d,a);n.texture=m}catch{let y=await zn(h,u,d,a);n.texture=y}}else if(u===vd||u===nl){let d=await Rv(h,u,r.textureLoaderOptions);u===nl&&(d=d[0]),n.texture={compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d}}}else n.texture=h}return n.material=m$(r.materialDefinition,n.texture),n.material&&(n.texture=null),await s$(e,n,r,t,i)}async function s$(e,r,t,i,a){var h,d;let n=e.byteLength,o,s,u=0,l=0,f;if(t.isDracoGeometry){let m=await zn(e,Kj,{draco:{attributeNameEntry:o$}});s=m.header.vertexCount,f=(h=m.indices)==null?void 0:h.value;let{POSITION:y,NORMAL:k,COLOR_0:x,TEXCOORD_0:A,["feature-index"]:P,["uv-region"]:T}=m.attributes;o={position:y,normal:k,color:x,uv0:A,uvRegion:T,id:P},u$(o,m);let B=y$(P);B&&b$(o,B)}else{let{vertexAttributes:m,ordering:y,featureAttributes:k,featureAttributeOrder:x}=i.store.defaultGeometrySchema,A=l$(e,i);u=A.byteOffset,s=A.vertexCount,l=A.featureCount;let{attributes:P,byteOffset:T}=EA(e,u,m,s,y),{attributes:B}=EA(e,T,k,l,x);v$(B),o=c$(P,B)}if(!((d=a==null?void 0:a.i3s)!=null&&d.coordinateSystem)||a.i3s.coordinateSystem===2){let m=p$(o.position,t);r.modelMatrix=m.invert(),r.coordinateSystem=2}else r.modelMatrix=h$(o.position),r.coordinateSystem=3;r.attributes={positions:o.position,normals:o.normal,colors:SA(o.color),texCoords:o.uv0,uvRegions:SA(o.uvRegion||o.region)},r.indices=f||null,o.id&&o.id.value&&(r.featureIds=o.id.value);for(let m in r.attributes)r.attributes[m]||delete r.attributes[m];return r.vertexCount=s,r.byteLength=n,r}function u$(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 c$(e,r){return{...e,...r}}function SA(e){return e&&(e.normalized=!0,e)}function l$(e,r){let t=0,i=0,a=0;for(let{property:n,type:o}of r.store.defaultGeometrySchema.header){let s=d1(o);switch(n){case"vertexCount":i=new s(e,0,4)[0],t+=bu(o);break;case"featureCount":a=new s(e,4,4)[0],t+=bu(o);break;default:break}}return{vertexCount:i,featureCount:a,byteOffset:t}}function EA(e,r,t,i,a){let n={};for(let o of a)if(t[o]){let{valueType:s,valuesPerElement:u}=t[o];if(r+i*u*bu(s)<=e.byteLength){let l=e.slice(r),f;if(s==="UInt64")f=f$(l,i*u,bu(s));else{let h=d1(s);f=new h(l,0,i*u)}switch(n[o]={value:f,type:kA[s],size:u},o){case"color":n.color.normalized=!0;break;case"position":case"region":case"normal":default:}r=r+i*u*bu(s)}else if(o!=="uv0")break}return{attributes:n,byteOffset:r}}function f$(e,r,t){let i=[],a=new DataView(e),n=0;for(let o=0;o<r;o++){let s=a.getUint32(n,!0),u=a.getUint32(n+4,!0),l=s+2**32*u;i.push(l),n+=t}return new Uint32Array(i)}function p$(e,r){let t=r.mbs,i=e.value,a=e.metadata,n=new vi,o=new Ir(t[0],t[1],t[2]),s=new Ir;return Gn.WGS84.cartographicToCartesian(o,s),Gn.WGS84.eastNorthUpToFixedFrame(s,n),e.value=d$(i,a,o),n}function d$(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)Gn.WGS84.cartographicToCartesian(i.subarray(o,o+3),bd),i[o]=bd.x,i[o+1]=bd.y,i[o+2]=bd.z;return i}function h$(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 vi;return a[0]=t,a[5]=i,a}function m$(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=jA(t.emissiveFactor)),t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorFactor&&(t.pbrMetallicRoughness.baseColorFactor=jA(t.pbrMetallicRoughness.baseColorFactor)),r&&g$(t,r),t}function jA(e){let r=[...e];for(let t=0;t<e.length;t++)r[t]=e[t]/255;return r}function g$(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 v$(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,u=0;for(let l=1;l<a.length;l+=2){let f=Number(i[s]),h=a[l],d=a[l-1],m=h-d+1,y=u+m*3;o.fill(f,u,y),s++,u=y}e.id.value=o}function b$(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 y$(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 x$="4.0.2",TA={name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:x$,mimeTypes:["application/octet-stream"],parse:w$,extensions:["bin"],options:{"i3s-content":{}}};async function w$(e,r,t){let{tile:i,_tileOptions:a,tileset:n,_tilesetOptions:o}=(r==null?void 0:r.i3s)||{},s=a||i,u=o||n;return!s||!u?null:await AA(e,s,u,r,t)}Jg(TA);
100
+ }`}function Lc(e,r=!0,t){let i=t||new Set;if(e){if(M5(e))i.add(e);else if(M5(e.buffer))i.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(let a in e)Lc(e[a],r,i)}}return t===void 0?Array.from(i):[]}function M5(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 Vg=()=>{},ko=class{constructor(r){this.terminated=!1;this._loadableURL="";let{name:t,source:i,url:a}=r;ma(i||a),this.name=t,this.source=i,this.url=a,this.onMessage=Vg,this.onError=n=>console.log(n),this.worker=oa?this._createBrowserWorker():this._createNodeWorker()}static isSupported(){return typeof Worker<"u"&&oa||typeof Dc<"u"&&!oa}destroy(){this.onMessage=Vg,this.onError=Vg,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(r,t){t=t||Lc(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=L5({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 Dc(i,{eval:!1})}else if(this.source)r=new Dc(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 qc=class{constructor(r){this.name="unnamed";this.maxConcurrency=1;this.maxMobileConcurrency=1;this.onDebug=()=>{};this.reuseWorkers=!0;this.props={};this.jobQueue=[];this.idleQueue=[];this.count=0;this.isDestroyed=!1;this.source=r.source,this.url=r.url,this.setProps(r)}static isSupported(){return ko.isSupported()}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 Fc(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){!oa||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 ko({name:r,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return F5?this.maxMobileConcurrency:this.maxConcurrency}};var IU={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},Qa=class{constructor(r){this.workerPools=new Map;this.props={...IU},this.setProps(r),this.workerPools=new Map}static isSupported(){return ko.isSupported()}static getWorkerFarm(r={}){return Qa._workerFarm=Qa._workerFarm||new Qa({}),Qa._workerFarm.setProps(r),Qa._workerFarm}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 qc({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}}};async function Zo(){let parentPort;try{eval("globalThis.parentPort = require('worker_threads').parentPort"),parentPort=globalThis.parentPort}catch{try{eval("globalThis.workerThreadsPromise = import('worker_threads')");let workerThreads=await globalThis.workerThreadsPromise;parentPort=workerThreads.parentPort}catch(e){console.error(e.message)}}return parentPort}var $g=new Map,Za=class{static async inWorkerThread(){return typeof self<"u"||Boolean(await Zo())}static set onmessage(r){async function t(i){let a=await Zo(),{type:n,payload:o}=a?i:i.data;r(n,o)}Zo().then(i=>{i?(i.on("message",t),i.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=t})}static async addEventListener(r){let t=$g.get(r);t||(t=async a=>{if(!BU(a))return;let n=await Zo(),{type:o,payload:s}=n?a:a.data;r(o,s)}),await Zo()?console.error("not implemented"):globalThis.addEventListener("message",t)}static async removeEventListener(r){let t=$g.get(r);$g.delete(r),await Zo()?console.error("not implemented"):globalThis.removeEventListener("message",t)}static async postMessage(r,t){let i={source:"loaders.gl",type:r,payload:t},a=Lc(t),n=await Zo();n?n.postMessage(i,a):globalThis.postMessage(i,a)}};function BU(e){let{type:r,data:t}=e;return r==="message"&&t&&typeof t.source=="string"&&t.source.startsWith("loaders.gl")}function Kg(e,r={}){let t=r[e.id]||{},i=oa?`${e.id}-worker.js`:`${e.id}-worker-node.js`,a=t.workerUrl;if(!a&&e.id==="compression"&&(a=r.workerUrl),r._workerType==="test"&&(oa?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 ma(a),a}function Yg(e,r=Ic){ma(e,"no worker provided");let t=e.version;return!(!r||!t)}var Qg={};Au(Qg,{readFileAsArrayBuffer:()=>wp,readFileAsText:()=>_p,requireFromFile:()=>kp,requireFromString:()=>cu});var Xg=Pt(require("module"),1),z5=Pt(require("path"),1),Mc=Pt(require("fs"),1);async function wp(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():Mc.readFileSync(e).buffer}async function _p(e){return e.startsWith("http")?await(await fetch(e)).text():Mc.readFileSync(e,"utf8")}async function kp(e){if(e.startsWith("http")){let i=await(await fetch(e)).text();return cu(i)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let r=await Mc.promises.readFile(e,"utf8");return cu(r)}function cu(e,r="",t){if(typeof r=="object"&&(t=r,r=""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let i=Xg.default._nodeModulePaths(z5.dirname(r)),a=typeof module<"u"&&(module==null?void 0:module.parent),n=new Xg.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 Zg={};async function gn(e,r=null,t={},i=null){return r&&(e=N5(e,r,t,i)),Zg[e]=Zg[e]||FU(e),await Zg[e]}function N5(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]:oa?t.CDN?(ma(t.CDN.startsWith("http")),`${t.CDN}/${r}@${Ic}/dist/libs/${i}`):Bc?`../src/libs/${i}`:`modules/${r}/src/libs/${i}`:`modules/${r}/dist/libs/${i}`}async function FU(e){if(e.endsWith("wasm"))return await LU(e);if(!oa)try{return Qg&&kp&&await kp(e)}catch(t){return console.error(t),null}if(Bc)return importScripts(e);let r=await qU(e);return DU(r,e)}function DU(e,r){if(!oa)return cu&&cu(e,r);if(Bc)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 LU(e){return oa||!wp||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await wp(e)}async function qU(e){return oa||!_p||e.startsWith("http")?await(await fetch(e)).text():await _p(e)}var MU=0;async function Jg(e){await Za.inWorkerThread()&&(Za.onmessage=async(r,t)=>{switch(r){case"process":try{let{input:i,options:a={},context:n={}}=t,o=await NU({loader:e,arrayBuffer:i,options:a,context:{...n,_parse:zU}});Za.postMessage("done",{result:o})}catch(i){let a=i instanceof Error?i.message:"";Za.postMessage("error",{error:a})}break;default:}})}function zU(e,r,t,i){return new Promise((a,n)=>{let o=MU++,s=(l,f)=>{if(f.id===o)switch(l){case"done":Za.removeEventListener(s),a(f.result);break;case"error":Za.removeEventListener(s),n(f.error);break;default:}};Za.addEventListener(s);let u={id:o,input:e,options:t};Za.postMessage("process",u)})}async function NU({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 ev(e,r){return!Qa.isSupported()||!oa&&!(r!=null&&r._nodeWorkers)?!1:e.worker&&(r==null?void 0:r.worker)}async function rv(e,r,t,i,a){let n=e.id,o=Kg(e,t),u=Qa.getWorkerFarm(t).getWorkerPool({name:n,url:o});t=JSON.parse(JSON.stringify(t)),i=JSON.parse(JSON.stringify(i||{}));let l=await u.startJob("process-on-worker",UU.bind(null,a));return l.postMessage("process",{input:r,options:t,context:i}),await(await l.result).result}async function UU(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 u=s instanceof Error?s.message:"unknown error";r.postMessage("error",{id:a,error:u})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}}function tv(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 av(...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 zc(e){let r=[];for await(let t of e)r.push(t);return av(...r)}function So(e){return So=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},So(e)}function iv(e,r){if(So(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var i=t.call(e,r||"default");if(So(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function nv(e){var r=iv(e,"string");return So(r)==="symbol"?r:String(r)}function ht(e,r,t){return r=nv(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var HU="",U5={};function Jo(e){for(let r in U5)if(e.startsWith(r)){let t=U5[r];e=e.replace(r,t)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${HU}${e}`),e}function H5(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function G5(e){return e&&typeof e=="object"&&e.isBuffer}function Sp(e){if(G5(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 es={};Au(es,{dirname:()=>VU,filename:()=>WU,join:()=>$U,resolve:()=>KU});function W5(){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 WU(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(r+1):""}function VU(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(0,r):""}function $U(...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 KU(...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=W5()),o=a),o.length!==0&&(t=`${o}/${t}`,i=o.charCodeAt(0)===Nc)}return t=YU(t,!i),i?`/${t}`:t.length>0?t:"."}var Nc=47,ov=46;function YU(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===Nc)break;n=Nc}if(n===Nc){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(t.length<2||!o||t.charCodeAt(t.length-1)!==ov||t.charCodeAt(t.length-2)!==ov){if(t.length>2){let u=t.length-1,l=u;for(;l>=0&&t.charCodeAt(l)!==Nc;--l);if(l!==u){t=l===-1?"":t.slice(0,l),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 u=e.slice(i+1,s);t.length>0?t+=`/${u}`:t=u,o=!1}i=s,a=0}else n===ov&&a!==-1?++a:a=-1}return t}var rs=Pt(require("fs"),1),ts=class{constructor(r,t,i){r=Jo(r),this.handle=rs.default.openSync(r,t,i);let a=rs.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)=>{rs.default.close(this.handle,i=>i?t(i):r())})}async stat(){return await new Promise((r,t)=>rs.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 u=await XU(this.handle,o,0,t,a);if(u===0)break;n+=u,a+=BigInt(u),t-=u,s!==void 0&&(s+=u)}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);rs.default.write(this.handle,s,0,i,o,(u,l)=>u?n(u):a(l))})}};async function XU(e,r,t,i,a){return await new Promise((n,o)=>rs.default.read(e,r,t,i,a,(s,u)=>s?o(s):n(u)))}var Tp=Pt(require("fs/promises"),1);var uv=Pt(require("fs"),1),sv=require("stream");var Ep=Pt(require("zlib"),1),QU=e=>e&&e instanceof ArrayBuffer,ZU=e=>e&&e instanceof Buffer;function jp(e,r){switch(r==null?void 0:r.get("content-encoding")){case"br":return e.pipe(Ep.default.createBrotliDecompress());case"gzip":return e.pipe(Ep.default.createGunzip());case"deflate":return e.pipe(Ep.default.createDeflate());default:return e}}async function V5(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(eH(a))}),e.on("end",()=>{let a=JU(r);t(a)})})}function JU(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 eH(e){if(QU(e))return e;if(ZU(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 rH=e=>typeof e=="boolean",$5=e=>typeof e=="function",tH=e=>e!==null&&typeof e=="object",aH=e=>tH(e)&&$5(e.read)&&$5(e.pipe)&&rH(e.readable);async function Ap(e,r){let t=/^file:\/\//;e.replace(t,"/");let i=e.split("?")[0];i=Jo(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,d)=>{let m=uv.default.createReadStream(i,{encoding:null});m.once("readable",()=>h(m)),m.on("error",y=>d(y))}),o=n;aH(n)?o=jp(n,a):typeof n=="string"?o=sv.Readable.from([new TextEncoder().encode(n)]):o=sv.Readable.from([n||new ArrayBuffer(0)]);let s=200,u="OK",l=iH(i),f=new Response(o,{headers:l,status:s,statusText:u});return Object.defineProperty(f,"url",{value:e}),f}catch(n){let o=n.message,s=400,u=o,l={},f=new Response(o,{headers:l,status:s,statusText:u});return Object.defineProperty(f,"url",{value:e}),f}}function iH(e){let r={};if(!r["content-length"]){let t=uv.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 Pp=class{constructor(){this.readable=!0;this.writable=!0}async readdir(r=".",t){return await Tp.default.readdir(r,t)}async stat(r){let t=await Tp.default.stat(r,{bigint:!0});return{size:Number(t.size),bigsize:t.size,isDirectory:t.isDirectory()}}async unlink(r){return await Tp.default.unlink(r)}async fetch(r,t){return await Ap(r,t)}async openReadableFile(r,t="r"){return new ts(r,t)}async openWritableFile(r,t="w",i){return new ts(r,t,i)}};var Uc=class{constructor(r={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(r,t="base64"){var o,s;let i=[];for await(let u of r)i.push(u),yield u;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 zc(r)}};var Hc=Pt(require("crypto"),1),Rp=class extends Uc{constructor(t){var i,a;super();this.name="crypto-node";if(this.options=t,!((a=(i=this.options)==null?void 0:i.crypto)!=null&&a.algorithm))throw new Error(this.name)}async hash(t,i){var n,o,s,u;let a=(s=(o=(n=this.options)==null?void 0:n.crypto)==null?void 0:o.algorithm)==null?void 0:s.toLowerCase();try{if(!Hc.createHash)throw new Error("crypto.createHash not available");let l=(u=Hc.createHash)==null?void 0:u(a),f=new Uint8Array(t);return l.update(f).digest("base64")}catch(l){throw Error(`${a} hash not available. ${l}`)}}async*hashBatches(t,i="base64"){var o,s,u,l,f,h,d;if(!Hc.createHash)throw new Error("crypto.createHash not available");let a=(l=Hc.createHash)==null?void 0:l((u=(s=(o=this.options)==null?void 0:o.crypto)==null?void 0:s.algorithm)==null?void 0:u.toLowerCase());for await(let m of t){let y=new Uint8Array(m);a.update(y),yield m}let n=a.digest(i);(d=(h=(f=this.options)==null?void 0:f.crypto)==null?void 0:h.onEnd)==null||d.call(h,{hash:n})}};var u4=require("node:process");var K5=Pt(require("stream"),1),cv=class{},nH=K5.Readable||cv;function fv(e,r){let t=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new lv(t,r)}var lv=class extends nH{constructor(t,i){super(i);this._iterator=t,this._pulling=!1,this._bytesMode=!i||!i.objectMode}async _read(t){this._pulling||(this._pulling=!0,this._pulling=await this._pull(t,this._iterator))}async _destroy(t,i){var a,n,o,s;this._iterator&&(t?await((n=(a=this._iterator)==null?void 0:a.throw)==null?void 0:n.call(a,t)):await((s=(o=this._iterator)==null?void 0:o.return)==null?void 0:s.call(o,t)),i==null||i(null))}async _pull(t,i){var o;let a=this._bytesMode,n=null;for(;this.readable&&!(n=await i.next()).done&&(t!==null&&(t-=a&&ArrayBuffer.isView(n.value)?n.value.byteLength:1),!(!this.push(new Uint8Array(n.value))||t<=0)););return(n!=null&&n.done||!this.readable)&&(this.push(null)||!0)&&((o=i==null?void 0:i.return)==null||o.call(i)),!this.readable}};var Q5=Pt(X5(),1);delete globalThis.ReadableStream;var Op=class extends Q5.ReadableStream{};var Ip=class{constructor(r){this.isWorking=!1;this.isCancelled=!1;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 Bp=class extends Op{constructor(t){super(new Ip(t.values()),{type:"bytes"});this._chunks=t}async*[Symbol.asyncIterator](t){let i=this.getReader();yield*this._chunks,i.releaseLock()}};var as=class{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 as)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=oH(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),u=Math.max(s-o,0),l=new as([],{type:i});if(u===0)return l;let f=0,h=[];for(let d of n){let{byteLength:m}=d;if(o>0&&m<=o)o-=m,s-=m;else{let y=d.subarray(o,Math.min(m,s));if(h.push(y),f+=y.byteLength,o=0,f>=u)break}}return l.parts=h,l.size=f,l}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 Bp(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 oH(e=""){let r=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(r)?"":r}function sH(){return typeof Blob>"u"&&!globalThis.Blob&&(globalThis.Blob=as),globalThis.Blob}var uH=sH();var Fp=class{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,${Pu(t)}`;this.onload&&this.onload({target:{result:i}})}async readAsText(r){let t=await r.text();this.onload&&this.onload({target:{result:t}})}};var Dp=class extends globalThis.Blob{constructor(t,i,a={}){super(t,a);this.name="";this.webkitRelativePath="";this.name=String(i).replace(/\//g,":"),this.lastModified=(a==null?void 0:a.lastModified)||Date.now()}get[Symbol.toStringTag](){return"File"}};function Z5(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=Fp),typeof File>"u"&&!globalThis.File&&(globalThis.File=Dp),global}var cH=Z5();var pv=Pt(require("module"),1),J5=Pt(require("path"),1),qp=Pt(require("fs"),1);async function e4(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():qp.default.readFileSync(e).buffer}async function r4(e){return e.startsWith("http")?await(await fetch(e)).text():qp.default.readFileSync(e,"utf8")}async function t4(e){if(e.startsWith("http")){let i=await(await fetch(e)).text();return Lp(i)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let r=await qp.default.readFileSync(e,"utf8");return Lp(r)}function Lp(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=pv.default._nodeModulePaths(J5.default.dirname(r)),a=typeof module<"u"&&(module==null?void 0:module.parent),n=new pv.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 Ni=class{constructor(r){this.map={},r instanceof Ni?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=Gc(r),t=a4(t);let i=this.map[r];this.map[r]=i?`${i}, ${t}`:t}delete(r){delete this.map[Gc(r)]}get(r){return r=Gc(r),this.has(r)?this.map[r]:null}has(r){return this.map.hasOwnProperty(Gc(r))}set(r,t){this.map[Gc(r)]=a4(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)}),dv(r)}values(){let r=[];return this.forEach(function(t){r.push(t)}),dv(r)}entries(){let r=[];return this.forEach(function(t,i){r.push([i,t])}),dv(r)}*[Symbol.iterator](){yield*this.entries()}};function Gc(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 a4(e){return typeof e!="string"&&(e=String(e)),e}function dv(e){let r={next(){let t=e.shift();return{done:t===void 0,value:t}}};return r[Symbol.iterator]=function(){return r},r}function hv(e,r){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${r}`)}var gv=Pt(require("stream"),1),lH=e=>typeof e=="boolean",i4=e=>typeof e=="function",fH=e=>e!==null&&typeof e=="object",mv=e=>fH(e)&&i4(e.read)&&i4(e.pipe)&&lH(e.readable),Mn=class{constructor(r,t){this.bodyUsed=!1;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 Ni((t==null?void 0:t.headers)||{}),mv(r)?this._body=jp(r,i):typeof r=="string"?this._body=gv.Readable.from([new TextEncoder().encode(r)]):this._body=gv.Readable.from([r||new ArrayBuffer(0)])}get body(){return hv(!this.bodyUsed),hv(mv(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return mv(this._body)?await V5(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 o4=Pt(require("http"),1),s4=Pt(require("https"),1);var pH=e=>e&&e instanceof ArrayBuffer,dH=e=>e&&e instanceof Buffer;function n4(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:hH(t),mimeType:i}}function hH(e){if(pH(e))return e;if(dH(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 vv=e=>e.startsWith("data:"),mH=e=>e.startsWith("http:")||e.startsWith("https:");async function Wc(e,r){try{if(globalThis.fetch!==Wc&&(mH(e)||vv(e)))return await fetch(e,r);if(vv(e)){let{arrayBuffer:l,mimeType:f}=n4(e);return new Mn(l,{headers:{"content-type":f},url:e})}let t={},i=e;e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip");let a=await gH(i,r),n=xH(e,a,t),{status:o,statusText:s}=yH(a),u=!r||r.followRedirect||r.followRedirect===void 0;if(o>=300&&o<400&&n.has("location")&&u){let l=vH(e,n.get("location"));return await Wc(l,r)}return new Mn(a,{headers:n,status:o,statusText:s,url:e})}catch(t){return new Mn(null,{status:400,statusText:String(t),url:e})}}async function gH(e,r){return await new Promise((t,i)=>{let a=bH(e,r),n=e.startsWith("https:")?s4.default.request(a,o=>t(o)):o4.default.request(a,o=>t(o));n.on("error",o=>i(o)),n.end()})}function vH(e,r){if(r.startsWith("http"))return r;let t=new URL(e);return t.pathname=r,t.href}function bH(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 yH(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function xH(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=wH(e);Number.isFinite(a)&&(i["content-length"]=a)}return Object.assign(i,t),new Ni(i)}function wH(e){return vv(e)?e.length-5:null}var _H=parseInt(u4.versions.node.split(".")[0]);V1&&console.error("loaders.gl: The @loaders.gl/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=fv;globalThis.loaders.NodeFile=ts;globalThis.loaders.NodeFileSystem=Pp;globalThis.loaders.fetchNode=Ap;globalThis.loaders.NodeHash=Rp;globalThis.TextEncoder||(globalThis.TextEncoder=Tu);globalThis.TextDecoder||(globalThis.TextDecoder=Oo);!("atob"in globalThis)&&Pu&&(globalThis.atob=Pu);!("btoa"in globalThis)&&zd&&(globalThis.btoa=zd);globalThis.loaders.encodeImageNode=Qx;globalThis.loaders.parseImageNode=Ug;globalThis.loaders.imageFormatsNode=Ng;globalThis._parseImageNode=Ug;globalThis._imageFormatsNode=Ng;globalThis.loaders.readFileAsArrayBuffer=e4;globalThis.loaders.readFileAsText=r4;globalThis.loaders.requireFromFile=t4;globalThis.loaders.requireFromString=Lp;_H<18&&(!("Headers"in globalThis)&&Ni&&(globalThis.Headers=Ni),!("Response"in globalThis)&&Mn&&(globalThis.Response=Mn),!("fetch"in globalThis)&&Wc&&(globalThis.fetch=Wc));var kH=e=>typeof e=="boolean",Vc=e=>typeof e=="function",is=e=>e!==null&&typeof e=="object",bv=e=>is(e)&&e.constructor==={}.constructor;var c4=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",l4=e=>e&&typeof e[Symbol.asyncIterator]=="function";var di=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var hi=e=>typeof Blob<"u"&&e instanceof Blob,f4=e=>e&&typeof e=="object"&&e.isBuffer;var SH=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||is(e)&&Vc(e.tee)&&Vc(e.cancel)&&Vc(e.getReader);var EH=e=>is(e)&&Vc(e.read)&&Vc(e.pipe)&&kH(e.readable),Mp=e=>SH(e)||EH(e);var jH=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,AH=/^([-\w.]+\/[-\w.+]+)/;function p4(e){let r=AH.exec(e);return r?r[1]:e}function yv(e){let r=jH.exec(e);return r?r[1]:""}var d4=/\?.*/;function h4(e){let r=e.match(d4);return r&&r[0]}function lu(e){return e.replace(d4,"")}function ns(e){return di(e)?e.url:hi(e)?e.name||"":typeof e=="string"?e:""}function $c(e){if(di(e)){let r=e,t=r.headers.get("content-type")||"",i=lu(r.url);return p4(t)||yv(i)}return hi(e)?e.type||"":typeof e=="string"?yv(e):""}function m4(e){return di(e)?e.headers["content-length"]||-1:hi(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function zp(e){if(di(e))return e;let r={},t=m4(e);t>=0&&(r["content-length"]=String(t));let i=ns(e),a=$c(e);a&&(r["content-type"]=a);let n=await PH(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 g4(e){if(!e.ok){let r=await TH(e);throw new Error(r)}}async function TH(e){let r=`Failed to fetch resource ${e.url} (${e.status}): `;try{let t=e.headers.get("Content-Type"),i=e.statusText;t!=null&&t.includes("application/json")&&(i+=` ${await e.text()}`),r+=i,r=r.length>60?`${r.slice(0,60)}...`:r}catch{}return r}async function PH(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,${RH(t)}`}return null}function RH(e){let r="",t=new Uint8Array(e);for(let i=0;i<t.byteLength;i++)r+=String.fromCharCode(t[i]);return btoa(r)}function CH(e){return!OH(e)&&!IH(e)}function OH(e){return e.startsWith("http:")||e.startsWith("https:")}function IH(e){return e.startsWith("data:")}async function xv(e,r){var t,i;if(typeof e=="string"){let a=Jo(e);return CH(a)&&(t=globalThis.loaders)!=null&&t.fetchNode?(i=globalThis.loaders)==null?void 0:i.fetchNode(a,r):await fetch(a,r)}return await zp(e)}function wv(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let r=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,t=e||r;return!!(t&&t.indexOf("Electron")>=0)}function Ui(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||wv()}var BH=globalThis.self||globalThis.window||globalThis.global,fu=globalThis.window||globalThis.self||globalThis.global,FH=globalThis.document||{},os=globalThis.process||{},DH=globalThis.console,Tte=globalThis.navigator||{};var Np="4.0.3",Cte=Ui();function LH(e){try{let r=window[e],t="__storage_test__";return r.setItem(t,t),r.removeItem(t),r}catch{return null}}var Up=class{constructor(r,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";ht(this,"storage",void 0),ht(this,"id",void 0),ht(this,"config",void 0),this.storage=LH(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 v4(e){let r;return e<10?r="".concat(e.toFixed(2),"ms"):e<100?r="".concat(e.toFixed(1),"ms"):e<1e3?r="".concat(e.toFixed(0),"ms"):r="".concat((e/1e3).toFixed(2),"s"),r}function b4(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,t=Math.max(r-e.length,0);return"".concat(" ".repeat(t)).concat(e)}function Hp(e,r,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,a=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(t=Math.min(t,i/e.width));let n=e.width*t,o=e.height*t,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(n/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(a,");"),"background-size:".concat(n,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(r," %c+"),s]}var Gp;(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"})(Gp||(Gp={}));var qH=10;function y4(e){return typeof e!="string"?e:(e=e.toUpperCase(),Gp[e]||Gp.WHITE)}function x4(e,r,t){if(!Ui&&typeof e=="string"){if(r){let i=y4(r);e="\x1B[".concat(i,"m").concat(e,"\x1B[39m")}if(t){let i=y4(t);e="\x1B[".concat(i+qH,"m").concat(e,"\x1B[49m")}}return e}function w4(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],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 pu(e,r){if(!e)throw new Error(r||"Assertion failed")}function ss(){let e;if(Ui()&&fu.performance){var r,t;e=fu===null||fu===void 0||(r=fu.performance)===null||r===void 0||(t=r.now)===null||t===void 0?void 0:t.call(r)}else if("hrtime"in os){var i;let a=os===null||os===void 0||(i=os.hrtime)===null||i===void 0?void 0:i.call(os);e=a[0]*1e3+a[1]/1e6}else e=Date.now();return e}var du={debug:Ui()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},MH={enabled:!0,level:0};function mi(){}var _4={},k4={once:!0},vn=class{constructor(){let{id:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};ht(this,"id",void 0),ht(this,"VERSION",Np),ht(this,"_startTs",ss()),ht(this,"_deltaTs",ss()),ht(this,"_storage",void 0),ht(this,"userData",{}),ht(this,"LOG_THROTTLE_TIMEOUT",0),this.id=r,this.userData={},this._storage=new Up("__probe-".concat(this.id,"__"),MH),this.timeStamp("".concat(this.id," started")),w4(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((ss()-this._startTs).toPrecision(10))}getDelta(){return Number((ss()-this._deltaTs).toPrecision(10))}set priority(r){this.level=r}get priority(){return this.level}getPriority(){return this.level}enable(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!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){pu(r,t)}warn(r){return this._getLogFunction(0,r,du.warn,arguments,k4)}error(r){return this._getLogFunction(0,r,du.error,arguments)}deprecated(r,t){return this.warn("`".concat(r,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}removed(r,t){return this.error("`".concat(r,"` has been removed. Use `").concat(t,"` instead"))}probe(r,t){return this._getLogFunction(r,t,du.log,arguments,{time:!0,once:!0})}log(r,t){return this._getLogFunction(r,t,du.debug,arguments)}info(r,t){return this._getLogFunction(r,t,console.info,arguments)}once(r,t){return this._getLogFunction(r,t,du.debug||du.info,arguments,k4)}table(r,t,i){return t?this._getLogFunction(r,t,console.table||mi,i&&[i],{tag:HH(t)}):mi}image(r){let{logLevel:t,priority:i,image:a,message:n="",scale:o=1}=r;return this._shouldLog(t||i)?Ui()?UH({image:a,message:n,scale:o}):NH({image:a,message:n,scale:o}):mi}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||mi)}group(r,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},a=S4({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){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(r,t,Object.assign({},i,{collapsed:!0}))}groupEnd(r){return this._getLogFunction(r,"",console.groupEnd||mi)}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()>=E4(r)}_getLogFunction(r,t,i,a,n){if(this._shouldLog(r)){n=S4({logLevel:r,message:t,args:a,opts:n}),i=i||n.method,pu(i),n.total=this.getTotal(),n.delta=this.getDelta(),this._deltaTs=ss();let o=n.tag||n.message;if(n.once&&o)if(!_4[o])_4[o]=ss();else return mi;return t=zH(this.id,n.message,n),i.bind(console,t,...n.args)}return mi}};ht(vn,"VERSION",Np);function E4(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 pu(Number.isFinite(r)&&r>=0),r}function S4(e){let{logLevel:r,message:t}=e;e.logLevel=E4(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 pu(a==="string"||a==="object"),Object.assign(e,{args:i},e.opts)}function zH(e,r,t){if(typeof r=="string"){let i=t.time?b4(v4(t.total)):"";r=t.time?"".concat(e,": ").concat(i," ").concat(r):"".concat(e,": ").concat(r),r=x4(r,t.color,t.background)}return r}function NH(e){let{image:r,message:t="",scale:i=1}=e;return console.warn("removed"),mi}function UH(e){let{image:r,message:t="",scale:i=1}=e;if(typeof r=="string"){let n=new Image;return n.onload=()=>{let o=Hp(n,t,i);console.log(...o)},n.src=r,mi}let a=r.nodeName||"";if(a.toLowerCase()==="img")return console.log(...Hp(r,t,i)),mi;if(a.toLowerCase()==="canvas"){let n=new Image;return n.onload=()=>console.log(...Hp(n,t,i)),n.src=r.toDataURL(),mi}return mi}function HH(e){for(let r in e)for(let t in e[r])return t||"untitled";return"empty"}var iae=new vn({id:"@probe.gl/log"});var _v=new vn({id:"loaders.gl"}),Wp=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},Vp=class{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 kv={fetch:null,mimeType:void 0,nothrow:!1,log:new Vp,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:Qo,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},j4={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 Sv(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state=e._state||{},e._state}function Ev(){let e=Sv();return e.globalOptions=e.globalOptions||{...kv},e.globalOptions}function P4(e,r,t,i){return t=t||[],t=Array.isArray(t)?t:[t],GH(e,t),VH(r,e,i)}function GH(e,r){A4(e,null,kv,j4,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]||{};A4(i,t.id,a,n,r)}}function A4(e,r,t,i,a){let n=r||"Top level",o=r?`${r}.`:"";for(let s in e){let u=!r&&is(e[s]),l=s==="baseUri"&&!r,f=s==="workerUrl"&&r;if(!(s in t)&&!l&&!f){if(s in i)_v.warn(`${n} loader option '${o}${s}' no longer supported, use '${i[s]}'`)();else if(!u){let h=WH(s,a);_v.warn(`${n} loader option '${o}${s}' not recognized. ${h}`)()}}}}function WH(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 VH(e,r,t){let a={...e.options||{}};return $H(a,t),a.log===null&&(a.log=new Wp),T4(a,Ev()),T4(a,r),a}function T4(e,r){for(let t in r)if(t in r){let i=r[t];bv(i)&&bv(e[t])?e[t]={...e[t],...r[t]}:e[t]=r[t]}}function $H(e,r){r&&!("baseUri"in e)&&(e.baseUri=r)}function Kc(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function jv(e){zi(e,"null loader"),zi(Kc(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 KH=()=>{let e=Sv();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function R4(){return KH()}var C4=new vn({id:"loaders.gl"});var YH=/\.([^.]+)$/;async function B4(e,r=[],t,i){if(!F4(e))return null;let a=O4(e,r,{...t,nothrow:!0},i);if(a)return a;if(hi(e)&&(e=await e.slice(0,10).arrayBuffer(),a=O4(e,r,t,i)),!a&&!(t!=null&&t.nothrow))throw new Error(D4(e));return a}function O4(e,r=[],t,i){if(!F4(e))return null;if(r&&!Array.isArray(r))return jv(r);let a=[];r&&(a=a.concat(r)),t!=null&&t.ignoreRegisteredLoaders||a.push(...R4()),QH(a);let n=XH(e,a,t,i);if(!n&&!(t!=null&&t.nothrow))throw new Error(D4(e));return n}function XH(e,r,t,i){let a=ns(e),n=$c(e),o=lu(a)||(i==null?void 0:i.url),s=null,u="";return t!=null&&t.mimeType&&(s=Av(r,t==null?void 0:t.mimeType),u=`match forced by supplied MIME type ${t==null?void 0:t.mimeType}`),s=s||ZH(r,o),u=u||(s?`matched url ${o}`:""),s=s||Av(r,n),u=u||(s?`matched MIME type ${n}`:""),s=s||eG(r,e),u=u||(s?`matched initial data ${L4(e)}`:""),t!=null&&t.fallbackMimeType&&(s=s||Av(r,t==null?void 0:t.fallbackMimeType),u=u||(s?`matched fallback MIME type ${n}`:"")),u&&C4.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${u}.`),s}function F4(e){return!(e instanceof Response&&e.status===204)}function D4(e){let r=ns(e),t=$c(e),i="No valid loader found (";i+=r?`${es.filename(r)}, `:"no url provided, ",i+=`MIME type: ${t?`"${t}"`:"not provided"}, `;let a=e?L4(e):"";return i+=a?` first bytes: "${a}"`:"first bytes: not available",i+=")",i}function QH(e){for(let r of e)jv(r)}function ZH(e,r){let t=r&&YH.exec(r),i=t&&t[1];return i?JH(e,i):null}function JH(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 Av(e,r){for(let t of e)if(t.mimeTypes&&t.mimeTypes.includes(r)||r===`application/x.${t.id}`)return t;return null}function eG(e,r){if(!r)return null;for(let t of e)if(typeof r=="string"){if(rG(r,t))return t}else if(ArrayBuffer.isView(r)){if(I4(r.buffer,r.byteOffset,t))return t}else if(r instanceof ArrayBuffer&&I4(r,0,t))return t;return null}function rG(e,r){return r.testText?r.testText(e):(Array.isArray(r.tests)?r.tests:[r.tests]).some(i=>e.startsWith(i))}function I4(e,r,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(a=>tG(e,r,t,a))}function tG(e,r,t,i){if(i instanceof ArrayBuffer)return tv(i,e,i.byteLength);switch(typeof i){case"function":return i(e);case"string":let a=Tv(e,r,i.length);return i===a;default:return!1}}function L4(e,r=5){return typeof e=="string"?e.slice(0,r):ArrayBuffer.isView(e)?Tv(e.buffer,e.byteOffset,r):e instanceof ArrayBuffer?Tv(e,0,r):""}function Tv(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*q4(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*M4(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*z4(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 Pv(e,r){return Qo?aG(e,r):iG(e,r)}async function*aG(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 Sp(o)}}catch{t.releaseLock()}}async function*iG(e,r){for await(let t of e)yield Sp(t)}function N4(e,r){if(typeof e=="string")return q4(e,r);if(e instanceof ArrayBuffer)return M4(e,r);if(hi(e))return z4(e,r);if(Mp(e))return Pv(e,r);if(di(e))return Pv(e.body,r);throw new Error("makeIterator")}var U4="Cannot convert supplied data type";function nG(e,r,t){if(r.text&&typeof e=="string")return e;if(f4(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(U4)}async function H4(e,r,t){let i=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||i)return nG(e,r,t);if(hi(e)&&(e=await zp(e)),di(e)){let a=e;return await g4(a),r.binary?await a.arrayBuffer():await a.text()}if(Mp(e)&&(e=N4(e,t)),c4(e)||l4(e))return zc(e);throw new Error(U4)}function $p(e,r){let t=Ev(),i=e||t;return typeof i.fetch=="function"?i.fetch:is(i.fetch)?a=>xv(a,i.fetch):r!=null&&r.fetch?r==null?void 0:r.fetch:xv}function G4(e,r,t){if(t)return t;let i={fetch:$p(r,e),...e};if(i.url){let a=lu(i.url);i.baseUrl=a,i.queryString=h4(i.url),i.filename=es.filename(a),i.baseUrl=es.dirname(a)}return Array.isArray(i.loaders)||(i.loaders=null),i}function W4(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 zn(e,r,t,i){r&&!Array.isArray(r)&&!Kc(r)&&(i=void 0,t=r,r=void 0),e=await e,t=t||{};let a=ns(e),o=W4(r,i),s=await B4(e,o,t);return s?(t=P4(t,s,o,a),i=G4({url:a,_parse:zn,loaders:o},t,i||null),await oG(s,e,t,i)):null}async function oG(e,r,t,i){if(Yg(e),t=Gg(e.options,t),di(r)){let n=r,{ok:o,redirected:s,status:u,statusText:l,type:f,url:h}=n,d=Object.fromEntries(n.headers.entries());i.response={headers:d,ok:o,redirected:s,status:u,statusText:l,type:f,url:h}}r=await H4(r,e,t);let a=e;if(a.parseTextSync&&typeof r=="string")return a.parseTextSync(r,t,i);if(ev(e,t))return await rv(e,r,t,i,zn);if(a.parseText&&typeof r=="string")return await a.parseText(r,t,i);if(a.parse)return await a.parse(r,t,i);throw ma(!a.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function V4(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 Rv(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:[],u=s&&s.length;for(let l=0;l<u;l+=3){let f=s[l],h=s[l+1],d=s[l+2];r=f<r?f:r,t=h<t?h:t,i=d<i?d:i,a=f>a?f:a,n=h>n?h:n,o=d>o?d:o}return[[r,t,i],[a,n,o]]}function Cv(e,r,t){let i=V4(r.value),a=t||$4(r);return{name:e,type:{type:"fixed-size-list",listSize:r.size,children:[{name:"value",type:i}]},nullable:!1,metadata:a}}function $4(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 Ov(e,r,t,i){let a,n;!Array.isArray(r)&&!Kc(r)?(a=[],n=r,i=void 0):(a=r,n=t);let o=$p(n),s=e;return typeof e=="string"&&(s=await o(e)),hi(e)&&(s=await o(e)),Array.isArray(a)?await zn(s,a,n):await zn(s,a,n)}var sG=1/Math.PI*180,uG=1/180*Math.PI,cG={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...cG}};var Bt=globalThis.mathgl.config;function Iv(e,{precision:r=Bt.precision}={}){return e=lG(e),"".concat(parseFloat(e.toPrecision(r)))}function Eo(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Bv(e){return K4(e)}function Fv(e){return Y4(e)}function K4(e,r){return X4(e,t=>t*uG,r)}function Y4(e,r){return X4(e,t=>t*sG,r)}function Nn(e,r,t){let i=Bt.EPSILON;t&&(Bt.EPSILON=t);try{if(e===r)return!0;if(Eo(e)&&Eo(r)){if(e.length!==r.length)return!1;for(let a=0;a<e.length;++a)if(!Nn(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)<=Bt.EPSILON*Math.max(1,Math.abs(e),Math.abs(r)):!1}finally{Bt.EPSILON=i}}function lG(e){return Math.round(e/Bt.EPSILON)*Bt.EPSILON}function fG(e){return e.clone?e.clone():new Array(e.length)}function X4(e,r,t){if(Eo(e)){let i=e;t=t||fG(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)}function pG(e){function r(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return r.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e,r}var hu=class extends pG(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:Eo(r)?this.toArray(r):this.toObject(r)}toTarget(r){return r?this.to(r):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Bt)}formatString(r){let t="";for(let i=0;i<this.ELEMENTS;++i)t+=(i>0?", ":"")+Iv(this[i],r);return"".concat(r.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(r){if(!r||this.length!==r.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!Nn(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(Bt.debug&&!this.validate())throw new Error("math.gl: ".concat(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 dG(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 Aa(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function Kp(e,r,t=""){if(Bt.debug&&!dG(e,r))throw new Error("math.gl: ".concat(t," some fields set to invalid numbers'"));return e}function gi(e,r){if(!e)throw new Error("math.gl assertion ".concat(r))}var Yp=class extends hu{get x(){return this[0]}set x(r){this[0]=Aa(r)}get y(){return this[1]}set y(r){this[1]=Aa(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 Aa(t)}dot(r){let t=0;for(let i=0;i<this.ELEMENTS;++i)t+=this[i]*r[i];return Aa(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 gi(r>=0&&r<this.ELEMENTS,"index is out of range"),Aa(this[r])}setComponent(r,t){return gi(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 Hi=typeof Float32Array<"u"?Float32Array:Array,Yc=Math.random;function mu(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var Mie=Math.PI/180;function hG(){let e=new Hi(2);return Hi!=Float32Array&&(e[0]=0,e[1]=0),e}function Q4(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 zie=function(){let e=hG();return function(r,t,i,a,n,o){let s,u;for(t||(t=2),i||(i=0),a?u=Math.min(a*t+i,r.length):u=r.length,s=i;s<u;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 Z4(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 Xp(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 J4(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 Qc={};Au(Qc,{add:()=>yG,angle:()=>Gv,bezier:()=>IG,ceil:()=>xG,clone:()=>mG,copy:()=>vG,create:()=>ej,cross:()=>qv,dist:()=>UG,distance:()=>nj,div:()=>NG,divide:()=>ij,dot:()=>Lv,equals:()=>qG,exactEquals:()=>LG,floor:()=>wG,forEach:()=>VG,fromValues:()=>gG,hermite:()=>OG,inverse:()=>TG,len:()=>GG,length:()=>rj,lerp:()=>RG,max:()=>kG,min:()=>_G,mul:()=>zG,multiply:()=>aj,negate:()=>AG,normalize:()=>PG,random:()=>BG,rotateX:()=>Nv,rotateY:()=>Uv,rotateZ:()=>Hv,round:()=>SG,scale:()=>EG,scaleAndAdd:()=>jG,set:()=>bG,slerp:()=>CG,sqrDist:()=>HG,sqrLen:()=>WG,squaredDistance:()=>oj,squaredLength:()=>sj,str:()=>DG,sub:()=>MG,subtract:()=>tj,transformMat3:()=>Mv,transformMat4:()=>Xc,transformQuat:()=>zv,zero:()=>FG});function ej(){let e=new Hi(3);return Hi!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function mG(e){let r=new Hi(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function rj(e){let r=e[0],t=e[1],i=e[2];return Math.sqrt(r*r+t*t+i*i)}function gG(e,r,t){let i=new Hi(3);return i[0]=e,i[1]=r,i[2]=t,i}function vG(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function bG(e,r,t,i){return e[0]=r,e[1]=t,e[2]=i,e}function yG(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e}function tj(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e}function aj(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 xG(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e}function wG(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e}function _G(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 kG(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 SG(e,r){return e[0]=mu(r[0]),e[1]=mu(r[1]),e[2]=mu(r[2]),e}function EG(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e}function jG(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 nj(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 oj(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 sj(e){let r=e[0],t=e[1],i=e[2];return r*r+t*t+i*i}function AG(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e}function TG(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e}function PG(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 Lv(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function qv(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[0],s=t[1],u=t[2];return e[0]=a*u-n*s,e[1]=n*o-i*u,e[2]=i*s-a*o,e}function RG(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 CG(e,r,t,i){let a=Math.acos(Math.min(Math.max(Lv(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 OG(e,r,t,i,a,n){let o=n*n,s=o*(2*n-3)+1,u=o*(n-2)+n,l=o*(n-1),f=o*(3-2*n);return e[0]=r[0]*s+t[0]*u+i[0]*l+a[0]*f,e[1]=r[1]*s+t[1]*u+i[1]*l+a[1]*f,e[2]=r[2]*s+t[2]*u+i[2]*l+a[2]*f,e}function IG(e,r,t,i,a,n){let o=1-n,s=o*o,u=n*n,l=s*o,f=3*n*s,h=3*u*o,d=u*n;return e[0]=r[0]*l+t[0]*f+i[0]*h+a[0]*d,e[1]=r[1]*l+t[1]*f+i[1]*h+a[1]*d,e[2]=r[2]*l+t[2]*f+i[2]*h+a[2]*d,e}function BG(e,r){r=r===void 0?1:r;let t=Yc()*2*Math.PI,i=Yc()*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 Xc(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 Mv(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 zv(e,r,t){let i=t[0],a=t[1],n=t[2],o=t[3],s=r[0],u=r[1],l=r[2],f=a*l-n*u,h=n*s-i*l,d=i*u-a*s,m=a*d-n*h,y=n*f-i*d,k=i*h-a*f,x=o*2;return f*=x,h*=x,d*=x,m*=2,y*=2,k*=2,e[0]=s+f+m,e[1]=u+h+y,e[2]=l+d+k,e}function Nv(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 Uv(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 Hv(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 Gv(e,r){let t=e[0],i=e[1],a=e[2],n=r[0],o=r[1],s=r[2],u=Math.sqrt((t*t+i*i+a*a)*(n*n+o*o+s*s)),l=u&&Lv(e,r)/u;return Math.acos(Math.min(Math.max(l,-1),1))}function FG(e){return e[0]=0,e[1]=0,e[2]=0,e}function DG(e){return"vec3(".concat(e[0],", ").concat(e[1],", ").concat(e[2],")")}function LG(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]}function qG(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 MG=tj,zG=aj,NG=ij,UG=nj,HG=oj,GG=rj,WG=sj,VG=function(){let e=ej();return function(r,t,i,a,n,o){let s,u;for(t||(t=3),i||(i=0),a?u=Math.min(a*t+i,r.length):u=r.length,s=i;s<u;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 Wv=[0,0,0],Qp,Ir=class extends Yp{static get ZERO(){return Qp||(Qp=new Ir(0,0,0),Object.freeze(Qp)),Qp}constructor(r=0,t=0,i=0){super(-0,-0,-0),arguments.length===1&&Eo(r)?this.copy(r):(Bt.debug&&(Aa(r),Aa(t),Aa(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 Bt.debug&&(Aa(r.x),Aa(r.y),Aa(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]=Aa(r)}angle(r){return Gv(this,r)}cross(r){return qv(this,this,r),this.check()}rotateX({radians:r,origin:t=Wv}){return Nv(this,this,t,r),this.check()}rotateY({radians:r,origin:t=Wv}){return Uv(this,this,t,r),this.check()}rotateZ({radians:r,origin:t=Wv}){return Hv(this,this,t,r),this.check()}transform(r){return this.transformAsPoint(r)}transformAsPoint(r){return Xc(this,this,r),this.check()}transformAsVector(r){return Xp(this,this,r),this.check()}transformByMatrix3(r){return Mv(this,this,r),this.check()}transformByMatrix2(r){return J4(this,this,r),this.check()}transformByQuaternion(r){return zv(this,this,r),this.check()}};var Zp=class extends hu{toString(){let r="[";if(Bt.printRowMajor){r+="row-major:";for(let t=0;t<this.RANK;++t)for(let i=0;i<this.RANK;++i)r+=" ".concat(this[i*this.RANK+t])}else{r+="column-major:";for(let t=0;t<this.ELEMENTS;++t)r+=" ".concat(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]=Aa(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 $G(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 uj(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 cj(e,r){let t=r[0],i=r[1],a=r[2],n=r[3],o=r[4],s=r[5],u=r[6],l=r[7],f=r[8],h=r[9],d=r[10],m=r[11],y=r[12],k=r[13],x=r[14],A=r[15],P=t*s-i*o,T=t*u-a*o,B=t*l-n*o,C=i*u-a*s,I=i*l-n*s,F=a*l-n*u,H=f*k-h*y,N=f*x-d*y,K=f*A-m*y,V=h*x-d*k,X=h*A-m*k,U=d*A-m*x,$=P*U-T*X+B*V+C*K-I*N+F*H;return $?($=1/$,e[0]=(s*U-u*X+l*V)*$,e[1]=(a*X-i*U-n*V)*$,e[2]=(k*F-x*I+A*C)*$,e[3]=(d*I-h*F-m*C)*$,e[4]=(u*K-o*U-l*N)*$,e[5]=(t*U-a*K+n*N)*$,e[6]=(x*B-y*F-A*T)*$,e[7]=(f*F-d*B+m*T)*$,e[8]=(o*X-s*K+l*H)*$,e[9]=(i*K-t*X-n*H)*$,e[10]=(y*I-k*B+A*P)*$,e[11]=(h*B-f*I-m*P)*$,e[12]=(s*N-o*V-u*H)*$,e[13]=(t*V-i*N+a*H)*$,e[14]=(k*T-y*C-x*P)*$,e[15]=(f*C-h*T+d*P)*$,e):null}function lj(e){let r=e[0],t=e[1],i=e[2],a=e[3],n=e[4],o=e[5],s=e[6],u=e[7],l=e[8],f=e[9],h=e[10],d=e[11],m=e[12],y=e[13],k=e[14],x=e[15],A=r*o-t*n,P=r*s-i*n,T=t*s-i*o,B=l*y-f*m,C=l*k-h*m,I=f*k-h*y,F=r*I-t*C+i*B,H=n*I-o*C+s*B,N=l*T-f*P+h*A,K=m*T-y*P+k*A;return u*F-a*H+x*N-d*K}function Vv(e,r,t){let i=r[0],a=r[1],n=r[2],o=r[3],s=r[4],u=r[5],l=r[6],f=r[7],h=r[8],d=r[9],m=r[10],y=r[11],k=r[12],x=r[13],A=r[14],P=r[15],T=t[0],B=t[1],C=t[2],I=t[3];return e[0]=T*i+B*s+C*h+I*k,e[1]=T*a+B*u+C*d+I*x,e[2]=T*n+B*l+C*m+I*A,e[3]=T*o+B*f+C*y+I*P,T=t[4],B=t[5],C=t[6],I=t[7],e[4]=T*i+B*s+C*h+I*k,e[5]=T*a+B*u+C*d+I*x,e[6]=T*n+B*l+C*m+I*A,e[7]=T*o+B*f+C*y+I*P,T=t[8],B=t[9],C=t[10],I=t[11],e[8]=T*i+B*s+C*h+I*k,e[9]=T*a+B*u+C*d+I*x,e[10]=T*n+B*l+C*m+I*A,e[11]=T*o+B*f+C*y+I*P,T=t[12],B=t[13],C=t[14],I=t[15],e[12]=T*i+B*s+C*h+I*k,e[13]=T*a+B*u+C*d+I*x,e[14]=T*n+B*l+C*m+I*A,e[15]=T*o+B*f+C*y+I*P,e}function fj(e,r,t){let i=t[0],a=t[1],n=t[2],o,s,u,l,f,h,d,m,y,k,x,A;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],u=r[2],l=r[3],f=r[4],h=r[5],d=r[6],m=r[7],y=r[8],k=r[9],x=r[10],A=r[11],e[0]=o,e[1]=s,e[2]=u,e[3]=l,e[4]=f,e[5]=h,e[6]=d,e[7]=m,e[8]=y,e[9]=k,e[10]=x,e[11]=A,e[12]=o*i+f*a+y*n+r[12],e[13]=s*i+h*a+k*n+r[13],e[14]=u*i+d*a+x*n+r[14],e[15]=l*i+m*a+A*n+r[15]),e}function pj(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 dj(e,r,t,i){let a=i[0],n=i[1],o=i[2],s=Math.sqrt(a*a+n*n+o*o),u,l,f,h,d,m,y,k,x,A,P,T,B,C,I,F,H,N,K,V,X,U,$,Z;return s<1e-6?null:(s=1/s,a*=s,n*=s,o*=s,l=Math.sin(t),u=Math.cos(t),f=1-u,h=r[0],d=r[1],m=r[2],y=r[3],k=r[4],x=r[5],A=r[6],P=r[7],T=r[8],B=r[9],C=r[10],I=r[11],F=a*a*f+u,H=n*a*f+o*l,N=o*a*f-n*l,K=a*n*f-o*l,V=n*n*f+u,X=o*n*f+a*l,U=a*o*f+n*l,$=n*o*f-a*l,Z=o*o*f+u,e[0]=h*F+k*H+T*N,e[1]=d*F+x*H+B*N,e[2]=m*F+A*H+C*N,e[3]=y*F+P*H+I*N,e[4]=h*K+k*V+T*X,e[5]=d*K+x*V+B*X,e[6]=m*K+A*V+C*X,e[7]=y*K+P*V+I*X,e[8]=h*U+k*$+T*Z,e[9]=d*U+x*$+B*Z,e[10]=m*U+A*$+C*Z,e[11]=y*U+P*$+I*Z,r!==e&&(e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e)}function hj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[4],o=r[5],s=r[6],u=r[7],l=r[8],f=r[9],h=r[10],d=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+l*i,e[5]=o*a+f*i,e[6]=s*a+h*i,e[7]=u*a+d*i,e[8]=l*a-n*i,e[9]=f*a-o*i,e[10]=h*a-s*i,e[11]=d*a-u*i,e}function mj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[0],o=r[1],s=r[2],u=r[3],l=r[8],f=r[9],h=r[10],d=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-l*i,e[1]=o*a-f*i,e[2]=s*a-h*i,e[3]=u*a-d*i,e[8]=n*i+l*a,e[9]=o*i+f*a,e[10]=s*i+h*a,e[11]=u*i+d*a,e}function gj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[0],o=r[1],s=r[2],u=r[3],l=r[4],f=r[5],h=r[6],d=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+l*i,e[1]=o*a+f*i,e[2]=s*a+h*i,e[3]=u*a+d*i,e[4]=l*a-n*i,e[5]=f*a-o*i,e[6]=h*a-s*i,e[7]=d*a-u*i,e}function vj(e,r){let t=r[0],i=r[1],a=r[2],n=r[3],o=t+t,s=i+i,u=a+a,l=t*o,f=i*o,h=i*s,d=a*o,m=a*s,y=a*u,k=n*o,x=n*s,A=n*u;return e[0]=1-h-y,e[1]=f+A,e[2]=d-x,e[3]=0,e[4]=f-A,e[5]=1-l-y,e[6]=m+k,e[7]=0,e[8]=d+x,e[9]=m-k,e[10]=1-l-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function bj(e,r,t,i,a,n,o){let s=1/(t-r),u=1/(a-i),l=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*u,e[6]=0,e[7]=0,e[8]=(t+r)*s,e[9]=(a+i)*u,e[10]=(o+n)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*n*2*l,e[15]=0,e}function KG(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 yj=KG;function YG(e,r,t,i,a,n,o){let s=1/(r-t),u=1/(i-a),l=1/(n-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(r+t)*s,e[13]=(a+i)*u,e[14]=(o+n)*l,e[15]=1,e}var xj=YG;function wj(e,r,t,i){let a,n,o,s,u,l,f,h,d,m,y=r[0],k=r[1],x=r[2],A=i[0],P=i[1],T=i[2],B=t[0],C=t[1],I=t[2];return Math.abs(y-B)<1e-6&&Math.abs(k-C)<1e-6&&Math.abs(x-I)<1e-6?$G(e):(h=y-B,d=k-C,m=x-I,a=1/Math.sqrt(h*h+d*d+m*m),h*=a,d*=a,m*=a,n=P*m-T*d,o=T*h-A*m,s=A*d-P*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),u=d*s-m*o,l=m*n-h*s,f=h*o-d*n,a=Math.sqrt(u*u+l*l+f*f),a?(a=1/a,u*=a,l*=a,f*=a):(u=0,l=0,f=0),e[0]=n,e[1]=u,e[2]=h,e[3]=0,e[4]=o,e[5]=l,e[6]=d,e[7]=0,e[8]=s,e[9]=f,e[10]=m,e[11]=0,e[12]=-(n*y+o*k+s*x),e[13]=-(u*y+l*k+f*x),e[14]=-(h*y+d*k+m*x),e[15]=1,e)}function XG(){let e=new Hi(4);return Hi!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function _j(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 ene=function(){let e=XG();return function(r,t,i,a,n,o){let s,u;for(t||(t=4),i||(i=0),a?u=Math.min(a*t+i,r.length):u=r.length,s=i;s<u;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 Yv;(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"})(Yv||(Yv={}));var QG=45*Math.PI/180,ZG=1,$v=.1,Kv=500,JG=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),vi=class extends Zp{static get IDENTITY(){return rW()}static get ZERO(){return eW()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Yv}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,u,l,f,h,d,m,y,k,x){return this[0]=r,this[1]=t,this[2]=i,this[3]=a,this[4]=n,this[5]=o,this[6]=s,this[7]=u,this[8]=l,this[9]=f,this[10]=h,this[11]=d,this[12]=m,this[13]=y,this[14]=k,this[15]=x,this.check()}setRowMajor(r,t,i,a,n,o,s,u,l,f,h,d,m,y,k,x){return this[0]=r,this[1]=n,this[2]=l,this[3]=m,this[4]=t,this[5]=o,this[6]=f,this[7]=y,this[8]=i,this[9]=s,this[10]=h,this[11]=k,this[12]=a,this[13]=u,this[14]=d,this[15]=x,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(JG)}fromObject(r){return this.check()}fromQuaternion(r){return vj(this,r),this.check()}frustum(r){let{left:t,right:i,bottom:a,top:n,near:o=$v,far:s=Kv}=r;return s===1/0?tW(this,t,i,a,n,o):bj(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 wj(this,t,i,a),this.check()}ortho(r){let{left:t,right:i,bottom:a,top:n,near:o=$v,far:s=Kv}=r;return xj(this,t,i,a,n,o,s),this.check()}orthographic(r){let{fovy:t=QG,aspect:i=ZG,focalDistance:a=1,near:n=$v,far:o=Kv}=r;kj(t);let s=t/2,u=a*Math.tan(s),l=u*i;return this.ortho({left:-l,right:l,bottom:-u,top:u,near:n,far:o})}perspective(r){let{fovy:t=45*Math.PI/180,aspect:i=1,near:a=.1,far:n=500}=r;return kj(t),yj(this,t,i,a,n),this.check()}determinant(){return lj(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 uj(this,this),this.check()}invert(){return cj(this,this),this.check()}multiplyLeft(r){return Vv(this,r,this),this.check()}multiplyRight(r){return Vv(this,this,r),this.check()}rotateX(r){return hj(this,this,r),this.check()}rotateY(r){return mj(this,this,r),this.check()}rotateZ(r){return gj(this,this,r),this.check()}rotateXYZ(r){return this.rotateX(r[0]).rotateY(r[1]).rotateZ(r[2])}rotateAxis(r,t){return dj(this,this,r,t),this.check()}scale(r){return pj(this,this,Array.isArray(r)?r:[r,r,r]),this.check()}translate(r){return fj(this,this,r),this.check()}transform(r,t){return r.length===4?(t=_j(t||[-0,-0,-0,-0],r,this),Kp(t,4),t):this.transformAsPoint(r,t)}transformAsPoint(r,t){let{length:i}=r,a;switch(i){case 2:a=Q4(t||[-0,-0],r,this);break;case 3:a=Xc(t||[-0,-0,-0],r,this);break;default:throw new Error("Illegal vector")}return Kp(a,r.length),a}transformAsVector(r,t){let i;switch(r.length){case 2:i=Z4(t||[-0,-0],r,this);break;case 3:i=Xp(t||[-0,-0,-0],r,this);break;default:throw new Error("Illegal vector")}return Kp(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])}},Jp,ed;function eW(){return Jp||(Jp=new vi([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Jp)),Jp}function rW(){return ed||(ed=new vi,Object.freeze(ed)),ed}function kj(e){if(e>Math.PI*2)throw Error("expected radians")}function tW(e,r,t,i,a,n){let o=2*n/(t-r),s=2*n/(a-i),u=(t+r)/(t-r),l=(a+i)/(a-i),f=-1,h=-1,d=-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]=u,e[9]=l,e[10]=f,e[11]=h,e[12]=0,e[13]=0,e[14]=d,e[15]=0,e}var us={};Au(us,{EPSILON1:()=>aW,EPSILON10:()=>pW,EPSILON11:()=>dW,EPSILON12:()=>hW,EPSILON13:()=>mW,EPSILON14:()=>gW,EPSILON15:()=>vW,EPSILON16:()=>bW,EPSILON17:()=>yW,EPSILON18:()=>xW,EPSILON19:()=>wW,EPSILON2:()=>iW,EPSILON20:()=>_W,EPSILON3:()=>nW,EPSILON4:()=>oW,EPSILON5:()=>sW,EPSILON6:()=>uW,EPSILON7:()=>cW,EPSILON8:()=>lW,EPSILON9:()=>fW,PI_OVER_FOUR:()=>SW,PI_OVER_SIX:()=>EW,PI_OVER_TWO:()=>kW,TWO_PI:()=>jW});var aW=.1,iW=.01,nW=.001,oW=1e-4,sW=1e-5,uW=1e-6,cW=1e-7,lW=1e-8,fW=1e-9,pW=1e-10,dW=1e-11,hW=1e-12,mW=1e-13,gW=1e-14,vW=1e-15,bW=1e-16,yW=1e-17,xW=1e-18,wW=1e-19,_W=1e-20,kW=Math.PI/2,SW=Math.PI/4,EW=Math.PI/6,jW=Math.PI*2;var Hn=6356752314245179e-9,AW={radii:[6378137,6378137,Hn],radiiSquared:[6378137*6378137,6378137*6378137,Hn*Hn],oneOverRadii:[1/6378137,1/6378137,1/Hn],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Hn*Hn)],maximumRadius:Math.max(6378137,6378137,Hn),centerToleranceSquared:.1};function rd(e){return e}var Rne=new Ir;function TW(e,r=[],t=rd){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 Sj(e,r=[]){return TW(e,r,Bt._cartographicRadians?rd:Bv)}function PW(e,r,t=rd){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 Ej(e,r){return PW(e,r,Bt._cartographicRadians?rd:Fv)}var jj=1e-14,RW=new Ir,Aj={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"}},Xv={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Zc={east:new Ir,north:new Ir,up:new Ir,west:new Ir,south:new Ir,down:new Ir},CW=new Ir,OW=new Ir,IW=new Ir;function Qv(e,r,t,i,a,n){let o=Aj[r]&&Aj[r][t];gi(o&&(!i||i===o));let s,u,l,f=RW.copy(a);if(Nn(f.x,0,jj)&&Nn(f.y,0,jj)){let d=Math.sign(f.z);s=CW.fromArray(Xv[r]),r!=="east"&&r!=="west"&&s.scale(d),u=OW.fromArray(Xv[t]),t!=="east"&&t!=="west"&&u.scale(d),l=IW.fromArray(Xv[i]),i!=="east"&&i!=="west"&&l.scale(d)}else{let{up:d,east:m,north:y}=Zc;m.set(-f.y,f.x,0).normalize(),e.geodeticSurfaceNormal(f,d),y.copy(d).cross(m);let{down:k,west:x,south:A}=Zc;k.copy(d).scale(-1),x.copy(m).scale(-1),A.copy(y).scale(-1),s=Zc[r],u=Zc[t],l=Zc[i]}return n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=u.x,n[5]=u.y,n[6]=u.z,n[7]=0,n[8]=l.x,n[9]=l.y,n[10]=l.z,n[11]=0,n[12]=f.x,n[13]=f.y,n[14]=f.z,n[15]=1,n}var gu=new Ir,BW=new Ir,FW=new Ir;function Tj(e,r,t=[]){let{oneOverRadii:i,oneOverRadiiSquared:a,centerToleranceSquared:n}=r;gu.from(e);let o=gu.x,s=gu.y,u=gu.z,l=i.x,f=i.y,h=i.z,d=o*o*l*l,m=s*s*f*f,y=u*u*h*h,k=d+m+y,x=Math.sqrt(1/k);if(!Number.isFinite(x))return;let A=BW;if(A.copy(e).scale(x),k<n)return A.to(t);let P=a.x,T=a.y,B=a.z,C=FW;C.set(A.x*P*2,A.y*T*2,A.z*B*2);let I=(1-x)*gu.len()/(.5*C.len()),F=0,H,N,K,V;do{I-=F,H=1/(1+I*P),N=1/(1+I*T),K=1/(1+I*B);let X=H*H,U=N*N,$=K*K,Z=X*H,le=U*N,ve=$*K;V=d*X+m*U+y*$-1;let we=-2*(d*Z*P+m*le*T+y*ve*B);F=V/we}while(Math.abs(V)>us.EPSILON12);return gu.scale([H,N,K]).to(t)}var td=new Ir,Pj=new Ir,qW=new Ir,Gi=new Ir,MW=new Ir,ad=new Ir,Gn=class{constructor(r=0,t=0,i=0){ht(this,"radii",void 0),ht(this,"radiiSquared",void 0),ht(this,"radiiToTheFourth",void 0),ht(this,"oneOverRadii",void 0),ht(this,"oneOverRadiiSquared",void 0),ht(this,"minimumRadius",void 0),ht(this,"maximumRadius",void 0),ht(this,"centerToleranceSquared",us.EPSILON1),ht(this,"squaredXOverSquaredZ",void 0),gi(r>=0),gi(t>=0),gi(i>=0),this.radii=new Ir(r,t,i),this.radiiSquared=new Ir(r*r,t*t,i*i),this.radiiToTheFourth=new Ir(r*r*r*r,t*t*t*t,i*i*i*i),this.oneOverRadii=new Ir(r===0?0:1/r,t===0?0:1/t,i===0?0:1/i),this.oneOverRadiiSquared=new Ir(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=Pj,a=qW,[,,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]){ad.from(r);let i=this.scaleToGeodeticSurface(ad,Gi);if(!i)return;let a=this.geodeticSurfaceNormal(i,Pj),n=MW;n.copy(ad).subtract(i);let o=Math.atan2(a.y,a.x),s=Math.asin(a.z),u=Math.sign(Qc.dot(n,ad))*Qc.length(n);return Ej([o,s,u],t)}eastNorthUpToFixedFrame(r,t=new vi){return Qv(this,"east","north","up",r,t)}localFrameToFixedFrame(r,t,i,a,n=new vi){return Qv(this,r,t,i,a,n)}geocentricSurfaceNormal(r,t=[0,0,0]){return td.from(r).normalize().to(t)}geodeticSurfaceNormalCartographic(r,t=[0,0,0]){let i=Sj(r),a=i[0],n=i[1],o=Math.cos(n);return td.set(o*Math.cos(a),o*Math.sin(a),Math.sin(n)).normalize(),td.to(t)}geodeticSurfaceNormal(r,t=[0,0,0]){return td.from(r).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(r,t){return Tj(r,this,t)}scaleToGeocentricSurface(r,t=[0,0,0]){Gi.from(r);let i=Gi.x,a=Gi.y,n=Gi.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(i*i*o.x+a*a*o.y+n*n*o.z);return Gi.multiplyScalar(s).to(t)}transformPositionToScaledSpace(r,t=[0,0,0]){return Gi.from(r).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(r,t=[0,0,0]){return Gi.from(r).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(r,t=0,i=[0,0,0]){gi(Nn(this.radii.x,this.radii.y,us.EPSILON15)),gi(this.radii.z>0),Gi.from(r);let a=Gi.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(a)>=this.radii.z-t))return Gi.set(0,0,a).to(i)}};ht(Gn,"WGS84",new Gn(6378137,6378137,Hn));var Rj="4.0.3";var Cj,zW=(Cj=globalThis.loaders)==null?void 0:Cj.parseImageNode,Zv=typeof Image<"u",Jv=typeof ImageBitmap<"u",NW=Boolean(zW),e1=Qo?!0:NW;function Oj(e){switch(e){case"auto":return Jv||Zv||e1;case"imagebitmap":return Jv;case"image":return Zv;case"data":return e1;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function Ij(){if(Jv)return"imagebitmap";if(Zv)return"image";if(e1)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function UW(e){let r=HW(e);if(!r)throw new Error("Not an image");return r}function Bj(e){switch(UW(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 HW(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 GW=/^data:image\/svg\+xml/,WW=/\.svg((\?|#).*)?$/;function id(e){return e&&(GW.test(e)||WW.test(e))}function Fj(e,r){if(id(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 r1(e,r)}function r1(e,r){if(id(r))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function nd(e,r,t){let i=Fj(e,t),a=self.URL||self.webkitURL,n=typeof i!="string"&&a.createObjectURL(i);try{return await VW(n||i,r)}finally{n&&a.revokeObjectURL(n)}}async function VW(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 $W={},Dj=!0;async function Lj(e,r,t){let i;id(t)?i=await nd(e,r,t):i=r1(e,t);let a=r&&r.imagebitmap;return await KW(i,a)}async function KW(e,r=null){if((YW(r)||!Dj)&&(r=null),r)try{return await createImageBitmap(e,r)}catch(t){console.warn(t),Dj=!1}return await createImageBitmap(e)}function YW(e){for(let r in e||$W)return!1;return!0}function qj(e){return!JW(e,"ftyp",4)||!(e[8]&96)?null:XW(e)}function XW(e){switch(QW(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function QW(e,r,t){return String.fromCharCode(...e.slice(r,t))}function ZW(e){return[...e].map(r=>r.charCodeAt(0))}function JW(e,r,t=0){let i=ZW(r);for(let a=0;a<i.length;++a)if(i[a]!==e[a+t])return!1;return!0}var bn=!1,Jc=!0;function od(e){let r=el(e);return rV(r)||iV(r)||tV(r)||aV(r)||eV(r)}function eV(e){let r=new Uint8Array(e instanceof DataView?e.buffer:e),t=qj(r);return t?{mimeType:t.mimeType,width:0,height:0}:null}function rV(e){let r=el(e);return r.byteLength>=24&&r.getUint32(0,bn)===2303741511?{mimeType:"image/png",width:r.getUint32(16,bn),height:r.getUint32(20,bn)}:null}function tV(e){let r=el(e);return r.byteLength>=10&&r.getUint32(0,bn)===1195984440?{mimeType:"image/gif",width:r.getUint16(6,Jc),height:r.getUint16(8,Jc)}:null}function aV(e){let r=el(e);return r.byteLength>=14&&r.getUint16(0,bn)===16973&&r.getUint32(2,Jc)===r.byteLength?{mimeType:"image/bmp",width:r.getUint32(18,Jc),height:r.getUint32(22,Jc)}:null}function iV(e){let r=el(e);if(!(r.byteLength>=3&&r.getUint16(0,bn)===65496&&r.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:a}=nV(),n=2;for(;n+9<r.byteLength;){let o=r.getUint16(n,bn);if(a.has(o))return{mimeType:"image/jpeg",height:r.getUint16(n+5,bn),width:r.getUint16(n+7,bn)};if(!i.has(o))return null;n+=2,n+=r.getUint16(n,bn)}return null}function nV(){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 el(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 Mj(e,r){var a;let{mimeType:t}=od(e)||{},i=(a=globalThis.loaders)==null?void 0:a.parseImageNode;return zi(i),await i(e,t)}async function zj(e,r,t){r=r||{};let a=(r.image||{}).type||"auto",{url:n}=t||{},o=oV(a),s;switch(o){case"imagebitmap":s=await Lj(e,r,n);break;case"image":s=await nd(e,r,n);break;case"data":s=await Mj(e,r);break;default:zi(!1)}return a==="data"&&(s=Bj(s)),s}function oV(e){switch(e){case"auto":case"data":return Ij();default:return Oj(e),e}}var sV=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],uV=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],cV={image:{type:"auto",decode:!0}},sd={id:"image",module:"images",name:"Images",version:Rj,mimeTypes:uV,extensions:sV,parse:zj,tests:[e=>Boolean(od(new DataView(e)))],options:cV};var Nj="4.0.3";var lV={draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},Uj={name:"Draco",id:"draco",module:"draco",version:Nj,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:lV};function Gj(e,r,t){let i=Wj(r.metadata),a=[],n=fV(r.attributes);for(let o in e){let s=e[o],u=Hj(o,s,n[o]);a.push(u)}if(t){let o=Hj("indices",t);a.push(o)}return{fields:a,metadata:i}}function fV(e){let r={};for(let t in e){let i=e[t];r[i.name||"undefined"]=i}return r}function Hj(e,r,t){let i=t?Wj(t.metadata):void 0;return Cv(e,r,i)}function Wj(e){Object.entries(e);let r={};for(let t in e)r[`${t}.string`]=JSON.stringify(e[t]);return r}var Vj={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},pV={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},dV=4,rl=class{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 d=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(d)}let s=this._getDracoLoaderData(n,a,t),u=this._getMeshData(n,s,t),l=Rv(u.attributes),f=Gj(u.attributes,s,u.indices);return{loader:"draco",loaderData:s,header:{vertexCount:n.num_points(),boundingBox:l},...u,schema:f}}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 u=this._getOctahedronTransform(n,t);u&&(i[n.unique_id()].octahedron_transform=u)}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{value:s,size:u}=this._getAttributeValues(t,n);a[o]={value:s,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*dV,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),gV(t)}finally{this.draco.destroy(t)}}_getAttributeValues(r,t){let i=pV[t.data_type],a=t.num_components,o=r.num_points()*a,s=o*i.BYTES_PER_ELEMENT,u=hV(this.draco,i),l,f=this.draco._malloc(s);try{let h=this.decoder.GetAttribute(r,t.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(r,h,u,s,f),l=new i(this.draco.HEAPF32.buffer,f,o).slice()}finally{this.draco._free(f)}return{value:l,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 Vj)if(this.draco[o]===a)return Vj[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=mV(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 hV(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 mV(e){let r=e.size(),t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=e.GetValue(i);return t}function gV(e){let r=e.size(),t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=e.GetValue(i);return t}var vV="1.5.6",bV="1.4.1",t1=`https://www.gstatic.com/draco/versioned/decoders/${vV}`,Ha={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},a1={[Ha.DECODER]:`${t1}/${Ha.DECODER}`,[Ha.DECODER_WASM]:`${t1}/${Ha.DECODER_WASM}`,[Ha.FALLBACK_DECODER]:`${t1}/${Ha.FALLBACK_DECODER}`,[Ha.ENCODER]:`https://raw.githubusercontent.com/google/draco/${bV}/javascript/${Ha.ENCODER}`},tl;async function $j(e){let r=e.modules||{};return r.draco3d?tl=tl||r.draco3d.createDecoderModule({}).then(t=>({draco:t})):tl=tl||yV(e),await tl}async function yV(e){let r,t;switch(e.draco&&e.draco.decoderType){case"js":r=await gn(a1[Ha.FALLBACK_DECODER],"draco",e,Ha.FALLBACK_DECODER);break;case"wasm":default:[r,t]=await Promise.all([await gn(a1[Ha.DECODER],"draco",e,Ha.DECODER),await gn(a1[Ha.DECODER_WASM],"draco",e,Ha.DECODER_WASM)])}return r=r||globalThis.DracoDecoderModule,await xV(r,t)}function xV(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e({...t,onModuleLoaded:a=>i({draco:a})})})}var Kj={...Uj,parse:wV};async function wV(e,r){let{draco:t}=await $j(r),i=new rl(t);try{return i.parseSync(e,r==null?void 0:r.draco)}finally{i.destroy()}}var ud="4.0.3";var cd={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},i1;async function o1(e){let r=e.modules||{};return r.basis?r.basis:(i1=i1||_V(e),await i1)}async function _V(e){let r=null,t=null;return[r,t]=await Promise.all([await gn(cd.TRANSCODER,"textures",e),await gn(cd.TRANSCODER_WASM,"textures",e)]),r=r||globalThis.BASIS,await kV(r,t)}function kV(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 n1;async function s1(e){let r=e.modules||{};return r.basisEncoder?r.basisEncoder:(n1=n1||SV(e),await n1)}async function SV(e){let r=null,t=null;return[r,t]=await Promise.all([await gn(cd.ENCODER,"textures",e),await gn(cd.ENCODER_WASM,"textures",e)]),r=r||globalThis.BASIS,await EV(r,t)}function EV(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e(t).then(a=>{let{BasisFile:n,KTX2File:o,initializeBasis:s,BasisEncoder:u}=a;s(),i({BasisFile:n,KTX2File:o,BasisEncoder:u})})})}var ce={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 jV=["","WEBKIT_","MOZ_"],Yj={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"},ld=null;function Xj(e){if(!ld){e=e||AV()||void 0,ld=new Set;for(let r of jV)for(let t in Yj)if(e&&e.getExtension(`${r}${t}`)){let i=Yj[t];ld.add(i)}}return ld}function AV(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var uA=Pt(oA(),1);function vu(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=RV(r,i,a,e,o),u=PV(e,o,n,s);t[o]={compressed:!0,format:r.internalFormat,data:u,width:i,height:a,levelSize:s},i=Math.max(1,i>>1),a=Math.max(1,a>>1),n+=s}return t}function PV(e,r,t,i){return Array.isArray(e)?e[r].levelData:new Uint8Array(e.buffer,e.byteOffset+t,i)}function RV(e,r,t,i,a){return Array.isArray(i)?e.sizeFunction(i[a]):e.sizeFunction(r,t)}var CV={131:ce.COMPRESSED_RGB_S3TC_DXT1_EXT,132:ce.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:ce.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:ce.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:ce.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:ce.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:ce.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:ce.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:ce.COMPRESSED_RED_RGTC1_EXT,140:ce.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:ce.COMPRESSED_RED_GREEN_RGTC2_EXT,142:ce.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:ce.COMPRESSED_RGB8_ETC2,148:ce.COMPRESSED_SRGB8_ETC2,149:ce.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:ce.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:ce.COMPRESSED_RGBA8_ETC2_EAC,152:ce.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:ce.COMPRESSED_R11_EAC,154:ce.COMPRESSED_SIGNED_R11_EAC,155:ce.COMPRESSED_RG11_EAC,156:ce.COMPRESSED_SIGNED_RG11_EAC,157:ce.COMPRESSED_RGBA_ASTC_4x4_KHR,158:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:ce.COMPRESSED_RGBA_ASTC_5x4_KHR,160:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:ce.COMPRESSED_RGBA_ASTC_5x5_KHR,162:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:ce.COMPRESSED_RGBA_ASTC_6x5_KHR,164:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:ce.COMPRESSED_RGBA_ASTC_6x6_KHR,166:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:ce.COMPRESSED_RGBA_ASTC_8x5_KHR,168:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:ce.COMPRESSED_RGBA_ASTC_8x6_KHR,170:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:ce.COMPRESSED_RGBA_ASTC_8x8_KHR,172:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:ce.COMPRESSED_RGBA_ASTC_10x5_KHR,174:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:ce.COMPRESSED_RGBA_ASTC_10x6_KHR,176:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:ce.COMPRESSED_RGBA_ASTC_10x8_KHR,178:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:ce.COMPRESSED_RGBA_ASTC_10x10_KHR,180:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:ce.COMPRESSED_RGBA_ASTC_12x10_KHR,182:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:ce.COMPRESSED_RGBA_ASTC_12x12_KHR,184:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:ce.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:ce.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:ce.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:ce.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:ce.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:ce.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:ce.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:ce.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:ce.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:ce.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:ce.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:ce.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:ce.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:ce.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:ce.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:ce.COMPRESSED_RGBA_ASTC_12x12_KHR};function sA(e){return CV[e]}var Ja=[171,75,84,88,32,50,48,187,13,10,26,10];function md(e){let r=new Uint8Array(e);return!(r.byteLength<Ja.length||r[0]!==Ja[0]||r[1]!==Ja[1]||r[2]!==Ja[2]||r[3]!==Ja[3]||r[4]!==Ja[4]||r[5]!==Ja[5]||r[6]!==Ja[6]||r[7]!==Ja[7]||r[8]!==Ja[8]||r[9]!==Ja[9]||r[10]!==Ja[10]||r[11]!==Ja[11])}function cA(e){let r=new Uint8Array(e),t=(0,uA.read)(r),i=Math.max(1,t.levels.length),a=t.pixelWidth,n=t.pixelHeight,o=sA(t.vkFormat);return vu(t.levels,{mipMapLevels:i,width:a,height:n,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var OV={etc1:{basisFormat:0,compressed:!0,format:ce.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:ce.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:ce.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:ce.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:ce.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:ce.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 il(e,r){if(r.basis.containerFormat==="auto"){if(md(e)){let i=await s1(r);return lA(i.KTX2File,e,r)}let{BasisFile:t}=await o1(r);return p1(t,e,r)}switch(r.basis.module){case"encoder":let t=await s1(r);switch(r.basis.containerFormat){case"ktx2":return lA(t.KTX2File,e,r);case"basis":default:return p1(t.BasisFile,e,r)}case"transcoder":default:let{BasisFile:i}=await o1(r);return p1(i,e,r)}}function p1(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),u=[];for(let l=0;l<s;l++)u.push(IV(i,o,l,t));n.push(u)}return n}finally{i.close(),i.delete()}}function IV(e,r,t,i){let a=e.getImageWidth(r,t),n=e.getImageHeight(r,t),o=e.getHasAlpha(),{compressed:s,format:u,basisFormat:l}=fA(i,o),f=e.getImageTranscodedSizeInBytes(r,t,l),h=new Uint8Array(f);if(!e.transcodeImage(h,r,t,l,0,0))throw new Error("failed to start Basis transcoding");return{width:a,height:n,data:h,compressed:s,format:u,hasAlpha:o}}function lA(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(BV(i,o,t));break}return[n]}finally{i.close(),i.delete()}}function BV(e,r,t){let{alphaFlag:i,height:a,width:n}=e.getImageLevelInfo(r,0,0),{compressed:o,format:s,basisFormat:u}=fA(t,i),l=e.getImageTranscodedSizeInBytes(r,0,0,u),f=new Uint8Array(l);if(!e.transcodeImage(f,r,0,0,u,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:n,height:a,data:f,compressed:o,levelSize:l,hasAlpha:i,format:s}}function fA(e,r){let t=e&&e.basis&&e.basis.format;return t==="auto"&&(t=FV()),typeof t=="object"&&(t=r?t.alpha:t.noAlpha),t=t.toLowerCase(),OV[t]}function FV(){let e=Xj();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 pA={name:"Basis",id:"basis",module:"textures",version:ud,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"}}},nl={...pA,parse:il};var ei={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},DV={DXT1:ce.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:ce.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:ce.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":ce.COMPRESSED_RGB_ATC_WEBGL,ATCA:ce.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:ce.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},LV=mA,qV=gd,MV=gd,zV={DXT1:mA,DXT3:gd,DXT5:gd,"ATC ":LV,ATCA:qV,ATCI:MV};function dA(e){return new Uint32Array(e,0,ei.HEADER_LENGTH)[ei.MAGIC_NUMBER_INDEX]===ei.MAGIC_NUMBER}function hA(e){let r=new Int32Array(e,0,ei.HEADER_LENGTH),t=r[ei.HEADER_PF_FOURCC_INDEX];zi(Boolean(r[ei.HEADER_PF_FLAGS_INDEX]&ei.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let i=NV(t),a=DV[i],n=zV[i];zi(a&&n,`DDS: Unknown pixel format ${t}`);let o=1;r[ei.HEADER_FLAGS_INDEX]&ei.DDSD_MIPMAPCOUNT&&(o=Math.max(1,r[ei.MIPMAPCOUNT_INDEX]));let s=r[ei.HEADER_WIDTH_INDEX],u=r[ei.HEADER_HEIGHT_INDEX],l=r[ei.HEADER_SIZE_INDEX]+4,f=new Uint8Array(e,l);return vu(f,{mipMapLevels:o,width:s,height:u,sizeFunction:n,internalFormat:a})}function mA(e,r){return(e+3>>2)*(r+3>>2)*8}function gd(e,r){return(e+3>>2)*(r+3>>2)*16}function NV(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var bi={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},UV={0:[ce.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[ce.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[ce.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[ce.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[ce.COMPRESSED_RGB_ETC1_WEBGL],7:[ce.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[ce.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[ce.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[ce.COMPRESSED_RGB8_ETC2],23:[ce.COMPRESSED_RGBA8_ETC2_EAC],24:[ce.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[ce.COMPRESSED_R11_EAC],26:[ce.COMPRESSED_RG11_EAC],27:[ce.COMPRESSED_RGBA_ASTC_4X4_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[ce.COMPRESSED_RGBA_ASTC_5X4_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[ce.COMPRESSED_RGBA_ASTC_5X5_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[ce.COMPRESSED_RGBA_ASTC_6X5_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[ce.COMPRESSED_RGBA_ASTC_6X6_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[ce.COMPRESSED_RGBA_ASTC_8X5_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[ce.COMPRESSED_RGBA_ASTC_8X6_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[ce.COMPRESSED_RGBA_ASTC_8X8_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[ce.COMPRESSED_RGBA_ASTC_10X5_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[ce.COMPRESSED_RGBA_ASTC_10X6_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[ce.COMPRESSED_RGBA_ASTC_10X8_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[ce.COMPRESSED_RGBA_ASTC_10X10_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[ce.COMPRESSED_RGBA_ASTC_12X10_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[ce.COMPRESSED_RGBA_ASTC_12X12_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},HV={0:gA,1:gA,2:vA,3:vA,6:ol,7:ol,9:sl,11:sl,22:ol,23:sl,24:ol,25:ol,26:sl,27:sl,28:GV,29:WV,30:VV,31:$V,32:KV,33:YV,34:XV,35:QV,36:ZV,37:JV,38:e$,39:r$,40:t$};function bA(e){let t=new Uint32Array(e,0,bi.HEADER_LENGTH)[bi.MAGIC_NUMBER_INDEX];return t===bi.MAGIC_NUMBER||t===bi.MAGIC_NUMBER_EXTRA}function yA(e){let r=new Uint32Array(e,0,bi.HEADER_LENGTH),t=r[bi.PIXEL_FORMAT_INDEX],i=r[bi.COLOUR_SPACE_INDEX],a=UV[t]||[],n=a.length>1&&i?a[1]:a[0],o=HV[t],s=r[bi.MIPMAPCOUNT_INDEX],u=r[bi.WIDTH_INDEX],l=r[bi.HEIGHT_INDEX],f=bi.HEADER_SIZE+r[bi.METADATA_SIZE_INDEX],h=new Uint8Array(e,f);return vu(h,{mipMapLevels:s,width:u,height:l,sizeFunction:o,internalFormat:n})}function gA(e,r){return e=Math.max(e,16),r=Math.max(r,8),e*r/4}function vA(e,r){return e=Math.max(e,8),r=Math.max(r,8),e*r/2}function ol(e,r){return Math.floor((e+3)/4)*Math.floor((r+3)/4)*8}function sl(e,r){return Math.floor((e+3)/4)*Math.floor((r+3)/4)*16}function GV(e,r){return Math.floor((e+4)/5)*Math.floor((r+3)/4)*16}function WV(e,r){return Math.floor((e+4)/5)*Math.floor((r+4)/5)*16}function VV(e,r){return Math.floor((e+5)/6)*Math.floor((r+4)/5)*16}function $V(e,r){return Math.floor((e+5)/6)*Math.floor((r+5)/6)*16}function KV(e,r){return Math.floor((e+7)/8)*Math.floor((r+4)/5)*16}function YV(e,r){return Math.floor((e+7)/8)*Math.floor((r+5)/6)*16}function XV(e,r){return Math.floor((e+7)/8)*Math.floor((r+7)/8)*16}function QV(e,r){return Math.floor((e+9)/10)*Math.floor((r+4)/5)*16}function ZV(e,r){return Math.floor((e+9)/10)*Math.floor((r+5)/6)*16}function JV(e,r){return Math.floor((e+9)/10)*Math.floor((r+7)/8)*16}function e$(e,r){return Math.floor((e+9)/10)*Math.floor((r+9)/10)*16}function r$(e,r){return Math.floor((e+11)/12)*Math.floor((r+9)/10)*16}function t$(e,r){return Math.floor((e+11)/12)*Math.floor((r+11)/12)*16}function xA(e){if(md(e))return cA(e);if(dA(e))return hA(e);if(bA(e))return yA(e);throw new Error("Texture container format not recognized")}var wA={name:"Texture Containers",id:"compressed-texture",module:"textures",version:ud,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}}},vd={...wA,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 il(e,r))[0]):xA(e)}};function _A(e,r=null){return r?`${e}?token=${r}`:e}var a$={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},i$={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},cs={...a$,...i$};function d1(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 kA={UInt8:cs.UNSIGNED_BYTE,UInt16:cs.UNSIGNED_SHORT,Float32:cs.FLOAT,UInt32:cs.UNSIGNED_INT,UInt64:cs.DOUBLE};function bu(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 bd=new Ir([0,0,0]);function n$(e){switch(e){case"ktx-etc2":case"dds":return vd;case"ktx2":return nl;case"jpg":case"png":default:return sd}}var o$="i3s-attribute-type";async function AA(e,r,t,i,a){var o;let n={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new vi,coordinateSystem:0,byteLength:0,texture:null};if(r.textureUrl){let s=_A(r.textureUrl,(o=i==null?void 0:i.i3s)==null?void 0:o.token),u=n$(r.textureFormat),h=await(await((a==null?void 0:a.fetch)||fetch)(s)).arrayBuffer();if(i!=null&&i.i3s.decodeTextures){if(u===sd){let d={...r.textureLoaderOptions,image:{type:"data"}};try{let m=await Hg(h,[],d,a);n.texture=m}catch{let y=await zn(h,u,d,a);n.texture=y}}else if(u===vd||u===nl){let d=await Ov(h,u,r.textureLoaderOptions);u===nl&&(d=d[0]),n.texture={compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d}}}else n.texture=h}return n.material=m$(r.materialDefinition,n.texture),n.material&&(n.texture=null),await s$(e,n,r,t,i)}async function s$(e,r,t,i,a){var h,d;let n=e.byteLength,o,s,u=0,l=0,f;if(t.isDracoGeometry){let m=await zn(e,Kj,{draco:{attributeNameEntry:o$}});s=m.header.vertexCount,f=(h=m.indices)==null?void 0:h.value;let{POSITION:y,NORMAL:k,COLOR_0:x,TEXCOORD_0:A,["feature-index"]:P,["uv-region"]:T}=m.attributes;o={position:y,normal:k,color:x,uv0:A,uvRegion:T,id:P},u$(o,m);let B=y$(P);B&&b$(o,B)}else{let{vertexAttributes:m,ordering:y,featureAttributes:k,featureAttributeOrder:x}=i.store.defaultGeometrySchema,A=l$(e,i);u=A.byteOffset,s=A.vertexCount,l=A.featureCount;let{attributes:P,byteOffset:T}=EA(e,u,m,s,y),{attributes:B}=EA(e,T,k,l,x);v$(B),o=c$(P,B)}if(!((d=a==null?void 0:a.i3s)!=null&&d.coordinateSystem)||a.i3s.coordinateSystem===2){let m=p$(o.position,t);r.modelMatrix=m.invert(),r.coordinateSystem=2}else r.modelMatrix=h$(o.position),r.coordinateSystem=3;r.attributes={positions:o.position,normals:o.normal,colors:SA(o.color),texCoords:o.uv0,uvRegions:SA(o.uvRegion||o.region)},r.indices=f||null,o.id&&o.id.value&&(r.featureIds=o.id.value);for(let m in r.attributes)r.attributes[m]||delete r.attributes[m];return r.vertexCount=s,r.byteLength=n,r}function u$(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 c$(e,r){return{...e,...r}}function SA(e){return e&&(e.normalized=!0,e)}function l$(e,r){let t=0,i=0,a=0;for(let{property:n,type:o}of r.store.defaultGeometrySchema.header){let s=d1(o);switch(n){case"vertexCount":i=new s(e,0,4)[0],t+=bu(o);break;case"featureCount":a=new s(e,4,4)[0],t+=bu(o);break;default:break}}return{vertexCount:i,featureCount:a,byteOffset:t}}function EA(e,r,t,i,a){let n={};for(let o of a)if(t[o]){let{valueType:s,valuesPerElement:u}=t[o];if(r+i*u*bu(s)<=e.byteLength){let l=e.slice(r),f;if(s==="UInt64")f=f$(l,i*u,bu(s));else{let h=d1(s);f=new h(l,0,i*u)}switch(n[o]={value:f,type:kA[s],size:u},o){case"color":n.color.normalized=!0;break;case"position":case"region":case"normal":default:}r=r+i*u*bu(s)}else if(o!=="uv0")break}return{attributes:n,byteOffset:r}}function f$(e,r,t){let i=[],a=new DataView(e),n=0;for(let o=0;o<r;o++){let s=a.getUint32(n,!0),u=a.getUint32(n+4,!0),l=s+2**32*u;i.push(l),n+=t}return new Uint32Array(i)}function p$(e,r){let t=r.mbs,i=e.value,a=e.metadata,n=new vi,o=new Ir(t[0],t[1],t[2]),s=new Ir;return Gn.WGS84.cartographicToCartesian(o,s),Gn.WGS84.eastNorthUpToFixedFrame(s,n),e.value=d$(i,a,o),n}function d$(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)Gn.WGS84.cartographicToCartesian(i.subarray(o,o+3),bd),i[o]=bd.x,i[o+1]=bd.y,i[o+2]=bd.z;return i}function h$(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 vi;return a[0]=t,a[5]=i,a}function m$(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=jA(t.emissiveFactor)),t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorFactor&&(t.pbrMetallicRoughness.baseColorFactor=jA(t.pbrMetallicRoughness.baseColorFactor)),r&&g$(t,r),t}function jA(e){let r=[...e];for(let t=0;t<e.length;t++)r[t]=e[t]/255;return r}function g$(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 v$(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,u=0;for(let l=1;l<a.length;l+=2){let f=Number(i[s]),h=a[l],d=a[l-1],m=h-d+1,y=u+m*3;o.fill(f,u,y),s++,u=y}e.id.value=o}function b$(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 y$(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 x$="4.0.3",TA={name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:x$,mimeTypes:["application/octet-stream"],parse:w$,extensions:["bin"],options:{"i3s-content":{}}};async function w$(e,r,t){let{tile:i,_tileOptions:a,tileset:n,_tilesetOptions:o}=(r==null?void 0:r.i3s)||{},s=a||i,u=o||n;return!s||!u?null:await AA(e,s,u,r,t)}Jg(TA);
101
101
  /*! Bundled license information:
102
102
 
103
103
  is-buffer/index.js: