@loaders.gl/tile-converter 4.0.0-beta.8 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/converter.min.cjs +2 -2
- package/package.json +14 -14
package/dist/converter.min.cjs
CHANGED
|
@@ -170,13 +170,13 @@ See: https://github.com/isaacs/node-glob/issues/167`);return new Gi(e,t).found}f
|
|
|
170
170
|
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof Gi))return new Gi(e,t);if(GLt(this,e,t),this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;n<r;n++)this._process(this.minimatch.set[n],n,!1);this._finish()}Gi.prototype._finish=function(){if(j3e.ok(this instanceof Gi),this.realpath){var e=this;this.matches.forEach(function(t,r){var n=e.matches[r]=Object.create(null);for(var i in t)try{i=e._makeAbs(i);var a=ULt.realpathSync(i,e.realpathCache);n[a]=!0}catch(o){if(o.syscall==="stat")n[e._makeAbs(i)]=!0;else throw o}})}o0.finish(this)};Gi.prototype._process=function(e,t,r){j3e.ok(this instanceof Gi);for(var n=0;typeof e[n]=="string";)n++;var i;switch(n){case e.length:this._processSimple(e.join("/"),t);return;case 0:i=null;break;default:i=e.slice(0,n).join("/");break}var a=e.slice(n),o;i===null?o=".":((I4(i)||I4(e.map(function(c){return typeof c=="string"?c:"[*]"}).join("/")))&&(!i||!I4(i))&&(i="/"+i),o=i);var s=this._makeAbs(o);if(!zLt(this,o)){var u=a[0]===R3e.GLOBSTAR;u?this._processGlobStar(i,o,s,a,t,r):this._processReaddir(i,o,s,a,t,r)}};Gi.prototype._processReaddir=function(e,t,r,n,i,a){var o=this._readdir(r,a);if(o){for(var s=n[0],u=!!this.minimatch.negate,c=s._glob,l=this.dot||c.charAt(0)===".",f=[],h=0;h<o.length;h++){var p=o[h];if(p.charAt(0)!=="."||l){var d;u&&!e?d=!p.match(s):d=p.match(s),d&&f.push(p)}}var b=f.length;if(b!==0){if(n.length===1&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(var h=0;h<b;h++){var p=f[h];e&&(e.slice(-1)!=="/"?p=e+"/"+p:p=e+p),p.charAt(0)==="/"&&!this.nomount&&(p=$G.join(this.root,p)),this._emitMatch(i,p)}return}n.shift();for(var h=0;h<b;h++){var p=f[h],g;e?g=[e,p]:g=[p],this._process(g.concat(n),i,a)}}}};Gi.prototype._emitMatch=function(e,t){if(!HLt(this,t)){var r=this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=r),!this.matches[e][t]){if(this.nodir){var n=this.cache[r];if(n==="DIR"||Array.isArray(n))return}this.matches[e][t]=!0,this.stat&&this._stat(t)}}};Gi.prototype._readdirInGlobStar=function(e){if(this.follow)return this._readdir(e,!1);var t,r,n;try{r=this.fs.lstatSync(e)}catch(a){if(a.code==="ENOENT")return null}var i=r&&r.isSymbolicLink();return this.symlinks[e]=i,!i&&r&&!r.isDirectory()?this.cache[e]="FILE":t=this._readdir(e,!1),t};Gi.prototype._readdir=function(e,t){var r;if(t&&!YG(this.symlinks,e))return this._readdirInGlobStar(e);if(YG(this.cache,e)){var n=this.cache[e];if(!n||n==="FILE")return null;if(Array.isArray(n))return n}try{return this._readdirEntries(e,this.fs.readdirSync(e))}catch(i){return this._readdirError(e,i),null}};Gi.prototype._readdirEntries=function(e,t){if(!this.mark&&!this.stat)for(var r=0;r<t.length;r++){var n=t[r];e==="/"?n=e+n:n=e+"/"+n,this.cache[n]=!0}return this.cache[e]=t,t};Gi.prototype._readdirError=function(e,t){switch(t.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(e);if(this.cache[r]="FILE",r===this.cwdAbs){var n=new Error(t.code+" invalid cwd "+this.cwd);throw n.path=this.cwd,n.code=t.code,n}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:if(this.cache[this._makeAbs(e)]=!1,this.strict)throw t;this.silent||console.error("glob error",t);break}};Gi.prototype._processGlobStar=function(e,t,r,n,i,a){var o=this._readdir(r,a);if(o){var s=n.slice(1),u=e?[e]:[],c=u.concat(s);this._process(c,i,!1);var l=o.length,f=this.symlinks[r];if(!(f&&a))for(var h=0;h<l;h++){var p=o[h];if(!(p.charAt(0)==="."&&!this.dot)){var d=u.concat(o[h],s);this._process(d,i,!0);var b=u.concat(o[h],n);this._process(b,i,!0)}}}};Gi.prototype._processSimple=function(e,t){var r=this._stat(e);if(this.matches[t]||(this.matches[t]=Object.create(null)),!!r){if(e&&I4(e)&&!this.nomount){var n=/[\/\\]$/.test(e);e.charAt(0)==="/"?e=$G.join(this.root,e):(e=$G.resolve(this.root,e),n&&(e+="/"))}process.platform==="win32"&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e)}};Gi.prototype._stat=function(e){var t=this._makeAbs(e),r=e.slice(-1)==="/";if(e.length>this.maxLength)return!1;if(!this.stat&&YG(this.cache,t)){var o=this.cache[t];if(Array.isArray(o)&&(o="DIR"),!r||o==="DIR")return o;if(r&&o==="FILE")return!1}var n,i=this.statCache[t];if(!i){var a;try{a=this.fs.lstatSync(t)}catch(s){if(s&&(s.code==="ENOENT"||s.code==="ENOTDIR"))return this.statCache[t]=!1,!1}if(a&&a.isSymbolicLink())try{i=this.fs.statSync(t)}catch{i=a}else i=a}this.statCache[t]=i;var o=!0;return i&&(o=i.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||o,r&&o==="FILE"?!1:o};Gi.prototype._mark=function(e){return o0.mark(this,e)};Gi.prototype._makeAbs=function(e){return o0.makeAbs(this,e)}});var XG=v((r3r,U3e)=>{U3e.exports=N3e;function N3e(e,t){if(e&&t)return N3e(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(n){r[n]=e[n]}),r;function r(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var a=e.apply(this,n),o=n[n.length-1];return typeof a=="function"&&a!==o&&Object.keys(o).forEach(function(s){a[s]=o[s]}),a}}});var R4=v((n3r,QG)=>{var G3e=XG();QG.exports=G3e(P4);QG.exports.strict=G3e(z3e);P4.proto=P4(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return P4(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return z3e(this)},configurable:!0})});function P4(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function z3e(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}});var W3e=v((i3r,H3e)=>{var WLt=XG(),d2=Object.create(null),VLt=R4();H3e.exports=WLt(KLt);function KLt(e,t){return d2[e]?(d2[e].push(t),null):(d2[e]=[t],$Lt(e))}function $Lt(e){return VLt(function t(){var r=d2[e],n=r.length,i=YLt(arguments);try{for(var a=0;a<n;a++)r[a].apply(null,i)}finally{r.length>n?(r.splice(0,n),process.nextTick(function(){t.apply(null,i)})):delete d2[e]}})}function YLt(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n]=e[n];return r}});var JG=v((s3r,K3e)=>{K3e.exports=s0;var JLt=NG(),V3e=k4(),a3r=V3e.Minimatch,XLt=tr(),QLt=require("events").EventEmitter,ZG=require("path"),ez=require("assert"),m2=O4(),rz=q3e(),u0=KG(),ZLt=u0.setopts,tz=u0.ownProp,nz=W3e(),o3r=require("util"),eMt=u0.childrenIgnored,tMt=u0.isIgnored,rMt=R4();function s0(e,t,r){if(typeof t=="function"&&(r=t,t={}),t||(t={}),t.sync){if(r)throw new TypeError("callback provided to sync glob");return rz(e,t)}return new on(e,t,r)}s0.sync=rz;var nMt=s0.GlobSync=rz.GlobSync;s0.glob=s0;function iMt(e,t){if(t===null||typeof t!="object")return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}s0.hasMagic=function(e,t){var r=iMt({},t);r.noprocess=!0;var n=new on(e,r),i=n.minimatch.set;if(!e)return!1;if(i.length>1)return!0;for(var a=0;a<i[0].length;a++)if(typeof i[0][a]!="string")return!0;return!1};s0.Glob=on;XLt(on,QLt);function on(e,t,r){if(typeof t=="function"&&(r=t,t=null),t&&t.sync){if(r)throw new TypeError("callback provided to sync glob");return new nMt(e,t)}if(!(this instanceof on))return new on(e,t,r);ZLt(this,e,t),this._didRealPath=!1;var n=this.minimatch.set.length;this.matches=new Array(n),typeof r=="function"&&(r=rMt(r),this.on("error",r),this.on("end",function(u){r(null,u)}));var i=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(n===0)return s();for(var a=!0,o=0;o<n;o++)this._process(this.minimatch.set[o],o,!1,s);a=!1;function s(){--i._processing,i._processing<=0&&(a?process.nextTick(function(){i._finish()}):i._finish())}}on.prototype._finish=function(){if(ez(this instanceof on),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();u0.finish(this),this.emit("end",this.found)}};on.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=!0;var e=this.matches.length;if(e===0)return this._finish();for(var t=this,r=0;r<this.matches.length;r++)this._realpathSet(r,n);function n(){--e===0&&t._finish()}};on.prototype._realpathSet=function(e,t){var r=this.matches[e];if(!r)return t();var n=Object.keys(r),i=this,a=n.length;if(a===0)return t();var o=this.matches[e]=Object.create(null);n.forEach(function(s,u){s=i._makeAbs(s),JLt.realpath(s,i.realpathCache,function(c,l){c?c.syscall==="stat"?o[s]=!0:i.emit("error",c):o[l]=!0,--a===0&&(i.matches[e]=o,t())})})};on.prototype._mark=function(e){return u0.mark(this,e)};on.prototype._makeAbs=function(e){return u0.makeAbs(this,e)};on.prototype.abort=function(){this.aborted=!0,this.emit("abort")};on.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))};on.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var e=this._emitQueue.slice(0);this._emitQueue.length=0;for(var t=0;t<e.length;t++){var r=e[t];this._emitMatch(r[0],r[1])}}if(this._processQueue.length){var n=this._processQueue.slice(0);this._processQueue.length=0;for(var t=0;t<n.length;t++){var i=n[t];this._processing--,this._process(i[0],i[1],i[2],i[3])}}}};on.prototype._process=function(e,t,r,n){if(ez(this instanceof on),ez(typeof n=="function"),!this.aborted){if(this._processing++,this.paused){this._processQueue.push([e,t,r,n]);return}for(var i=0;typeof e[i]=="string";)i++;var a;switch(i){case e.length:this._processSimple(e.join("/"),t,n);return;case 0:a=null;break;default:a=e.slice(0,i).join("/");break}var o=e.slice(i),s;a===null?s=".":((m2(a)||m2(e.map(function(l){return typeof l=="string"?l:"[*]"}).join("/")))&&(!a||!m2(a))&&(a="/"+a),s=a);var u=this._makeAbs(s);if(eMt(this,s))return n();var c=o[0]===V3e.GLOBSTAR;c?this._processGlobStar(a,s,u,o,t,r,n):this._processReaddir(a,s,u,o,t,r,n)}};on.prototype._processReaddir=function(e,t,r,n,i,a,o){var s=this;this._readdir(r,a,function(u,c){return s._processReaddir2(e,t,r,n,i,a,c,o)})};on.prototype._processReaddir2=function(e,t,r,n,i,a,o,s){if(!o)return s();for(var u=n[0],c=!!this.minimatch.negate,l=u._glob,f=this.dot||l.charAt(0)===".",h=[],p=0;p<o.length;p++){var d=o[p];if(d.charAt(0)!=="."||f){var b;c&&!e?b=!d.match(u):b=d.match(u),b&&h.push(d)}}var g=h.length;if(g===0)return s();if(n.length===1&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(var p=0;p<g;p++){var d=h[p];e&&(e!=="/"?d=e+"/"+d:d=e+d),d.charAt(0)==="/"&&!this.nomount&&(d=ZG.join(this.root,d)),this._emitMatch(i,d)}return s()}n.shift();for(var p=0;p<g;p++){var d=h[p],x;e&&(e!=="/"?d=e+"/"+d:d=e+d),this._process([d].concat(n),i,a,s)}s()};on.prototype._emitMatch=function(e,t){if(!this.aborted&&!tMt(this,t)){if(this.paused){this._emitQueue.push([e,t]);return}var r=m2(t)?t:this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=r),!this.matches[e][t]){if(this.nodir){var n=this.cache[r];if(n==="DIR"||Array.isArray(n))return}this.matches[e][t]=!0;var i=this.statCache[r];i&&this.emit("stat",t,i),this.emit("match",t)}}};on.prototype._readdirInGlobStar=function(e,t){if(this.aborted)return;if(this.follow)return this._readdir(e,!1,t);var r="lstat\0"+e,n=this,i=nz(r,a);i&&n.fs.lstat(e,i);function a(o,s){if(o&&o.code==="ENOENT")return t();var u=s&&s.isSymbolicLink();n.symlinks[e]=u,!u&&s&&!s.isDirectory()?(n.cache[e]="FILE",t()):n._readdir(e,!1,t)}};on.prototype._readdir=function(e,t,r){if(!this.aborted&&(r=nz("readdir\0"+e+"\0"+t,r),!!r)){if(t&&!tz(this.symlinks,e))return this._readdirInGlobStar(e,r);if(tz(this.cache,e)){var n=this.cache[e];if(!n||n==="FILE")return r();if(Array.isArray(n))return r(null,n)}var i=this;i.fs.readdir(e,aMt(this,e,r))}};function aMt(e,t,r){return function(n,i){n?e._readdirError(t,n,r):e._readdirEntries(t,i,r)}}on.prototype._readdirEntries=function(e,t,r){if(!this.aborted){if(!this.mark&&!this.stat)for(var n=0;n<t.length;n++){var i=t[n];e==="/"?i=e+i:i=e+"/"+i,this.cache[i]=!0}return this.cache[e]=t,r(null,t)}};on.prototype._readdirError=function(e,t,r){if(!this.aborted){switch(t.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(e);if(this.cache[n]="FILE",n===this.cwdAbs){var i=new Error(t.code+" invalid cwd "+this.cwd);i.path=this.cwd,i.code=t.code,this.emit("error",i),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:this.cache[this._makeAbs(e)]=!1,this.strict&&(this.emit("error",t),this.abort()),this.silent||console.error("glob error",t);break}return r()}};on.prototype._processGlobStar=function(e,t,r,n,i,a,o){var s=this;this._readdir(r,a,function(u,c){s._processGlobStar2(e,t,r,n,i,a,c,o)})};on.prototype._processGlobStar2=function(e,t,r,n,i,a,o,s){if(!o)return s();var u=n.slice(1),c=e?[e]:[],l=c.concat(u);this._process(l,i,!1,s);var f=this.symlinks[r],h=o.length;if(f&&a)return s();for(var p=0;p<h;p++){var d=o[p];if(!(d.charAt(0)==="."&&!this.dot)){var b=c.concat(o[p],u);this._process(b,i,!0,s);var g=c.concat(o[p],n);this._process(g,i,!0,s)}}s()};on.prototype._processSimple=function(e,t,r){var n=this;this._stat(e,function(i,a){n._processSimple2(e,t,i,a,r)})};on.prototype._processSimple2=function(e,t,r,n,i){if(this.matches[t]||(this.matches[t]=Object.create(null)),!n)return i();if(e&&m2(e)&&!this.nomount){var a=/[\/\\]$/.test(e);e.charAt(0)==="/"?e=ZG.join(this.root,e):(e=ZG.resolve(this.root,e),a&&(e+="/"))}process.platform==="win32"&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e),i()};on.prototype._stat=function(e,t){var r=this._makeAbs(e),n=e.slice(-1)==="/";if(e.length>this.maxLength)return t();if(!this.stat&&tz(this.cache,r)){var i=this.cache[r];if(Array.isArray(i)&&(i="DIR"),!n||i==="DIR")return t(null,i);if(n&&i==="FILE")return t()}var a,o=this.statCache[r];if(o!==void 0){if(o===!1)return t(null,o);var s=o.isDirectory()?"DIR":"FILE";return n&&s==="FILE"?t():t(null,s,o)}var u=this,c=nz("stat\0"+r,l);c&&u.fs.lstat(r,c);function l(f,h){if(h&&h.isSymbolicLink())return u.fs.stat(r,function(p,d){p?u._stat2(e,r,null,h,t):u._stat2(e,r,p,d,t)});u._stat2(e,r,f,h,t)}};on.prototype._stat2=function(e,t,r,n,i){if(r&&(r.code==="ENOENT"||r.code==="ENOTDIR"))return this.statCache[t]=!1,i();var a=e.slice(-1)==="/";if(this.statCache[t]=n,t.slice(-1)==="/"&&n&&!n.isDirectory())return i(null,!1,n);var o=!0;return n&&(o=n.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||o,a&&o==="FILE"?i():i(null,o,n)}});var X3e=v((u3r,J3e)=>{var Y3e=xG(),Sb=require("path"),iz=P6e(),oMt=V6e(),sMt=a3e(),uMt=c3e(),cMt=JG(),c0=J3e.exports={},$3e=/[\/\\]/g,lMt=function(e,t){var r=[];return iz(e).forEach(function(n){var i=n.indexOf("!")===0;i&&(n=n.slice(1));var a=t(n);i?r=oMt(r,a):r=sMt(r,a)}),r};c0.exists=function(){var e=Sb.join.apply(Sb,arguments);return Y3e.existsSync(e)};c0.expand=function(...e){var t=uMt(e[0])?e.shift():{},r=Array.isArray(e[0])?e[0]:e;if(r.length===0)return[];var n=lMt(r,function(i){return cMt.sync(i,t)});return t.filter&&(n=n.filter(function(i){i=Sb.join(t.cwd||"",i);try{return typeof t.filter=="function"?t.filter(i):Y3e.statSync(i)[t.filter]()}catch{return!1}})),n};c0.expandMapping=function(e,t,r){r=Object.assign({rename:function(a,o){return Sb.join(a||"",o)}},r);var n=[],i={};return c0.expand(r,e).forEach(function(a){var o=a;r.flatten&&(o=Sb.basename(o)),r.ext&&(o=o.replace(/(\.[^\/]*)?$/,r.ext));var s=r.rename(t,o,r);r.cwd&&(a=Sb.join(r.cwd,a)),s=s.replace($3e,"/"),a=a.replace($3e,"/"),i[s]?i[s].src.push(a):(n.push({src:[a],dest:s}),i[s]=n[n.length-1])}),n};c0.normalizeFilesArray=function(e){var t=[];return e.forEach(function(r){var n;("src"in r||"dest"in r)&&t.push(r)}),t.length===0?[]:(t=_(t).chain().forEach(function(r){!("src"in r)||!r.src||(Array.isArray(r.src)?r.src=iz(r.src):r.src=[r.src])}).map(function(r){var n=Object.assign({},r);if(delete n.src,delete n.dest,r.expand)return c0.expandMapping(r.src,r.dest,n).map(function(a){var o=Object.assign({},r);return o.orig=Object.assign({},r),o.src=a.src,o.dest=a.dest,["expand","cwd","flatten","rename","ext"].forEach(function(s){delete o[s]}),o});var i=Object.assign({},r);return i.orig=Object.assign({},r),"src"in i&&Object.defineProperty(i,"src",{enumerable:!0,get:function a(){var o;return"result"in a||(o=r.src,o=Array.isArray(o)?iz(o):[o],a.result=c0.expand(n,o)),a.result}}),"dest"in i&&(i.dest=r.dest),i}).flatten().value(),t)}});var Tb=v((l3r,eCe)=>{var az=xG(),Q3e=require("path"),c3r=require("util"),fMt=y6e(),Z3e=_G(),hMt=D6e(),pMt=require("stream").Stream,dMt=C_().PassThrough,qo=eCe.exports={};qo.file=X3e();qo.collectStream=function(e,t){var r=[],n=0;e.on("error",t),e.on("data",function(i){r.push(i),n+=i.length}),e.on("end",function(){var i=new Buffer(n),a=0;r.forEach(function(o){o.copy(i,a),a+=o.length}),t(null,i)})};qo.dateify=function(e){return e=e||new Date,e instanceof Date?e=e:typeof e=="string"?e=new Date(e):e=new Date,e};qo.defaults=function(e,t,r){var n=arguments;return n[0]=n[0]||{},hMt(...n)};qo.isStream=function(e){return e instanceof pMt};qo.lazyReadStream=function(e){return new fMt.Readable(function(){return az.createReadStream(e)})};qo.normalizeInputSource=function(e){if(e===null)return new Buffer(0);if(typeof e=="string")return new Buffer(e);if(qo.isStream(e)&&!e._readableState){var t=new dMt;return e.pipe(t),t}return e};qo.sanitizePath=function(e){return Z3e(e,!1).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"")};qo.trailingSlashIt=function(e){return e.slice(-1)!=="/"?e+"/":e};qo.unixifyPath=function(e){return Z3e(e,!1).replace(/^\w+:/,"")};qo.walkdir=function(e,t,r){var n=[];typeof t=="function"&&(r=t,t=e),az.readdir(e,function(i,a){var o=0,s,u;if(i)return r(i);(function c(){if(s=a[o++],!s)return r(null,n);u=Q3e.join(e,s),az.stat(u,function(l,f){n.push({path:u,relative:Q3e.relative(t,u).replace(/\\/g,"/"),stats:f}),f&&f.isDirectory()?qo.walkdir(u,t,function(h,p){p.forEach(function(d){n.push(d)}),c()}):c()})})()})}});var iCe=v((rCe,nCe)=>{var mMt=require("util"),gMt={ABORTED:"archive was aborted",DIRECTORYDIRPATHREQUIRED:"diretory dirpath argument must be a non-empty string value",DIRECTORYFUNCTIONINVALIDDATA:"invalid data returned by directory custom data function",ENTRYNAMEREQUIRED:"entry name must be a non-empty string value",FILEFILEPATHREQUIRED:"file filepath argument must be a non-empty string value",FINALIZING:"archive already finalizing",QUEUECLOSED:"queue closed",NOENDMETHOD:"no suitable finalize/end method defined by module",DIRECTORYNOTSUPPORTED:"support for directory entries not defined by module",FORMATSET:"archive format already set",INPUTSTEAMBUFFERREQUIRED:"input source must be valid Stream or Buffer instance",MODULESET:"module already set",SYMLINKNOTSUPPORTED:"support for symlink entries not defined by module",SYMLINKFILEPATHREQUIRED:"symlink filepath argument must be a non-empty string value",SYMLINKTARGETREQUIRED:"symlink target argument must be a non-empty string value",ENTRYNOTSUPPORTED:"entry not supported"};function tCe(e,t){Error.captureStackTrace(this,this.constructor),this.message=gMt[e]||e,this.code=e,this.data=t}mMt.inherits(tCe,Error);rCe=nCe.exports=tCe});var oz=v((f3r,aCe)=>{aCe.exports=require("stream")});var fCe=v((h3r,lCe)=>{"use strict";function oCe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function sCe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oCe(Object(r),!0).forEach(function(n){vMt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oCe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vMt(e,t,r){return t=cCe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bMt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uCe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,cCe(n.key),n)}}function yMt(e,t,r){return t&&uCe(e.prototype,t),r&&uCe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function cCe(e){var t=xMt(e,"string");return typeof t=="symbol"?t:String(t)}function xMt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _Mt=require("buffer"),j4=_Mt.Buffer,wMt=require("util"),sz=wMt.inspect,EMt=sz&&sz.custom||"inspect";function AMt(e,t,r){j4.prototype.copy.call(e,t,r)}lCe.exports=function(){function e(){bMt(this,e),this.head=null,this.tail=null,this.length=0}return yMt(e,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return j4.alloc(0);for(var n=j4.allocUnsafe(r>>>0),i=this.head,a=0;i;)AMt(i.data,n,a),a+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,a=n.data;for(r-=a.length;n=n.next;){var o=n.data,s=r>o.length?o.length:r;if(s===o.length?a+=o:a+=o.slice(0,r),r-=s,r===0){s===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(s));break}++i}return this.length-=i,a}},{key:"_getBuffer",value:function(r){var n=j4.allocUnsafe(r),i=this.head,a=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var o=i.data,s=r>o.length?o.length:r;if(o.copy(n,n.length-r,0,s),r-=s,r===0){s===o.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(s));break}++a}return this.length-=a,n}},{key:EMt,value:function(r,n){return sz(this,sCe(sCe({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var cz=v((p3r,pCe)=>{"use strict";function SMt(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(uz,this,e)):process.nextTick(uz,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(L4,r):(r._writableState.errorEmitted=!0,process.nextTick(hCe,r,a)):process.nextTick(hCe,r,a):t?(process.nextTick(L4,r),t(a)):process.nextTick(L4,r)}),this)}function hCe(e,t){uz(e,t),L4(e)}function L4(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function TMt(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function uz(e,t){e.emit("error",t)}function CMt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}pCe.exports={destroy:SMt,undestroy:TMt,errorOrDestroy:CMt}});var Vh=v((d3r,gCe)=>{"use strict";var mCe={};function Ts(e,t,r){r||(r=Error);function n(a,o,s){return typeof t=="string"?t:t(a,o,s)}class i extends r{constructor(o,s,u){super(n(o,s,u))}}i.prototype.name=r.name,i.prototype.code=e,mCe[e]=i}function dCe(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function DMt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function FMt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function kMt(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Ts("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Ts("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&DMt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(FMt(e," argument"))i=`The ${e} ${n} ${dCe(t,"type")}`;else{let a=kMt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${dCe(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);Ts("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Ts("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Ts("ERR_STREAM_PREMATURE_CLOSE","Premature close");Ts("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Ts("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Ts("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Ts("ERR_STREAM_WRITE_AFTER_END","write after end");Ts("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Ts("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Ts("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");gCe.exports.codes=mCe});var lz=v((m3r,vCe)=>{"use strict";var BMt=Vh().codes.ERR_INVALID_OPT_VALUE;function OMt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function IMt(e,t,r,n){var i=OMt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new BMt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}vCe.exports={getHighWaterMark:IMt}});var pz=v((g3r,ECe)=>{"use strict";ECe.exports=ai;function yCe(e){var t=this;this.next=null,this.entry=null,this.finish=function(){o7t(t,e)}}var Cb;ai.WritableState=v2;var PMt={deprecate:ld()},xCe=oz(),q4=require("buffer").Buffer,RMt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function jMt(e){return q4.from(e)}function LMt(e){return q4.isBuffer(e)||e instanceof RMt}var hz=cz(),MMt=lz(),qMt=MMt.getHighWaterMark,Kh=Vh().codes,NMt=Kh.ERR_INVALID_ARG_TYPE,UMt=Kh.ERR_METHOD_NOT_IMPLEMENTED,GMt=Kh.ERR_MULTIPLE_CALLBACK,zMt=Kh.ERR_STREAM_CANNOT_PIPE,HMt=Kh.ERR_STREAM_DESTROYED,WMt=Kh.ERR_STREAM_NULL_VALUES,VMt=Kh.ERR_STREAM_WRITE_AFTER_END,KMt=Kh.ERR_UNKNOWN_ENCODING,Db=hz.errorOrDestroy;tr()(ai,xCe);function $Mt(){}function v2(e,t,r){Cb=Cb||l0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Cb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=qMt(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){t7t(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new yCe(this)}v2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(v2.prototype,"buffer",{get:PMt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var M4;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(M4=Function.prototype[Symbol.hasInstance],Object.defineProperty(ai,Symbol.hasInstance,{value:function(t){return M4.call(this,t)?!0:this!==ai?!1:t&&t._writableState instanceof v2}})):M4=function(t){return t instanceof this};function ai(e){Cb=Cb||l0();var t=this instanceof Cb;if(!t&&!M4.call(ai,this))return new ai(e);this._writableState=new v2(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),xCe.call(this)}ai.prototype.pipe=function(){Db(this,new zMt)};function YMt(e,t){var r=new VMt;Db(e,r),process.nextTick(t,r)}function JMt(e,t,r,n){var i;return r===null?i=new WMt:typeof r!="string"&&!t.objectMode&&(i=new NMt("chunk",["string","Buffer"],r)),i?(Db(e,i),process.nextTick(n,i),!1):!0}ai.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&LMt(e);return a&&!q4.isBuffer(e)&&(e=jMt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=$Mt),n.ending?YMt(this,r):(a||JMt(this,n,e,r))&&(n.pendingcb++,i=QMt(this,n,a,e,t,r)),i};ai.prototype.cork=function(){this._writableState.corked++};ai.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&_Ce(this,e))};ai.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new KMt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(ai.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function XMt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=q4.from(t,r)),t}Object.defineProperty(ai.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function QMt(e,t,r,n,i,a){if(!r){var o=XMt(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else fz(e,t,!1,s,n,i,a);return u}function fz(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new HMt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function ZMt(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(g2,e,t),e._writableState.errorEmitted=!0,Db(e,n)):(i(n),e._writableState.errorEmitted=!0,Db(e,n),g2(e,t))}function e7t(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function t7t(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new GMt;if(e7t(r),t)ZMt(e,r,n,t,i);else{var a=wCe(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&_Ce(e,r),n?process.nextTick(bCe,e,r,a,i):bCe(e,r,a,i)}}function bCe(e,t,r,n){r||r7t(e,t),t.pendingcb--,n(),g2(e,t)}function r7t(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function _Ce(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var o=0,s=!0;r;)i[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;i.allBuffers=s,fz(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new yCe(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(fz(e,t,!1,f,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}ai.prototype._write=function(e,t,r){r(new UMt("_write()"))};ai.prototype._writev=null;ai.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||a7t(this,n,r),this};Object.defineProperty(ai.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function wCe(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function n7t(e,t){e._final(function(r){t.pendingcb--,r&&Db(e,r),t.prefinished=!0,e.emit("prefinish"),g2(e,t)})}function i7t(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(n7t,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function g2(e,t){var r=wCe(t);if(r&&(i7t(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function a7t(e,t,r){t.ending=!0,g2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function o7t(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(ai.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});ai.prototype.destroy=hz.destroy;ai.prototype._undestroy=hz.undestroy;ai.prototype._destroy=function(e,t){t(e)}});var l0=v((v3r,SCe)=>{"use strict";var s7t=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};SCe.exports=Oc;var ACe=gz(),mz=pz();tr()(Oc,ACe);for(dz=s7t(mz.prototype),N4=0;N4<dz.length;N4++)U4=dz[N4],Oc.prototype[U4]||(Oc.prototype[U4]=mz.prototype[U4]);var dz,U4,N4;function Oc(e){if(!(this instanceof Oc))return new Oc(e);ACe.call(this,e),mz.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",u7t)))}Object.defineProperty(Oc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Oc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Oc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function u7t(){this._writableState.ended||process.nextTick(c7t,this)}function c7t(e){e.end()}Object.defineProperty(Oc.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var yz=v(CCe=>{"use strict";var bz=Us().Buffer,TCe=bz.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function l7t(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function f7t(e){var t=l7t(e);if(typeof t!="string"&&(bz.isEncoding===TCe||!TCe(e)))throw new Error("Unknown encoding: "+e);return t||e}CCe.StringDecoder=b2;function b2(e){this.encoding=f7t(e);var t;switch(this.encoding){case"utf16le":this.text=v7t,this.end=b7t,t=4;break;case"utf8":this.fillLast=d7t,t=4;break;case"base64":this.text=y7t,this.end=x7t,t=3;break;default:this.write=_7t,this.end=w7t;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=bz.allocUnsafe(t)}b2.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};b2.prototype.end=g7t;b2.prototype.text=m7t;b2.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function vz(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function h7t(e,t,r){var n=t.length-1;if(n<r)return 0;var i=vz(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=vz(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=vz(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function p7t(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function d7t(e){var t=this.lastTotal-this.lastNeed,r=p7t(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function m7t(e,t){var r=h7t(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function g7t(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function v7t(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function b7t(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function y7t(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function x7t(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function _7t(e){return e.toString(this.encoding)}function w7t(e){return e&&e.length?this.write(e):""}});var G4=v((y3r,kCe)=>{"use strict";var DCe=Vh().codes.ERR_STREAM_PREMATURE_CLOSE;function E7t(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function A7t(){}function S7t(e){return e.setHeader&&typeof e.abort=="function"}function FCe(e,t,r){if(typeof t=="function")return FCe(e,null,t);t||(t={}),r=E7t(r||A7t);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,a=function(){e.writable||s()},o=e._writableState&&e._writableState.finished,s=function(){i=!1,o=!0,n||r.call(e)},u=e._readableState&&e._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(e)},l=function(d){r.call(e,d)},f=function(){var d;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(d=new DCe),r.call(e,d);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(d=new DCe),r.call(e,d)},h=function(){e.req.on("finish",s)};return S7t(e)?(e.on("complete",s),e.on("abort",f),e.req?h():e.on("request",h)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",h),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}kCe.exports=FCe});var OCe=v((x3r,BCe)=>{"use strict";var z4;function $h(e,t,r){return t=T7t(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function T7t(e){var t=C7t(e,"string");return typeof t=="symbol"?t:String(t)}function C7t(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var D7t=G4(),Yh=Symbol("lastResolve"),f0=Symbol("lastReject"),y2=Symbol("error"),H4=Symbol("ended"),h0=Symbol("lastPromise"),xz=Symbol("handlePromise"),p0=Symbol("stream");function Jh(e,t){return{value:e,done:t}}function F7t(e){var t=e[Yh];if(t!==null){var r=e[p0].read();r!==null&&(e[h0]=null,e[Yh]=null,e[f0]=null,t(Jh(r,!1)))}}function k7t(e){process.nextTick(F7t,e)}function B7t(e,t){return function(r,n){e.then(function(){if(t[H4]){r(Jh(void 0,!0));return}t[xz](r,n)},n)}}var O7t=Object.getPrototypeOf(function(){}),I7t=Object.setPrototypeOf((z4={get stream(){return this[p0]},next:function(){var t=this,r=this[y2];if(r!==null)return Promise.reject(r);if(this[H4])return Promise.resolve(Jh(void 0,!0));if(this[p0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[y2]?s(t[y2]):o(Jh(void 0,!0))})});var n=this[h0],i;if(n)i=new Promise(B7t(n,this));else{var a=this[p0].read();if(a!==null)return Promise.resolve(Jh(a,!1));i=new Promise(this[xz])}return this[h0]=i,i}},$h(z4,Symbol.asyncIterator,function(){return this}),$h(z4,"return",function(){var t=this;return new Promise(function(r,n){t[p0].destroy(null,function(i){if(i){n(i);return}r(Jh(void 0,!0))})})}),z4),O7t),P7t=function(t){var r,n=Object.create(I7t,(r={},$h(r,p0,{value:t,writable:!0}),$h(r,Yh,{value:null,writable:!0}),$h(r,f0,{value:null,writable:!0}),$h(r,y2,{value:null,writable:!0}),$h(r,H4,{value:t._readableState.endEmitted,writable:!0}),$h(r,xz,{value:function(a,o){var s=n[p0].read();s?(n[h0]=null,n[Yh]=null,n[f0]=null,a(Jh(s,!1))):(n[Yh]=a,n[f0]=o)},writable:!0}),r));return n[h0]=null,D7t(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[f0];a!==null&&(n[h0]=null,n[Yh]=null,n[f0]=null,a(i)),n[y2]=i;return}var o=n[Yh];o!==null&&(n[h0]=null,n[Yh]=null,n[f0]=null,o(Jh(void 0,!0))),n[H4]=!0}),t.on("readable",k7t.bind(null,n)),n};BCe.exports=P7t});var jCe=v((_3r,RCe)=>{"use strict";function ICe(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){r(c);return}s.done?t(u):Promise.resolve(u).then(n,i)}function R7t(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){ICe(a,n,i,o,s,"next",u)}function s(u){ICe(a,n,i,o,s,"throw",u)}o(void 0)})}}function PCe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function j7t(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?PCe(Object(r),!0).forEach(function(n){L7t(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):PCe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function L7t(e,t,r){return t=M7t(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function M7t(e){var t=q7t(e,"string");return typeof t=="symbol"?t:String(t)}function q7t(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var N7t=Vh().codes.ERR_INVALID_ARG_TYPE;function U7t(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new N7t("iterable",["Iterable"],t);var i=new e(j7t({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=R7t(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?o():a=!1}catch(f){i.destroy(f)}}),s.apply(this,arguments)}return i}RCe.exports=U7t});var gz=v((E3r,VCe)=>{"use strict";VCe.exports=Nr;var Fb;Nr.ReadableState=NCe;var w3r=require("events").EventEmitter,qCe=function(t,r){return t.listeners(r).length},_2=oz(),W4=require("buffer").Buffer,G7t=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function z7t(e){return W4.from(e)}function H7t(e){return W4.isBuffer(e)||e instanceof G7t}var _z=require("util"),gr;_z&&_z.debuglog?gr=_z.debuglog("stream"):gr=function(){};var W7t=fCe(),Dz=cz(),V7t=lz(),K7t=V7t.getHighWaterMark,V4=Vh().codes,$7t=V4.ERR_INVALID_ARG_TYPE,Y7t=V4.ERR_STREAM_PUSH_AFTER_EOF,J7t=V4.ERR_METHOD_NOT_IMPLEMENTED,X7t=V4.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,kb,wz,Ez;tr()(Nr,_2);var x2=Dz.errorOrDestroy,Az=["error","close","destroy","pause","resume"];function Q7t(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function NCe(e,t,r){Fb=Fb||l0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Fb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=K7t(this,e,"readableHighWaterMark",r),this.buffer=new W7t,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(kb||(kb=yz().StringDecoder),this.decoder=new kb(e.encoding),this.encoding=e.encoding)}function Nr(e){if(Fb=Fb||l0(),!(this instanceof Nr))return new Nr(e);var t=this instanceof Fb;this._readableState=new NCe(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),_2.call(this)}Object.defineProperty(Nr.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});Nr.prototype.destroy=Dz.destroy;Nr.prototype._undestroy=Dz.undestroy;Nr.prototype._destroy=function(e,t){t(e)};Nr.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=W4.from(e,t),t=""),n=!0),UCe(this,e,t,!1,n)};Nr.prototype.unshift=function(e){return UCe(this,e,null,!0,!1)};function UCe(e,t,r,n,i){gr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,tqt(e,a);else{var o;if(i||(o=Z7t(a,t)),o)x2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==W4.prototype&&(t=z7t(t)),n)a.endEmitted?x2(e,new X7t):Sz(e,a,t,!0);else if(a.ended)x2(e,new Y7t);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?Sz(e,a,t,!1):Cz(e,a)):Sz(e,a,t,!1)}else n||(a.reading=!1,Cz(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function Sz(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&K4(e)),Cz(e,t)}function Z7t(e,t){var r;return!H7t(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new $7t("chunk",["string","Buffer","Uint8Array"],t)),r}Nr.prototype.isPaused=function(){return this._readableState.flowing===!1};Nr.prototype.setEncoding=function(e){kb||(kb=yz().StringDecoder);var t=new kb(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var LCe=1073741824;function eqt(e){return e>=LCe?e=LCe:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function MCe(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=eqt(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Nr.prototype.read=function(e){gr("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return gr("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?Tz(this):K4(this),null;if(e=MCe(e,t),e===0&&t.ended)return t.length===0&&Tz(this),null;var n=t.needReadable;gr("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,gr("length less than watermark",n)),t.ended||t.reading?(n=!1,gr("reading or ended",n)):n&&(gr("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=MCe(r,t)));var i;return e>0?i=HCe(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&Tz(this)),i!==null&&this.emit("data",i),i};function tqt(e,t){if(gr("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?K4(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,GCe(e)))}}function K4(e){var t=e._readableState;gr("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(gr("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(GCe,e))}function GCe(e){var t=e._readableState;gr("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,Fz(e)}function Cz(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(rqt,e,t))}function rqt(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(gr("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}Nr.prototype._read=function(e){x2(this,new J7t("_read()"))};Nr.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,gr("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?s:b;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",o);function o(g,x){gr("onunpipe"),g===r&&x&&x.hasUnpiped===!1&&(x.hasUnpiped=!0,l())}function s(){gr("onend"),e.end()}var u=nqt(r);e.on("drain",u);var c=!1;function l(){gr("cleanup"),e.removeListener("close",p),e.removeListener("finish",d),e.removeListener("drain",u),e.removeListener("error",h),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){gr("ondata");var x=e.write(g);gr("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&WCe(n.pipes,e)!==-1)&&!c&&(gr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(g){gr("onerror",g),b(),e.removeListener("error",h),qCe(e,"error")===0&&x2(e,g)}Q7t(e,"error",h);function p(){e.removeListener("finish",d),b()}e.once("close",p);function d(){gr("onfinish"),e.removeListener("close",p),b()}e.once("finish",d);function b(){gr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(gr("pipe resume"),r.resume()),e};function nqt(e){return function(){var r=e._readableState;gr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&qCe(e,"data")&&(r.flowing=!0,Fz(e))}}Nr.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=WCe(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};Nr.prototype.on=function(e,t){var r=_2.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,gr("on readable",n.length,n.reading),n.length?K4(this):n.reading||process.nextTick(iqt,this)),r};Nr.prototype.addListener=Nr.prototype.on;Nr.prototype.removeListener=function(e,t){var r=_2.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(zCe,this),r};Nr.prototype.removeAllListeners=function(e){var t=_2.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(zCe,this),t};function zCe(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function iqt(e){gr("readable nexttick read 0"),e.read(0)}Nr.prototype.resume=function(){var e=this._readableState;return e.flowing||(gr("resume"),e.flowing=!e.readableListening,aqt(this,e)),e.paused=!1,this};function aqt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(oqt,e,t))}function oqt(e,t){gr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Fz(e),t.flowing&&!t.reading&&e.read(0)}Nr.prototype.pause=function(){return gr("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(gr("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Fz(e){var t=e._readableState;for(gr("flow",t.flowing);t.flowing&&e.read()!==null;);}Nr.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(gr("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&t.push(o)}t.push(null)}),e.on("data",function(o){if(gr("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var s=t.push(o);s||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(s){return function(){return e[s].apply(e,arguments)}}(i));for(var a=0;a<Az.length;a++)e.on(Az[a],this.emit.bind(this,Az[a]));return this._read=function(o){gr("wrapped _read",o),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(Nr.prototype[Symbol.asyncIterator]=function(){return wz===void 0&&(wz=OCe()),wz(this)});Object.defineProperty(Nr.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Nr.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Nr.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});Nr._fromList=HCe;Object.defineProperty(Nr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function HCe(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function Tz(e){var t=e._readableState;gr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(sqt,t,e))}function sqt(e,t){if(gr("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(Nr.from=function(e,t){return Ez===void 0&&(Ez=jCe()),Ez(Nr,e,t)});function WCe(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var kz=v((A3r,$Ce)=>{"use strict";$Ce.exports=Kl;var $4=Vh().codes,uqt=$4.ERR_METHOD_NOT_IMPLEMENTED,cqt=$4.ERR_MULTIPLE_CALLBACK,lqt=$4.ERR_TRANSFORM_ALREADY_TRANSFORMING,fqt=$4.ERR_TRANSFORM_WITH_LENGTH_0,Y4=l0();tr()(Kl,Y4);function hqt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new cqt);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Kl(e){if(!(this instanceof Kl))return new Kl(e);Y4.call(this,e),this._transformState={afterTransform:hqt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",pqt)}function pqt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){KCe(e,t,r)}):KCe(this,null,null)}Kl.prototype.push=function(e,t){return this._transformState.needTransform=!1,Y4.prototype.push.call(this,e,t)};Kl.prototype._transform=function(e,t,r){r(new uqt("_transform()"))};Kl.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Kl.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Kl.prototype._destroy=function(e,t){Y4.prototype._destroy.call(this,e,function(r){t(r)})};function KCe(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new fqt;if(e._transformState.transforming)throw new lqt;return e.push(null)}});var XCe=v((S3r,JCe)=>{"use strict";JCe.exports=w2;var YCe=kz();tr()(w2,YCe);function w2(e){if(!(this instanceof w2))return new w2(e);YCe.call(this,e)}w2.prototype._transform=function(e,t,r){r(null,e)}});var r8e=v((T3r,t8e)=>{"use strict";var Bz;function dqt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var e8e=Vh().codes,mqt=e8e.ERR_MISSING_ARGS,gqt=e8e.ERR_STREAM_DESTROYED;function QCe(e){if(e)throw e}function vqt(e){return e.setHeader&&typeof e.abort=="function"}function bqt(e,t,r,n){n=dqt(n);var i=!1;e.on("close",function(){i=!0}),Bz===void 0&&(Bz=G4()),Bz(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var a=!1;return function(o){if(!i&&!a){if(a=!0,vqt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new gqt("pipe"))}}}function ZCe(e){e()}function yqt(e,t){return e.pipe(t)}function xqt(e){return!e.length||typeof e[e.length-1]!="function"?QCe:e.pop()}function _qt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=xqt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new mqt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return bqt(o,u,c,function(l){i||(i=l),l&&a.forEach(ZCe),!u&&(a.forEach(ZCe),n(i))})});return t.reduce(yqt)}t8e.exports=_qt});var Oz=v((Cs,A2)=>{var E2=require("stream");process.env.READABLE_STREAM==="disable"&&E2?(A2.exports=E2.Readable,Object.assign(A2.exports,E2),A2.exports.Stream=E2):(Cs=A2.exports=gz(),Cs.Stream=E2||Cs,Cs.Readable=Cs,Cs.Writable=pz(),Cs.Duplex=l0(),Cs.Transform=kz(),Cs.PassThrough=XCe(),Cs.finished=G4(),Cs.pipeline=r8e())});var s8e=v((C3r,o8e)=>{var Rz=require("fs"),i8e=t6e(),n8e=n6e(),Iz=require("path"),Ic=Tb(),wqt=require("util").inherits,oi=iCe(),a8e=Oz().Transform,Pz=process.platform==="win32",Jr=function(e,t){if(!(this instanceof Jr))return new Jr(e,t);typeof e!="string"&&(t=e,e="zip"),t=this.options=Ic.defaults(t,{highWaterMark:1024*1024,statConcurrency:4}),a8e.call(this,t),this._format=!1,this._module=!1,this._pending=0,this._pointer=0,this._entriesCount=0,this._entriesProcessedCount=0,this._fsEntriesTotalBytes=0,this._fsEntriesProcessedBytes=0,this._queue=n8e.queue(this._onQueueTask.bind(this),1),this._queue.drain(this._onQueueDrain.bind(this)),this._statQueue=n8e.queue(this._onStatQueueTask.bind(this),t.statConcurrency),this._statQueue.drain(this._onQueueDrain.bind(this)),this._state={aborted:!1,finalize:!1,finalizing:!1,finalized:!1,modulePiped:!1},this._streams=[]};wqt(Jr,a8e);Jr.prototype._abort=function(){this._state.aborted=!0,this._queue.kill(),this._statQueue.kill(),this._queue.idle()&&this._shutdown()};Jr.prototype._append=function(e,t){t=t||{};var r={source:null,filepath:e};t.name||(t.name=e),t.sourcePath=e,r.data=t,this._entriesCount++,t.stats&&t.stats instanceof Rz.Stats?(r=this._updateQueueTaskWithStats(r,t.stats),r&&(t.stats.size&&(this._fsEntriesTotalBytes+=t.stats.size),this._queue.push(r))):this._statQueue.push(r)};Jr.prototype._finalize=function(){this._state.finalizing||this._state.finalized||this._state.aborted||(this._state.finalizing=!0,this._moduleFinalize(),this._state.finalizing=!1,this._state.finalized=!0)};Jr.prototype._maybeFinalize=function(){return this._state.finalizing||this._state.finalized||this._state.aborted?!1:this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()?(this._finalize(),!0):!1};Jr.prototype._moduleAppend=function(e,t,r){if(this._state.aborted){r();return}this._module.append(e,t,function(n){if(this._task=null,this._state.aborted){this._shutdown();return}if(n){this.emit("error",n),setImmediate(r);return}this.emit("entry",t),this._entriesProcessedCount++,t.stats&&t.stats.size&&(this._fsEntriesProcessedBytes+=t.stats.size),this.emit("progress",{entries:{total:this._entriesCount,processed:this._entriesProcessedCount},fs:{totalBytes:this._fsEntriesTotalBytes,processedBytes:this._fsEntriesProcessedBytes}}),setImmediate(r)}.bind(this))};Jr.prototype._moduleFinalize=function(){typeof this._module.finalize=="function"?this._module.finalize():typeof this._module.end=="function"?this._module.end():this.emit("error",new oi("NOENDMETHOD"))};Jr.prototype._modulePipe=function(){this._module.on("error",this._onModuleError.bind(this)),this._module.pipe(this),this._state.modulePiped=!0};Jr.prototype._moduleSupports=function(e){return!this._module.supports||!this._module.supports[e]?!1:this._module.supports[e]};Jr.prototype._moduleUnpipe=function(){this._module.unpipe(this),this._state.modulePiped=!1};Jr.prototype._normalizeEntryData=function(e,t){e=Ic.defaults(e,{type:"file",name:null,date:null,mode:null,prefix:null,sourcePath:null,stats:!1}),t&&e.stats===!1&&(e.stats=t);var r=e.type==="directory";return e.name&&(typeof e.prefix=="string"&&e.prefix!==""&&(e.name=e.prefix+"/"+e.name,e.prefix=null),e.name=Ic.sanitizePath(e.name),e.type!=="symlink"&&e.name.slice(-1)==="/"?(r=!0,e.type="directory"):r&&(e.name+="/")),typeof e.mode=="number"?Pz?e.mode&=511:e.mode&=4095:e.stats&&e.mode===null?(Pz?e.mode=e.stats.mode&511:e.mode=e.stats.mode&4095,Pz&&r&&(e.mode=493)):e.mode===null&&(e.mode=r?493:420),e.stats&&e.date===null?e.date=e.stats.mtime:e.date=Ic.dateify(e.date),e};Jr.prototype._onModuleError=function(e){this.emit("error",e)};Jr.prototype._onQueueDrain=function(){this._state.finalizing||this._state.finalized||this._state.aborted||this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()&&this._finalize()};Jr.prototype._onQueueTask=function(e,t){var r=()=>{e.data.callback&&e.data.callback(),t()};if(this._state.finalizing||this._state.finalized||this._state.aborted){r();return}this._task=e,this._moduleAppend(e.source,e.data,r)};Jr.prototype._onStatQueueTask=function(e,t){if(this._state.finalizing||this._state.finalized||this._state.aborted){t();return}Rz.lstat(e.filepath,function(r,n){if(this._state.aborted){setImmediate(t);return}if(r){this._entriesCount--,this.emit("warning",r),setImmediate(t);return}e=this._updateQueueTaskWithStats(e,n),e&&(n.size&&(this._fsEntriesTotalBytes+=n.size),this._queue.push(e)),setImmediate(t)}.bind(this))};Jr.prototype._shutdown=function(){this._moduleUnpipe(),this.end()};Jr.prototype._transform=function(e,t,r){e&&(this._pointer+=e.length),r(null,e)};Jr.prototype._updateQueueTaskWithStats=function(e,t){if(t.isFile())e.data.type="file",e.data.sourceType="stream",e.source=Ic.lazyReadStream(e.filepath);else if(t.isDirectory()&&this._moduleSupports("directory"))e.data.name=Ic.trailingSlashIt(e.data.name),e.data.type="directory",e.data.sourcePath=Ic.trailingSlashIt(e.filepath),e.data.sourceType="buffer",e.source=Buffer.concat([]);else if(t.isSymbolicLink()&&this._moduleSupports("symlink")){var r=Rz.readlinkSync(e.filepath),n=Iz.dirname(e.filepath);e.data.type="symlink",e.data.linkname=Iz.relative(n,Iz.resolve(n,r)),e.data.sourceType="buffer",e.source=Buffer.concat([])}else return t.isDirectory()?this.emit("warning",new oi("DIRECTORYNOTSUPPORTED",e.data)):t.isSymbolicLink()?this.emit("warning",new oi("SYMLINKNOTSUPPORTED",e.data)):this.emit("warning",new oi("ENTRYNOTSUPPORTED",e.data)),null;return e.data=this._normalizeEntryData(e.data,t),e};Jr.prototype.abort=function(){return this._state.aborted||this._state.finalized?this:(this._abort(),this)};Jr.prototype.append=function(e,t){if(this._state.finalize||this._state.aborted)return this.emit("error",new oi("QUEUECLOSED")),this;if(t=this._normalizeEntryData(t),typeof t.name!="string"||t.name.length===0)return this.emit("error",new oi("ENTRYNAMEREQUIRED")),this;if(t.type==="directory"&&!this._moduleSupports("directory"))return this.emit("error",new oi("DIRECTORYNOTSUPPORTED",{name:t.name})),this;if(e=Ic.normalizeInputSource(e),Buffer.isBuffer(e))t.sourceType="buffer";else if(Ic.isStream(e))t.sourceType="stream";else return this.emit("error",new oi("INPUTSTEAMBUFFERREQUIRED",{name:t.name})),this;return this._entriesCount++,this._queue.push({data:t,source:e}),this};Jr.prototype.directory=function(e,t,r){if(this._state.finalize||this._state.aborted)return this.emit("error",new oi("QUEUECLOSED")),this;if(typeof e!="string"||e.length===0)return this.emit("error",new oi("DIRECTORYDIRPATHREQUIRED")),this;this._pending++,t===!1?t="":typeof t!="string"&&(t=e);var n=!1;typeof r=="function"?(n=r,r={}):typeof r!="object"&&(r={});var i={stat:!0,dot:!0};function a(){this._pending--,this._maybeFinalize()}function o(c){this.emit("error",c)}function s(c){u.pause();var l=!1,f=Object.assign({},r);f.name=c.relative,f.prefix=t,f.stats=c.stat,f.callback=u.resume.bind(u);try{if(n){if(f=n(f),f===!1)l=!0;else if(typeof f!="object")throw new oi("DIRECTORYFUNCTIONINVALIDDATA",{dirpath:e})}}catch(h){this.emit("error",h);return}if(l){u.resume();return}this._append(c.absolute,f)}var u=i8e(e,i);return u.on("error",o.bind(this)),u.on("match",s.bind(this)),u.on("end",a.bind(this)),this};Jr.prototype.file=function(e,t){return this._state.finalize||this._state.aborted?(this.emit("error",new oi("QUEUECLOSED")),this):typeof e!="string"||e.length===0?(this.emit("error",new oi("FILEFILEPATHREQUIRED")),this):(this._append(e,t),this)};Jr.prototype.glob=function(e,t,r){this._pending++,t=Ic.defaults(t,{stat:!0,pattern:e});function n(){this._pending--,this._maybeFinalize()}function i(s){this.emit("error",s)}function a(s){o.pause();var u=Object.assign({},r);u.callback=o.resume.bind(o),u.stats=s.stat,u.name=s.relative,this._append(s.absolute,u)}var o=i8e(t.cwd||".",t);return o.on("error",i.bind(this)),o.on("match",a.bind(this)),o.on("end",n.bind(this)),this};Jr.prototype.finalize=function(){if(this._state.aborted){var e=new oi("ABORTED");return this.emit("error",e),Promise.reject(e)}if(this._state.finalize){var t=new oi("FINALIZING");return this.emit("error",t),Promise.reject(t)}this._state.finalize=!0,this._pending===0&&this._queue.idle()&&this._statQueue.idle()&&this._finalize();var r=this;return new Promise(function(n,i){var a;r._module.on("end",function(){a||n()}),r._module.on("error",function(o){a=!0,i(o)})})};Jr.prototype.setFormat=function(e){return this._format?(this.emit("error",new oi("FORMATSET")),this):(this._format=e,this)};Jr.prototype.setModule=function(e){return this._state.aborted?(this.emit("error",new oi("ABORTED")),this):this._state.module?(this.emit("error",new oi("MODULESET")),this):(this._module=e,this._modulePipe(),this)};Jr.prototype.symlink=function(e,t,r){if(this._state.finalize||this._state.aborted)return this.emit("error",new oi("QUEUECLOSED")),this;if(typeof e!="string"||e.length===0)return this.emit("error",new oi("SYMLINKFILEPATHREQUIRED")),this;if(typeof t!="string"||t.length===0)return this.emit("error",new oi("SYMLINKTARGETREQUIRED",{filepath:e})),this;if(!this._moduleSupports("symlink"))return this.emit("error",new oi("SYMLINKNOTSUPPORTED",{filepath:e})),this;var n={};return n.type="symlink",n.name=e.replace(/\\/g,"/"),n.linkname=t.replace(/\\/g,"/"),n.sourceType="buffer",typeof r=="number"&&(n.mode=r),this._entriesCount++,this._queue.push({data:n,source:Buffer.concat([])}),this};Jr.prototype.pointer=function(){return this._pointer};Jr.prototype.use=function(e){return this._streams.push(e),this};o8e.exports=Jr});var X4=v((D3r,u8e)=>{var J4=u8e.exports=function(){};J4.prototype.getName=function(){};J4.prototype.getSize=function(){};J4.prototype.getLastModifiedDate=function(){};J4.prototype.isDirectory=function(){}});var Q4=v((F3r,c8e)=>{var Ds=c8e.exports={};Ds.dateToDos=function(e,t){t=t||!1;var r=t?e.getFullYear():e.getUTCFullYear();if(r<1980)return 2162688;if(r>=2044)return 2141175677;var n={year:r,month:t?e.getMonth():e.getUTCMonth(),date:t?e.getDate():e.getUTCDate(),hours:t?e.getHours():e.getUTCHours(),minutes:t?e.getMinutes():e.getUTCMinutes(),seconds:t?e.getSeconds():e.getUTCSeconds()};return n.year-1980<<25|n.month+1<<21|n.date<<16|n.hours<<11|n.minutes<<5|n.seconds/2};Ds.dosToDate=function(e){return new Date((e>>25&127)+1980,(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(e&31)<<1)};Ds.fromDosTime=function(e){return Ds.dosToDate(e.readUInt32LE(0))};Ds.getEightBytes=function(e){var t=Buffer.alloc(8);return t.writeUInt32LE(e%4294967296,0),t.writeUInt32LE(e/4294967296|0,4),t};Ds.getShortBytes=function(e){var t=Buffer.alloc(2);return t.writeUInt16LE((e&65535)>>>0,0),t};Ds.getShortBytesValue=function(e,t){return e.readUInt16LE(t)};Ds.getLongBytes=function(e){var t=Buffer.alloc(4);return t.writeUInt32LE((e&4294967295)>>>0,0),t};Ds.getLongBytesValue=function(e,t){return e.readUInt32LE(t)};Ds.toDosTime=function(e){return Ds.getLongBytes(Ds.dateToDos(e))}});var jz=v((k3r,m8e)=>{var l8e=Q4(),f8e=1<<3,h8e=1<<0,Eqt=1<<2,Aqt=1<<1,p8e=1<<6,d8e=1<<11,Sa=m8e.exports=function(){return this instanceof Sa?(this.descriptor=!1,this.encryption=!1,this.utf8=!1,this.numberOfShannonFanoTrees=0,this.strongEncryption=!1,this.slidingDictionarySize=0,this):new Sa};Sa.prototype.encode=function(){return l8e.getShortBytes((this.descriptor?f8e:0)|(this.utf8?d8e:0)|(this.encryption?h8e:0)|(this.strongEncryption?p8e:0))};Sa.prototype.parse=function(e,t){var r=l8e.getShortBytesValue(e,t),n=new Sa;return n.useDataDescriptor((r&f8e)!==0),n.useUTF8ForNames((r&d8e)!==0),n.useStrongEncryption((r&p8e)!==0),n.useEncryption((r&h8e)!==0),n.setSlidingDictionarySize(r&Aqt?8192:4096),n.setNumberOfShannonFanoTrees(r&Eqt?3:2),n};Sa.prototype.setNumberOfShannonFanoTrees=function(e){this.numberOfShannonFanoTrees=e};Sa.prototype.getNumberOfShannonFanoTrees=function(){return this.numberOfShannonFanoTrees};Sa.prototype.setSlidingDictionarySize=function(e){this.slidingDictionarySize=e};Sa.prototype.getSlidingDictionarySize=function(){return this.slidingDictionarySize};Sa.prototype.useDataDescriptor=function(e){this.descriptor=e};Sa.prototype.usesDataDescriptor=function(){return this.descriptor};Sa.prototype.useEncryption=function(e){this.encryption=e};Sa.prototype.usesEncryption=function(){return this.encryption};Sa.prototype.useStrongEncryption=function(e){this.strongEncryption=e};Sa.prototype.usesStrongEncryption=function(){return this.strongEncryption};Sa.prototype.useUTF8ForNames=function(e){this.utf8=e};Sa.prototype.usesUTF8ForNames=function(){return this.utf8}});var v8e=v((B3r,g8e)=>{g8e.exports={PERM_MASK:4095,FILE_TYPE_FLAG:61440,LINK_FLAG:40960,FILE_FLAG:32768,DIR_FLAG:16384,DEFAULT_LINK_PERM:511,DEFAULT_DIR_PERM:493,DEFAULT_FILE_PERM:420}});var Lz=v((O3r,b8e)=>{b8e.exports={WORD:4,DWORD:8,EMPTY:Buffer.alloc(0),SHORT:2,SHORT_MASK:65535,SHORT_SHIFT:16,SHORT_ZERO:Buffer.from(Array(2)),LONG:4,LONG_ZERO:Buffer.from(Array(4)),MIN_VERSION_INITIAL:10,MIN_VERSION_DATA_DESCRIPTOR:20,MIN_VERSION_ZIP64:45,VERSION_MADEBY:45,METHOD_STORED:0,METHOD_DEFLATED:8,PLATFORM_UNIX:3,PLATFORM_FAT:0,SIG_LFH:67324752,SIG_DD:134695760,SIG_CFH:33639248,SIG_EOCD:101010256,SIG_ZIP64_EOCD:101075792,SIG_ZIP64_EOCD_LOC:117853008,ZIP64_MAGIC_SHORT:65535,ZIP64_MAGIC:4294967295,ZIP64_EXTRA_ID:1,ZLIB_NO_COMPRESSION:0,ZLIB_BEST_SPEED:1,ZLIB_BEST_COMPRESSION:9,ZLIB_DEFAULT_COMPRESSION:-1,MODE_MASK:4095,DEFAULT_FILE_MODE:33188,DEFAULT_DIR_MODE:16877,EXT_FILE_ATTR_DIR:1106051088,EXT_FILE_ATTR_FILE:2175008800,S_IFMT:61440,S_IFIFO:4096,S_IFCHR:8192,S_IFDIR:16384,S_IFBLK:24576,S_IFREG:32768,S_IFLNK:40960,S_IFSOCK:49152,S_DOS_A:32,S_DOS_D:16,S_DOS_V:8,S_DOS_S:4,S_DOS_H:2,S_DOS_R:1}});var Mz=v((I3r,E8e)=>{var Sqt=require("util").inherits,Tqt=_G(),x8e=X4(),_8e=jz(),y8e=v8e(),Qa=Lz(),w8e=Q4(),vr=E8e.exports=function(e){if(!(this instanceof vr))return new vr(e);x8e.call(this),this.platform=Qa.PLATFORM_FAT,this.method=-1,this.name=null,this.size=0,this.csize=0,this.gpb=new _8e,this.crc=0,this.time=-1,this.minver=Qa.MIN_VERSION_INITIAL,this.mode=-1,this.extra=null,this.exattr=0,this.inattr=0,this.comment=null,e&&this.setName(e)};Sqt(vr,x8e);vr.prototype.getCentralDirectoryExtra=function(){return this.getExtra()};vr.prototype.getComment=function(){return this.comment!==null?this.comment:""};vr.prototype.getCompressedSize=function(){return this.csize};vr.prototype.getCrc=function(){return this.crc};vr.prototype.getExternalAttributes=function(){return this.exattr};vr.prototype.getExtra=function(){return this.extra!==null?this.extra:Qa.EMPTY};vr.prototype.getGeneralPurposeBit=function(){return this.gpb};vr.prototype.getInternalAttributes=function(){return this.inattr};vr.prototype.getLastModifiedDate=function(){return this.getTime()};vr.prototype.getLocalFileDataExtra=function(){return this.getExtra()};vr.prototype.getMethod=function(){return this.method};vr.prototype.getName=function(){return this.name};vr.prototype.getPlatform=function(){return this.platform};vr.prototype.getSize=function(){return this.size};vr.prototype.getTime=function(){return this.time!==-1?w8e.dosToDate(this.time):-1};vr.prototype.getTimeDos=function(){return this.time!==-1?this.time:0};vr.prototype.getUnixMode=function(){return this.platform!==Qa.PLATFORM_UNIX?0:this.getExternalAttributes()>>Qa.SHORT_SHIFT&Qa.SHORT_MASK};vr.prototype.getVersionNeededToExtract=function(){return this.minver};vr.prototype.setComment=function(e){Buffer.byteLength(e)!==e.length&&this.getGeneralPurposeBit().useUTF8ForNames(!0),this.comment=e};vr.prototype.setCompressedSize=function(e){if(e<0)throw new Error("invalid entry compressed size");this.csize=e};vr.prototype.setCrc=function(e){if(e<0)throw new Error("invalid entry crc32");this.crc=e};vr.prototype.setExternalAttributes=function(e){this.exattr=e>>>0};vr.prototype.setExtra=function(e){this.extra=e};vr.prototype.setGeneralPurposeBit=function(e){if(!(e instanceof _8e))throw new Error("invalid entry GeneralPurposeBit");this.gpb=e};vr.prototype.setInternalAttributes=function(e){this.inattr=e};vr.prototype.setMethod=function(e){if(e<0)throw new Error("invalid entry compression method");this.method=e};vr.prototype.setName=function(e,t=!1){e=Tqt(e,!1).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,""),t&&(e=`/${e}`),Buffer.byteLength(e)!==e.length&&this.getGeneralPurposeBit().useUTF8ForNames(!0),this.name=e};vr.prototype.setPlatform=function(e){this.platform=e};vr.prototype.setSize=function(e){if(e<0)throw new Error("invalid entry size");this.size=e};vr.prototype.setTime=function(e,t){if(!(e instanceof Date))throw new Error("invalid entry time");this.time=w8e.dateToDos(e,t)};vr.prototype.setUnixMode=function(e){e|=this.isDirectory()?Qa.S_IFDIR:Qa.S_IFREG;var t=0;t|=e<<Qa.SHORT_SHIFT|(this.isDirectory()?Qa.S_DOS_D:Qa.S_DOS_A),this.setExternalAttributes(t),this.mode=e&Qa.MODE_MASK,this.platform=Qa.PLATFORM_UNIX};vr.prototype.setVersionNeededToExtract=function(e){this.minver=e};vr.prototype.isDirectory=function(){return this.getName().slice(-1)==="/"};vr.prototype.isUnixSymlink=function(){return(this.getUnixMode()&y8e.FILE_TYPE_FLAG)===y8e.LINK_FLAG};vr.prototype.isZip64=function(){return this.csize>Qa.ZIP64_MAGIC||this.size>Qa.ZIP64_MAGIC}});var qz=v((P3r,A8e)=>{A8e.exports=require("stream")});var k8e=v((R3r,F8e)=>{"use strict";function S8e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function T8e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?S8e(Object(r),!0).forEach(function(n){Cqt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S8e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Cqt(e,t,r){return t=D8e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Dqt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C8e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,D8e(n.key),n)}}function Fqt(e,t,r){return t&&C8e(e.prototype,t),r&&C8e(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function D8e(e){var t=kqt(e,"string");return typeof t=="symbol"?t:String(t)}function kqt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bqt=require("buffer"),Z4=Bqt.Buffer,Oqt=require("util"),Nz=Oqt.inspect,Iqt=Nz&&Nz.custom||"inspect";function Pqt(e,t,r){Z4.prototype.copy.call(e,t,r)}F8e.exports=function(){function e(){Dqt(this,e),this.head=null,this.tail=null,this.length=0}return Fqt(e,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return Z4.alloc(0);for(var n=Z4.allocUnsafe(r>>>0),i=this.head,a=0;i;)Pqt(i.data,n,a),a+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,a=n.data;for(r-=a.length;n=n.next;){var o=n.data,s=r>o.length?o.length:r;if(s===o.length?a+=o:a+=o.slice(0,r),r-=s,r===0){s===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(s));break}++i}return this.length-=i,a}},{key:"_getBuffer",value:function(r){var n=Z4.allocUnsafe(r),i=this.head,a=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var o=i.data,s=r>o.length?o.length:r;if(o.copy(n,n.length-r,0,s),r-=s,r===0){s===o.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(s));break}++a}return this.length-=a,n}},{key:Iqt,value:function(r,n){return Nz(this,T8e(T8e({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var Gz=v((j3r,O8e)=>{"use strict";function Rqt(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Uz,this,e)):process.nextTick(Uz,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(eF,r):(r._writableState.errorEmitted=!0,process.nextTick(B8e,r,a)):process.nextTick(B8e,r,a):t?(process.nextTick(eF,r),t(a)):process.nextTick(eF,r)}),this)}function B8e(e,t){Uz(e,t),eF(e)}function eF(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function jqt(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Uz(e,t){e.emit("error",t)}function Lqt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}O8e.exports={destroy:Rqt,undestroy:jqt,errorOrDestroy:Lqt}});var Xh=v((L3r,R8e)=>{"use strict";var P8e={};function Fs(e,t,r){r||(r=Error);function n(a,o,s){return typeof t=="string"?t:t(a,o,s)}class i extends r{constructor(o,s,u){super(n(o,s,u))}}i.prototype.name=r.name,i.prototype.code=e,P8e[e]=i}function I8e(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function Mqt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function qqt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function Nqt(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Fs("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Fs("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&Mqt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(qqt(e," argument"))i=`The ${e} ${n} ${I8e(t,"type")}`;else{let a=Nqt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${I8e(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);Fs("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Fs("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Fs("ERR_STREAM_PREMATURE_CLOSE","Premature close");Fs("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Fs("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Fs("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Fs("ERR_STREAM_WRITE_AFTER_END","write after end");Fs("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Fs("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Fs("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");R8e.exports.codes=P8e});var zz=v((M3r,j8e)=>{"use strict";var Uqt=Xh().codes.ERR_INVALID_OPT_VALUE;function Gqt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function zqt(e,t,r,n){var i=Gqt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new Uqt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}j8e.exports={getHighWaterMark:zqt}});var Vz=v((q3r,G8e)=>{"use strict";G8e.exports=si;function M8e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){gNt(t,e)}}var Bb;si.WritableState=T2;var Hqt={deprecate:ld()},q8e=qz(),rF=require("buffer").Buffer,Wqt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Vqt(e){return rF.from(e)}function Kqt(e){return rF.isBuffer(e)||e instanceof Wqt}var Wz=Gz(),$qt=zz(),Yqt=$qt.getHighWaterMark,Qh=Xh().codes,Jqt=Qh.ERR_INVALID_ARG_TYPE,Xqt=Qh.ERR_METHOD_NOT_IMPLEMENTED,Qqt=Qh.ERR_MULTIPLE_CALLBACK,Zqt=Qh.ERR_STREAM_CANNOT_PIPE,eNt=Qh.ERR_STREAM_DESTROYED,tNt=Qh.ERR_STREAM_NULL_VALUES,rNt=Qh.ERR_STREAM_WRITE_AFTER_END,nNt=Qh.ERR_UNKNOWN_ENCODING,Ob=Wz.errorOrDestroy;tr()(si,q8e);function iNt(){}function T2(e,t,r){Bb=Bb||d0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Bb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=Yqt(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){fNt(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new M8e(this)}T2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(T2.prototype,"buffer",{get:Hqt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var tF;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(tF=Function.prototype[Symbol.hasInstance],Object.defineProperty(si,Symbol.hasInstance,{value:function(t){return tF.call(this,t)?!0:this!==si?!1:t&&t._writableState instanceof T2}})):tF=function(t){return t instanceof this};function si(e){Bb=Bb||d0();var t=this instanceof Bb;if(!t&&!tF.call(si,this))return new si(e);this._writableState=new T2(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),q8e.call(this)}si.prototype.pipe=function(){Ob(this,new Zqt)};function aNt(e,t){var r=new rNt;Ob(e,r),process.nextTick(t,r)}function oNt(e,t,r,n){var i;return r===null?i=new tNt:typeof r!="string"&&!t.objectMode&&(i=new Jqt("chunk",["string","Buffer"],r)),i?(Ob(e,i),process.nextTick(n,i),!1):!0}si.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&Kqt(e);return a&&!rF.isBuffer(e)&&(e=Vqt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=iNt),n.ending?aNt(this,r):(a||oNt(this,n,e,r))&&(n.pendingcb++,i=uNt(this,n,a,e,t,r)),i};si.prototype.cork=function(){this._writableState.corked++};si.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&N8e(this,e))};si.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new nNt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(si.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function sNt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=rF.from(t,r)),t}Object.defineProperty(si.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function uNt(e,t,r,n,i,a){if(!r){var o=sNt(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else Hz(e,t,!1,s,n,i,a);return u}function Hz(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new eNt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function cNt(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(S2,e,t),e._writableState.errorEmitted=!0,Ob(e,n)):(i(n),e._writableState.errorEmitted=!0,Ob(e,n),S2(e,t))}function lNt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function fNt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new Qqt;if(lNt(r),t)cNt(e,r,n,t,i);else{var a=U8e(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&N8e(e,r),n?process.nextTick(L8e,e,r,a,i):L8e(e,r,a,i)}}function L8e(e,t,r,n){r||hNt(e,t),t.pendingcb--,n(),S2(e,t)}function hNt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function N8e(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var o=0,s=!0;r;)i[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;i.allBuffers=s,Hz(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new M8e(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(Hz(e,t,!1,f,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}si.prototype._write=function(e,t,r){r(new Xqt("_write()"))};si.prototype._writev=null;si.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||mNt(this,n,r),this};Object.defineProperty(si.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function U8e(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function pNt(e,t){e._final(function(r){t.pendingcb--,r&&Ob(e,r),t.prefinished=!0,e.emit("prefinish"),S2(e,t)})}function dNt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(pNt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function S2(e,t){var r=U8e(t);if(r&&(dNt(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function mNt(e,t,r){t.ending=!0,S2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function gNt(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(si.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});si.prototype.destroy=Wz.destroy;si.prototype._undestroy=Wz.undestroy;si.prototype._destroy=function(e,t){t(e)}});var d0=v((N3r,H8e)=>{"use strict";var vNt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};H8e.exports=Pc;var z8e=Yz(),$z=Vz();tr()(Pc,z8e);for(Kz=vNt($z.prototype),nF=0;nF<Kz.length;nF++)iF=Kz[nF],Pc.prototype[iF]||(Pc.prototype[iF]=$z.prototype[iF]);var Kz,iF,nF;function Pc(e){if(!(this instanceof Pc))return new Pc(e);z8e.call(this,e),$z.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",bNt)))}Object.defineProperty(Pc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Pc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Pc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function bNt(){this._writableState.ended||process.nextTick(yNt,this)}function yNt(e){e.end()}Object.defineProperty(Pc.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var Qz=v(V8e=>{"use strict";var Xz=Us().Buffer,W8e=Xz.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function xNt(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function _Nt(e){var t=xNt(e);if(typeof t!="string"&&(Xz.isEncoding===W8e||!W8e(e)))throw new Error("Unknown encoding: "+e);return t||e}V8e.StringDecoder=C2;function C2(e){this.encoding=_Nt(e);var t;switch(this.encoding){case"utf16le":this.text=CNt,this.end=DNt,t=4;break;case"utf8":this.fillLast=ANt,t=4;break;case"base64":this.text=FNt,this.end=kNt,t=3;break;default:this.write=BNt,this.end=ONt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Xz.allocUnsafe(t)}C2.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};C2.prototype.end=TNt;C2.prototype.text=SNt;C2.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Jz(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function wNt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=Jz(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=Jz(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=Jz(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function ENt(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function ANt(e){var t=this.lastTotal-this.lastNeed,r=ENt(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function SNt(e,t){var r=wNt(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function TNt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function CNt(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function DNt(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function FNt(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function kNt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function BNt(e){return e.toString(this.encoding)}function ONt(e){return e&&e.length?this.write(e):""}});var aF=v((G3r,Y8e)=>{"use strict";var K8e=Xh().codes.ERR_STREAM_PREMATURE_CLOSE;function INt(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function PNt(){}function RNt(e){return e.setHeader&&typeof e.abort=="function"}function $8e(e,t,r){if(typeof t=="function")return $8e(e,null,t);t||(t={}),r=INt(r||PNt);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,a=function(){e.writable||s()},o=e._writableState&&e._writableState.finished,s=function(){i=!1,o=!0,n||r.call(e)},u=e._readableState&&e._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(e)},l=function(d){r.call(e,d)},f=function(){var d;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(d=new K8e),r.call(e,d);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(d=new K8e),r.call(e,d)},h=function(){e.req.on("finish",s)};return RNt(e)?(e.on("complete",s),e.on("abort",f),e.req?h():e.on("request",h)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",h),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}Y8e.exports=$8e});var X8e=v((z3r,J8e)=>{"use strict";var oF;function Zh(e,t,r){return t=jNt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jNt(e){var t=LNt(e,"string");return typeof t=="symbol"?t:String(t)}function LNt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var MNt=aF(),ep=Symbol("lastResolve"),m0=Symbol("lastReject"),D2=Symbol("error"),sF=Symbol("ended"),g0=Symbol("lastPromise"),Zz=Symbol("handlePromise"),v0=Symbol("stream");function tp(e,t){return{value:e,done:t}}function qNt(e){var t=e[ep];if(t!==null){var r=e[v0].read();r!==null&&(e[g0]=null,e[ep]=null,e[m0]=null,t(tp(r,!1)))}}function NNt(e){process.nextTick(qNt,e)}function UNt(e,t){return function(r,n){e.then(function(){if(t[sF]){r(tp(void 0,!0));return}t[Zz](r,n)},n)}}var GNt=Object.getPrototypeOf(function(){}),zNt=Object.setPrototypeOf((oF={get stream(){return this[v0]},next:function(){var t=this,r=this[D2];if(r!==null)return Promise.reject(r);if(this[sF])return Promise.resolve(tp(void 0,!0));if(this[v0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[D2]?s(t[D2]):o(tp(void 0,!0))})});var n=this[g0],i;if(n)i=new Promise(UNt(n,this));else{var a=this[v0].read();if(a!==null)return Promise.resolve(tp(a,!1));i=new Promise(this[Zz])}return this[g0]=i,i}},Zh(oF,Symbol.asyncIterator,function(){return this}),Zh(oF,"return",function(){var t=this;return new Promise(function(r,n){t[v0].destroy(null,function(i){if(i){n(i);return}r(tp(void 0,!0))})})}),oF),GNt),HNt=function(t){var r,n=Object.create(zNt,(r={},Zh(r,v0,{value:t,writable:!0}),Zh(r,ep,{value:null,writable:!0}),Zh(r,m0,{value:null,writable:!0}),Zh(r,D2,{value:null,writable:!0}),Zh(r,sF,{value:t._readableState.endEmitted,writable:!0}),Zh(r,Zz,{value:function(a,o){var s=n[v0].read();s?(n[g0]=null,n[ep]=null,n[m0]=null,a(tp(s,!1))):(n[ep]=a,n[m0]=o)},writable:!0}),r));return n[g0]=null,MNt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[m0];a!==null&&(n[g0]=null,n[ep]=null,n[m0]=null,a(i)),n[D2]=i;return}var o=n[ep];o!==null&&(n[g0]=null,n[ep]=null,n[m0]=null,o(tp(void 0,!0))),n[sF]=!0}),t.on("readable",NNt.bind(null,n)),n};J8e.exports=HNt});var tDe=v((H3r,eDe)=>{"use strict";function Q8e(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){r(c);return}s.done?t(u):Promise.resolve(u).then(n,i)}function WNt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){Q8e(a,n,i,o,s,"next",u)}function s(u){Q8e(a,n,i,o,s,"throw",u)}o(void 0)})}}function Z8e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function VNt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Z8e(Object(r),!0).forEach(function(n){KNt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z8e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function KNt(e,t,r){return t=$Nt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $Nt(e){var t=YNt(e,"string");return typeof t=="symbol"?t:String(t)}function YNt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var JNt=Xh().codes.ERR_INVALID_ARG_TYPE;function XNt(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new JNt("iterable",["Iterable"],t);var i=new e(VNt({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=WNt(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?o():a=!1}catch(f){i.destroy(f)}}),s.apply(this,arguments)}return i}eDe.exports=XNt});var Yz=v((V3r,fDe)=>{"use strict";fDe.exports=Ur;var Ib;Ur.ReadableState=aDe;var W3r=require("events").EventEmitter,iDe=function(t,r){return t.listeners(r).length},k2=qz(),uF=require("buffer").Buffer,QNt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function ZNt(e){return uF.from(e)}function eUt(e){return uF.isBuffer(e)||e instanceof QNt}var eH=require("util"),br;eH&&eH.debuglog?br=eH.debuglog("stream"):br=function(){};var tUt=k8e(),sH=Gz(),rUt=zz(),nUt=rUt.getHighWaterMark,cF=Xh().codes,iUt=cF.ERR_INVALID_ARG_TYPE,aUt=cF.ERR_STREAM_PUSH_AFTER_EOF,oUt=cF.ERR_METHOD_NOT_IMPLEMENTED,sUt=cF.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Pb,tH,rH;tr()(Ur,k2);var F2=sH.errorOrDestroy,nH=["error","close","destroy","pause","resume"];function uUt(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function aDe(e,t,r){Ib=Ib||d0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Ib),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=nUt(this,e,"readableHighWaterMark",r),this.buffer=new tUt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Pb||(Pb=Qz().StringDecoder),this.decoder=new Pb(e.encoding),this.encoding=e.encoding)}function Ur(e){if(Ib=Ib||d0(),!(this instanceof Ur))return new Ur(e);var t=this instanceof Ib;this._readableState=new aDe(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),k2.call(this)}Object.defineProperty(Ur.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});Ur.prototype.destroy=sH.destroy;Ur.prototype._undestroy=sH.undestroy;Ur.prototype._destroy=function(e,t){t(e)};Ur.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=uF.from(e,t),t=""),n=!0),oDe(this,e,t,!1,n)};Ur.prototype.unshift=function(e){return oDe(this,e,null,!0,!1)};function oDe(e,t,r,n,i){br("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,fUt(e,a);else{var o;if(i||(o=cUt(a,t)),o)F2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==uF.prototype&&(t=ZNt(t)),n)a.endEmitted?F2(e,new sUt):iH(e,a,t,!0);else if(a.ended)F2(e,new aUt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?iH(e,a,t,!1):oH(e,a)):iH(e,a,t,!1)}else n||(a.reading=!1,oH(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function iH(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&lF(e)),oH(e,t)}function cUt(e,t){var r;return!eUt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new iUt("chunk",["string","Buffer","Uint8Array"],t)),r}Ur.prototype.isPaused=function(){return this._readableState.flowing===!1};Ur.prototype.setEncoding=function(e){Pb||(Pb=Qz().StringDecoder);var t=new Pb(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var rDe=1073741824;function lUt(e){return e>=rDe?e=rDe:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function nDe(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=lUt(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Ur.prototype.read=function(e){br("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return br("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?aH(this):lF(this),null;if(e=nDe(e,t),e===0&&t.ended)return t.length===0&&aH(this),null;var n=t.needReadable;br("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,br("length less than watermark",n)),t.ended||t.reading?(n=!1,br("reading or ended",n)):n&&(br("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=nDe(r,t)));var i;return e>0?i=cDe(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&aH(this)),i!==null&&this.emit("data",i),i};function fUt(e,t){if(br("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?lF(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,sDe(e)))}}function lF(e){var t=e._readableState;br("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(br("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(sDe,e))}function sDe(e){var t=e._readableState;br("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,uH(e)}function oH(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(hUt,e,t))}function hUt(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(br("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}Ur.prototype._read=function(e){F2(this,new oUt("_read()"))};Ur.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,br("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?s:b;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",o);function o(g,x){br("onunpipe"),g===r&&x&&x.hasUnpiped===!1&&(x.hasUnpiped=!0,l())}function s(){br("onend"),e.end()}var u=pUt(r);e.on("drain",u);var c=!1;function l(){br("cleanup"),e.removeListener("close",p),e.removeListener("finish",d),e.removeListener("drain",u),e.removeListener("error",h),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){br("ondata");var x=e.write(g);br("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&lDe(n.pipes,e)!==-1)&&!c&&(br("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(g){br("onerror",g),b(),e.removeListener("error",h),iDe(e,"error")===0&&F2(e,g)}uUt(e,"error",h);function p(){e.removeListener("finish",d),b()}e.once("close",p);function d(){br("onfinish"),e.removeListener("close",p),b()}e.once("finish",d);function b(){br("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(br("pipe resume"),r.resume()),e};function pUt(e){return function(){var r=e._readableState;br("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&iDe(e,"data")&&(r.flowing=!0,uH(e))}}Ur.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=lDe(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};Ur.prototype.on=function(e,t){var r=k2.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,br("on readable",n.length,n.reading),n.length?lF(this):n.reading||process.nextTick(dUt,this)),r};Ur.prototype.addListener=Ur.prototype.on;Ur.prototype.removeListener=function(e,t){var r=k2.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(uDe,this),r};Ur.prototype.removeAllListeners=function(e){var t=k2.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(uDe,this),t};function uDe(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function dUt(e){br("readable nexttick read 0"),e.read(0)}Ur.prototype.resume=function(){var e=this._readableState;return e.flowing||(br("resume"),e.flowing=!e.readableListening,mUt(this,e)),e.paused=!1,this};function mUt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(gUt,e,t))}function gUt(e,t){br("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),uH(e),t.flowing&&!t.reading&&e.read(0)}Ur.prototype.pause=function(){return br("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(br("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function uH(e){var t=e._readableState;for(br("flow",t.flowing);t.flowing&&e.read()!==null;);}Ur.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(br("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&t.push(o)}t.push(null)}),e.on("data",function(o){if(br("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var s=t.push(o);s||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(s){return function(){return e[s].apply(e,arguments)}}(i));for(var a=0;a<nH.length;a++)e.on(nH[a],this.emit.bind(this,nH[a]));return this._read=function(o){br("wrapped _read",o),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(Ur.prototype[Symbol.asyncIterator]=function(){return tH===void 0&&(tH=X8e()),tH(this)});Object.defineProperty(Ur.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Ur.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Ur.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});Ur._fromList=cDe;Object.defineProperty(Ur.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function cDe(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function aH(e){var t=e._readableState;br("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(vUt,t,e))}function vUt(e,t){if(br("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(Ur.from=function(e,t){return rH===void 0&&(rH=tDe()),rH(Ur,e,t)});function lDe(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var cH=v((K3r,pDe)=>{"use strict";pDe.exports=$l;var fF=Xh().codes,bUt=fF.ERR_METHOD_NOT_IMPLEMENTED,yUt=fF.ERR_MULTIPLE_CALLBACK,xUt=fF.ERR_TRANSFORM_ALREADY_TRANSFORMING,_Ut=fF.ERR_TRANSFORM_WITH_LENGTH_0,hF=d0();tr()($l,hF);function wUt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new yUt);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function $l(e){if(!(this instanceof $l))return new $l(e);hF.call(this,e),this._transformState={afterTransform:wUt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",EUt)}function EUt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){hDe(e,t,r)}):hDe(this,null,null)}$l.prototype.push=function(e,t){return this._transformState.needTransform=!1,hF.prototype.push.call(this,e,t)};$l.prototype._transform=function(e,t,r){r(new bUt("_transform()"))};$l.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};$l.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};$l.prototype._destroy=function(e,t){hF.prototype._destroy.call(this,e,function(r){t(r)})};function hDe(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new _Ut;if(e._transformState.transforming)throw new xUt;return e.push(null)}});var gDe=v(($3r,mDe)=>{"use strict";mDe.exports=B2;var dDe=cH();tr()(B2,dDe);function B2(e){if(!(this instanceof B2))return new B2(e);dDe.call(this,e)}B2.prototype._transform=function(e,t,r){r(null,e)}});var _De=v((Y3r,xDe)=>{"use strict";var lH;function AUt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var yDe=Xh().codes,SUt=yDe.ERR_MISSING_ARGS,TUt=yDe.ERR_STREAM_DESTROYED;function vDe(e){if(e)throw e}function CUt(e){return e.setHeader&&typeof e.abort=="function"}function DUt(e,t,r,n){n=AUt(n);var i=!1;e.on("close",function(){i=!0}),lH===void 0&&(lH=aF()),lH(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var a=!1;return function(o){if(!i&&!a){if(a=!0,CUt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new TUt("pipe"))}}}function bDe(e){e()}function FUt(e,t){return e.pipe(t)}function kUt(e){return!e.length||typeof e[e.length-1]!="function"?vDe:e.pop()}function BUt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=kUt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new SUt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return DUt(o,u,c,function(l){i||(i=l),l&&a.forEach(bDe),!u&&(a.forEach(bDe),n(i))})});return t.reduce(FUt)}xDe.exports=BUt});var fH=v((ks,I2)=>{var O2=require("stream");process.env.READABLE_STREAM==="disable"&&O2?(I2.exports=O2.Readable,Object.assign(I2.exports,O2),I2.exports.Stream=O2):(ks=I2.exports=Yz(),ks.Stream=O2||ks,ks.Readable=ks,ks.Writable=Vz(),ks.Duplex=d0(),ks.Transform=cH(),ks.PassThrough=gDe(),ks.finished=aF(),ks.pipeline=_De())});var pH=v((J3r,wDe)=>{var OUt=require("stream").Stream,IUt=fH().PassThrough,hH=wDe.exports={};hH.isStream=function(e){return e instanceof OUt};hH.normalizeInputSource=function(e){if(e===null)return Buffer.alloc(0);if(typeof e=="string")return Buffer.from(e);if(hH.isStream(e)&&!e._readableState){var t=new IUt;return e.pipe(t),t}return e}});var mH=v((X3r,ADe)=>{var PUt=require("util").inherits,dH=fH().Transform,RUt=X4(),EDe=pH(),No=ADe.exports=function(e){if(!(this instanceof No))return new No(e);dH.call(this,e),this.offset=0,this._archive={finish:!1,finished:!1,processing:!1}};PUt(No,dH);No.prototype._appendBuffer=function(e,t,r){};No.prototype._appendStream=function(e,t,r){};No.prototype._emitErrorCallback=function(e){e&&this.emit("error",e)};No.prototype._finish=function(e){};No.prototype._normalizeEntry=function(e){};No.prototype._transform=function(e,t,r){r(null,e)};No.prototype.entry=function(e,t,r){if(t=t||null,typeof r!="function"&&(r=this._emitErrorCallback.bind(this)),!(e instanceof RUt)){r(new Error("not a valid instance of ArchiveEntry"));return}if(this._archive.finish||this._archive.finished){r(new Error("unacceptable entry after finish"));return}if(this._archive.processing){r(new Error("already processing an entry"));return}if(this._archive.processing=!0,this._normalizeEntry(e),this._entry=e,t=EDe.normalizeInputSource(t),Buffer.isBuffer(t))this._appendBuffer(e,t,r);else if(EDe.isStream(t))this._appendStream(e,t,r);else{this._archive.processing=!1,r(new Error("input source must be valid Stream or Buffer instance"));return}return this};No.prototype.finish=function(){if(this._archive.processing){this._archive.finish=!0;return}this._finish()};No.prototype.getBytesWritten=function(){return this.offset};No.prototype.write=function(e,t){return e&&(this.offset+=e.length),dH.prototype.write.call(this,e,t)}});var yH=v((Q3r,TDe)=>{var rp=require("buffer").Buffer,gH=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(gH=new Int32Array(gH));function SDe(e){if(rp.isBuffer(e))return e;var t=typeof rp.alloc=="function"&&typeof rp.from=="function";if(typeof e=="number")return t?rp.alloc(e):new rp(e);if(typeof e=="string")return t?rp.from(e):new rp(e);throw new Error("input must be buffer, number, or string, received "+typeof e)}function jUt(e){var t=SDe(4);return t.writeInt32BE(e,0),t}function vH(e,t){e=SDe(e),rp.isBuffer(t)&&(t=t.readUInt32BE(0));for(var r=~~t^-1,n=0;n<e.length;n++)r=gH[(r^e[n])&255]^r>>>8;return r^-1}function bH(){return jUt(vH.apply(null,arguments))}bH.signed=function(){return vH.apply(null,arguments)};bH.unsigned=function(){return vH.apply(null,arguments)>>>0};TDe.exports=bH});var xH=v((Z3r,CDe)=>{CDe.exports=require("stream")});var IDe=v((eCr,ODe)=>{"use strict";function DDe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function FDe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?DDe(Object(r),!0).forEach(function(n){LUt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DDe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function LUt(e,t,r){return t=BDe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MUt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kDe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,BDe(n.key),n)}}function qUt(e,t,r){return t&&kDe(e.prototype,t),r&&kDe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function BDe(e){var t=NUt(e,"string");return typeof t=="symbol"?t:String(t)}function NUt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var UUt=require("buffer"),pF=UUt.Buffer,GUt=require("util"),_H=GUt.inspect,zUt=_H&&_H.custom||"inspect";function HUt(e,t,r){pF.prototype.copy.call(e,t,r)}ODe.exports=function(){function e(){MUt(this,e),this.head=null,this.tail=null,this.length=0}return qUt(e,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return pF.alloc(0);for(var n=pF.allocUnsafe(r>>>0),i=this.head,a=0;i;)HUt(i.data,n,a),a+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,a=n.data;for(r-=a.length;n=n.next;){var o=n.data,s=r>o.length?o.length:r;if(s===o.length?a+=o:a+=o.slice(0,r),r-=s,r===0){s===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(s));break}++i}return this.length-=i,a}},{key:"_getBuffer",value:function(r){var n=pF.allocUnsafe(r),i=this.head,a=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var o=i.data,s=r>o.length?o.length:r;if(o.copy(n,n.length-r,0,s),r-=s,r===0){s===o.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(s));break}++a}return this.length-=a,n}},{key:zUt,value:function(r,n){return _H(this,FDe(FDe({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var EH=v((tCr,RDe)=>{"use strict";function WUt(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(wH,this,e)):process.nextTick(wH,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(dF,r):(r._writableState.errorEmitted=!0,process.nextTick(PDe,r,a)):process.nextTick(PDe,r,a):t?(process.nextTick(dF,r),t(a)):process.nextTick(dF,r)}),this)}function PDe(e,t){wH(e,t),dF(e)}function dF(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function VUt(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function wH(e,t){e.emit("error",t)}function KUt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}RDe.exports={destroy:WUt,undestroy:VUt,errorOrDestroy:KUt}});var np=v((rCr,MDe)=>{"use strict";var LDe={};function Bs(e,t,r){r||(r=Error);function n(a,o,s){return typeof t=="string"?t:t(a,o,s)}class i extends r{constructor(o,s,u){super(n(o,s,u))}}i.prototype.name=r.name,i.prototype.code=e,LDe[e]=i}function jDe(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function $Ut(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function YUt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function JUt(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Bs("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Bs("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&$Ut(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(YUt(e," argument"))i=`The ${e} ${n} ${jDe(t,"type")}`;else{let a=JUt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${jDe(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);Bs("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Bs("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Bs("ERR_STREAM_PREMATURE_CLOSE","Premature close");Bs("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Bs("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Bs("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Bs("ERR_STREAM_WRITE_AFTER_END","write after end");Bs("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Bs("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Bs("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");MDe.exports.codes=LDe});var AH=v((nCr,qDe)=>{"use strict";var XUt=np().codes.ERR_INVALID_OPT_VALUE;function QUt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function ZUt(e,t,r,n){var i=QUt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new XUt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}qDe.exports={getHighWaterMark:ZUt}});var CH=v((iCr,WDe)=>{"use strict";WDe.exports=ui;function UDe(e){var t=this;this.next=null,this.entry=null,this.finish=function(){TGt(t,e)}}var Rb;ui.WritableState=R2;var eGt={deprecate:ld()},GDe=xH(),gF=require("buffer").Buffer,tGt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function rGt(e){return gF.from(e)}function nGt(e){return gF.isBuffer(e)||e instanceof tGt}var TH=EH(),iGt=AH(),aGt=iGt.getHighWaterMark,ip=np().codes,oGt=ip.ERR_INVALID_ARG_TYPE,sGt=ip.ERR_METHOD_NOT_IMPLEMENTED,uGt=ip.ERR_MULTIPLE_CALLBACK,cGt=ip.ERR_STREAM_CANNOT_PIPE,lGt=ip.ERR_STREAM_DESTROYED,fGt=ip.ERR_STREAM_NULL_VALUES,hGt=ip.ERR_STREAM_WRITE_AFTER_END,pGt=ip.ERR_UNKNOWN_ENCODING,jb=TH.errorOrDestroy;tr()(ui,GDe);function dGt(){}function R2(e,t,r){Rb=Rb||b0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Rb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=aGt(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){_Gt(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new UDe(this)}R2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(R2.prototype,"buffer",{get:eGt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var mF;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(mF=Function.prototype[Symbol.hasInstance],Object.defineProperty(ui,Symbol.hasInstance,{value:function(t){return mF.call(this,t)?!0:this!==ui?!1:t&&t._writableState instanceof R2}})):mF=function(t){return t instanceof this};function ui(e){Rb=Rb||b0();var t=this instanceof Rb;if(!t&&!mF.call(ui,this))return new ui(e);this._writableState=new R2(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),GDe.call(this)}ui.prototype.pipe=function(){jb(this,new cGt)};function mGt(e,t){var r=new hGt;jb(e,r),process.nextTick(t,r)}function gGt(e,t,r,n){var i;return r===null?i=new fGt:typeof r!="string"&&!t.objectMode&&(i=new oGt("chunk",["string","Buffer"],r)),i?(jb(e,i),process.nextTick(n,i),!1):!0}ui.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&nGt(e);return a&&!gF.isBuffer(e)&&(e=rGt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=dGt),n.ending?mGt(this,r):(a||gGt(this,n,e,r))&&(n.pendingcb++,i=bGt(this,n,a,e,t,r)),i};ui.prototype.cork=function(){this._writableState.corked++};ui.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&zDe(this,e))};ui.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new pGt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(ui.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function vGt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=gF.from(t,r)),t}Object.defineProperty(ui.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function bGt(e,t,r,n,i,a){if(!r){var o=vGt(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else SH(e,t,!1,s,n,i,a);return u}function SH(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new lGt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function yGt(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(P2,e,t),e._writableState.errorEmitted=!0,jb(e,n)):(i(n),e._writableState.errorEmitted=!0,jb(e,n),P2(e,t))}function xGt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function _Gt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new uGt;if(xGt(r),t)yGt(e,r,n,t,i);else{var a=HDe(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&zDe(e,r),n?process.nextTick(NDe,e,r,a,i):NDe(e,r,a,i)}}function NDe(e,t,r,n){r||wGt(e,t),t.pendingcb--,n(),P2(e,t)}function wGt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function zDe(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var o=0,s=!0;r;)i[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;i.allBuffers=s,SH(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new UDe(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(SH(e,t,!1,f,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}ui.prototype._write=function(e,t,r){r(new sGt("_write()"))};ui.prototype._writev=null;ui.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||SGt(this,n,r),this};Object.defineProperty(ui.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function HDe(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function EGt(e,t){e._final(function(r){t.pendingcb--,r&&jb(e,r),t.prefinished=!0,e.emit("prefinish"),P2(e,t)})}function AGt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(EGt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function P2(e,t){var r=HDe(t);if(r&&(AGt(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function SGt(e,t,r){t.ending=!0,P2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function TGt(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(ui.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});ui.prototype.destroy=TH.destroy;ui.prototype._undestroy=TH.undestroy;ui.prototype._destroy=function(e,t){t(e)}});var b0=v((aCr,KDe)=>{"use strict";var CGt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};KDe.exports=Rc;var VDe=kH(),FH=CH();tr()(Rc,VDe);for(DH=CGt(FH.prototype),vF=0;vF<DH.length;vF++)bF=DH[vF],Rc.prototype[bF]||(Rc.prototype[bF]=FH.prototype[bF]);var DH,bF,vF;function Rc(e){if(!(this instanceof Rc))return new Rc(e);VDe.call(this,e),FH.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",DGt)))}Object.defineProperty(Rc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Rc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Rc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function DGt(){this._writableState.ended||process.nextTick(FGt,this)}function FGt(e){e.end()}Object.defineProperty(Rc.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var IH=v(YDe=>{"use strict";var OH=Us().Buffer,$De=OH.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function kGt(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function BGt(e){var t=kGt(e);if(typeof t!="string"&&(OH.isEncoding===$De||!$De(e)))throw new Error("Unknown encoding: "+e);return t||e}YDe.StringDecoder=j2;function j2(e){this.encoding=BGt(e);var t;switch(this.encoding){case"utf16le":this.text=LGt,this.end=MGt,t=4;break;case"utf8":this.fillLast=PGt,t=4;break;case"base64":this.text=qGt,this.end=NGt,t=3;break;default:this.write=UGt,this.end=GGt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=OH.allocUnsafe(t)}j2.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};j2.prototype.end=jGt;j2.prototype.text=RGt;j2.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function BH(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function OGt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=BH(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=BH(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=BH(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function IGt(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function PGt(e){var t=this.lastTotal-this.lastNeed,r=IGt(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function RGt(e,t){var r=OGt(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function jGt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function LGt(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function MGt(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function qGt(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function NGt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function UGt(e){return e.toString(this.encoding)}function GGt(e){return e&&e.length?this.write(e):""}});var yF=v((sCr,QDe)=>{"use strict";var JDe=np().codes.ERR_STREAM_PREMATURE_CLOSE;function zGt(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function HGt(){}function WGt(e){return e.setHeader&&typeof e.abort=="function"}function XDe(e,t,r){if(typeof t=="function")return XDe(e,null,t);t||(t={}),r=zGt(r||HGt);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,a=function(){e.writable||s()},o=e._writableState&&e._writableState.finished,s=function(){i=!1,o=!0,n||r.call(e)},u=e._readableState&&e._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(e)},l=function(d){r.call(e,d)},f=function(){var d;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(d=new JDe),r.call(e,d);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(d=new JDe),r.call(e,d)},h=function(){e.req.on("finish",s)};return WGt(e)?(e.on("complete",s),e.on("abort",f),e.req?h():e.on("request",h)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",h),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}QDe.exports=XDe});var e4e=v((uCr,ZDe)=>{"use strict";var xF;function ap(e,t,r){return t=VGt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VGt(e){var t=KGt(e,"string");return typeof t=="symbol"?t:String(t)}function KGt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $Gt=yF(),op=Symbol("lastResolve"),y0=Symbol("lastReject"),L2=Symbol("error"),_F=Symbol("ended"),x0=Symbol("lastPromise"),PH=Symbol("handlePromise"),_0=Symbol("stream");function sp(e,t){return{value:e,done:t}}function YGt(e){var t=e[op];if(t!==null){var r=e[_0].read();r!==null&&(e[x0]=null,e[op]=null,e[y0]=null,t(sp(r,!1)))}}function JGt(e){process.nextTick(YGt,e)}function XGt(e,t){return function(r,n){e.then(function(){if(t[_F]){r(sp(void 0,!0));return}t[PH](r,n)},n)}}var QGt=Object.getPrototypeOf(function(){}),ZGt=Object.setPrototypeOf((xF={get stream(){return this[_0]},next:function(){var t=this,r=this[L2];if(r!==null)return Promise.reject(r);if(this[_F])return Promise.resolve(sp(void 0,!0));if(this[_0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[L2]?s(t[L2]):o(sp(void 0,!0))})});var n=this[x0],i;if(n)i=new Promise(XGt(n,this));else{var a=this[_0].read();if(a!==null)return Promise.resolve(sp(a,!1));i=new Promise(this[PH])}return this[x0]=i,i}},ap(xF,Symbol.asyncIterator,function(){return this}),ap(xF,"return",function(){var t=this;return new Promise(function(r,n){t[_0].destroy(null,function(i){if(i){n(i);return}r(sp(void 0,!0))})})}),xF),QGt),ezt=function(t){var r,n=Object.create(ZGt,(r={},ap(r,_0,{value:t,writable:!0}),ap(r,op,{value:null,writable:!0}),ap(r,y0,{value:null,writable:!0}),ap(r,L2,{value:null,writable:!0}),ap(r,_F,{value:t._readableState.endEmitted,writable:!0}),ap(r,PH,{value:function(a,o){var s=n[_0].read();s?(n[x0]=null,n[op]=null,n[y0]=null,a(sp(s,!1))):(n[op]=a,n[y0]=o)},writable:!0}),r));return n[x0]=null,$Gt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[y0];a!==null&&(n[x0]=null,n[op]=null,n[y0]=null,a(i)),n[L2]=i;return}var o=n[op];o!==null&&(n[x0]=null,n[op]=null,n[y0]=null,o(sp(void 0,!0))),n[_F]=!0}),t.on("readable",JGt.bind(null,n)),n};ZDe.exports=ezt});var i4e=v((cCr,n4e)=>{"use strict";function t4e(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){r(c);return}s.done?t(u):Promise.resolve(u).then(n,i)}function tzt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){t4e(a,n,i,o,s,"next",u)}function s(u){t4e(a,n,i,o,s,"throw",u)}o(void 0)})}}function r4e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function rzt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?r4e(Object(r),!0).forEach(function(n){nzt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):r4e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nzt(e,t,r){return t=izt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function izt(e){var t=azt(e,"string");return typeof t=="symbol"?t:String(t)}function azt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ozt=np().codes.ERR_INVALID_ARG_TYPE;function szt(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new ozt("iterable",["Iterable"],t);var i=new e(rzt({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=tzt(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?o():a=!1}catch(f){i.destroy(f)}}),s.apply(this,arguments)}return i}n4e.exports=szt});var kH=v((fCr,d4e)=>{"use strict";d4e.exports=Gr;var Lb;Gr.ReadableState=u4e;var lCr=require("events").EventEmitter,s4e=function(t,r){return t.listeners(r).length},q2=xH(),wF=require("buffer").Buffer,uzt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function czt(e){return wF.from(e)}function lzt(e){return wF.isBuffer(e)||e instanceof uzt}var RH=require("util"),yr;RH&&RH.debuglog?yr=RH.debuglog("stream"):yr=function(){};var fzt=IDe(),GH=EH(),hzt=AH(),pzt=hzt.getHighWaterMark,EF=np().codes,dzt=EF.ERR_INVALID_ARG_TYPE,mzt=EF.ERR_STREAM_PUSH_AFTER_EOF,gzt=EF.ERR_METHOD_NOT_IMPLEMENTED,vzt=EF.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Mb,jH,LH;tr()(Gr,q2);var M2=GH.errorOrDestroy,MH=["error","close","destroy","pause","resume"];function bzt(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function u4e(e,t,r){Lb=Lb||b0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Lb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=pzt(this,e,"readableHighWaterMark",r),this.buffer=new fzt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Mb||(Mb=IH().StringDecoder),this.decoder=new Mb(e.encoding),this.encoding=e.encoding)}function Gr(e){if(Lb=Lb||b0(),!(this instanceof Gr))return new Gr(e);var t=this instanceof Lb;this._readableState=new u4e(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),q2.call(this)}Object.defineProperty(Gr.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});Gr.prototype.destroy=GH.destroy;Gr.prototype._undestroy=GH.undestroy;Gr.prototype._destroy=function(e,t){t(e)};Gr.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=wF.from(e,t),t=""),n=!0),c4e(this,e,t,!1,n)};Gr.prototype.unshift=function(e){return c4e(this,e,null,!0,!1)};function c4e(e,t,r,n,i){yr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,_zt(e,a);else{var o;if(i||(o=yzt(a,t)),o)M2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==wF.prototype&&(t=czt(t)),n)a.endEmitted?M2(e,new vzt):qH(e,a,t,!0);else if(a.ended)M2(e,new mzt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?qH(e,a,t,!1):UH(e,a)):qH(e,a,t,!1)}else n||(a.reading=!1,UH(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function qH(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&AF(e)),UH(e,t)}function yzt(e,t){var r;return!lzt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new dzt("chunk",["string","Buffer","Uint8Array"],t)),r}Gr.prototype.isPaused=function(){return this._readableState.flowing===!1};Gr.prototype.setEncoding=function(e){Mb||(Mb=IH().StringDecoder);var t=new Mb(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var a4e=1073741824;function xzt(e){return e>=a4e?e=a4e:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function o4e(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=xzt(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Gr.prototype.read=function(e){yr("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return yr("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?NH(this):AF(this),null;if(e=o4e(e,t),e===0&&t.ended)return t.length===0&&NH(this),null;var n=t.needReadable;yr("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,yr("length less than watermark",n)),t.ended||t.reading?(n=!1,yr("reading or ended",n)):n&&(yr("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=o4e(r,t)));var i;return e>0?i=h4e(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&NH(this)),i!==null&&this.emit("data",i),i};function _zt(e,t){if(yr("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?AF(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,l4e(e)))}}function AF(e){var t=e._readableState;yr("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(yr("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(l4e,e))}function l4e(e){var t=e._readableState;yr("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,zH(e)}function UH(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(wzt,e,t))}function wzt(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(yr("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}Gr.prototype._read=function(e){M2(this,new gzt("_read()"))};Gr.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,yr("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?s:b;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",o);function o(g,x){yr("onunpipe"),g===r&&x&&x.hasUnpiped===!1&&(x.hasUnpiped=!0,l())}function s(){yr("onend"),e.end()}var u=Ezt(r);e.on("drain",u);var c=!1;function l(){yr("cleanup"),e.removeListener("close",p),e.removeListener("finish",d),e.removeListener("drain",u),e.removeListener("error",h),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){yr("ondata");var x=e.write(g);yr("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&p4e(n.pipes,e)!==-1)&&!c&&(yr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(g){yr("onerror",g),b(),e.removeListener("error",h),s4e(e,"error")===0&&M2(e,g)}bzt(e,"error",h);function p(){e.removeListener("finish",d),b()}e.once("close",p);function d(){yr("onfinish"),e.removeListener("close",p),b()}e.once("finish",d);function b(){yr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(yr("pipe resume"),r.resume()),e};function Ezt(e){return function(){var r=e._readableState;yr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&s4e(e,"data")&&(r.flowing=!0,zH(e))}}Gr.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=p4e(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};Gr.prototype.on=function(e,t){var r=q2.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,yr("on readable",n.length,n.reading),n.length?AF(this):n.reading||process.nextTick(Azt,this)),r};Gr.prototype.addListener=Gr.prototype.on;Gr.prototype.removeListener=function(e,t){var r=q2.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(f4e,this),r};Gr.prototype.removeAllListeners=function(e){var t=q2.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(f4e,this),t};function f4e(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function Azt(e){yr("readable nexttick read 0"),e.read(0)}Gr.prototype.resume=function(){var e=this._readableState;return e.flowing||(yr("resume"),e.flowing=!e.readableListening,Szt(this,e)),e.paused=!1,this};function Szt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(Tzt,e,t))}function Tzt(e,t){yr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),zH(e),t.flowing&&!t.reading&&e.read(0)}Gr.prototype.pause=function(){return yr("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(yr("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function zH(e){var t=e._readableState;for(yr("flow",t.flowing);t.flowing&&e.read()!==null;);}Gr.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(yr("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&t.push(o)}t.push(null)}),e.on("data",function(o){if(yr("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var s=t.push(o);s||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(s){return function(){return e[s].apply(e,arguments)}}(i));for(var a=0;a<MH.length;a++)e.on(MH[a],this.emit.bind(this,MH[a]));return this._read=function(o){yr("wrapped _read",o),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(Gr.prototype[Symbol.asyncIterator]=function(){return jH===void 0&&(jH=e4e()),jH(this)});Object.defineProperty(Gr.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Gr.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Gr.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});Gr._fromList=h4e;Object.defineProperty(Gr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function h4e(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function NH(e){var t=e._readableState;yr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(Czt,t,e))}function Czt(e,t){if(yr("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(Gr.from=function(e,t){return LH===void 0&&(LH=i4e()),LH(Gr,e,t)});function p4e(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var HH=v((hCr,g4e)=>{"use strict";g4e.exports=Yl;var SF=np().codes,Dzt=SF.ERR_METHOD_NOT_IMPLEMENTED,Fzt=SF.ERR_MULTIPLE_CALLBACK,kzt=SF.ERR_TRANSFORM_ALREADY_TRANSFORMING,Bzt=SF.ERR_TRANSFORM_WITH_LENGTH_0,TF=b0();tr()(Yl,TF);function Ozt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new Fzt);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Yl(e){if(!(this instanceof Yl))return new Yl(e);TF.call(this,e),this._transformState={afterTransform:Ozt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Izt)}function Izt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){m4e(e,t,r)}):m4e(this,null,null)}Yl.prototype.push=function(e,t){return this._transformState.needTransform=!1,TF.prototype.push.call(this,e,t)};Yl.prototype._transform=function(e,t,r){r(new Dzt("_transform()"))};Yl.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Yl.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Yl.prototype._destroy=function(e,t){TF.prototype._destroy.call(this,e,function(r){t(r)})};function m4e(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Bzt;if(e._transformState.transforming)throw new kzt;return e.push(null)}});var y4e=v((pCr,b4e)=>{"use strict";b4e.exports=N2;var v4e=HH();tr()(N2,v4e);function N2(e){if(!(this instanceof N2))return new N2(e);v4e.call(this,e)}N2.prototype._transform=function(e,t,r){r(null,e)}});var A4e=v((dCr,E4e)=>{"use strict";var WH;function Pzt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var w4e=np().codes,Rzt=w4e.ERR_MISSING_ARGS,jzt=w4e.ERR_STREAM_DESTROYED;function x4e(e){if(e)throw e}function Lzt(e){return e.setHeader&&typeof e.abort=="function"}function Mzt(e,t,r,n){n=Pzt(n);var i=!1;e.on("close",function(){i=!0}),WH===void 0&&(WH=yF()),WH(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var a=!1;return function(o){if(!i&&!a){if(a=!0,Lzt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new jzt("pipe"))}}}function _4e(e){e()}function qzt(e,t){return e.pipe(t)}function Nzt(e){return!e.length||typeof e[e.length-1]!="function"?x4e:e.pop()}function Uzt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Nzt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Rzt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return Mzt(o,u,c,function(l){i||(i=l),l&&a.forEach(_4e),!u&&(a.forEach(_4e),n(i))})});return t.reduce(qzt)}E4e.exports=Uzt});var S4e=v((Os,G2)=>{var U2=require("stream");process.env.READABLE_STREAM==="disable"&&U2?(G2.exports=U2.Readable,Object.assign(G2.exports,U2),G2.exports.Stream=U2):(Os=G2.exports=kH(),Os.Stream=U2||Os,Os.Readable=Os,Os.Writable=CH(),Os.Duplex=b0(),Os.Transform=HH(),Os.PassThrough=y4e(),Os.finished=yF(),Os.pipeline=A4e())});var KH=v(VH=>{var T4e;(function(e){typeof DO_NOT_EXPORT_CRC>"u"?typeof VH=="object"?e(VH):typeof define=="function"&&define.amd?define(function(){var t={};return e(t),t}):e(T4e={}):e(T4e={})})(function(e){e.version="1.2.2";function t(){for(var k=0,N=new Array(256),C=0;C!=256;++C)k=C,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,N[C]=k;return typeof Int32Array<"u"?new Int32Array(N):N}var r=t();function n(k){var N=0,C=0,I=0,P=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(I=0;I!=256;++I)P[I]=k[I];for(I=0;I!=256;++I)for(C=k[I],N=256+I;N<4096;N+=256)C=P[N]=C>>>8^k[C&255];var U=[];for(I=1;I!=16;++I)U[I-1]=typeof Int32Array<"u"?P.subarray(I*256,I*256+256):P.slice(I*256,I*256+256);return U}var i=n(r),a=i[0],o=i[1],s=i[2],u=i[3],c=i[4],l=i[5],f=i[6],h=i[7],p=i[8],d=i[9],b=i[10],g=i[11],x=i[12],E=i[13],S=i[14];function F(k,N){for(var C=N^-1,I=0,P=k.length;I<P;)C=C>>>8^r[(C^k.charCodeAt(I++))&255];return~C}function D(k,N){for(var C=N^-1,I=k.length-15,P=0;P<I;)C=S[k[P++]^C&255]^E[k[P++]^C>>8&255]^x[k[P++]^C>>16&255]^g[k[P++]^C>>>24]^b[k[P++]]^d[k[P++]]^p[k[P++]]^h[k[P++]]^f[k[P++]]^l[k[P++]]^c[k[P++]]^u[k[P++]]^s[k[P++]]^o[k[P++]]^a[k[P++]]^r[k[P++]];for(I+=15;P<I;)C=C>>>8^r[(C^k[P++])&255];return~C}function j(k,N){for(var C=N^-1,I=0,P=k.length,U=0,Y=0;I<P;)U=k.charCodeAt(I++),U<128?C=C>>>8^r[(C^U)&255]:U<2048?(C=C>>>8^r[(C^(192|U>>6&31))&255],C=C>>>8^r[(C^(128|U&63))&255]):U>=55296&&U<57344?(U=(U&1023)+64,Y=k.charCodeAt(I++)&1023,C=C>>>8^r[(C^(240|U>>8&7))&255],C=C>>>8^r[(C^(128|U>>2&63))&255],C=C>>>8^r[(C^(128|Y>>6&15|(U&3)<<4))&255],C=C>>>8^r[(C^(128|Y&63))&255]):(C=C>>>8^r[(C^(224|U>>12&15))&255],C=C>>>8^r[(C^(128|U>>6&63))&255],C=C>>>8^r[(C^(128|U&63))&255]);return~C}e.table=r,e.bstr=F,e.buf=D,e.str=j})});var D4e=v((gCr,C4e)=>{"use strict";var{Transform:Gzt}=S4e(),zzt=KH(),$H=class extends Gzt{constructor(t){super(t),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(t,r,n){t&&(this.checksum=zzt.buf(t,this.checksum)>>>0,this.rawSize+=t.length),n(null,t)}digest(t){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),t?r.toString(t):r}hex(){return this.digest("hex").toUpperCase()}size(){return this.rawSize}};C4e.exports=$H});var k4e=v((vCr,F4e)=>{"use strict";var{DeflateRaw:Hzt}=require("zlib"),Wzt=KH(),YH=class extends Hzt{constructor(t){super(t),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0,this.compressedSize=0}push(t,r){return t&&(this.compressedSize+=t.length),super.push(t,r)}_transform(t,r,n){t&&(this.checksum=Wzt.buf(t,this.checksum)>>>0,this.rawSize+=t.length),super._transform(t,r,n)}digest(t){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),t?r.toString(t):r}hex(){return this.digest("hex").toUpperCase()}size(t=!1){return t?this.compressedSize:this.rawSize}};F4e.exports=YH});var JH=v((bCr,B4e)=>{"use strict";B4e.exports={CRC32Stream:D4e(),DeflateCRC32Stream:k4e()}});var P4e=v((wCr,I4e)=>{var Vzt=require("util").inherits,Kzt=yH(),{CRC32Stream:$zt}=JH(),{DeflateCRC32Stream:Yzt}=JH(),O4e=mH(),yCr=Mz(),xCr=jz(),sr=Lz(),_Cr=pH(),Ut=Q4(),oa=I4e.exports=function(e){if(!(this instanceof oa))return new oa(e);e=this.options=this._defaults(e),O4e.call(this,e),this._entry=null,this._entries=[],this._archive={centralLength:0,centralOffset:0,comment:"",finish:!1,finished:!1,processing:!1,forceZip64:e.forceZip64,forceLocalTime:e.forceLocalTime}};Vzt(oa,O4e);oa.prototype._afterAppend=function(e){this._entries.push(e),e.getGeneralPurposeBit().usesDataDescriptor()&&this._writeDataDescriptor(e),this._archive.processing=!1,this._entry=null,this._archive.finish&&!this._archive.finished&&this._finish()};oa.prototype._appendBuffer=function(e,t,r){t.length===0&&e.setMethod(sr.METHOD_STORED);var n=e.getMethod();if(n===sr.METHOD_STORED&&(e.setSize(t.length),e.setCompressedSize(t.length),e.setCrc(Kzt.unsigned(t))),this._writeLocalFileHeader(e),n===sr.METHOD_STORED){this.write(t),this._afterAppend(e),r(null,e);return}else if(n===sr.METHOD_DEFLATED){this._smartStream(e,r).end(t);return}else{r(new Error("compression method "+n+" not implemented"));return}};oa.prototype._appendStream=function(e,t,r){e.getGeneralPurposeBit().useDataDescriptor(!0),e.setVersionNeededToExtract(sr.MIN_VERSION_DATA_DESCRIPTOR),this._writeLocalFileHeader(e);var n=this._smartStream(e,r);t.once("error",function(i){n.emit("error",i),n.end()}),t.pipe(n)};oa.prototype._defaults=function(e){return typeof e!="object"&&(e={}),typeof e.zlib!="object"&&(e.zlib={}),typeof e.zlib.level!="number"&&(e.zlib.level=sr.ZLIB_BEST_SPEED),e.forceZip64=!!e.forceZip64,e.forceLocalTime=!!e.forceLocalTime,e};oa.prototype._finish=function(){this._archive.centralOffset=this.offset,this._entries.forEach(function(e){this._writeCentralFileHeader(e)}.bind(this)),this._archive.centralLength=this.offset-this._archive.centralOffset,this.isZip64()&&this._writeCentralDirectoryZip64(),this._writeCentralDirectoryEnd(),this._archive.processing=!1,this._archive.finish=!0,this._archive.finished=!0,this.end()};oa.prototype._normalizeEntry=function(e){e.getMethod()===-1&&e.setMethod(sr.METHOD_DEFLATED),e.getMethod()===sr.METHOD_DEFLATED&&(e.getGeneralPurposeBit().useDataDescriptor(!0),e.setVersionNeededToExtract(sr.MIN_VERSION_DATA_DESCRIPTOR)),e.getTime()===-1&&e.setTime(new Date,this._archive.forceLocalTime),e._offsets={file:0,data:0,contents:0}};oa.prototype._smartStream=function(e,t){var r=e.getMethod()===sr.METHOD_DEFLATED,n=r?new Yzt(this.options.zlib):new $zt,i=null;function a(){var o=n.digest().readUInt32BE(0);e.setCrc(o),e.setSize(n.size()),e.setCompressedSize(n.size(!0)),this._afterAppend(e),t(i,e)}return n.once("end",a.bind(this)),n.once("error",function(o){i=o}),n.pipe(this,{end:!1}),n};oa.prototype._writeCentralDirectoryEnd=function(){var e=this._entries.length,t=this._archive.centralLength,r=this._archive.centralOffset;this.isZip64()&&(e=sr.ZIP64_MAGIC_SHORT,t=sr.ZIP64_MAGIC,r=sr.ZIP64_MAGIC),this.write(Ut.getLongBytes(sr.SIG_EOCD)),this.write(sr.SHORT_ZERO),this.write(sr.SHORT_ZERO),this.write(Ut.getShortBytes(e)),this.write(Ut.getShortBytes(e)),this.write(Ut.getLongBytes(t)),this.write(Ut.getLongBytes(r));var n=this.getComment(),i=Buffer.byteLength(n);this.write(Ut.getShortBytes(i)),this.write(n)};oa.prototype._writeCentralDirectoryZip64=function(){this.write(Ut.getLongBytes(sr.SIG_ZIP64_EOCD)),this.write(Ut.getEightBytes(44)),this.write(Ut.getShortBytes(sr.MIN_VERSION_ZIP64)),this.write(Ut.getShortBytes(sr.MIN_VERSION_ZIP64)),this.write(sr.LONG_ZERO),this.write(sr.LONG_ZERO),this.write(Ut.getEightBytes(this._entries.length)),this.write(Ut.getEightBytes(this._entries.length)),this.write(Ut.getEightBytes(this._archive.centralLength)),this.write(Ut.getEightBytes(this._archive.centralOffset)),this.write(Ut.getLongBytes(sr.SIG_ZIP64_EOCD_LOC)),this.write(sr.LONG_ZERO),this.write(Ut.getEightBytes(this._archive.centralOffset+this._archive.centralLength)),this.write(Ut.getLongBytes(1))};oa.prototype._writeCentralFileHeader=function(e){var t=e.getGeneralPurposeBit(),r=e.getMethod(),n=e._offsets,i=e.getSize(),a=e.getCompressedSize();if(e.isZip64()||n.file>sr.ZIP64_MAGIC){i=sr.ZIP64_MAGIC,a=sr.ZIP64_MAGIC,e.setVersionNeededToExtract(sr.MIN_VERSION_ZIP64);var o=Buffer.concat([Ut.getShortBytes(sr.ZIP64_EXTRA_ID),Ut.getShortBytes(24),Ut.getEightBytes(e.getSize()),Ut.getEightBytes(e.getCompressedSize()),Ut.getEightBytes(n.file)],28);e.setExtra(o)}this.write(Ut.getLongBytes(sr.SIG_CFH)),this.write(Ut.getShortBytes(e.getPlatform()<<8|sr.VERSION_MADEBY)),this.write(Ut.getShortBytes(e.getVersionNeededToExtract())),this.write(t.encode()),this.write(Ut.getShortBytes(r)),this.write(Ut.getLongBytes(e.getTimeDos())),this.write(Ut.getLongBytes(e.getCrc())),this.write(Ut.getLongBytes(a)),this.write(Ut.getLongBytes(i));var s=e.getName(),u=e.getComment(),c=e.getCentralDirectoryExtra();t.usesUTF8ForNames()&&(s=Buffer.from(s),u=Buffer.from(u)),this.write(Ut.getShortBytes(s.length)),this.write(Ut.getShortBytes(c.length)),this.write(Ut.getShortBytes(u.length)),this.write(sr.SHORT_ZERO),this.write(Ut.getShortBytes(e.getInternalAttributes())),this.write(Ut.getLongBytes(e.getExternalAttributes())),n.file>sr.ZIP64_MAGIC?this.write(Ut.getLongBytes(sr.ZIP64_MAGIC)):this.write(Ut.getLongBytes(n.file)),this.write(s),this.write(c),this.write(u)};oa.prototype._writeDataDescriptor=function(e){this.write(Ut.getLongBytes(sr.SIG_DD)),this.write(Ut.getLongBytes(e.getCrc())),e.isZip64()?(this.write(Ut.getEightBytes(e.getCompressedSize())),this.write(Ut.getEightBytes(e.getSize()))):(this.write(Ut.getLongBytes(e.getCompressedSize())),this.write(Ut.getLongBytes(e.getSize())))};oa.prototype._writeLocalFileHeader=function(e){var t=e.getGeneralPurposeBit(),r=e.getMethod(),n=e.getName(),i=e.getLocalFileDataExtra();e.isZip64()&&(t.useDataDescriptor(!0),e.setVersionNeededToExtract(sr.MIN_VERSION_ZIP64)),t.usesUTF8ForNames()&&(n=Buffer.from(n)),e._offsets.file=this.offset,this.write(Ut.getLongBytes(sr.SIG_LFH)),this.write(Ut.getShortBytes(e.getVersionNeededToExtract())),this.write(t.encode()),this.write(Ut.getShortBytes(r)),this.write(Ut.getLongBytes(e.getTimeDos())),e._offsets.data=this.offset,t.usesDataDescriptor()?(this.write(sr.LONG_ZERO),this.write(sr.LONG_ZERO),this.write(sr.LONG_ZERO)):(this.write(Ut.getLongBytes(e.getCrc())),this.write(Ut.getLongBytes(e.getCompressedSize())),this.write(Ut.getLongBytes(e.getSize()))),this.write(Ut.getShortBytes(n.length)),this.write(Ut.getShortBytes(i.length)),this.write(n),this.write(i),e._offsets.contents=this.offset};oa.prototype.getComment=function(e){return this._archive.comment!==null?this._archive.comment:""};oa.prototype.isZip64=function(){return this._archive.forceZip64||this._entries.length>sr.ZIP64_MAGIC_SHORT||this._archive.centralLength>sr.ZIP64_MAGIC||this._archive.centralOffset>sr.ZIP64_MAGIC};oa.prototype.setComment=function(e){this._archive.comment=e}});var XH=v((ECr,R4e)=>{R4e.exports={ArchiveEntry:X4(),ZipArchiveEntry:Mz(),ArchiveOutputStream:mH(),ZipArchiveOutputStream:P4e()}});var L4e=v((ACr,j4e)=>{var Jzt=require("util").inherits,ZH=XH().ZipArchiveOutputStream,Xzt=XH().ZipArchiveEntry,QH=Tb(),qb=j4e.exports=function(e){if(!(this instanceof qb))return new qb(e);e=this.options=e||{},e.zlib=e.zlib||{},ZH.call(this,e),typeof e.level=="number"&&e.level>=0&&(e.zlib.level=e.level,delete e.level),!e.forceZip64&&typeof e.zlib.level=="number"&&e.zlib.level===0&&(e.store=!0),e.namePrependSlash=e.namePrependSlash||!1,e.comment&&e.comment.length>0&&this.setComment(e.comment)};Jzt(qb,ZH);qb.prototype._normalizeFileData=function(e){e=QH.defaults(e,{type:"file",name:null,namePrependSlash:this.options.namePrependSlash,linkname:null,date:null,mode:null,store:this.options.store,comment:""});var t=e.type==="directory",r=e.type==="symlink";return e.name&&(e.name=QH.sanitizePath(e.name),!r&&e.name.slice(-1)==="/"?(t=!0,e.type="directory"):t&&(e.name+="/")),(t||r)&&(e.store=!0),e.date=QH.dateify(e.date),e};qb.prototype.entry=function(e,t,r){if(typeof r!="function"&&(r=this._emitErrorCallback.bind(this)),t=this._normalizeFileData(t),t.type!=="file"&&t.type!=="directory"&&t.type!=="symlink"){r(new Error(t.type+" entries not currently supported"));return}if(typeof t.name!="string"||t.name.length===0){r(new Error("entry name must be a non-empty string value"));return}if(t.type==="symlink"&&typeof t.linkname!="string"){r(new Error("entry linkname must be a non-empty string value when type equals symlink"));return}var n=new Xzt(t.name);return n.setTime(t.date,this.options.forceLocalTime),t.namePrependSlash&&n.setName(t.name,!0),t.store&&n.setMethod(0),t.comment.length>0&&n.setComment(t.comment),t.type==="symlink"&&typeof t.mode!="number"&&(t.mode=40960),typeof t.mode=="number"&&(t.type==="symlink"&&(t.mode|=40960),n.setUnixMode(t.mode)),t.type==="symlink"&&typeof t.linkname=="string"&&(e=Buffer.from(t.linkname)),ZH.prototype.entry.call(this,n,e,r)};qb.prototype.finalize=function(){this.finish()}});var q4e=v((SCr,M4e)=>{var Qzt=L4e(),Zzt=Tb(),up=function(e){if(!(this instanceof up))return new up(e);e=this.options=Zzt.defaults(e,{comment:"",forceUTC:!1,namePrependSlash:!1,store:!1}),this.supports={directory:!0,symlink:!0},this.engine=new Qzt(e)};up.prototype.append=function(e,t,r){this.engine.entry(e,t,r)};up.prototype.finalize=function(){this.engine.finalize()};up.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};up.prototype.pipe=function(){return this.engine.pipe.apply(this.engine,arguments)};up.prototype.unpipe=function(){return this.engine.unpipe.apply(this.engine,arguments)};M4e.exports=up});var rW=v(Ub=>{var eHt=Buffer.alloc,tHt="0000000000000000000",rHt="7777777777777777777",N4e="0".charCodeAt(0),U4e=Buffer.from("ustar\0","binary"),nHt=Buffer.from("00","binary"),iHt=Buffer.from("ustar ","binary"),aHt=Buffer.from(" \0","binary"),oHt=parseInt("7777",8),z2=257,tW=263,sHt=function(e,t,r){return typeof e!="number"?r:(e=~~e,e>=t?t:e>=0||(e+=t,e>=0)?e:0)},uHt=function(e){switch(e){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null},cHt=function(e){switch(e){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0},G4e=function(e,t,r,n){for(;r<n;r++)if(e[r]===t)return r;return n},z4e=function(e){for(var t=256,r=0;r<148;r++)t+=e[r];for(var n=156;n<512;n++)t+=e[n];return t},cp=function(e,t){return e=e.toString(8),e.length>t?rHt.slice(0,t)+" ":tHt.slice(0,t-e.length)+e+" "};function lHt(e){var t;if(e[0]===128)t=!0;else if(e[0]===255)t=!1;else return null;for(var r=[],n=e.length-1;n>0;n--){var i=e[n];t?r.push(i):r.push(255-i)}var a=0,o=r.length;for(n=0;n<o;n++)a+=r[n]*Math.pow(256,n);return t?a:-1*a}var lp=function(e,t,r){if(e=e.slice(t,t+r),t=0,e[t]&128)return lHt(e);for(;t<e.length&&e[t]===32;)t++;for(var n=sHt(G4e(e,32,t,e.length),e.length,e.length);t<n&&e[t]===0;)t++;return n===t?0:parseInt(e.slice(t,n).toString(),8)},Nb=function(e,t,r,n){return e.slice(t,G4e(e,0,t,t+r)).toString(n)},eW=function(e){var t=Buffer.byteLength(e),r=Math.floor(Math.log(t)/Math.log(10))+1;return t+r>=Math.pow(10,r)&&r++,t+r+e};Ub.decodeLongPath=function(e,t){return Nb(e,0,e.length,t)};Ub.encodePax=function(e){var t="";e.name&&(t+=eW(" path="+e.name+`
|
|
171
171
|
`)),e.linkname&&(t+=eW(" linkpath="+e.linkname+`
|
|
172
172
|
`));var r=e.pax;if(r)for(var n in r)t+=eW(" "+n+"="+r[n]+`
|
|
173
|
-
`);return Buffer.from(t)};Ub.decodePax=function(e){for(var t={};e.length;){for(var r=0;r<e.length&&e[r]!==32;)r++;var n=parseInt(e.slice(0,r).toString(),10);if(!n)return t;var i=e.slice(r+1,n-1).toString(),a=i.indexOf("=");if(a===-1)return t;t[i.slice(0,a)]=i.slice(a+1),e=e.slice(n)}return t};Ub.encode=function(e){var t=eHt(512),r=e.name,n="";if(e.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var i=r.indexOf("/");if(i===-1)return null;n+=n?"/"+r.slice(0,i):r.slice(0,i),r=r.slice(i+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(n)>155||e.linkname&&Buffer.byteLength(e.linkname)>100?null:(t.write(r),t.write(cp(e.mode&oHt,6),100),t.write(cp(e.uid,6),108),t.write(cp(e.gid,6),116),t.write(cp(e.size,11),124),t.write(cp(e.mtime.getTime()/1e3|0,11),136),t[156]=N4e+cHt(e.type),e.linkname&&t.write(e.linkname,157),U4e.copy(t,z2),nHt.copy(t,tW),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(cp(e.devmajor||0,6),329),t.write(cp(e.devminor||0,6),337),n&&t.write(n,345),t.write(cp(z4e(t),6),148),t)};Ub.decode=function(e,t,r){var n=e[156]===0?0:e[156]-N4e,i=Nb(e,0,100,t),a=lp(e,100,8),o=lp(e,108,8),s=lp(e,116,8),u=lp(e,124,12),c=lp(e,136,12),l=uHt(n),f=e[157]===0?null:Nb(e,157,100,t),h=Nb(e,265,32),p=Nb(e,297,32),d=lp(e,329,8),b=lp(e,337,8),g=z4e(e);if(g===8*32)return null;if(g!==lp(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(U4e.compare(e,z2,z2+6)===0)e[345]&&(i=Nb(e,345,155,t)+"/"+i);else if(!(iHt.compare(e,z2,z2+6)===0&&aHt.compare(e,tW,tW+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return n===0&&i&&i[i.length-1]==="/"&&(n=5),{name:i,mode:a,uid:o,gid:s,size:u,mtime:new Date(1e3*c),type:l,linkname:f,uname:h,gname:p,devmajor:d,devminor:b}}});var nW=v((CCr,H4e)=>{H4e.exports=require("stream")});var J4e=v((DCr,Y4e)=>{"use strict";function W4e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function V4e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?W4e(Object(r),!0).forEach(function(n){fHt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W4e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fHt(e,t,r){return t=$4e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hHt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K4e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$4e(n.key),n)}}function pHt(e,t,r){return t&&K4e(e.prototype,t),r&&K4e(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $4e(e){var t=dHt(e,"string");return typeof t=="symbol"?t:String(t)}function dHt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mHt=require("buffer"),CF=mHt.Buffer,gHt=require("util"),iW=gHt.inspect,vHt=iW&&iW.custom||"inspect";function bHt(e,t,r){CF.prototype.copy.call(e,t,r)}Y4e.exports=function(){function e(){hHt(this,e),this.head=null,this.tail=null,this.length=0}return pHt(e,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return CF.alloc(0);for(var n=CF.allocUnsafe(r>>>0),i=this.head,a=0;i;)bHt(i.data,n,a),a+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,a=n.data;for(r-=a.length;n=n.next;){var o=n.data,s=r>o.length?o.length:r;if(s===o.length?a+=o:a+=o.slice(0,r),r-=s,r===0){s===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(s));break}++i}return this.length-=i,a}},{key:"_getBuffer",value:function(r){var n=CF.allocUnsafe(r),i=this.head,a=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var o=i.data,s=r>o.length?o.length:r;if(o.copy(n,n.length-r,0,s),r-=s,r===0){s===o.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(s));break}++a}return this.length-=a,n}},{key:vHt,value:function(r,n){return iW(this,V4e(V4e({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var oW=v((FCr,Q4e)=>{"use strict";function yHt(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(aW,this,e)):process.nextTick(aW,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(DF,r):(r._writableState.errorEmitted=!0,process.nextTick(X4e,r,a)):process.nextTick(X4e,r,a):t?(process.nextTick(DF,r),t(a)):process.nextTick(DF,r)}),this)}function X4e(e,t){aW(e,t),DF(e)}function DF(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function xHt(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function aW(e,t){e.emit("error",t)}function _Ht(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}Q4e.exports={destroy:yHt,undestroy:xHt,errorOrDestroy:_Ht}});var fp=v((kCr,tFe)=>{"use strict";var eFe={};function Is(e,t,r){r||(r=Error);function n(a,o,s){return typeof t=="string"?t:t(a,o,s)}class i extends r{constructor(o,s,u){super(n(o,s,u))}}i.prototype.name=r.name,i.prototype.code=e,eFe[e]=i}function Z4e(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function wHt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function EHt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function AHt(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Is("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Is("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&wHt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(EHt(e," argument"))i=`The ${e} ${n} ${Z4e(t,"type")}`;else{let a=AHt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${Z4e(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);Is("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Is("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Is("ERR_STREAM_PREMATURE_CLOSE","Premature close");Is("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Is("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Is("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Is("ERR_STREAM_WRITE_AFTER_END","write after end");Is("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Is("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Is("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");tFe.exports.codes=eFe});var sW=v((BCr,rFe)=>{"use strict";var SHt=fp().codes.ERR_INVALID_OPT_VALUE;function THt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function CHt(e,t,r,n){var i=THt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new SHt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}rFe.exports={getHighWaterMark:CHt}});var lW=v((OCr,uFe)=>{"use strict";uFe.exports=ci;function iFe(e){var t=this;this.next=null,this.entry=null,this.finish=function(){eWt(t,e)}}var Gb;ci.WritableState=W2;var DHt={deprecate:ld()},aFe=nW(),kF=require("buffer").Buffer,FHt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function kHt(e){return kF.from(e)}function BHt(e){return kF.isBuffer(e)||e instanceof FHt}var cW=oW(),OHt=sW(),IHt=OHt.getHighWaterMark,hp=fp().codes,PHt=hp.ERR_INVALID_ARG_TYPE,RHt=hp.ERR_METHOD_NOT_IMPLEMENTED,jHt=hp.ERR_MULTIPLE_CALLBACK,LHt=hp.ERR_STREAM_CANNOT_PIPE,MHt=hp.ERR_STREAM_DESTROYED,qHt=hp.ERR_STREAM_NULL_VALUES,NHt=hp.ERR_STREAM_WRITE_AFTER_END,UHt=hp.ERR_UNKNOWN_ENCODING,zb=cW.errorOrDestroy;tr()(ci,aFe);function GHt(){}function W2(e,t,r){Gb=Gb||w0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Gb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=IHt(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){YHt(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new iFe(this)}W2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(W2.prototype,"buffer",{get:DHt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var FF;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(FF=Function.prototype[Symbol.hasInstance],Object.defineProperty(ci,Symbol.hasInstance,{value:function(t){return FF.call(this,t)?!0:this!==ci?!1:t&&t._writableState instanceof W2}})):FF=function(t){return t instanceof this};function ci(e){Gb=Gb||w0();var t=this instanceof Gb;if(!t&&!FF.call(ci,this))return new ci(e);this._writableState=new W2(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),aFe.call(this)}ci.prototype.pipe=function(){zb(this,new LHt)};function zHt(e,t){var r=new NHt;zb(e,r),process.nextTick(t,r)}function HHt(e,t,r,n){var i;return r===null?i=new qHt:typeof r!="string"&&!t.objectMode&&(i=new PHt("chunk",["string","Buffer"],r)),i?(zb(e,i),process.nextTick(n,i),!1):!0}ci.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&BHt(e);return a&&!kF.isBuffer(e)&&(e=kHt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=GHt),n.ending?zHt(this,r):(a||HHt(this,n,e,r))&&(n.pendingcb++,i=VHt(this,n,a,e,t,r)),i};ci.prototype.cork=function(){this._writableState.corked++};ci.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&oFe(this,e))};ci.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new UHt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(ci.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function WHt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=kF.from(t,r)),t}Object.defineProperty(ci.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function VHt(e,t,r,n,i,a){if(!r){var o=WHt(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else uW(e,t,!1,s,n,i,a);return u}function uW(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new MHt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function KHt(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(H2,e,t),e._writableState.errorEmitted=!0,zb(e,n)):(i(n),e._writableState.errorEmitted=!0,zb(e,n),H2(e,t))}function $Ht(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function YHt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new jHt;if($Ht(r),t)KHt(e,r,n,t,i);else{var a=sFe(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&oFe(e,r),n?process.nextTick(nFe,e,r,a,i):nFe(e,r,a,i)}}function nFe(e,t,r,n){r||JHt(e,t),t.pendingcb--,n(),H2(e,t)}function JHt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function oFe(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var o=0,s=!0;r;)i[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;i.allBuffers=s,uW(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new iFe(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(uW(e,t,!1,f,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}ci.prototype._write=function(e,t,r){r(new RHt("_write()"))};ci.prototype._writev=null;ci.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||ZHt(this,n,r),this};Object.defineProperty(ci.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function sFe(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function XHt(e,t){e._final(function(r){t.pendingcb--,r&&zb(e,r),t.prefinished=!0,e.emit("prefinish"),H2(e,t)})}function QHt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(XHt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function H2(e,t){var r=sFe(t);if(r&&(QHt(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function ZHt(e,t,r){t.ending=!0,H2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function eWt(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(ci.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});ci.prototype.destroy=cW.destroy;ci.prototype._undestroy=cW.undestroy;ci.prototype._destroy=function(e,t){t(e)}});var w0=v((ICr,lFe)=>{"use strict";var tWt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};lFe.exports=jc;var cFe=pW(),hW=lW();tr()(jc,cFe);for(fW=tWt(hW.prototype),BF=0;BF<fW.length;BF++)OF=fW[BF],jc.prototype[OF]||(jc.prototype[OF]=hW.prototype[OF]);var fW,OF,BF;function jc(e){if(!(this instanceof jc))return new jc(e);cFe.call(this,e),hW.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",rWt)))}Object.defineProperty(jc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(jc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(jc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function rWt(){this._writableState.ended||process.nextTick(nWt,this)}function nWt(e){e.end()}Object.defineProperty(jc.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var gW=v(hFe=>{"use strict";var mW=Us().Buffer,fFe=mW.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function iWt(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function aWt(e){var t=iWt(e);if(typeof t!="string"&&(mW.isEncoding===fFe||!fFe(e)))throw new Error("Unknown encoding: "+e);return t||e}hFe.StringDecoder=V2;function V2(e){this.encoding=aWt(e);var t;switch(this.encoding){case"utf16le":this.text=fWt,this.end=hWt,t=4;break;case"utf8":this.fillLast=uWt,t=4;break;case"base64":this.text=pWt,this.end=dWt,t=3;break;default:this.write=mWt,this.end=gWt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=mW.allocUnsafe(t)}V2.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};V2.prototype.end=lWt;V2.prototype.text=cWt;V2.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function dW(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function oWt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=dW(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=dW(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=dW(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function sWt(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function uWt(e){var t=this.lastTotal-this.lastNeed,r=sWt(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function cWt(e,t){var r=oWt(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function lWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function fWt(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function hWt(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function pWt(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function dWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function mWt(e){return e.toString(this.encoding)}function gWt(e){return e&&e.length?this.write(e):""}});var IF=v((RCr,mFe)=>{"use strict";var pFe=fp().codes.ERR_STREAM_PREMATURE_CLOSE;function vWt(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function bWt(){}function yWt(e){return e.setHeader&&typeof e.abort=="function"}function dFe(e,t,r){if(typeof t=="function")return dFe(e,null,t);t||(t={}),r=vWt(r||bWt);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,a=function(){e.writable||s()},o=e._writableState&&e._writableState.finished,s=function(){i=!1,o=!0,n||r.call(e)},u=e._readableState&&e._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(e)},l=function(d){r.call(e,d)},f=function(){var d;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(d=new pFe),r.call(e,d);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(d=new pFe),r.call(e,d)},h=function(){e.req.on("finish",s)};return yWt(e)?(e.on("complete",s),e.on("abort",f),e.req?h():e.on("request",h)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",h),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}mFe.exports=dFe});var vFe=v((jCr,gFe)=>{"use strict";var PF;function pp(e,t,r){return t=xWt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xWt(e){var t=_Wt(e,"string");return typeof t=="symbol"?t:String(t)}function _Wt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wWt=IF(),dp=Symbol("lastResolve"),E0=Symbol("lastReject"),K2=Symbol("error"),RF=Symbol("ended"),A0=Symbol("lastPromise"),vW=Symbol("handlePromise"),S0=Symbol("stream");function mp(e,t){return{value:e,done:t}}function EWt(e){var t=e[dp];if(t!==null){var r=e[S0].read();r!==null&&(e[A0]=null,e[dp]=null,e[E0]=null,t(mp(r,!1)))}}function AWt(e){process.nextTick(EWt,e)}function SWt(e,t){return function(r,n){e.then(function(){if(t[RF]){r(mp(void 0,!0));return}t[vW](r,n)},n)}}var TWt=Object.getPrototypeOf(function(){}),CWt=Object.setPrototypeOf((PF={get stream(){return this[S0]},next:function(){var t=this,r=this[K2];if(r!==null)return Promise.reject(r);if(this[RF])return Promise.resolve(mp(void 0,!0));if(this[S0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[K2]?s(t[K2]):o(mp(void 0,!0))})});var n=this[A0],i;if(n)i=new Promise(SWt(n,this));else{var a=this[S0].read();if(a!==null)return Promise.resolve(mp(a,!1));i=new Promise(this[vW])}return this[A0]=i,i}},pp(PF,Symbol.asyncIterator,function(){return this}),pp(PF,"return",function(){var t=this;return new Promise(function(r,n){t[S0].destroy(null,function(i){if(i){n(i);return}r(mp(void 0,!0))})})}),PF),TWt),DWt=function(t){var r,n=Object.create(CWt,(r={},pp(r,S0,{value:t,writable:!0}),pp(r,dp,{value:null,writable:!0}),pp(r,E0,{value:null,writable:!0}),pp(r,K2,{value:null,writable:!0}),pp(r,RF,{value:t._readableState.endEmitted,writable:!0}),pp(r,vW,{value:function(a,o){var s=n[S0].read();s?(n[A0]=null,n[dp]=null,n[E0]=null,a(mp(s,!1))):(n[dp]=a,n[E0]=o)},writable:!0}),r));return n[A0]=null,wWt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[E0];a!==null&&(n[A0]=null,n[dp]=null,n[E0]=null,a(i)),n[K2]=i;return}var o=n[dp];o!==null&&(n[A0]=null,n[dp]=null,n[E0]=null,o(mp(void 0,!0))),n[RF]=!0}),t.on("readable",AWt.bind(null,n)),n};gFe.exports=DWt});var _Fe=v((LCr,xFe)=>{"use strict";function bFe(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){r(c);return}s.done?t(u):Promise.resolve(u).then(n,i)}function FWt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){bFe(a,n,i,o,s,"next",u)}function s(u){bFe(a,n,i,o,s,"throw",u)}o(void 0)})}}function yFe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function kWt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yFe(Object(r),!0).forEach(function(n){BWt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yFe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BWt(e,t,r){return t=OWt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OWt(e){var t=IWt(e,"string");return typeof t=="symbol"?t:String(t)}function IWt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var PWt=fp().codes.ERR_INVALID_ARG_TYPE;function RWt(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new PWt("iterable",["Iterable"],t);var i=new e(kWt({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=FWt(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?o():a=!1}catch(f){i.destroy(f)}}),s.apply(this,arguments)}return i}xFe.exports=RWt});var pW=v((qCr,BFe)=>{"use strict";BFe.exports=zr;var Hb;zr.ReadableState=SFe;var MCr=require("events").EventEmitter,AFe=function(t,r){return t.listeners(r).length},Y2=nW(),jF=require("buffer").Buffer,jWt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function LWt(e){return jF.from(e)}function MWt(e){return jF.isBuffer(e)||e instanceof jWt}var bW=require("util"),xr;bW&&bW.debuglog?xr=bW.debuglog("stream"):xr=function(){};var qWt=J4e(),SW=oW(),NWt=sW(),UWt=NWt.getHighWaterMark,LF=fp().codes,GWt=LF.ERR_INVALID_ARG_TYPE,zWt=LF.ERR_STREAM_PUSH_AFTER_EOF,HWt=LF.ERR_METHOD_NOT_IMPLEMENTED,WWt=LF.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Wb,yW,xW;tr()(zr,Y2);var $2=SW.errorOrDestroy,_W=["error","close","destroy","pause","resume"];function VWt(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function SFe(e,t,r){Hb=Hb||w0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Hb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=UWt(this,e,"readableHighWaterMark",r),this.buffer=new qWt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Wb||(Wb=gW().StringDecoder),this.decoder=new Wb(e.encoding),this.encoding=e.encoding)}function zr(e){if(Hb=Hb||w0(),!(this instanceof zr))return new zr(e);var t=this instanceof Hb;this._readableState=new SFe(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Y2.call(this)}Object.defineProperty(zr.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});zr.prototype.destroy=SW.destroy;zr.prototype._undestroy=SW.undestroy;zr.prototype._destroy=function(e,t){t(e)};zr.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=jF.from(e,t),t=""),n=!0),TFe(this,e,t,!1,n)};zr.prototype.unshift=function(e){return TFe(this,e,null,!0,!1)};function TFe(e,t,r,n,i){xr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,YWt(e,a);else{var o;if(i||(o=KWt(a,t)),o)$2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==jF.prototype&&(t=LWt(t)),n)a.endEmitted?$2(e,new WWt):wW(e,a,t,!0);else if(a.ended)$2(e,new zWt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?wW(e,a,t,!1):AW(e,a)):wW(e,a,t,!1)}else n||(a.reading=!1,AW(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function wW(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&MF(e)),AW(e,t)}function KWt(e,t){var r;return!MWt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new GWt("chunk",["string","Buffer","Uint8Array"],t)),r}zr.prototype.isPaused=function(){return this._readableState.flowing===!1};zr.prototype.setEncoding=function(e){Wb||(Wb=gW().StringDecoder);var t=new Wb(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var wFe=1073741824;function $Wt(e){return e>=wFe?e=wFe:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function EFe(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=$Wt(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}zr.prototype.read=function(e){xr("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return xr("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?EW(this):MF(this),null;if(e=EFe(e,t),e===0&&t.ended)return t.length===0&&EW(this),null;var n=t.needReadable;xr("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,xr("length less than watermark",n)),t.ended||t.reading?(n=!1,xr("reading or ended",n)):n&&(xr("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=EFe(r,t)));var i;return e>0?i=FFe(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&EW(this)),i!==null&&this.emit("data",i),i};function YWt(e,t){if(xr("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?MF(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,CFe(e)))}}function MF(e){var t=e._readableState;xr("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(xr("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(CFe,e))}function CFe(e){var t=e._readableState;xr("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,TW(e)}function AW(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(JWt,e,t))}function JWt(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(xr("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}zr.prototype._read=function(e){$2(this,new HWt("_read()"))};zr.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,xr("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?s:b;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",o);function o(g,x){xr("onunpipe"),g===r&&x&&x.hasUnpiped===!1&&(x.hasUnpiped=!0,l())}function s(){xr("onend"),e.end()}var u=XWt(r);e.on("drain",u);var c=!1;function l(){xr("cleanup"),e.removeListener("close",p),e.removeListener("finish",d),e.removeListener("drain",u),e.removeListener("error",h),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){xr("ondata");var x=e.write(g);xr("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&kFe(n.pipes,e)!==-1)&&!c&&(xr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(g){xr("onerror",g),b(),e.removeListener("error",h),AFe(e,"error")===0&&$2(e,g)}VWt(e,"error",h);function p(){e.removeListener("finish",d),b()}e.once("close",p);function d(){xr("onfinish"),e.removeListener("close",p),b()}e.once("finish",d);function b(){xr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(xr("pipe resume"),r.resume()),e};function XWt(e){return function(){var r=e._readableState;xr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&AFe(e,"data")&&(r.flowing=!0,TW(e))}}zr.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=kFe(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};zr.prototype.on=function(e,t){var r=Y2.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,xr("on readable",n.length,n.reading),n.length?MF(this):n.reading||process.nextTick(QWt,this)),r};zr.prototype.addListener=zr.prototype.on;zr.prototype.removeListener=function(e,t){var r=Y2.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(DFe,this),r};zr.prototype.removeAllListeners=function(e){var t=Y2.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(DFe,this),t};function DFe(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function QWt(e){xr("readable nexttick read 0"),e.read(0)}zr.prototype.resume=function(){var e=this._readableState;return e.flowing||(xr("resume"),e.flowing=!e.readableListening,ZWt(this,e)),e.paused=!1,this};function ZWt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(eVt,e,t))}function eVt(e,t){xr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),TW(e),t.flowing&&!t.reading&&e.read(0)}zr.prototype.pause=function(){return xr("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(xr("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function TW(e){var t=e._readableState;for(xr("flow",t.flowing);t.flowing&&e.read()!==null;);}zr.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(xr("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&t.push(o)}t.push(null)}),e.on("data",function(o){if(xr("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var s=t.push(o);s||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(s){return function(){return e[s].apply(e,arguments)}}(i));for(var a=0;a<_W.length;a++)e.on(_W[a],this.emit.bind(this,_W[a]));return this._read=function(o){xr("wrapped _read",o),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(zr.prototype[Symbol.asyncIterator]=function(){return yW===void 0&&(yW=vFe()),yW(this)});Object.defineProperty(zr.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(zr.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(zr.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});zr._fromList=FFe;Object.defineProperty(zr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function FFe(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function EW(e){var t=e._readableState;xr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(tVt,t,e))}function tVt(e,t){if(xr("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(zr.from=function(e,t){return xW===void 0&&(xW=_Fe()),xW(zr,e,t)});function kFe(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var CW=v((NCr,IFe)=>{"use strict";IFe.exports=Jl;var qF=fp().codes,rVt=qF.ERR_METHOD_NOT_IMPLEMENTED,nVt=qF.ERR_MULTIPLE_CALLBACK,iVt=qF.ERR_TRANSFORM_ALREADY_TRANSFORMING,aVt=qF.ERR_TRANSFORM_WITH_LENGTH_0,NF=w0();tr()(Jl,NF);function oVt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new nVt);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Jl(e){if(!(this instanceof Jl))return new Jl(e);NF.call(this,e),this._transformState={afterTransform:oVt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",sVt)}function sVt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){OFe(e,t,r)}):OFe(this,null,null)}Jl.prototype.push=function(e,t){return this._transformState.needTransform=!1,NF.prototype.push.call(this,e,t)};Jl.prototype._transform=function(e,t,r){r(new rVt("_transform()"))};Jl.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Jl.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Jl.prototype._destroy=function(e,t){NF.prototype._destroy.call(this,e,function(r){t(r)})};function OFe(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new aVt;if(e._transformState.transforming)throw new iVt;return e.push(null)}});var jFe=v((UCr,RFe)=>{"use strict";RFe.exports=J2;var PFe=CW();tr()(J2,PFe);function J2(e){if(!(this instanceof J2))return new J2(e);PFe.call(this,e)}J2.prototype._transform=function(e,t,r){r(null,e)}});var UFe=v((GCr,NFe)=>{"use strict";var DW;function uVt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var qFe=fp().codes,cVt=qFe.ERR_MISSING_ARGS,lVt=qFe.ERR_STREAM_DESTROYED;function LFe(e){if(e)throw e}function fVt(e){return e.setHeader&&typeof e.abort=="function"}function hVt(e,t,r,n){n=uVt(n);var i=!1;e.on("close",function(){i=!0}),DW===void 0&&(DW=IF()),DW(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var a=!1;return function(o){if(!i&&!a){if(a=!0,fVt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new lVt("pipe"))}}}function MFe(e){e()}function pVt(e,t){return e.pipe(t)}function dVt(e){return!e.length||typeof e[e.length-1]!="function"?LFe:e.pop()}function mVt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=dVt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new cVt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return hVt(o,u,c,function(l){i||(i=l),l&&a.forEach(MFe),!u&&(a.forEach(MFe),n(i))})});return t.reduce(pVt)}NFe.exports=mVt});var Z2=v((Ps,Q2)=>{var X2=require("stream");process.env.READABLE_STREAM==="disable"&&X2?(Q2.exports=X2.Readable,Object.assign(Q2.exports,X2),Q2.exports.Stream=X2):(Ps=Q2.exports=pW(),Ps.Stream=X2||Ps,Ps.Readable=Ps,Ps.Writable=lW(),Ps.Duplex=w0(),Ps.Transform=CW(),Ps.PassThrough=jFe(),Ps.finished=IF(),Ps.pipeline=UFe())});var $Fe=v((zCr,KFe)=>{var zFe=require("util"),gVt=kL(),ew=rW(),HFe=Z2().Writable,WFe=Z2().PassThrough,VFe=function(){},GFe=function(e){return e&=511,e&&512-e},vVt=function(e,t){var r=new UF(e,t);return r.end(),r},bVt=function(e,t){return t.path&&(e.name=t.path),t.linkpath&&(e.linkname=t.linkpath),t.size&&(e.size=parseInt(t.size,10)),e.pax=t,e},UF=function(e,t){this._parent=e,this.offset=t,WFe.call(this,{autoDestroy:!1})};zFe.inherits(UF,WFe);UF.prototype.destroy=function(e){this._parent.destroy(e)};var Xl=function(e){if(!(this instanceof Xl))return new Xl(e);HFe.call(this,e),e=e||{},this._offset=0,this._buffer=gVt(),this._missing=0,this._partial=!1,this._onparse=VFe,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var t=this,r=t._buffer,n=function(){t._continue()},i=function(h){if(t._locked=!1,h)return t.destroy(h);t._stream||n()},a=function(){t._stream=null;var h=GFe(t._header.size);h?t._parse(h,o):t._parse(512,f),t._locked||n()},o=function(){t._buffer.consume(GFe(t._header.size)),t._parse(512,f),n()},s=function(){var h=t._header.size;t._paxGlobal=ew.decodePax(r.slice(0,h)),r.consume(h),a()},u=function(){var h=t._header.size;t._pax=ew.decodePax(r.slice(0,h)),t._paxGlobal&&(t._pax=Object.assign({},t._paxGlobal,t._pax)),r.consume(h),a()},c=function(){var h=t._header.size;this._gnuLongPath=ew.decodeLongPath(r.slice(0,h),e.filenameEncoding),r.consume(h),a()},l=function(){var h=t._header.size;this._gnuLongLinkPath=ew.decodeLongPath(r.slice(0,h),e.filenameEncoding),r.consume(h),a()},f=function(){var h=t._offset,p;try{p=t._header=ew.decode(r.slice(0,512),e.filenameEncoding,e.allowUnknownFormat)}catch(d){t.emit("error",d)}if(r.consume(512),!p){t._parse(512,f),n();return}if(p.type==="gnu-long-path"){t._parse(p.size,c),n();return}if(p.type==="gnu-long-link-path"){t._parse(p.size,l),n();return}if(p.type==="pax-global-header"){t._parse(p.size,s),n();return}if(p.type==="pax-header"){t._parse(p.size,u),n();return}if(t._gnuLongPath&&(p.name=t._gnuLongPath,t._gnuLongPath=null),t._gnuLongLinkPath&&(p.linkname=t._gnuLongLinkPath,t._gnuLongLinkPath=null),t._pax&&(t._header=p=bVt(p,t._pax),t._pax=null),t._locked=!0,!p.size||p.type==="directory"){t._parse(512,f),t.emit("entry",p,vVt(t,h),i);return}t._stream=new UF(t,h),t.emit("entry",p,t._stream,i),t._parse(p.size,a),n()};this._onheader=f,this._parse(512,f)};zFe.inherits(Xl,HFe);Xl.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))};Xl.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)};Xl.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=VFe,this._overflow?this._write(this._overflow,void 0,e):e()}};Xl.prototype._write=function(e,t,r){if(!this._destroyed){var n=this._stream,i=this._buffer,a=this._missing;if(e.length&&(this._partial=!0),e.length<a)return this._missing-=e.length,this._overflow=null,n?n.write(e,r):(i.append(e),r());this._cb=r,this._missing=0;var o=null;e.length>a&&(o=e.slice(a),e=e.slice(0,a)),n?n.end(e):i.append(e),this._overflow=o,this._onparse()}};Xl.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};KFe.exports=Xl});var JFe=v((HCr,YFe)=>{YFe.exports=require("fs").constants||require("constants")});var ZFe=v((WCr,QFe)=>{var yVt=R4(),xVt=function(){},_Vt=function(e){return e.setHeader&&typeof e.abort=="function"},wVt=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},XFe=function(e,t,r){if(typeof t=="function")return XFe(e,null,t);t||(t={}),r=yVt(r||xVt);var n=e._writableState,i=e._readableState,a=t.readable||t.readable!==!1&&e.readable,o=t.writable||t.writable!==!1&&e.writable,s=!1,u=function(){e.writable||c()},c=function(){o=!1,a||r.call(e)},l=function(){a=!1,o||r.call(e)},f=function(g){r.call(e,g?new Error("exited with error code: "+g):null)},h=function(g){r.call(e,g)},p=function(){process.nextTick(d)},d=function(){if(!s){if(a&&!(i&&i.ended&&!i.destroyed))return r.call(e,new Error("premature close"));if(o&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"))}},b=function(){e.req.on("finish",c)};return _Vt(e)?(e.on("complete",c),e.on("abort",p),e.req?b():e.on("request",b)):o&&!n&&(e.on("end",u),e.on("close",u)),wVt(e)&&e.on("exit",f),e.on("end",l),e.on("finish",c),t.error!==!1&&e.on("error",h),e.on("close",p),function(){s=!0,e.removeListener("complete",c),e.removeListener("abort",p),e.removeListener("request",b),e.req&&e.req.removeListener("finish",c),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("exit",f),e.removeListener("end",l),e.removeListener("error",h),e.removeListener("close",p)}};QFe.exports=XFe});var ike=v((VCr,nke)=>{var Vb=JFe(),eke=ZFe(),zF=tr(),EVt=Buffer.alloc,tke=Z2().Readable,Kb=Z2().Writable,AVt=require("string_decoder").StringDecoder,GF=rW(),SVt=parseInt("755",8),TVt=parseInt("644",8),rke=EVt(1024),kW=function(){},FW=function(e,t){t&=511,t&&e.push(rke.slice(0,512-t))};function CVt(e){switch(e&Vb.S_IFMT){case Vb.S_IFBLK:return"block-device";case Vb.S_IFCHR:return"character-device";case Vb.S_IFDIR:return"directory";case Vb.S_IFIFO:return"fifo";case Vb.S_IFLNK:return"symlink"}return"file"}var HF=function(e){Kb.call(this),this.written=0,this._to=e,this._destroyed=!1};zF(HF,Kb);HF.prototype._write=function(e,t,r){if(this.written+=e.length,this._to.push(e))return r();this._to._drain=r};HF.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var WF=function(){Kb.call(this),this.linkname="",this._decoder=new AVt("utf-8"),this._destroyed=!1};zF(WF,Kb);WF.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e),r()};WF.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var tw=function(){Kb.call(this),this._destroyed=!1};zF(tw,Kb);tw.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))};tw.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Lc=function(e){if(!(this instanceof Lc))return new Lc(e);tke.call(this,e),this._drain=kW,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};zF(Lc,tke);Lc.prototype.entry=function(e,t,r){if(this._stream)throw new Error("already piping an entry");if(!(this._finalized||this._destroyed)){typeof t=="function"&&(r=t,t=null),r||(r=kW);var n=this;if((!e.size||e.type==="symlink")&&(e.size=0),e.type||(e.type=CVt(e.mode)),e.mode||(e.mode=e.type==="directory"?SVt:TVt),e.uid||(e.uid=0),e.gid||(e.gid=0),e.mtime||(e.mtime=new Date),typeof t=="string"&&(t=Buffer.from(t)),Buffer.isBuffer(t)){e.size=t.length,this._encode(e);var i=this.push(t);return FW(n,e.size),i?process.nextTick(r):this._drain=r,new tw}if(e.type==="symlink"&&!e.linkname){var a=new WF;return eke(a,function(s){if(s)return n.destroy(),r(s);e.linkname=a.linkname,n._encode(e),r()}),a}if(this._encode(e),e.type!=="file"&&e.type!=="contiguous-file")return process.nextTick(r),new tw;var o=new HF(this);return this._stream=o,eke(o,function(s){if(n._stream=null,s)return n.destroy(),r(s);if(o.written!==e.size)return n.destroy(),r(new Error("size mismatch"));FW(n,e.size),n._finalizing&&n.finalize(),r()}),o}};Lc.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(rke),this.push(null))};Lc.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())};Lc.prototype._encode=function(e){if(!e.pax){var t=GF.encode(e);if(t){this.push(t);return}}this._encodePax(e)};Lc.prototype._encodePax=function(e){var t=GF.encodePax({name:e.name,linkname:e.linkname,pax:e.pax}),r={name:"PaxHeader",mode:e.mode,uid:e.uid,gid:e.gid,size:t.length,mtime:e.mtime,type:"pax-header",linkname:e.linkname&&"PaxHeader",uname:e.uname,gname:e.gname,devmajor:e.devmajor,devminor:e.devminor};this.push(GF.encode(r)),this.push(t),FW(this,t.length),r.size=e.size,r.type=e.type,this.push(GF.encode(r))};Lc.prototype._read=function(e){var t=this._drain;this._drain=kW,t()};nke.exports=Lc});var ake=v(BW=>{BW.extract=$Fe();BW.pack=ike()});var uke=v(($Cr,ske)=>{var DVt=require("zlib"),FVt=ake(),oke=Tb(),Ql=function(e){if(!(this instanceof Ql))return new Ql(e);e=this.options=oke.defaults(e,{gzip:!1}),typeof e.gzipOptions!="object"&&(e.gzipOptions={}),this.supports={directory:!0,symlink:!0},this.engine=FVt.pack(e),this.compressor=!1,e.gzip&&(this.compressor=DVt.createGzip(e.gzipOptions),this.compressor.on("error",this._onCompressorError.bind(this)))};Ql.prototype._onCompressorError=function(e){this.engine.emit("error",e)};Ql.prototype.append=function(e,t,r){var n=this;t.mtime=t.date;function i(o,s){if(o){r(o);return}n.engine.entry(t,s,function(u){r(u,t)})}if(t.sourceType==="buffer")i(null,e);else if(t.sourceType==="stream"&&t.stats){t.size=t.stats.size;var a=n.engine.entry(t,function(o){r(o,t)});e.pipe(a)}else t.sourceType==="stream"&&oke.collectStream(e,i)};Ql.prototype.finalize=function(){this.engine.finalize()};Ql.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};Ql.prototype.pipe=function(e,t){return this.compressor?this.engine.pipe.apply(this.engine,[this.compressor]).pipe(e,t):this.engine.pipe.apply(this.engine,arguments)};Ql.prototype.unpipe=function(){return this.compressor?this.compressor.unpipe.apply(this.compressor,arguments):this.engine.unpipe.apply(this.engine,arguments)};ske.exports=Ql});var hke=v((YCr,fke)=>{var kVt=require("util").inherits,cke=Oz().Transform,BVt=yH(),lke=Tb(),gp=function(e){if(!(this instanceof gp))return new gp(e);e=this.options=lke.defaults(e,{}),cke.call(this,e),this.supports={directory:!0,symlink:!0},this.files=[]};kVt(gp,cke);gp.prototype._transform=function(e,t,r){r(null,e)};gp.prototype._writeStringified=function(){var e=JSON.stringify(this.files);this.write(e)};gp.prototype.append=function(e,t,r){var n=this;t.crc32=0;function i(a,o){if(a){r(a);return}t.size=o.length||0,t.crc32=BVt.unsigned(o),n.files.push(t),r(null,t)}t.sourceType==="buffer"?i(null,e):t.sourceType==="stream"&&lke.collectStream(e,i)};gp.prototype.finalize=function(){this._writeStringified(),this.end()};fke.exports=gp});var dke=v((JCr,pke)=>{var OVt=s8e(),rw={},vp=function(e,t){return vp.create(e,t)};vp.create=function(e,t){if(rw[e]){var r=new OVt(e,t);return r.setFormat(e),r.setModule(new rw[e](t)),r}else throw new Error("create("+e+"): format not registered")};vp.registerFormat=function(e,t){if(rw[e])throw new Error("register("+e+"): format already registered");if(typeof t!="function")throw new Error("register("+e+"): format module invalid");if(typeof t.prototype.append!="function"||typeof t.prototype.finalize!="function")throw new Error("register("+e+"): format module missing methods");rw[e]=t};vp.isRegisteredFormat=function(e){return!!rw[e]};vp.registerFormat("zip",q4e());vp.registerFormat("tar",uke());vp.registerFormat("json",hke());pke.exports=vp});var _V=typeof process!="object"||String(process)!=="[object process]"||process.browser;var wV={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"]=wV||{};function er(e,t,r){return t<=e&&e<=r}function S5e(e,t){return e.indexOf(t)!==-1}var Kc=Math.floor;function Ow(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function T5e(e){for(var t=String(e),r=t.length,n=0,i=[];n<r;){var a=t.charCodeAt(n);if(a<55296||a>57343)i.push(a);else if(56320<=a&&a<=57343)i.push(65533);else if(55296<=a&&a<=56319)if(n===r-1)i.push(65533);else{var o=t.charCodeAt(n+1);if(56320<=o&&o<=57343){var s=a&1023,u=o&1023;i.push(65536+(s<<10)+u),n+=1}else i.push(65533)}n+=1}return i}function C5e(e){for(var t="",r=0;r<e.length;++r){var n=e[r];n<=65535?t+=String.fromCharCode(n):(n-=65536,t+=String.fromCharCode((n>>10)+55296,(n&1023)+56320))}return t}function Ho(e){return 0<=e&&e<=127}var zo=Ho,Fr=-1;function wk(e){this.tokens=[].slice.call(e),this.tokens.reverse()}wk.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Fr},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.pop());else this.tokens.push(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.shift());else this.tokens.unshift(e)}};var xn=-1;function Dr(e,t){if(e)throw TypeError("Decoder error");return t||65533}function Ms(e){throw TypeError("The code point "+e+" could not be encoded.")}function D5e(){}D5e.prototype={handler:function(e,t){}};function F5e(){}F5e.prototype={handler:function(e,t){}};function xk(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(_k,e)?_k[e]:null}var EV=[{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"}],_k={};EV.forEach(function(e){e.encodings.forEach(function(t){t.labels.forEach(function(r){_k[r]=t})})});var to={},ro={};function L0(e,t){return t&&t[e]||null}function M0(e,t){var r=t.indexOf(e);return r===-1?null:r}function Ga(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 k5e(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var t=0,r=0,n=Ga("gb18030-ranges"),i;for(i=0;i<n.length;++i){var a=n[i];if(a[0]<=e)t=a[0],r=a[1];else break}return r+e-t}function B5e(e){if(e===59335)return 7457;var t=0,r=0,n=Ga("gb18030-ranges"),i;for(i=0;i<n.length;++i){var a=n[i];if(a[1]<=e)t=a[1],r=a[0];else break}return r+e-t}function O5e(e){bk=bk||Ga("jis0208").map(function(r,n){return er(n,8272,8835)?null:r});var t=bk;return t.indexOf(e)}var bk;function I5e(e){yk=yk||Ga("big5").map(function(r,n){return n<(161-129)*157?null:r});var t=yk;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?t.lastIndexOf(e):M0(e,t)}var yk,AV="utf-8";function _p(e,t){if(!(this instanceof _p))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):AV,t=Ow(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=xk(e);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!ro[r.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var n=this;return n._encoding=r,Boolean(t.fatal)&&(n._error_mode="fatal"),Boolean(t.ignoreBOM)&&(n._ignoreBOM=!0),Object.defineProperty||(this.encoding=n._encoding.name.toLowerCase(),this.fatal=n._error_mode==="fatal",this.ignoreBOM=n._ignoreBOM),n}Object.defineProperty&&(Object.defineProperty(_p.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(_p.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(_p.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));_p.prototype.decode=function(t,r){var n;typeof t=="object"&&t instanceof ArrayBuffer?n=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):n=new Uint8Array(0),r=Ow(r),this._do_not_flush||(this._decoder=ro[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(r.stream);for(var i=new wk(n),a=[],o;;){var s=i.read();if(s===Fr||(o=this._decoder.handler(i,s),o===xn))break;o!==null&&(Array.isArray(o)?a.push.apply(a,o):a.push(o))}if(!this._do_not_flush){do{if(o=this._decoder.handler(i,i.read()),o===xn)break;o!==null&&(Array.isArray(o)?a.push.apply(a,o):a.push(o))}while(!i.endOfStream());this._decoder=null}function u(c){return S5e(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(c.length>0&&c[0]===65279?(this._BOMseen=!0,c.shift()):c.length>0&&(this._BOMseen=!0)),C5e(c)}return u.call(this,a)};function vy(e,t){if(!(this instanceof vy))throw TypeError("Called as a function. Did you forget 'new'?");t=Ow(t),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(t.fatal)?"fatal":"replacement";var r=this;if(Boolean(t.NONSTANDARD_allowLegacyEncoding)){e=e!==void 0?String(e):AV;var n=xk(e);if(n===null||n.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!to[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=n}else r._encoding=xk("utf-8"),e!==void 0&&"console"in globalThis&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=r._encoding.name.toLowerCase()),r}Object.defineProperty&&Object.defineProperty(vy.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});vy.prototype.encode=function(t,r){t=t===void 0?"":String(t),r=Ow(r),this._do_not_flush||(this._encoder=to[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(r.stream);for(var n=new wk(T5e(t)),i=[],a;;){var o=n.read();if(o===Fr||(a=this._encoder.handler(n,o),a===xn))break;Array.isArray(a)?i.push.apply(i,a):i.push(a)}if(!this._do_not_flush){for(;a=this._encoder.handler(n,n.read()),a!==xn;)Array.isArray(a)?i.push.apply(i,a):i.push(a);this._encoder=null}return new Uint8Array(i)};function P5e(e){var t=e.fatal,r=0,n=0,i=0,a=128,o=191;this.handler=function(s,u){if(u===Fr&&i!==0)return i=0,Dr(t);if(u===Fr)return xn;if(i===0){if(er(u,0,127))return u;if(er(u,194,223))i=1,r=u&31;else if(er(u,224,239))u===224&&(a=160),u===237&&(o=159),i=2,r=u&15;else if(er(u,240,244))u===240&&(a=144),u===244&&(o=143),i=3,r=u&7;else return Dr(t);return null}if(!er(u,a,o))return r=i=n=0,a=128,o=191,s.prepend(u),Dr(t);if(a=128,o=191,r=r<<6|u&63,n+=1,n!==i)return null;var c=r;return r=i=n=0,c}}function R5e(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(zo(n))return n;var i,a;er(n,128,2047)?(i=1,a=192):er(n,2048,65535)?(i=2,a=224):er(n,65536,1114111)&&(i=3,a=240);for(var o=[(n>>6*i)+a];i>0;){var s=n>>6*(i-1);o.push(128|s&63),i-=1}return o}}to["UTF-8"]=function(e){return new R5e(e)};ro["UTF-8"]=function(e){return new P5e(e)};function j5e(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Ho(i))return i;var a=e[i-128];return a===null?Dr(r):a}}function L5e(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(zo(i))return i;var a=M0(i,e);return a===null&&Ms(i),a+128}}(function(){"encoding-indexes"in globalThis&&EV.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(t){var r=t.name,n=Ga(r.toLowerCase());ro[r]=function(i){return new j5e(n,i)},to[r]=function(i){return new L5e(n,i)}})})})();ro.GBK=function(e){return new SV(e)};to.GBK=function(e){return new TV(e,!0)};function SV(e){var t=e.fatal,r=0,n=0,i=0;this.handler=function(a,o){if(o===Fr&&r===0&&n===0&&i===0)return xn;o===Fr&&(r!==0||n!==0||i!==0)&&(r=0,n=0,i=0,Dr(t));var s;if(i!==0){s=null,er(o,48,57)&&(s=k5e((((r-129)*10+n-48)*126+i-129)*10+o-48));var u=[n,i,o];return r=0,n=0,i=0,s===null?(a.prepend(u),Dr(t)):s}if(n!==0)return er(o,129,254)?(i=o,null):(a.prepend([n,o]),r=0,n=0,Dr(t));if(r!==0){if(er(o,48,57))return n=o,null;var c=r,l=null;r=0;var f=o<127?64:65;return(er(o,64,126)||er(o,128,254))&&(l=(c-129)*190+(o-f)),s=l===null?null:L0(l,Ga("gb18030")),s===null&&Ho(o)&&a.prepend(o),s===null?Dr(t):s}return Ho(o)?o:o===128?8364:er(o,129,254)?(r=o,null):Dr(t)}}function TV(e,t){var r=e.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(zo(i))return i;if(i===58853)return Ms(i);if(t&&i===8364)return 128;var a=M0(i,Ga("gb18030"));if(a!==null){var o=Kc(a/190)+129,s=a%190,u=s<63?64:65;return[o,s+u]}if(t)return Ms(i);a=B5e(i);var c=Kc(a/10/126/10);a=a-c*10*126*10;var l=Kc(a/10/126);a=a-l*10*126;var f=Kc(a/10),h=a-f*10;return[c+129,l+48,f+129,h+48]}}to.gb18030=function(e){return new TV(e)};ro.gb18030=function(e){return new SV(e)};function M5e(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Fr&&r!==0)return r=0,Dr(t);if(i===Fr&&r===0)return xn;if(r!==0){var a=r,o=null;r=0;var s=i<127?64:98;switch((er(i,64,126)||er(i,161,254))&&(o=(a-129)*157+(i-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:L0(o,Ga("big5"));return u===null&&Ho(i)&&n.prepend(i),u===null?Dr(t):u}return Ho(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function q5e(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(zo(n))return n;var i=I5e(n);if(i===null)return Ms(n);var a=Kc(i/157)+129;if(a<161)return Ms(n);var o=i%157,s=o<63?64:98;return[a,o+s]}}to.Big5=function(e){return new q5e(e)};ro.Big5=function(e){return new M5e(e)};function N5e(e){var t=e.fatal,r=!1,n=0;this.handler=function(i,a){if(a===Fr&&n!==0)return n=0,Dr(t);if(a===Fr&&n===0)return xn;if(n===142&&er(a,161,223))return n=0,65377-161+a;if(n===143&&er(a,161,254))return r=!0,n=a,null;if(n!==0){var o=n;n=0;var s=null;return er(o,161,254)&&er(a,161,254)&&(s=L0((o-161)*94+(a-161),Ga(r?"jis0212":"jis0208"))),r=!1,er(a,161,254)||i.prepend(a),s===null?Dr(t):s}return Ho(a)?a:a===142||a===143||er(a,161,254)?(n=a,null):Dr(t)}}function U5e(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(zo(n))return n;if(n===165)return 92;if(n===8254)return 126;if(er(n,65377,65439))return[142,n-65377+161];n===8722&&(n=65293);var i=M0(n,Ga("jis0208"));if(i===null)return Ms(n);var a=Kc(i/94)+161,o=i%94+161;return[a,o]}}to["EUC-JP"]=function(e){return new U5e(e)};ro["EUC-JP"]=function(e){return new N5e(e)};function G5e(e){var t=e.fatal,r={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},n=r.ASCII,i=r.ASCII,a=0,o=!1;this.handler=function(s,u){switch(n){default:case r.ASCII:return u===27?(n=r.EscapeStart,null):er(u,0,127)&&u!==14&&u!==15&&u!==27?(o=!1,u):u===Fr?xn:(o=!1,Dr(t));case r.Roman:return u===27?(n=r.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===Fr?xn:(o=!1,Dr(t));case r.Katakana:return u===27?(n=r.EscapeStart,null):er(u,33,95)?(o=!1,65377-33+u):u===Fr?xn:(o=!1,Dr(t));case r.LeadByte:return u===27?(n=r.EscapeStart,null):er(u,33,126)?(o=!1,a=u,n=r.TrailByte,null):u===Fr?xn:(o=!1,Dr(t));case r.TrailByte:if(u===27)return n=r.EscapeStart,Dr(t);if(er(u,33,126)){n=r.LeadByte;var c=(a-33)*94+u-33,l=L0(c,Ga("jis0208"));return l===null?Dr(t):l}return u===Fr?(n=r.LeadByte,s.prepend(u),Dr(t)):(n=r.LeadByte,Dr(t));case r.EscapeStart:return u===36||u===40?(a=u,n=r.Escape,null):(s.prepend(u),o=!1,n=i,Dr(t));case r.Escape:var f=a;a=0;var h=null;if(f===40&&u===66&&(h=r.ASCII),f===40&&u===74&&(h=r.Roman),f===40&&u===73&&(h=r.Katakana),f===36&&(u===64||u===66)&&(h=r.LeadByte),h!==null){n=n=h;var p=o;return o=!0,p?Dr(t):null}return s.prepend([f,u]),o=!1,n=i,Dr(t)}}}function z5e(e){var t=e.fatal,r={ASCII:0,Roman:1,jis0208:2},n=r.ASCII;this.handler=function(i,a){if(a===Fr&&n!==r.ASCII)return i.prepend(a),n=r.ASCII,[27,40,66];if(a===Fr&&n===r.ASCII)return xn;if((n===r.ASCII||n===r.Roman)&&(a===14||a===15||a===27))return Ms(65533);if(n===r.ASCII&&zo(a))return a;if(n===r.Roman&&(zo(a)&&a!==92&&a!==126||a==165||a==8254)){if(zo(a))return a;if(a===165)return 92;if(a===8254)return 126}if(zo(a)&&n!==r.ASCII)return i.prepend(a),n=r.ASCII,[27,40,66];if((a===165||a===8254)&&n!==r.Roman)return i.prepend(a),n=r.Roman,[27,40,74];a===8722&&(a=65293);var o=M0(a,Ga("jis0208"));if(o===null)return Ms(a);if(n!==r.jis0208)return i.prepend(a),n=r.jis0208,[27,36,66];var s=Kc(o/94)+33,u=o%94+33;return[s,u]}}to["ISO-2022-JP"]=function(e){return new z5e(e)};ro["ISO-2022-JP"]=function(e){return new G5e(e)};function H5e(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Fr&&r!==0)return r=0,Dr(t);if(i===Fr&&r===0)return xn;if(r!==0){var a=r,o=null;r=0;var s=i<127?64:65,u=a<160?129:193;if((er(i,64,126)||er(i,128,252))&&(o=(a-u)*188+i-s),er(o,8836,10715))return 57344-8836+o;var c=o===null?null:L0(o,Ga("jis0208"));return c===null&&Ho(i)&&n.prepend(i),c===null?Dr(t):c}return Ho(i)||i===128?i:er(i,161,223)?65377-161+i:er(i,129,159)||er(i,224,252)?(r=i,null):Dr(t)}}function W5e(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(zo(n)||n===128)return n;if(n===165)return 92;if(n===8254)return 126;if(er(n,65377,65439))return n-65377+161;n===8722&&(n=65293);var i=O5e(n);if(i===null)return Ms(n);var a=Kc(i/188),o=a<31?129:193,s=i%188,u=s<63?64:65;return[a+o,s+u]}}to.Shift_JIS=function(e){return new W5e(e)};ro.Shift_JIS=function(e){return new H5e(e)};function V5e(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Fr&&r!==0)return r=0,Dr(t);if(i===Fr&&r===0)return xn;if(r!==0){var a=r,o=null;r=0,er(i,65,254)&&(o=(a-129)*190+(i-65));var s=o===null?null:L0(o,Ga("euc-kr"));return o===null&&Ho(i)&&n.prepend(i),s===null?Dr(t):s}return Ho(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function K5e(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(zo(n))return n;var i=M0(n,Ga("euc-kr"));if(i===null)return Ms(n);var a=Kc(i/190)+129,o=i%190+65;return[a,o]}}to["EUC-KR"]=function(e){return new K5e(e)};ro["EUC-KR"]=function(e){return new V5e(e)};function Bw(e,t){var r=e>>8,n=e&255;return t?[r,n]:[n,r]}function CV(e,t){var r=t.fatal,n=null,i=null;this.handler=function(a,o){if(o===Fr&&(n!==null||i!==null))return Dr(r);if(o===Fr&&n===null&&i===null)return xn;if(n===null)return n=o,null;var s;if(e?s=(n<<8)+o:s=(o<<8)+n,n=null,i!==null){var u=i;return i=null,er(s,56320,57343)?65536+(u-55296)*1024+(s-56320):(a.prepend(Bw(s,e)),Dr(r))}return er(s,55296,56319)?(i=s,null):er(s,56320,57343)?Dr(r):s}}function DV(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(er(i,0,65535))return Bw(i,e);var a=Bw((i-65536>>10)+55296,e),o=Bw((i-65536&1023)+56320,e);return a.concat(o)}}to["UTF-16BE"]=function(e){return new DV(!0,e)};ro["UTF-16BE"]=function(e){return new CV(!0,e)};to["UTF-16LE"]=function(e){return new DV(!1,e)};ro["UTF-16LE"]=function(e){return new CV(!1,e)};function $5e(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?xn:Ho(n)?n:63360+n-128}}function Y5e(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?xn:zo(n)?n:er(n,63360,63487)?n-63360+128:Ms(n)}}to["x-user-defined"]=function(e){return new Y5e(e)};ro["x-user-defined"]=function(e){return new $5e(e)};function by(e){return Buffer.from(e).toString("base64")}function Ek(e){return Buffer.from(e,"base64").toString("ascii")}var wY=$t(xY(),1),EY=$t(Ty(),1);function _Y(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function cRe(e,t){let r=t.type?t.type.replace("image/",""):"jpeg",n=(0,EY.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,wY.default)(n,r,t)}function AY(e,t){let r=cRe(e,t);return new Promise(n=>{let i=[];r.on("data",a=>i.push(a)),r.on("end",()=>{let a=Buffer.concat(i);n(_Y(a))})})}var nae=$t(rae(),1),TI=["image/png","image/jpeg","image/gif"];async function CI(e,t){if(!t)throw new Error("MIMEType is required to parse image under Node.js");let r=e instanceof Buffer?e:Buffer.from(e);return await _We(r,t)}function _We(e,t){return new Promise(r=>(0,nae.default)(e,t,(n,i)=>{if(n)throw n;let a=[...i.shape],o=i.shape.length===4?i.shape.shift():1,s=i.data instanceof Buffer?new Uint8Array(i.data):i.data;r({shape:a,data:s,width:i.shape[0],height:i.shape[1],components:i.shape[2],layers:o?[o]:[]})}))}async function So(e,t,r,n){return n._parse(e,t,r,n)}function Qt(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var Ju={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},aae=Ju.self||Ju.window||Ju.global||{},oae=Ju.window||Ju.self||Ju.global||{},sae=Ju.global||Ju.self||Ju.window||{},uae=Ju.document||{};var gn=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var iae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),wWe=iae&&parseFloat(iae[1])||0;function DI(e,t){return cae(e||{},t)}function cae(e,t){let r={...e};for(let[n,i]of Object.entries(t))i&&typeof i=="object"&&!Array.isArray(i)?r[n]=cae(r[n]||{},t[n]):r[n]=t[n];return r}var lae="beta";function EWe(){var e;return(e=globalThis._loadersgl_)!=null&&e.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.0.0-beta.8"),globalThis._loadersgl_.version}var Np=EWe();function pa(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Xu={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Ctr=Xu.self||Xu.window||Xu.global||{},Dtr=Xu.window||Xu.self||Xu.global||{},Ftr=Xu.global||Xu.self||Xu.window||{},ktr=Xu.document||{};var $a=typeof process!="object"||String(process)!=="[object process]"||process.browser,wx=typeof importScripts=="function",hae=typeof window<"u"&&typeof window.orientation<"u",fae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Btr=fae&&parseFloat(fae[1])||0;var Ex=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(t,r){this.name=t,this.workerThread=r,this.result=new Promise((n,i)=>{this._resolve=n,this._reject=i})}postMessage(t,r){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:r})}done(t){pa(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){pa(this.isRunning),this.isRunning=!1,this._reject(t)}};var Dm={};ca(Dm,{NodeWorker:()=>Ax});var pae=$t(require("worker_threads"),1);kw(Dm,require("worker_threads"));var Ax=pae.Worker;var FI=new Map;function dae(e){pa(e.source&&!e.url||!e.source&&e.url);let t=FI.get(e.source||e.url);return t||(e.url&&(t=AWe(e.url),FI.set(e.url,t)),e.source&&(t=mae(e.source),FI.set(e.source,t))),pa(t),t}function AWe(e){if(!e.startsWith("http"))return e;let t=SWe(e);return mae(t)}function mae(e){let t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function SWe(e){return`try {
|
|
173
|
+
`);return Buffer.from(t)};Ub.decodePax=function(e){for(var t={};e.length;){for(var r=0;r<e.length&&e[r]!==32;)r++;var n=parseInt(e.slice(0,r).toString(),10);if(!n)return t;var i=e.slice(r+1,n-1).toString(),a=i.indexOf("=");if(a===-1)return t;t[i.slice(0,a)]=i.slice(a+1),e=e.slice(n)}return t};Ub.encode=function(e){var t=eHt(512),r=e.name,n="";if(e.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var i=r.indexOf("/");if(i===-1)return null;n+=n?"/"+r.slice(0,i):r.slice(0,i),r=r.slice(i+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(n)>155||e.linkname&&Buffer.byteLength(e.linkname)>100?null:(t.write(r),t.write(cp(e.mode&oHt,6),100),t.write(cp(e.uid,6),108),t.write(cp(e.gid,6),116),t.write(cp(e.size,11),124),t.write(cp(e.mtime.getTime()/1e3|0,11),136),t[156]=N4e+cHt(e.type),e.linkname&&t.write(e.linkname,157),U4e.copy(t,z2),nHt.copy(t,tW),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(cp(e.devmajor||0,6),329),t.write(cp(e.devminor||0,6),337),n&&t.write(n,345),t.write(cp(z4e(t),6),148),t)};Ub.decode=function(e,t,r){var n=e[156]===0?0:e[156]-N4e,i=Nb(e,0,100,t),a=lp(e,100,8),o=lp(e,108,8),s=lp(e,116,8),u=lp(e,124,12),c=lp(e,136,12),l=uHt(n),f=e[157]===0?null:Nb(e,157,100,t),h=Nb(e,265,32),p=Nb(e,297,32),d=lp(e,329,8),b=lp(e,337,8),g=z4e(e);if(g===8*32)return null;if(g!==lp(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(U4e.compare(e,z2,z2+6)===0)e[345]&&(i=Nb(e,345,155,t)+"/"+i);else if(!(iHt.compare(e,z2,z2+6)===0&&aHt.compare(e,tW,tW+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return n===0&&i&&i[i.length-1]==="/"&&(n=5),{name:i,mode:a,uid:o,gid:s,size:u,mtime:new Date(1e3*c),type:l,linkname:f,uname:h,gname:p,devmajor:d,devminor:b}}});var nW=v((CCr,H4e)=>{H4e.exports=require("stream")});var J4e=v((DCr,Y4e)=>{"use strict";function W4e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function V4e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?W4e(Object(r),!0).forEach(function(n){fHt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W4e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fHt(e,t,r){return t=$4e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hHt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K4e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$4e(n.key),n)}}function pHt(e,t,r){return t&&K4e(e.prototype,t),r&&K4e(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $4e(e){var t=dHt(e,"string");return typeof t=="symbol"?t:String(t)}function dHt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mHt=require("buffer"),CF=mHt.Buffer,gHt=require("util"),iW=gHt.inspect,vHt=iW&&iW.custom||"inspect";function bHt(e,t,r){CF.prototype.copy.call(e,t,r)}Y4e.exports=function(){function e(){hHt(this,e),this.head=null,this.tail=null,this.length=0}return pHt(e,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return CF.alloc(0);for(var n=CF.allocUnsafe(r>>>0),i=this.head,a=0;i;)bHt(i.data,n,a),a+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,a=n.data;for(r-=a.length;n=n.next;){var o=n.data,s=r>o.length?o.length:r;if(s===o.length?a+=o:a+=o.slice(0,r),r-=s,r===0){s===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(s));break}++i}return this.length-=i,a}},{key:"_getBuffer",value:function(r){var n=CF.allocUnsafe(r),i=this.head,a=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var o=i.data,s=r>o.length?o.length:r;if(o.copy(n,n.length-r,0,s),r-=s,r===0){s===o.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(s));break}++a}return this.length-=a,n}},{key:vHt,value:function(r,n){return iW(this,V4e(V4e({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var oW=v((FCr,Q4e)=>{"use strict";function yHt(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(aW,this,e)):process.nextTick(aW,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(DF,r):(r._writableState.errorEmitted=!0,process.nextTick(X4e,r,a)):process.nextTick(X4e,r,a):t?(process.nextTick(DF,r),t(a)):process.nextTick(DF,r)}),this)}function X4e(e,t){aW(e,t),DF(e)}function DF(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function xHt(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function aW(e,t){e.emit("error",t)}function _Ht(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}Q4e.exports={destroy:yHt,undestroy:xHt,errorOrDestroy:_Ht}});var fp=v((kCr,tFe)=>{"use strict";var eFe={};function Is(e,t,r){r||(r=Error);function n(a,o,s){return typeof t=="string"?t:t(a,o,s)}class i extends r{constructor(o,s,u){super(n(o,s,u))}}i.prototype.name=r.name,i.prototype.code=e,eFe[e]=i}function Z4e(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function wHt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function EHt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function AHt(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Is("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Is("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&wHt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(EHt(e," argument"))i=`The ${e} ${n} ${Z4e(t,"type")}`;else{let a=AHt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${Z4e(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);Is("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Is("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Is("ERR_STREAM_PREMATURE_CLOSE","Premature close");Is("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Is("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Is("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Is("ERR_STREAM_WRITE_AFTER_END","write after end");Is("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Is("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Is("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");tFe.exports.codes=eFe});var sW=v((BCr,rFe)=>{"use strict";var SHt=fp().codes.ERR_INVALID_OPT_VALUE;function THt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function CHt(e,t,r,n){var i=THt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new SHt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}rFe.exports={getHighWaterMark:CHt}});var lW=v((OCr,uFe)=>{"use strict";uFe.exports=ci;function iFe(e){var t=this;this.next=null,this.entry=null,this.finish=function(){eWt(t,e)}}var Gb;ci.WritableState=W2;var DHt={deprecate:ld()},aFe=nW(),kF=require("buffer").Buffer,FHt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function kHt(e){return kF.from(e)}function BHt(e){return kF.isBuffer(e)||e instanceof FHt}var cW=oW(),OHt=sW(),IHt=OHt.getHighWaterMark,hp=fp().codes,PHt=hp.ERR_INVALID_ARG_TYPE,RHt=hp.ERR_METHOD_NOT_IMPLEMENTED,jHt=hp.ERR_MULTIPLE_CALLBACK,LHt=hp.ERR_STREAM_CANNOT_PIPE,MHt=hp.ERR_STREAM_DESTROYED,qHt=hp.ERR_STREAM_NULL_VALUES,NHt=hp.ERR_STREAM_WRITE_AFTER_END,UHt=hp.ERR_UNKNOWN_ENCODING,zb=cW.errorOrDestroy;tr()(ci,aFe);function GHt(){}function W2(e,t,r){Gb=Gb||w0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Gb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=IHt(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){YHt(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new iFe(this)}W2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(W2.prototype,"buffer",{get:DHt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var FF;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(FF=Function.prototype[Symbol.hasInstance],Object.defineProperty(ci,Symbol.hasInstance,{value:function(t){return FF.call(this,t)?!0:this!==ci?!1:t&&t._writableState instanceof W2}})):FF=function(t){return t instanceof this};function ci(e){Gb=Gb||w0();var t=this instanceof Gb;if(!t&&!FF.call(ci,this))return new ci(e);this._writableState=new W2(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),aFe.call(this)}ci.prototype.pipe=function(){zb(this,new LHt)};function zHt(e,t){var r=new NHt;zb(e,r),process.nextTick(t,r)}function HHt(e,t,r,n){var i;return r===null?i=new qHt:typeof r!="string"&&!t.objectMode&&(i=new PHt("chunk",["string","Buffer"],r)),i?(zb(e,i),process.nextTick(n,i),!1):!0}ci.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&BHt(e);return a&&!kF.isBuffer(e)&&(e=kHt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=GHt),n.ending?zHt(this,r):(a||HHt(this,n,e,r))&&(n.pendingcb++,i=VHt(this,n,a,e,t,r)),i};ci.prototype.cork=function(){this._writableState.corked++};ci.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&oFe(this,e))};ci.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new UHt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(ci.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function WHt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=kF.from(t,r)),t}Object.defineProperty(ci.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function VHt(e,t,r,n,i,a){if(!r){var o=WHt(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else uW(e,t,!1,s,n,i,a);return u}function uW(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new MHt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function KHt(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(H2,e,t),e._writableState.errorEmitted=!0,zb(e,n)):(i(n),e._writableState.errorEmitted=!0,zb(e,n),H2(e,t))}function $Ht(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function YHt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new jHt;if($Ht(r),t)KHt(e,r,n,t,i);else{var a=sFe(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&oFe(e,r),n?process.nextTick(nFe,e,r,a,i):nFe(e,r,a,i)}}function nFe(e,t,r,n){r||JHt(e,t),t.pendingcb--,n(),H2(e,t)}function JHt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function oFe(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var o=0,s=!0;r;)i[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;i.allBuffers=s,uW(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new iFe(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(uW(e,t,!1,f,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}ci.prototype._write=function(e,t,r){r(new RHt("_write()"))};ci.prototype._writev=null;ci.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||ZHt(this,n,r),this};Object.defineProperty(ci.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function sFe(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function XHt(e,t){e._final(function(r){t.pendingcb--,r&&zb(e,r),t.prefinished=!0,e.emit("prefinish"),H2(e,t)})}function QHt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(XHt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function H2(e,t){var r=sFe(t);if(r&&(QHt(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function ZHt(e,t,r){t.ending=!0,H2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function eWt(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(ci.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});ci.prototype.destroy=cW.destroy;ci.prototype._undestroy=cW.undestroy;ci.prototype._destroy=function(e,t){t(e)}});var w0=v((ICr,lFe)=>{"use strict";var tWt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};lFe.exports=jc;var cFe=pW(),hW=lW();tr()(jc,cFe);for(fW=tWt(hW.prototype),BF=0;BF<fW.length;BF++)OF=fW[BF],jc.prototype[OF]||(jc.prototype[OF]=hW.prototype[OF]);var fW,OF,BF;function jc(e){if(!(this instanceof jc))return new jc(e);cFe.call(this,e),hW.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",rWt)))}Object.defineProperty(jc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(jc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(jc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function rWt(){this._writableState.ended||process.nextTick(nWt,this)}function nWt(e){e.end()}Object.defineProperty(jc.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var gW=v(hFe=>{"use strict";var mW=Us().Buffer,fFe=mW.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function iWt(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function aWt(e){var t=iWt(e);if(typeof t!="string"&&(mW.isEncoding===fFe||!fFe(e)))throw new Error("Unknown encoding: "+e);return t||e}hFe.StringDecoder=V2;function V2(e){this.encoding=aWt(e);var t;switch(this.encoding){case"utf16le":this.text=fWt,this.end=hWt,t=4;break;case"utf8":this.fillLast=uWt,t=4;break;case"base64":this.text=pWt,this.end=dWt,t=3;break;default:this.write=mWt,this.end=gWt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=mW.allocUnsafe(t)}V2.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};V2.prototype.end=lWt;V2.prototype.text=cWt;V2.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function dW(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function oWt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=dW(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=dW(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=dW(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function sWt(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function uWt(e){var t=this.lastTotal-this.lastNeed,r=sWt(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function cWt(e,t){var r=oWt(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function lWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function fWt(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function hWt(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function pWt(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function dWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function mWt(e){return e.toString(this.encoding)}function gWt(e){return e&&e.length?this.write(e):""}});var IF=v((RCr,mFe)=>{"use strict";var pFe=fp().codes.ERR_STREAM_PREMATURE_CLOSE;function vWt(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function bWt(){}function yWt(e){return e.setHeader&&typeof e.abort=="function"}function dFe(e,t,r){if(typeof t=="function")return dFe(e,null,t);t||(t={}),r=vWt(r||bWt);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,a=function(){e.writable||s()},o=e._writableState&&e._writableState.finished,s=function(){i=!1,o=!0,n||r.call(e)},u=e._readableState&&e._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(e)},l=function(d){r.call(e,d)},f=function(){var d;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(d=new pFe),r.call(e,d);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(d=new pFe),r.call(e,d)},h=function(){e.req.on("finish",s)};return yWt(e)?(e.on("complete",s),e.on("abort",f),e.req?h():e.on("request",h)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",h),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}mFe.exports=dFe});var vFe=v((jCr,gFe)=>{"use strict";var PF;function pp(e,t,r){return t=xWt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xWt(e){var t=_Wt(e,"string");return typeof t=="symbol"?t:String(t)}function _Wt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wWt=IF(),dp=Symbol("lastResolve"),E0=Symbol("lastReject"),K2=Symbol("error"),RF=Symbol("ended"),A0=Symbol("lastPromise"),vW=Symbol("handlePromise"),S0=Symbol("stream");function mp(e,t){return{value:e,done:t}}function EWt(e){var t=e[dp];if(t!==null){var r=e[S0].read();r!==null&&(e[A0]=null,e[dp]=null,e[E0]=null,t(mp(r,!1)))}}function AWt(e){process.nextTick(EWt,e)}function SWt(e,t){return function(r,n){e.then(function(){if(t[RF]){r(mp(void 0,!0));return}t[vW](r,n)},n)}}var TWt=Object.getPrototypeOf(function(){}),CWt=Object.setPrototypeOf((PF={get stream(){return this[S0]},next:function(){var t=this,r=this[K2];if(r!==null)return Promise.reject(r);if(this[RF])return Promise.resolve(mp(void 0,!0));if(this[S0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[K2]?s(t[K2]):o(mp(void 0,!0))})});var n=this[A0],i;if(n)i=new Promise(SWt(n,this));else{var a=this[S0].read();if(a!==null)return Promise.resolve(mp(a,!1));i=new Promise(this[vW])}return this[A0]=i,i}},pp(PF,Symbol.asyncIterator,function(){return this}),pp(PF,"return",function(){var t=this;return new Promise(function(r,n){t[S0].destroy(null,function(i){if(i){n(i);return}r(mp(void 0,!0))})})}),PF),TWt),DWt=function(t){var r,n=Object.create(CWt,(r={},pp(r,S0,{value:t,writable:!0}),pp(r,dp,{value:null,writable:!0}),pp(r,E0,{value:null,writable:!0}),pp(r,K2,{value:null,writable:!0}),pp(r,RF,{value:t._readableState.endEmitted,writable:!0}),pp(r,vW,{value:function(a,o){var s=n[S0].read();s?(n[A0]=null,n[dp]=null,n[E0]=null,a(mp(s,!1))):(n[dp]=a,n[E0]=o)},writable:!0}),r));return n[A0]=null,wWt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[E0];a!==null&&(n[A0]=null,n[dp]=null,n[E0]=null,a(i)),n[K2]=i;return}var o=n[dp];o!==null&&(n[A0]=null,n[dp]=null,n[E0]=null,o(mp(void 0,!0))),n[RF]=!0}),t.on("readable",AWt.bind(null,n)),n};gFe.exports=DWt});var _Fe=v((LCr,xFe)=>{"use strict";function bFe(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){r(c);return}s.done?t(u):Promise.resolve(u).then(n,i)}function FWt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){bFe(a,n,i,o,s,"next",u)}function s(u){bFe(a,n,i,o,s,"throw",u)}o(void 0)})}}function yFe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function kWt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yFe(Object(r),!0).forEach(function(n){BWt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yFe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BWt(e,t,r){return t=OWt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OWt(e){var t=IWt(e,"string");return typeof t=="symbol"?t:String(t)}function IWt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var PWt=fp().codes.ERR_INVALID_ARG_TYPE;function RWt(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new PWt("iterable",["Iterable"],t);var i=new e(kWt({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=FWt(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?o():a=!1}catch(f){i.destroy(f)}}),s.apply(this,arguments)}return i}xFe.exports=RWt});var pW=v((qCr,BFe)=>{"use strict";BFe.exports=zr;var Hb;zr.ReadableState=SFe;var MCr=require("events").EventEmitter,AFe=function(t,r){return t.listeners(r).length},Y2=nW(),jF=require("buffer").Buffer,jWt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function LWt(e){return jF.from(e)}function MWt(e){return jF.isBuffer(e)||e instanceof jWt}var bW=require("util"),xr;bW&&bW.debuglog?xr=bW.debuglog("stream"):xr=function(){};var qWt=J4e(),SW=oW(),NWt=sW(),UWt=NWt.getHighWaterMark,LF=fp().codes,GWt=LF.ERR_INVALID_ARG_TYPE,zWt=LF.ERR_STREAM_PUSH_AFTER_EOF,HWt=LF.ERR_METHOD_NOT_IMPLEMENTED,WWt=LF.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Wb,yW,xW;tr()(zr,Y2);var $2=SW.errorOrDestroy,_W=["error","close","destroy","pause","resume"];function VWt(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function SFe(e,t,r){Hb=Hb||w0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Hb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=UWt(this,e,"readableHighWaterMark",r),this.buffer=new qWt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Wb||(Wb=gW().StringDecoder),this.decoder=new Wb(e.encoding),this.encoding=e.encoding)}function zr(e){if(Hb=Hb||w0(),!(this instanceof zr))return new zr(e);var t=this instanceof Hb;this._readableState=new SFe(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Y2.call(this)}Object.defineProperty(zr.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});zr.prototype.destroy=SW.destroy;zr.prototype._undestroy=SW.undestroy;zr.prototype._destroy=function(e,t){t(e)};zr.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=jF.from(e,t),t=""),n=!0),TFe(this,e,t,!1,n)};zr.prototype.unshift=function(e){return TFe(this,e,null,!0,!1)};function TFe(e,t,r,n,i){xr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,YWt(e,a);else{var o;if(i||(o=KWt(a,t)),o)$2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==jF.prototype&&(t=LWt(t)),n)a.endEmitted?$2(e,new WWt):wW(e,a,t,!0);else if(a.ended)$2(e,new zWt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?wW(e,a,t,!1):AW(e,a)):wW(e,a,t,!1)}else n||(a.reading=!1,AW(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function wW(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&MF(e)),AW(e,t)}function KWt(e,t){var r;return!MWt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new GWt("chunk",["string","Buffer","Uint8Array"],t)),r}zr.prototype.isPaused=function(){return this._readableState.flowing===!1};zr.prototype.setEncoding=function(e){Wb||(Wb=gW().StringDecoder);var t=new Wb(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var wFe=1073741824;function $Wt(e){return e>=wFe?e=wFe:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function EFe(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=$Wt(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}zr.prototype.read=function(e){xr("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return xr("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?EW(this):MF(this),null;if(e=EFe(e,t),e===0&&t.ended)return t.length===0&&EW(this),null;var n=t.needReadable;xr("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,xr("length less than watermark",n)),t.ended||t.reading?(n=!1,xr("reading or ended",n)):n&&(xr("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=EFe(r,t)));var i;return e>0?i=FFe(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&EW(this)),i!==null&&this.emit("data",i),i};function YWt(e,t){if(xr("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?MF(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,CFe(e)))}}function MF(e){var t=e._readableState;xr("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(xr("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(CFe,e))}function CFe(e){var t=e._readableState;xr("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,TW(e)}function AW(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(JWt,e,t))}function JWt(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(xr("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}zr.prototype._read=function(e){$2(this,new HWt("_read()"))};zr.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,xr("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?s:b;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",o);function o(g,x){xr("onunpipe"),g===r&&x&&x.hasUnpiped===!1&&(x.hasUnpiped=!0,l())}function s(){xr("onend"),e.end()}var u=XWt(r);e.on("drain",u);var c=!1;function l(){xr("cleanup"),e.removeListener("close",p),e.removeListener("finish",d),e.removeListener("drain",u),e.removeListener("error",h),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){xr("ondata");var x=e.write(g);xr("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&kFe(n.pipes,e)!==-1)&&!c&&(xr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(g){xr("onerror",g),b(),e.removeListener("error",h),AFe(e,"error")===0&&$2(e,g)}VWt(e,"error",h);function p(){e.removeListener("finish",d),b()}e.once("close",p);function d(){xr("onfinish"),e.removeListener("close",p),b()}e.once("finish",d);function b(){xr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(xr("pipe resume"),r.resume()),e};function XWt(e){return function(){var r=e._readableState;xr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&AFe(e,"data")&&(r.flowing=!0,TW(e))}}zr.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=kFe(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};zr.prototype.on=function(e,t){var r=Y2.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,xr("on readable",n.length,n.reading),n.length?MF(this):n.reading||process.nextTick(QWt,this)),r};zr.prototype.addListener=zr.prototype.on;zr.prototype.removeListener=function(e,t){var r=Y2.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(DFe,this),r};zr.prototype.removeAllListeners=function(e){var t=Y2.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(DFe,this),t};function DFe(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function QWt(e){xr("readable nexttick read 0"),e.read(0)}zr.prototype.resume=function(){var e=this._readableState;return e.flowing||(xr("resume"),e.flowing=!e.readableListening,ZWt(this,e)),e.paused=!1,this};function ZWt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(eVt,e,t))}function eVt(e,t){xr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),TW(e),t.flowing&&!t.reading&&e.read(0)}zr.prototype.pause=function(){return xr("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(xr("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function TW(e){var t=e._readableState;for(xr("flow",t.flowing);t.flowing&&e.read()!==null;);}zr.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(xr("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&t.push(o)}t.push(null)}),e.on("data",function(o){if(xr("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var s=t.push(o);s||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(s){return function(){return e[s].apply(e,arguments)}}(i));for(var a=0;a<_W.length;a++)e.on(_W[a],this.emit.bind(this,_W[a]));return this._read=function(o){xr("wrapped _read",o),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(zr.prototype[Symbol.asyncIterator]=function(){return yW===void 0&&(yW=vFe()),yW(this)});Object.defineProperty(zr.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(zr.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(zr.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});zr._fromList=FFe;Object.defineProperty(zr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function FFe(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function EW(e){var t=e._readableState;xr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(tVt,t,e))}function tVt(e,t){if(xr("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(zr.from=function(e,t){return xW===void 0&&(xW=_Fe()),xW(zr,e,t)});function kFe(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var CW=v((NCr,IFe)=>{"use strict";IFe.exports=Jl;var qF=fp().codes,rVt=qF.ERR_METHOD_NOT_IMPLEMENTED,nVt=qF.ERR_MULTIPLE_CALLBACK,iVt=qF.ERR_TRANSFORM_ALREADY_TRANSFORMING,aVt=qF.ERR_TRANSFORM_WITH_LENGTH_0,NF=w0();tr()(Jl,NF);function oVt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new nVt);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Jl(e){if(!(this instanceof Jl))return new Jl(e);NF.call(this,e),this._transformState={afterTransform:oVt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",sVt)}function sVt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){OFe(e,t,r)}):OFe(this,null,null)}Jl.prototype.push=function(e,t){return this._transformState.needTransform=!1,NF.prototype.push.call(this,e,t)};Jl.prototype._transform=function(e,t,r){r(new rVt("_transform()"))};Jl.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Jl.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Jl.prototype._destroy=function(e,t){NF.prototype._destroy.call(this,e,function(r){t(r)})};function OFe(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new aVt;if(e._transformState.transforming)throw new iVt;return e.push(null)}});var jFe=v((UCr,RFe)=>{"use strict";RFe.exports=J2;var PFe=CW();tr()(J2,PFe);function J2(e){if(!(this instanceof J2))return new J2(e);PFe.call(this,e)}J2.prototype._transform=function(e,t,r){r(null,e)}});var UFe=v((GCr,NFe)=>{"use strict";var DW;function uVt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var qFe=fp().codes,cVt=qFe.ERR_MISSING_ARGS,lVt=qFe.ERR_STREAM_DESTROYED;function LFe(e){if(e)throw e}function fVt(e){return e.setHeader&&typeof e.abort=="function"}function hVt(e,t,r,n){n=uVt(n);var i=!1;e.on("close",function(){i=!0}),DW===void 0&&(DW=IF()),DW(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var a=!1;return function(o){if(!i&&!a){if(a=!0,fVt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new lVt("pipe"))}}}function MFe(e){e()}function pVt(e,t){return e.pipe(t)}function dVt(e){return!e.length||typeof e[e.length-1]!="function"?LFe:e.pop()}function mVt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=dVt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new cVt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return hVt(o,u,c,function(l){i||(i=l),l&&a.forEach(MFe),!u&&(a.forEach(MFe),n(i))})});return t.reduce(pVt)}NFe.exports=mVt});var Z2=v((Ps,Q2)=>{var X2=require("stream");process.env.READABLE_STREAM==="disable"&&X2?(Q2.exports=X2.Readable,Object.assign(Q2.exports,X2),Q2.exports.Stream=X2):(Ps=Q2.exports=pW(),Ps.Stream=X2||Ps,Ps.Readable=Ps,Ps.Writable=lW(),Ps.Duplex=w0(),Ps.Transform=CW(),Ps.PassThrough=jFe(),Ps.finished=IF(),Ps.pipeline=UFe())});var $Fe=v((zCr,KFe)=>{var zFe=require("util"),gVt=kL(),ew=rW(),HFe=Z2().Writable,WFe=Z2().PassThrough,VFe=function(){},GFe=function(e){return e&=511,e&&512-e},vVt=function(e,t){var r=new UF(e,t);return r.end(),r},bVt=function(e,t){return t.path&&(e.name=t.path),t.linkpath&&(e.linkname=t.linkpath),t.size&&(e.size=parseInt(t.size,10)),e.pax=t,e},UF=function(e,t){this._parent=e,this.offset=t,WFe.call(this,{autoDestroy:!1})};zFe.inherits(UF,WFe);UF.prototype.destroy=function(e){this._parent.destroy(e)};var Xl=function(e){if(!(this instanceof Xl))return new Xl(e);HFe.call(this,e),e=e||{},this._offset=0,this._buffer=gVt(),this._missing=0,this._partial=!1,this._onparse=VFe,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var t=this,r=t._buffer,n=function(){t._continue()},i=function(h){if(t._locked=!1,h)return t.destroy(h);t._stream||n()},a=function(){t._stream=null;var h=GFe(t._header.size);h?t._parse(h,o):t._parse(512,f),t._locked||n()},o=function(){t._buffer.consume(GFe(t._header.size)),t._parse(512,f),n()},s=function(){var h=t._header.size;t._paxGlobal=ew.decodePax(r.slice(0,h)),r.consume(h),a()},u=function(){var h=t._header.size;t._pax=ew.decodePax(r.slice(0,h)),t._paxGlobal&&(t._pax=Object.assign({},t._paxGlobal,t._pax)),r.consume(h),a()},c=function(){var h=t._header.size;this._gnuLongPath=ew.decodeLongPath(r.slice(0,h),e.filenameEncoding),r.consume(h),a()},l=function(){var h=t._header.size;this._gnuLongLinkPath=ew.decodeLongPath(r.slice(0,h),e.filenameEncoding),r.consume(h),a()},f=function(){var h=t._offset,p;try{p=t._header=ew.decode(r.slice(0,512),e.filenameEncoding,e.allowUnknownFormat)}catch(d){t.emit("error",d)}if(r.consume(512),!p){t._parse(512,f),n();return}if(p.type==="gnu-long-path"){t._parse(p.size,c),n();return}if(p.type==="gnu-long-link-path"){t._parse(p.size,l),n();return}if(p.type==="pax-global-header"){t._parse(p.size,s),n();return}if(p.type==="pax-header"){t._parse(p.size,u),n();return}if(t._gnuLongPath&&(p.name=t._gnuLongPath,t._gnuLongPath=null),t._gnuLongLinkPath&&(p.linkname=t._gnuLongLinkPath,t._gnuLongLinkPath=null),t._pax&&(t._header=p=bVt(p,t._pax),t._pax=null),t._locked=!0,!p.size||p.type==="directory"){t._parse(512,f),t.emit("entry",p,vVt(t,h),i);return}t._stream=new UF(t,h),t.emit("entry",p,t._stream,i),t._parse(p.size,a),n()};this._onheader=f,this._parse(512,f)};zFe.inherits(Xl,HFe);Xl.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))};Xl.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)};Xl.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=VFe,this._overflow?this._write(this._overflow,void 0,e):e()}};Xl.prototype._write=function(e,t,r){if(!this._destroyed){var n=this._stream,i=this._buffer,a=this._missing;if(e.length&&(this._partial=!0),e.length<a)return this._missing-=e.length,this._overflow=null,n?n.write(e,r):(i.append(e),r());this._cb=r,this._missing=0;var o=null;e.length>a&&(o=e.slice(a),e=e.slice(0,a)),n?n.end(e):i.append(e),this._overflow=o,this._onparse()}};Xl.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};KFe.exports=Xl});var JFe=v((HCr,YFe)=>{YFe.exports=require("fs").constants||require("constants")});var ZFe=v((WCr,QFe)=>{var yVt=R4(),xVt=function(){},_Vt=function(e){return e.setHeader&&typeof e.abort=="function"},wVt=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},XFe=function(e,t,r){if(typeof t=="function")return XFe(e,null,t);t||(t={}),r=yVt(r||xVt);var n=e._writableState,i=e._readableState,a=t.readable||t.readable!==!1&&e.readable,o=t.writable||t.writable!==!1&&e.writable,s=!1,u=function(){e.writable||c()},c=function(){o=!1,a||r.call(e)},l=function(){a=!1,o||r.call(e)},f=function(g){r.call(e,g?new Error("exited with error code: "+g):null)},h=function(g){r.call(e,g)},p=function(){process.nextTick(d)},d=function(){if(!s){if(a&&!(i&&i.ended&&!i.destroyed))return r.call(e,new Error("premature close"));if(o&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"))}},b=function(){e.req.on("finish",c)};return _Vt(e)?(e.on("complete",c),e.on("abort",p),e.req?b():e.on("request",b)):o&&!n&&(e.on("end",u),e.on("close",u)),wVt(e)&&e.on("exit",f),e.on("end",l),e.on("finish",c),t.error!==!1&&e.on("error",h),e.on("close",p),function(){s=!0,e.removeListener("complete",c),e.removeListener("abort",p),e.removeListener("request",b),e.req&&e.req.removeListener("finish",c),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("exit",f),e.removeListener("end",l),e.removeListener("error",h),e.removeListener("close",p)}};QFe.exports=XFe});var ike=v((VCr,nke)=>{var Vb=JFe(),eke=ZFe(),zF=tr(),EVt=Buffer.alloc,tke=Z2().Readable,Kb=Z2().Writable,AVt=require("string_decoder").StringDecoder,GF=rW(),SVt=parseInt("755",8),TVt=parseInt("644",8),rke=EVt(1024),kW=function(){},FW=function(e,t){t&=511,t&&e.push(rke.slice(0,512-t))};function CVt(e){switch(e&Vb.S_IFMT){case Vb.S_IFBLK:return"block-device";case Vb.S_IFCHR:return"character-device";case Vb.S_IFDIR:return"directory";case Vb.S_IFIFO:return"fifo";case Vb.S_IFLNK:return"symlink"}return"file"}var HF=function(e){Kb.call(this),this.written=0,this._to=e,this._destroyed=!1};zF(HF,Kb);HF.prototype._write=function(e,t,r){if(this.written+=e.length,this._to.push(e))return r();this._to._drain=r};HF.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var WF=function(){Kb.call(this),this.linkname="",this._decoder=new AVt("utf-8"),this._destroyed=!1};zF(WF,Kb);WF.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e),r()};WF.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var tw=function(){Kb.call(this),this._destroyed=!1};zF(tw,Kb);tw.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))};tw.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Lc=function(e){if(!(this instanceof Lc))return new Lc(e);tke.call(this,e),this._drain=kW,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};zF(Lc,tke);Lc.prototype.entry=function(e,t,r){if(this._stream)throw new Error("already piping an entry");if(!(this._finalized||this._destroyed)){typeof t=="function"&&(r=t,t=null),r||(r=kW);var n=this;if((!e.size||e.type==="symlink")&&(e.size=0),e.type||(e.type=CVt(e.mode)),e.mode||(e.mode=e.type==="directory"?SVt:TVt),e.uid||(e.uid=0),e.gid||(e.gid=0),e.mtime||(e.mtime=new Date),typeof t=="string"&&(t=Buffer.from(t)),Buffer.isBuffer(t)){e.size=t.length,this._encode(e);var i=this.push(t);return FW(n,e.size),i?process.nextTick(r):this._drain=r,new tw}if(e.type==="symlink"&&!e.linkname){var a=new WF;return eke(a,function(s){if(s)return n.destroy(),r(s);e.linkname=a.linkname,n._encode(e),r()}),a}if(this._encode(e),e.type!=="file"&&e.type!=="contiguous-file")return process.nextTick(r),new tw;var o=new HF(this);return this._stream=o,eke(o,function(s){if(n._stream=null,s)return n.destroy(),r(s);if(o.written!==e.size)return n.destroy(),r(new Error("size mismatch"));FW(n,e.size),n._finalizing&&n.finalize(),r()}),o}};Lc.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(rke),this.push(null))};Lc.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())};Lc.prototype._encode=function(e){if(!e.pax){var t=GF.encode(e);if(t){this.push(t);return}}this._encodePax(e)};Lc.prototype._encodePax=function(e){var t=GF.encodePax({name:e.name,linkname:e.linkname,pax:e.pax}),r={name:"PaxHeader",mode:e.mode,uid:e.uid,gid:e.gid,size:t.length,mtime:e.mtime,type:"pax-header",linkname:e.linkname&&"PaxHeader",uname:e.uname,gname:e.gname,devmajor:e.devmajor,devminor:e.devminor};this.push(GF.encode(r)),this.push(t),FW(this,t.length),r.size=e.size,r.type=e.type,this.push(GF.encode(r))};Lc.prototype._read=function(e){var t=this._drain;this._drain=kW,t()};nke.exports=Lc});var ake=v(BW=>{BW.extract=$Fe();BW.pack=ike()});var uke=v(($Cr,ske)=>{var DVt=require("zlib"),FVt=ake(),oke=Tb(),Ql=function(e){if(!(this instanceof Ql))return new Ql(e);e=this.options=oke.defaults(e,{gzip:!1}),typeof e.gzipOptions!="object"&&(e.gzipOptions={}),this.supports={directory:!0,symlink:!0},this.engine=FVt.pack(e),this.compressor=!1,e.gzip&&(this.compressor=DVt.createGzip(e.gzipOptions),this.compressor.on("error",this._onCompressorError.bind(this)))};Ql.prototype._onCompressorError=function(e){this.engine.emit("error",e)};Ql.prototype.append=function(e,t,r){var n=this;t.mtime=t.date;function i(o,s){if(o){r(o);return}n.engine.entry(t,s,function(u){r(u,t)})}if(t.sourceType==="buffer")i(null,e);else if(t.sourceType==="stream"&&t.stats){t.size=t.stats.size;var a=n.engine.entry(t,function(o){r(o,t)});e.pipe(a)}else t.sourceType==="stream"&&oke.collectStream(e,i)};Ql.prototype.finalize=function(){this.engine.finalize()};Ql.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};Ql.prototype.pipe=function(e,t){return this.compressor?this.engine.pipe.apply(this.engine,[this.compressor]).pipe(e,t):this.engine.pipe.apply(this.engine,arguments)};Ql.prototype.unpipe=function(){return this.compressor?this.compressor.unpipe.apply(this.compressor,arguments):this.engine.unpipe.apply(this.engine,arguments)};ske.exports=Ql});var hke=v((YCr,fke)=>{var kVt=require("util").inherits,cke=Oz().Transform,BVt=yH(),lke=Tb(),gp=function(e){if(!(this instanceof gp))return new gp(e);e=this.options=lke.defaults(e,{}),cke.call(this,e),this.supports={directory:!0,symlink:!0},this.files=[]};kVt(gp,cke);gp.prototype._transform=function(e,t,r){r(null,e)};gp.prototype._writeStringified=function(){var e=JSON.stringify(this.files);this.write(e)};gp.prototype.append=function(e,t,r){var n=this;t.crc32=0;function i(a,o){if(a){r(a);return}t.size=o.length||0,t.crc32=BVt.unsigned(o),n.files.push(t),r(null,t)}t.sourceType==="buffer"?i(null,e):t.sourceType==="stream"&&lke.collectStream(e,i)};gp.prototype.finalize=function(){this._writeStringified(),this.end()};fke.exports=gp});var dke=v((JCr,pke)=>{var OVt=s8e(),rw={},vp=function(e,t){return vp.create(e,t)};vp.create=function(e,t){if(rw[e]){var r=new OVt(e,t);return r.setFormat(e),r.setModule(new rw[e](t)),r}else throw new Error("create("+e+"): format not registered")};vp.registerFormat=function(e,t){if(rw[e])throw new Error("register("+e+"): format already registered");if(typeof t!="function")throw new Error("register("+e+"): format module invalid");if(typeof t.prototype.append!="function"||typeof t.prototype.finalize!="function")throw new Error("register("+e+"): format module missing methods");rw[e]=t};vp.isRegisteredFormat=function(e){return!!rw[e]};vp.registerFormat("zip",q4e());vp.registerFormat("tar",uke());vp.registerFormat("json",hke());pke.exports=vp});var _V=typeof process!="object"||String(process)!=="[object process]"||process.browser;var wV={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"]=wV||{};function er(e,t,r){return t<=e&&e<=r}function S5e(e,t){return e.indexOf(t)!==-1}var Kc=Math.floor;function Ow(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function T5e(e){for(var t=String(e),r=t.length,n=0,i=[];n<r;){var a=t.charCodeAt(n);if(a<55296||a>57343)i.push(a);else if(56320<=a&&a<=57343)i.push(65533);else if(55296<=a&&a<=56319)if(n===r-1)i.push(65533);else{var o=t.charCodeAt(n+1);if(56320<=o&&o<=57343){var s=a&1023,u=o&1023;i.push(65536+(s<<10)+u),n+=1}else i.push(65533)}n+=1}return i}function C5e(e){for(var t="",r=0;r<e.length;++r){var n=e[r];n<=65535?t+=String.fromCharCode(n):(n-=65536,t+=String.fromCharCode((n>>10)+55296,(n&1023)+56320))}return t}function Ho(e){return 0<=e&&e<=127}var zo=Ho,Fr=-1;function wk(e){this.tokens=[].slice.call(e),this.tokens.reverse()}wk.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Fr},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.pop());else this.tokens.push(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.shift());else this.tokens.unshift(e)}};var xn=-1;function Dr(e,t){if(e)throw TypeError("Decoder error");return t||65533}function Ms(e){throw TypeError("The code point "+e+" could not be encoded.")}function D5e(){}D5e.prototype={handler:function(e,t){}};function F5e(){}F5e.prototype={handler:function(e,t){}};function xk(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(_k,e)?_k[e]:null}var EV=[{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"}],_k={};EV.forEach(function(e){e.encodings.forEach(function(t){t.labels.forEach(function(r){_k[r]=t})})});var to={},ro={};function L0(e,t){return t&&t[e]||null}function M0(e,t){var r=t.indexOf(e);return r===-1?null:r}function Ga(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 k5e(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var t=0,r=0,n=Ga("gb18030-ranges"),i;for(i=0;i<n.length;++i){var a=n[i];if(a[0]<=e)t=a[0],r=a[1];else break}return r+e-t}function B5e(e){if(e===59335)return 7457;var t=0,r=0,n=Ga("gb18030-ranges"),i;for(i=0;i<n.length;++i){var a=n[i];if(a[1]<=e)t=a[1],r=a[0];else break}return r+e-t}function O5e(e){bk=bk||Ga("jis0208").map(function(r,n){return er(n,8272,8835)?null:r});var t=bk;return t.indexOf(e)}var bk;function I5e(e){yk=yk||Ga("big5").map(function(r,n){return n<(161-129)*157?null:r});var t=yk;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?t.lastIndexOf(e):M0(e,t)}var yk,AV="utf-8";function _p(e,t){if(!(this instanceof _p))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):AV,t=Ow(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=xk(e);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!ro[r.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var n=this;return n._encoding=r,Boolean(t.fatal)&&(n._error_mode="fatal"),Boolean(t.ignoreBOM)&&(n._ignoreBOM=!0),Object.defineProperty||(this.encoding=n._encoding.name.toLowerCase(),this.fatal=n._error_mode==="fatal",this.ignoreBOM=n._ignoreBOM),n}Object.defineProperty&&(Object.defineProperty(_p.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(_p.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(_p.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));_p.prototype.decode=function(t,r){var n;typeof t=="object"&&t instanceof ArrayBuffer?n=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):n=new Uint8Array(0),r=Ow(r),this._do_not_flush||(this._decoder=ro[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(r.stream);for(var i=new wk(n),a=[],o;;){var s=i.read();if(s===Fr||(o=this._decoder.handler(i,s),o===xn))break;o!==null&&(Array.isArray(o)?a.push.apply(a,o):a.push(o))}if(!this._do_not_flush){do{if(o=this._decoder.handler(i,i.read()),o===xn)break;o!==null&&(Array.isArray(o)?a.push.apply(a,o):a.push(o))}while(!i.endOfStream());this._decoder=null}function u(c){return S5e(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(c.length>0&&c[0]===65279?(this._BOMseen=!0,c.shift()):c.length>0&&(this._BOMseen=!0)),C5e(c)}return u.call(this,a)};function vy(e,t){if(!(this instanceof vy))throw TypeError("Called as a function. Did you forget 'new'?");t=Ow(t),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(t.fatal)?"fatal":"replacement";var r=this;if(Boolean(t.NONSTANDARD_allowLegacyEncoding)){e=e!==void 0?String(e):AV;var n=xk(e);if(n===null||n.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!to[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=n}else r._encoding=xk("utf-8"),e!==void 0&&"console"in globalThis&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=r._encoding.name.toLowerCase()),r}Object.defineProperty&&Object.defineProperty(vy.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});vy.prototype.encode=function(t,r){t=t===void 0?"":String(t),r=Ow(r),this._do_not_flush||(this._encoder=to[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(r.stream);for(var n=new wk(T5e(t)),i=[],a;;){var o=n.read();if(o===Fr||(a=this._encoder.handler(n,o),a===xn))break;Array.isArray(a)?i.push.apply(i,a):i.push(a)}if(!this._do_not_flush){for(;a=this._encoder.handler(n,n.read()),a!==xn;)Array.isArray(a)?i.push.apply(i,a):i.push(a);this._encoder=null}return new Uint8Array(i)};function P5e(e){var t=e.fatal,r=0,n=0,i=0,a=128,o=191;this.handler=function(s,u){if(u===Fr&&i!==0)return i=0,Dr(t);if(u===Fr)return xn;if(i===0){if(er(u,0,127))return u;if(er(u,194,223))i=1,r=u&31;else if(er(u,224,239))u===224&&(a=160),u===237&&(o=159),i=2,r=u&15;else if(er(u,240,244))u===240&&(a=144),u===244&&(o=143),i=3,r=u&7;else return Dr(t);return null}if(!er(u,a,o))return r=i=n=0,a=128,o=191,s.prepend(u),Dr(t);if(a=128,o=191,r=r<<6|u&63,n+=1,n!==i)return null;var c=r;return r=i=n=0,c}}function R5e(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(zo(n))return n;var i,a;er(n,128,2047)?(i=1,a=192):er(n,2048,65535)?(i=2,a=224):er(n,65536,1114111)&&(i=3,a=240);for(var o=[(n>>6*i)+a];i>0;){var s=n>>6*(i-1);o.push(128|s&63),i-=1}return o}}to["UTF-8"]=function(e){return new R5e(e)};ro["UTF-8"]=function(e){return new P5e(e)};function j5e(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Ho(i))return i;var a=e[i-128];return a===null?Dr(r):a}}function L5e(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(zo(i))return i;var a=M0(i,e);return a===null&&Ms(i),a+128}}(function(){"encoding-indexes"in globalThis&&EV.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(t){var r=t.name,n=Ga(r.toLowerCase());ro[r]=function(i){return new j5e(n,i)},to[r]=function(i){return new L5e(n,i)}})})})();ro.GBK=function(e){return new SV(e)};to.GBK=function(e){return new TV(e,!0)};function SV(e){var t=e.fatal,r=0,n=0,i=0;this.handler=function(a,o){if(o===Fr&&r===0&&n===0&&i===0)return xn;o===Fr&&(r!==0||n!==0||i!==0)&&(r=0,n=0,i=0,Dr(t));var s;if(i!==0){s=null,er(o,48,57)&&(s=k5e((((r-129)*10+n-48)*126+i-129)*10+o-48));var u=[n,i,o];return r=0,n=0,i=0,s===null?(a.prepend(u),Dr(t)):s}if(n!==0)return er(o,129,254)?(i=o,null):(a.prepend([n,o]),r=0,n=0,Dr(t));if(r!==0){if(er(o,48,57))return n=o,null;var c=r,l=null;r=0;var f=o<127?64:65;return(er(o,64,126)||er(o,128,254))&&(l=(c-129)*190+(o-f)),s=l===null?null:L0(l,Ga("gb18030")),s===null&&Ho(o)&&a.prepend(o),s===null?Dr(t):s}return Ho(o)?o:o===128?8364:er(o,129,254)?(r=o,null):Dr(t)}}function TV(e,t){var r=e.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(zo(i))return i;if(i===58853)return Ms(i);if(t&&i===8364)return 128;var a=M0(i,Ga("gb18030"));if(a!==null){var o=Kc(a/190)+129,s=a%190,u=s<63?64:65;return[o,s+u]}if(t)return Ms(i);a=B5e(i);var c=Kc(a/10/126/10);a=a-c*10*126*10;var l=Kc(a/10/126);a=a-l*10*126;var f=Kc(a/10),h=a-f*10;return[c+129,l+48,f+129,h+48]}}to.gb18030=function(e){return new TV(e)};ro.gb18030=function(e){return new SV(e)};function M5e(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Fr&&r!==0)return r=0,Dr(t);if(i===Fr&&r===0)return xn;if(r!==0){var a=r,o=null;r=0;var s=i<127?64:98;switch((er(i,64,126)||er(i,161,254))&&(o=(a-129)*157+(i-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:L0(o,Ga("big5"));return u===null&&Ho(i)&&n.prepend(i),u===null?Dr(t):u}return Ho(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function q5e(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(zo(n))return n;var i=I5e(n);if(i===null)return Ms(n);var a=Kc(i/157)+129;if(a<161)return Ms(n);var o=i%157,s=o<63?64:98;return[a,o+s]}}to.Big5=function(e){return new q5e(e)};ro.Big5=function(e){return new M5e(e)};function N5e(e){var t=e.fatal,r=!1,n=0;this.handler=function(i,a){if(a===Fr&&n!==0)return n=0,Dr(t);if(a===Fr&&n===0)return xn;if(n===142&&er(a,161,223))return n=0,65377-161+a;if(n===143&&er(a,161,254))return r=!0,n=a,null;if(n!==0){var o=n;n=0;var s=null;return er(o,161,254)&&er(a,161,254)&&(s=L0((o-161)*94+(a-161),Ga(r?"jis0212":"jis0208"))),r=!1,er(a,161,254)||i.prepend(a),s===null?Dr(t):s}return Ho(a)?a:a===142||a===143||er(a,161,254)?(n=a,null):Dr(t)}}function U5e(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(zo(n))return n;if(n===165)return 92;if(n===8254)return 126;if(er(n,65377,65439))return[142,n-65377+161];n===8722&&(n=65293);var i=M0(n,Ga("jis0208"));if(i===null)return Ms(n);var a=Kc(i/94)+161,o=i%94+161;return[a,o]}}to["EUC-JP"]=function(e){return new U5e(e)};ro["EUC-JP"]=function(e){return new N5e(e)};function G5e(e){var t=e.fatal,r={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},n=r.ASCII,i=r.ASCII,a=0,o=!1;this.handler=function(s,u){switch(n){default:case r.ASCII:return u===27?(n=r.EscapeStart,null):er(u,0,127)&&u!==14&&u!==15&&u!==27?(o=!1,u):u===Fr?xn:(o=!1,Dr(t));case r.Roman:return u===27?(n=r.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===Fr?xn:(o=!1,Dr(t));case r.Katakana:return u===27?(n=r.EscapeStart,null):er(u,33,95)?(o=!1,65377-33+u):u===Fr?xn:(o=!1,Dr(t));case r.LeadByte:return u===27?(n=r.EscapeStart,null):er(u,33,126)?(o=!1,a=u,n=r.TrailByte,null):u===Fr?xn:(o=!1,Dr(t));case r.TrailByte:if(u===27)return n=r.EscapeStart,Dr(t);if(er(u,33,126)){n=r.LeadByte;var c=(a-33)*94+u-33,l=L0(c,Ga("jis0208"));return l===null?Dr(t):l}return u===Fr?(n=r.LeadByte,s.prepend(u),Dr(t)):(n=r.LeadByte,Dr(t));case r.EscapeStart:return u===36||u===40?(a=u,n=r.Escape,null):(s.prepend(u),o=!1,n=i,Dr(t));case r.Escape:var f=a;a=0;var h=null;if(f===40&&u===66&&(h=r.ASCII),f===40&&u===74&&(h=r.Roman),f===40&&u===73&&(h=r.Katakana),f===36&&(u===64||u===66)&&(h=r.LeadByte),h!==null){n=n=h;var p=o;return o=!0,p?Dr(t):null}return s.prepend([f,u]),o=!1,n=i,Dr(t)}}}function z5e(e){var t=e.fatal,r={ASCII:0,Roman:1,jis0208:2},n=r.ASCII;this.handler=function(i,a){if(a===Fr&&n!==r.ASCII)return i.prepend(a),n=r.ASCII,[27,40,66];if(a===Fr&&n===r.ASCII)return xn;if((n===r.ASCII||n===r.Roman)&&(a===14||a===15||a===27))return Ms(65533);if(n===r.ASCII&&zo(a))return a;if(n===r.Roman&&(zo(a)&&a!==92&&a!==126||a==165||a==8254)){if(zo(a))return a;if(a===165)return 92;if(a===8254)return 126}if(zo(a)&&n!==r.ASCII)return i.prepend(a),n=r.ASCII,[27,40,66];if((a===165||a===8254)&&n!==r.Roman)return i.prepend(a),n=r.Roman,[27,40,74];a===8722&&(a=65293);var o=M0(a,Ga("jis0208"));if(o===null)return Ms(a);if(n!==r.jis0208)return i.prepend(a),n=r.jis0208,[27,36,66];var s=Kc(o/94)+33,u=o%94+33;return[s,u]}}to["ISO-2022-JP"]=function(e){return new z5e(e)};ro["ISO-2022-JP"]=function(e){return new G5e(e)};function H5e(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Fr&&r!==0)return r=0,Dr(t);if(i===Fr&&r===0)return xn;if(r!==0){var a=r,o=null;r=0;var s=i<127?64:65,u=a<160?129:193;if((er(i,64,126)||er(i,128,252))&&(o=(a-u)*188+i-s),er(o,8836,10715))return 57344-8836+o;var c=o===null?null:L0(o,Ga("jis0208"));return c===null&&Ho(i)&&n.prepend(i),c===null?Dr(t):c}return Ho(i)||i===128?i:er(i,161,223)?65377-161+i:er(i,129,159)||er(i,224,252)?(r=i,null):Dr(t)}}function W5e(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(zo(n)||n===128)return n;if(n===165)return 92;if(n===8254)return 126;if(er(n,65377,65439))return n-65377+161;n===8722&&(n=65293);var i=O5e(n);if(i===null)return Ms(n);var a=Kc(i/188),o=a<31?129:193,s=i%188,u=s<63?64:65;return[a+o,s+u]}}to.Shift_JIS=function(e){return new W5e(e)};ro.Shift_JIS=function(e){return new H5e(e)};function V5e(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Fr&&r!==0)return r=0,Dr(t);if(i===Fr&&r===0)return xn;if(r!==0){var a=r,o=null;r=0,er(i,65,254)&&(o=(a-129)*190+(i-65));var s=o===null?null:L0(o,Ga("euc-kr"));return o===null&&Ho(i)&&n.prepend(i),s===null?Dr(t):s}return Ho(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function K5e(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(zo(n))return n;var i=M0(n,Ga("euc-kr"));if(i===null)return Ms(n);var a=Kc(i/190)+129,o=i%190+65;return[a,o]}}to["EUC-KR"]=function(e){return new K5e(e)};ro["EUC-KR"]=function(e){return new V5e(e)};function Bw(e,t){var r=e>>8,n=e&255;return t?[r,n]:[n,r]}function CV(e,t){var r=t.fatal,n=null,i=null;this.handler=function(a,o){if(o===Fr&&(n!==null||i!==null))return Dr(r);if(o===Fr&&n===null&&i===null)return xn;if(n===null)return n=o,null;var s;if(e?s=(n<<8)+o:s=(o<<8)+n,n=null,i!==null){var u=i;return i=null,er(s,56320,57343)?65536+(u-55296)*1024+(s-56320):(a.prepend(Bw(s,e)),Dr(r))}return er(s,55296,56319)?(i=s,null):er(s,56320,57343)?Dr(r):s}}function DV(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(er(i,0,65535))return Bw(i,e);var a=Bw((i-65536>>10)+55296,e),o=Bw((i-65536&1023)+56320,e);return a.concat(o)}}to["UTF-16BE"]=function(e){return new DV(!0,e)};ro["UTF-16BE"]=function(e){return new CV(!0,e)};to["UTF-16LE"]=function(e){return new DV(!1,e)};ro["UTF-16LE"]=function(e){return new CV(!1,e)};function $5e(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?xn:Ho(n)?n:63360+n-128}}function Y5e(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?xn:zo(n)?n:er(n,63360,63487)?n-63360+128:Ms(n)}}to["x-user-defined"]=function(e){return new Y5e(e)};ro["x-user-defined"]=function(e){return new $5e(e)};function by(e){return Buffer.from(e).toString("base64")}function Ek(e){return Buffer.from(e,"base64").toString("ascii")}var wY=$t(xY(),1),EY=$t(Ty(),1);function _Y(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function cRe(e,t){let r=t.type?t.type.replace("image/",""):"jpeg",n=(0,EY.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,wY.default)(n,r,t)}function AY(e,t){let r=cRe(e,t);return new Promise(n=>{let i=[];r.on("data",a=>i.push(a)),r.on("end",()=>{let a=Buffer.concat(i);n(_Y(a))})})}var nae=$t(rae(),1),TI=["image/png","image/jpeg","image/gif"];async function CI(e,t){if(!t)throw new Error("MIMEType is required to parse image under Node.js");let r=e instanceof Buffer?e:Buffer.from(e);return await _We(r,t)}function _We(e,t){return new Promise(r=>(0,nae.default)(e,t,(n,i)=>{if(n)throw n;let a=[...i.shape],o=i.shape.length===4?i.shape.shift():1,s=i.data instanceof Buffer?new Uint8Array(i.data):i.data;r({shape:a,data:s,width:i.shape[0],height:i.shape[1],components:i.shape[2],layers:o?[o]:[]})}))}async function So(e,t,r,n){return n._parse(e,t,r,n)}function Qt(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var Ju={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},aae=Ju.self||Ju.window||Ju.global||{},oae=Ju.window||Ju.self||Ju.global||{},sae=Ju.global||Ju.self||Ju.window||{},uae=Ju.document||{};var gn=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var iae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),wWe=iae&&parseFloat(iae[1])||0;function DI(e,t){return cae(e||{},t)}function cae(e,t){let r={...e};for(let[n,i]of Object.entries(t))i&&typeof i=="object"&&!Array.isArray(i)?r[n]=cae(r[n]||{},t[n]):r[n]=t[n];return r}var lae="beta";function EWe(){var e;return(e=globalThis._loadersgl_)!=null&&e.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.0.0"),globalThis._loadersgl_.version}var Np=EWe();function pa(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Xu={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Ctr=Xu.self||Xu.window||Xu.global||{},Dtr=Xu.window||Xu.self||Xu.global||{},Ftr=Xu.global||Xu.self||Xu.window||{},ktr=Xu.document||{};var $a=typeof process!="object"||String(process)!=="[object process]"||process.browser,wx=typeof importScripts=="function",hae=typeof window<"u"&&typeof window.orientation<"u",fae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Btr=fae&&parseFloat(fae[1])||0;var Ex=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(t,r){this.name=t,this.workerThread=r,this.result=new Promise((n,i)=>{this._resolve=n,this._reject=i})}postMessage(t,r){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:r})}done(t){pa(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){pa(this.isRunning),this.isRunning=!1,this._reject(t)}};var Dm={};ca(Dm,{NodeWorker:()=>Ax});var pae=$t(require("worker_threads"),1);kw(Dm,require("worker_threads"));var Ax=pae.Worker;var FI=new Map;function dae(e){pa(e.source&&!e.url||!e.source&&e.url);let t=FI.get(e.source||e.url);return t||(e.url&&(t=AWe(e.url),FI.set(e.url,t)),e.source&&(t=mae(e.source),FI.set(e.source,t))),pa(t),t}function AWe(e){if(!e.startsWith("http"))return e;let t=SWe(e);return mae(t)}function mae(e){let t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function SWe(e){return`try {
|
|
174
174
|
importScripts('${e}');
|
|
175
175
|
} catch (error) {
|
|
176
176
|
console.error(error);
|
|
177
177
|
throw error;
|
|
178
178
|
}`}function kI(e,t=!0,r){let n=r||new Set;if(e){if(gae(e))n.add(e);else if(gae(e.buffer))n.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(t&&typeof e=="object")for(let i in e)kI(e[i],t,n)}}return r===void 0?Array.from(n):[]}function gae(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}function BI(e){if(e===null)return{};let t=Object.assign({},e);return Object.keys(t).forEach(r=>{typeof e[r]=="object"&&!ArrayBuffer.isView(e[r])&&!(e[r]instanceof Array)?t[r]=BI(e[r]):typeof t[r]=="function"||t[r]instanceof RegExp?t[r]={}:t[r]=e[r]}),t}var OI=()=>{},Rf=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&$a||typeof Ax<"u"&&!$a}constructor(t){let{name:r,source:n,url:i}=t;pa(n||i),this.name=r,this.source=n,this.url=i,this.onMessage=OI,this.onError=a=>console.log(a),this.worker=$a?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=OI,this.onError=OI,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,r){r=r||kI(t),this.worker.postMessage(t,r)}_getErrorFromErrorEvent(t){let r="Failed to load ";return r+=`worker ${this.name} from ${this.url}. `,t.message&&(r+=`${t.message} in `),t.lineno&&(r+=`:${t.lineno}:${t.colno}`),new Error(r)}_createBrowserWorker(){this._loadableURL=dae({source:this.source,url:this.url});let t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=r=>{r.data?this.onMessage(r.data):this.onError(new Error("No data received"))},t.onerror=r=>{this.onError(this._getErrorFromErrorEvent(r)),this.terminated=!0},t.onmessageerror=r=>console.error(r),t}_createNodeWorker(){let t;if(this.url){let n=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;t=new Ax(n,{eval:!1})}else if(this.source)t=new Ax(this.source,{eval:!0});else throw new Error("no worker");return t.on("message",r=>{this.onMessage(r)}),t.on("error",r=>{this.onError(r)}),t.on("exit",r=>{}),t}};var Sx=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return Rf.isSupported()}constructor(t){this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach(t=>t.destroy()),this.isDestroyed=!0}setProps(t){this.props={...this.props,...t},t.name!==void 0&&(this.name=t.name),t.maxConcurrency!==void 0&&(this.maxConcurrency=t.maxConcurrency),t.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=t.maxMobileConcurrency),t.reuseWorkers!==void 0&&(this.reuseWorkers=t.reuseWorkers),t.onDebug!==void 0&&(this.onDebug=t.onDebug)}async startJob(t,r=(i,a,o)=>i.done(o),n=(i,a)=>i.error(a)){let i=new Promise(a=>(this.jobQueue.push({name:t,onMessage:r,onError:n,onStart:a}),this));return this._startQueuedJob(),await i}async _startQueuedJob(){if(!this.jobQueue.length)return;let t=this._getAvailableWorker();if(!t)return;let r=this.jobQueue.shift();if(r){this.onDebug({message:"Starting job",name:r.name,workerThread:t,backlog:this.jobQueue.length});let n=new Ex(r.name,t);t.onMessage=i=>r.onMessage(n,i.type,i.payload),t.onError=i=>r.onError(n,i),r.onStart(n);try{await n.result}catch(i){console.error(`Worker exception: ${i}`)}finally{this.returnWorkerToQueue(t)}}}returnWorkerToQueue(t){!$a||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let t=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new Rf({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return hae?this.maxMobileConcurrency:this.maxConcurrency}};var TWe={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},Up=class{props;workerPools=new Map;static isSupported(){return Rf.isSupported()}static getWorkerFarm(t={}){return Up._workerFarm=Up._workerFarm||new Up({}),Up._workerFarm.setProps(t),Up._workerFarm}constructor(t){this.props={...TWe},this.setProps(t),this.workerPools=new Map}destroy(){for(let t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props={...this.props,...t};for(let r of this.workerPools.values())r.setProps(this._getWorkerPoolProps())}getWorkerPool(t){let{name:r,source:n,url:i}=t,a=this.workerPools.get(r);return a||(a=new Sx({name:r,source:n,url:i}),a.setProps(this._getWorkerPoolProps()),this.workerPools.set(r,a)),a}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},Ra=Up;xV(Ra,"_workerFarm");function vae(e){let t=e.version!==Np?` (worker-utils@${Np})`:"";return`${e.name}@${e.version}${t}`}function Tx(e,t={}){let r=t[e.id]||{},n=$a?`${e.id}-worker.js`:`${e.id}-worker-node.js`,i=r.workerUrl;if(!i&&e.id==="compression"&&(i=t.workerUrl),t._workerType==="test"&&(i=`modules/${e.module}/dist/${n}`),!i){let a=e.version;a==="latest"&&(a=lae);let o=a?`@${a}`:"";i=`https://unpkg.com/@loaders.gl/${e.module}${o}/dist/${n}`}return pa(i),i}async function II(e,t,r={},n={}){let i=vae(e),a=Ra.getWorkerFarm(r),{source:o}=r,s={name:i,source:o};o||(s.url=Tx(e,r));let u=a.getWorkerPool(s),c=r.jobName||e.name,l=await u.startJob(c,CWe.bind(null,n)),f=BI(r);return l.postMessage("process",{input:t,options:f}),(await l.result).result}async function CWe(e,t,r,n){switch(r){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":let{id:i,input:a,options:o}=n;try{if(!e.process){t.postMessage("error",{id:i,error:"Worker not set up to process on main thread"});return}let s=await e.process(a,o);t.postMessage("done",{id:i,result:s})}catch(s){let u=s instanceof Error?s.message:"unknown error";t.postMessage("error",{id:i,error:u})}break;default:console.warn(`process-on-worker: unknown message ${r}`)}}function PI(e,t=Np){pa(e,"no worker provided");let r=e.version;return!(!t||!r)}var jI={};ca(jI,{readFileAsArrayBuffer:()=>DA,readFileAsText:()=>FA,requireFromFile:()=>kA,requireFromString:()=>Fm});var RI=$t(require("module"),1),bae=$t(require("path"),1),CA=$t(require("fs"),1);async function DA(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():CA.readFileSync(e).buffer}async function FA(e){return e.startsWith("http")?await(await fetch(e)).text():CA.readFileSync(e,"utf8")}async function kA(e){if(e.startsWith("http")){let n=await(await fetch(e)).text();return Fm(n)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let t=await CA.readFileSync(e,"utf8");return Fm(t)}function Fm(e,t="",r){if(typeof t=="object"&&(r=t,t=""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let n=RI.default._nodeModulePaths(bae.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),a=new RI.default(t,i);return a.filename=t,a.paths=[].concat((r==null?void 0:r.prependPaths)||[]).concat(n).concat((r==null?void 0:r.appendPaths)||[]),a._compile(e,t),i&&i.children&&i.children.splice(i.children.indexOf(a),1),a.exports}var LI={};async function Qu(e,t=null,r={},n=null){return t&&(e=yae(e,t,r,n)),LI[e]=LI[e]||DWe(e),await LI[e]}function yae(e,t,r={},n=null){if(!r.useLocalLibraries&&e.startsWith("http"))return e;n=n||e;let i=r.modules||{};return i[n]?i[n]:$a?r.CDN?(pa(r.CDN.startsWith("http")),`${r.CDN}/${t}@${Np}/dist/libs/${n}`):wx?`../src/libs/${n}`:`modules/${t}/src/libs/${n}`:`modules/${t}/dist/libs/${n}`}async function DWe(e){if(e.endsWith("wasm"))return await kWe(e);if(!$a)try{return jI&&kA&&await kA(e)}catch(r){return console.error(r),null}if(wx)return importScripts(e);let t=await BWe(e);return FWe(t,e)}function FWe(e,t){if(!$a)return Fm&&Fm(e,t);if(wx)return eval.call(globalThis,e),null;let r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch{r.text=e}return document.body.appendChild(r),null}async function kWe(e){return!DA||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await DA(e)}async function BWe(e){return!FA||e.startsWith("http")?await(await fetch(e)).text():await FA(e)}var Eae=$t(require("child_process"),1);var xae=$t(require("child_process"),1);function _ae(e=3e3){return new Promise(t=>{xae.default.exec("lsof -i -P -n | grep LISTEN",(r,n)=>{if(r){t(e);return}let i=[],a=/:(\d+) \(LISTEN\)/;n.split(`
|
|
179
|
-
`).forEach(s=>{let u=a.exec(s);u&&i.push(Number(u[1]))});let o=e;for(;i.includes(o);)o++;t(o)})})}var wae={command:"",arguments:[],port:5e3,autoPort:!0,wait:2e3,onSuccess:e=>{console.log(`Started ${e.props.command}`)}},ll=class{id;props={...wae};childProcess=null;port=0;successTimer;constructor({id:t="browser-driver"}={}){this.id=t}async start(t){t={...wae,...t},this.props=t;let r=[...t.arguments];return this.port=Number(t.port),t.portArg&&(t.autoPort&&(this.port=await _ae(t.port)),r.push(t.portArg,String(this.port))),await new Promise((n,i)=>{try{this._setTimeout(()=>{t.onSuccess&&t.onSuccess(this),n({})}),console.log(`Spawning ${t.command} ${t.arguments.join(" ")}`);let a=Eae.spawn(t.command,r,t.spawn);this.childProcess=a,a.stdout.on("data",o=>{console.log(o.toString())}),a.stderr.on("data",o=>{console.log(`Child process wrote to stderr: "${o}".`),t.ignoreStderr||(this._clearTimeout(),i(new Error(o)))}),a.on("error",o=>{console.log(`Child process errored with ${o}`),this._clearTimeout(),i(o)}),a.on("close",o=>{console.log(`Child process exited with ${o}`),this.childProcess=null,this._clearTimeout(),n({})})}catch(a){i(a)}})}async stop(){this.childProcess&&(this.childProcess.kill(),this.childProcess=null)}async exit(t=0){try{await this.stop(),process.exit(t)}catch(r){console.error(r.message||r),process.exit(1)}}_setTimeout(t){Number(this.props.wait)>0&&(this.successTimer=setTimeout(t,this.props.wait))}_clearTimeout(){this.successTimer&&clearTimeout(this.successTimer)}};function MI(e,t){return!Ra.isSupported()||!$a&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}async function qI(e,t,r,n,i){let a=e.id,o=Tx(e,r),u=Ra.getWorkerFarm(r).getWorkerPool({name:a,url:o});r=JSON.parse(JSON.stringify(r)),n=JSON.parse(JSON.stringify(n||{}));let c=await u.startJob("process-on-worker",OWe.bind(null,i));return c.postMessage("process",{input:t,options:r,context:n}),await(await c.result).result}async function OWe(e,t,r,n){switch(r){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":let{id:i,input:a,options:o}=n;try{let s=await e(a,o);t.postMessage("done",{id:i,result:s})}catch(s){let u=s instanceof Error?s.message:"unknown error";t.postMessage("error",{id:i,error:u})}break;default:console.warn(`parse-with-worker unknown message ${r}`)}}function NI(e,t){return!Ra.isSupported()||!gn&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}function Sae(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?Aae(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?Aae(e,0,t):""}function Aae(e,t,r){if(e.byteLength<=t+r)return"";let n=new DataView(e),i="";for(let a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function UI(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${Sae(e)}"`)}}function Zu(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let n=new Uint8Array(e),i=new Uint8Array(t);for(let a=0;a<n.length;++a)if(n[a]!==i[a])return!1;return!0}function ec(...e){let t=e.map(a=>a instanceof ArrayBuffer?new Uint8Array(a):a),r=t.reduce((a,o)=>a+o.byteLength,0),n=new Uint8Array(r),i=0;for(let a of t)n.set(a,i),i+=a.byteLength;return n.buffer}function To(...e){let t=e,r=t&&t.length>1&&t[0].constructor||null;if(!r)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');let n=t.reduce((o,s)=>o+s.length,0),i=new r(n),a=0;for(let o of t)i.set(o,a),a+=o.length;return i}function Gp(e,t,r){let n=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function Co(e,t){return Qt(e>=0),Qt(t>0),e+(t-1)&~(t-1)}function GI(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let i=e.byteOffset,a=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,i,a)}return t.set(n,r),r+Co(n.byteLength,4)}function zI(e,t){let r=e.length,i=Math.ceil(r/t)*t-r,a="";for(let o=0;o<i;++o)a+=" ";return e+a}function km(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r.charCodeAt(i));return t+n}function Cx(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r[i]);return t+n}function BA(e,t,r,n){let i=Co(r.byteLength,n),a=i-r.byteLength;if(e){let o=new Uint8Array(e.buffer,e.byteOffset+t,r.byteLength),s=new Uint8Array(r);o.set(s);for(let u=0;u<a;++u)e.setUint8(t+r.byteLength+u,32)}return t+=i,t}function Bm(e,t,r,n){let a=new TextEncoder().encode(r);return t=BA(e,t,a,n),t}async function zp(e){let t=[];for await(let r of e)t.push(r);return ec(...t)}function jf(e){return jf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jf(e)}function HI(e,t){if(jf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(jf(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function WI(e){var t=HI(e,"string");return jf(t)==="symbol"?t:String(t)}function zt(e,t,r){return t=WI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var IWe="",Tae={};function tc(e){for(let t in Tae)if(e.startsWith(t)){let r=Tae[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${IWe}${e}`),e}var PWe="4.0.0-beta.8",VI={name:"JSON",id:"json",module:"json",version:PWe,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:Cae,parse:async e=>Cae(new TextDecoder().decode(e)),options:{}};function Cae(e){return JSON.parse(e)}function Dae(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function Fae(e){return e&&typeof e=="object"&&e.isBuffer}function fl(e){if(Fae(e))return Dae(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 t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function Om(e){return t=>new Promise((r,n)=>e(t,(i,a)=>i?n(i):r(a)))}var eu={};ca(eu,{dirname:()=>LWe,filename:()=>jWe,join:()=>MWe,resolve:()=>qWe});function kae(){var t;if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=(t=window.location)==null?void 0:t.pathname;return(e==null?void 0:e.slice(0,e.lastIndexOf("/")+1))||""}function jWe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function LWe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function MWe(...e){let t="/";return e=e.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${t}`),"")),n!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function qWe(...e){let t=[];for(let a=0;a<e.length;a++)t[a]=e[a];let r="",n=!1,i;for(let a=t.length-1;a>=-1&&!n;a--){let o;a>=0?o=t[a]:(i===void 0&&(i=kae()),o=i),o.length!==0&&(r=`${o}/${r}`,n=o.charCodeAt(0)===Dx)}return r=NWe(r,!n),n?`/${r}`:r.length>0?r:"."}var Dx=47,KI=46;function NWe(e,t){let r="",n=-1,i=0,a,o=!1;for(let s=0;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else{if(a===Dx)break;a=Dx}if(a===Dx){if(!(n===s-1||i===1))if(n!==s-1&&i===2){if(r.length<2||!o||r.charCodeAt(r.length-1)!==KI||r.charCodeAt(r.length-2)!==KI){if(r.length>2){let u=r.length-1,c=u;for(;c>=0&&r.charCodeAt(c)!==Dx;--c);if(c!==u){r=c===-1?"":r.slice(0,c),n=s,i=0,o=!1;continue}}else if(r.length===2||r.length===1){r="",n=s,i=0,o=!1;continue}}t&&(r.length>0?r+="/..":r="..",o=!0)}else{let u=e.slice(n+1,s);r.length>0?r+=`/${u}`:r=u,o=!1}n=s,i=0}else a===KI&&i!==-1?++i:i=-1}return r}var $I=new Error("Not implemented"),Hp=class{handle;size=0;bigsize=0n;url="";constructor(t,r,n){var i;if((i=globalThis.loaders)!=null&&i.NodeFile)return new globalThis.loaders.NodeFile(t,r,n);throw gn?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(t,r){throw $I}async write(t,r,n){throw $I}async stat(){throw $I}async close(){}};var YI=e=>(e==null?void 0:e.getUint8)&&(e==null?void 0:e.slice)&&(e==null?void 0:e.length);var Fx=class{file;size;constructor(t){this.file=new Hp(t,"r"),this.size=this.file.bigsize}async destroy(){await this.file.close()}async getUint8(t){let r=await this.file.read(t,1),n=new Uint8Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint16(t){let r=await this.file.read(t,2),n=new Uint16Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint32(t){let r=await this.file.read(t,4),n=new Uint32Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getBigUint64(t){let r=await this.file.read(t,8),n=new BigInt64Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async slice(t,r){let n=r-t;if(n>Number.MAX_SAFE_INTEGER)throw new Error("too big slice");let i=Number(n);return await this.file.read(t,i)}get length(){return this.size}};var Wp=$t(require("fs"),1),Vp=class{handle;size;bigsize;url;constructor(t,r,n){t=tc(t),this.handle=Wp.default.openSync(t,r,n);let i=Wp.default.fstatSync(this.handle,{bigint:!0});this.size=Number(i.size),this.bigsize=i.size,this.url=t}async close(){return new Promise((t,r)=>{Wp.default.close(this.handle,n=>n?r(n):t())})}async stat(){return await new Promise((t,r)=>Wp.default.fstat(this.handle,{bigint:!0},(n,i)=>{let a={size:Number(i.size),bigsize:i.size,isDirectory:i.isDirectory()};n?r(n):t(a)}))}async read(t,r){let n=new ArrayBuffer(r),i=BigInt(t),a=0,o=new Uint8Array(n),s;for(;r>0;){let u=await GWe(this.handle,o,0,r,i);if(u===0)break;a+=u,i+=BigInt(u),r-=u,s!==void 0&&(s+=u)}return a<r?n.slice(0,a):n}async write(t,r=0,n=t.byteLength){return new Promise((i,a)=>{let o=Number(r),s=new Uint8Array(t,Number(r),n);Wp.default.write(this.handle,s,0,n,o,(u,c)=>u?a(u):i(c))})}};async function GWe(e,t,r,n,i){return await new Promise((a,o)=>Wp.default.read(e,t,r,n,i,(s,u)=>s?o(s):a(u)))}var RA=$t(require("fs/promises"),1);var XI=$t(require("fs"),1),JI=require("stream");var OA=$t(require("zlib"),1),zWe=e=>e&&e instanceof ArrayBuffer,HWe=e=>e&&e instanceof Buffer;function IA(e,t){switch(t==null?void 0:t.get("content-encoding")){case"br":return e.pipe(OA.default.createBrotliDecompress());case"gzip":return e.pipe(OA.default.createGunzip());case"deflate":return e.pipe(OA.default.createDeflate());default:return e}}async function Bae(e){let t=[];return await new Promise((r,n)=>{e.on("error",i=>n(i)),e.on("readable",()=>e.read()),e.on("data",i=>{typeof i=="string"&&n(new Error("Read stream not binary")),t.push(VWe(i))}),e.on("end",()=>{let i=WWe(t);r(i)})})}function WWe(e){let t=e.map(a=>a instanceof ArrayBuffer?new Uint8Array(a):a),r=t.reduce((a,o)=>a+o.byteLength,0),n=new Uint8Array(r),i=0;for(let a of t)n.set(a,i),i+=a.byteLength;return n.buffer}function VWe(e){if(zWe(e))return e;if(HWe(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var KWe=e=>typeof e=="boolean",Oae=e=>typeof e=="function",$We=e=>e!==null&&typeof e=="object",YWe=e=>$We(e)&&Oae(e.read)&&Oae(e.pipe)&&KWe(e.readable);async function PA(e,t){let r=/^file:\/\//;e.replace(r,"/");let n=e.split("?")[0];n=tc(n);let i=new Headers;e.endsWith(".gz")&&(i["content-encoding"]="gzip"),e.endsWith(".br")&&(i["content-encoding"]="br");try{let a=await new Promise((f,h)=>{let p=XI.default.createReadStream(n,{encoding:null});p.once("readable",()=>f(p)),p.on("error",d=>h(d))}),o=a;YWe(a)?o=IA(a,i):typeof a=="string"?o=JI.Readable.from([new TextEncoder().encode(a)]):o=JI.Readable.from([a||new ArrayBuffer(0)]);let s=200,u="OK",c=JWe(n),l=new Response(o,{headers:c,status:s,statusText:u});return Object.defineProperty(l,"url",{value:e}),l}catch(a){let o=a.message,s=400,u=o,c={},l=new Response(o,{headers:c,status:s,statusText:u});return Object.defineProperty(l,"url",{value:e}),l}}function JWe(e){let t={};if(!t["content-length"]){let r=XI.default.statSync(e);t["content-length"]=r.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip"),new Headers(t)}var jA=class{readable=!0;writable=!0;constructor(){}async readdir(t=".",r){return await RA.default.readdir(t,r)}async stat(t){let r=await RA.default.stat(t,{bigint:!0});return{size:Number(r.size),bigsize:r.size,isDirectory:r.isDirectory()}}async unlink(t){return await RA.default.unlink(t)}async fetch(t,r){return await PA(t,r)}async openReadableFile(t,r="r"){return new Vp(t,r)}async openWritableFile(t,r="w",n){return new Vp(t,r,n)}};var Kp=class{constructor(t={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(t,r="base64"){var o,s;let n=[];for await(let u of t)n.push(u),yield u;let i=await this.concatenate(n),a=await this.hash(i,r);(s=(o=this.options.crypto)==null?void 0:o.onEnd)==null||s.call(o,{hash:a})}async concatenate(t){return await zp(t)}};function Iae(e){e=`${e}`;for(let r=0;r<e.length;r++)if(e.charCodeAt(r)>255)return null;let t="";for(let r=0;r<e.length;r+=3){let n=[void 0,void 0,void 0,void 0];n[0]=e.charCodeAt(r)>>2,n[1]=(e.charCodeAt(r)&3)<<4,e.length>r+1&&(n[1]|=e.charCodeAt(r+1)>>4,n[2]=(e.charCodeAt(r+1)&15)<<2),e.length>r+2&&(n[2]|=e.charCodeAt(r+2)>>6,n[3]=e.charCodeAt(r+2)&63);for(let i=0;i<n.length;i++)typeof n[i]>"u"?t+="=":t+=XWe(n[i])}return t}function XWe(e){if(e<26)return String.fromCharCode(e+"A".charCodeAt(0));if(e<52)return String.fromCharCode(e-26+"a".charCodeAt(0));if(e<62)return String.fromCharCode(e-52+"0".charCodeAt(0));if(e===62)return"+";if(e===63)return"/"}function Pae(e,t){switch(t){case"hex":return e;case"base64":return QWe(e);default:throw new Error(t)}}function QWe(e){e.length%2!==0&&(e=`0${e}`);let r=(e.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return Iae(r)||""}var jae=typeof atob=="function"?atob:typeof Buffer=="function"?aVe:Mae,ZWe=jae("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALB7oCJQhvbmVGdWxsQQAYCG9uZUZ1bGxCABkIb25lRnVsbEMAGghvbmVGdWxsRAAbBWxvb3BzAAEEbG9vcAACBXByaW1lAAMFbG9vcEEABAZsb29wQTEABQZsb29wQTIABgZsb29wQTMABwZsb29wQTQACAVsb29wQgAJBmxvb3BCMQAKBmxvb3BCMgALBmxvb3BCMwAMBmxvb3BCNAANBWxvb3BDAA4GbG9vcEMxAA8GbG9vcEMyABAGbG9vcEMzABEGbG9vcEM0ABIFbG9vcEQAEwZsb29wRDEAFAZsb29wRDIAFQZsb29wRDMAFgZsb29wRDQAFwRnZXRBACgEZ2V0QgApBGdldEMAKgRnZXREACsEZ2V0WAAsBHNldEEALQRzZXRCAC4Ec2V0QwAvBHNldEQAMARzZXRYADEKzA0xWwEBf0EAJAggAEEGdCEBAkADQCMIIAFGDQEjACQEIwEkBSMCJAYjAyQHEAIjBCMAaiQAIwUjAWokASMGIwJqJAIjByMDaiQDIwhBwABqJAgMAAsLIwgjGmokGgsTACMIIxpqJAkQAxAEEAkQDhATC6IBAEEAIwlqKAIAJApBBCMJaigCACQLQQgjCWooAgAkDEEMIwlqKAIAJA1BECMJaigCACQOQRQjCWooAgAkD0EYIwlqKAIAJBBBHCMJaigCACQRQSAjCWooAgAkEkEkIwlqKAIAJBNBKCMJaigCACQUQSwjCWooAgAkFUEwIwlqKAIAJBZBNCMJaigCACQXQTgjCWooAgAkGEE8IwlqKAIAJBkLCgAQBRAGEAcQCAsuAEH4yKq7fSMKahAYQdbunsZ+IwtqEBtB2+GBoQIjDGoQGkHunfeNfCMNahAZCy0AQa+f8Kt/Iw5qEBhBqoyfvAQjD2oQG0GTjMHBeiMQahAaQYGqmmojEWoQGQssAEHYsYLMBiMSahAYQa/vk9p4IxNqEBtBsbd9IxRqEBpBvq/zyngjFWoQGQstAEGiosDcBiMWahAYQZPj4WwjF2oQG0GOh+WzeiMYahAaQaGQ0M0EIxlqEBkLCgAQChALEAwQDQsuAEHiyviwfyMLahAcQcDmgoJ8IxBqEB9B0bT5sgIjFWoQHkGqj9vNfiMKahAdCy0AQd2gvLF9Iw9qEBxB06iQEiMUahAfQYHNh8V9IxlqEB5ByPfPvn4jDmoQHQsuAEHmm4ePAiMTahAcQdaP3Jl8IxhqEB9Bh5vUpn8jDWoQHkHtqeiqBCMSahAdCy0AQYXSj896IxdqEBxB+Me+ZyMMahAfQdmFvLsGIxFqEB5Bipmp6XgjFmoQHQsKABAPEBAQERASCysAQcLyaCMPahAgQYHtx7t4IxJqECNBosL17AYjFWoQIkGM8JRvIxhqECELLgBBxNT7pXojC2oQIEGpn/veBCMOahAjQeCW7bV/IxFqECJB8Pj+9XsjFGoQIQstAEHG/e3EAiMXahAgQfrPhNV+IwpqECNBheG8p30jDWoQIkGFuqAkIxBqECELLgBBuaDTzn0jE2oQIEHls+62fiMWahAjQfj5if0BIxlqECJB5ayxpXwjDGoQIQsKABAUEBUQFhAXCy0AQcTEpKF/IwpqECRBl/+rmQQjEWoQJ0Gnx9DceiMYahAmQbnAzmQjD2oQJQstAEHDs+2qBiMWahAkQZKZs/h4Iw1qECdB/ei/fyMUahAmQdG7kax4IwtqECULLQBBz/yh/QYjEmoQJEHgzbNxIxlqECdBlIaFmHojEGoQJkGho6DwBCMXahAlCy4AQYL9zbp/Iw5qECRBteTr6XsjFWoQJ0G7pd/WAiMMahAmQZGnm9x+IxNqECULKAEBf0F/IwFzIwNxIwEjAnFyIwBqIABqIgFBB3QgAUEZdnIjAWokAAsoAQF/QX8jAnMjAHEjAiMDcXIjAWogAGoiAUEWdCABQQp2ciMCaiQBCygBAX9BfyMDcyMBcSMDIwBxciMCaiAAaiIBQRF0IAFBD3ZyIwNqJAILKAEBf0F/IwBzIwJxIwAjAXFyIwNqIABqIgFBDHQgAUEUdnIjAGokAwsoAQF/IwJBfyMDc3EjASMDcXIjAGogAGoiAUEFdCABQRt2ciMBaiQACygBAX8jA0F/IwBzcSMCIwBxciMBaiAAaiIBQRR0IAFBDHZyIwJqJAELKAEBfyMAQX8jAXNxIwMjAXFyIwJqIABqIgFBDnQgAUESdnIjA2okAgsoAQF/IwFBfyMCc3EjACMCcXIjA2ogAGoiAUEJdCABQRd2ciMAaiQDCyIBAX8jASMCcyMDcyMAaiAAaiIBQQR0IAFBHHZyIwFqJAALIgEBfyMCIwNzIwBzIwFqIABqIgFBF3QgAUEJdnIjAmokAQsiAQF/IwMjAHMjAXMjAmogAGoiAUEQdCABQRB2ciMDaiQCCyIBAX8jACMBcyMCcyMDaiAAaiIBQQt0IAFBFXZyIwBqJAMLJQEBf0F/IwNzIwFyIwJzIwBqIABqIgFBBnQgAUEadnIjAWokAAslAQF/QX8jAHMjAnIjA3MjAWogAGoiAUEVdCABQQt2ciMCaiQBCyUBAX9BfyMBcyMDciMAcyMCaiAAaiIBQQ90IAFBEXZyIwNqJAILJQEBf0F/IwJzIwByIwFzIwNqIABqIgFBCnQgAUEWdnIjAGokAwsEACMACwQAIwELBAAjAgsEACMDCwQAIxoLBgAgACQACwYAIAAkAQsGACAAJAILBgAgACQDCwYAIAAkGgsA6gQEbmFtZQGSAzIAA2xvZwEFbG9vcHMCBGxvb3ADBXByaW1lBAVsb29wQQUGbG9vcEExBgZsb29wQTIHBmxvb3BBMwgGbG9vcEE0CQVsb29wQgoGbG9vcEIxCwZsb29wQjIMBmxvb3BCMw0GbG9vcEI0DgVsb29wQw8GbG9vcEMxEAZsb29wQzIRBmxvb3BDMxIGbG9vcEM0EwVsb29wRBQGbG9vcEQxFQZsb29wRDIWBmxvb3BEMxcGbG9vcEQ0GAhvbmVGdWxsQRkIb25lRnVsbEIaCG9uZUZ1bGxDGwhvbmVGdWxsRBwIdHdvRnVsbEEdCHR3b0Z1bGxCHgh0d29GdWxsQx8IdHdvRnVsbEQgCHRyZUZ1bGxBIQh0cmVGdWxsQiIIdHJlRnVsbEMjCHRyZUZ1bGxEJAhxdWFGdWxsQSUIcXVhRnVsbEImCHF1YUZ1bGxDJwhxdWFGdWxsRCgEZ2V0QSkEZ2V0QioEZ2V0QysEZ2V0RCwEZ2V0WC0Ec2V0QS4Ec2V0Qi8Ec2V0QzAEc2V0RDEEc2V0WALNATIAAQAAAQIAAAEIbnVtbG9vcHMCAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),QI=WebAssembly&&jae!==Mae?iVe(ZWe).buffer:!1,rc=oVe(),ZI=240*16*16,Lae=Math.floor(ZI*16*1.066666667),eVe=268435456-65536,Rae="Parameter must be Buffer, ArrayBuffer or Uint8Array",tVe="Parameter exceeds max size of 255.9 Mbytes";QI||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function eP(e){var t,r,n,i,a,o,s,u,c,l;let f=nVe(),h=rVe(),p={},d=new Date().getTime();return p.then=function(E){return s=E,g(),p},p.catch=function(E){return u=E,p},e&&typeof e=="object"?typeof Buffer=="function"&&e.constructor===Buffer?o=e:e.constructor===Uint8Array||e.constructor===ArrayBuffer?o=e.constructor===ArrayBuffer?new Uint8Array(e):e:x(new TypeError(Rae)):x(new TypeError(Rae)),o&&(a=o.length,QI&&a>Lae?a>eVe?x(new Error(tVe)):(t=new WebAssembly.Memory({initial:a>32e6?a>64e6?a>128e6?4096:2048:1024:512}),r=new Uint32Array(t.buffer),i={mem:t,log:console.log},n={imports:i},WebAssembly.instantiate(QI,n).then(b)):g(f(o))),p;function b(E){g(h(o,E.instance.exports,r))}function g(E){var S=Boolean(E)?E:c;Boolean(E)&&(l=new Date().getTime()),typeof s=="function"?Boolean(S)&&(s(S,l-d),s=u=null):Boolean(E)&&(c=E)}function x(E){typeof u=="function"&&u(E)}}function rVe(){var e,t,r,n,i,a,o,s,u,c,l,f,h,p=function(d){var b,g,x,E,S,F,D,j,k,N,C,I,P,U,Y,J,re,ee,ge,ye,pe,Te,$e=new Date().getTime(),We=0,oe=1732584193,V=-271733879,ne=-1732584194,se=271733878,Ge=0,at=d.length*8,ft;for(ft=Ie(d,h),h[at>>>5]|=128<<at%32,h[(at+64>>>9<<4)+14]=at,ft=(at+64>>>9<<4)+15,pe=h;Ge<ft;)ft>Ge+Lae?(n(oe),a(V),s(ne),c(se),t(ZI),Ge=Ge+ZI*16,oe=r(),V=i(),ne=o(),se=u(),We++):(re=oe,ee=V,ge=ne,ye=se,b=pe[Ge+0]>>>0,g=pe[Ge+1]>>>0,x=pe[Ge+2]>>>0,E=pe[Ge+3]>>>0,S=pe[Ge+4]>>>0,F=pe[Ge+5]>>>0,D=pe[Ge+6]>>>0,j=pe[Ge+7]>>>0,k=pe[Ge+8]>>>0,N=pe[Ge+9]>>>0,C=pe[Ge+10]>>>0,I=pe[Ge+11]>>>0,P=pe[Ge+12]>>>0,U=pe[Ge+13]>>>0,Y=pe[Ge+14]>>>0,J=pe[Ge+15]>>>0,oe=me(7,25,oe+(V&ne|~V&se)+b-680876936)+V,se=me(12,20,se+(oe&V|~oe&ne)+g-389564586)+oe,ne=me(17,15,ne+(se&oe|~se&V)+x+606105819)+se,V=me(22,10,V+(ne&se|~ne&oe)+E-1044525330)+ne,oe=me(7,25,oe+(V&ne|~V&se)+S-176418897)+V,se=me(12,20,se+(oe&V|~oe&ne)+F+1200080426)+oe,ne=me(17,15,ne+(se&oe|~se&V)+D-1473231341)+se,V=me(22,10,V+(ne&se|~ne&oe)+j-45705983)+ne,oe=me(7,25,oe+(V&ne|~V&se)+k+1770035416)+V,se=me(12,20,se+(oe&V|~oe&ne)+N-1958414417)+oe,ne=me(17,15,ne+(se&oe|~se&V)+C-42063)+se,V=me(22,10,V+(ne&se|~ne&oe)+I-1990404162)+ne,oe=me(7,25,oe+(V&ne|~V&se)+P+1804603682)+V,se=me(12,20,se+(oe&V|~oe&ne)+U-40341101)+oe,ne=me(17,15,ne+(se&oe|~se&V)+Y-1502002290)+se,V=me(22,10,V+(ne&se|~ne&oe)+J+1236535329)+ne,oe=me(5,27,oe+(V&se|ne&~se)+g-165796510)+V,se=me(9,23,se+(oe&ne|V&~ne)+D-1069501632)+oe,ne=me(14,18,ne+(se&V|oe&~V)+I+643717713)+se,V=me(20,12,V+(ne&oe|se&~oe)+b-373897302)+ne,oe=me(5,27,oe+(V&se|ne&~se)+F-701558691)+V,se=me(9,23,se+(oe&ne|V&~ne)+C+38016083)+oe,ne=me(14,18,ne+(se&V|oe&~V)+J-660478335)+se,V=me(20,12,V+(ne&oe|se&~oe)+S-405537848)+ne,oe=me(5,27,oe+(V&se|ne&~se)+N+568446438)+V,se=me(9,23,se+(oe&ne|V&~ne)+Y-1019803690)+oe,ne=me(14,18,ne+(se&V|oe&~V)+E-187363961)+se,V=me(20,12,V+(ne&oe|se&~oe)+k+1163531501)+ne,oe=me(5,27,oe+(V&se|ne&~se)+U-1444681467)+V,se=me(9,23,se+(oe&ne|V&~ne)+x-51403784)+oe,ne=me(14,18,ne+(se&V|oe&~V)+j+1735328473)+se,V=me(20,12,V+(ne&oe|se&~oe)+P-1926607734)+ne,oe=me(4,28,oe+(V^ne^se)+F-378558)+V,se=me(11,21,se+(oe^V^ne)+k-2022574463)+oe,ne=me(16,16,ne+(se^oe^V)+I+1839030562)+se,V=me(23,9,V+(ne^se^oe)+Y-35309556)+ne,oe=me(4,28,oe+(V^ne^se)+g-1530992060)+V,se=me(11,21,se+(oe^V^ne)+S+1272893353)+oe,ne=me(16,16,ne+(se^oe^V)+j-155497632)+se,V=me(23,9,V+(ne^se^oe)+C-1094730640)+ne,oe=me(4,28,oe+(V^ne^se)+U+681279174)+V,se=me(11,21,se+(oe^V^ne)+b-358537222)+oe,ne=me(16,16,ne+(se^oe^V)+E-722521979)+se,V=me(23,9,V+(ne^se^oe)+D+76029189)+ne,oe=me(4,28,oe+(V^ne^se)+N-640364487)+V,se=me(11,21,se+(oe^V^ne)+P-421815835)+oe,ne=me(16,16,ne+(se^oe^V)+J+530742520)+se,V=me(23,9,V+(ne^se^oe)+x-995338651)+ne,oe=me(6,26,oe+(ne^(V|~se))+b-198630844)+V,se=me(10,22,se+(V^(oe|~ne))+j+1126891415)+oe,ne=me(15,17,ne+(oe^(se|~V))+Y-1416354905)+se,V=me(21,11,V+(se^(ne|~oe))+F-57434055)+ne,oe=me(6,26,oe+(ne^(V|~se))+P+1700485571)+V,se=me(10,22,se+(V^(oe|~ne))+E-1894986606)+oe,ne=me(15,17,ne+(oe^(se|~V))+C-1051523)+se,V=me(21,11,V+(se^(ne|~oe))+g-2054922799)+ne,oe=me(6,26,oe+(ne^(V|~se))+k+1873313359)+V,se=me(10,22,se+(V^(oe|~ne))+J-30611744)+oe,ne=me(15,17,ne+(oe^(se|~V))+D-1560198380)+se,V=me(21,11,V+(se^(ne|~oe))+U+1309151649)+ne,oe=me(6,26,oe+(ne^(V|~se))+S-145523070)+V,se=me(10,22,se+(V^(oe|~ne))+I-1120210379)+oe,ne=me(15,17,ne+(oe^(se|~V))+x+718787259)+se,V=me(21,11,V+(se^(ne|~oe))+N-343485551)+ne,Ge=Ge+16,oe=oe+re>>>0,V=V+ee>>>0,ne=ne+ge>>>0,se=se+ye>>>0);return rc.endian([oe,V,ne,se]);function me(Oe,gt,Ue){return Ue<<Oe|Ue>>>gt}function Ie(Oe,gt){for(var Ue=-1,_t=Math.floor((Oe.length-1)/4),Mt=0,Sr,he,Xe,ct;_t-8>Ue++;)Mt=Ue<<2,gt[Ue]=Oe[Mt+0]|Oe[Mt+1]<<8|Oe[Mt+2]<<16|Oe[Mt+3]<<24;for(Ue--;_t>Ue++;)Mt=Ue<<2,Sr=typeof Oe[Mt+0]>"u"?0:Oe[Mt+0],he=typeof Oe[Mt+1]>"u"?0:Oe[Mt+1],Xe=typeof Oe[Mt+2]>"u"?0:Oe[Mt+2],ct=typeof Oe[Mt+3]>"u"?0:Oe[Mt+3],gt[Ue]=Sr|he<<8|Xe<<16|ct<<24;return _t+1}};return function(d,b,g,x){var E;return t=b.loops,e=b.loop,r=b.getA,i=b.getB,o=b.getC,u=b.getD,l=b.getX,n=b.setA,a=b.setB,s=b.setC,c=b.setD,f=b.setX,h=g,E=rc.wordsToBytes(p(d)),x&&x.asBytes?E:rc.bytesconvertNumberToHex(E)}}function nVe(){var e=function(t,r){var n,i,a,o,s,u,c,l,f,h,p,d,b,g,x,E,S,F,D,j,k,N=new Date().getTime(),C=1732584193,I=-271733879,P=-1732584194,U=271733878,Y=t.length*8;k=rc.bytesToWords(t);for(var J=0;J<k.length;J++)k[J]=(k[J]<<8|k[J]>>>24)&16711935|(k[J]<<24|k[J]>>>8)&4278255360;k[Y>>>5]|=128<<Y%32,k[(Y+64>>>9<<4)+14]=Y;for(var re=0;re<k.length;re+=16)S=C,F=I,D=P,j=U,n=k[re+0]>>>0,i=k[re+1]>>>0,a=k[re+2]>>>0,o=k[re+3]>>>0,s=k[re+4]>>>0,u=k[re+5]>>>0,c=k[re+6]>>>0,l=k[re+7]>>>0,f=k[re+8]>>>0,h=k[re+9]>>>0,p=k[re+10]>>>0,d=k[re+11]>>>0,b=k[re+12]>>>0,g=k[re+13]>>>0,x=k[re+14]>>>0,E=k[re+15]>>>0,C=ee(7,25,C+(I&P|~I&U)+n-680876936)+I,U=ee(12,20,U+(C&I|~C&P)+i-389564586)+C,P=ee(17,15,P+(U&C|~U&I)+a+606105819)+U,I=ee(22,10,I+(P&U|~P&C)+o-1044525330)+P,C=ee(7,25,C+(I&P|~I&U)+s-176418897)+I,U=ee(12,20,U+(C&I|~C&P)+u+1200080426)+C,P=ee(17,15,P+(U&C|~U&I)+c-1473231341)+U,I=ee(22,10,I+(P&U|~P&C)+l-45705983)+P,C=ee(7,25,C+(I&P|~I&U)+f+1770035416)+I,U=ee(12,20,U+(C&I|~C&P)+h-1958414417)+C,P=ee(17,15,P+(U&C|~U&I)+p-42063)+U,I=ee(22,10,I+(P&U|~P&C)+d-1990404162)+P,C=ee(7,25,C+(I&P|~I&U)+b+1804603682)+I,U=ee(12,20,U+(C&I|~C&P)+g-40341101)+C,P=ee(17,15,P+(U&C|~U&I)+x-1502002290)+U,I=ee(22,10,I+(P&U|~P&C)+E+1236535329)+P,C=ee(5,27,C+(I&U|P&~U)+i-165796510)+I,U=ee(9,23,U+(C&P|I&~P)+c-1069501632)+C,P=ee(14,18,P+(U&I|C&~I)+d+643717713)+U,I=ee(20,12,I+(P&C|U&~C)+n-373897302)+P,C=ee(5,27,C+(I&U|P&~U)+u-701558691)+I,U=ee(9,23,U+(C&P|I&~P)+p+38016083)+C,P=ee(14,18,P+(U&I|C&~I)+E-660478335)+U,I=ee(20,12,I+(P&C|U&~C)+s-405537848)+P,C=ee(5,27,C+(I&U|P&~U)+h+568446438)+I,U=ee(9,23,U+(C&P|I&~P)+x-1019803690)+C,P=ee(14,18,P+(U&I|C&~I)+o-187363961)+U,I=ee(20,12,I+(P&C|U&~C)+f+1163531501)+P,C=ee(5,27,C+(I&U|P&~U)+g-1444681467)+I,U=ee(9,23,U+(C&P|I&~P)+a-51403784)+C,P=ee(14,18,P+(U&I|C&~I)+l+1735328473)+U,I=ee(20,12,I+(P&C|U&~C)+b-1926607734)+P,C=ee(4,28,C+(I^P^U)+u-378558)+I,U=ee(11,21,U+(C^I^P)+f-2022574463)+C,P=ee(16,16,P+(U^C^I)+d+1839030562)+U,I=ee(23,9,I+(P^U^C)+x-35309556)+P,C=ee(4,28,C+(I^P^U)+i-1530992060)+I,U=ee(11,21,U+(C^I^P)+s+1272893353)+C,P=ee(16,16,P+(U^C^I)+l-155497632)+U,I=ee(23,9,I+(P^U^C)+p-1094730640)+P,C=ee(4,28,C+(I^P^U)+g+681279174)+I,U=ee(11,21,U+(C^I^P)+n-358537222)+C,P=ee(16,16,P+(U^C^I)+o-722521979)+U,I=ee(23,9,I+(P^U^C)+c+76029189)+P,C=ee(4,28,C+(I^P^U)+h-640364487)+I,U=ee(11,21,U+(C^I^P)+b-421815835)+C,P=ee(16,16,P+(U^C^I)+E+530742520)+U,I=ee(23,9,I+(P^U^C)+a-995338651)+P,C=ee(6,26,C+(P^(I|~U))+n-198630844)+I,U=ee(10,22,U+(I^(C|~P))+l+1126891415)+C,P=ee(15,17,P+(C^(U|~I))+x-1416354905)+U,I=ee(21,11,I+(U^(P|~C))+u-57434055)+P,C=ee(6,26,C+(P^(I|~U))+b+1700485571)+I,U=ee(10,22,U+(I^(C|~P))+o-1894986606)+C,P=ee(15,17,P+(C^(U|~I))+p-1051523)+U,I=ee(21,11,I+(U^(P|~C))+i-2054922799)+P,C=ee(6,26,C+(P^(I|~U))+f+1873313359)+I,U=ee(10,22,U+(I^(C|~P))+E-30611744)+C,P=ee(15,17,P+(C^(U|~I))+c-1560198380)+U,I=ee(21,11,I+(U^(P|~C))+g+1309151649)+P,C=ee(6,26,C+(P^(I|~U))+s-145523070)+I,U=ee(10,22,U+(I^(C|~P))+d-1120210379)+C,P=ee(15,17,P+(C^(U|~I))+a+718787259)+U,I=ee(21,11,I+(U^(P|~C))+h-343485551)+P,C=C+S>>>0,I=I+F>>>0,P=P+D>>>0,U=U+j>>>0;return rc.endian([C,I,P,U]);function ee(ge,ye,pe){return pe<<ge|pe>>>ye}};return function(t,r){var n=rc.wordsToBytes(e(t,r)),i=r&&r.asBytes?n:rc.bytesconvertNumberToHex(n);return i}}function iVe(e){var t,r,n,i=-1;for(t=e.length-1,r=new ArrayBuffer(e.length),n=new Uint8Array(r);t>i++;)n[i]=e.charCodeAt(i);return n}function aVe(e){return Buffer.from(e,"base64").toString("binary")}function Mae(e){return e}function oVe(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(t,r){return t<<r|t>>>32-r},endian:function(t){if(t.constructor==Number)return rc.rotl(t,8)&16711935|rc.rotl(t,24)&4278255360;for(var r=0;r<t.length;r++)t[r]=rc.endian(t[r]);return t},bytesToWords:function(t){for(var r=[],n=0,i=0;n<t.length;n++,i+=8)r[i>>>5]|=t[n]<<24-i%32;return r},wordsToBytes:function(t){for(var r=[],n=0;n<t.length*32;n+=8)r.push(t[n>>>5]>>>24-n%32&255);return r},bytesconvertNumberToHex:function(t){for(var r=[],n=0;n<t.length;n++)r.push((t[n]>>>4).toString(16)),r.push((t[n]&15).toString(16));return r.join("")}}}var kx=class extends Kp{name="md5";options;constructor(t={}){super(),this.options=t}async hash(t,r){let i=await new Promise((a,o)=>eP(t).then(a).catch(o));return Pae(i,r)}};var Bx=$t(require("crypto"),1),LA=class extends Kp{name="crypto-node";options;_algorithm;_hash;constructor(t){var r,n;if(super(),this.options=t,!((n=(r=this.options)==null?void 0:r.crypto)!=null&&n.algorithm))throw new Error(this.name)}async hash(t,r){var i,a,o,s;let n=(o=(a=(i=this.options)==null?void 0:i.crypto)==null?void 0:a.algorithm)==null?void 0:o.toLowerCase();try{if(!Bx.createHash)throw new Error("crypto.createHash not available");let u=(s=Bx.createHash)==null?void 0:s(n),c=new Uint8Array(t);return u.update(c).digest("base64")}catch(u){throw Error(`${n} hash not available. ${u}`)}}async*hashBatches(t,r="base64"){var a,o,s,u,c,l,f;if(!Bx.createHash)throw new Error("crypto.createHash not available");let n=(u=Bx.createHash)==null?void 0:u((s=(o=(a=this.options)==null?void 0:a.crypto)==null?void 0:o.algorithm)==null?void 0:s.toLowerCase());for await(let h of t){let p=new Uint8Array(h);n.update(p),yield h}let i=n.digest(r);(f=(l=(c=this.options)==null?void 0:c.crypto)==null?void 0:l.onEnd)==null||f.call(l,{hash:i})}};var Zae=require("process");var qae=$t(require("stream"),1),tP=class{},sVe=qae.Readable||tP;function nP(e,t){let r=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new rP(r,t)}var rP=class extends sVe{_pulling;_bytesMode;_iterator;constructor(t,r){super(r),this._iterator=t,this._pulling=!1,this._bytesMode=!r||!r.objectMode}async _read(t){this._pulling||(this._pulling=!0,this._pulling=await this._pull(t,this._iterator))}async _destroy(t,r){var n,i,a,o;this._iterator&&(t?await((i=(n=this._iterator)==null?void 0:n.throw)==null?void 0:i.call(n,t)):await((o=(a=this._iterator)==null?void 0:a.return)==null?void 0:o.call(a,t)),r==null||r(null))}async _pull(t,r){var a;let n=this._bytesMode,i=null;for(;this.readable&&!(i=await r.next()).done&&(t!==null&&(t-=n&&ArrayBuffer.isView(i.value)?i.value.byteLength:1),!(!this.push(new Uint8Array(i.value))||t<=0)););return(i!=null&&i.done||!this.readable)&&(this.push(null)||!0)&&((a=r==null?void 0:r.return)==null||a.call(r)),!this.readable}};var Gae=$t(Uae(),1);delete globalThis.ReadableStream;var qA=class extends Gae.ReadableStream{};var NA=class{chunks;isWorking=!1;isCancelled=!1;constructor(t){this.chunks=t}start(t){this.work(t)}async work(t){let{chunks:r}=this;for(this.isWorking=!0;!this.isCancelled&&(t.desiredSize||0)>0;){let n;try{n=r.next()}catch(i){t.error(i);break}n&&(!n.done&&!this.isCancelled?t.enqueue(n.value):t.close())}this.isWorking=!1}pull(t){this.isWorking||this.work(t)}cancel(){this.isCancelled=!0}};var UA=class extends qA{_chunks;constructor(t){super(new NA(t.values()),{type:"bytes"}),this._chunks=t}async*[Symbol.asyncIterator](t){let r=this.getReader();yield*this._chunks,r.releaseLock()}};var $p=class{type;size;parts;constructor(t=[],r={}){this.parts=[],this.size=0;for(let n of t)if(typeof n=="string"){let i=new TextEncoder().encode(n);this.parts.push(i),this.size+=i.byteLength}else if(n instanceof $p)this.size+=n.size,this.parts.push(...n.parts);else if(n instanceof ArrayBuffer)this.parts.push(new Uint8Array(n)),this.size+=n.byteLength;else if(n instanceof Uint8Array)this.parts.push(n),this.size+=n.byteLength;else if(ArrayBuffer.isView(n)){let{buffer:i,byteOffset:a,byteLength:o}=n;this.parts.push(new Uint8Array(i,a,o)),this.size+=o}else{let i=new TextEncoder().encode(String(n));this.parts.push(i),this.size+=i.byteLength}this.type=uVe(r.type)}slice(t=0,r=this.size,n=""){let{size:i,parts:a}=this,o=t<0?Math.max(i+t,0):Math.min(t,i),s=r<0?Math.max(i+r,0):Math.min(r,i),u=Math.max(s-o,0),c=new $p([],{type:n});if(u===0)return c;let l=0,f=[];for(let h of a){let{byteLength:p}=h;if(o>0&&p<=o)o-=p,s-=p;else{let d=h.subarray(o,Math.min(p,s));if(f.push(d),l+=d.byteLength,o=0,l>=u)break}}return c.parts=f,c.size=l,c}async arrayBuffer(){return this._toArrayBuffer()}async text(){let t=new TextDecoder,r="";for(let n of this.parts)r+=t.decode(n);return r}stream(){return new UA(this.parts)}toString(){return"[object Blob]"}get[Symbol.toStringTag](){return"Blob"}_toArrayBuffer(){let t=new ArrayBuffer(this.size),r=new Uint8Array(t),n=0;for(let i of this.parts)r.set(i,n),n+=i.byteLength;return t}};function uVe(e=""){let t=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(t)?"":t}function cVe(){return typeof Blob>"u"&&!globalThis.Blob&&(globalThis.Blob=$p),globalThis.Blob}var lVe=cVe();var GA=class{onload;onabort;onerror;error;onloadstart;onloadend;onprogress;readyState;result;DONE;EMPTY;LOADING;addEventListener;removeEventListener;dispatchEvent;constructor(){this.onload=null}abort(){}async readAsArrayBuffer(t){let r=await t.arrayBuffer();this.onload&&this.onload({target:{result:r}})}async readAsBinaryString(t){throw Error("Not implemented")}async readAsDataURL(t){let r=await t.text(),n=`data://;base64,${by(r)}`;this.onload&&this.onload({target:{result:n}})}async readAsText(t){let r=await t.text();this.onload&&this.onload({target:{result:r}})}};var zA=class extends globalThis.Blob{name="";webkitRelativePath="";lastModified;constructor(t,r,n={}){super(t,n),this.name=String(r).replace(/\//g,":"),this.lastModified=(n==null?void 0:n.lastModified)||Date.now()}get[Symbol.toStringTag](){return"File"}};function zae(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=GA),typeof File>"u"&&!globalThis.File&&(globalThis.File=zA),global}var fVe=zae();var iP=$t(require("module"),1),Hae=$t(require("path"),1),WA=$t(require("fs"),1);async function Wae(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():WA.default.readFileSync(e).buffer}async function Vae(e){return e.startsWith("http")?await(await fetch(e)).text():WA.default.readFileSync(e,"utf8")}async function Kae(e){if(e.startsWith("http")){let n=await(await fetch(e)).text();return HA(n)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let t=await WA.default.readFileSync(e,"utf8");return HA(t)}function HA(e,t="",r){if(typeof t=="object"&&(r=t,t=""),t=t.replace("file://",""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let n=iP.default._nodeModulePaths(Hae.default.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),a=new iP.default(t,i);return a.filename=t,a.paths=[].concat((r==null?void 0:r.prependPaths)||[]).concat(n).concat((r==null?void 0:r.appendPaths)||[]),a._compile(e,t),i&&i.children&&i.children.splice(i.children.indexOf(a),1),a.exports}var tu=class{map;constructor(t){this.map={},t instanceof tu?t.forEach((r,n)=>this.append(n,r)):Array.isArray(t)?t.forEach(r=>this.append(r[0],r[1])):t&&Object.getOwnPropertyNames(t).forEach(r=>this.append(r,t[r]))}append(t,r){t=Ox(t),r=$ae(r);let n=this.map[t];this.map[t]=n?`${n}, ${r}`:r}delete(t){delete this.map[Ox(t)]}get(t){return t=Ox(t),this.has(t)?this.map[t]:null}has(t){return this.map.hasOwnProperty(Ox(t))}set(t,r){this.map[Ox(t)]=$ae(r)}forEach(t,r=null){for(let n in this.map)this.map.hasOwnProperty(n)&&(r?t.call(r,this.map[n],n,this):t(this.map[n],n,this))}keys(){let t=[];return this.forEach(function(r,n){t.push(n)}),aP(t)}values(){let t=[];return this.forEach(function(r){t.push(r)}),aP(t)}entries(){let t=[];return this.forEach(function(r,n){t.push([n,r])}),aP(t)}*[Symbol.iterator](){yield*this.entries()}};function Ox(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 $ae(e){return typeof e!="string"&&(e=String(e)),e}function aP(e){let t={next(){let r=e.shift();return{done:r===void 0,value:r}}};return t[Symbol.iterator]=function(){return t},t}function oP(e,t){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${t}`)}var uP=$t(require("stream"),1),hVe=e=>typeof e=="boolean",Yae=e=>typeof e=="function",pVe=e=>e!==null&&typeof e=="object",sP=e=>pVe(e)&&Yae(e.read)&&Yae(e.pipe)&&hVe(e.readable),hl=class{ok;status;statusText;headers;url;bodyUsed=!1;_body;constructor(t,r){let{headers:n,status:i=200,statusText:a="OK",url:o}=r||{};this.url=o,this.ok=i===200,this.status=i,this.statusText=a,this.headers=new tu((r==null?void 0:r.headers)||{}),sP(t)?this._body=IA(t,n):typeof t=="string"?this._body=uP.Readable.from([new TextEncoder().encode(t)]):this._body=uP.Readable.from([t||new ArrayBuffer(0)])}get body(){return oP(!this.bodyUsed),oP(sP(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return sP(this._body)?await Bae(this._body):this._body||new ArrayBuffer(0)}async text(){let t=await this.arrayBuffer();return new TextDecoder().decode(t)}async json(){let t=await this.text();return JSON.parse(t)}async blob(){if(typeof Blob>"u")throw new Error("Blob polyfill not installed");return new Blob([await this.arrayBuffer()])}};var Xae=$t(require("http"),1),Qae=$t(require("https"),1);var dVe=e=>e&&e instanceof ArrayBuffer,mVe=e=>e&&e instanceof Buffer;function Jae(e){let t=e.indexOf(","),r,n;return e.slice(t-7,t)===";base64"?(r=Buffer.from(e.slice(t+1),"base64"),n=e.slice(5,t-7).trim()):(r=Buffer.from(decodeURIComponent(e.slice(t+1))),n=e.slice(5,t).trim()),n?n.startsWith(";")&&(n=`text/plain${n}`):n="text/plain;charset=US-ASCII",{arrayBuffer:gVe(r),mimeType:n}}function gVe(e){if(dVe(e))return e;if(mVe(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var cP=e=>e.startsWith("data:"),vVe=e=>e.startsWith("http:")||e.startsWith("https:");async function Ix(e,t){try{if(globalThis.fetch!==Ix&&(vVe(e)||cP(e)))return await fetch(e,t);if(cP(e)){let{arrayBuffer:c,mimeType:l}=Jae(e);return new hl(c,{headers:{"content-type":l},url:e})}let r={},n=e;e.endsWith(".gz")&&(e=e.slice(0,-3),r["content-encoding"]="gzip");let i=await bVe(n,t),a=wVe(e,i,r),{status:o,statusText:s}=_Ve(i),u=!t||t.followRedirect||t.followRedirect===void 0;if(o>=300&&o<400&&a.has("location")&&u){let c=yVe(e,a.get("location"));return await Ix(c,t)}return new hl(i,{headers:a,status:o,statusText:s,url:e})}catch(r){return new hl(null,{status:400,statusText:String(r),url:e})}}async function bVe(e,t){return await new Promise((r,n)=>{let i=xVe(e,t),a=e.startsWith("https:")?Qae.default.request(i,o=>r(o)):Xae.default.request(i,o=>r(o));a.on("error",o=>n(o)),a.end()})}function yVe(e,t){if(t.startsWith("http"))return t;let r=new URL(e);return r.pathname=t,r.href}function xVe(e,t){let r=(t==null?void 0:t.headers)||{},n={};for(let a of Object.keys(r))n[a.toLowerCase()]=r[a];n["accept-encoding"]=n["accept-encoding"]||"gzip,br,deflate";let i=new URL(e);return{hostname:i.hostname,path:i.pathname,method:"GET",...t,...t==null?void 0:t.fetch,headers:n,port:i.port}}function _Ve(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function wVe(e,t,r={}){let n={};if(t&&t.headers){let i=t.headers;for(let a in i){let o=i[a];n[a.toLowerCase()]=String(o)}}if(!n["content-length"]){let i=EVe(e);Number.isFinite(i)&&(n["content-length"]=i)}return Object.assign(n,r),new tu(n)}function EVe(e){return cP(e)?e.length-5:null}var AVe=parseInt(Zae.versions.node.split(".")[0]);_V&&console.error("loaders.gl: The @loaders.gl/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=nP;globalThis.loaders.NodeFile=Vp;globalThis.loaders.NodeFileSystem=jA;globalThis.loaders.fetchNode=PA;globalThis.loaders.NodeHash=LA;globalThis.TextEncoder||(globalThis.TextEncoder=vy);globalThis.TextDecoder||(globalThis.TextDecoder=_p);!("atob"in globalThis)&&by&&(globalThis.atob=by);!("btoa"in globalThis)&&Ek&&(globalThis.btoa=Ek);globalThis.loaders.encodeImageNode=AY;globalThis.loaders.parseImageNode=CI;globalThis.loaders.imageFormatsNode=TI;globalThis._parseImageNode=CI;globalThis._imageFormatsNode=TI;globalThis.loaders.readFileAsArrayBuffer=Wae;globalThis.loaders.readFileAsText=Vae;globalThis.loaders.requireFromFile=Kae;globalThis.loaders.requireFromString=HA;AVe<18&&(!("Headers"in globalThis)&&tu&&(globalThis.Headers=tu),!("Response"in globalThis)&&hl&&(globalThis.Response=hl),!("fetch"in globalThis)&&Ix&&(globalThis.fetch=Ix));var NBe=require("path"),UBe=$t(Hye(),1);var nTt=e=>typeof e=="boolean",z1=e=>typeof e=="function",wd=e=>e!==null&&typeof e=="object",HM=e=>wd(e)&&e.constructor==={}.constructor;var Wye=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",Vye=e=>e&&typeof e[Symbol.asyncIterator]=="function";var us=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var cs=e=>typeof Blob<"u"&&e instanceof Blob,Kye=e=>e&&typeof e=="object"&&e.isBuffer;var iTt=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||wd(e)&&z1(e.tee)&&z1(e.cancel)&&z1(e.getReader);var aTt=e=>wd(e)&&z1(e.read)&&z1(e.pipe)&&nTt(e.readable),JC=e=>iTt(e)||aTt(e);var oTt=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,sTt=/^([-\w.]+\/[-\w.+]+)/;function $ye(e){let t=sTt.exec(e);return t?t[1]:e}function WM(e){let t=oTt.exec(e);return t?t[1]:""}var Yye=/\?.*/;function Jye(e){let t=e.match(Yye);return t&&t[0]}function sv(e){return e.replace(Yye,"")}function Ed(e){return us(e)?e.url:cs(e)?e.name||"":typeof e=="string"?e:""}function H1(e){if(us(e)){let t=e,r=t.headers.get("content-type")||"",n=sv(t.url);return $ye(r)||WM(n)}return cs(e)?e.type||"":typeof e=="string"?WM(e):""}function Xye(e){return us(e)?e.headers["content-length"]||-1:cs(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function XC(e){if(us(e))return e;let t={},r=Xye(e);r>=0&&(t["content-length"]=String(r));let n=Ed(e),i=H1(e);i&&(t["content-type"]=i);let a=await cTt(e);a&&(t["x-first-bytes"]=a),typeof e=="string"&&(e=new TextEncoder().encode(e));let o=new Response(e,{headers:t});return Object.defineProperty(o,"url",{value:n}),o}async function Qye(e){if(!e.ok){let t=await uTt(e);throw new Error(t)}}async function uTt(e){let t=`Failed to fetch resource ${e.url} (${e.status}): `;try{let r=e.headers.get("Content-Type"),n=e.statusText;r.includes("application/json")&&(n+=` ${await e.text()}`),t+=n,t=t.length>60?`${t.slice(0,60)}...`:t}catch{}return t}async function cTt(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let r=e.slice(0,5);return await new Promise(n=>{let i=new FileReader;i.onload=a=>{var o;return n((o=a==null?void 0:a.target)==null?void 0:o.result)},i.readAsDataURL(r)})}if(e instanceof ArrayBuffer){let r=e.slice(0,5);return`data:base64,${lTt(r)}`}return null}function lTt(e){let t="",r=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)t+=String.fromCharCode(r[n]);return btoa(t)}function fTt(e){return!hTt(e)&&!pTt(e)}function hTt(e){return e.startsWith("http:")||e.startsWith("https:")}function pTt(e){return e.startsWith("data:")}async function Fo(e,t){var r,n;if(typeof e=="string"){let i=tc(e);return fTt(i)&&(r=globalThis.loaders)!=null&&r.fetchNode?(n=globalThis.loaders)==null?void 0:n.fetchNode(i,t):await fetch(i,t)}return await XC(e)}function VM(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 t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function lu(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||VM()}var dTt=globalThis.self||globalThis.window||globalThis.global,uv=globalThis.window||globalThis.self||globalThis.global,mTt=globalThis.document||{},Ad=globalThis.process||{},gTt=globalThis.console,Wdr=globalThis.navigator||{};var QC="4.0.0-beta.8",$dr=lu();function vTt(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var ZC=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";zt(this,"storage",void 0),zt(this,"id",void 0),zt(this,"config",void 0),this.storage=vTt(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function Zye(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function exe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function e8(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var t8;(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"})(t8||(t8={}));var bTt=10;function txe(e){return typeof e!="string"?e:(e=e.toUpperCase(),t8[e]||t8.WHITE)}function rxe(e,t,r){if(!lu&&typeof e=="string"){if(t){let n=txe(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=txe(r);e="\x1B[".concat(n+bTt,"m").concat(e,"\x1B[49m")}}return e}function nxe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),i=e;for(let a of n){let o=i[a];typeof o=="function"&&(t.find(s=>a===s)||(i[a]=o.bind(e)))}}function cv(e,t){if(!e)throw new Error(t||"Assertion failed")}function Sd(){let e;if(lu()&&uv.performance){var t,r;e=uv===null||uv===void 0||(t=uv.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Ad){var n;let i=Ad===null||Ad===void 0||(n=Ad.hrtime)===null||n===void 0?void 0:n.call(Ad);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var lv={debug:lu()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},yTt={enabled:!0,level:0};function ls(){}var ixe={},axe={once:!0},vc=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};zt(this,"id",void 0),zt(this,"VERSION",QC),zt(this,"_startTs",Sd()),zt(this,"_deltaTs",Sd()),zt(this,"_storage",void 0),zt(this,"userData",{}),zt(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new ZC("__probe-".concat(this.id,"__"),yTt),this.timeStamp("".concat(this.id," started")),nxe(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Sd()-this._startTs).toPrecision(10))}getDelta(){return Number((Sd()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){cv(t,r)}warn(t){return this._getLogFunction(0,t,lv.warn,arguments,axe)}error(t){return this._getLogFunction(0,t,lv.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,lv.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,lv.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,lv.debug||lv.info,arguments,axe)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||ls,n&&[n],{tag:ETt(r)}):ls}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?lu()?wTt({image:i,message:a,scale:o}):_Tt({image:i,message:a,scale:o}):ls}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||ls)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=oxe({logLevel:t,message:r,opts:n}),{collapsed:a}=n;return i.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||ls)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=sxe(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=oxe({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,cv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Sd();let o=a.tag||a.message;if(a.once&&o)if(!ixe[o])ixe[o]=Sd();else return ls;return r=xTt(this.id,a.message,a),n.bind(console,r,...a.args)}return ls}};zt(vc,"VERSION",QC);function sxe(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return cv(Number.isFinite(t)&&t>=0),t}function oxe(e){let{logLevel:t,message:r}=e;e.logLevel=sxe(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let i=typeof e.message;return cv(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function xTt(e,t,r){if(typeof t=="string"){let n=r.time?exe(Zye(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=rxe(t,r.color,r.background)}return t}function _Tt(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),ls}function wTt(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=e8(a,r,n);console.log(...o)},a.src=t,ls}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...e8(t,r,n)),ls;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...e8(a,r,n)),a.src=t.toDataURL(),ls}return ls}function ETt(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var _0r=new vc({id:"@probe.gl/log"});var KM=new vc({id:"loaders.gl"}),r8=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},n8=class{console;constructor(){this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}};var $M={fetch:null,mimeType:void 0,nothrow:!1,log:new n8,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:gn,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},uxe={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 YM(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state=e._state||{},e._state}function fv(){let e=YM();return e.globalOptions=e.globalOptions||{...$M},e.globalOptions}function fxe(e,t,r,n){return r=r||[],r=Array.isArray(r)?r:[r],ATt(e,r),TTt(t,e,n)}function ATt(e,t){cxe(e,null,$M,uxe,t);for(let r of t){let n=e&&e[r.id]||{},i=r.options&&r.options[r.id]||{},a=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};cxe(n,r.id,i,a,t)}}function cxe(e,t,r,n,i){let a=t||"Top level",o=t?`${t}.`:"";for(let s in e){let u=!t&&wd(e[s]),c=s==="baseUri"&&!t,l=s==="workerUrl"&&t;if(!(s in r)&&!c&&!l){if(s in n)KM.warn(`${a} loader option '${o}${s}' no longer supported, use '${n[s]}'`)();else if(!u){let f=STt(s,i);KM.warn(`${a} loader option '${o}${s}' not recognized. ${f}`)()}}}}function STt(e,t){let r=e.toLowerCase(),n="";for(let i of t)for(let a in i.options){if(e===a)return`Did you mean '${i.id}.${a}'?`;let o=a.toLowerCase();(r.startsWith(o)||o.startsWith(r))&&(n=n||`Did you mean '${i.id}.${a}'?`)}return n}function TTt(e,t,r){let i={...e.options||{}};return CTt(i,r),i.log===null&&(i.log=new r8),lxe(i,fv()),lxe(i,t),i}function lxe(e,t){for(let r in t)if(r in t){let n=t[r];HM(n)&&HM(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function CTt(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function W1(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function JM(e){Qt(e,"null loader"),Qt(W1(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e={...e,options:{...e.options,...t}}),(e!=null&&e.parseTextSync||e!=null&&e.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var DTt=()=>{let e=YM();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function hxe(){return DTt()}var pxe=new vc({id:"loaders.gl"});var FTt=/\.([^.]+)$/;async function gxe(e,t=[],r,n){if(!vxe(e))return null;let i=dxe(e,t,{...r,nothrow:!0},n);if(i)return i;if(cs(e)&&(e=await e.slice(0,10).arrayBuffer(),i=dxe(e,t,r,n)),!i&&!(r!=null&&r.nothrow))throw new Error(bxe(e));return i}function dxe(e,t=[],r,n){if(!vxe(e))return null;if(t&&!Array.isArray(t))return JM(t);let i=[];t&&(i=i.concat(t)),r!=null&&r.ignoreRegisteredLoaders||i.push(...hxe()),BTt(i);let a=kTt(e,i,r,n);if(!a&&!(r!=null&&r.nothrow))throw new Error(bxe(e));return a}function kTt(e,t,r,n){let i=Ed(e),a=H1(e),o=sv(i)||(n==null?void 0:n.url),s=null,u="";return r!=null&&r.mimeType&&(s=XM(t,r==null?void 0:r.mimeType),u=`match forced by supplied MIME type ${r==null?void 0:r.mimeType}`),s=s||OTt(t,o),u=u||(s?`matched url ${o}`:""),s=s||XM(t,a),u=u||(s?`matched MIME type ${a}`:""),s=s||PTt(t,e),u=u||(s?`matched initial data ${yxe(e)}`:""),r!=null&&r.fallbackMimeType&&(s=s||XM(t,r==null?void 0:r.fallbackMimeType),u=u||(s?`matched fallback MIME type ${a}`:"")),u&&pxe.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${u}.`),s}function vxe(e){return!(e instanceof Response&&e.status===204)}function bxe(e){let t=Ed(e),r=H1(e),n="No valid loader found (";n+=t?`${eu.filename(t)}, `:"no url provided, ",n+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let i=e?yxe(e):"";return n+=i?` first bytes: "${i}"`:"first bytes: not available",n+=")",n}function BTt(e){for(let t of e)JM(t)}function OTt(e,t){let r=t&&FTt.exec(t),n=r&&r[1];return n?ITt(e,n):null}function ITt(e,t){t=t.toLowerCase();for(let r of e)for(let n of r.extensions)if(n.toLowerCase()===t)return r;return null}function XM(e,t){for(let r of e)if(r.mimeTypes&&r.mimeTypes.includes(t)||t===`application/x.${r.id}`)return r;return null}function PTt(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(RTt(t,r))return r}else if(ArrayBuffer.isView(t)){if(mxe(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&mxe(t,0,r))return r;return null}function RTt(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(n=>e.startsWith(n))}function mxe(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(i=>jTt(e,t,r,i))}function jTt(e,t,r,n){if(n instanceof ArrayBuffer)return Zu(n,e,n.byteLength);switch(typeof n){case"function":return n(e);case"string":let i=QM(e,t,n.length);return n===i;default:return!1}}function yxe(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?QM(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?QM(e,0,t):""}function QM(e,t,r){if(e.byteLength<t+r)return"";let n=new DataView(e),i="";for(let a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function*xxe(e,t){let r=(t==null?void 0:t.chunkSize)||262144,n=0,i=new TextEncoder;for(;n<e.length;){let a=Math.min(e.length-n,r),o=e.slice(n,n+a);n+=a,yield i.encode(o)}}function*_xe(e,t={}){let{chunkSize:r=262144}=t,n=0;for(;n<e.byteLength;){let i=Math.min(e.byteLength-n,r),a=new ArrayBuffer(i),o=new Uint8Array(e,n,i);new Uint8Array(a).set(o),n+=i,yield a}}async function*wxe(e,t){let r=(t==null?void 0:t.chunkSize)||1048576,n=0;for(;n<e.size;){let i=n+r,a=await e.slice(n,i).arrayBuffer();n=i,yield a}}function ZM(e,t){return gn?LTt(e,t):MTt(e,t)}async function*LTt(e,t){let r=e.getReader(),n;try{for(;;){let i=n||r.read();t!=null&&t._streamReadAhead&&(n=r.read());let{done:a,value:o}=await i;if(a)return;yield fl(o)}}catch{r.releaseLock()}}async function*MTt(e,t){for await(let r of e)yield fl(r)}function Exe(e,t){if(typeof e=="string")return xxe(e,t);if(e instanceof ArrayBuffer)return _xe(e,t);if(cs(e))return wxe(e,t);if(JC(e))return ZM(e,t);if(us(e))return ZM(e.body,t);throw new Error("makeIterator")}var Axe="Cannot convert supplied data type";function qTt(e,t,r){if(t.text&&typeof e=="string")return e;if(Kye(e)&&(e=e.buffer),e instanceof ArrayBuffer){let n=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);let n=e.buffer,i=e.byteLength||e.length;return(e.byteOffset!==0||i!==n.byteLength)&&(n=n.slice(e.byteOffset,e.byteOffset+i)),n}throw new Error(Axe)}async function Sxe(e,t,r){let n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||n)return qTt(e,t,r);if(cs(e)&&(e=await XC(e)),us(e)){let i=e;return await Qye(i),t.binary?await i.arrayBuffer():await i.text()}if(JC(e)&&(e=Exe(e,r)),Wye(e)||Vye(e))return zp(e);throw new Error(Axe)}function i8(e,t){let r=fv(),n=e||r;return typeof n.fetch=="function"?n.fetch:wd(n.fetch)?i=>Fo(i,n.fetch):t!=null&&t.fetch?t==null?void 0:t.fetch:Fo}function Txe(e,t,r){if(r)return r;let n={fetch:i8(t,e),...e};if(n.url){let i=sv(n.url);n.baseUrl=i,n.queryString=Jye(n.url),n.filename=eu.filename(i),n.baseUrl=eu.dirname(i)}return Array.isArray(n.loaders)||(n.loaders=null),n}function Cxe(e,t){if(e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){let n=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...n]:n}return r&&r.length?r:void 0}async function ko(e,t,r,n){t&&!Array.isArray(t)&&!W1(t)&&(n=void 0,r=t,t=void 0),e=await e,r=r||{};let i=Ed(e),o=Cxe(t,n),s=await gxe(e,o,r);return s?(r=fxe(r,s,o,i),n=Txe({url:i,_parse:ko,loaders:o},r,n||null),await NTt(s,e,r,n)):null}async function NTt(e,t,r,n){if(PI(e),r=DI(e.options,r),us(t)){let a=t,{ok:o,redirected:s,status:u,statusText:c,type:l,url:f}=a,h=Object.fromEntries(a.headers.entries());n.response={headers:h,ok:o,redirected:s,status:u,statusText:c,type:l,url:f}}t=await Sxe(t,e,r);let i=e;if(i.parseTextSync&&typeof t=="string")return i.parseTextSync(t,r,n);if(MI(e,r))return await qI(e,t,r,n,ko);if(i.parseText&&typeof t=="string")return await i.parseText(t,r,n);if(i.parse)return await i.parse(t,r,n);throw pa(!i.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}async function An(e,t,r,n){let i,a;!Array.isArray(t)&&!W1(t)?(i=[],a=t,n=void 0):(i=t,a=r);let o=i8(a),s=e;return typeof e=="string"&&(s=await o(e)),cs(e)&&(s=await o(e)),Array.isArray(i)?await ko(s,i,a):await ko(s,i,a)}async function hv(e,t,r){if(r={...fv(),...r},NI(t,r))return await II(t,e,r);if(t.encode)return await t.encode(e,r);if(t.encodeSync)return t.encodeSync(e,r);if(t.encodeText)return new TextEncoder().encode(await t.encodeText(e,r));if(t.encodeInBatches){let i=Fxe(e,t,r),a=[];for await(let o of i)a.push(o);return ec(...a)}if(!gn&&t.encodeURLtoURL){let i=Dxe("input");await new Hp(i,"w").write(e);let o=Dxe("output"),s=await kxe(i,o,t,r);return(await Fo(s)).arrayBuffer()}throw new Error("Writer could not encode data")}function a8(e,t,r){if(t.encodeSync)return t.encodeSync(e,r);throw new Error("Writer could not synchronously encode data")}function Fxe(e,t,r){if(t.encodeInBatches){let n=UTt(e);return t.encodeInBatches(n,r)}throw new Error("Writer could not encode data in batches")}async function kxe(e,t,r,n){if(e=tc(e),t=tc(t),gn||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,n)}function UTt(e){return[{...e,start:0,end:e.length}]}function Dxe(e){return`/tmp/${e}`}var GTt=1/Math.PI*180,zTt=1/180*Math.PI,HTt={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...HTt}};var Sn=globalThis.mathgl.config;function e7(e,{precision:t=Sn.precision}={}){return e=WTt(e),"".concat(parseFloat(e.toPrecision(t)))}function fs(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function t7(e){return Bxe(e)}function r7(e){return Cl(e)}function Bxe(e,t){return i7(e,r=>r*zTt,t)}function Cl(e,t){return i7(e,r=>r*GTt,t)}function n7(e,t,r){return i7(e,n=>Math.max(t,Math.min(r,n)))}function Bo(e,t,r){let n=Sn.EPSILON;r&&(Sn.EPSILON=r);try{if(e===t)return!0;if(fs(e)&&fs(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!Bo(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=Sn.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{Sn.EPSILON=n}}function WTt(e){return Math.round(e/Sn.EPSILON)*Sn.EPSILON}function VTt(e){return e.clone?e.clone():new Array(e.length)}function i7(e,t,r){if(fs(e)){let n=e;r=r||VTt(n);for(let i=0;i<r.length&&i<n.length;++i){let a=typeof e=="number"?e:e[i];r[i]=t(a,i,r)}return r}return t(e)}function KTt(e){function t(){var r=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var bh=class extends KTt(Array){clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:fs(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Sn)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+e7(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!Bo(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let i=0;i<this.ELEMENTS;++i){let a=t[i],o=typeof r=="number"?r:r[i];this[i]=a+n*(o-a)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(Sn.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function $Tt(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function Ar(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function yh(e,t,r=""){if(Sn.debug&&!$Tt(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function na(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var xh=class extends bh{get x(){return this[0]}set x(t){this[0]=Ar(t)}get y(){return this[1]}set y(t){this[1]=Ar(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let i=this[n]-t[n];r+=i*i}return Ar(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return Ar(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return na(t>=0&&t<this.ELEMENTS,"index is out of range"),Ar(this[t])}setComponent(t,r){return na(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var Ln=typeof Float32Array<"u"?Float32Array:Array,V1=Math.random;function pv(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var ugr=Math.PI/180;function YTt(){let e=new Ln(2);return Ln!=Float32Array&&(e[0]=0,e[1]=0),e}function Oxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e}function Ixe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5],e}function o8(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function s8(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}var cgr=function(){let e=YTt();return function(t,r,n,i,a,o){let s,u;for(r||(r=2),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],a(e,e,o),t[s]=e[0],t[s+1]=e[1];return t}}();function u8(e,t,r){let n=t[0],i=t[1],a=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/a,e[1]=(r[1]*n+r[5]*i)/a,e}function c8(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a||1;return e[0]=(r[0]*n+r[4]*i+r[8]*a)/o,e[1]=(r[1]*n+r[5]*i+r[9]*a)/o,e[2]=(r[2]*n+r[6]*i+r[10]*a)/o,e}function Pxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e}function Rxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e[3]=t[3],e}function l8(e,t,r){let n=t[0],i=t[1],a=t[2];return e[0]=r[0]*n+r[3]*i+r[6]*a,e[1]=r[1]*n+r[4]*i+r[7]*a,e[2]=r[2]*n+r[5]*i+r[8]*a,e[3]=t[3],e}var Td=class extends xh{constructor(t=0,r=0){super(2),fs(t)&&arguments.length===1?this.copy(t):(Sn.debug&&(Ar(t),Ar(r)),this[0]=t,this[1]=r)}set(t,r){return this[0]=t,this[1]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return Sn.debug&&(Ar(t.x),Ar(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return s8(this,this,t),this.check()}transformAsVector(t){return u8(this,this,t),this.check()}transformByMatrix3(t){return o8(this,this,t),this.check()}transformByMatrix2x3(t){return Ixe(this,this,t),this.check()}transformByMatrix2(t){return Oxe(this,this,t),this.check()}};var mv={};ca(mv,{add:()=>ZTt,angle:()=>c7,bezier:()=>h6t,ceil:()=>e6t,clone:()=>JTt,copy:()=>XTt,create:()=>f8,cross:()=>Cd,dist:()=>_6t,distance:()=>Nxe,div:()=>x6t,divide:()=>qxe,dot:()=>K1,equals:()=>v6t,exactEquals:()=>g6t,floor:()=>t6t,forEach:()=>A6t,fromValues:()=>h8,hermite:()=>f6t,inverse:()=>u6t,len:()=>l7,length:()=>jxe,lerp:()=>c6t,max:()=>n6t,min:()=>r6t,mul:()=>y6t,multiply:()=>Mxe,negate:()=>s6t,normalize:()=>a7,random:()=>p6t,rotateX:()=>o7,rotateY:()=>s7,rotateZ:()=>u7,round:()=>i6t,scale:()=>a6t,scaleAndAdd:()=>o6t,set:()=>QTt,slerp:()=>l6t,sqrDist:()=>w6t,sqrLen:()=>E6t,squaredDistance:()=>Uxe,squaredLength:()=>Gxe,str:()=>m6t,sub:()=>b6t,subtract:()=>Lxe,transformMat3:()=>$1,transformMat4:()=>Dd,transformQuat:()=>Y1,zero:()=>d6t});function f8(){let e=new Ln(3);return Ln!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function JTt(e){let t=new Ln(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function jxe(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function h8(e,t,r){let n=new Ln(3);return n[0]=e,n[1]=t,n[2]=r,n}function XTt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function QTt(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function ZTt(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function Lxe(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function Mxe(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function qxe(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function e6t(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function t6t(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function r6t(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function n6t(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function i6t(e,t){return e[0]=pv(t[0]),e[1]=pv(t[1]),e[2]=pv(t[2]),e}function a6t(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function o6t(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}function Nxe(e,t){let r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+n*n+i*i)}function Uxe(e,t){let r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i}function Gxe(e){let t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function s6t(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function u6t(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function a7(e,t){let r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function K1(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Cd(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2];return e[0]=i*u-a*s,e[1]=a*o-n*u,e[2]=n*s-i*o,e}function c6t(e,t,r,n){let i=t[0],a=t[1],o=t[2];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e}function l6t(e,t,r,n){let i=Math.acos(Math.min(Math.max(K1(t,r),-1),1)),a=Math.sin(i),o=Math.sin((1-n)*i)/a,s=Math.sin(n*i)/a;return e[0]=o*t[0]+s*r[0],e[1]=o*t[1]+s*r[1],e[2]=o*t[2]+s*r[2],e}function f6t(e,t,r,n,i,a){let o=a*a,s=o*(2*a-3)+1,u=o*(a-2)+a,c=o*(a-1),l=o*(3-2*a);return e[0]=t[0]*s+r[0]*u+n[0]*c+i[0]*l,e[1]=t[1]*s+r[1]*u+n[1]*c+i[1]*l,e[2]=t[2]*s+r[2]*u+n[2]*c+i[2]*l,e}function h6t(e,t,r,n,i,a){let o=1-a,s=o*o,u=a*a,c=s*o,l=3*a*s,f=3*u*o,h=u*a;return e[0]=t[0]*c+r[0]*l+n[0]*f+i[0]*h,e[1]=t[1]*c+r[1]*l+n[1]*f+i[1]*h,e[2]=t[2]*c+r[2]*l+n[2]*f+i[2]*h,e}function p6t(e,t){t=t===void 0?1:t;let r=V1()*2*Math.PI,n=V1()*2-1,i=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*i,e[1]=Math.sin(r)*i,e[2]=n*t,e}function Dd(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}function $1(e,t,r){let n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}function Y1(e,t,r){let n=r[0],i=r[1],a=r[2],o=r[3],s=t[0],u=t[1],c=t[2],l=i*c-a*u,f=a*s-n*c,h=n*u-i*s,p=i*h-a*f,d=a*l-n*h,b=n*f-i*l,g=o*2;return l*=g,f*=g,h*=g,p*=2,d*=2,b*=2,e[0]=s+l+p,e[1]=u+f+d,e[2]=c+h+b,e}function o7(e,t,r,n){let i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function s7(e,t,r,n){let i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function u7(e,t,r,n){let i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function c7(e,t){let r=e[0],n=e[1],i=e[2],a=t[0],o=t[1],s=t[2],u=Math.sqrt((r*r+n*n+i*i)*(a*a+o*o+s*s)),c=u&&K1(e,t)/u;return Math.acos(Math.min(Math.max(c,-1),1))}function d6t(e){return e[0]=0,e[1]=0,e[2]=0,e}function m6t(e){return"vec3(".concat(e[0],", ").concat(e[1],", ").concat(e[2],")")}function g6t(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function v6t(e,t){let r=e[0],n=e[1],i=e[2],a=t[0],o=t[1],s=t[2];return Math.abs(r-a)<=1e-6*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-o)<=1e-6*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=1e-6*Math.max(1,Math.abs(i),Math.abs(s))}var b6t=Lxe,y6t=Mxe,x6t=qxe,_6t=Nxe,w6t=Uxe,l7=jxe,E6t=Gxe,A6t=function(){let e=f8();return function(t,r,n,i,a,o){let s,u;for(r||(r=3),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2];return t}}();var f7=[0,0,0],p8,ce=class extends xh{static get ZERO(){return p8||(p8=new ce(0,0,0),Object.freeze(p8)),p8}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&fs(t)?this.copy(t):(Sn.debug&&(Ar(t),Ar(r),Ar(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return Sn.debug&&(Ar(t.x),Ar(t.y),Ar(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=Ar(t)}angle(t){return c7(this,t)}cross(t){return Cd(this,this,t),this.check()}rotateX({radians:t,origin:r=f7}){return o7(this,this,r,t),this.check()}rotateY({radians:t,origin:r=f7}){return s7(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=f7}){return u7(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Dd(this,this,t),this.check()}transformAsVector(t){return c8(this,this,t),this.check()}transformByMatrix3(t){return $1(this,this,t),this.check()}transformByMatrix2(t){return Pxe(this,this,t),this.check()}transformByQuaternion(t){return Y1(this,this,t),this.check()}};var d8,hs=class extends xh{static get ZERO(){return d8||(d8=new hs(0,0,0,0),Object.freeze(d8)),d8}constructor(t=0,r=0,n=0,i=0){super(-0,-0,-0,-0),fs(t)&&arguments.length===1?this.copy(t):(Sn.debug&&(Ar(t),Ar(r),Ar(n),Ar(i)),this[0]=t,this[1]=r,this[2]=n,this[3]=i)}set(t,r,n,i){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return Sn.debug&&(Ar(t.x),Ar(t.y),Ar(t.z),Ar(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=Ar(t)}get w(){return this[3]}set w(t){this[3]=Ar(t)}transform(t){return Dd(this,this,t),this.check()}transformByMatrix3(t){return l8(this,this,t),this.check()}transformByMatrix2(t){return Rxe(this,this,t),this.check()}transformByQuaternion(t){return Y1(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var gv=class extends bh{toString(){let t="[";if(Sn.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+r])}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=Ar(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(t,r){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}};function zxe(){let e=new Ln(9);return Ln!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function Hxe(e,t){if(e===t){let r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function Wxe(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=l*o-s*c,h=-l*a+s*u,p=c*a-o*u,d=r*f+n*h+i*p;return d?(d=1/d,e[0]=f*d,e[1]=(-l*n+i*c)*d,e[2]=(s*n-i*o)*d,e[3]=h*d,e[4]=(l*r-i*u)*d,e[5]=(-s*r+i*a)*d,e[6]=p*d,e[7]=(-c*r+n*u)*d,e[8]=(o*r-n*a)*d,e):null}function Vxe(e){let t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8];return t*(c*a-o*u)+r*(-c*i+o*s)+n*(u*i-a*s)}function h7(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=r[0],p=r[1],d=r[2],b=r[3],g=r[4],x=r[5],E=r[6],S=r[7],F=r[8];return e[0]=h*n+p*o+d*c,e[1]=h*i+p*s+d*l,e[2]=h*a+p*u+d*f,e[3]=b*n+g*o+x*c,e[4]=b*i+g*s+x*l,e[5]=b*a+g*u+x*f,e[6]=E*n+S*o+F*c,e[7]=E*i+S*s+F*l,e[8]=E*a+S*u+F*f,e}function Kxe(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=r[0],p=r[1];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=h*n+p*o+c,e[7]=h*i+p*s+l,e[8]=h*a+p*u+f,e}function $xe(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=Math.sin(r),p=Math.cos(r);return e[0]=p*n+h*o,e[1]=p*i+h*s,e[2]=p*a+h*u,e[3]=p*o-h*n,e[4]=p*s-h*i,e[5]=p*u-h*a,e[6]=c,e[7]=l,e[8]=f,e}function p7(e,t,r){let n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Yxe(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,h=i*o,p=i*s,d=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-d,e[3]=l-x,e[6]=h+g,e[1]=l+x,e[4]=1-c-d,e[7]=p-b,e[2]=h-g,e[5]=p+b,e[8]=1-c-f,e}var d7;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(d7||(d7={}));var T6t=Object.freeze([1,0,0,0,1,0,0,0,1]),Rr=class extends gv{static get IDENTITY(){return D6t()}static get ZERO(){return C6t()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return d7}constructor(t,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):r.length>0?this.copy([t,...r]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(T6t)}fromObject(t){return this.check()}fromQuaternion(t){return Yxe(this,t),this.check()}set(t,r,n,i,a,o,s,u,c){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=a,this[5]=o,this[6]=s,this[7]=u,this[8]=c,this.check()}setRowMajor(t,r,n,i,a,o,s,u,c){return this[0]=t,this[1]=i,this[2]=s,this[3]=r,this[4]=a,this[5]=u,this[6]=n,this[7]=o,this[8]=c,this.check()}determinant(){return Vxe(this)}transpose(){return Hxe(this,this),this.check()}invert(){return Wxe(this,this),this.check()}multiplyLeft(t){return h7(this,t,this),this.check()}multiplyRight(t){return h7(this,this,t),this.check()}rotate(t){return $xe(this,this,t),this.check()}scale(t){return Array.isArray(t)?p7(this,this,t):p7(this,this,[t,t]),this.check()}translate(t){return Kxe(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=o8(r||[-0,-0],t,this);break;case 3:n=$1(r||[-0,-0,-0],t,this);break;case 4:n=l8(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return yh(n,t.length),n}transformVector(t,r){return this.transform(t,r)}transformVector2(t,r){return this.transform(t,r)}transformVector3(t,r){return this.transform(t,r)}},m8,g8=null;function C6t(){return m8||(m8=new Rr([0,0,0,0,0,0,0,0,0]),Object.freeze(m8)),m8}function D6t(){return g8||(g8=new Rr,Object.freeze(g8)),g8}var v8={};ca(v8,{add:()=>Z6t,adjoint:()=>P6t,clone:()=>k6t,copy:()=>B6t,create:()=>F6t,decompose:()=>H6t,determinant:()=>v7,equals:()=>n3t,exactEquals:()=>r3t,frob:()=>Q6t,fromQuat:()=>A7,fromQuat2:()=>U6t,fromRotation:()=>L6t,fromRotationTranslation:()=>Xxe,fromRotationTranslationScale:()=>W6t,fromRotationTranslationScaleOrigin:()=>V6t,fromScaling:()=>j6t,fromTranslation:()=>R6t,fromValues:()=>O6t,fromXRotation:()=>M6t,fromYRotation:()=>q6t,fromZRotation:()=>N6t,frustum:()=>S7,getRotation:()=>z6t,getScaling:()=>Qxe,getTranslation:()=>G6t,identity:()=>Jxe,invert:()=>g7,lookAt:()=>D7,mul:()=>i3t,multiply:()=>J1,multiplyScalar:()=>e3t,multiplyScalarAndAdd:()=>t3t,ortho:()=>C7,orthoNO:()=>e1e,orthoZO:()=>Y6t,perspective:()=>T7,perspectiveFromFieldOfView:()=>$6t,perspectiveNO:()=>Zxe,perspectiveZO:()=>K6t,rotate:()=>x7,rotateX:()=>_7,rotateY:()=>w7,rotateZ:()=>E7,scale:()=>y7,set:()=>I6t,str:()=>X6t,sub:()=>a3t,subtract:()=>t1e,targetTo:()=>J6t,translate:()=>b7,transpose:()=>m7});function F6t(){let e=new Ln(16);return Ln!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function k6t(e){let t=new Ln(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function B6t(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function O6t(e,t,r,n,i,a,o,s,u,c,l,f,h,p,d,b){let g=new Ln(16);return g[0]=e,g[1]=t,g[2]=r,g[3]=n,g[4]=i,g[5]=a,g[6]=o,g[7]=s,g[8]=u,g[9]=c,g[10]=l,g[11]=f,g[12]=h,g[13]=p,g[14]=d,g[15]=b,g}function I6t(e,t,r,n,i,a,o,s,u,c,l,f,h,p,d,b,g){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=a,e[5]=o,e[6]=s,e[7]=u,e[8]=c,e[9]=l,e[10]=f,e[11]=h,e[12]=p,e[13]=d,e[14]=b,e[15]=g,e}function Jxe(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 m7(e,t){if(e===t){let r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function g7(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],h=t[10],p=t[11],d=t[12],b=t[13],g=t[14],x=t[15],E=r*s-n*o,S=r*u-i*o,F=r*c-a*o,D=n*u-i*s,j=n*c-a*s,k=i*c-a*u,N=l*b-f*d,C=l*g-h*d,I=l*x-p*d,P=f*g-h*b,U=f*x-p*b,Y=h*x-p*g,J=E*Y-S*U+F*P+D*I-j*C+k*N;return J?(J=1/J,e[0]=(s*Y-u*U+c*P)*J,e[1]=(i*U-n*Y-a*P)*J,e[2]=(b*k-g*j+x*D)*J,e[3]=(h*j-f*k-p*D)*J,e[4]=(u*I-o*Y-c*C)*J,e[5]=(r*Y-i*I+a*C)*J,e[6]=(g*F-d*k-x*S)*J,e[7]=(l*k-h*F+p*S)*J,e[8]=(o*U-s*I+c*N)*J,e[9]=(n*I-r*U-a*N)*J,e[10]=(d*j-b*F+x*E)*J,e[11]=(f*F-l*j-p*E)*J,e[12]=(s*C-o*P-u*N)*J,e[13]=(r*P-n*C+i*N)*J,e[14]=(b*S-d*D-g*E)*J,e[15]=(l*D-f*S+h*E)*J,e):null}function P6t(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],h=t[10],p=t[11],d=t[12],b=t[13],g=t[14],x=t[15],E=r*s-n*o,S=r*u-i*o,F=r*c-a*o,D=n*u-i*s,j=n*c-a*s,k=i*c-a*u,N=l*b-f*d,C=l*g-h*d,I=l*x-p*d,P=f*g-h*b,U=f*x-p*b,Y=h*x-p*g;return e[0]=s*Y-u*U+c*P,e[1]=i*U-n*Y-a*P,e[2]=b*k-g*j+x*D,e[3]=h*j-f*k-p*D,e[4]=u*I-o*Y-c*C,e[5]=r*Y-i*I+a*C,e[6]=g*F-d*k-x*S,e[7]=l*k-h*F+p*S,e[8]=o*U-s*I+c*N,e[9]=n*I-r*U-a*N,e[10]=d*j-b*F+x*E,e[11]=f*F-l*j-p*E,e[12]=s*C-o*P-u*N,e[13]=r*P-n*C+i*N,e[14]=b*S-d*D-g*E,e[15]=l*D-f*S+h*E,e}function v7(e){let t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=e[11],p=e[12],d=e[13],b=e[14],g=e[15],x=t*o-r*a,E=t*s-n*a,S=r*s-n*o,F=c*d-l*p,D=c*b-f*p,j=l*b-f*d,k=t*j-r*D+n*F,N=a*j-o*D+s*F,C=c*S-l*E+f*x,I=p*S-d*E+b*x;return u*k-i*N+g*C-h*I}function J1(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],p=t[10],d=t[11],b=t[12],g=t[13],x=t[14],E=t[15],S=r[0],F=r[1],D=r[2],j=r[3];return e[0]=S*n+F*s+D*f+j*b,e[1]=S*i+F*u+D*h+j*g,e[2]=S*a+F*c+D*p+j*x,e[3]=S*o+F*l+D*d+j*E,S=r[4],F=r[5],D=r[6],j=r[7],e[4]=S*n+F*s+D*f+j*b,e[5]=S*i+F*u+D*h+j*g,e[6]=S*a+F*c+D*p+j*x,e[7]=S*o+F*l+D*d+j*E,S=r[8],F=r[9],D=r[10],j=r[11],e[8]=S*n+F*s+D*f+j*b,e[9]=S*i+F*u+D*h+j*g,e[10]=S*a+F*c+D*p+j*x,e[11]=S*o+F*l+D*d+j*E,S=r[12],F=r[13],D=r[14],j=r[15],e[12]=S*n+F*s+D*f+j*b,e[13]=S*i+F*u+D*h+j*g,e[14]=S*a+F*c+D*p+j*x,e[15]=S*o+F*l+D*d+j*E,e}function b7(e,t,r){let n=r[0],i=r[1],a=r[2],o,s,u,c,l,f,h,p,d,b,g,x;return t===e?(e[12]=t[0]*n+t[4]*i+t[8]*a+t[12],e[13]=t[1]*n+t[5]*i+t[9]*a+t[13],e[14]=t[2]*n+t[6]*i+t[10]*a+t[14],e[15]=t[3]*n+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],u=t[2],c=t[3],l=t[4],f=t[5],h=t[6],p=t[7],d=t[8],b=t[9],g=t[10],x=t[11],e[0]=o,e[1]=s,e[2]=u,e[3]=c,e[4]=l,e[5]=f,e[6]=h,e[7]=p,e[8]=d,e[9]=b,e[10]=g,e[11]=x,e[12]=o*n+l*i+d*a+t[12],e[13]=s*n+f*i+b*a+t[13],e[14]=u*n+h*i+g*a+t[14],e[15]=c*n+p*i+x*a+t[15]),e}function y7(e,t,r){let n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function x7(e,t,r,n){let i=n[0],a=n[1],o=n[2],s=Math.sqrt(i*i+a*a+o*o),u,c,l,f,h,p,d,b,g,x,E,S,F,D,j,k,N,C,I,P,U,Y,J,re;return s<1e-6?null:(s=1/s,i*=s,a*=s,o*=s,c=Math.sin(r),u=Math.cos(r),l=1-u,f=t[0],h=t[1],p=t[2],d=t[3],b=t[4],g=t[5],x=t[6],E=t[7],S=t[8],F=t[9],D=t[10],j=t[11],k=i*i*l+u,N=a*i*l+o*c,C=o*i*l-a*c,I=i*a*l-o*c,P=a*a*l+u,U=o*a*l+i*c,Y=i*o*l+a*c,J=a*o*l-i*c,re=o*o*l+u,e[0]=f*k+b*N+S*C,e[1]=h*k+g*N+F*C,e[2]=p*k+x*N+D*C,e[3]=d*k+E*N+j*C,e[4]=f*I+b*P+S*U,e[5]=h*I+g*P+F*U,e[6]=p*I+x*P+D*U,e[7]=d*I+E*P+j*U,e[8]=f*Y+b*J+S*re,e[9]=h*Y+g*J+F*re,e[10]=p*Y+x*J+D*re,e[11]=d*Y+E*J+j*re,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function _7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],h=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*n,e[5]=o*i+l*n,e[6]=s*i+f*n,e[7]=u*i+h*n,e[8]=c*i-a*n,e[9]=l*i-o*n,e[10]=f*i-s*n,e[11]=h*i-u*n,e}function w7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[8],l=t[9],f=t[10],h=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*n,e[1]=o*i-l*n,e[2]=s*i-f*n,e[3]=u*i-h*n,e[8]=a*n+c*i,e[9]=o*n+l*i,e[10]=s*n+f*i,e[11]=u*n+h*i,e}function E7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[4],l=t[5],f=t[6],h=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*n,e[1]=o*i+l*n,e[2]=s*i+f*n,e[3]=u*i+h*n,e[4]=c*i-a*n,e[5]=l*i-o*n,e[6]=f*i-s*n,e[7]=h*i-u*n,e}function R6t(e,t){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]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function j6t(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function L6t(e,t,r){let n=r[0],i=r[1],a=r[2],o=Math.sqrt(n*n+i*i+a*a),s,u,c;return o<1e-6?null:(o=1/o,n*=o,i*=o,a*=o,u=Math.sin(t),s=Math.cos(t),c=1-s,e[0]=n*n*c+s,e[1]=i*n*c+a*u,e[2]=a*n*c-i*u,e[3]=0,e[4]=n*i*c-a*u,e[5]=i*i*c+s,e[6]=a*i*c+n*u,e[7]=0,e[8]=n*a*c+i*u,e[9]=i*a*c-n*u,e[10]=a*a*c+s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function M6t(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function q6t(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function N6t(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,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 Xxe(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,u=i+i,c=a+a,l=n*s,f=n*u,h=n*c,p=i*u,d=i*c,b=a*c,g=o*s,x=o*u,E=o*c;return e[0]=1-(p+b),e[1]=f+E,e[2]=h-x,e[3]=0,e[4]=f-E,e[5]=1-(l+b),e[6]=d+g,e[7]=0,e[8]=h+x,e[9]=d-g,e[10]=1-(l+p),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function U6t(e,t){let r=new Ln(3),n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=n*n+i*i+a*a+o*o;return f>0?(r[0]=(s*o+l*n+u*a-c*i)*2/f,r[1]=(u*o+l*i+c*n-s*a)*2/f,r[2]=(c*o+l*a+s*i-u*n)*2/f):(r[0]=(s*o+l*n+u*a-c*i)*2,r[1]=(u*o+l*i+c*n-s*a)*2,r[2]=(c*o+l*a+s*i-u*n)*2),Xxe(e,t,r),e}function G6t(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Qxe(e,t){let r=t[0],n=t[1],i=t[2],a=t[4],o=t[5],s=t[6],u=t[8],c=t[9],l=t[10];return e[0]=Math.sqrt(r*r+n*n+i*i),e[1]=Math.sqrt(a*a+o*o+s*s),e[2]=Math.sqrt(u*u+c*c+l*l),e}function z6t(e,t){let r=new Ln(3);Qxe(r,t);let n=1/r[0],i=1/r[1],a=1/r[2],o=t[0]*n,s=t[1]*i,u=t[2]*a,c=t[4]*n,l=t[5]*i,f=t[6]*a,h=t[8]*n,p=t[9]*i,d=t[10]*a,b=o+l+d,g=0;return b>0?(g=Math.sqrt(b+1)*2,e[3]=.25*g,e[0]=(f-p)/g,e[1]=(h-u)/g,e[2]=(s-c)/g):o>l&&o>d?(g=Math.sqrt(1+o-l-d)*2,e[3]=(f-p)/g,e[0]=.25*g,e[1]=(s+c)/g,e[2]=(h+u)/g):l>d?(g=Math.sqrt(1+l-o-d)*2,e[3]=(h-u)/g,e[0]=(s+c)/g,e[1]=.25*g,e[2]=(f+p)/g):(g=Math.sqrt(1+d-o-l)*2,e[3]=(s-c)/g,e[0]=(h+u)/g,e[1]=(f+p)/g,e[2]=.25*g),e}function H6t(e,t,r,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];let i=n[0],a=n[1],o=n[2],s=n[4],u=n[5],c=n[6],l=n[8],f=n[9],h=n[10];r[0]=Math.sqrt(i*i+a*a+o*o),r[1]=Math.sqrt(s*s+u*u+c*c),r[2]=Math.sqrt(l*l+f*f+h*h);let p=1/r[0],d=1/r[1],b=1/r[2],g=i*p,x=a*d,E=o*b,S=s*p,F=u*d,D=c*b,j=l*p,k=f*d,N=h*b,C=g+F+N,I=0;return C>0?(I=Math.sqrt(C+1)*2,e[3]=.25*I,e[0]=(D-k)/I,e[1]=(j-E)/I,e[2]=(x-S)/I):g>F&&g>N?(I=Math.sqrt(1+g-F-N)*2,e[3]=(D-k)/I,e[0]=.25*I,e[1]=(x+S)/I,e[2]=(j+E)/I):F>N?(I=Math.sqrt(1+F-g-N)*2,e[3]=(j-E)/I,e[0]=(x+S)/I,e[1]=.25*I,e[2]=(D+k)/I):(I=Math.sqrt(1+N-g-F)*2,e[3]=(x-S)/I,e[0]=(j+E)/I,e[1]=(D+k)/I,e[2]=.25*I),e}function W6t(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3],u=i+i,c=a+a,l=o+o,f=i*u,h=i*c,p=i*l,d=a*c,b=a*l,g=o*l,x=s*u,E=s*c,S=s*l,F=n[0],D=n[1],j=n[2];return e[0]=(1-(d+g))*F,e[1]=(h+S)*F,e[2]=(p-E)*F,e[3]=0,e[4]=(h-S)*D,e[5]=(1-(f+g))*D,e[6]=(b+x)*D,e[7]=0,e[8]=(p+E)*j,e[9]=(b-x)*j,e[10]=(1-(f+d))*j,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function V6t(e,t,r,n,i){let a=t[0],o=t[1],s=t[2],u=t[3],c=a+a,l=o+o,f=s+s,h=a*c,p=a*l,d=a*f,b=o*l,g=o*f,x=s*f,E=u*c,S=u*l,F=u*f,D=n[0],j=n[1],k=n[2],N=i[0],C=i[1],I=i[2],P=(1-(b+x))*D,U=(p+F)*D,Y=(d-S)*D,J=(p-F)*j,re=(1-(h+x))*j,ee=(g+E)*j,ge=(d+S)*k,ye=(g-E)*k,pe=(1-(h+b))*k;return e[0]=P,e[1]=U,e[2]=Y,e[3]=0,e[4]=J,e[5]=re,e[6]=ee,e[7]=0,e[8]=ge,e[9]=ye,e[10]=pe,e[11]=0,e[12]=r[0]+N-(P*N+J*C+ge*I),e[13]=r[1]+C-(U*N+re*C+ye*I),e[14]=r[2]+I-(Y*N+ee*C+pe*I),e[15]=1,e}function A7(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,h=i*o,p=i*s,d=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-d,e[1]=l+x,e[2]=h-g,e[3]=0,e[4]=l-x,e[5]=1-c-d,e[6]=p+b,e[7]=0,e[8]=h+g,e[9]=p-b,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function S7(e,t,r,n,i,a,o){let s=1/(r-t),u=1/(i-n),c=1/(a-o);return e[0]=a*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*u,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*u,e[10]=(o+a)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*c,e[15]=0,e}function Zxe(e,t,r,n,i){let a=1/Math.tan(t/2);if(e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let o=1/(n-i);e[10]=(i+n)*o,e[14]=2*i*n*o}else e[10]=-1,e[14]=-2*n;return e}var T7=Zxe;function K6t(e,t,r,n,i){let a=1/Math.tan(t/2);if(e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let o=1/(n-i);e[10]=i*o,e[14]=i*n*o}else e[10]=-1,e[14]=-n;return e}function $6t(e,t,r,n){let i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),u=2/(o+s),c=2/(i+a);return e[0]=u,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-((o-s)*u*.5),e[9]=(i-a)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function e1e(e,t,r,n,i,a,o){let s=1/(t-r),u=1/(n-i),c=1/(a-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*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=(o+a)*c,e[15]=1,e}var C7=e1e;function Y6t(e,t,r,n,i,a,o){let s=1/(t-r),u=1/(n-i),c=1/(a-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]=c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=a*c,e[15]=1,e}function D7(e,t,r,n){let i,a,o,s,u,c,l,f,h,p,d=t[0],b=t[1],g=t[2],x=n[0],E=n[1],S=n[2],F=r[0],D=r[1],j=r[2];return Math.abs(d-F)<1e-6&&Math.abs(b-D)<1e-6&&Math.abs(g-j)<1e-6?Jxe(e):(f=d-F,h=b-D,p=g-j,i=1/Math.sqrt(f*f+h*h+p*p),f*=i,h*=i,p*=i,a=E*p-S*h,o=S*f-x*p,s=x*h-E*f,i=Math.sqrt(a*a+o*o+s*s),i?(i=1/i,a*=i,o*=i,s*=i):(a=0,o=0,s=0),u=h*s-p*o,c=p*a-f*s,l=f*o-h*a,i=Math.sqrt(u*u+c*c+l*l),i?(i=1/i,u*=i,c*=i,l*=i):(u=0,c=0,l=0),e[0]=a,e[1]=u,e[2]=f,e[3]=0,e[4]=o,e[5]=c,e[6]=h,e[7]=0,e[8]=s,e[9]=l,e[10]=p,e[11]=0,e[12]=-(a*d+o*b+s*g),e[13]=-(u*d+c*b+l*g),e[14]=-(f*d+h*b+p*g),e[15]=1,e)}function J6t(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=n[0],u=n[1],c=n[2],l=i-r[0],f=a-r[1],h=o-r[2],p=l*l+f*f+h*h;p>0&&(p=1/Math.sqrt(p),l*=p,f*=p,h*=p);let d=u*h-c*f,b=c*l-s*h,g=s*f-u*l;return p=d*d+b*b+g*g,p>0&&(p=1/Math.sqrt(p),d*=p,b*=p,g*=p),e[0]=d,e[1]=b,e[2]=g,e[3]=0,e[4]=f*g-h*b,e[5]=h*d-l*g,e[6]=l*b-f*d,e[7]=0,e[8]=l,e[9]=f,e[10]=h,e[11]=0,e[12]=i,e[13]=a,e[14]=o,e[15]=1,e}function X6t(e){return"mat4(".concat(e[0],", ").concat(e[1],", ").concat(e[2],", ").concat(e[3],", ").concat(e[4],", ").concat(e[5],", ").concat(e[6],", ").concat(e[7],", ").concat(e[8],", ").concat(e[9],", ").concat(e[10],", ").concat(e[11],", ").concat(e[12],", ").concat(e[13],", ").concat(e[14],", ").concat(e[15],")")}function Q6t(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}function Z6t(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function t1e(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function e3t(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function t3t(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function r3t(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function n3t(e,t){let r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=e[9],h=e[10],p=e[11],d=e[12],b=e[13],g=e[14],x=e[15],E=t[0],S=t[1],F=t[2],D=t[3],j=t[4],k=t[5],N=t[6],C=t[7],I=t[8],P=t[9],U=t[10],Y=t[11],J=t[12],re=t[13],ee=t[14],ge=t[15];return Math.abs(r-E)<=1e-6*Math.max(1,Math.abs(r),Math.abs(E))&&Math.abs(n-S)<=1e-6*Math.max(1,Math.abs(n),Math.abs(S))&&Math.abs(i-F)<=1e-6*Math.max(1,Math.abs(i),Math.abs(F))&&Math.abs(a-D)<=1e-6*Math.max(1,Math.abs(a),Math.abs(D))&&Math.abs(o-j)<=1e-6*Math.max(1,Math.abs(o),Math.abs(j))&&Math.abs(s-k)<=1e-6*Math.max(1,Math.abs(s),Math.abs(k))&&Math.abs(u-N)<=1e-6*Math.max(1,Math.abs(u),Math.abs(N))&&Math.abs(c-C)<=1e-6*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(l-I)<=1e-6*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(f-P)<=1e-6*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(h-U)<=1e-6*Math.max(1,Math.abs(h),Math.abs(U))&&Math.abs(p-Y)<=1e-6*Math.max(1,Math.abs(p),Math.abs(Y))&&Math.abs(d-J)<=1e-6*Math.max(1,Math.abs(d),Math.abs(J))&&Math.abs(b-re)<=1e-6*Math.max(1,Math.abs(b),Math.abs(re))&&Math.abs(g-ee)<=1e-6*Math.max(1,Math.abs(g),Math.abs(ee))&&Math.abs(x-ge)<=1e-6*Math.max(1,Math.abs(x),Math.abs(ge))}var i3t=J1,a3t=t1e;function o3t(){let e=new Ln(4);return Ln!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function r1e(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function n1e(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function i1e(e){let t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)}function a1e(e){let t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function o1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o,e}function s1e(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function u1e(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e}function c1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}function l1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],c=r[3],l=c*n+s*a-u*i,f=c*i+u*n-o*a,h=c*a+o*i-s*n,p=-o*n-s*i-u*a;return e[0]=l*c+p*-o+f*-u-h*-s,e[1]=f*c+p*-s+h*-o-l*-u,e[2]=h*c+p*-u+l*-s-f*-o,e[3]=t[3],e}var Ugr=function(){let e=o3t();return function(t,r,n,i,a,o){let s,u;for(r||(r=4),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}}();var B7;(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"})(B7||(B7={}));var u3t=45*Math.PI/180,c3t=1,F7=.1,k7=500,l3t=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Kr=class extends gv{static get IDENTITY(){return h3t()}static get ZERO(){return f3t()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return B7}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,i,a,o,s,u,c,l,f,h,p,d,b,g){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=a,this[5]=o,this[6]=s,this[7]=u,this[8]=c,this[9]=l,this[10]=f,this[11]=h,this[12]=p,this[13]=d,this[14]=b,this[15]=g,this.check()}setRowMajor(t,r,n,i,a,o,s,u,c,l,f,h,p,d,b,g){return this[0]=t,this[1]=a,this[2]=c,this[3]=p,this[4]=r,this[5]=o,this[6]=l,this[7]=d,this[8]=n,this[9]=s,this[10]=f,this[11]=b,this[12]=i,this[13]=u,this[14]=h,this[15]=g,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(l3t)}fromObject(t){return this.check()}fromQuaternion(t){return A7(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:i,top:a,near:o=F7,far:s=k7}=t;return s===1/0?p3t(this,r,n,i,a,o):S7(this,r,n,i,a,o,s),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=t;return D7(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:a,near:o=F7,far:s=k7}=t;return C7(this,r,n,i,a,o,s),this.check()}orthographic(t){let{fovy:r=u3t,aspect:n=c3t,focalDistance:i=1,near:a=F7,far:o=k7}=t;f1e(r);let s=r/2,u=i*Math.tan(s),c=u*n;return this.ortho({left:-c,right:c,bottom:-u,top:u,near:a,far:o})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:a=500}=t;return f1e(r),T7(this,r,n,i,a),this.check()}determinant(){return v7(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],a=1/n[1],o=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*a,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*a,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*a,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],a=1/n[1],o=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*a,t[2]=this[2]*o,t[3]=this[4]*i,t[4]=this[5]*a,t[5]=this[6]*o,t[6]=this[8]*i,t[7]=this[9]*a,t[8]=this[10]*o,t}transpose(){return m7(this,this),this.check()}invert(){return g7(this,this),this.check()}multiplyLeft(t){return J1(this,t,this),this.check()}multiplyRight(t){return J1(this,this,t),this.check()}rotateX(t){return _7(this,this,t),this.check()}rotateY(t){return w7(this,this,t),this.check()}rotateZ(t){return E7(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return x7(this,this,t,r),this.check()}scale(t){return y7(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return b7(this,this,t),this.check()}transform(t,r){return t.length===4?(r=c1e(r||[-0,-0,-0,-0],t,this),yh(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=s8(r||[-0,-0],t,this);break;case 3:i=Dd(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return yh(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=u8(r||[-0,-0],t,this);break;case 3:n=c8(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return yh(n,t.length),n}transformPoint(t,r){return this.transformAsPoint(t,r)}transformVector(t,r){return this.transformAsPoint(t,r)}transformDirection(t,r){return this.transformAsVector(t,r)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}},b8,y8;function f3t(){return b8||(b8=new Kr([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(b8)),b8}function h3t(){return y8||(y8=new Kr,Object.freeze(y8)),y8}function f1e(e){if(e>Math.PI*2)throw Error("expected radians")}function p3t(e,t,r,n,i,a){let o=2*a/(r-t),s=2*a/(i-n),u=(r+t)/(r-t),c=(i+n)/(i-n),l=-1,f=-1,h=-2*a;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]=c,e[10]=l,e[11]=f,e[12]=0,e[13]=0,e[14]=h,e[15]=0,e}function h1e(){let e=new Ln(4);return Ln!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function p1e(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function O7(e,t,r){r=r*.5;let n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function I7(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=r[0],u=r[1],c=r[2],l=r[3];return e[0]=n*l+o*s+i*c-a*u,e[1]=i*l+o*u+a*s-n*c,e[2]=a*l+o*c+n*u-i*s,e[3]=o*l-n*s-i*u-a*c,e}function d1e(e,t,r){r*=.5;let n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+o*s,e[1]=i*u+a*s,e[2]=a*u-i*s,e[3]=o*u-n*s,e}function m1e(e,t,r){r*=.5;let n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u-a*s,e[1]=i*u+o*s,e[2]=a*u+n*s,e[3]=o*u-i*s,e}function g1e(e,t,r){r*=.5;let n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+i*s,e[1]=i*u-n*s,e[2]=a*u+o*s,e[3]=o*u-a*s,e}function v1e(e,t){let r=t[0],n=t[1],i=t[2];return e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),e}function X1(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3],u=r[0],c=r[1],l=r[2],f=r[3],h,p,d,b,g;return h=i*u+a*c+o*l+s*f,h<0&&(h=-h,u=-u,c=-c,l=-l,f=-f),1-h>1e-6?(p=Math.acos(h),g=Math.sin(p),d=Math.sin((1-n)*p)/g,b=Math.sin(n*p)/g):(d=1-n,b=n),e[0]=d*i+b*u,e[1]=d*a+b*c,e[2]=d*o+b*l,e[3]=d*s+b*f,e}function b1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return e[0]=-r*s,e[1]=-n*s,e[2]=-i*s,e[3]=a*s,e}function y1e(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function P7(e,t){let r=t[0]+t[4]+t[8],n;if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);let a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(t[i*3+i]-t[a*3+a]-t[o*3+o]+1),e[i]=.5*n,n=.5/n,e[3]=(t[a*3+o]-t[o*3+a])*n,e[a]=(t[a*3+i]+t[i*3+a])*n,e[o]=(t[o*3+i]+t[i*3+o])*n}return e}var x1e=r1e;var _1e=n1e,w1e=s1e,E1e=u1e,A1e=i1e;var S1e=a1e;var T1e=o1e;var C1e=function(){let e=f8(),t=h8(1,0,0),r=h8(0,1,0);return function(n,i,a){let o=K1(i,a);return o<-.999999?(Cd(e,t,i),l7(e)<1e-6&&Cd(e,r,i),a7(e,e),O7(n,e,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Cd(e,i,a),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+o,T1e(n,n))}}(),tvr=function(){let e=h1e(),t=h1e();return function(r,n,i,a,o,s){return X1(e,n,o,s),X1(t,i,a,s),X1(r,e,t,2*s*(1-s)),r}}(),rvr=function(){let e=zxe();return function(t,r,n,i){return e[0]=n[0],e[3]=n[1],e[6]=n[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],T1e(t,P7(t,e))}}();var d3t=[0,0,0,1],ps=class extends bh{constructor(t=0,r=0,n=0,i=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,r,n,i)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,r,n,i){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return P7(this,t),this.check()}fromAxisRotation(t,r){return O7(this,t,r),this.check()}identity(){return p1e(this),this.check()}setAxisAngle(t,r){return this.fromAxisRotation(t,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=Ar(t)}get y(){return this[1]}set y(t){this[1]=Ar(t)}get z(){return this[2]}set z(t){this[2]=Ar(t)}get w(){return this[3]}set w(t){this[3]=Ar(t)}len(){return A1e(this)}lengthSquared(){return S1e(this)}dot(t){return w1e(this,t)}rotationTo(t,r){return C1e(this,t,r),this.check()}add(t){return x1e(this,this,t),this.check()}calculateW(){return v1e(this,this),this.check()}conjugate(){return y1e(this,this),this.check()}invert(){return b1e(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(E1e(this,t,r,n),this.check())}multiplyRight(t){return I7(this,this,t),this.check()}multiplyLeft(t){return I7(this,t,this),this.check()}normalize(){let t=this.len(),r=t>0?1/t:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,t===0&&(this[3]=1),this.check()}rotateX(t){return d1e(this,this,t),this.check()}rotateY(t){return m1e(this,this,t),this.check()}rotateZ(t){return g1e(this,this,t),this.check()}scale(t){return _1e(this,this,t),this.check()}slerp(t,r,n){let i,a,o;switch(arguments.length){case 1:({start:i=d3t,target:a,ratio:o}=t);break;case 2:i=this,a=t,o=r;break;default:i=t,a=r,o=n}return X1(this,i,a,o),this.check()}transformVector4(t,r=new hs){return l1e(r,t,this),yh(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,r){return this.setAxisAngle(t,r)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}};var fu={};ca(fu,{EPSILON1:()=>m3t,EPSILON10:()=>A3t,EPSILON11:()=>S3t,EPSILON12:()=>T3t,EPSILON13:()=>C3t,EPSILON14:()=>D3t,EPSILON15:()=>F3t,EPSILON16:()=>k3t,EPSILON17:()=>B3t,EPSILON18:()=>O3t,EPSILON19:()=>I3t,EPSILON2:()=>g3t,EPSILON20:()=>P3t,EPSILON3:()=>v3t,EPSILON4:()=>b3t,EPSILON5:()=>y3t,EPSILON6:()=>x3t,EPSILON7:()=>_3t,EPSILON8:()=>w3t,EPSILON9:()=>E3t,PI_OVER_FOUR:()=>j3t,PI_OVER_SIX:()=>L3t,PI_OVER_TWO:()=>R3t,TWO_PI:()=>M3t});var m3t=.1,g3t=.01,v3t=.001,b3t=1e-4,y3t=1e-5,x3t=1e-6,_3t=1e-7,w3t=1e-8,E3t=1e-9,A3t=1e-10,S3t=1e-11,T3t=1e-12,C3t=1e-13,D3t=1e-14,F3t=1e-15,k3t=1e-16,B3t=1e-17,O3t=1e-18,I3t=1e-19,P3t=1e-20,R3t=Math.PI/2,j3t=Math.PI/4,L3t=Math.PI/6,M3t=Math.PI*2;var Dl=6356752314245179e-9,q3t={radii:[6378137,6378137,Dl],radiiSquared:[6378137*6378137,6378137*6378137,Dl*Dl],oneOverRadii:[1/6378137,1/6378137,1/Dl],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Dl*Dl)],maximumRadius:Math.max(6378137,6378137,Dl),centerToleranceSquared:.1};function x8(e){return e}var Ivr=new ce;function N3t(e,t=[],r=x8){return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function D1e(e,t=[]){return N3t(e,t,Sn._cartographicRadians?x8:t7)}function U3t(e,t,r=x8){return"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):"x"in t?(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function F1e(e,t){return U3t(e,t,Sn._cartographicRadians?x8:r7)}var k1e=1e-14,G3t=new ce,B1e={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"}},R7={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Q1={east:new ce,north:new ce,up:new ce,west:new ce,south:new ce,down:new ce},z3t=new ce,H3t=new ce,W3t=new ce;function j7(e,t,r,n,i,a){let o=B1e[t]&&B1e[t][r];na(o&&(!n||n===o));let s,u,c,l=G3t.copy(i);if(Bo(l.x,0,k1e)&&Bo(l.y,0,k1e)){let h=Math.sign(l.z);s=z3t.fromArray(R7[t]),t!=="east"&&t!=="west"&&s.scale(h),u=H3t.fromArray(R7[r]),r!=="east"&&r!=="west"&&u.scale(h),c=W3t.fromArray(R7[n]),n!=="east"&&n!=="west"&&c.scale(h)}else{let{up:h,east:p,north:d}=Q1;p.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,h),d.copy(h).cross(p);let{down:b,west:g,south:x}=Q1;b.copy(h).scale(-1),g.copy(p).scale(-1),x.copy(d).scale(-1),s=Q1[t],u=Q1[r],c=Q1[n]}return a[0]=s.x,a[1]=s.y,a[2]=s.z,a[3]=0,a[4]=u.x,a[5]=u.y,a[6]=u.z,a[7]=0,a[8]=c.x,a[9]=c.y,a[10]=c.z,a[11]=0,a[12]=l.x,a[13]=l.y,a[14]=l.z,a[15]=1,a}var vv=new ce,V3t=new ce,K3t=new ce;function O1e(e,t,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:i,centerToleranceSquared:a}=t;vv.from(e);let o=vv.x,s=vv.y,u=vv.z,c=n.x,l=n.y,f=n.z,h=o*o*c*c,p=s*s*l*l,d=u*u*f*f,b=h+p+d,g=Math.sqrt(1/b);if(!Number.isFinite(g))return;let x=V3t;if(x.copy(e).scale(g),b<a)return x.to(r);let E=i.x,S=i.y,F=i.z,D=K3t;D.set(x.x*E*2,x.y*S*2,x.z*F*2);let j=(1-g)*vv.len()/(.5*D.len()),k=0,N,C,I,P;do{j-=k,N=1/(1+j*E),C=1/(1+j*S),I=1/(1+j*F);let U=N*N,Y=C*C,J=I*I,re=U*N,ee=Y*C,ge=J*I;P=h*U+p*Y+d*J-1;let pe=-2*(h*re*E+p*ee*S+d*ge*F);k=P/pe}while(Math.abs(P)>fu.EPSILON12);return vv.scale([N,C,I]).to(r)}var _8=new ce,I1e=new ce,J3t=new ce,hu=new ce,X3t=new ce,w8=new ce,or=class{constructor(t=0,r=0,n=0){zt(this,"radii",void 0),zt(this,"radiiSquared",void 0),zt(this,"radiiToTheFourth",void 0),zt(this,"oneOverRadii",void 0),zt(this,"oneOverRadiiSquared",void 0),zt(this,"minimumRadius",void 0),zt(this,"maximumRadius",void 0),zt(this,"centerToleranceSquared",fu.EPSILON1),zt(this,"squaredXOverSquaredZ",void 0),na(t>=0),na(r>=0),na(n>=0),this.radii=new ce(t,r,n),this.radiiSquared=new ce(t*t,r*r,n*n),this.radiiToTheFourth=new ce(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new ce(t===0?0:1/t,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new ce(t===0?0:1/(t*t),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,r=[0,0,0]){let n=I1e,i=J3t,[,,a]=t;this.geodeticSurfaceNormalCartographic(t,n),i.copy(this.radiiSquared).scale(n);let o=Math.sqrt(n.dot(i));return i.scale(1/o),n.scale(a),i.add(n),i.to(r)}cartesianToCartographic(t,r=[0,0,0]){w8.from(t);let n=this.scaleToGeodeticSurface(w8,hu);if(!n)return;let i=this.geodeticSurfaceNormal(n,I1e),a=X3t;a.copy(w8).subtract(n);let o=Math.atan2(i.y,i.x),s=Math.asin(i.z),u=Math.sign(mv.dot(a,w8))*mv.length(a);return F1e([o,s,u],r)}eastNorthUpToFixedFrame(t,r=new Kr){return j7(this,"east","north","up",t,r)}localFrameToFixedFrame(t,r,n,i,a=new Kr){return j7(this,t,r,n,i,a)}geocentricSurfaceNormal(t,r=[0,0,0]){return _8.from(t).normalize().to(r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=D1e(t),i=n[0],a=n[1],o=Math.cos(a);return _8.set(o*Math.cos(i),o*Math.sin(i),Math.sin(a)).normalize(),_8.to(r)}geodeticSurfaceNormal(t,r=[0,0,0]){return _8.from(t).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(t,r){return O1e(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){hu.from(t);let n=hu.x,i=hu.y,a=hu.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(n*n*o.x+i*i*o.y+a*a*o.z);return hu.multiplyScalar(s).to(r)}transformPositionToScaledSpace(t,r=[0,0,0]){return hu.from(t).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(t,r=[0,0,0]){return hu.from(t).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){na(Bo(this.radii.x,this.radii.y,fu.EPSILON15)),na(this.radii.z>0),hu.from(t);let i=hu.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-r))return hu.set(0,0,i).to(n)}};zt(or,"WGS84",new or(6378137,6378137,Dl));var ia={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var ebr=new ce,tbr=new ce;var Z1=new ce,P1e=new ce,Ya=class{constructor(t=[0,0,0],r=0){zt(this,"center",void 0),zt(this,"radius",void 0),this.radius=-0,this.center=new ce,this.fromCenterRadius(t,r)}fromCenterRadius(t,r){return this.center.from(t),this.radius=r,this}fromCornerPoints(t,r){return r=Z1.from(r),this.center=new ce().from(t).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new Ya(this.center,this.radius)}union(t){let r=this.center,n=this.radius,i=t.center,a=t.radius,o=Z1.copy(i).subtract(r),s=o.magnitude();if(n>=s+a)return this.clone();if(a>=s+n)return t.clone();let u=(n+s+a)*.5;return P1e.copy(o).scale((-n+u)/s).add(r),this.center.copy(P1e),this.radius=u,this}expand(t){let n=Z1.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=v8.getScaling(Z1,t);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(t){let r=this.distanceTo(t);return r*r}distanceTo(t){let n=Z1.from(t).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(t){let r=this.center,n=this.radius,a=t.normal.dot(r)+t.distance;return a<-n?ia.OUTSIDE:a<n?ia.INTERSECTING:ia.INSIDE}};var Q3t=new ce,Z3t=new ce,E8=new ce,A8=new ce,S8=new ce,eCt=new ce,tCt=new ce,Fl={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},aa=class{constructor(t=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){zt(this,"center",void 0),zt(this,"halfAxes",void 0),this.center=new ce().from(t),this.halfAxes=new Rr(r)}get halfSize(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new ce(t).len(),new ce(r).len(),new ce(n).len()]}get quaternion(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),i=new ce(t).normalize(),a=new ce(r).normalize(),o=new ce(n).normalize();return new ps().fromMatrix3(new Rr([...i,...a,...o]))}fromCenterHalfSizeQuaternion(t,r,n){let i=new ps(n),a=new Rr().fromQuaternion(i);return a[0]=a[0]*r[0],a[1]=a[1]*r[0],a[2]=a[2]*r[0],a[3]=a[3]*r[1],a[4]=a[4]*r[1],a[5]=a[5]*r[1],a[6]=a[6]*r[2],a[7]=a[7]*r[2],a[8]=a[8]*r[2],this.center=new ce().from(t),this.halfAxes=a,this}clone(){return new aa(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new Ya){let r=this.halfAxes,n=r.getColumn(0,E8),i=r.getColumn(1,A8),a=r.getColumn(2,S8),o=Q3t.copy(n).add(i).add(a);return t.center.copy(this.center),t.radius=o.magnitude(),t}intersectPlane(t){let r=this.center,n=t.normal,i=this.halfAxes,a=n.x,o=n.y,s=n.z,u=Math.abs(a*i[Fl.COLUMN0ROW0]+o*i[Fl.COLUMN0ROW1]+s*i[Fl.COLUMN0ROW2])+Math.abs(a*i[Fl.COLUMN1ROW0]+o*i[Fl.COLUMN1ROW1]+s*i[Fl.COLUMN1ROW2])+Math.abs(a*i[Fl.COLUMN2ROW0]+o*i[Fl.COLUMN2ROW1]+s*i[Fl.COLUMN2ROW2]),c=n.dot(r)+t.distance;return c<=-u?ia.OUTSIDE:c>=u?ia.INSIDE:ia.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=Z3t.from(t).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,E8),a=n.getColumn(1,A8),o=n.getColumn(2,S8),s=i.magnitude(),u=a.magnitude(),c=o.magnitude();i.normalize(),a.normalize(),o.normalize();let l=0,f;return f=Math.abs(r.dot(i))-s,f>0&&(l+=f*f),f=Math.abs(r.dot(a))-u,f>0&&(l+=f*f),f=Math.abs(r.dot(o))-c,f>0&&(l+=f*f),l}computePlaneDistances(t,r,n=[-0,-0]){let i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=this.center,s=this.halfAxes,u=s.getColumn(0,E8),c=s.getColumn(1,A8),l=s.getColumn(2,S8),f=eCt.copy(u).add(c).add(l).add(o),h=tCt.copy(f).subtract(t),p=r.dot(h);return i=Math.min(p,i),a=Math.max(p,a),f.copy(o).add(u).add(c).subtract(l),h.copy(f).subtract(t),p=r.dot(h),i=Math.min(p,i),a=Math.max(p,a),f.copy(o).add(u).subtract(c).add(l),h.copy(f).subtract(t),p=r.dot(h),i=Math.min(p,i),a=Math.max(p,a),f.copy(o).add(u).subtract(c).subtract(l),h.copy(f).subtract(t),p=r.dot(h),i=Math.min(p,i),a=Math.max(p,a),o.copy(f).subtract(u).add(c).add(l),h.copy(f).subtract(t),p=r.dot(h),i=Math.min(p,i),a=Math.max(p,a),o.copy(f).subtract(u).add(c).subtract(l),h.copy(f).subtract(t),p=r.dot(h),i=Math.min(p,i),a=Math.max(p,a),o.copy(f).subtract(u).subtract(c).add(l),h.copy(f).subtract(t),p=r.dot(h),i=Math.min(p,i),a=Math.max(p,a),o.copy(f).subtract(u).subtract(c).subtract(l),h.copy(f).subtract(t),p=r.dot(h),i=Math.min(p,i),a=Math.max(p,a),n[0]=i,n[1]=a,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,E8);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,A8);n.transformAsPoint(t);let i=this.halfAxes.getColumn(2,S8);return i.transformAsPoint(t),this.halfAxes=new Rr([...r,...n,...i]),this}getTransform(){throw new Error("not implemented")}};var R1e=new ce,j1e=new ce,kl=class{constructor(t=[0,0,1],r=0){zt(this,"normal",void 0),zt(this,"distance",void 0),this.normal=new ce,this.distance=-0,this.fromNormalDistance(t,r)}fromNormalDistance(t,r){return na(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=R1e.from(t),this.normal.from(r).normalize();let n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,r,n,i){return this.normal.set(t,r,n),na(Bo(this.normal.len(),1)),this.distance=i,this}clone(){return new kl(this.normal,this.distance)}equals(t){return Bo(this.distance,t.distance)&&Bo(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=j1e.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,r)}projectPointOntoPlane(t,r=[0,0,0]){let n=R1e.from(t),i=this.getPointDistance(n),a=j1e.copy(this.normal).scale(i);return n.subtract(a).to(r)}};var L1e=[new ce([1,0,0]),new ce([0,1,0]),new ce([0,0,1])],M1e=new ce,rCt=new ce,ds=class{constructor(t=[]){zt(this,"planes",void 0),this.planes=t}fromBoundingSphere(t){this.planes.length=2*L1e.length;let r=t.center,n=t.radius,i=0;for(let a of L1e){let o=this.planes[i],s=this.planes[i+1];o||(o=this.planes[i]=new kl),s||(s=this.planes[i+1]=new kl);let u=M1e.copy(a).scale(-n).add(r);o.fromPointNormal(u,a);let c=M1e.copy(a).scale(n).add(r),l=rCt.copy(a).negate();s.fromPointNormal(c,l),i+=2}return this}computeVisibility(t){let r=ia.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case ia.OUTSIDE:return ia.OUTSIDE;case ia.INTERSECTING:r=ia.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(na(Number.isFinite(r),"parentPlaneMask is required."),r===ds.MASK_OUTSIDE||r===ds.MASK_INSIDE)return r;let n=ds.MASK_INSIDE,i=this.planes;for(let a=0;a<this.planes.length;++a){let o=a<31?1<<a:0;if(a<31&&!(r&o))continue;let s=i[a],u=t.intersectPlane(s);if(u===ia.OUTSIDE)return ds.MASK_OUTSIDE;u===ia.INTERSECTING&&(n|=o)}return n}};zt(ds,"MASK_OUTSIDE",4294967295);zt(ds,"MASK_INSIDE",0);zt(ds,"MASK_INDETERMINATE",2147483647);var Abr=new ce,Sbr=new ce,Tbr=new ce,Cbr=new ce,Dbr=new ce;var iCt=new ce,aCt=new ce,oCt=new ce,sCt=new ce,uCt=new ce,cCt=new ce,lCt=new ce,bv=new ce,fCt=new ce,hCt=new ce,pCt=new ce,dCt=new ce;function L7(e,t=new Ya){if(!e||e.length===0)return t.fromCenterRadius([0,0,0],0);let r=lCt.copy(e[0]),n=iCt.copy(r),i=aCt.copy(r),a=oCt.copy(r),o=sCt.copy(r),s=uCt.copy(r),u=cCt.copy(r);for(let j of e){r.copy(j);let k=r.x,N=r.y,C=r.z;k<n.x&&n.copy(r),k>o.x&&o.copy(r),N<i.y&&i.copy(r),N>s.y&&s.copy(r),C<a.z&&a.copy(r),C>u.z&&u.copy(r)}let c=bv.copy(o).subtract(n).magnitudeSquared(),l=bv.copy(s).subtract(i).magnitudeSquared(),f=bv.copy(u).subtract(a).magnitudeSquared(),h=n,p=o,d=c;l>d&&(d=l,h=i,p=s),f>d&&(d=f,h=a,p=u);let b=fCt;b.x=(h.x+p.x)*.5,b.y=(h.y+p.y)*.5,b.z=(h.z+p.z)*.5;let g=bv.copy(p).subtract(b).magnitudeSquared(),x=Math.sqrt(g),E=hCt;E.x=n.x,E.y=i.y,E.z=a.z;let S=pCt;S.x=o.x,S.y=s.y,S.z=u.z;let F=dCt.copy(E).add(S).multiplyByScalar(.5),D=0;for(let j of e){r.copy(j);let k=bv.copy(r).subtract(F).magnitude();k>D&&(D=k);let N=bv.copy(r).subtract(b).magnitudeSquared();if(N>g){let C=Math.sqrt(N);x=(x+C)*.5,g=x*x;let I=C-x;b.x=(x*b.x+I*r.x)/C,b.y=(x*b.y+I*r.y)/C,b.z=(x*b.z+I*r.z)/C}}return x<D?(b.to(t.center),t.radius=x):(F.to(t.center),t.radius=D),t}var bc=new Rr,mCt=new Rr,gCt=new Rr,T8=new Rr,q1e=new Rr;function N7(e,t={}){let r=fu.EPSILON20,n=10,i=0,a=0,o=mCt,s=gCt;o.identity(),s.copy(e);let u=r*vCt(s);for(;a<n&&bCt(s)>u;)yCt(s,T8),q1e.copy(T8).transpose(),s.multiplyRight(T8),s.multiplyLeft(q1e),o.multiplyRight(T8),++i>2&&(++a,i=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=s.toTarget(t.diagonal),t}function vCt(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var M7=[1,0,0],q7=[2,2,1];function bCt(e){let t=0;for(let r=0;r<3;++r){let n=e[bc.getElementIndex(q7[r],M7[r])];t+=2*n*n}return Math.sqrt(t)}function yCt(e,t){let r=fu.EPSILON15,n=0,i=1;for(let c=0;c<3;++c){let l=Math.abs(e[bc.getElementIndex(q7[c],M7[c])]);l>n&&(i=c,n=l)}let a=M7[i],o=q7[i],s=1,u=0;if(Math.abs(e[bc.getElementIndex(o,a)])>r){let c=e[bc.getElementIndex(o,o)],l=e[bc.getElementIndex(a,a)],f=e[bc.getElementIndex(o,a)],h=(c-l)/2/f,p;h<0?p=-1/(-h+Math.sqrt(1+h*h)):p=1/(h+Math.sqrt(1+h*h)),s=1/Math.sqrt(1+p*p),u=p*s}return Rr.IDENTITY.to(t),t[bc.getElementIndex(a,a)]=t[bc.getElementIndex(o,o)]=s,t[bc.getElementIndex(o,a)]=u,t[bc.getElementIndex(a,o)]=-u,t}var _h=new ce,_Ct=new ce,wCt=new ce,ECt=new ce,ACt=new ce,SCt=new Rr,TCt={diagonal:new Rr,unitary:new Rr};function e_(e,t=new aa){if(!e||e.length===0)return t.halfAxes=new Rr([0,0,0,0,0,0,0,0,0]),t.center=new ce,t;let r=e.length,n=new ce(0,0,0);for(let C of e)n.add(C);let i=1/r;n.multiplyByScalar(i);let a=0,o=0,s=0,u=0,c=0,l=0;for(let C of e){let I=_h.copy(C).subtract(n);a+=I.x*I.x,o+=I.x*I.y,s+=I.x*I.z,u+=I.y*I.y,c+=I.y*I.z,l+=I.z*I.z}a*=i,o*=i,s*=i,u*=i,c*=i,l*=i;let f=SCt;f[0]=a,f[1]=o,f[2]=s,f[3]=o,f[4]=u,f[5]=c,f[6]=s,f[7]=c,f[8]=l;let{unitary:h}=N7(f,TCt),p=t.halfAxes.copy(h),d=p.getColumn(0,wCt),b=p.getColumn(1,ECt),g=p.getColumn(2,ACt),x=-Number.MAX_VALUE,E=-Number.MAX_VALUE,S=-Number.MAX_VALUE,F=Number.MAX_VALUE,D=Number.MAX_VALUE,j=Number.MAX_VALUE;for(let C of e)_h.copy(C),x=Math.max(_h.dot(d),x),E=Math.max(_h.dot(b),E),S=Math.max(_h.dot(g),S),F=Math.min(_h.dot(d),F),D=Math.min(_h.dot(b),D),j=Math.min(_h.dot(g),j);d=d.multiplyByScalar(.5*(F+x)),b=b.multiplyByScalar(.5*(D+E)),g=g.multiplyByScalar(.5*(j+S)),t.center.copy(d).add(b).add(g);let k=_Ct.set(x-F,E-D,S-j).multiplyByScalar(.5),N=new Rr([k[0],0,0,0,k[1],0,0,0,k[2]]);return t.halfAxes.multiplyRight(N),t}function z1e(e){return e!=null}var syr=new ce,CCt=new ce,DCt=new ce,FCt=new ce,Fd=new ce,N1e=new ce,U1e=new ce,G1e=new ce;function C8(e,t,r){if(Qt(e,"3D Tile: boundingVolume must be defined"),e.box)return H1e(e.box,t,r);if(e.region)return BCt(e.region);if(e.sphere)return kCt(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function H1e(e,t,r){let n=new ce(e[0],e[1],e[2]);t.transform(n,n);let i=[];if(e.length===10){let c=e.slice(3,6),l=new ps;l.fromArray(e,6);let f=new ce([1,0,0]),h=new ce([0,1,0]),p=new ce([0,0,1]);f.transformByQuaternion(l),f.scale(c[0]),h.transformByQuaternion(l),h.scale(c[1]),p.transformByQuaternion(l),p.scale(c[2]),i=[...f.toArray(),...h.toArray(),...p.toArray()]}else i=[...e.slice(3,6),...e.slice(6,9),...e.slice(9,12)];let a=t.transformAsVector(i.slice(0,3)),o=t.transformAsVector(i.slice(3,6)),s=t.transformAsVector(i.slice(6,9)),u=new Rr([a[0],a[1],a[2],o[0],o[1],o[2],s[0],s[1],s[2]]);return z1e(r)?(r.center=n,r.halfAxes=u,r):new aa(n,u)}function kCt(e,t,r){let n=new ce(e[0],e[1],e[2]);t.transform(n,n);let i=t.getScale(CCt),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return z1e(r)?(r.center=n,r.radius=o,r):new Ya(n,o)}function BCt(e){let[t,r,n,i,a,o]=e,s=or.WGS84.cartographicToCartesian([Cl(t),Cl(i),a],DCt),u=or.WGS84.cartographicToCartesian([Cl(n),Cl(r),o],FCt),c=new ce().addVectors(s,u).multiplyByScalar(.5);return or.WGS84.cartesianToCartographic(c,Fd),or.WGS84.cartographicToCartesian([Cl(n),Fd[1],Fd[2]],N1e),or.WGS84.cartographicToCartesian([Fd[0],Cl(i),Fd[2]],U1e),or.WGS84.cartographicToCartesian([Fd[0],Fd[1],o],G1e),H1e([...c,...N1e.subtract(c),...U1e.subtract(c),...G1e.subtract(c)],new Kr)}var yv="4.0.0-beta.8";var ms={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},hyr=Object.keys(ms),wh={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function U7(e,t,r){Qt(e instanceof ArrayBuffer);let n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}function W1e(e,t=0){let r=new DataView(e);return`${String.fromCharCode(r.getUint8(t+0))}${String.fromCharCode(r.getUint8(t+1))}${String.fromCharCode(r.getUint8(t+2))}${String.fromCharCode(r.getUint8(t+3))}`}var D8="4.0.0-beta.8";var OCt={draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},V1e={name:"Draco",id:"draco",module:"draco",version:D8,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:OCt};function K1e(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 G7(e){let t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length;for(let c=0;c<u;c+=3){let l=s[c],f=s[c+1],h=s[c+2];t=l<t?l:t,r=f<r?f:r,n=h<n?h:n,i=l>i?l:i,a=f>a?f:a,o=h>o?h:o}return[[t,r,n],[i,a,o]]}function z7(e,t,r){let n=K1e(t.value),i=r||$1e(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:i}}function $1e(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),t}function J1e(e,t,r){let n=X1e(t.metadata),i=[],a=ICt(t.attributes);for(let o in e){let s=e[o],u=Y1e(o,s,a[o]);i.push(u)}if(r){let o=Y1e("indices",r);i.push(o)}return{fields:i,metadata:n}}function ICt(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function Y1e(e,t,r){let n=r?X1e(r.metadata):void 0;return z7(e,t,n)}function X1e(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var Q1e={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},PCt={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},RCt=4,t_=class{draco;decoder;metadataQuerier;constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,r={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(r);let i=this.decoder.GetEncodedGeometryType(n),a=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(i){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(n,a);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(n,a);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!a.ptr){let h=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(h)}let s=this._getDracoLoaderData(a,i,r),u=this._getMeshData(a,s,r),c=G7(u.attributes),l=J1e(u.attributes,s,u.indices);return{loader:"draco",loaderData:s,header:{vertexCount:a.num_points(),boundingBox:c},...u,schema:l}}finally{this.draco.destroy(n),a&&this.draco.destroy(a)}}_getDracoLoaderData(t,r,n){let i=this._getTopLevelMetadata(t),a=this._getDracoAttributes(t,n);return{geometry_type:r,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:i,attributes:a}}_getDracoAttributes(t,r){let n={};for(let i=0;i<t.num_attributes();i++){let a=this.decoder.GetAttribute(t,i),o=this._getAttributeMetadata(t,i);n[a.unique_id()]={unique_id:a.unique_id(),attribute_type:a.attribute_type(),data_type:a.data_type(),num_components:a.num_components(),byte_offset:a.byte_offset(),byte_stride:a.byte_stride(),normalized:a.normalized(),attribute_index:i,metadata:o};let s=this._getQuantizationTransform(a,r);s&&(n[a.unique_id()].quantization_transform=s);let u=this._getOctahedronTransform(a,r);u&&(n[a.unique_id()].octahedron_transform=u)}return n}_getMeshData(t,r,n){let i=this._getMeshAttributes(r,t,n);if(!i.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(n.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:i,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:i,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:i}}_getMeshAttributes(t,r,n){let i={};for(let a of Object.values(t.attributes)){let o=this._deduceAttributeName(a,n);a.name=o;let{value:s,size:u}=this._getAttributeValues(r,a);i[o]={value:s,size:u,byteOffset:a.byte_offset,byteStride:a.byte_stride,normalized:a.normalized}}return i}_getTriangleListIndices(t){let n=t.num_faces()*3,i=n*RCt,a=this.draco._malloc(i);try{return this.decoder.GetTrianglesUInt32Array(t,i,a),new Uint32Array(this.draco.HEAPF32.buffer,a,n).slice()}finally{this.draco._free(a)}}_getTriangleStripIndices(t){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,r),MCt(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=PCt[r.data_type],i=r.num_components,o=t.num_points()*i,s=o*n.BYTES_PER_ELEMENT,u=jCt(this.draco,n),c,l=this.draco._malloc(s);try{let f=this.decoder.GetAttribute(t,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,f,u,s,l),c=new n(this.draco.HEAPF32.buffer,l,o).slice()}finally{this.draco._free(l)}return{value:c,size:i}}_deduceAttributeName(t,r){let n=t.unique_id;for(let[o,s]of Object.entries(r.extraAttributes||{}))if(s===n)return o;let i=t.attribute_type;for(let o in Q1e)if(this.draco[o]===i)return Q1e[o];let a=r.attributeNameEntry||"name";return t.metadata[a]?t.metadata[a].string:`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(t){let r=this.decoder.GetMetadata(t);return this._getDracoMetadata(r)}_getAttributeMetadata(t,r){let n=this.decoder.GetAttributeMetadata(t,r);return this._getDracoMetadata(n)}_getDracoMetadata(t){if(!t||!t.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(t);for(let i=0;i<n;i++){let a=this.metadataQuerier.GetEntryName(t,i);r[a]=this._getDracoMetadataField(t,a)}return r}_getDracoMetadataField(t,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,r,n);let i=LCt(n);return{int:this.metadataQuerier.GetIntEntry(t,r),string:this.metadataQuerier.GetStringEntry(t,r),double:this.metadataQuerier.GetDoubleEntry(t,r),intArray:i}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(t){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=t,i=[...r,...n];for(let a of i)this.decoder.SkipAttributeTransform(this.draco[a])}_getQuantizationTransform(t,r){let{quantizedAttributes:n=[]}=r,i=t.attribute_type();if(n.map(o=>this.decoder[o]).includes(i)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(t))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(t,r){let{octahedronAttributes:n=[]}=r,i=t.attribute_type();if(n.map(o=>this.decoder[o]).includes(i)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(t))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}};function jCt(e,t){switch(t){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 LCt(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function MCt(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}var qCt="1.5.6",NCt="1.4.1",H7=`https://www.gstatic.com/draco/versioned/decoders/${qCt}`,ii={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},Eh={[ii.DECODER]:`${H7}/${ii.DECODER}`,[ii.DECODER_WASM]:`${H7}/${ii.DECODER_WASM}`,[ii.FALLBACK_DECODER]:`${H7}/${ii.FALLBACK_DECODER}`,[ii.ENCODER]:`https://raw.githubusercontent.com/google/draco/${NCt}/javascript/${ii.ENCODER}`},r_;async function Z1e(e){let t=e.modules||{};return t.draco3d?r_=r_||t.draco3d.createDecoderModule({}).then(r=>({draco:r})):r_=r_||UCt(e),await r_}async function UCt(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await Qu(Eh[ii.FALLBACK_DECODER],"draco",e,ii.FALLBACK_DECODER);break;case"wasm":default:[t,r]=await Promise.all([await Qu(Eh[ii.DECODER],"draco",e,ii.DECODER),await Qu(Eh[ii.DECODER_WASM],"draco",e,ii.DECODER_WASM)])}return t=t||globalThis.DracoDecoderModule,await GCt(t,r)}function GCt(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e({...r,onModuleLoaded:i=>n({draco:i})})})}var W7={id:"draco-writer",name:"Draco compressed geometry writer",module:"draco",version:D8,worker:!0,options:{draco:{},source:null}};var xv={...V1e,parse:zCt};async function zCt(e,t){let{draco:r}=await Z1e(t),n=new t_(r);try{return n.parseSync(e,t==null?void 0:t.draco)}finally{n.destroy()}}var HCt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},vi={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},Ht={...HCt,...vi};var V7={[vi.DOUBLE]:Float64Array,[vi.FLOAT]:Float32Array,[vi.UNSIGNED_SHORT]:Uint16Array,[vi.UNSIGNED_INT]:Uint32Array,[vi.UNSIGNED_BYTE]:Uint8Array,[vi.BYTE]:Int8Array,[vi.SHORT]:Int16Array,[vi.INT]:Int32Array},WCt={DOUBLE:vi.DOUBLE,FLOAT:vi.FLOAT,UNSIGNED_SHORT:vi.UNSIGNED_SHORT,UNSIGNED_INT:vi.UNSIGNED_INT,UNSIGNED_BYTE:vi.UNSIGNED_BYTE,BYTE:vi.BYTE,SHORT:vi.SHORT,INT:vi.INT},K7="Failed to convert GL type",La=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in V7)if(V7[r]===t)return r;throw new Error(K7)}static fromName(t){let r=WCt[t];if(!r)throw new Error(K7);return r}static getArrayType(t){switch(t){case vi.UNSIGNED_SHORT_5_6_5:case vi.UNSIGNED_SHORT_4_4_4_4:case vi.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=V7[t];if(!r)throw new Error(K7);return r}}static getByteSize(t){return La.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(La.getArrayType(t))}static createTypedArray(t,r,n=0,i){i===void 0&&(i=(r.byteLength-n)/La.getByteSize(t));let a=La.getArrayType(t);return new a(r,n,i)}};function e_e(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function $7(e,t=[0,0,0]){let r=e>>11&31,n=e>>5&63,i=e&31;return t[0]=r<<3,t[1]=n<<2,t[2]=i<<3,t}var Yyr=1/256;var Jyr=new Td,Xyr=new ce,Qyr=new Td,Zyr=new Td,exr=new Uint8Array(1);function t_e(e,t=255){return n7(e,0,t)/t*2-1}function r_e(e){return e<0?-1:1}function n_e(e,t,r,n){if(e_e(n),e<0||e>r||t<0||t>r)throw new Error(`x and y must be unsigned normalized integers between 0 and ${r}`);if(n.x=t_e(e,r),n.y=t_e(t,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){let i=n.x;n.x=(1-Math.abs(n.y))*r_e(i),n.y=(1-Math.abs(i))*r_e(n.y)}return n.normalize()}function Y7(e,t,r){return n_e(e,t,255,r)}function kd(e){return(e%1+1)%1}var Bl=class{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(t,r){this.json=t,this.buffer=r}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t,r=Ht.UNSIGNED_INT,n=1){let i=this.json[t];return i&&Number.isFinite(i.byteOffset)?this._getTypedArrayFromBinary(t,r,n,1,i.byteOffset):i}getPropertyArray(t,r,n){let i=this.json[t];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(r=La.fromName(i.componentType)),this._getTypedArrayFromBinary(t,r,n,this.featuresLength,i.byteOffset)):this._getTypedArrayFromArray(t,r,i)}getProperty(t,r,n,i,a){let o=this.json[t];if(!o)return o;let s=this.getPropertyArray(t,r,n);if(n===1)return s[i];for(let u=0;u<n;++u)a[u]=s[n*i+u];return a}_getTypedArrayFromBinary(t,r,n,i,a){let o=this._cachedTypedArrays,s=o[t];return s||(s=La.createTypedArray(r,this.buffer.buffer,this.buffer.byteOffset+a,i*n),o[t]=s),s}_getTypedArrayFromArray(t,r,n){let i=this._cachedTypedArrays,a=i[t];return a||(a=La.createTypedArray(r,n),i[t]=a),a}};var VCt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},KCt={SCALAR:(e,t)=>e[t],VEC2:(e,t)=>[e[2*t+0],e[2*t+1]],VEC3:(e,t)=>[e[3*t+0],e[3*t+1],e[3*t+2]],VEC4:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT2:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT3:(e,t)=>[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]],MAT4:(e,t)=>[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]},$Ct={SCALAR:(e,t,r)=>{t[r]=e},VEC2:(e,t,r)=>{t[2*r+0]=e[0],t[2*r+1]=e[1]},VEC3:(e,t,r)=>{t[3*r+0]=e[0],t[3*r+1]=e[1],t[3*r+2]=e[2]},VEC4:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT2:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT3:(e,t,r)=>{t[9*r+0]=e[0],t[9*r+1]=e[1],t[9*r+2]=e[2],t[9*r+3]=e[3],t[9*r+4]=e[4],t[9*r+5]=e[5],t[9*r+6]=e[6],t[9*r+7]=e[7],t[9*r+8]=e[8],t[9*r+9]=e[9]},MAT4:(e,t,r)=>{t[16*r+0]=e[0],t[16*r+1]=e[1],t[16*r+2]=e[2],t[16*r+3]=e[3],t[16*r+4]=e[4],t[16*r+5]=e[5],t[16*r+6]=e[6],t[16*r+7]=e[7],t[16*r+8]=e[8],t[16*r+9]=e[9],t[16*r+10]=e[10],t[16*r+11]=e[11],t[16*r+12]=e[12],t[16*r+13]=e[13],t[16*r+14]=e[14],t[16*r+15]=e[15]}};function i_e(e,t,r,n){let{componentType:i}=e;Qt(e.componentType);let a=typeof i=="string"?La.fromName(i):i,o=VCt[e.type],s=KCt[e.type],u=$Ct[e.type];return r+=e.byteOffset,{values:La.createTypedArray(a,t,r,o*n),type:a,size:o,unpacker:s,packer:u}}var yc=e=>e!==void 0;function a_e(e,t,r){if(!t)return null;let n=e.getExtension("3DTILES_batch_table_hierarchy"),i=t.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?YCt(n,r):null}function YCt(e,t){let r,n,i,a=e.instancesLength,o=e.classes,s=e.classIds,u=e.parentCounts,c=e.parentIds,l=a;yc(s.byteOffset)&&(s.componentType=defaultValue(s.componentType,GL.UNSIGNED_SHORT),s.type=AttributeType.SCALAR,i=getBinaryAccessor(s),s=i.createArrayBufferView(t.buffer,t.byteOffset+s.byteOffset,a));let f;if(yc(u))for(yc(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,a)),f=new Uint16Array(a),l=0,r=0;r<a;++r)f[r]=l,l+=u[r];yc(c)&&yc(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,l));let h=o.length;for(r=0;r<h;++r){let g=o[r].length,x=o[r].instances,E=getBinaryProperties(g,x,t);o[r].instances=combine(E,x)}let p=new Array(h).fill(0),d=new Uint16Array(a);for(r=0;r<a;++r)n=s[r],d[r]=p[n],++p[n];let b={classes:o,classIds:s,classIndexes:d,parentCounts:u,parentIndexes:f,parentIds:c};return QCt(b),b}function _v(e,t,r){if(!e)return;let n=e.parentCounts;return e.parentIds?r(e,t):n>0?JCt(e,t,r):XCt(e,t,r)}function JCt(e,t,r){let n=e.classIds,i=e.parentCounts,a=e.parentIds,o=e.parentIndexes,s=n.length,u=scratchVisited;u.length=Math.max(u.length,s);let c=++marker,l=scratchStack;for(l.length=0,l.push(t);l.length>0;){if(t=l.pop(),u[t]===c)continue;u[t]=c;let f=r(e,t);if(yc(f))return f;let h=i[t],p=o[t];for(let d=0;d<h;++d){let b=a[p+d];b!==t&&l.push(b)}}return null}function XCt(e,t,r){let n=!0;for(;n;){let i=r(e,t);if(yc(i))return i;let a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}function QCt(e){let t=[],n=e.classIds.length;for(let i=0;i<n;++i)o_e(e,i,stack)}function o_e(e,t,r){let n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,s=e.classIds.length;if(!yc(i))return;assert(t<s,`Parent index ${t} exceeds the total number of instances: ${s}`),assert(r.indexOf(t)===-1,"Circular dependency detected in the batch table hierarchy."),r.push(t);let u=yc(n)?n[t]:1,c=yc(n)?a[t]:t;for(let l=0;l<u;++l){let f=i[c+l];f!==t&&o_e(e,f,r)}r.pop(t)}function po(e){return e!=null}var F8=(e,t)=>e,ZCt={HIERARCHY:!0,extensions:!0,extras:!0},Bd=class{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(t,r,n,i={}){var a;Qt(n>=0),this.json=t||{},this.binary=r,this.featureCount=n,this._extensions=((a=this.json)==null?void 0:a.extensions)||{},this._properties={};for(let o in this.json)ZCt[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),i["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=a_e(this,this.json,this.binary))}getExtension(t){return this.json&&this.json.extensions&&this.json.extensions[t]}memorySizeInBytes(){return 0}isClass(t,r){if(this._checkBatchId(t),Qt(typeof r=="string",r),this._hierarchy){let n=_v(this._hierarchy,t,(i,a)=>{let o=i.classIds[a];return i.classes[o].name===r});return po(n)}return!1}isExactClass(t,r){return Qt(typeof r=="string",r),this.getExactClassName(t)===r}getExactClassName(t){if(this._checkBatchId(t),this._hierarchy){let r=this._hierarchy.classIds[t];return this._hierarchy.classes[r].name}}hasProperty(t,r){return this._checkBatchId(t),Qt(typeof r=="string",r),po(this._properties[r])||this._hasPropertyInHierarchy(t,r)}getPropertyNames(t,r){this._checkBatchId(t),r=po(r)?r:[],r.length=0;let n=Object.keys(this._properties);return r.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(t,r),r}getProperty(t,r){if(this._checkBatchId(t),Qt(typeof r=="string",r),this._binaryProperties){let i=this._binaryProperties[r];if(po(i))return this._getBinaryProperty(i,t)}let n=this._properties[r];if(po(n))return F8(n[t],!0);if(this._hierarchy){let i=this._getHierarchyProperty(t,r);if(po(i))return i}}setProperty(t,r,n){let i=this.featureCount;if(this._checkBatchId(t),Qt(typeof r=="string",r),this._binaryProperties){let o=this._binaryProperties[r];if(o){this._setBinaryProperty(o,t,n);return}}if(this._hierarchy&&this._setHierarchyProperty(this,t,r,n))return;let a=this._properties[r];po(a)||(this._properties[r]=new Array(i),a=this._properties[r]),a[t]=F8(n,!0)}_checkBatchId(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(t,r){return t.unpack(t.typedArray,r)}_setBinaryProperty(t,r,n){t.pack(n,t.typedArray,r)}_initializeBinaryProperties(){let t=null;for(let r in this._properties){let n=this._properties[r],i=this._initializeBinaryProperty(r,n);i&&(t=t||{},t[r]=i)}return t}_initializeBinaryProperty(t,r){if("byteOffset"in r){let n=r;Qt(this.binary,`Property ${t} requires a batch table binary.`),Qt(n.type,`Property ${t} requires a type.`);let i=i_e(n,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:i.values,componentCount:i.size,unpack:i.unpacker,pack:i.packer}}return null}_hasPropertyInHierarchy(t,r){if(!this._hierarchy)return!1;let n=_v(this._hierarchy,t,(i,a)=>{let o=i.classIds[a],s=i.classes[o].instances;return po(s[r])});return po(n)}_getPropertyNamesInHierarchy(t,r){_v(this._hierarchy,t,(n,i)=>{let a=n.classIds[i],o=n.classes[a].instances;for(let s in o)o.hasOwnProperty(s)&&r.indexOf(s)===-1&&r.push(s)})}_getHierarchyProperty(t,r){return _v(this._hierarchy,t,(n,i)=>{let a=n.classIds[i],o=n.classes[a],s=n.classIndexes[i],u=o.instances[r];return po(u)?po(u.typedArray)?this._getBinaryProperty(u,s):F8(u[s],!0):null})}_setHierarchyProperty(t,r,n,i){let a=_v(this._hierarchy,r,(o,s)=>{let u=o.classIds[s],c=o.classes[u],l=o.classIndexes[s],f=c.instances[n];return po(f)?(Qt(s===r,`Inherited property "${n}" is read-only.`),po(f.typedArray)?this._setBinaryProperty(f,l,i):f[l]=F8(i,!0),!0):!1});return po(a)}};var J7=4;function Ah(e,t,r=0){let n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=J7,e.version=n.getUint32(r,!0),r+=J7,e.byteLength=n.getUint32(r,!0),r+=J7,e.version!==1)throw new Error(`3D Tile Version ${e.version} not supported`);return r}var wv=4,s_e="b3dm tile in legacy format.";function Ev(e,t,r){let n=new DataView(t),i;e.header=e.header||{};let a=n.getUint32(r,!0);r+=wv;let o=n.getUint32(r,!0);r+=wv;let s=n.getUint32(r,!0);r+=wv;let u=n.getUint32(r,!0);return r+=wv,s>=570425344?(r-=wv*2,i=a,s=o,u=0,a=0,o=0,console.warn(s_e)):u>=570425344&&(r-=wv,i=s,s=a,u=o,a=0,o=0,console.warn(s_e)),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=u,e.header.batchLength=i,r}function Av(e,t,r,n){return r=e8t(e,t,r,n),r=t8t(e,t,r,n),r}function e8t(e,t,r,n){let{featureTableJsonByteLength:i,featureTableBinaryByteLength:a,batchLength:o}=e.header||{};if(e.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){let s=U7(t,r,i);e.featureTableJson=JSON.parse(s)}return r+=i||0,e.featureTableBinary=new Uint8Array(t,r,a),r+=a||0,r}function t8t(e,t,r,n){let{batchTableJsonByteLength:i,batchTableBinaryByteLength:a}=e.header||{};if(i&&i>0){let o=U7(t,r,i);e.batchTableJson=JSON.parse(o),r+=i,a&&a>0&&(e.batchTableBinary=new Uint8Array(t,r,a),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=a)}return r}function X7(e,t,r){if(!t&&(!e||!e.batchIds||!r))return null;let{batchIds:n,isRGB565:i,pointCount:a=0}=e;if(n&&r){let o=new Uint8ClampedArray(a*3);for(let s=0;s<a;s++){let u=n[s],l=r.getProperty(u,"dimensions").map(f=>f*255);o[s*3]=l[0],o[s*3+1]=l[1],o[s*3+2]=l[2]}return{type:Ht.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}if(t&&i){let o=new Uint8ClampedArray(a*3);for(let s=0;s<a;s++){let u=$7(t[s]);o[s*3]=u[0],o[s*3+1]=u[1],o[s*3+2]=u[2]}return{type:Ht.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}return t&&t.length===a*3?{type:Ht.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:Ht.UNSIGNED_BYTE,value:t||new Uint8ClampedArray,size:4,normalized:!0}}var u_e=new ce;function c_e(e,t){if(!t)return null;if(e.isOctEncoded16P){let r=new Float32Array((e.pointsLength||0)*3);for(let n=0;n<(e.pointsLength||0);n++)Y7(t[n*2],t[n*2+1],u_e),u_e.toArray(r,n*3);return{type:Ht.FLOAT,size:2,value:r}}return{type:Ht.FLOAT,size:2,value:t}}function l_e(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,r8t(e,t)):{type:Ht.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function r8t(e,t){let r=new ce,n=new Float32Array(e.pointCount*3);for(let i=0;i<e.pointCount;i++)r.set(t[i*3],t[i*3+1],t[i*3+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,i*3);return n}async function f_e(e,t,r,n,i){r=Ah(e,t,r),r=Ev(e,t,r),r=Av(e,t,r,n),n8t(e);let{featureTable:a,batchTable:o}=i8t(e);return await c8t(e,a,o,n,i),a8t(e,a,n),o8t(e,a,o),s8t(e,a),r}function n8t(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function i8t(e){let t=new Bl(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3);let n=u8t(e,t);return{featureTable:t,batchTable:n}}function a8t(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.positions){if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",Ht.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){let n=t.getPropertyArray("POSITION_QUANTIZED",Ht.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=(1<<16)-1,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Ht.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Ht.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=l_e(e,n,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function o8t(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.colors){let n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",Ht.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",Ht.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",Ht.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=X7(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",Ht.UNSIGNED_BYTE,4))}function s8t(e,t){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.normals){let r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",Ht.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",Ht.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=c_e(e,r)}}function u8t(e,t){let r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",Ht.UNSIGNED_SHORT,1),e.batchIds)){let n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");let{batchTableJson:i,batchTableBinary:a}=e;r=new Bd(i,a,n)}return r}async function c8t(e,t,r,n,i){let a,o,s,u=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];u&&(s=u.properties);let c=t.getExtension("3DTILES_draco_point_compression");if(c){o=c.properties;let f=c.byteOffset,h=c.byteLength;if(!o||!Number.isFinite(f)||!h)throw new Error("Draco properties, byteOffset, and byteLength must be defined");a=(e.featureTableBinary||[]).slice(f,f+h),e.hasPositions=Number.isFinite(o.POSITION),e.hasColors=Number.isFinite(o.RGB)||Number.isFinite(o.RGBA),e.hasNormals=Number.isFinite(o.NORMAL),e.hasBatchIds=Number.isFinite(o.BATCH_ID),e.isTranslucent=Number.isFinite(o.RGBA)}if(!a)return!0;let l={buffer:a,properties:{...o,...s},featureTableProperties:o,batchTableProperties:s,dequantizeInShader:!1};return await l8t(e,l,n,i)}async function l8t(e,t,r,n){if(!n)return;let i={...r,draco:{...r==null?void 0:r.draco,extraAttributes:t.batchTableProperties||{}}};delete i["3d-tiles"];let a=await So(t.buffer,xv,i,n),o=a.attributes.POSITION&&a.attributes.POSITION.value,s=a.attributes.COLOR_0&&a.attributes.COLOR_0.value,u=a.attributes.NORMAL&&a.attributes.NORMAL.value,c=a.attributes.BATCH_ID&&a.attributes.BATCH_ID.value,l=o&&a.attributes.POSITION.value.quantization,f=u&&a.attributes.NORMAL.value.quantization;if(l){let p=a.POSITION.data.quantization,d=p.range;e.quantizedVolumeScale=new ce(d,d,d),e.quantizedVolumeOffset=new ce(p.minValues),e.quantizedRange=(1<<p.quantizationBits)-1,e.isQuantizedDraco=!0}f&&(e.octEncodedRange=(1<<a.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);let h={};if(t.batchTableProperties)for(let p of Object.keys(t.batchTableProperties))a.attributes[p]&&a.attributes[p].value&&(h[p.toLowerCase()]=a.attributes[p].value);e.attributes={positions:o,colors:X7(e,s,void 0),normals:u,batchIds:c,...h}}var oq={};ca(oq,{decode:()=>Y8t,name:()=>N8});var k8="4.0.0-beta.8";var h_e,f8t=(h_e=globalThis.loaders)==null?void 0:h_e.parseImageNode,Q7=typeof Image<"u",Z7=typeof ImageBitmap<"u",h8t=Boolean(f8t),eq=gn?!0:h8t;function p_e(e){switch(e){case"auto":return Z7||Q7||eq;case"imagebitmap":return Z7;case"image":return Q7;case"data":return eq;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function d_e(){if(Z7)return"imagebitmap";if(Q7)return"image";if(eq)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function m_e(e){let t=p8t(e);if(!t)throw new Error("Not an image");return t}function tq(e){return Sv(e)}function Sv(e){switch(m_e(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function p8t(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 d8t=/^data:image\/svg\+xml/,m8t=/\.svg((\?|#).*)?$/;function B8(e){return e&&(d8t.test(e)||m8t.test(e))}function g_e(e,t){if(B8(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(a){throw new Error(a.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return rq(e,t)}function rq(e,t){if(B8(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function O8(e,t,r){let n=g_e(e,r),i=self.URL||self.webkitURL,a=typeof n!="string"&&i.createObjectURL(n);try{return await g8t(a||n,t)}finally{a&&i.revokeObjectURL(a)}}async function g8t(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,i)=>{try{r.onload=()=>n(r),r.onerror=a=>i(new Error(`Could not load image ${e}: ${a}`))}catch(a){i(a)}})}var v8t={},v_e=!0;async function b_e(e,t,r){let n;B8(r)?n=await O8(e,t,r):n=rq(e,r);let i=t&&t.imagebitmap;return await b8t(n,i)}async function b8t(e,t=null){if((y8t(t)||!v_e)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),v_e=!1}return await createImageBitmap(e)}function y8t(e){for(let t in e||v8t)return!1;return!0}function y_e(e){return!E8t(e,"ftyp",4)||!(e[8]&96)?null:x8t(e)}function x8t(e){switch(_8t(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function _8t(e,t,r){return String.fromCharCode(...e.slice(t,r))}function w8t(e){return[...e].map(t=>t.charCodeAt(0))}function E8t(e,t,r=0){let n=w8t(t);for(let i=0;i<n.length;++i)if(n[i]!==e[i+r])return!1;return!0}var xc=!1,n_=!0;function Od(e){let t=i_(e);return S8t(t)||D8t(t)||T8t(t)||C8t(t)||A8t(t)}function A8t(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=y_e(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function S8t(e){let t=i_(e);return t.byteLength>=24&&t.getUint32(0,xc)===2303741511?{mimeType:"image/png",width:t.getUint32(16,xc),height:t.getUint32(20,xc)}:null}function T8t(e){let t=i_(e);return t.byteLength>=10&&t.getUint32(0,xc)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,n_),height:t.getUint16(8,n_)}:null}function C8t(e){let t=i_(e);return t.byteLength>=14&&t.getUint16(0,xc)===16973&&t.getUint32(2,n_)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,n_),height:t.getUint32(22,n_)}:null}function D8t(e){let t=i_(e);if(!(t.byteLength>=3&&t.getUint16(0,xc)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=F8t(),a=2;for(;a+9<t.byteLength;){let o=t.getUint16(a,xc);if(i.has(o))return{mimeType:"image/jpeg",height:t.getUint16(a+5,xc),width:t.getUint16(a+7,xc)};if(!n.has(o))return null;a+=2,a+=t.getUint16(a,xc)}return null}function F8t(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function i_(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 x_e(e,t){var i;let{mimeType:r}=Od(e)||{},n=(i=globalThis.loaders)==null?void 0:i.parseImageNode;return Qt(n),await n(e,r)}async function __e(e,t,r){t=t||{};let i=(t.image||{}).type||"auto",{url:a}=r||{},o=k8t(i),s;switch(o){case"imagebitmap":s=await b_e(e,t,a);break;case"image":s=await O8(e,t,a);break;case"data":s=await x_e(e,t);break;default:Qt(!1)}return i==="data"&&(s=Sv(s)),s}function k8t(e){switch(e){case"auto":case"data":return d_e();default:return p_e(e),e}}var B8t=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],O8t=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],I8t={image:{type:"auto",decode:!0}},Tv={id:"image",module:"images",name:"Images",version:k8,mimeTypes:O8t,extensions:B8t,parse:__e,tests:[e=>Boolean(Od(new DataView(e)))],options:I8t};var A_e,w_e=(A_e=globalThis.loaders)==null?void 0:A_e.encodeImageNode;async function S_e(e,t){return t=t||{},t.image=t.image||{},w_e?w_e(e,{type:t.image.mimeType}):P8t(e,t)}var E_e=!0;async function P8t(e,t){let{mimeType:r,jpegQuality:n}=t.image,{width:i,height:a}=tq(e),o=document.createElement("canvas");o.width=i,o.height=a,R8t(e,o);let s=await new Promise(u=>{if(n&&E_e)try{o.toBlob(u,r,n);return}catch{E_e=!1}o.toBlob(u,r)});if(!s)throw new Error("image encoding failed");return await s.arrayBuffer()}function R8t(e,t,r=0,n=0){if(r===0&&n===0&&typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let a=t.getContext("bitmaprenderer");if(a)return a.transferFromImageBitmap(e),t}let i=t.getContext("2d");if(e.data){let a=new Uint8ClampedArray(e.data),o=new ImageData(a,e.width,e.height);return i.putImageData(o,0,0),t}return i.drawImage(e,0,0),t}var nq={name:"Images",id:"image",module:"images",version:k8,extensions:["jpeg"],options:{image:{mimeType:"image/png",jpegQuality:null}},encode:S_e};var iq={};function aq(e){if(iq[e]===void 0){let t=gn?L8t(e):j8t(e);iq[e]=t}return iq[e]}function j8t(e){var i,a;let t=["image/png","image/jpeg","image/gif"],r=((i=globalThis.loaders)==null?void 0:i.imageFormatsNode)||t,n=(a=globalThis.loaders)==null?void 0:a.parseImageNode;return Boolean(n)&&r.includes(e)}function L8t(e){switch(e){case"image/avif":case"image/webp":return M8t(e);default:return!0}}function M8t(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}function Ni(e,t){if(!e)throw new Error(t||"assert failed: gltf")}var I8={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},P8={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var q8t=1.33,T_e=["SCALAR","VEC2","VEC3","VEC4"],N8t=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],U8t=new Map(N8t),G8t={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},z8t={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},H8t={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function R8(e){return T_e[e-1]||T_e[0]}function Cv(e){let t=U8t.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Dv(e,t){let r=H8t[e.componentType],n=G8t[e.type],i=z8t[e.componentType],a=e.count*n,o=e.count*n*i;Ni(o>=0&&o<=t.byteLength);let s=P8[e.componentType],u=I8[e.type];return{ArrayType:r,length:a,byteLength:o,componentByteSize:s,numberOfComponentsInElement:u}}function a_(e){let{images:t,bufferViews:r}=e;t=t||[],r=r||[];let n=t.map(o=>o.bufferView);r=r.filter(o=>!n.includes(o));let i=r.reduce((o,s)=>o+s.byteLength,0),a=t.reduce((o,s)=>{let{width:u,height:c}=s.image;return o+u*c},0);return i+Math.ceil(4*a*q8t)}function C_e(e,t,r){let n=e.bufferViews[r];Ni(n);let i=n.buffer,a=t[i];Ni(a);let o=(n.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,o,n.byteLength)}function D_e(e,t,r){var b,g;let n=typeof r=="number"?(b=e.accessors)==null?void 0:b[r]:r;if(!n)throw new Error(`No gltf accessor ${r}`);let i=(g=e.bufferViews)==null?void 0:g[n.bufferView||0];if(!i)throw new Error(`No gltf buffer view for accessor ${i}`);let{arrayBuffer:a,byteOffset:o}=t[i.buffer],s=(o||0)+(n.byteOffset||0)+(i.byteOffset||0),{ArrayType:u,length:c,componentByteSize:l,numberOfComponentsInElement:f}=Dv(n,i),h=l*f,p=i.byteStride||h;if(typeof i.byteStride>"u"||i.byteStride===h)return new u(a,s,c);let d=new u(c);for(let x=0;x<n.count;x++){let E=new u(a,s+x*p,f);d.set(E,x*f)}return d}function W8t(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var qr=class{gltf;sourceBuffers;byteLength;constructor(t){this.gltf={json:(t==null?void 0:t.json)||W8t(),buffers:(t==null?void 0:t.buffers)||[],images:(t==null?void 0:t.images)||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}hasExtension(t){let r=this.getUsedExtensions().find(i=>i===t),n=this.getRequiredExtensions().find(i=>i===t);return typeof r=="string"||typeof n=="string"}getExtension(t){let r=this.getUsedExtensions().find(i=>i===t),n=this.json.extensions||{};return r?n[t]:null}getRequiredExtension(t){return this.getRequiredExtensions().find(n=>n===t)?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(t,r){return(t.extensions||{})[r]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,r){if(typeof r=="object")return r;let n=this.json[t]&&this.json[t][r];if(!n)throw new Error(`glTF file error: Could not find ${t}[${r}]`);return n}getTypedArrayForBufferView(t){t=this.getBufferView(t);let r=t.buffer,n=this.gltf.buffers[r];Ni(n);let i=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,i,t.byteLength)}getTypedArrayForAccessor(t){let r=this.getAccessor(t);return D_e(this.gltf.json,this.gltf.buffers,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);let r=this.getBufferView(t.bufferView),i=this.getBuffer(r.buffer).data,a=r.byteOffset||0;return new Uint8Array(i,a,r.byteLength)}addApplicationData(t,r){return this.json[t]=r,this}addExtraData(t,r){return this.json.extras=this.json.extras||{},this.json.extras[t]=r,this}addObjectExtension(t,r,n){return t.extensions=t.extensions||{},t.extensions[r]=n,this.registerUsedExtension(r),this}setObjectExtension(t,r,n){let i=t.extensions||{};i[r]=n}removeObjectExtension(t,r){let n=(t==null?void 0:t.extensions)||{};if(n[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let i=this.json.extensionsRemoved;i.includes(r)||i.push(r)}delete n[r]}addExtension(t,r={}){return Ni(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return Ni(r),this.addExtension(t,r),this.registerRequiredExtension(t),r}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===t)||this.json.extensionsRequired.push(t)}removeExtension(t){var r;if((r=this.json.extensions)!=null&&r[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let n=this.json.extensionsRemoved;n.includes(t)||n.push(t)}this.json.extensions&&delete this.json.extensions[t],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t)}setDefaultScene(t){this.json.scene=t}addScene(t){let{nodeIndices:r}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(t){let{meshIndex:r,matrix:n}=t;this.json.nodes=this.json.nodes||[];let i={mesh:r};return n&&(i.matrix=n),this.json.nodes.push(i),this.json.nodes.length-1}addMesh(t){let{attributes:r,indices:n,material:i,mode:a=4}=t,s={primitives:[{attributes:this._addAttributes(r),mode:a}]};if(n){let u=this._addIndices(n);s.primitives[0].indices=u}return Number.isFinite(i)&&(s.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(s),this.json.meshes.length-1}addPointCloud(t){let n={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(t,r){let n=Od(t),i=r||(n==null?void 0:n.mimeType),o={bufferView:this.addBufferView(t),mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(t,r=0,n=this.byteLength){let i=t.byteLength;Ni(Number.isFinite(i)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let a={buffer:r,byteOffset:n,byteLength:i};return this.byteLength+=Co(i,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(a),this.json.bufferViews.length-1}addAccessor(t,r){let n={bufferView:t,type:R8(r.size),componentType:r.componentType,count:r.count,max:r.max,min:r.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(t,r={size:3}){let n=this.addBufferView(t),i={min:r.min,max:r.max};(!i.min||!i.max)&&(i=this._getAccessorMinMax(t,r.size));let a={size:r.size,componentType:Cv(t),count:Math.round(t.length/r.size),min:i.min,max:i.max};return this.addAccessor(n,Object.assign(a,r))}addTexture(t){let{imageIndex:r}=t,n={source:r};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var a,o;this.gltf.buffers=[];let t=this.byteLength,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;for(let s of this.sourceBuffers||[])i=GI(s,n,i);(o=(a=this.json)==null?void 0:a.buffers)!=null&&o[0]?this.json.buffers[0].byteLength=t:this.json.buffers=[{byteLength:t}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(t,r){let n=!0;for(;n;){let i=t.indexOf(r);i>-1?t.splice(i,1):n=!1}}_addAttributes(t={}){let r={};for(let n in t){let i=t[n],a=this._getGltfAttributeName(n),o=this.addBinaryBuffer(i.value,i);r[a]=o}return r}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,r){let n={min:null,max:null};if(t.length<r)return n;n.min=[],n.max=[];let i=t.subarray(0,r);for(let a of i)n.min.push(a),n.max.push(a);for(let a=r;a<t.length;a+=r)for(let o=0;o<r;o++)n.min[0+o]=Math.min(n.min[0+o],t[a+o]),n.max[0+o]=Math.max(n.max[0+o],t[a+o]);return n}};var F_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},V8t={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},k_e={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function o_(e,t){return k_e[t]*F_e[e]}function Fv(e,t,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let i=e.getTypedArrayForBufferView(t),a=kv(i,"SCALAR",r,n+1);return a instanceof BigInt64Array||a instanceof BigUint64Array?null:a}function kv(e,t,r,n=1){let i=F_e[t],a=V8t[r],o=k_e[r],s=n*i,u=s*o,c=e.buffer,l=e.byteOffset;return l%o!==0&&(c=new Uint8Array(c).slice(l,l+u).buffer,l=0),new a(c,l,s)}function Bv(e,t,r){var c,l,f,h,p;let n=`TEXCOORD_${t.texCoord||0}`,i=r.attributes[n],a=e.getTypedArrayForAccessor(i),o=e.gltf.json,s=t.index,u=(l=(c=o.textures)==null?void 0:c[s])==null?void 0:l.source;if(typeof u<"u"){let d=(h=(f=o.images)==null?void 0:f[u])==null?void 0:h.mimeType,b=(p=e.gltf.images)==null?void 0:p[u];if(b&&typeof b.width<"u"){let g=[];for(let x=0;x<a.length;x+=2){let E=K8t(b,d,a,x,t.channels);g.push(E)}return g}}return[]}function j8(e,t,r,n,i){if(!(r!=null&&r.length))return;let a=[];for(let l of r){let f=n.findIndex(h=>h===l);f===-1&&(f=n.push(l)-1),a.push(f)}let o=new Uint32Array(a),s=e.gltf.buffers.push({arrayBuffer:o.buffer,byteOffset:o.byteOffset,byteLength:o.byteLength})-1,u=e.addBufferView(o,s,0),c=e.addAccessor(u,{size:1,componentType:Cv(o),count:o.length});i.attributes[t]=c}function K8t(e,t,r,n,i=[0]){let a={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=r[n],s=r[n+1],u=1;t&&(t.indexOf("image/jpeg")!==-1||t.indexOf("image/png")!==-1)&&(u=4);let c=$8t(o,s,e,u),l=0;for(let f of i){let h=typeof f=="number"?Object.values(a)[f]:a[f],p=c+h.offset,d=Sv(e);if(d.data.length<=p)throw new Error(`${d.data.length} <= ${p}`);let b=d.data[p];l|=b<<h.shift}return l}function $8t(e,t,r,n=1){let i=r.width,a=kd(e)*(i-1),o=Math.round(a),s=r.height,u=kd(t)*(s-1),c=Math.round(u),l=r.components?r.components:n;return(c*i+o)*l}function L8(e,t,r,n,i){let a=[];for(let o=0;o<t;o++){let s=r[o],u=r[o+1]-r[o];if(u+s>n)break;let c=s/i,l=u/i;a.push(e.slice(c,c+l))}return a}function M8(e,t,r){let n=[];for(let i=0;i<t;i++){let a=i*r;n.push(e.slice(a,a+r))}return n}function q8(e,t,r,n){if(r)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){let i=[],a=new TextDecoder("utf8"),o=0;for(let s=0;s<e;s++){let u=n[s+1]-n[s];if(u+o<=t.length){let c=t.subarray(o,u+o),l=a.decode(c);i.push(l),o+=u}}return i}return[]}var B_e="EXT_mesh_features",N8=B_e;async function Y8t(e,t){let r=new qr(e);J8t(r,t)}function J8t(e,t){let r=e.gltf.json;if(r.meshes)for(let n of r.meshes)for(let i of n.primitives)X8t(e,i,t)}function X8t(e,t,r){var a,o,s;if(!((a=r==null?void 0:r.gltf)!=null&&a.loadBuffers))return;let n=(o=t.extensions)==null?void 0:o[B_e],i=n==null?void 0:n.featureIds;if(i)for(let u of i){let c;if(typeof u.attribute<"u"){let l=`_FEATURE_ID_${u.attribute}`,f=t.attributes[l];c=e.getTypedArrayForAccessor(f)}else typeof u.texture<"u"&&((s=r==null?void 0:r.gltf)!=null&&s.loadImages)?c=Bv(e,u.texture,t):c=[];u.data=c}}var cq={};ca(cq,{decode:()=>Q8t,name:()=>Ol});var sq="EXT_structural_metadata",Ol=sq;async function Q8t(e,t){let r=new qr(e);Z8t(r,t)}function Z8t(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(sq);r&&((i=t.gltf)!=null&&i.loadImages&&eDt(e,r),tDt(e,r))}function eDt(e,t){let r=t.propertyTextures,n=e.gltf.json;if(r&&n.meshes)for(let i of n.meshes)for(let a of i.primitives)nDt(e,r,a,t)}function tDt(e,t){let r=t.schema;if(!r)return;let n=r.classes,i=t.propertyTables;if(n&&i)for(let a in n){let o=rDt(i,a);o&&aDt(e,r,o)}}function rDt(e,t){for(let r of e)if(r.class===t)return r;return null}function nDt(e,t,r,n){var o;if(!t)return;let i=(o=r.extensions)==null?void 0:o[sq],a=i==null?void 0:i.propertyTextures;if(a)for(let s of a){let u=t[s];iDt(e,u,r,n)}}function iDt(e,t,r,n){var a;if(!t.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let i=t.class;for(let o in t.properties){let s=`${i}_${o}`,u=(a=t.properties)==null?void 0:a[o];if(!u)continue;u.data||(u.data=[]);let c=u.data,l=Bv(e,u,r);l!==null&&(j8(e,s,l,c,r),u.data=c,n.dataAttributeNames.push(s))}}function aDt(e,t,r){var a,o;let n=(a=t.classes)==null?void 0:a[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let i=r.count;for(let s in n.properties){let u=n.properties[s],c=(o=r.properties)==null?void 0:o[s];if(c){let l=oDt(e,t,u,i,c);c.data=l}}}function oDt(e,t,r,n,i){let a=[],o=i.values,s=e.getTypedArrayForBufferView(o),u=sDt(e,r,i,n),c=uDt(e,i,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{a=cDt(r,n,s,u);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{a=q8(n,s,u,c);break}case"ENUM":{a=lDt(t,r,n,s,u);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return a}function sDt(e,t,r,n){return t.array&&typeof t.count>"u"&&typeof r.arrayOffsets<"u"?Fv(e,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function uDt(e,t,r){return typeof t.stringOffsets<"u"?Fv(e,t.stringOffsets,t.stringOffsetType||"UINT32",r):null}function cDt(e,t,r,n){let i=e.array,a=e.count,o=o_(e.type,e.componentType),s=r.byteLength/o,u;return e.componentType?u=kv(r,e.type,e.componentType,s):u=r,i?n?L8(u,t,n,r.length,o):a?M8(u,t,a):[]:u}function lDt(e,t,r,n,i){var f;let a=t.enumType;if(!a)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let o=(f=e.enums)==null?void 0:f[a];if(!o)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${a}`);let s=o.valueType||"UINT16",u=o_(t.type,s),c=n.byteLength/u,l=kv(n,t.type,s,c);if(l||(l=n),t.array){if(i)return fDt({valuesData:l,numberOfElements:r,arrayOffsets:i,valuesDataBytesLength:n.length,elementSize:u,enumEntry:o});let h=t.count;return h?hDt(l,r,h,o):[]}return uq(l,0,r,o)}function fDt(e){let{valuesData:t,numberOfElements:r,arrayOffsets:n,valuesDataBytesLength:i,elementSize:a,enumEntry:o}=e,s=[];for(let u=0;u<r;u++){let c=n[u],l=n[u+1]-n[u];if(l+c>i)break;let f=c/a,h=l/a,p=uq(t,f,h,o);s.push(p)}return s}function hDt(e,t,r,n){let i=[];for(let a=0;a<t;a++){let o=r*a,s=uq(e,o,r,n);i.push(s)}return i}function uq(e,t,r,n){let i=[];for(let a=0;a<r;a++)if(e instanceof BigInt64Array||e instanceof BigUint64Array)i.push("");else{let o=e[t+a],s=pDt(n,o);s?i.push(s.name):i.push("")}return i}function pDt(e,t){for(let r of e.values)if(r.value===t)return r;return null}var lq={};ca(lq,{decode:()=>dDt,name:()=>gs});var O_e="EXT_feature_metadata",gs=O_e;async function dDt(e,t){let r=new qr(e);mDt(r,t)}function mDt(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(O_e);r&&((i=t.gltf)!=null&&i.loadImages&&gDt(e,r),vDt(e,r))}function gDt(e,t){let r=t.schema;if(!r)return;let n=r.classes,{featureTextures:i}=t;if(n&&i)for(let a in n){let o=n[a],s=yDt(i,a);s&&_Dt(e,s,o)}}function vDt(e,t){let r=t.schema;if(!r)return;let n=r.classes,i=t.featureTables;if(n&&i)for(let a in n){let o=bDt(i,a);o&&xDt(e,r,o)}}function bDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function yDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function xDt(e,t,r){var a,o;if(!r.class)return;let n=(a=t.classes)==null?void 0:a[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let i=r.count;for(let s in n.properties){let u=n.properties[s],c=(o=r.properties)==null?void 0:o[s];if(c){let l=wDt(e,t,u,i,c);c.data=l}}}function _Dt(e,t,r){var i;let n=t.class;for(let a in r.properties){let o=(i=t==null?void 0:t.properties)==null?void 0:i[a];if(o){let s=CDt(e,o,n);o.data=s}}}function wDt(e,t,r,n,i){let a=[],o=i.bufferView,s=e.getTypedArrayForBufferView(o),u=EDt(e,r,i,n),c=ADt(e,r,i,n);return r.type==="STRING"||r.componentType==="STRING"?a=q8(n,s,u,c):SDt(r)&&(a=TDt(r,n,s,u)),a}function EDt(e,t,r,n){return t.type==="ARRAY"&&typeof t.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?Fv(e,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function ADt(e,t,r,n){return typeof r.stringOffsetBufferView<"u"?Fv(e,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function SDt(e){let t=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return t.includes(e.type)||typeof e.componentType<"u"&&t.includes(e.componentType)}function TDt(e,t,r,n){let i=e.type==="ARRAY",a=e.componentCount,o="SCALAR",s=e.componentType||e.type,u=o_(o,s),c=r.byteLength/u,l=kv(r,o,s,c);return i?n?L8(l,t,n,r.length,u):a?M8(l,t,a):[]:l}function CDt(e,t,r){let n=e.gltf.json;if(!n.meshes)return[];let i=[];for(let a of n.meshes)for(let o of a.primitives)DDt(e,r,t,i,o);return i}function DDt(e,t,r,n,i){let a={channels:r.channels,...r.texture},o=Bv(e,a,i);o&&j8(e,t,o,n,i)}var U8="4.0.0-beta.8";var Ov="4.0.0-beta.8";var _c={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},fq;async function pq(e){let t=e.modules||{};return t.basis?t.basis:(fq=fq||FDt(e),await fq)}async function FDt(e){let t=null,r=null;return[t,r]=await Promise.all([await Qu(_c.TRANSCODER,"textures",e),await Qu(_c.TRANSCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await kDt(t,r)}function kDt(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(i=>{let{BasisFile:a,initializeBasis:o}=i;o(),n({BasisFile:a})})})}var hq;async function dq(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:(hq=hq||BDt(e),await hq)}async function BDt(e){let t=null,r=null;return[t,r]=await Promise.all([await Qu(_c.ENCODER,"textures",e),await Qu(_c.ENCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await ODt(t,r)}function ODt(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(i=>{let{BasisFile:a,KTX2File:o,initializeBasis:s,BasisEncoder:u}=i;s(),n({BasisFile:a,KTX2File:o,BasisEncoder:u})})})}var ke={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 IDt=["","WEBKIT_","MOZ_"],I_e={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"},G8=null;function s_(e){if(!G8){e=e||PDt()||void 0,G8=new Set;for(let t of IDt)for(let r in I_e)if(e&&e.getExtension(`${t}${r}`)){let n=I_e[r];G8.add(n)}}return G8}function PDt(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var W_e=$t(z_e(),1);function Iv(e,t){let r=new Array(t.mipMapLevels),n=t.width,i=t.height,a=0;for(let o=0;o<t.mipMapLevels;++o){let s=LDt(t,n,i,e,o),u=jDt(e,o,a,s);r[o]={compressed:!0,format:t.internalFormat,data:u,width:n,height:i,levelSize:s},n=Math.max(1,n>>1),i=Math.max(1,i>>1),a+=s}return r}function jDt(e,t,r,n){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,n)}function LDt(e,t,r,n,i){return Array.isArray(n)?e.sizeFunction(n[i]):e.sizeFunction(t,r)}var MDt={131:ke.COMPRESSED_RGB_S3TC_DXT1_EXT,132:ke.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:ke.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:ke.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:ke.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:ke.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:ke.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:ke.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:ke.COMPRESSED_RED_RGTC1_EXT,140:ke.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:ke.COMPRESSED_RED_GREEN_RGTC2_EXT,142:ke.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:ke.COMPRESSED_RGB8_ETC2,148:ke.COMPRESSED_SRGB8_ETC2,149:ke.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:ke.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:ke.COMPRESSED_RGBA8_ETC2_EAC,152:ke.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:ke.COMPRESSED_R11_EAC,154:ke.COMPRESSED_SIGNED_R11_EAC,155:ke.COMPRESSED_RG11_EAC,156:ke.COMPRESSED_SIGNED_RG11_EAC,157:ke.COMPRESSED_RGBA_ASTC_4x4_KHR,158:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:ke.COMPRESSED_RGBA_ASTC_5x4_KHR,160:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:ke.COMPRESSED_RGBA_ASTC_5x5_KHR,162:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:ke.COMPRESSED_RGBA_ASTC_6x5_KHR,164:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:ke.COMPRESSED_RGBA_ASTC_6x6_KHR,166:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:ke.COMPRESSED_RGBA_ASTC_8x5_KHR,168:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:ke.COMPRESSED_RGBA_ASTC_8x6_KHR,170:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:ke.COMPRESSED_RGBA_ASTC_8x8_KHR,172:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:ke.COMPRESSED_RGBA_ASTC_10x5_KHR,174:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:ke.COMPRESSED_RGBA_ASTC_10x6_KHR,176:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:ke.COMPRESSED_RGBA_ASTC_10x8_KHR,178:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:ke.COMPRESSED_RGBA_ASTC_10x10_KHR,180:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:ke.COMPRESSED_RGBA_ASTC_12x10_KHR,182:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:ke.COMPRESSED_RGBA_ASTC_12x12_KHR,184:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:ke.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:ke.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:ke.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:ke.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:ke.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:ke.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:ke.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:ke.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:ke.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:ke.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:ke.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:ke.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:ke.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:ke.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:ke.COMPRESSED_RGBA_ASTC_12x12_KHR};function H_e(e){return MDt[e]}var Oo=[171,75,84,88,32,50,48,187,13,10,26,10];function K8(e){let t=new Uint8Array(e);return!(t.byteLength<Oo.length||t[0]!==Oo[0]||t[1]!==Oo[1]||t[2]!==Oo[2]||t[3]!==Oo[3]||t[4]!==Oo[4]||t[5]!==Oo[5]||t[6]!==Oo[6]||t[7]!==Oo[7]||t[8]!==Oo[8]||t[9]!==Oo[9]||t[10]!==Oo[10]||t[11]!==Oo[11])}function V_e(e){let t=new Uint8Array(e),r=(0,W_e.read)(t),n=Math.max(1,r.levels.length),i=r.pixelWidth,a=r.pixelHeight,o=H_e(r.vkFormat);return Iv(r.levels,{mipMapLevels:n,width:i,height:a,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var qDt={etc1:{basisFormat:0,compressed:!0,format:ke.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:ke.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:ke.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:ke.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:ke.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 c_(e,t){if(t.basis.containerFormat==="auto"){if(K8(e)){let n=await dq(t);return K_e(n.KTX2File,e,t)}let{BasisFile:r}=await pq(t);return yq(r,e,t)}switch(t.basis.module){case"encoder":let r=await dq(t);switch(t.basis.containerFormat){case"ktx2":return K_e(r.KTX2File,e,t);case"basis":default:return yq(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:n}=await pq(t);return yq(n,e,t)}}function yq(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let i=n.getNumImages(),a=[];for(let o=0;o<i;o++){let s=n.getNumLevels(o),u=[];for(let c=0;c<s;c++)u.push(NDt(n,o,c,r));a.push(u)}return a}finally{n.close(),n.delete()}}function NDt(e,t,r,n){let i=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),{compressed:s,format:u,basisFormat:c}=$_e(n,o),l=e.getImageTranscodedSizeInBytes(t,r,c),f=new Uint8Array(l);if(!e.transcodeImage(f,t,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:a,data:f,compressed:s,format:u,hasAlpha:o}}function K_e(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");let i=n.getLevels(),a=[];for(let o=0;o<i;o++){a.push(UDt(n,o,r));break}return[a]}finally{n.close(),n.delete()}}function UDt(e,t,r){let{alphaFlag:n,height:i,width:a}=e.getImageLevelInfo(t,0,0),{compressed:o,format:s,basisFormat:u}=$_e(r,n),c=e.getImageTranscodedSizeInBytes(t,0,0,u),l=new Uint8Array(c);if(!e.transcodeImage(l,t,0,0,u,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:a,height:i,data:l,compressed:o,levelSize:c,hasAlpha:n,format:s}}function $_e(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=Pv()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),qDt[r]}function Pv(){let e=s_();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 Y_e={name:"Basis",id:"basis",module:"textures",version:Ov,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"}}},Id={...Y_e,parse:c_};var Io={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},GDt={DXT1:ke.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:ke.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:ke.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":ke.COMPRESSED_RGB_ATC_WEBGL,ATCA:ke.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:ke.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},zDt=Q_e,HDt=$8,WDt=$8,VDt={DXT1:Q_e,DXT3:$8,DXT5:$8,"ATC ":zDt,ATCA:HDt,ATCI:WDt};function J_e(e){return new Uint32Array(e,0,Io.HEADER_LENGTH)[Io.MAGIC_NUMBER_INDEX]===Io.MAGIC_NUMBER}function X_e(e){let t=new Int32Array(e,0,Io.HEADER_LENGTH),r=t[Io.HEADER_PF_FOURCC_INDEX];Qt(Boolean(t[Io.HEADER_PF_FLAGS_INDEX]&Io.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=KDt(r),i=GDt[n],a=VDt[n];Qt(i&&a,`DDS: Unknown pixel format ${r}`);let o=1;t[Io.HEADER_FLAGS_INDEX]&Io.DDSD_MIPMAPCOUNT&&(o=Math.max(1,t[Io.MIPMAPCOUNT_INDEX]));let s=t[Io.HEADER_WIDTH_INDEX],u=t[Io.HEADER_HEIGHT_INDEX],c=t[Io.HEADER_SIZE_INDEX]+4,l=new Uint8Array(e,c);return Iv(l,{mipMapLevels:o,width:s,height:u,sizeFunction:a,internalFormat:i})}function Q_e(e,t){return(e+3>>2)*(t+3>>2)*8}function $8(e,t){return(e+3>>2)*(t+3>>2)*16}function KDt(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var vs={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},$Dt={0:[ke.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[ke.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[ke.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[ke.COMPRESSED_RGB_ETC1_WEBGL],7:[ke.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[ke.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[ke.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[ke.COMPRESSED_RGB8_ETC2],23:[ke.COMPRESSED_RGBA8_ETC2_EAC],24:[ke.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[ke.COMPRESSED_R11_EAC],26:[ke.COMPRESSED_RG11_EAC],27:[ke.COMPRESSED_RGBA_ASTC_4X4_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[ke.COMPRESSED_RGBA_ASTC_5X4_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[ke.COMPRESSED_RGBA_ASTC_5X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[ke.COMPRESSED_RGBA_ASTC_6X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[ke.COMPRESSED_RGBA_ASTC_6X6_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[ke.COMPRESSED_RGBA_ASTC_8X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[ke.COMPRESSED_RGBA_ASTC_8X6_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[ke.COMPRESSED_RGBA_ASTC_8X8_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[ke.COMPRESSED_RGBA_ASTC_10X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[ke.COMPRESSED_RGBA_ASTC_10X6_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[ke.COMPRESSED_RGBA_ASTC_10X8_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[ke.COMPRESSED_RGBA_ASTC_10X10_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[ke.COMPRESSED_RGBA_ASTC_12X10_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[ke.COMPRESSED_RGBA_ASTC_12X12_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},YDt={0:Z_e,1:Z_e,2:e2e,3:e2e,6:l_,7:l_,9:f_,11:f_,22:l_,23:f_,24:l_,25:l_,26:f_,27:f_,28:JDt,29:XDt,30:QDt,31:ZDt,32:e4t,33:t4t,34:r4t,35:n4t,36:i4t,37:a4t,38:o4t,39:s4t,40:u4t};function t2e(e){let r=new Uint32Array(e,0,vs.HEADER_LENGTH)[vs.MAGIC_NUMBER_INDEX];return r===vs.MAGIC_NUMBER||r===vs.MAGIC_NUMBER_EXTRA}function r2e(e){let t=new Uint32Array(e,0,vs.HEADER_LENGTH),r=t[vs.PIXEL_FORMAT_INDEX],n=t[vs.COLOUR_SPACE_INDEX],i=$Dt[r]||[],a=i.length>1&&n?i[1]:i[0],o=YDt[r],s=t[vs.MIPMAPCOUNT_INDEX],u=t[vs.WIDTH_INDEX],c=t[vs.HEIGHT_INDEX],l=vs.HEADER_SIZE+t[vs.METADATA_SIZE_INDEX],f=new Uint8Array(e,l);return Iv(f,{mipMapLevels:s,width:u,height:c,sizeFunction:o,internalFormat:a})}function Z_e(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function e2e(e,t){return e=Math.max(e,8),t=Math.max(t,8),e*t/2}function l_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function f_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function JDt(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16}function XDt(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16}function QDt(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16}function ZDt(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16}function e4t(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16}function t4t(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16}function r4t(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16}function n4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16}function i4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16}function a4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16}function o4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16}function s4t(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16}function u4t(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}function n2e(e){if(K8(e))return V_e(e);if(J_e(e))return X_e(e);if(t2e(e))return r2e(e);throw new Error("Texture container format not recognized")}var i2e={name:"Texture Containers",id:"compressed-texture",module:"textures",version:Ov,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}}},Y8={...i2e,parse:async(e,t)=>{var r;return(r=t==null?void 0:t["compressed-texture"])!=null&&r.useBasis?(t.basis={format:{alpha:"BC3",noAlpha:"BC1"},...t.basis,containerFormat:"ktx2",module:"encoder"},(await c_(e,t))[0]):n2e(e)}};var xq={name:"Basis Universal Supercompressed GPU Texture",id:"ktx2-basis-writer",module:"textures",version:Ov,extensions:["ktx2"],worker:!0,options:{useSRGB:!1,qualityLevel:10,encodeUASTC:!1,mipmaps:!1}};var Rv=!0,a2e=1735152710,Eq=12,J8=8,c4t=1313821514,l4t=5130562,f4t=0,h4t=0,p4t=1;function d4t(e,t=0){return`${String.fromCharCode(e.getUint8(t+0))}${String.fromCharCode(e.getUint8(t+1))}${String.fromCharCode(e.getUint8(t+2))}${String.fromCharCode(e.getUint8(t+3))}`}function o2e(e,t=0,r={}){let n=new DataView(e),{magic:i=a2e}=r,a=n.getUint32(t,!1);return a===i||a===a2e}function s2e(e,t,r=0,n={}){let i=new DataView(t),a=d4t(i,r+0),o=i.getUint32(r+4,Rv),s=i.getUint32(r+8,Rv);switch(Object.assign(e,{header:{byteOffset:r,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),r+=Eq,e.version){case 1:return m4t(e,i,r);case 2:return g4t(e,i,r,n={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports version 1 and 2.`)}}function m4t(e,t,r){Qt(e.header.byteLength>Eq+J8);let n=t.getUint32(r+0,Rv),i=t.getUint32(r+4,Rv);return r+=J8,Qt(i===f4t),_q(e,t,r,n),r+=n,r+=wq(e,t,r,e.header.byteLength),r}function g4t(e,t,r,n){return Qt(e.header.byteLength>Eq+J8),v4t(e,t,r,n),r+e.header.byteLength}function v4t(e,t,r,n){for(;r+8<=e.header.byteLength;){let i=t.getUint32(r+0,Rv),a=t.getUint32(r+4,Rv);switch(r+=J8,a){case c4t:_q(e,t,r,i);break;case l4t:wq(e,t,r,i);break;case h4t:n.strict||_q(e,t,r,i);break;case p4t:n.strict||wq(e,t,r,i);break;default:break}r+=Co(i,4)}return r}function _q(e,t,r,n){let i=new Uint8Array(t.buffer,r,n),o=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(o),Co(n,4)}function wq(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),Co(n,4)}function Aq(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;let n=t.baseUri||t.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${e}`);return n.substr(0,n.lastIndexOf("/")+1)+e}var Tq={};ca(Tq,{decode:()=>F4t,name:()=>D4t});var b4t="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",y4t="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",x4t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),_4t=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),w4t={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},E4t={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function u2e(e,t,r,n,i,a="NONE"){let o=await A4t();C4t(o,o.exports[E4t[i]],e,t,r,n,o.exports[w4t[a||"NONE"]])}var Sq;async function A4t(){return Sq||(Sq=S4t()),Sq}async function S4t(){let e=b4t;WebAssembly.validate(x4t)&&(e=y4t,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate(T4t(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function T4t(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n){let i=e.charCodeAt(n);t[n]=i>96?i-71:i>64?i-65:i>47?i+4:i>46?63:62}let r=0;for(let n=0;n<e.length;++n)t[r++]=t[n]<60?_4t[t[n]]:(t[n]-60)*64+t[++n];return t.buffer.slice(0,r)}function C4t(e,t,r,n,i,a,o){let s=e.exports.sbrk,u=n+3&-4,c=s(u*i),l=s(a.length),f=new Uint8Array(e.exports.memory.buffer);f.set(a,l);let h=t(c,n,i,l,a.length);if(h===0&&o&&o(c,u,i),r.set(f.subarray(c,c+n*i)),s(c-s(0)),h!==0)throw new Error(`Malformed buffer data: ${h}`)}var X8="EXT_meshopt_compression",D4t=X8;async function F4t(e,t){var i,a;let r=new qr(e);if(!((i=t==null?void 0:t.gltf)!=null&&i.decompressMeshes)||!((a=t.gltf)!=null&&a.loadBuffers))return;let n=[];for(let o of e.json.bufferViews||[])n.push(k4t(r,o));await Promise.all(n),r.removeExtension(X8)}async function k4t(e,t){let r=e.getObjectExtension(t,X8);if(r){let{byteOffset:n=0,byteLength:i=0,byteStride:a,count:o,mode:s,filter:u="NONE",buffer:c}=r,l=e.gltf.buffers[c],f=new Uint8Array(l.arrayBuffer,l.byteOffset+n,i),h=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);await u2e(h,o,a,f,s,u),e.removeObjectExtension(t,X8)}}var Cq={};ca(Cq,{name:()=>B4t,preprocess:()=>O4t});var jv="EXT_texture_webp",B4t=jv;function O4t(e,t){let r=new qr(e);if(!aq("image/webp")){if(r.getRequiredExtensions().includes(jv))throw new Error(`gltf: Required extension ${jv} not supported by browser`);return}let{json:n}=r;for(let i of n.textures||[]){let a=r.getObjectExtension(i,jv);a&&(i.source=a.source),r.removeObjectExtension(i,jv)}r.removeExtension(jv)}var Dq={};ca(Dq,{name:()=>I4t,preprocess:()=>P4t});var Q8="KHR_texture_basisu",I4t=Q8;function P4t(e,t){let r=new qr(e),{json:n}=r;for(let i of n.textures||[]){let a=r.getObjectExtension(i,Q8);a&&(i.source=a.source,r.removeObjectExtension(i,Q8))}r.removeExtension(Q8)}var kq={};ca(kq,{decode:()=>q4t,encode:()=>N4t,name:()=>L4t,preprocess:()=>M4t});function c2e(e){let t={};for(let r in e){let n=e[r];if(r!=="indices"){let i=Fq(n);t[r]=i}}return t}function Fq(e){let{buffer:t,size:r,count:n}=R4t(e);return{value:t,size:r,byteOffset:0,count:n,type:R8(r),componentType:Cv(t)}}function R4t(e){let t=e,r=1,n=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=j4t(t,Float32Array)),n=t.length/r),{buffer:t,size:r,count:n}}function j4t(e,t,r=!1){return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}var Sh="KHR_draco_mesh_compression",L4t=Sh;function M4t(e,t,r){let n=new qr(e);for(let i of l2e(n))n.getObjectExtension(i,Sh)}async function q4t(e,t,r){var a;if(!((a=t==null?void 0:t.gltf)!=null&&a.decompressMeshes))return;let n=new qr(e),i=[];for(let o of l2e(n))n.getObjectExtension(o,Sh)&&i.push(U4t(n,o,t,r));await Promise.all(i),n.removeExtension(Sh)}function N4t(e,t={}){let r=new qr(e);for(let n of r.json.meshes||[])G4t(n,t),r.addRequiredExtension(Sh)}async function U4t(e,t,r,n){let i=e.getObjectExtension(t,Sh);if(!i)return;let a=e.getTypedArrayForBufferView(i.bufferView),o=Gp(a.buffer,a.byteOffset),s={...r};delete s["3d-tiles"];let u=await So(o,xv,s,n),c=c2e(u.attributes);for(let[l,f]of Object.entries(c))if(l in t.attributes){let h=t.attributes[l],p=e.getAccessor(h);p!=null&&p.min&&(p!=null&&p.max)&&(f.min=p.min,f.max=p.max)}t.attributes=c,u.indices&&(t.indices=Fq(u.indices)),e.removeObjectExtension(t,Sh),z4t(t)}function G4t(e,t,r=4,n,i){var l;if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");let a=n.DracoWriter.encodeSync({attributes:e}),o=(l=i==null?void 0:i.parseSync)==null?void 0:l.call(i,{attributes:e}),s=n._addFauxAttributes(o.attributes),u=n.addBufferView(a);return{primitives:[{attributes:s,mode:r,extensions:{[Sh]:{bufferView:u,attributes:s}}}]}}function z4t(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*l2e(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var Oq={};ca(Oq,{decode:()=>K4t,name:()=>H4t});var Bq="KHR_texture_transform",H4t=Bq,Z8=new ce,W4t=new Rr,V4t=new Rr;async function K4t(e,t){var a;if(!new qr(e).hasExtension(Bq)||!((a=t.gltf)!=null&&a.loadBuffers))return;let i=e.json.materials||[];for(let o=0;o<i.length;o++)$4t(o,e)}function $4t(e,t){var c,l,f;let r=[],n=(c=t.json.materials)==null?void 0:c[e],i=(l=n==null?void 0:n.pbrMetallicRoughness)==null?void 0:l.baseColorTexture;i&&h_(t,e,i,r);let a=n==null?void 0:n.emissiveTexture;a&&h_(t,e,a,r);let o=n==null?void 0:n.normalTexture;o&&h_(t,e,o,r);let s=n==null?void 0:n.occlusionTexture;s&&h_(t,e,s,r);let u=(f=n==null?void 0:n.pbrMetallicRoughness)==null?void 0:f.metallicRoughnessTexture;u&&h_(t,e,u,r)}function h_(e,t,r,n){let i=Y4t(r,n);if(!i)return;let a=e.json.meshes||[];for(let o of a)for(let s of o.primitives){let u=s.material;Number.isFinite(u)&&t===u&&J4t(e,s,i)}}function Y4t(e,t){var o;let r=(o=e.extensions)==null?void 0:o[Bq],{texCoord:n=0}=e,{texCoord:i=n}=r;if(!(t.findIndex(([s,u])=>s===n&&u===i)!==-1)){let s=Z4t(r);return n!==i&&(e.texCoord=i),t.push([n,i]),{originalTexCoord:n,texCoord:i,matrix:s}}return null}function J4t(e,t,r){var s,u;let{originalTexCoord:n,texCoord:i,matrix:a}=r,o=t.attributes[`TEXCOORD_${n}`];if(Number.isFinite(o)){let c=(s=e.json.accessors)==null?void 0:s[o];if(c&&c.bufferView){let l=(u=e.json.bufferViews)==null?void 0:u[c.bufferView];if(l){let{arrayBuffer:f,byteOffset:h}=e.buffers[l.buffer],p=(h||0)+(c.byteOffset||0)+(l.byteOffset||0),{ArrayType:d,length:b}=Dv(c,l),g=P8[c.componentType],x=I8[c.type],E=l.byteStride||g*x,S=new Float32Array(b);for(let F=0;F<c.count;F++){let D=new d(f,p+F*E,2);Z8.set(D[0],D[1],1),Z8.transformByMatrix3(a),S.set([Z8[0],Z8[1]],F*x)}n===i?X4t(c,l,e.buffers,S):Q4t(i,c,t,e,S)}}}}function X4t(e,t,r,n){e.componentType=5126,r.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),t.buffer=r.length-1,t.byteLength=n.buffer.byteLength,t.byteOffset=0,delete t.byteStride}function Q4t(e,t,r,n,i){n.buffers.push({arrayBuffer:i.buffer,byteOffset:0,byteLength:i.buffer.byteLength});let a=n.json.bufferViews;if(!a)return;a.push({buffer:n.buffers.length-1,byteLength:i.buffer.byteLength,byteOffset:0});let o=n.json.accessors;o&&(o.push({bufferView:(a==null?void 0:a.length)-1,byteOffset:0,componentType:5126,count:t.count,type:"VEC2"}),r.attributes[`TEXCOORD_${e}`]=o.length-1)}function Z4t(e){let{offset:t=[0,0],rotation:r=0,scale:n=[1,1]}=e,i=new Rr().set(1,0,0,0,1,0,t[0],t[1],1),a=W4t.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),o=V4t.set(n[0],0,0,0,n[1],0,0,0,1);return i.multiplyRight(a).multiplyRight(o)}var Iq={};ca(Iq,{decode:()=>tFt,encode:()=>rFt,name:()=>eFt});var Pd="KHR_lights_punctual",eFt=Pd;async function tFt(e){let t=new qr(e),{json:r}=t,n=t.getExtension(Pd);n&&(t.json.lights=n.lights,t.removeExtension(Pd));for(let i of r.nodes||[]){let a=t.getObjectExtension(i,Pd);a&&(i.light=a.light),t.removeObjectExtension(i,Pd)}}async function rFt(e){let t=new qr(e),{json:r}=t;if(r.lights){let n=t.addExtension(Pd);Ni(!n.lights),n.lights=r.lights,delete r.lights}if(t.json.lights){for(let n of t.json.lights){let i=n.node;t.addObjectExtension(i,Pd,n)}delete t.json.lights}}var Pq={};ca(Pq,{decode:()=>iFt,encode:()=>aFt,name:()=>nFt});var p_="KHR_materials_unlit",nFt=p_;async function iFt(e){let t=new qr(e),{json:r}=t;for(let n of r.materials||[])n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),t.removeObjectExtension(n,p_);t.removeExtension(p_)}function aFt(e){let t=new qr(e),{json:r}=t;if(t.materials)for(let n of r.materials||[])n.unlit&&(delete n.unlit,t.addObjectExtension(n,p_,{}),t.addExtension(p_))}var Rq={};ca(Rq,{decode:()=>sFt,encode:()=>uFt,name:()=>oFt});var d_="KHR_techniques_webgl",oFt=d_;async function sFt(e){let t=new qr(e),{json:r}=t,n=t.getExtension(d_);if(n){let i=cFt(n,t);for(let a of r.materials||[]){let o=t.getObjectExtension(a,d_);o&&(a.technique=Object.assign({},o,i[o.technique]),a.technique.values=lFt(a.technique,t)),t.removeObjectExtension(a,d_)}t.removeExtension(d_)}}async function uFt(e,t){}function cFt(e,t){let{programs:r=[],shaders:n=[],techniques:i=[]}=e,a=new TextDecoder;return n.forEach(o=>{if(Number.isFinite(o.bufferView))o.code=a.decode(t.getTypedArrayForBufferView(o.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),r.forEach(o=>{o.fragmentShader=n[o.fragmentShader],o.vertexShader=n[o.vertexShader]}),i.forEach(o=>{o.program=r[o.program]}),i}function lFt(e,t){let r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(n=>{e.uniforms[n].value&&!(n in r)&&(r[n]=e.uniforms[n].value)}),Object.keys(r).forEach(n=>{typeof r[n]=="object"&&r[n].index!==void 0&&(r[n].texture=t.getTexture(r[n].index))}),r}var f2e=[cq,oq,Tq,Cq,Dq,kq,Iq,Pq,Rq,Oq,lq];function h2e(e,t={},r){var i;let n=f2e.filter(a=>d2e(a.name,t));for(let a of n)(i=a.preprocess)==null||i.call(a,e,t,r)}async function p2e(e,t={},r){var i;let n=f2e.filter(a=>d2e(a.name,t));for(let a of n)await((i=a.decode)==null?void 0:i.call(a,e,t,r))}function d2e(e,t){var i;let r=((i=t==null?void 0:t.gltf)==null?void 0:i.excludeExtensions)||{};return!(e in r&&!r[e])}var jq="KHR_binary_glTF";function m2e(e){let t=new qr(e),{json:r}=t;for(let n of r.images||[]){let i=t.getObjectExtension(n,jq);i&&Object.assign(n,i),t.removeObjectExtension(n,jq)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(jq)}var g2e={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},hFt={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Lq=class{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(t,r){this.json=t.json;let n=t.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${n.asset.version}`);return}if(!r.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),m2e(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(let r in g2e)this._convertTopLevelObjectToArray(t,r)}_convertTopLevelObjectToArray(t,r){let n=t[r];if(!(!n||Array.isArray(n))){t[r]=[];for(let i in n){let a=n[i];a.id=a.id||i;let o=t[r].length;t[r].push(a),this.idToIndexMap[r][i]=o}}}_convertObjectIdsToArrayIndices(t){for(let r in g2e)this._convertIdsToIndices(t,r);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(let r of t.textures)this._convertTextureIds(r);for(let r of t.meshes)this._convertMeshIds(r);for(let r of t.nodes)this._convertNodeIds(r);for(let r of t.scenes)this._convertSceneIds(r)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(let r of t.primitives){let{attributes:n,indices:i,material:a}=r;for(let o in n)n[o]=this._convertIdToIndex(n[o],"accessor");i&&(r.indices=this._convertIdToIndex(i,"accessor")),a&&(r.material=this._convertIdToIndex(a,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map(r=>this._convertIdToIndex(r,"node"))),t.meshes&&(t.meshes=t.meshes.map(r=>this._convertIdToIndex(r,"mesh")))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map(r=>this._convertIdToIndex(r,"node")))}_convertIdsToIndices(t,r){t[r]||(console.warn(`gltf v1: json doesn't contain attribute ${r}`),t[r]=[]);for(let n of t[r])for(let i in n){let a=n[i],o=this._convertIdToIndex(a,i);n[i]=o}}_convertIdToIndex(t,r){let n=hFt[r];if(n in this.idToIndexMap){let i=this.idToIndexMap[n][t];if(!Number.isFinite(i))throw new Error(`gltf v1: failed to resolve ${r} with id ${t}`);return i}return t}_updateObjects(t){for(let r of this.json.buffers)delete r.type}_updateMaterial(t){var r,n,i;for(let a of t.materials){a.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};let o=((r=a.values)==null?void 0:r.tex)||((n=a.values)==null?void 0:n.texture2d_0)||((i=a.values)==null?void 0:i.diffuseTex),s=t.textures.findIndex(u=>u.id===o);s!==-1&&(a.pbrMetallicRoughness.baseColorTexture={index:s})}}};function v2e(e,t={}){return new Lq().normalize(e,t)}async function b2e(e,t,r=0,n,i){var a,o,s;return pFt(e,t,r,n),v2e(e,{normalize:(a=n==null?void 0:n.gltf)==null?void 0:a.normalize}),h2e(e,n,i),(o=n==null?void 0:n.gltf)!=null&&o.loadBuffers&&e.json.buffers&&await dFt(e,n,i),(s=n==null?void 0:n.gltf)!=null&&s.loadImages&&await mFt(e,n,i),await p2e(e,n,i),e}function pFt(e,t,r,n){if(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!o2e(t,r,n)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=UI(t);else if(t instanceof ArrayBuffer){let o={};r=s2e(o,t,r,n.glb),Ni(o.type==="glTF",`Invalid GLB magic string ${o.type}`),e._glb=o,e.json=o.json}else Ni(!1,"GLTF: must be ArrayBuffer or string");let i=e.json.buffers||[];if(e.buffers=new Array(i.length).fill(null),e._glb&&e._glb.header.hasBinChunk){let{binChunks:o}=e._glb;e.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}let a=e.json.images||[];e.images=new Array(a.length).fill({})}async function dFt(e,t,r){var i,a;let n=e.json.buffers||[];for(let o=0;o<n.length;++o){let s=n[o];if(s.uri){let{fetch:u}=r;Ni(u);let c=Aq(s.uri,t),l=await((i=r==null?void 0:r.fetch)==null?void 0:i.call(r,c)),f=await((a=l==null?void 0:l.arrayBuffer)==null?void 0:a.call(l));e.buffers[o]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete s.uri}else e.buffers[o]===null&&(e.buffers[o]={arrayBuffer:new ArrayBuffer(s.byteLength),byteOffset:0,byteLength:s.byteLength})}}async function mFt(e,t,r){let n=gFt(e),i=e.json.images||[],a=[];for(let o of n)a.push(vFt(e,i[o],o,t,r));return await Promise.all(a)}function gFt(e){let t=new Set,r=e.json.textures||[];for(let n of r)n.source!==void 0&&t.add(n.source);return Array.from(t).sort()}async function vFt(e,t,r,n,i){let a;if(t.uri&&!t.hasOwnProperty("bufferView")){let s=Aq(t.uri,n),{fetch:u}=i;a=await(await u(s)).arrayBuffer(),t.bufferView={data:a}}if(Number.isFinite(t.bufferView)){let s=C_e(e.json,e.buffers,t.bufferView);a=Gp(s.buffer,s.byteOffset,s.byteLength)}Ni(a,"glTF image has no data");let o=await So(a,[Tv,Id],{...n,mimeType:t.mimeType,basis:n.basis||{format:Pv()}},i);o&&o[0]&&(o={compressed:!0,mipmaps:!1,width:o[0].width,height:o[0].height,data:o[0]}),e.images=e.images||[],e.images[r]=o}var Il={name:"glTF",id:"gltf",module:"gltf",version:U8,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:bFt,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function bFt(e,t={},r){t={...Il.options,...t},t.gltf={...Il.options.gltf,...t.gltf};let{byteOffset:n=0}=t;return await b2e({},e,n,t,r)}var yFt=1179937895,xFt=1313821514,_Ft=5130562,wc=!0;function y2e(e,t,r=0,n={}){let{magic:i=yFt,version:a=2,json:o={},binary:s}=e,u=r;t&&(t.setUint32(r+0,i,wc),t.setUint32(r+4,a,wc),t.setUint32(r+8,0,wc));let c=r+8;r+=12;let l=r;t&&(t.setUint32(r+0,0,wc),t.setUint32(r+4,xFt,wc)),r+=8;let f=JSON.stringify(o);if(r=Bm(t,r,f,4),t){let h=r-l-8;t.setUint32(l+0,h,wc)}if(s){let h=r;if(t&&(t.setUint32(r+0,0,wc),t.setUint32(r+4,_Ft,wc)),r+=8,r=BA(t,r,s,4),t){let p=r-h-8;t.setUint32(h+0,p,wc)}}if(t){let h=r-u;t.setUint32(c,h,wc)}return r}function Mq(e,t,r,n){return wFt(e),y2e(e,t,r,n)}function wFt(e,{firstBuffer:t=0}={}){if(e.buffers&&e.buffers.length>t)throw new Error("encodeGLTF: multiple buffers not yet implemented")}var qq={name:"glTF",id:"gltf",module:"gltf",version:U8,extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,encodeSync:EFt,options:{gltf:{}}};function EFt(e,t={}){let{byteOffset:r=0}=t,n=Mq(e,null,r,t),i=new ArrayBuffer(n),a=new DataView(i);return Mq(e,a,r,t),i}var AFt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},SFt={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},bs={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},TFt={magFilter:bs.TEXTURE_MAG_FILTER,minFilter:bs.TEXTURE_MIN_FILTER,wrapS:bs.TEXTURE_WRAP_S,wrapT:bs.TEXTURE_WRAP_T},CFt={[bs.TEXTURE_MAG_FILTER]:bs.LINEAR,[bs.TEXTURE_MIN_FILTER]:bs.NEAREST_MIPMAP_LINEAR,[bs.TEXTURE_WRAP_S]:bs.REPEAT,[bs.TEXTURE_WRAP_T]:bs.REPEAT};function DFt(){return{id:"default-sampler",parameters:CFt}}function FFt(e){return SFt[e]}function kFt(e){return AFt[e]}var Nq=class{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(t,r={}){let{json:n,buffers:i=[],images:a=[]}=t,{baseUri:o=""}=t;return Ni(n),this.baseUri=o,this.buffers=i,this.images=a,this.jsonUnprocessed=n,this.json=this._resolveTree(t.json,r),this.json}_resolveTree(t,r={}){let n={...t};return this.json=n,t.bufferViews&&(n.bufferViews=t.bufferViews.map((i,a)=>this._resolveBufferView(i,a))),t.images&&(n.images=t.images.map((i,a)=>this._resolveImage(i,a))),t.samplers&&(n.samplers=t.samplers.map((i,a)=>this._resolveSampler(i,a))),t.textures&&(n.textures=t.textures.map((i,a)=>this._resolveTexture(i,a))),t.accessors&&(n.accessors=t.accessors.map((i,a)=>this._resolveAccessor(i,a))),t.materials&&(n.materials=t.materials.map((i,a)=>this._resolveMaterial(i,a))),t.meshes&&(n.meshes=t.meshes.map((i,a)=>this._resolveMesh(i,a))),t.nodes&&(n.nodes=t.nodes.map((i,a)=>this._resolveNode(i,a)),n.nodes=n.nodes.map((i,a)=>this._resolveNodeChildren(i))),t.skins&&(n.skins=t.skins.map((i,a)=>this._resolveSkin(i,a))),t.scenes&&(n.scenes=t.scenes.map((i,a)=>this._resolveScene(i,a))),typeof this.json.scene=="number"&&n.scenes&&(n.scene=n.scenes[this.json.scene]),n}getScene(t){return this._get(this.json.scenes,t)}getNode(t){return this._get(this.json.nodes,t)}getSkin(t){return this._get(this.json.skins,t)}getMesh(t){return this._get(this.json.meshes,t)}getMaterial(t){return this._get(this.json.materials,t)}getAccessor(t){return this._get(this.json.accessors,t)}getCamera(t){return this._get(this.json.cameras,t)}getTexture(t){return this._get(this.json.textures,t)}getSampler(t){return this._get(this.json.samplers,t)}getImage(t){return this._get(this.json.images,t)}getBufferView(t){return this._get(this.json.bufferViews,t)}getBuffer(t){return this._get(this.json.buffers,t)}_get(t,r){if(typeof r=="object")return r;let n=t&&t[r];return n||console.warn(`glTF file error: Could not find ${t}[${r}]`),n}_resolveScene(t,r){return{...t,id:t.id||`scene-${r}`,nodes:(t.nodes||[]).map(n=>this.getNode(n))}}_resolveNode(t,r){let n={...t,id:(t==null?void 0:t.id)||`node-${r}`};return t.mesh!==void 0&&(n.mesh=this.getMesh(t.mesh)),t.camera!==void 0&&(n.camera=this.getCamera(t.camera)),t.skin!==void 0&&(n.skin=this.getSkin(t.skin)),t.meshes!==void 0&&t.meshes.length&&(n.mesh=t.meshes.reduce((i,a)=>{let o=this.getMesh(a);return i.id=o.id,i.primitives=i.primitives.concat(o.primitives),i},{primitives:[]})),n}_resolveNodeChildren(t){return t.children&&(t.children=t.children.map(r=>this.getNode(r))),t}_resolveSkin(t,r){let n=typeof t.inverseBindMatrices=="number"?this.getAccessor(t.inverseBindMatrices):void 0;return{...t,id:t.id||`skin-${r}`,inverseBindMatrices:n}}_resolveMesh(t,r){let n={...t,id:t.id||`mesh-${r}`,primitives:[]};return t.primitives&&(n.primitives=t.primitives.map(i=>{let a={...i,attributes:{},indices:void 0,material:void 0},o=i.attributes;for(let s in o)a.attributes[s]=this.getAccessor(o[s]);return i.indices!==void 0&&(a.indices=this.getAccessor(i.indices)),i.material!==void 0&&(a.material=this.getMaterial(i.material)),a})),n}_resolveMaterial(t,r){let n={...t,id:t.id||`material-${r}`};if(n.normalTexture&&(n.normalTexture={...n.normalTexture},n.normalTexture.texture=this.getTexture(n.normalTexture.index)),n.occlusionTexture&&(n.occlusionTexture={...n.occlusionTexture},n.occlusionTexture.texture=this.getTexture(n.occlusionTexture.index)),n.emissiveTexture&&(n.emissiveTexture={...n.emissiveTexture},n.emissiveTexture.texture=this.getTexture(n.emissiveTexture.index)),n.emissiveFactor||(n.emissiveFactor=n.emissiveTexture?[1,1,1]:[0,0,0]),n.pbrMetallicRoughness){n.pbrMetallicRoughness={...n.pbrMetallicRoughness};let i=n.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture={...i.baseColorTexture},i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture={...i.metallicRoughnessTexture},i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return n}_resolveAccessor(t,r){let n=FFt(t.componentType),i=kFt(t.type),a=n*i,o={...t,id:t.id||`accessor-${r}`,bytesPerComponent:n,components:i,bytesPerElement:a,value:void 0,bufferView:void 0,sparse:void 0};if(t.bufferView!==void 0&&(o.bufferView=this.getBufferView(t.bufferView)),o.bufferView){let s=o.bufferView.buffer,{ArrayType:u,byteLength:c}=Dv(o,o.bufferView),l=(o.bufferView.byteOffset||0)+(o.byteOffset||0)+s.byteOffset,f=s.arrayBuffer.slice(l,l+c);o.bufferView.byteStride&&(f=this._getValueFromInterleavedBuffer(s,l,o.bufferView.byteStride,o.bytesPerElement,o.count)),o.value=new u(f)}return o}_getValueFromInterleavedBuffer(t,r,n,i,a){let o=new Uint8Array(a*i);for(let s=0;s<a;s++){let u=r+s*n;o.set(new Uint8Array(t.arrayBuffer.slice(u,u+i)),s*i)}return o.buffer}_resolveTexture(t,r){return{...t,id:t.id||`texture-${r}`,sampler:typeof t.sampler=="number"?this.getSampler(t.sampler):DFt(),source:typeof t.source=="number"?this.getImage(t.source):void 0}}_resolveSampler(t,r){let n={id:t.id||`sampler-${r}`,...t,parameters:{}};for(let i in n){let a=this._enumSamplerParameter(i);a!==void 0&&(n.parameters[a]=n[i])}return n}_enumSamplerParameter(t){return TFt[t]}_resolveImage(t,r){let n={...t,id:t.id||`image-${r}`,image:null,bufferView:t.bufferView!==void 0?this.getBufferView(t.bufferView):void 0},i=this.images[r];return i&&(n.image=i),n}_resolveBufferView(t,r){let n=t.buffer,i=this.buffers[n].arrayBuffer,a=this.buffers[n].byteOffset||0;return t.byteOffset&&(a+=t.byteOffset),{id:`bufferView-${r}`,...t,buffer:this.buffers[n],data:new Uint8Array(i,a,t.byteLength)}}_resolveCamera(t,r){let n={...t,id:t.id||`camera-${r}`};return n.perspective,n.orthographic,n}};function m_(e,t){return new Nq().postProcess(e,t)}var eD={URI:0,EMBEDDED:1};function tD(e,t,r,n){e.rotateYtoZ=!0;let i=(e.byteOffset||0)+(e.byteLength||0)-r;if(i===0)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n!=null&&n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=Gp(t,r,i),e.gltfByteOffset=0,e.gltfByteLength=i,r%4===0||console.warn(`${e.type}: embedded glb is not aligned to a 4-byte boundary.`),(e.byteOffset||0)+(e.byteLength||0)}async function rD(e,t,r,n){let i=(r==null?void 0:r["3d-tiles"])||{};if(BFt(e,t,r),i.loadGLTF){if(!n)return;if(e.gltfUrl){let{fetch:a}=n,o=await a(e.gltfUrl,r);e.gltfArrayBuffer=await o.arrayBuffer(),e.gltfByteOffset=0}if(e.gltfArrayBuffer){let a=await So(e.gltfArrayBuffer,Il,r,n);e.gltf=m_(a),e.gpuMemoryUsageInBytes=a_(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength}}}function BFt(e,t,r){switch(t){case eD.URI:if(e.gltfArrayBuffer){let n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),a=new TextDecoder().decode(n);e.gltfUrl=a.replace(/[\s\0]+$/,"")}delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case eD.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function x2e(e,t,r,n,i){var o;r=OFt(e,t,r,n,i),await rD(e,eD.EMBEDDED,n,i);let a=(o=e==null?void 0:e.gltf)==null?void 0:o.extensions;return a&&a.CESIUM_RTC&&(e.rtcCenter=a.CESIUM_RTC.center),r}function OFt(e,t,r,n,i){r=Ah(e,t,r),r=Ev(e,t,r),r=Av(e,t,r,n),r=tD(e,t,r,n);let a=new Bl(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3),r}async function _2e(e,t,r,n,i){return r=IFt(e,t,r,n,i),await rD(e,e.gltfFormat||0,n,i),r}function IFt(e,t,r,n,i){var c;if(r=Ah(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=Ev(e,t,r);let a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r+=4,r=Av(e,t,r,n),r=tD(e,t,r,n),!((c=e==null?void 0:e.header)!=null&&c.featureTableJsonByteLength)||e.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let o=new Bl(e.featureTableJson,e.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=o.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3);let u=new Bd(e.batchTableJson,e.batchTableBinary,s);return PFt(e,o,u,s),r}function PFt(e,t,r,n){let i=new Array(n),a=new ce,o=new ce,s=new ce,u=new ce,c=new Rr,l=new ps,f=new ce,h={},p=new Kr,d=[],b=[],g=[],x=[];for(let E=0;E<n;E++){let S;if(t.hasProperty("POSITION"))S=t.getProperty("POSITION",Ht.FLOAT,3,E,a);else if(t.hasProperty("POSITION_QUANTIZED")){S=t.getProperty("POSITION_QUANTIZED",Ht.UNSIGNED_SHORT,3,E,a);let I=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Ht.FLOAT,3);if(!I)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let P=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Ht.FLOAT,3);if(!P)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let U=65535;for(let Y=0;Y<3;Y++)S[Y]=S[Y]/U*P[Y]+I[Y]}if(!S)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");a.copy(S),h.translation=a,e.normalUp=t.getProperty("NORMAL_UP",Ht.FLOAT,3,E,d),e.normalRight=t.getProperty("NORMAL_RIGHT",Ht.FLOAT,3,E,b);let F=!1;if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",Ht.UNSIGNED_SHORT,2,E,d),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",Ht.UNSIGNED_SHORT,2,E,b),e.octNormalUp)throw e.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");e.eastNorthUp?(or.WGS84.eastNorthUpToFixedFrame(a,p),p.getRotationMatrix3(c)):c.identity()}F&&(u.copy(o).cross(s).normalize(),c.setColumn(0,o),c.setColumn(1,s),c.setColumn(2,u)),l.fromMatrix3(c),h.rotation=l,f.set(1,1,1);let D=t.getProperty("SCALE",Ht.FLOAT,1,E,g);Number.isFinite(D)&&f.multiplyByScalar(D);let j=t.getProperty("SCALE_NON_UNIFORM",Ht.FLOAT,3,E,d);j&&f.scale(j),h.scale=f;let k=t.getProperty("BATCH_ID",Ht.UNSIGNED_SHORT,1,E,x);k===void 0&&(k=E);let N=new Kr().fromQuaternion(h.rotation);p.identity(),p.translate(h.translation),p.multiplyRight(N),p.scale(h.scale);let C=p.clone();i[E]={modelMatrix:C,batchId:k}}e.instances=i}async function w2e(e,t,r,n,i,a){r=Ah(e,t,r);let o=new DataView(t);for(e.tilesLength=o.getUint32(r,!0),r+=4,e.tiles=[];e.tiles.length<e.tilesLength&&(e.byteLength||0)-r>12;){let s={shape:"tile3d"};e.tiles.push(s),r=await a(t,r,n,i,s)}return r}async function E2e(e,t,r,n){var i,a;if(e.rotateYtoZ=!0,e.gltfUpAxis=(i=r==null?void 0:r["3d-tiles"])!=null&&i.assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",(a=r==null?void 0:r["3d-tiles"])!=null&&a.loadGLTF){if(!n)return t.byteLength;let o=await So(t,Il,r,n);e.gltf=m_(o),e.gpuMemoryUsageInBytes=a_(e.gltf)}else e.gltfArrayBuffer=t;return t.byteLength}async function Uq(e,t=0,r,n,i={shape:"tile3d"}){switch(i.byteOffset=t,i.type=W1e(e,t),i.type){case ms.COMPOSITE:return await w2e(i,e,t,r,n,Uq);case ms.BATCHED_3D_MODEL:return await x2e(i,e,t,r,n);case ms.GLTF:return await E2e(i,e,r,n);case ms.INSTANCED_3D_MODEL:return await _2e(i,e,t,r,n);case ms.POINT_CLOUD:return await f_e(i,e,t,r,n);default:throw new Error(`3DTileLoader: unknown type ${i.type}`)}}async function Gq(e,t,r){if(new Uint32Array(e.slice(0,4))[0]!==1952609651)throw new Error("Wrong subtree file magic number");if(new Uint32Array(e.slice(4,8))[0]!==1)throw new Error("Wrong subtree file verson, must be 1");let a=A2e(e.slice(8,16)),o=new Uint8Array(e,24,a),u=new TextDecoder("utf8").decode(o),c=JSON.parse(u),l=A2e(e.slice(16,24)),f=new ArrayBuffer(0);if(l&&(f=e.slice(24+a)),await nD(c,c.tileAvailability,f,r),Array.isArray(c.contentAvailability))for(let h of c.contentAvailability)await nD(c,h,f,r);else await nD(c,c.contentAvailability,f,r);return await nD(c,c.childSubtreeAvailability,f,r),c}async function nD(e,t,r,n){let i=Number.isFinite(t.bitstream)?t.bitstream:t.bufferView;if(typeof i!="number")return;let a=e.bufferViews[i],o=e.buffers[a.buffer];if(!(n!=null&&n.baseUrl))throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(o.uri){let s=`${(n==null?void 0:n.baseUrl)||""}/${o.uri}`,c=await(await n.fetch(s)).arrayBuffer();t.explicitBitstream=new Uint8Array(c,a.byteOffset,a.byteLength);return}t.explicitBitstream=new Uint8Array(r,a.byteOffset,a.byteLength)}function A2e(e){let t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+2**32*n}var iD={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:yv,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Gq,options:{}};function zq(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 t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function pu(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||zq()}var RFt=globalThis.self||globalThis.window||globalThis.global,Lv=globalThis.window||globalThis.self||globalThis.global,jFt=globalThis.document||{},Rd=globalThis.process||{},LFt=globalThis.console,$wr=globalThis.navigator||{};var aD="4.0.0-beta.8",Xwr=pu();function MFt(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var oD=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=MFt(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function S2e(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function T2e(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function sD(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var uD;(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"})(uD||(uD={}));var qFt=10;function C2e(e){return typeof e!="string"?e:(e=e.toUpperCase(),uD[e]||uD.WHITE)}function D2e(e,t,r){if(!pu&&typeof e=="string"){if(t){let n=C2e(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=C2e(r);e="\x1B[".concat(n+qFt,"m").concat(e,"\x1B[49m")}}return e}function F2e(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),i=e;for(let a of n){let o=i[a];typeof o=="function"&&(t.find(s=>a===s)||(i[a]=o.bind(e)))}}function Mv(e,t){if(!e)throw new Error(t||"Assertion failed")}function jd(){let e;if(pu()&&Lv.performance){var t,r;e=Lv===null||Lv===void 0||(t=Lv.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Rd){var n;let i=Rd===null||Rd===void 0||(n=Rd.hrtime)===null||n===void 0?void 0:n.call(Rd);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var qv={debug:pu()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},NFt={enabled:!0,level:0};function ys(){}var k2e={},B2e={once:!0},g_=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=aD,this._startTs=jd(),this._deltaTs=jd(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new oD("__probe-".concat(this.id,"__"),NFt),this.timeStamp("".concat(this.id," started")),F2e(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((jd()-this._startTs).toPrecision(10))}getDelta(){return Number((jd()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){Mv(t,r)}warn(t){return this._getLogFunction(0,t,qv.warn,arguments,B2e)}error(t){return this._getLogFunction(0,t,qv.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,qv.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,qv.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,qv.debug||qv.info,arguments,B2e)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||ys,n&&[n],{tag:HFt(r)}):ys}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?pu()?zFt({image:i,message:a,scale:o}):GFt({image:i,message:a,scale:o}):ys}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||ys)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=O2e({logLevel:t,message:r,opts:n}),{collapsed:a}=n;return i.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||ys)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=I2e(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=O2e({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,Mv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=jd();let o=a.tag||a.message;if(a.once&&o)if(!k2e[o])k2e[o]=jd();else return ys;return r=UFt(this.id,a.message,a),n.bind(console,r,...a.args)}return ys}};g_.VERSION=aD;function I2e(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Mv(Number.isFinite(t)&&t>=0),t}function O2e(e){let{logLevel:t,message:r}=e;e.logLevel=I2e(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let i=typeof e.message;return Mv(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function UFt(e,t,r){if(typeof t=="string"){let n=r.time?T2e(S2e(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=D2e(t,r.color,r.background)}return t}function GFt(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),ys}function zFt(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=sD(a,r,n);console.log(...o)},a.src=t,ys}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...sD(t,r,n)),ys;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...sD(a,r,n)),a.src=t.toDataURL(),ys}return ys}function HFt(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Hq=new g_({id:"@probe.gl/log"});var xs=null;try{xs=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function kn(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}kn.prototype.__isLong__;Object.defineProperty(kn.prototype,"__isLong__",{value:!0});function Ma(e){return(e&&e.__isLong__)===!0}function P2e(e){var t=Math.clz32(e&-e);return e?31-t:t}kn.isLong=Ma;var R2e={},j2e={};function Ld(e,t){var r,n,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(n=j2e[e],n)?n:(r=$r(e,0,!0),i&&(j2e[e]=r),r)):(e|=0,(i=-128<=e&&e<128)&&(n=R2e[e],n)?n:(r=$r(e,e<0?-1:0,!1),i&&(R2e[e]=r),r))}kn.fromInt=Ld;function _s(e,t){if(isNaN(e))return t?Pl:du;if(t){if(e<0)return Pl;if(e>=N2e)return z2e}else{if(e<=-M2e)return mo;if(e+1>=M2e)return G2e}return e<0?_s(-e,t).neg():$r(e%Uv|0,e/Uv|0,t)}kn.fromNumber=_s;function $r(e,t,r){return new kn(e,t,r)}kn.fromBits=$r;var cD=Math.pow;function Vq(e,t,r){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(r=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?Pl:du;if(r=r||10,r<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return Vq(e.substring(1),t,r).neg();for(var i=_s(cD(r,8)),a=du,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),u=parseInt(e.substring(o,o+s),r);if(s<8){var c=_s(cD(r,s));a=a.mul(c).add(_s(u))}else a=a.mul(i),a=a.add(_s(u))}return a.unsigned=t,a}kn.fromString=Vq;function mu(e,t){return typeof e=="number"?_s(e,t):typeof e=="string"?Vq(e,t):$r(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}kn.fromValue=mu;var L2e=1<<16,WFt=1<<24,Uv=L2e*L2e,N2e=Uv*Uv,M2e=N2e/2,q2e=Ld(WFt),du=Ld(0);kn.ZERO=du;var Pl=Ld(0,!0);kn.UZERO=Pl;var Nv=Ld(1);kn.ONE=Nv;var U2e=Ld(1,!0);kn.UONE=U2e;var Wq=Ld(-1);kn.NEG_ONE=Wq;var G2e=$r(-1,2147483647,!1);kn.MAX_VALUE=G2e;var z2e=$r(-1,-1,!0);kn.MAX_UNSIGNED_VALUE=z2e;var mo=$r(0,-2147483648,!1);kn.MIN_VALUE=mo;var Ke=kn.prototype;Ke.toInt=function(){return this.unsigned?this.low>>>0:this.low};Ke.toNumber=function(){return this.unsigned?(this.high>>>0)*Uv+(this.low>>>0):this.high*Uv+(this.low>>>0)};Ke.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(mo)){var r=_s(t),n=this.div(r),i=n.mul(r).sub(this);return n.toString(t)+i.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var a=_s(cD(t,6),this.unsigned),o=this,s="";;){var u=o.div(a),c=o.sub(u.mul(a)).toInt()>>>0,l=c.toString(t);if(o=u,o.isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}};Ke.getHighBits=function(){return this.high};Ke.getHighBitsUnsigned=function(){return this.high>>>0};Ke.getLowBits=function(){return this.low};Ke.getLowBitsUnsigned=function(){return this.low>>>0};Ke.getNumBitsAbs=function(){if(this.isNegative())return this.eq(mo)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&!(t&1<<r);r--);return this.high!=0?r+33:r+1};Ke.isZero=function(){return this.high===0&&this.low===0};Ke.eqz=Ke.isZero;Ke.isNegative=function(){return!this.unsigned&&this.high<0};Ke.isPositive=function(){return this.unsigned||this.high>=0};Ke.isOdd=function(){return(this.low&1)===1};Ke.isEven=function(){return(this.low&1)===0};Ke.equals=function(t){return Ma(t)||(t=mu(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};Ke.eq=Ke.equals;Ke.notEquals=function(t){return!this.eq(t)};Ke.neq=Ke.notEquals;Ke.ne=Ke.notEquals;Ke.lessThan=function(t){return this.comp(t)<0};Ke.lt=Ke.lessThan;Ke.lessThanOrEqual=function(t){return this.comp(t)<=0};Ke.lte=Ke.lessThanOrEqual;Ke.le=Ke.lessThanOrEqual;Ke.greaterThan=function(t){return this.comp(t)>0};Ke.gt=Ke.greaterThan;Ke.greaterThanOrEqual=function(t){return this.comp(t)>=0};Ke.gte=Ke.greaterThanOrEqual;Ke.ge=Ke.greaterThanOrEqual;Ke.compare=function(t){if(Ma(t)||(t=mu(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};Ke.comp=Ke.compare;Ke.negate=function(){return!this.unsigned&&this.eq(mo)?mo:this.not().add(Nv)};Ke.neg=Ke.negate;Ke.add=function(t){Ma(t)||(t=mu(t));var r=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=t.high>>>16,s=t.high&65535,u=t.low>>>16,c=t.low&65535,l=0,f=0,h=0,p=0;return p+=a+c,h+=p>>>16,p&=65535,h+=i+u,f+=h>>>16,h&=65535,f+=n+s,l+=f>>>16,f&=65535,l+=r+o,l&=65535,$r(h<<16|p,l<<16|f,this.unsigned)};Ke.subtract=function(t){return Ma(t)||(t=mu(t)),this.add(t.neg())};Ke.sub=Ke.subtract;Ke.multiply=function(t){if(this.isZero())return this;if(Ma(t)||(t=mu(t)),xs){var r=xs.mul(this.low,this.high,t.low,t.high);return $r(r,xs.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?Pl:du;if(this.eq(mo))return t.isOdd()?mo:du;if(t.eq(mo))return this.isOdd()?mo:du;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(q2e)&&t.lt(q2e))return _s(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=t.high>>>16,u=t.high&65535,c=t.low>>>16,l=t.low&65535,f=0,h=0,p=0,d=0;return d+=o*l,p+=d>>>16,d&=65535,p+=a*l,h+=p>>>16,p&=65535,p+=o*c,h+=p>>>16,p&=65535,h+=i*l,f+=h>>>16,h&=65535,h+=a*c,f+=h>>>16,h&=65535,h+=o*u,f+=h>>>16,h&=65535,f+=n*l+i*c+a*u+o*s,f&=65535,$r(p<<16|d,f<<16|h,this.unsigned)};Ke.mul=Ke.multiply;Ke.divide=function(t){if(Ma(t)||(t=mu(t)),t.isZero())throw Error("division by zero");if(xs){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?xs.div_u:xs.div_s)(this.low,this.high,t.low,t.high);return $r(r,xs.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Pl:du;var n,i,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Pl;if(t.gt(this.shru(1)))return U2e;a=Pl}else{if(this.eq(mo)){if(t.eq(Nv)||t.eq(Wq))return mo;if(t.eq(mo))return Nv;var o=this.shr(1);return n=o.div(t).shl(1),n.eq(du)?t.isNegative()?Nv:Wq:(i=this.sub(t.mul(n)),a=n.add(i.div(t)),a)}else if(t.eq(mo))return this.unsigned?Pl:du;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();a=du}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),u=s<=48?1:cD(2,s-48),c=_s(n),l=c.mul(t);l.isNegative()||l.gt(i);)n-=u,c=_s(n,this.unsigned),l=c.mul(t);c.isZero()&&(c=Nv),a=a.add(c),i=i.sub(l)}return a};Ke.div=Ke.divide;Ke.modulo=function(t){if(Ma(t)||(t=mu(t)),xs){var r=(this.unsigned?xs.rem_u:xs.rem_s)(this.low,this.high,t.low,t.high);return $r(r,xs.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};Ke.mod=Ke.modulo;Ke.rem=Ke.modulo;Ke.not=function(){return $r(~this.low,~this.high,this.unsigned)};Ke.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};Ke.clz=Ke.countLeadingZeros;Ke.countTrailingZeros=function(){return this.low?P2e(this.low):P2e(this.high)+32};Ke.ctz=Ke.countTrailingZeros;Ke.and=function(t){return Ma(t)||(t=mu(t)),$r(this.low&t.low,this.high&t.high,this.unsigned)};Ke.or=function(t){return Ma(t)||(t=mu(t)),$r(this.low|t.low,this.high|t.high,this.unsigned)};Ke.xor=function(t){return Ma(t)||(t=mu(t)),$r(this.low^t.low,this.high^t.high,this.unsigned)};Ke.shiftLeft=function(t){return Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?$r(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):$r(0,this.low<<t-32,this.unsigned)};Ke.shl=Ke.shiftLeft;Ke.shiftRight=function(t){return Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?$r(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):$r(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};Ke.shr=Ke.shiftRight;Ke.shiftRightUnsigned=function(t){return Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?$r(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?$r(this.high,0,this.unsigned):$r(this.high>>>t-32,0,this.unsigned)};Ke.shru=Ke.shiftRightUnsigned;Ke.shr_u=Ke.shiftRightUnsigned;Ke.rotateLeft=function(t){var r;return Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?$r(this.high,this.low,this.unsigned):t<32?(r=32-t,$r(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,$r(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))};Ke.rotl=Ke.rotateLeft;Ke.rotateRight=function(t){var r;return Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?$r(this.high,this.low,this.unsigned):t<32?(r=32-t,$r(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,$r(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};Ke.rotr=Ke.rotateRight;Ke.toSigned=function(){return this.unsigned?$r(this.low,this.high,!1):this};Ke.toUnsigned=function(){return this.unsigned?this:$r(this.low,this.high,!0)};Ke.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};Ke.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};Ke.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};kn.fromBytes=function(t,r,n){return n?kn.fromBytesLE(t,r):kn.fromBytesBE(t,r)};kn.fromBytesLE=function(t,r){return new kn(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};kn.fromBytesBE=function(t,r){return new kn(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)};var Gv=kn;var VFt=16;function v_(e){e==="X"&&(e="");let t=e.padEnd(VFt,"0");return Gv.fromString(t,!0,16)}function Kq(e){if(e.isZero())return"X";let t=e.countTrailingZeros(),r=t%4;t=(t-r)/4;let n=t;t*=4;let a=e.shiftRightUnsigned(t).toString(16).replace(/0+$/,"");return Array(17-n-a.length).join("0")+a}function $q(e,t){let r=KFt(e).shiftRightUnsigned(2);return e.add(Gv.fromNumber(2*t+1-4).multiply(r))}function KFt(e){return e.and(e.not().add(1))}var $Ft=3,YFt=30,JFt=2*YFt+1,H2e=180/Math.PI;function V2e(e){if(e.length===0)throw new Error(`Invalid Hilbert quad key ${e}`);let t=e.split("/"),r=parseInt(t[0],10),n=t[1],i=n.length,a=0,o=[0,0];for(let s=i-1;s>=0;s--){a=i-s;let u=n[s],c=0,l=0;u==="1"?l=1:u==="2"?(c=1,l=1):u==="3"&&(c=1);let f=Math.pow(2,a-1);XFt(f,o,c,l),o[0]+=f*c,o[1]+=f*l}if(r%2===1){let s=o[0];o[0]=o[1],o[1]=s}return{face:r,ij:o,level:a}}function K2e(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<$Ft+JFt;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),i=t.substring(3,r),a=i.length/2,o=Gv.fromString(n,!0,2).toString(10),s="";if(a!==0)for(s=Gv.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return`${o}/${s}`}function Yq(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function W2e(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Jq(e){return[W2e(e[0]),W2e(e[1])]}function Xq(e,[t,r]){switch(e){case 0:return[1,t,r];case 1:return[-t,1,r];case 2:return[-t,-r,1];case 3:return[-1,-r,-t];case 4:return[r,-1,-t];case 5:return[r,t,-1];default:throw new Error("Invalid face")}}function Qq([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*H2e,n*H2e]}function XFt(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let i=t[0];t[0]=t[1],t[1]=i}}function $2e(e){let t=Yq(e.ij,e.level,[.5,.5]),r=Jq(t),n=Xq(e.face,r);return Qq(n)}var QFt=100;function Zq(e){let{face:t,ij:r,level:n}=e,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],a=Math.max(1,Math.ceil(QFt*Math.pow(2,-n))),o=new Float64Array(4*a*2+2),s=0,u=0;for(let c=0;c<4;c++){let l=i[c].slice(0),f=i[c+1],h=(f[0]-l[0])/a,p=(f[1]-l[1])/a;for(let d=0;d<a;d++){l[0]+=h,l[1]+=p;let b=Yq(r,n,l),g=Jq(b),x=Xq(t,g),E=Qq(x);Math.abs(E[1])>89.999&&(E[0]=u);let S=E[0]-u;E[0]+=S>180?-360:S<-180?360:0,o[s++]=E[0],o[s++]=E[1],u=E[0]}}return o[s++]=o[0],o[s++]=o[1],o}function zv(e){let t=ZFt(e);return V2e(t)}function ZFt(e){if(e.indexOf("/")>0)return e;let t=v_(e);return K2e(t)}function eN(e){let t=zv(e);return $2e(t)}function J2e(e){let t;if(e.face===2||e.face===5){let r=null,n=0;for(let i=0;i<4;i++){let a=`${e.face}/${i}`,o=zv(a),s=Zq(o);(typeof r>"u"||r===null)&&(r=new Float64Array(4*s.length)),r.set(s,n),n+=s.length}t=Y2e(r)}else{let r=Zq(e);t=Y2e(r)}return t}function Y2e(e){if(e.length%2!==0)throw new Error("Invalid corners");let t=[],r=[];for(let n=0;n<e.length;n+=2)t.push(e[n]),r.push(e[n+1]);return t.sort((n,i)=>n-i),r.sort((n,i)=>n-i),{west:t[0],east:t[t.length-1],north:r[r.length-1],south:r[0]}}function tN(e,t){let r=(t==null?void 0:t.minimumHeight)||0,n=(t==null?void 0:t.maximumHeight)||0,i=zv(e),a=J2e(i),o=a.west,s=a.south,u=a.east,c=a.north,l=[];return l.push(new ce(o,c,r)),l.push(new ce(u,c,r)),l.push(new ce(u,s,r)),l.push(new ce(o,s,r)),l.push(new ce(o,c,n)),l.push(new ce(u,c,n)),l.push(new ce(u,s,n)),l.push(new ce(o,s,n)),l}function lD(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=tN(t,r),i=eN(t),a=i[0],o=i[1],s=or.WGS84.cartographicToCartesian([a,o,r.maximumHeight]),u=new ce(s[0],s[1],s[2]);n.push(u);let c=e_(n);return[...c.center,...c.halfAxes]}var ekt=4,tkt=8,rkt={QUADTREE:ekt,OCTREE:tkt};function nkt(e,t,r){if(e!=null&&e.box){let n=v_(e.s2VolumeInfo.token),i=$q(n,t),a=Kq(i),o={...e.s2VolumeInfo};switch(o.token=a,r){case"OCTREE":let c=e.s2VolumeInfo,l=c.maximumHeight-c.minimumHeight,f=l/2,h=c.minimumHeight+l/2;c.minimumHeight=h-f,c.maximumHeight=h+f;break;default:break}return{box:lD(o),s2VolumeInfo:o}}}async function nN(e){let{implicitOptions:t,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,globalData:i={level:0,mortonIndex:0,x:0,y:0,z:0},s2VolumeBox:a,loaderOptions:o}=e,{subtree:s,level:u=0}=e,{subdivisionScheme:c,subtreeLevels:l,maximumLevel:f,contentUrlTemplate:h,subtreesUriTemplate:p,basePath:d}=t,b={children:[],lodMetricValue:0,contentUrl:""};if(!f)return Hq.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${h} won't be loaded...`),b;let g=u+i.level;if(g>f)return b;let x=rkt[c],E=Math.log2(x),S=n&1,F=n>>1&1,D=n>>2&1,j=(x**u-1)/(x-1),k=Md(r.mortonIndex,n,E),N=j+k,C=Md(r.x,S,1),I=Md(r.y,F,1),P=Md(r.z,D,1),U=!1;u>=l&&(U=rN(s.childSubtreeAvailability,k));let Y=Md(i.x,C,u*E),J=Md(i.y,I,u*E),re=Md(i.z,P,u*E);if(U){let Te=`${d}/${p}`,$e=fD(Te,g,Y,J,re);s=await An($e,iD,o),i.mortonIndex=k,i.x=C,i.y=I,i.z=P,i.level=u,k=0,N=0,C=0,I=0,P=0,u=0}if(!rN(s.tileAvailability,N))return b;rN(s.contentAvailability,N)&&(b.contentUrl=fD(h,g,Y,J,re));let ye=u+1,pe={mortonIndex:k,x:C,y:I,z:P};for(let Te=0;Te<x;Te++){let $e=nkt(a,Te,c),We=await nN({subtree:s,implicitOptions:t,loaderOptions:o,parentData:pe,childIndex:Te,level:ye,globalData:{...i},s2VolumeBox:$e});if(We.contentUrl||We.children.length){let oe=g+1,ne=ikt(We,oe,{childTileX:C,childTileY:I,childTileZ:P},t,a);b.children.push(ne)}}return b}function rN(e,t){let r;return Array.isArray(e)?(r=e[0],e.length>1&&Hq.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=e,"constant"in r?Boolean(r.constant):r.explicitBitstream?skt(t,r.explicitBitstream):!1}function ikt(e,t,r,n,i){let{basePath:a,refine:o,getRefine:s,lodMetricType:u,getTileType:c,rootLodMetricValue:l,rootBoundingVolume:f}=n,h=e.contentUrl&&e.contentUrl.replace(`${a}/`,""),p=l/2**t,d=i!=null&&i.box?{box:i.box}:f,b=akt(t,d,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:h},id:e.contentUrl,refine:s(o),type:c(e),lodMetricType:u,lodMetricValue:p,geometricError:p,transform:e.transform,boundingVolume:b}}function akt(e,t,r){if(t.region){let{childTileX:n,childTileY:i,childTileZ:a}=r,[o,s,u,c,l,f]=t.region,h=2**e,p=(u-o)/h,d=(c-s)/h,b=(f-l)/h,[g,x]=[o+p*n,o+p*(n+1)],[E,S]=[s+d*i,s+d*(i+1)],[F,D]=[l+b*a,l+b*(a+1)];return{region:[g,E,x,S,F,D]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${t}`)}function Md(e,t,r){return(e<<r)+t}function fD(e,t,r,n,i){let a=okt({level:t,x:r,y:n,z:i});return e.replace(/{level}|{x}|{y}|{z}/gi,o=>a[o])}function okt(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function skt(e,t){let r=Math.floor(e/8),n=e%8;return(t[r]>>n&1)===1}function aN(e,t=""){if(!t)return"empty";let n=t.split("?")[0].split(".").pop();switch(n){case"pnts":return"pointcloud";case"i3dm":case"b3dm":case"glb":case"gltf":return"scenegraph";default:return n||"empty"}}function oN(e){switch(e){case"REPLACE":case"replace":return 2;case"ADD":case"add":return 1;default:return e}}function iN(e="",t){if(/^[a-z][0-9a-z+.-]*:/i.test(t)){let n=new URL(e,`${t}/`);return decodeURI(n.toString())}else if(e.startsWith("/"))return e;return eu.resolve(t,e)}function X2e(e,t){var i;if(!e)return null;let r;if(e.content){let a=e.content.uri||((i=e.content)==null?void 0:i.url);r=iN(a,t)}return{...e,id:r,contentUrl:r,lodMetricType:"geometricError",lodMetricValue:e.geometricError,transformMatrix:e.transform,type:aN(e,r),refine:oN(e.refine)}}async function ewe(e,t,r){let n=null,i=Z2e(e.root);i&&e.root?n=await Q2e(e.root,e,t,i,r):n=X2e(e.root,t);let a=[];for(a.push(n);a.length>0;){let o=a.pop()||{},s=o.children||[],u=[];for(let c of s){let l=Z2e(c),f;l?f=await Q2e(c,e,t,l,r):f=X2e(c,t),f&&(u.push(f),a.push(f))}o.children=u}return n}async function Q2e(e,t,r,n,i){var S,F,D;let{subdivisionScheme:a,maximumLevel:o,availableLevels:s,subtreeLevels:u,subtrees:{uri:c}}=n,l=fD(c,0,0,0,0),f=iN(l,r),h=await An(f,iD,i),p=iN((S=e.content)==null?void 0:S.uri,r),d=(F=t==null?void 0:t.root)==null?void 0:F.refine,b=e.geometricError,g=(D=e.boundingVolume.extensions)==null?void 0:D["3DTILES_bounding_volume_S2"];if(g){let k={box:lD(g),s2VolumeInfo:g};e.boundingVolume=k}let x=e.boundingVolume,E={contentUrlTemplate:p,subtreesUriTemplate:c,subdivisionScheme:a,subtreeLevels:u,maximumLevel:Number.isFinite(s)?s-1:o,refine:d,basePath:r,lodMetricType:"geometricError",rootLodMetricValue:b,rootBoundingVolume:x,getTileType:aN,getRefine:oN};return await ukt(e,r,h,E,i)}async function ukt(e,t,r,n,i){if(!e)return null;let{children:a,contentUrl:o}=await nN({subtree:r,implicitOptions:n,loaderOptions:i}),s,u=null;return o&&(s=o,u={uri:o.replace(`${t}/`,"")}),{...e,id:s,contentUrl:s,lodMetricType:"geometricError",lodMetricValue:e.geometricError,transformMatrix:e.transform,type:aN(e,s),refine:oN(e.refine),content:u||e.content,children:a}}function Z2e(e){var t;return((t=e==null?void 0:e.extensions)==null?void 0:t["3DTILES_implicit_tiling"])||(e==null?void 0:e.implicitTiling)}var Ec={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:yv,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:ckt,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function ckt(e,t={},r){let n=t["3d-tiles"]||{},i;return n.isTileset==="auto"?i=(r==null?void 0:r.url)&&r.url.indexOf(".json")!==-1:i=n.isTileset,i?lkt(e,t,r):fkt(e,t,r)}async function lkt(e,t,r){var u;let n=JSON.parse(new TextDecoder().decode(e)),i=(r==null?void 0:r.url)||"",a=hkt(i),o=await ewe(n,a,t||{});return{...n,shape:"tileset3d",loader:Ec,url:i,queryString:(r==null?void 0:r.queryString)||"",basePath:a,root:o||n.root,type:"TILES3D",lodMetricType:"geometricError",lodMetricValue:((u=n.root)==null?void 0:u.geometricError)||0}}async function fkt(e,t,r){let n={content:{shape:"tile3d",featureIds:null}};return await Uq(e,0,t,r,n.content),n.content}function hkt(e){return eu.dirname(e)}var twe="https://api.cesium.com/v1/assets";async function rwe(e,t){if(!t){let a=await pkt(e);for(let o of a.items)o.type==="3DTILES"&&(t=o.id)}let r=await dkt(e,t),{type:n,url:i}=r;return Qt(n==="3DTILES"&&i),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function pkt(e){Qt(e);let t=twe,r={Authorization:`Bearer ${e}`},n=await Fo(t,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function dkt(e,t){Qt(e,t);let r={Authorization:`Bearer ${e}`},n=`${twe}/${t}`,i=await Fo(`${n}`,{headers:r});if(!i.ok)throw new Error(i.statusText);let a=await i.json();if(i=await Fo(`${n}/endpoint`,{headers:r}),!i.ok)throw new Error(i.statusText);let o=await i.json();return a={...a,...o},a}async function mkt(e,t={}){t=t["cesium-ion"]||{};let{accessToken:r}=t,n=t.assetId;if(!Number.isFinite(n)){let i=e.match(/\/([0-9]+)\/tileset.json/);n=i&&i[1]}return rwe(r,n)}var hD={...Ec,id:"cesium-ion",name:"Cesium Ion",preload:mkt,parse:async(e,t,r)=>(t={...t},t["3d-tiles"]=t["cesium-ion"],t.loader=hD,Ec.parse(e,t,r)),options:{"cesium-ion":{...Ec.options["3d-tiles"],accessToken:null}}};var lTe=$t(KU(),1),RIt="4.0.0-beta.8",$U={id:"zip",module:"zip",name:"Zip Archive",version:RIt,extensions:["zip"],mimeTypes:["application/zip"],category:"archive",tests:["PK"],options:{},parse:jIt};async function jIt(e,t={}){let r=[],n={};try{let i=new lTe.default;return(await i.loadAsync(e,t)).forEach((o,s)=>{let u=s.name,c=LIt(i,u,t).then(l=>{n[o]=l});r.push(c)}),await Promise.all(r),n}catch(i){throw t.log.error(`Unable to read zip archive: ${i}`),i}}async function LIt(e,t,r={}){try{return await e.file(t).async(r.dataType||"arraybuffer")}catch(n){return r.log.error(`Unable to read ${t} from zip archive: ${n}`),n}}var e2=async(e,t)=>{let r=[await e.getUint8(e.length-1n),await e.getUint8(e.length-2n),await e.getUint8(e.length-3n),void 0],n=0n;for(let i=e.length-4n;i>-1;i--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=await e.getUint8(i),r.every((a,o)=>a===t[o])){n=i;break}return n};var MIt=new Uint8Array([80,75,5,6]),qIt=new Uint8Array([80,75,6,7]),NIt=new Uint8Array([80,75,6,6]),UIt=8n,GIt=16n,zIt=8n,HIt=24n,WIt=48n,fTe=async e=>{let t=await e2(e,MIt),r=BigInt(await e.getUint16(t+UIt)),n=BigInt(await e.getUint32(t+GIt));if(n===BigInt(4294967295)||r===BigInt(4294967295)){let i=t-20n,a=await e.slice(i,i+4n);if(!Zu(a,qIt))throw new Error("zip64 EoCD locator not found");let o=await e.getBigUint64(i+zIt),s=await e.slice(o,o+4n);if(!Zu(s,NIt.buffer))throw new Error("zip64 EoCD not found");r=await e.getBigUint64(o+HIt),n=await e.getBigUint64(o+WIt)}return{cdRecordsNumber:r,cdStartOffset:n}};var VIt=20n,KIt=24n,$It=28n,YIt=30n,JIt=42n,YU=46n,n4=new Uint8Array([80,75,1,2]),t2=async(e,t)=>{let r=await t.slice(e,e+4n);if(!Zu(r,n4.buffer))return null;let n=BigInt(await t.getUint32(e+VIt)),i=BigInt(await t.getUint32(e+KIt)),a=await t.getUint16(e+YIt),o=await t.getUint16(e+$It),s=await t.slice(e+YU,e+YU+BigInt(o)),u=new TextDecoder().decode(s),c=e+YU+BigInt(o),l=await t.getUint32(e+JIt),f=BigInt(l),h=4n;return i===BigInt(4294967295)&&(i=await t.getBigUint64(c+h),h+=8n),n===BigInt(4294967295)&&(n=await t.getBigUint64(c+h),h+=8n),f===BigInt(4294967295)&&(f=await t.getBigUint64(c+h)),{compressedSize:n,uncompressedSize:i,extraFieldLength:a,fileNameLength:o,fileName:u,extraOffset:c,localHeaderOffset:f}};async function*i4(e){let{cdStartOffset:t}=await fTe(e),r=await t2(t,e);for(;r;)yield r,r=await t2(r.extraOffset+BigInt(r.extraFieldLength),e)}var XIt=8n,QIt=18n,ZIt=22n,ePt=26n,tPt=28n,a4=30n,hTe=new Uint8Array([80,75,3,4]),Zd=async(e,t)=>{let r=await t.slice(e,e+4n);if(!Zu(r,hTe))return null;let n=await t.getUint16(e+ePt),i=new TextDecoder().decode(await t.slice(e+a4,e+a4+BigInt(n))).split("\\").join("/"),a=await t.getUint16(e+tPt),o=e+a4+BigInt(n+a),s=await t.getUint16(e+XIt),u=BigInt(await t.getUint32(e+QIt)),c=BigInt(await t.getUint32(e+ZIt)),l=e+a4+BigInt(n),f=4n;return c===BigInt(4294967295)&&(c=await t.getBigUint64(l+f),f+=8n),u===BigInt(4294967295)&&(u=await t.getBigUint64(l+f),f+=8n),o===BigInt(4294967295)&&(o=await t.getBigUint64(l+f)),{fileNameLength:n,fileName:i,extraFieldLength:a,fileDataOffset:o,compressedSize:u,compressionMethod:s}};function JU(e){let t=new DataView(e),r={};for(let n=0;n<e.byteLength;n=n+24){let i=t.getBigUint64(n+16,!0),a=rPt(e,n,16);r[a]=i}return r}function rPt(e,t,r){return[...new Uint8Array(e,t,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}var mb=class{constructor(t){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(){}async compress(t){return await this.preload(),this.compressSync(t)}async decompress(t,r){return await this.preload(),this.decompressSync(t,r)}compressSync(t){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(t,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(t){let r=await this.concatenate(t);yield this.compress(r)}async*decompressBatches(t){let r=await this.concatenate(t);yield this.decompress(r)}concatenate(t){return zp(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var r2=class extends mb{name="uncompressed";extensions=[];contentEncodings=[];isSupported=!0;options;constructor(t){super(t),this.options=t||{}}compressSync(t){return t}decompressSync(t){return t}async*compressBatches(t){return yield*t}async*decompressBatches(t){return yield*t}};var e0=$t(PU(),1),Wl=$t(require("zlib"),1);var t0=class extends mb{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(t={}){super(t),this.options=t}async compress(t){var r,n;if(!gn&&((r=this.options.deflate)!=null&&r.useZlib)){let i=(n=this.options.deflate)!=null&&n.gzip?await Om(Wl.default.gzip)(t):await Om(Wl.default.deflate)(t);return fl(i)}return this.compressSync(t)}async decompress(t){var r,n;if(!gn&&((r=this.options.deflate)!=null&&r.useZlib)){let i=(n=this.options.deflate)!=null&&n.gzip?await Om(Wl.default.gunzip)(t):await Om(Wl.default.inflate)(t);return fl(i)}return this.decompressSync(t)}compressSync(t){var a,o,s,u;if(!gn&&((a=this.options.deflate)!=null&&a.useZlib)){let c=(o=this.options.deflate)!=null&&o.gzip?Wl.default.gzipSync(t):Wl.default.deflateSync(t);return fl(c)}let r=((s=this.options)==null?void 0:s.deflate)||{},n=new Uint8Array(t);return((u=this.options)!=null&&u.raw?e0.default.deflateRaw:e0.default.deflate)(n,r).buffer}decompressSync(t){var a,o,s,u;if(!gn&&((a=this.options.deflate)!=null&&a.useZlib)){let c=(o=this.options.deflate)!=null&&o.gzip?Wl.default.gunzipSync(t):Wl.default.inflateSync(t);return fl(c)}let r=((s=this.options)==null?void 0:s.deflate)||{},n=new Uint8Array(t);return((u=this.options)!=null&&u.raw?e0.default.inflateRaw:e0.default.inflate)(n,r).buffer}async*compressBatches(t){var i;let r=((i=this.options)==null?void 0:i.deflate)||{},n=new e0.default.Deflate(r);yield*this.transformBatches(n,t)}async*decompressBatches(t){var i;let r=((i=this.options)==null?void 0:i.deflate)||{},n=new e0.default.Inflate(r);yield*this.transformBatches(n,t)}async*transformBatches(t,r){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(let o of r){let s=new Uint8Array(o);if(!t.push(s,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),i=t.push(n,!0);yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){let t=this._chunks;return this._chunks=[],t}_getError(t=0){let r={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${r[t]}`}};var nPt={0:async e=>e,8:async e=>await new t0({raw:!0}).decompress(e)},n2=class{fileProvider=null;fileName;constructor(t){if(typeof t=="string")if(this.fileName=t,!gn)this.fileProvider=new Fx(t);else throw new Error("Cannot open file for random access in a WEB browser");else YI(t)&&(this.fileProvider=t)}async destroy(){this.fileProvider&&await this.fileProvider.destroy()}async readdir(){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let t=[],r=i4(this.fileProvider);for await(let n of r)t.push(n.fileName);return t}async stat(t){let r=await this.getCDFileHeader(t);return{...r,size:Number(r.uncompressedSize)}}async fetch(t){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=await this.getCDFileHeader(t),n=await Zd(r.localHeaderOffset,this.fileProvider);if(!n)throw new Error("Local file header has not been found in the zip archive`");let i=nPt[n.compressionMethod.toString()];if(!i)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(n.fileDataOffset,n.fileDataOffset+n.compressedSize),o=await i(a),s=new Response(o);return Object.defineProperty(s,"url",{value:`${this.fileName||""}/${t}`}),s}async getCDFileHeader(t){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=i4(this.fileProvider),n=null;for await(let i of r)if(i.fileName===t){n=i;break}if(!n)throw new Error("File has not been found in the zip archive");return n}};var iPt={0:e=>new r2().decompress(e),8:e=>new t0({raw:!0}).decompress(e)},o4=class{fileProvider;hashTable;constructor(t,r){this.fileProvider=t,this.hashTable=r}async getFile(t){let r=await this.getFileBytes(t.toLocaleLowerCase());if(r||(r=await this.getFileBytes(t)),!r)throw new Error(`No such file in the archive: ${t}`);return r}async getFileBytes(t){let r=new TextEncoder().encode(t).buffer,n=await new kx().hash(r,"hex"),i=this.hashTable[n];if(i===void 0)return null;let a=await Zd(i,this.fileProvider);if(!a)return null;let o=await this.fileProvider.slice(a.fileDataOffset,a.fileDataOffset+a.compressedSize),s=iPt[a.compressionMethod];if(!s)throw Error("Only Deflation compression is supported");return s(o)}};var i2=class extends n2{hashTable;constructor(t){super(t)}async fetch(t){let r=this.fileProvider;if(!r)throw new Error("No data detected in the zip archive");if(await this.parseHashTable(),this.hashTable){let i=await new o4(r,this.hashTable).getFile(t),a=new Response(i);return Object.defineProperty(a,"url",{value:`${this.fileName||""}/${t}`}),a}return super.fetch(t)}async parseHashTable(){if(this.hashTable!==void 0)return;let t=this.fileProvider;if(!t)throw new Error("No data detected in the zip archive");let r=await e2(t,n4),n=await t2(r,t);if((n==null?void 0:n.fileName)==="@3dtilesIndex1@"){let i=await Zd(n.localHeaderOffset,t);if(!i)throw new Error("corrupted 3tz");let a=i.fileDataOffset,o=await t.slice(a,a+i.compressedSize);this.hashTable=JU(o)}else this.hashTable=null}};function Lh(e,t,r){if(!t)return r+12;let{magic:i,version:a=1,byteLength:o=12}=e;return Qt(Array.isArray(i)&&Number.isFinite(a)&&Number.isFinite(o)),t.setUint8(r+0,i[0]),t.setUint8(r+1,i[1]),t.setUint8(r+2,i[2]),t.setUint8(r+3,i[3]),t.setUint32(r+4,a,!0),t.setUint32(r+8,o,!0),r+=12,r}function Mh(e,t,r){e&&e.setUint32(t+8,r,!0)}function pTe(e,t,r,n,i){e={magic:wh.COMPOSITE,tiles:[],...e};let a=r;r+=Lh(e,t,r),t&&t.setUint32(r,e.tiles.length,!0),r+=4;for(let o=0;o<e.tiles.length;++o)r+=i(e.tiles[o],t,r,n);return Mh(t,a,r-a),r}function dTe(e,t,r,n){let{featuresLength:i=0,batchTable:a}=e,s=JSON.stringify({BATCH_LENGTH:i}),u=a?JSON.stringify(a):"",c=Co(s.length,8),l=u?Co(u.length,8):0;e={magic:wh.BATCHED_MODEL,...e};let f=r;r=Lh(e,t,r),t&&(t.setUint32(12,c,!0),t.setUint32(16,0,!0),t.setUint32(20,l,!0),t.setUint32(24,0,!0)),r+=16,r=Bm(t,r,s,8),a&&(r=Bm(t,r,u,8));let h=e.gltfEncoded;return h&&(r=Cx(t,r,h,h.byteLength)),Mh(t,f,r-f),r}function mTe(e,t,r,n){let{featuresLength:i=1,gltfFormat:a=1,gltfUri:o=""}=e,s=o.length,u={INSTANCES_LENGTH:i,POSITION:new Array(i*3).fill(0)},c=JSON.stringify(u),l=c.length;e={magic:wh.INSTANCED_MODEL,...e};let f=r;return r=Lh(e,t,0),t&&(t.setUint32(12,l,!0),t.setUint32(16,0,!0),t.setUint32(20,0,!0),t.setUint32(24,0,!0),t.setUint32(28,a,!0)),r+=20,r+=km(t,r,c,l),r+=km(t,r,o,s),Mh(t,f,r-f),r}var aPt={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function gTe(e,t,r,n){let{featureTableJson:i=aPt}=e,a=JSON.stringify(i);a=zI(a,4);let{featureTableJsonByteLength:o=a.length}=e,s=new ArrayBuffer(12),u=s.byteLength;e={magic:wh.POINT_CLOUD,...e};let c=r;return r+=Lh(e,t,0),t&&(t.setUint32(r+0,o,!0),t.setUint32(r+4,u,!0),t.setUint32(r+8,0,!0),t.setUint32(r+12,0,!0)),r+=16,r+=km(t,r,a,o),r+=Cx(t,r,s,u),Mh(t,c,r-c),r}function QU(e,t){let r=XU(e,null,0,t),n=new ArrayBuffer(r),i=new DataView(n);return XU(e,i,0,t),n}function XU(e,t,r,n){switch(Qt(typeof e.type=="string"),e.type){case ms.COMPOSITE:return pTe(e,t,r,n,XU);case ms.POINT_CLOUD:return gTe(e,t,r,n);case ms.BATCHED_3D_MODEL:return dTe(e,t,r,n);case ms.INSTANCED_3D_MODEL:return mTe(e,t,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var ZU={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:yv,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],encodeSync:oPt,binary:!0,options:{["3d-tiles"]:{}}};function oPt(e,t){return QU(e,t)}var Na=require("path");var vTe=$t(require("crypto")),u4=new Uint8Array(256),s4=u4.length;function eG(){return s4>u4.length-16&&(vTe.default.randomFillSync(u4),s4=0),u4.slice(s4,s4+=16)}var wa=[];for(let e=0;e<256;++e)wa.push((e+256).toString(16).slice(1));function bTe(e,t=0){return(wa[e[t+0]]+wa[e[t+1]]+wa[e[t+2]]+wa[e[t+3]]+"-"+wa[e[t+4]]+wa[e[t+5]]+"-"+wa[e[t+6]]+wa[e[t+7]]+"-"+wa[e[t+8]]+wa[e[t+9]]+"-"+wa[e[t+10]]+wa[e[t+11]]+wa[e[t+12]]+wa[e[t+13]]+wa[e[t+14]]+wa[e[t+15]]).toLowerCase()}var yTe=$t(require("crypto")),tG={randomUUID:yTe.default.randomUUID};function sPt(e,t,r){if(tG.randomUUID&&!t&&!e)return tG.randomUUID();e=e||{};let n=e.random||(e.rng||eG)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return bTe(n)}var Bc=sPt;var C0=$t(require("process"),1),nk=$t(_u(),1),VW=$t(aG(),1);var Jb=require("path"),yke=$t(_u(),1);var kTe=()=>({folderPattern:{path:"folderPattern",default:"BASIC"},archiveCompressionType:{path:"archiveCompressionType",default:"STORE"},resourceCompressionType:{path:"resourceCompressionType",default:"GZIP"},I3SVersion:{path:"I3SVersion",default:"1.8"},nodeCount:{path:"nodeCount"}});var $b=require("fs"),Yb=require("path");var mke=require("zlib"),gke=require("path"),nw=require("fs"),IVt=$t(dke(),1);var PVt=$t(KU(),1);var RVt=$t(rG(),1);function VF(e){let t=`${e}.gz`,r=(0,mke.createGzip)(),n=(0,nw.createReadStream)(e),i=(0,nw.createWriteStream)(t);return new Promise((a,o)=>{n.on("end",()=>{console.log(`${t} compressed and saved.`),a(t)}),n.on("error",s=>{console.log(`${t}: compression error!`),o(s)}),n.pipe(r).pipe(i)})}async function vke(e,t,r,n,i){process.platform==="win32"?await LVt(e,t,r,n,i):await jVt(e,t,r,n)}async function jVt(e,t,r=0,n="."){let i=iw(t),a=[`-${r}`,"-r",i,n];await new ll().start({command:"zip",arguments:a,spawn:{cwd:e},wait:0})}async function LVt(e,t,r=0,n=(0,gke.join)(".","*"),i){n[0]==="@"&&(n=`*${n.substr(1)}`);let a=iw(t),o=["a","-tzip",`-mx=${r}`,a,n];await new ll().start({command:i,arguments:o,spawn:{cwd:`${e}`},wait:0})}async function Fi(e,t,r="index.json"){let n;t instanceof Promise?n=new Uint8Array(await t):t instanceof ArrayBuffer?n=new Uint8Array(t):n=t,await $b.promises.mkdir(e,{recursive:!0});let i=(0,Yb.join)(e,r);try{await $b.promises.writeFile(i,n)}catch(a){throw a}return console.log(`${i} saved.`),i}async function Mc(e,t,r="index.json",n=!0,i){let a=await Fi(e,t,r);if(n){if(i)return i.includes(a)?null:(i.push(a),`${a}.gz`);{let o=await VF(a);return await OW(a),o}}return a}async function KF(e,t){return new Promise((r,n)=>{let i=0;console.log(`load ${e}/${t}.`);let a=setInterval(()=>{let o=(0,Yb.join)(e,t);An(o,VI).then(s=>{clearInterval(a),r(s)}).catch(()=>{i++,i>100&&(clearInterval(a),n(new Error(`Cannon load ${e}/${t}.`)))})},200)})}async function bke(e){try{return await $b.promises.stat(e),!0}catch{return!1}}function aw(e){return $b.promises.rm(e,{recursive:!0})}function OW(e){return $b.promises.unlink(e)}function iw(e){return(0,Yb.isAbsolute)(e)?e:(0,Yb.join)(process.cwd(),e)}var Za=class{nodesPerPage;nodesCounter;writeFile;converter;nodePages;length=0;constructor(t,r,n){this.nodesPerPage=r,this.nodesCounter=0,this.nodePages=[{}],this.nodePages[0].nodes=[],this.writeFile=t,this.converter=n,this.length=0}useWriteFunction(t){this.writeFile=t}getNodePageFileName(t){let r,n;return this.converter.options.slpk?(r=(0,Jb.join)(this.converter.layers0Path,"nodepages"),n=`${t.toString()}.json`):(r=(0,Jb.join)(this.converter.layers0Path,"nodepages",t.toString()),n="index.json"),{filePath:r,fileName:n}}async loadNodePage(t){let{filePath:r,fileName:n}=this.getNodePageFileName(t),i=(0,Jb.join)(r,n);return await bke(i)?(console.log(`load ${i}.`),await KF(r,n)):{nodes:[]}}getPageIndexByNodeId(t){return Math.floor(t/this.nodesPerPage)}async getPageByNodeId(t){let r=this.getPageIndexByNodeId(t);return this.converter.options.instantNodeWriting?await this.loadNodePage(r):this.nodePages[r]}async getNodeById(t,r){let n=t%this.nodesPerPage;return r=r||await this.getPageByNodeId(t),r.nodes[n]}async addChildRelation(t,r){var i;if(t==null)return;let n=await this.getNodeById(t);(i=n.children)==null||i.push(r),await this.saveNode(n)}async push(t,r){if(t.index=this.nodesCounter++,!this.converter.options.instantNodeWriting){let n=this.nodePages[this.nodePages.length-1];n.nodes.length===this.nodesPerPage&&(n={nodes:[]},this.nodePages.push(n)),n.nodes.push(t)}return await this.addChildRelation(r,t.index),Za.updateResourceInMesh(t),await this.saveNode(t),t}async saveNode(t){if(this.converter.options.instantNodeWriting){let r=this.getPageIndexByNodeId(t.index),n=await this.getPageByNodeId(t.index),{filePath:i,fileName:a}=this.getNodePageFileName(r),o=await this.getNodeById(t.index,n);o?Za.updateAll(o,t):n.nodes.push(t);let s=JSON.stringify(n);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodePages/${r.toString()}.json.gz`,writePromise:()=>this.writeFile(i,s,a,!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>this.writeFile(i,s)},!0)}else return}async saveMetadata(){let t=(0,yke.default)({nodeCount:this.nodesCounter},kTe()),r=!1;await this.converter.writeQueue.enqueue({archiveKey:"metadata.json",writePromise:()=>this.writeFile(this.converter.layers0Path,JSON.stringify(t),"metadata.json",r)})}async save(){if(this.converter.options.instantNodeWriting){await this.saveMetadata();return}if(this.converter.options.slpk){for(let[t,r]of this.nodePages.entries()){let n=JSON.stringify(r),i=(0,Jb.join)(this.converter.layers0Path,"nodepages");await this.converter.writeQueue.enqueue({archiveKey:`nodePages/${t.toString()}.json.gz`,writePromise:()=>this.writeFile(i,n,`${t.toString()}.json`)})}await this.saveMetadata()}else for(let[t,r]of this.nodePages.entries()){let n=JSON.stringify(r),i=(0,Jb.join)(this.converter.layers0Path,"nodepages",t.toString());await this.converter.writeQueue.enqueue({writePromise:()=>this.writeFile(i,n)})}}static updateResourceInMesh(t){t.mesh&&isFinite(t.index)&&(t.mesh.geometry.resource=t.index)}static updateAll(t,r){return Object.assign(t,r,{index:t.index}),Za.updateResourceInMesh(t),t}static updateMaterialByNodeId(t,r){t.mesh&&(t.mesh.material={definition:r,resource:t.index})}static updateVertexCountByNodeId(t,r){t.mesh&&(t.mesh.geometry.vertexCount=r)}static updateNodeAttributeByNodeId(t){!t.mesh||!t.index||(t.mesh.attribute.resource=t.index)}static updateFeatureCountByNodeId(t,r){t.mesh&&(t.mesh.geometry.featureCount=r)}static updateTexelCountHintByNodeId(t,r){!t.mesh||!t.mesh.material||(t.mesh.material.texelCountHint=r)}};var ow=require("path"),$F=require("fs");function YF(e){let r=e[0],n=Math.floor(r/3600);r=r-n*3600;let i=Math.floor(r/60);r=r-i*60;let a=Math.floor(r),o=e[1]/1e6,s="";return n&&(s+=`${n}h `),i&&(s+=`${i}m `),a&&(s+=`${a}s`),s||(s+=`${o}ms`),s}async function JF(e){let{slpk:t,outputPath:r,tilesetName:n}=e,i=iw(r);try{if(t){let s=(0,ow.join)(i,`${n}.slpk`);return(await $F.promises.stat(s)).size}let a=(0,ow.join)(i,n);return await xke(a)}catch(a){return console.log("Calculate file sizes error: ",a),null}}async function xke(e){let t=0,r=await $F.promises.readdir(e);for(let n of r){let i=await $F.promises.stat((0,ow.join)(e,n));i.isDirectory()?t+=await xke((0,ow.join)(e,n)):t+=i.size}return t}var Hke=$t(aG(),1);var T0=3,Xb=9;function wke(e){let{positions:t,normals:r,texCoords:n,colors:i,uvRegions:a,featureIndices:o}=e,s=t.length/Xb;if(!o.length)return{faceRange:new Uint32Array([0,s-1]),featureIds:[0],featureCount:1,positions:t,normals:r,texCoords:n,colors:i,uvRegions:a};let u=MVt(o),c=qVt({...u,...e}),l=NVt(c);return UVt(l,u.featureCount)}function MVt(e){let t=1,r=1,n=_ke(e.slice(0,T0)),i=[],a=[],o=[n];i[0]=0,a[0]=n;for(let c=T0;c<e.length;c+=T0){let l=_ke(e.slice(c,c+T0));n!==l&&(i[t]=c/T0-1,i[t+1]=c/T0,a[r]=l,o.includes(l)||o.push(l),t+=2,r+=1),n=l}i[t]=e.length/T0-1;let s=new Uint32Array(i),u=o.length;return{faceRange:s,featureCount:u,featureIds:a}}function _ke(e){let t={},r=e[0],n=1;for(let i of e)t[i]=(t[i]||0)+1,n=n>t[i]?n:t[i],r=n>t[i]?r:i;return r}function qVt(e){let{featureIds:t,positions:r,normals:n,colors:i,uvRegions:a,texCoords:o,faceRange:s=new Uint32Array(0)}=e,u=[],c=new Float32Array(r),l=new Float32Array(n),f=new Uint8Array(i),h=new Float32Array(o),p=new Uint16Array(a),d=0,b=0,g=0,x=0,E=0;for(let S=0;S<t.length;S++){let F=s[S*2],D=s[S*2+1],j=sw("positions",F,D),k=sw("normals",F,D),N=sw("colors",F,D),C=sw("uvRegions",F,D),I=sw("texCoords",F,D);u.push({featureId:t[S],positions:c.subarray(d,d+j),normals:l.subarray(b,b+k),colors:f.subarray(g,g+N),uvRegions:p.subarray(x,x+C),texCoords:h.subarray(E,E+I)}),d+=j,b+=k,g+=N,x+=C,E+=I}return u}function sw(e,t,r){let a=r-t+1,o=a*3;switch(e){case"positions":case"normals":return a*Xb;case"colors":case"uvRegions":return o*4;case"texCoords":return o*2;default:return 0}}function NVt(e){let t=[];for(let n of e){let i=t.find(a=>a.featureId===n.featureId);i?i.attributes.push(n):t.push({featureId:n.featureId,attributes:[n]})}let r=[];for(let n of t){let i=Eke(n.attributes);r.push({featureId:n.featureId,...i})}return r}function UVt(e,t){let n=[e[0].featureId||0],i=[0],a=0,o=0;for(let c=1;c<e.length;c++){let l=e[c];n.push(l.featureId||0);let f=e[a];i.push(f.positions.length/Xb-1+o),i.push(f.positions.length/Xb+o),o+=f.positions.length/Xb,a+=1}let s=Eke(e);return i.push(s.positions.length/Xb-1),{faceRange:new Uint32Array(i),featureIds:n,featureCount:t,...s}}function Eke(e){let t=e.map(({positions:f})=>f),r=t.length>1?To(...t):t[0],n=e.map(({normals:f})=>f),i=n.length>1?To(...n):n[0],a=e.map(({colors:f})=>f),o=a.length>1?To(...a):a[0],s=e.map(({texCoords:f})=>f),u=s.length>1?To(...s):s[0],c=e.map(({uvRegions:f})=>f),l=c.length>1?To(...c):c[0];return{positions:r,normals:i,colors:o,texCoords:u,uvRegions:l}}function IW(e,t){let r,n,i,a=or.WGS84.cartesianToCartographic(e.center,new ce);return a[2]=a[2]-t.getHeight(a[1],a[0]),e instanceof aa?(n=e.halfSize,r=new ce(n[0],n[1],n[2]).len(),i=e.quaternion):(r=e.radius,n=[r,r,r],i=new ps().fromMatrix3(new Rr([n[0],0,0,0,n[1],0,0,0,n[2]])).normalize()),{mbs:[a[0],a[1],a[2],r],obb:{center:[a[0],a[1],a[2]],halfSize:n,quaternion:i}}}function Ake(e,t){let r=GVt(e),n=e_(r),i=L7(r),a=or.WGS84.cartesianToCartographic(i.center,new ce),o=or.WGS84.cartesianToCartographic(n.center,new ce);return a[2]=a[2]-t.getHeight(a[1],a[0]),o[2]=o[2]-t.getHeight(o[1],o[0]),{mbs:[a[0],a[1],a[2],i.radius],obb:{center:o,halfSize:n.halfSize,quaternion:n.quaternion}}}function GVt(e){let t=[];for(let r=0;r<e.length;r+=3){let n=new ce([e[r],e[r+1],e[r+2]]);t.push(n)}return t}function Ske(e){let t;e instanceof Ya?t=e:t=e.getBoundingSphere();let r=t.center,n=t.radius,i=or.WGS84.cartesianToCartographic(new ce(r[0]+n,r[1]+n,r[2]+n),new ce),a=or.WGS84.cartesianToCartographic(new ce(r[0]-n,r[1]-n,r[2]-n),new ce);return{xmin:Math.min(a[0],i[0]),xmax:Math.max(a[0],i[0]),ymin:Math.min(a[1],i[1]),ymax:Math.max(a[1],i[1]),zmin:Math.min(a[2],i[2]),zmax:Math.max(a[2],i[2])}}function PW(e){let t=e[3],r=new ce(e[0],e[1],e[2]),n=new Rr([t,0,0,0,t,0,0,0,t]);return new aa(r,n)}function Tke(e,t,r){var s,u,c,l,f,h,p,d;let n=((u=(s=e.gltf)==null?void 0:s.scene)==null?void 0:u.nodes)||((f=(l=(c=e.gltf)==null?void 0:c.scenes)==null?void 0:l[0])==null?void 0:f.nodes)||((h=e.gltf)==null?void 0:h.nodes)||[],i=((d=(p=e.gltf)==null?void 0:p.images)==null?void 0:d.map(b=>{var g,x;if((g=b==null?void 0:b.image)!=null&&g.compressed)return null;{let E=(x=b==null?void 0:b.image)==null?void 0:x.data,S=new Uint8Array(E.length);return S.set(E),{data:S,compressed:!1,height:b.image.height,width:b.image.width,components:b.image.components,mimeType:b.mimeType}}}))||[];Cke(n);let{cartographicOrigin:a,modelMatrix:o}=HVt(e,t,r);return{nodes:n,images:i,cartographicOrigin:a,cartesianModelMatrix:o}}function zVt(e){let t={};for(let r in e)t[r]={value:e[r].value};return t}function HVt(e,t,r){let{rtcCenter:n,gltfUpAxis:i}=e,{center:a}=r,o=new Kr(t);switch(n&&o.translate(n),i){case"Z":break;case"Y":let c=new Kr().rotateX(Math.PI/2);o=o.multiplyRight(c);break;case"X":let l=new Kr().rotateY(-Math.PI/2);o=o.multiplyRight(l);break;default:break}let s=new ce(a),u=or.WGS84.cartesianToCartographic(s,new ce);return{modelMatrix:o,cartographicOrigin:u}}function Cke(e){var t;for(let r=0;r<e.length;r++){let n=e[r];n.mesh&&(e[r]={...n,mesh:{...n.mesh,primitives:(t=n.mesh)==null?void 0:t.primitives.map(i=>{var a,o,s;return{...i,indices:{value:(a=i==null?void 0:i.indices)==null?void 0:a.value},attributes:zVt(i.attributes),material:{id:(o=i==null?void 0:i.material)==null?void 0:o.id,uniqueId:(s=i==null?void 0:i.material)==null?void 0:s.uniqueId}}})}}),n.children&&Cke(n.children)}}function Dke(e,t){var n,i;let r=(i=(n=e.gltf)==null?void 0:n.extensions)==null?void 0:i[gs];if(!(r!=null&&r.featureTextures))return null;for(let a in r.featureTextures)if(r.featureTextures[a].class===t)return a;return null}function Fke(e,t,r,n){let i=t==null?void 0:t.extensions;if(!i)return[];for(let[a,o]of Object.entries(i||{}))switch(a){case gs:return VVt(e,o,r,n);case N8:return WVt(e,o);default:return[]}return[]}function WVt(e,t){for(let r of t.featureIds)if(typeof r.propertyTable<"u")return r.data;return[]}function VVt(e,t,r,n){var o,s,u,c,l,f,h;let i=(o=t==null?void 0:t.featureIdAttributes)==null?void 0:o[0];if((s=i==null?void 0:i.featureIds)!=null&&s.attribute)return e[i.featureIds.attribute].value;if((u=i==null?void 0:i.featureIds)!=null&&u.hasOwnProperty("constant")&&((c=i==null?void 0:i.featureIds)!=null&&c.hasOwnProperty("divisor"))){let p=((l=e==null?void 0:e.POSITIONS)==null?void 0:l.value.length)/3||0;return KVt(p,i.featureIds.constant,i.featureIds.divisor)}let a=(t==null?void 0:t.featureIdTextures)&&(t==null?void 0:t.featureIdTextures[0]);if(a){let d=`TEXCOORD_${((h=(f=a==null?void 0:a.featureIds)==null?void 0:f.texture)==null?void 0:h.texCoord)||0}`,b=e[d].value;return $Vt(a,b,r)}return n?e[n].value:[]}function KVt(e,t=0,r=0){let n=[];if(r>0){let i=t,a=r;for(let o=0;o<e;o++)n.push(i),a-=1,a===0&&(i++,a=r)}else n=Array(e).fill(t,0,e);return n}function $Vt(e,t,r){var c,l,f;if(!(r!=null&&r.length))return[];let n={r:0,g:1,b:2,a:3},i=(l=(c=e==null?void 0:e.featureIds)==null?void 0:c.texture)==null?void 0:l.index,a=(f=e==null?void 0:e.featureIds)==null?void 0:f.channels;if(!a||i===void 0)return[];let o=r[i],s=[],u=n[a];if(o&&(o!=null&&o.width)&&(o!=null&&o.height)&&(o!=null&&o.components))for(let h=0;h<t.length;h+=2){let p=t[h],d=t[h+1],b=Math.min(kd(p)*o.width|0,o.width-1),x=(Math.min(kd(d)*o.height|0,o.height-1)*o.width+b)*o.components+u,E=new Uint8Array(o.data)[x];s.push(E)}else console.warn(`Can't get batch Ids from ${(o==null?void 0:o.mimeType)||""} compressed texture`);return s}function Bke(e,t){let r={};for(let n in t){let i=t[n];r[n]=YVt(i,e)}return r}function YVt(e,t){let r=[];if(e)for(let n in t){let i=e[n]||null;r.push(i)}return r}function Oke(e,t){let r=!1;for(let n of Object.values(t))(!e||!n||e.length!==n.length)&&(r=!0);return r}var qc="string",uw="Int32",cw="double",Ike="OBJECTID";function JVt(e){return typeof e===qc||typeof e=="bigint"?qc:typeof e=="number"?Number.isInteger(e)?uw:cw:qc}function Pke(e,t,r){let n={key:`f_${e}`,name:t,ordering:["attributeValues"],header:[{property:"count",valueType:"UInt32"}],attributeValues:{valueType:"Int32",valuesPerElement:1}};switch(r){case Ike:XVt(n);break;case qc:kke(n);break;case cw:QVt(n);break;case uw:break;default:kke(n)}return n}function Rke(e){switch(e){case Ike:return"esriFieldTypeOID";case qc:return"esriFieldTypeString";case uw:return"esriFieldTypeInteger";case cw:return"esriFieldTypeDouble";default:return"esriFieldTypeString"}}function jke(e,t){return{name:e,type:t,alias:e}}function Lke(e){let t="{OBJECTID}",r=[],n=[],i=[],a=[];for(let o of e)n.push({fieldName:o,visible:!0,isEditable:!1,label:o});return i.push({fieldInfos:n,type:"fields"}),{title:t,mediaInfos:r,popupElements:i,fieldInfos:n,expressionInfos:a}}function kke(e){e.ordering.unshift("attributeByteCounts"),e.header.push({property:"attributeValuesByteCount",valueType:"UInt32"}),e.attributeValues={valueType:"String",encoding:"UTF-8",valuesPerElement:1},e.attributeByteCounts={valueType:"UInt32",valuesPerElement:1}}function XVt(e){e.attributeValues={valueType:"Oid32",valuesPerElement:1}}function QVt(e){e.attributeValues={valueType:"Float64",valuesPerElement:1}}function Mke(e){let t={};for(let r in e){let n=e[r][0],i=JVt(n);t[r]=i}return t}var qke=(e,t)=>{var a,o,s,u,c,l,f,h;let r={},n=(u=(s=(o=(a=e.extensions)==null?void 0:a[gs])==null?void 0:o.schema)==null?void 0:s.classes)==null?void 0:u[t];if(n){for(let p in n.properties){let d=n.properties[p],b=ZVt(d);r[p]=b}return r}let i=(h=(f=(l=(c=e.extensions)==null?void 0:c[Ol])==null?void 0:l.schema)==null?void 0:f.classes)==null?void 0:h[t];if(i){for(let p in i.properties){let d=i.properties[p],b=eKt(d);r[p]=b}return r}return null},ZVt=e=>{let t;switch(e.type){case"INT8":case"UINT8":case"INT16":case"UINT16":case"INT32":case"UINT32":t=uw;break;case"FLOAT32":case"FLOAT64":t=cw;break;case"INT64":case"UINT64":case"BOOLEAN":case"ENUM":case"STRING":case"ARRAY":t=qc;break;default:t=qc;break}return t},eKt=e=>{let t;if(e.array)t=qc;else switch(e.componentType){case"INT8":case"UINT8":case"INT16":case"UINT16":case"INT32":case"UINT32":t=uw;break;case"FLOAT32":case"FLOAT64":t=cw;break;case"INT64":case"UINT64":t=qc;break;default:t=qc;break}return t};var XF=e=>{let t=new Uint32Array(e);for(let r=0;r<e;r++)t[r]=r;return t};var tKt=1,rKt=1,Eu=3,lw=2,nKt=4,iKt="string",aKt="Int32",oKt="Float64",sKt="Oid32",Nke=["CUSTOM_ATTRIBUTE_2","_BATCHID","BATCHID"],bp=new ce;async function RW(e,t,r,n,i,a,o,s,u,c,l,f,h){var S;let p=u,d=await wKt((S=e.gltf)==null?void 0:S.materials,c),b=Tke(e,t,r),g=Dke(e,h),x=await lKt(b,d,p,g);u&&uKt(x,l);let E=[];for(let F of d){let D=F.mergedMaterials[0].originalMaterialId;if(!x.has(D))continue;let j=x.get(D);if(!j)continue;let{material:k,texture:N}=F,C=await n();E.push(await cKt({convertedAttributes:j,material:k,texture:N,tileContent:e,nodeId:C,featuresHashArray:a,propertyTable:i,attributeStorageInfo:o,draco:s,libraries:f}))}return E.length?E:null}function uKt(e,t){for(let r of e.values()){let n=Ake(r.positions,t);r.boundingVolumes=n;let i=n.obb.center;for(let a=0;a<r.positions.length;a+=Eu){let o=r.positions.subarray(a,a+Eu);or.WGS84.cartesianToCartographic(Array.from(o),bp),bp[2]=bp[2]-t.getHeight(bp[1],bp[0]),bp=bp.subtract(i),r.positions.set(bp,a)}}}async function cKt({convertedAttributes:e,material:t,texture:r,tileContent:n,nodeId:i,featuresHashArray:a,propertyTable:o,attributeStorageInfo:s,draco:u,libraries:c}){var I;let l=e.boundingVolumes,f=e.positions.length/Eu,{faceRange:h,featureIds:p,positions:d,normals:b,colors:g,uvRegions:x,texCoords:E,featureCount:S}=wke(e),F={};o&&(F=IKt(p,e.featureIndices,a,o));let D=new Uint32Array(2),j=GKt(p);D.set([f,S],0);let k=new Uint8Array(ec(D.buffer,d.buffer,b.buffer,r?E.buffer:new ArrayBuffer(0),g.buffer,x,j.buffer,h.buffer)),N=u?zKt(f,e,{positions:d,normals:b,texCoords:r?E:new Float32Array(0),colors:g,uvRegions:x,featureIds:p,faceRange:h},c):null,C=[];return s&&o&&(C=LKt(p,F,o,s)),{nodeId:i,geometry:k,compressedGeometry:N,texture:r,hasUvRegions:Boolean(x.length),sharedResources:DKt(((I=n.gltf)==null?void 0:I.materials)||[],i),meshMaterial:t,vertexCount:f,attributes:C,featureCount:S,boundingVolumes:l}}async function lKt(e,t,r,n){let{nodes:i,images:a,cartographicOrigin:o,cartesianModelMatrix:s}=e,u=new Map;for(let c of t){let l={positions:new Float32Array(0),normals:new Float32Array(0),texCoords:new Float32Array(0),colors:new Uint8Array(0),uvRegions:new Uint16Array(0),featureIndicesGroups:[],featureIndices:[],boundingVolumes:null,mergedMaterials:c.mergedMaterials};for(let f of c.mergedMaterials)u.set(f.originalMaterialId,l)}Wke(i,a,o,s,u,r,void 0,n);for(let c of u.keys()){let l=u.get(c);if(l){if(l.positions.length===0){u.delete(c);continue}l.featureIndicesGroups&&(l.featureIndices=l.featureIndicesGroups.reduce((f,h)=>f.concat(h)),delete l.featureIndicesGroups)}}return u}function Wke(e,t,r,n,i,a,o=new Kr([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),s){if(e)for(let u of e)hKt(u,t,r,n,i,a,o,s)}function fKt(e,t){let r=t,{matrix:n,rotation:i,scale:a,translation:o}=e;return n&&(r=t.multiplyRight(n)),o&&(r=r.translate(o)),i&&(r=r.rotateXYZ(i)),a&&(r=r.scale(a)),r}function hKt(e,t,r,n,i,a,o=new Kr([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),s){let u=fKt(e,o),c=e.mesh;c&&pKt(c,t,r,n,i,a,u,s),Wke(e.children||[],t,r,n,i,a,u,s)}function pKt(e,t,r,n,i,a=!1,o=new Kr([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),s){var u;for(let c of e.primitives){let l=null,f;c.material?(l=i.get(c.material.id),f=(u=l==null?void 0:l.mergedMaterials.find(({originalMaterialId:d})=>{var b;return d===((b=c.material)==null?void 0:b.id)}))==null?void 0:u.uvRegion):i.has("default")&&(l=i.get("default")),Qt(l!==null,"Primitive - material mapping failed"),Qt(c.mode===void 0||c.mode===Ht.TRIANGLES||c.mode===Ht.TRIANGLE_STRIP,`Primitive - unsupported mode ${c.mode}`);let h=c.attributes;if(!l)continue;let p=dKt(c);l.positions=To(l.positions,Uke({vertices:h.POSITION.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:p,attributeSpecificTransformation:mKt,useCartesianPositions:a})),l.normals=To(l.normals,Uke({vertices:h.NORMAL&&h.NORMAL.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:p,attributeSpecificTransformation:gKt,useCartesianPositions:!1})),l.texCoords=To(l.texCoords,vKt(h.TEXCOORD_0&&h.TEXCOORD_0.value,p)),l.colors=To(l.colors,bKt(h.COLOR_0,p)),f&&(l.uvRegions=To(l.uvRegions,yKt(f,p))),l.featureIndicesGroups=l.featureIndicesGroups||[],l.featureIndicesGroups.push(xKt(_Kt(h,c,t,s),p))}}function dKt(e){var r;let t=(r=e.indices)==null?void 0:r.value;if(!t){let n=e.attributes.POSITION.value;return XF(n.length/Eu)}if(t&&e.mode===Ht.TRIANGLE_STRIP){let n=t.constructor,i=new n((t.length-2)*3),a=0,o=t.slice(0,3);i.set(o,0);for(let s=1;s+2<t.length;s++)a+=3,o=t.slice(s,s+3),s%2===0?i.set(o,a):i.set(o.reverse(),a);t=i}return t}function Uke(e){let{vertices:t,indices:r,attributeSpecificTransformation:n}=e,i=new Float32Array(r.length*Eu);if(!t)return i;for(let a=0;a<r.length;a++){let o=r[a]*Eu,s=t.subarray(o,o+Eu),u=new ce(Array.from(s));u=n(u,e),i[a*Eu]=u.x,i[a*Eu+1]=u.y,i[a*Eu+2]=u.z}return i}function mKt(e,t){let{cartesianModelMatrix:r,cartographicOrigin:n,nodeMatrix:i,useCartesianPositions:a}=t;return i&&(e=e.transform(i)),e=e.transform(r),a||(or.WGS84.cartesianToCartographic([e[0],e[1],e[2]],e),e=e.subtract(n)),e}function gKt(e,t){let{cartesianModelMatrix:r,nodeMatrix:n}=t;return n&&(e=e.transformAsVector(n)),e=e.transformAsVector(r),e}function vKt(e,t){let r=new Float32Array(t.length*lw);if(!e)return r.fill(1),r;for(let n=0;n<t.length;n++){let i=t[n]*lw,a=e.subarray(i,i+lw);r[n*lw]=a[0],r[n*lw+1]=a[1]}return r}function bKt(e,t){let r=(e==null?void 0:e.components)||nKt,n=new Uint8Array(t.length*r);if(!e)return n.fill(255),n;let i=e.value;for(let a=0;a<t.length;a++){let o=t[a]*r,s=i.subarray(o,o+r),u=new Uint8Array(r);for(let c=0;c<s.length;c++)u[c]=s[c]*255;n.set(u,a*r)}return n}function yKt(e,t){let r=new Uint16Array(t.length*4);for(let n=0;n<r.length;n+=4)r.set(e,n);return r}function xKt(e,t){if(!e.length||!t.length)return[];let r=[];for(let n=0;n<t.length;n++){let i=t[n];r.push(e[i])}return r}function _Kt(e,t,r,n){let i=Fke(e,t,r,n);if(i.length)return i;for(let a=0;a<Nke.length;a++){let o=Nke[a];if(e[o]&&e[o].value)return e[o].value}return[]}async function wKt(e=[],t){let r=[];for(let n of e)r.push(SKt(n));return t&&(r=await EKt(r)),r}async function EKt(e){var r,n;let t=[];for(;e.length>0;){let i=e.splice(0,1)[0],a=[];for(let o=0;o<e.length;o++){let s=e[o];(i.texture&&s.texture||!i.texture&&!s.texture)&&(i=await AKt(i,s),a.push(o))}if(i.texture&&a.length){let o=(r=i.mergedMaterials)==null?void 0:r.reduce((c,{textureSize:l})=>c+((l==null?void 0:l.width)||0),0),s=(n=i.mergedMaterials)==null?void 0:n.reduce((c,{textureSize:l})=>Math.max(c,(l==null?void 0:l.height)||0),0),u=-1;for(let c of i.mergedMaterials)if(c.textureSize){let l=u+1+c.textureSize.width/o*2**(Uint16Array.BYTES_PER_ELEMENT*8)-1;c.uvRegion=new Uint16Array([u+1,0,l,c.textureSize.height/s*2**(Uint16Array.BYTES_PER_ELEMENT*8)-1]),u=l}i.texture.image.width=o,i.texture.image.height=s}for(let o of a.reverse())e.splice(o,1);t.push(i)}return t.length||t.push({material:CKt(),mergedMaterials:[{originalMaterialId:"default"}]}),t}async function AKt(e,t){var r,n;if((r=e.texture)!=null&&r.bufferView&&((n=t.texture)!=null&&n.bufferView)&&e.mergedMaterials&&t.mergedMaterials){let i=Buffer.from(e.texture.bufferView.data),a=Buffer.from(t.texture.bufferView.data);try{let{joinImages:o}=await import("join-images"),s=await o([i,a],{direction:"horizontal"});e.texture.bufferView.data=await s.toFormat(e.texture.mimeType==="image/png"?"png":"jpeg").toBuffer()}catch(o){throw console.log("Join images into a texture atlas has failed. Consider usage `--split-nodes` option. (See documentation https://loaders.gl/modules/tile-converter/docs/cli-reference/tile-converter)"),o}e.material.pbrMetallicRoughness.baseColorTexture.textureSetDefinitionId=1}return e.mergedMaterials=e.mergedMaterials.concat(t.mergedMaterials),e}function SKt(e){var i,a,o,s,u;let t={doubleSided:e.doubleSided,emissiveFactor:(i=e.emissiveFactor)==null?void 0:i.map(c=>Math.round(c*255)),alphaMode:TKt(e.alphaMode),pbrMetallicRoughness:{roughnessFactor:((a=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:a.roughnessFactor)||tKt,metallicFactor:((o=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:o.metallicFactor)||rKt}},r;(s=e==null?void 0:e.pbrMetallicRoughness)!=null&&s.baseColorTexture?(r=e.pbrMetallicRoughness.baseColorTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}):e.emissiveTexture&&(r=e.emissiveTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}),e.id=Number.isFinite(e.id)?e.id:Bc();let n=[{originalMaterialId:e.id}];if(r)n[0].textureSize={width:r.image.width,height:r.image.height};else{let c=(u=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:u.baseColorFactor;t.pbrMetallicRoughness.baseColorFactor=c&&c.map(l=>Math.round(l*255))||void 0}return{material:t,texture:r,mergedMaterials:n}}function TKt(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend";default:return"opaque"}}function CKt(){return{alphaMode:"opaque",pbrMetallicRoughness:{metallicFactor:1,roughnessFactor:1}}}function DKt(e,t){let r={};if(!e||!e.length)return r;r.materialDefinitionInfos=[];for(let n of e){let{materialDefinitionInfo:i,textureDefinitionInfo:a}=FKt(n,t);r.materialDefinitionInfos.push(i),a&&(r.textureDefinitionInfos=r.textureDefinitionInfos||[],r.textureDefinitionInfos.push(a))}return r}function FKt(e,t){var s;let r=((s=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:s.baseColorTexture)||e.emissiveTexture,n=null;r&&(n=BKt(r.texture,t));let{baseColorFactor:i,metallicFactor:a}=(e==null?void 0:e.pbrMetallicRoughness)||{},o=i;return(!i||i[3]===0)&&e.emissiveFactor&&(o=e.emissiveFactor,o[3]=o[3]||1),{materialDefinitionInfo:kKt(o||[1,1,1,1],a),textureDefinitionInfo:n}}function kKt(e,t=1){let r=.00015686274509803922,n=new hs(0,0,0,1),i=new hs(1,1,1,1),a=new hs(r,r,r,0),o=new hs(e),s=i.subtract(a).multiply(o),u=s.lerp(s,n,t);a[3]=1;let c=a.lerp(a,o,t);return{params:{diffuse:u.toArray(),specular:c.toArray(),renderMode:"solid"}}}function BKt(e,t){var r,n,i,a;return{encoding:(r=e==null?void 0:e.source)!=null&&r.mimeType?[e.source.mimeType]:void 0,images:[{id:OKt(e,t),size:(n=e.source)==null?void 0:n.image.width,length:(i=e.source)!=null&&i.image.data.length?[(a=e.source)==null?void 0:a.image.data.length]:void 0}]}}function OKt(e,t){var b;let{width:r,height:n}=((b=e.source)==null?void 0:b.image)||{};if(!r||!n)return"";let i=1,a=0,o=t+1,s=32-o.toString(2).length,u="0".repeat(s).concat(o.toString(2)),c=i<<28,l=a<<24,f=r-1<<12,h=n-1<<0,p=c+l+f+h;return BigInt(`0b${p.toString(2)}${u}`).toString()}function IKt(e,t,r,n){let i=PKt(e,n,r);return Gke(t,i),Gke(e,i),i}function PKt(e,t,r){let n={};for(let i=0;i<e.length;i++){let a=e[i],o=jKt(i,t,r);n[a.toString()]=o}return n}function RKt(e,t){let r="";for(let n in e)r+=e[n][t];return r}function jKt(e,t,r){let n=RKt(t,e),i=(0,Hke.default)(n);return r.includes(i)?r.indexOf(i):r.push(i)-1}function Gke(e,t){for(let r=0;r<e.length;r++)e[r]=t[e[r]]}function LKt(e,t,r,n){let i=[],o=Oke(e,r)?Bke(t,r):r,s={OBJECTID:e,...o};for(let u in s){let c=qKt(u,n);if(c){let l=s[u],f=MKt(c,l);i.push(f)}}return i}function MKt(e,t){let r;switch(e){case sKt:case aKt:r=NKt(t);break;case oKt:r=UKt(t);break;case iKt:r=zke(t);break;default:r=zke(t)}return r}function qKt(e,t){let r=t.find(n=>n.name===e);return r?r.attributeValues?r.attributeValues.valueType:(console.error(`attributeValues is null, attribute=${r}`),""):(console.error(`attribute is null, key=${e}, attributeStorageInfo=${JSON.stringify(t,null,2)}`),"")}function NKt(e){let t=new Uint32Array([e.length]),r=new Uint32Array(e);return ec(t.buffer,r.buffer)}function UKt(e){let t=new Uint32Array([e.length]),r=new Uint8Array(4),n=new Float64Array(e);return ec(t.buffer,r.buffer,n.buffer)}function zke(e){let t=new Uint32Array([e.length]),r=0,n=new Uint32Array(e.length),i=[];for(let o=0;o<e.length;o++){let s=`${String(e[o])}\0`,u=Buffer.from(s),c=u.length;r+=c,n[o]=c,i.push(u)}let a=new Uint32Array([r]);return ec(t.buffer,a.buffer,n.buffer,...i)}function GKt(e){let t=new BigUint64Array(e.length);for(let r=0;r<e.length;r++)t[r]=BigInt(e[r]);return t}async function zKt(e,t,r,n){let{positions:i,normals:a,texCoords:o,colors:s,uvRegions:u,featureIds:c,faceRange:l}=r,f=new Uint32Array(e);for(let g=0;g<f.length;g++)f.set([g],g);let h=new Uint32Array(t.featureIndices.length?t.featureIndices:e),p=HKt(h,l),d={positions:i,normals:a,colors:s,"feature-index":p};o.length&&(d.texCoords=o);let b={"feature-index":{"i3s-attribute-type":"feature-index","i3s-feature-ids":new Int32Array(c)}};return u.length&&(d["uv-region"]=u,b["uv-region"]={"i3s-attribute-type":"uv-region"}),hv({attributes:d,indices:f},W7,{...W7.options,reuseWorkers:!0,_nodeWorkers:!0,modules:n,useLocalLibraries:!0,draco:{method:"MESH_SEQUENTIAL_ENCODING",attributesMetadata:b},["draco-writer"]:{workerUrl:"./modules/draco/dist/draco-writer-worker-node.js"}})}function HKt(e,t){let r=new Uint32Array(e.length),n=0,i=0;for(let a=1;a<t.length;a+=2){let o=(t[a]+1)*Eu;r.fill(n,i,o),n++,i=o+1}return r}function Vke(e,t){if(!e)return null;let r,n=e.batchTableJson;if(n)return n;let{extensionName:i,extension:a}=KKt(e);switch(i){case Ol:return r=WKt(a,t),r;case gs:return r=VKt(a,t),r;default:return null}}function WKt(e,t){if(e.propertyTables){for(let r of e.propertyTables)if(r.class===t||!t)return QF(r)}if(e.propertyTextures){for(let r of e.propertyTextures)if(r.class===t||!t)return QF(r)}return null}function VKt(e,t){if(e.featureTables)for(let r in e.featureTables){let n=e.featureTables[r];if(n.class===t||!t)return QF(n)}if(e.featureTextures)for(let r in e.featureTextures){let n=e.featureTextures[r];if(n.class===t||!t)return QF(n)}return null}function QF(e){let t={};for(let r in e.properties)t[r]=e.properties[r].data;return t}function KKt(e){var a,o,s,u;let t=[gs,Ol];if(!((a=e==null?void 0:e.gltf)==null?void 0:a.extensionsUsed))return{extensionName:null,extension:null};let n="";for(let c of((o=e==null?void 0:e.gltf)==null?void 0:o.extensionsUsed)||[])if(t.includes(c)){n=c;break}if(!n)return{extensionName:null,extension:null};let i=(u=(s=e==null?void 0:e.gltf)==null?void 0:s.extensions)==null?void 0:u[n];return{extensionName:n,extension:i}}var $ke=$t(_u(),1),Yke=require("path");var Kke=()=>({serviceItemId:{path:"serviceItemId"},serviceName:{path:"layerName"},name:{path:"layerName"},currentVersion:{path:"currentVersion",default:10.7},serviceVersion:{path:"serviceVersion",default:"1.8"},supportedBindings:{path:"supportedBindings",default:["REST"]},layers:{path:"layers0",transform:e=>[e]}});async function Jke(e,t,r){let n={serviceItemId:Bc().replace(/-/gi,""),layerName:e,layers0:t},i=(0,$ke.default)(n,Kke()),a=(0,Yke.join)(r,"SceneServer");await Fi(a,JSON.stringify(i))}var jW=16;function Xke(e,t){let r=[],n=e.boundingVolume,i=e.lodMetricValue||.1,a={metricType:"maxScreenThreshold",maxError:t.mbs[3]*2*jW/i},o={metricType:"maxScreenThresholdSQ",maxError:Math.PI*.25*a.maxError*a.maxError};return n.constructor.name==="OrientedBoundingBox"?(r.push(o),r.push(a)):(r.push(a),r.push(o)),r}function LW(e){var n,i;let t=(n=e.lodSelection)==null?void 0:n.find(a=>a.metricType==="maxScreenThreshold"),r=t==null?void 0:t.maxError;if(!r){let a=(i=e.lodSelection)==null?void 0:i.find(o=>o.metricType==="maxScreenThresholdSQ");a&&(r=Math.sqrt(a.maxError/(Math.PI*.25)))}return r||(r=jW),e.mbs[3]*2*jW/r}var $Kt=240,YKt=[9,-18,-88,0,96,90,0,0,-60,-20,-9,18,8,0,-96,30,0,0,60,-20,9,-88,-18,90,96,0,-20,-60,0,0,186,-42,-42,-150,-96,-150,60,60,60,60,54,162,-78,30,-24,-90,-60,60,-60,60,-9,-32,18,30,24,0,20,-60,0,0,-9,8,18,30,-96,0,-20,60,0,0,54,-78,162,-90,-24,30,60,-60,60,-60,-54,78,78,90,144,90,-60,-60,-60,-60,9,-8,-18,-30,-24,0,20,60,0,0,-9,18,-32,0,24,30,0,0,-60,20,9,-18,-8,0,-24,-30,0,0,60,20],JKt=372,XKt=[0,0,-131,0,138,144,0,0,-102,-31,0,0,7,0,-138,42,0,0,102,-31,62,0,-31,0,0,-62,0,0,0,31,124,0,-62,0,0,-124,0,0,0,62,124,0,-62,0,0,-124,0,0,0,62,62,0,-31,0,0,-62,0,0,0,31,0,0,45,0,-183,-9,0,93,18,0,0,0,216,0,33,87,0,-93,12,-93,0,0,156,0,153,99,0,-93,-12,-93,0,0,-45,0,-3,9,0,93,-18,0,0,0,-55,0,48,42,0,0,-84,31,0,0,-7,0,-48,-42,0,0,84,31],QKt=372,ZKt=[18,-36,-122,0,120,135,0,0,-84,-31,-18,36,-2,0,-120,51,0,0,84,-31,36,-165,-27,93,147,-9,0,-93,18,0,210,45,-111,-93,-57,-192,0,93,12,93,162,141,-75,-93,-129,-180,0,93,-12,93,-36,-21,27,93,39,9,0,-93,-18,0,0,0,62,0,0,31,0,0,0,-31,0,0,124,0,0,62,0,0,0,-62,0,0,124,0,0,62,0,0,0,-62,0,0,62,0,0,31,0,0,0,-31,-18,36,-64,0,66,51,0,0,-102,31,18,-36,2,0,-66,-51,0,0,102,31],e$t=12,MW=(3+1)*(3+2)/2,t$t=2,Qb=class{constructor(t){zt(this,"_v00",0),zt(this,"_v01",0),zt(this,"_v10",0),zt(this,"_v11",0),zt(this,"_t",[]),zt(this,"_ix",void 0),zt(this,"_iy",void 0),zt(this,"options",void 0),this.options=t,this._ix=this.options._width,this._iy=this.options._height}getHeight(t,r){if(t=Math.abs(t)>90?NaN:t,isNaN(t)||isNaN(r))return NaN;let n=r$t(r,360);r=n!==-180?n:180;let i=r*this.options._rlonres,a=-t*this.options._rlatres,o=Math.floor(i),s=Math.min(Math.round((this.options._height-1)/2-1),Math.floor(a));i-=o,a-=s,s+=(this.options._height-1)/2,o+=o<0?this.options._width:o>=this.options._width?-this.options._width:0;let u=0,c=0,l=0,f=0,h=new Array(MW);if(o===this._ix&&s===this._iy)this.options.cubic?h=this._t:(u=this._v00,c=this._v01,l=this._v10,f=this._v11);else if(!this.options.cubic)u=this._rawval(o,s),c=this._rawval(o+1,s),l=this._rawval(o,s+1),f=this._rawval(o+1,s+1);else{let d=[this._rawval(o,s-1),this._rawval(o+1,s-1),this._rawval(o-1,s),this._rawval(o,s),this._rawval(o+1,s),this._rawval(o+2,s),this._rawval(o-1,s+1),this._rawval(o,s+1),this._rawval(o+1,s+1),this._rawval(o+2,s+1),this._rawval(o,s+2),this._rawval(o+1,s+2)],b=XKt;s!==0&&(b=s===this.options._height-2?ZKt:YKt);let g=JKt;s!==0&&(g=s===this.options._height-2?QKt:$Kt);for(let x=0;x<MW;++x){h[x]=0;for(let E=0;E<e$t;++E)h[x]+=d[E]*b[MW*E+x];h[x]/=g}}if(!this.options.cubic){let d=(1-i)*u+i*c,b=(1-i)*l+i*f,g=(1-a)*d+a*b,x=this.options._offset+this.options._scale*g;return this._ix=o,this._iy=s,this._v00=u,this._v01=c,this._v10=l,this._v11=f,x}let p=h[0]+i*(h[1]+i*(h[3]+i*h[6]))+a*(h[2]+i*(h[4]+i*h[7])+a*(h[5]+i*h[8]+a*h[9]));return p=this.options._offset+this.options._scale*p,this._ix=o,this._iy=s,this._t=h,p}_rawval(t,r){t<0?t+=this.options._width:t>=this.options._width&&(t-=this.options._width),(r<0||r>=this.options._height)&&(r=r<0?-r:2*(this.options._height-1)-r,t+=(t<this.options._width/2?1:-1)*this.options._width/2);let n=this.options._datastart+t$t*(r*this.options._swidth+t),i=this.options.data[n],a=this.options.data[n+1];return i<<8|a}};function r$t(e,t){t=Math.abs(t);let r=Qke(e,t);return 2*Math.abs(r)===t?r-=Qke(e,2*t)-r:2*Math.abs(r)>t&&(r+=r<0?t:-t),r}function Qke(e,t){return e-Math.floor(e/t)*t}var n$t=10,i$t=65535;function qW(e,t){let r=a$t(e),n=r.next();if(n.done||n.value.line!=="P5")throw new Error("Geoid model file: File not in PGM format");let i=Number.MAX_VALUE,a=0,o=-1,s=-1,u="NONE",c="UNKNOWN",l=0,f=0,h=null,p=null;do{n=r.next();let x=n.value.line;if(x.length)if(x[0]==="#"){let E=x.split(" "),S=E[0],F=E[1];if(S!=="#"||!F)continue;let D=E.length>2?E.slice(2):[];if(F==="Description")u=D.join(" ");else if(F==="DateTime")c=D.join(" ");else if(F==="Offset"){if(!E[2])throw new Error("Geoid model file: Error reading offset");i=parseInt(E[2],10)}else if(F==="Scale"){if(!E[2])throw new Error("Geoid model file: Error reading scale");a=parseFloat(E[2])}else F===(t.cubic?"MaxCubicError":"MaxBilinearError")?isFinite(parseFloat(E[2]))&&(o=parseFloat(E[2])):F===(t.cubic?"RMSCubicError":"RMSBilinearError")&&isFinite(parseFloat(E[2]))&&(s=parseFloat(E[2]))}else{let E=x.split(" ");if(E=E.filter(S=>S!==""),l=parseInt(E[0],10),f=parseInt(E[1],10),!(l&&f))throw new Error("Geoid model file: Error reading raster size");break}}while(!n.done);n=r.next();let d=parseInt(n.value.line,10);if(n.done)throw new Error("Geoid model file: Error reading maxval");if(d!==i$t)throw new Error("Geoid model file: Incorrect value of maxval");if(h=n.value.offset,p=l,i===Number.MAX_VALUE)throw new Error("Geoid model file: Offset not set");if(a===0)throw new Error("Geoid model file: Scale not set");if(a<0)throw new Error("Geoid model file: Scale must be positive");if(f<2||l<2)throw new Error("Geoid model file: Raster size too small");if(l&1)throw new Error("Geoid model file: Raster width is odd");if(!(f&1))throw new Error("Geoid model file: Raster height is even");let b=l/360,g=(f-1)/180;return new Qb({cubic:t.cubic,_width:l,_height:f,_rlonres:b,_rlatres:g,_offset:i,_scale:a,_swidth:p,_datastart:h,_maxerror:o,_rmserror:s,_description:u,_datetime:c,data:e})}function*a$t(e){let t=0;do{let r=e.indexOf(n$t,t);if(r!==-1){let n=e.subarray(t,r);t=r+1,yield{offset:t,line:Zke(n)}}else{let n=e.subarray(t,e.length);t=e.length,yield{offset:t,line:Zke(n)}}}while(t<e.length);return{offset:t,line:""}}function Zke(e){let t="";for(let r of e)t+=String.fromCharCode(r);return t}var o$t="4.0.0-beta.8";var ZF={name:"PGM - Netpbm grayscale image format",id:"pgm",module:"tile-converter",version:o$t,mimeTypes:["image/x-portable-graymap"],parse:async(e,t)=>qW(new Uint8Array(e),(t==null?void 0:t.pgm)||{}),extensions:["pgm"],options:{pgm:{cubic:!1}}};var Zb=$t(_u(),1);var eBe={id:{path:"id",transform:e=>e.toUpperCase()},profile:{path:"profile",default:"meshpyramids"},version:{path:"version",default:"1.8"},resourcePattern:{path:"resourcePattern",default:["3dNodeIndexDocument","Attributes","SharedResource","Geometry"]},rootNode:{path:"rootNode",default:"./nodes/root"},extent:{path:"extent"},indexCRS:{path:"indexCRS",default:"http://www.opengis.net/def/crs/EPSG/0/4326"},vertexCRS:{path:"vertexCRS",default:"http://www.opengis.net/def/crs/EPSG/0/4326"},normalReferenceFrame:{path:"normalReferenceFrame",default:"east-north-up"},attributeEncoding:{path:"attributeEncoding",default:"application/octet-stream; version=1.6"},textureEncoding:{path:"textureEncoding",default:["image/jpeg","image/ktx2"]},lodType:{path:"lodType",default:"MeshPyramid"},lodModel:{path:"lodModel",default:"node-switching"},defaultGeometrySchema:{path:"defaultGeometrySchema",default:{geometryType:"triangles",header:[{property:"vertexCount",type:"UInt32"},{property:"featureCount",type:"UInt32"}],topology:"PerAttributeArray",ordering:["position","normal","uv0","color"],vertexAttributes:{position:{valueType:"Float32",valuesPerElement:3},normal:{valueType:"Float32",valuesPerElement:3},uv0:{valueType:"Float32",valuesPerElement:2},color:{valueType:"UInt8",valuesPerElement:4}},featureAttributeOrder:["id","faceRange"],featureAttributes:{id:{valueType:"UInt64",valuesPerElement:1},faceRange:{valueType:"UInt32",valuesPerElement:2}}}}};var s$t=()=>({wkid:{path:"wkid",default:4326},latestWkid:{path:"latestWkid",default:4326},vcsWkid:{path:"vcsWkid",default:5773},latestVcsWkid:{path:"latestVcsWkid",default:5773}}),u$t=()=>({heightModel:{path:"heightModel",default:"gravity_related_height"},vertCRS:{path:"vertCRS",default:"EGM96_Geoid"},heightUnit:{path:"heightUnit",default:"meter"}}),c$t=()=>({nodesPerPage:{path:"nodesPerPage"},lodSelectionMetricType:{path:"lodSelectionMetricType",default:"maxScreenThresholdSQ"}}),l$t=()=>({xmin:{path:"xmin"},ymin:{path:"ymin"},xmax:{path:"xmax"},ymax:{path:"ymax"},zmin:{path:"zmin"},zmax:{path:"zmax"}}),tBe=()=>({version:{path:"version",transform:e=>e.toUpperCase()},id:{path:"id",default:0},name:{path:"name"},href:{path:"href",default:"./layers/0"},layerType:{path:"layerType",default:"IntegratedMesh"},spatialReference:{path:"spatialReference",transform:e=>(0,Zb.default)(e,s$t())},capabilities:{path:"capabilities",default:["View","Query"]},store:{path:"store",transform:e=>(0,Zb.default)(e,eBe)},fullExtent:{path:"fullExtent",transform:e=>(0,Zb.default)(e,l$t())},heightModelInfo:{path:"heightModelInfo",transform:e=>(0,Zb.default)(e,u$t())},nodePages:{path:"nodePages",transform:e=>(0,Zb.default)(e,c$t())},materialDefinitions:{path:"materialDefinitions",default:[]},textureSetDefinitions:{path:"textureSetDefinitions",default:[]},geometryDefinitions:{path:"geometryDefinitions",default:[]},attributeStorageInfo:{path:"attributeStorageInfo",default:[]},fields:{path:"fields",default:[]},popupInfo:{path:"popupInfo",default:null}});var NW=$t(_u(),1),f$t=()=>({offset:{default:8},position:{default:{type:"Float32",component:3}},normal:{default:{type:"Float32",component:3}},uv0:{path:"hasTexture",transform:e=>e&&{type:"Float32",component:2}||!1,omitValues:[!1]},color:{default:{type:"UInt8",component:4}},uvRegion:{path:"hasUvRegions",transform:e=>e&&{type:"UInt16",component:4}||!1,omitValues:[!1]},featureId:{default:{binding:"per-feature",type:"UInt64",component:1}},faceRange:{default:{binding:"per-feature",type:"UInt32",component:2}}}),h$t=()=>({"compressedAttributes.encoding":{default:"draco"},"compressedAttributes.attributes":{path:"geometryConfig",transform:e=>{let t=["position","normal"];return e.hasTexture&&t.push("uv0"),t.push("color"),e.hasUvRegions&&t.push("uv-region"),t.push("feature-index"),t}}}),rBe=()=>({geometryBuffers:{path:"geometryConfig",transform:e=>{let t=[(0,NW.default)(e,f$t())];return e.draco&&t.push((0,NW.default)({geometryConfig:e},h$t())),t}}});var fw=$t(_u(),1),p$t=()=>({renderMode:{path:"renderMode",default:"solid"},shininess:{path:"shininess",default:1},reflectivity:{path:"reflectivity",default:0},ambient:{path:"ambient",default:[1,1,1]},diffuse:{path:"diffuse",default:[1,1,1]},specular:{path:"specular",default:[0,0,0]},useVertexColorAlpha:{path:"useVertexColorAlpha",default:!1},vertexRegions:{path:"vertexRegions",default:!1},vertexColors:{path:"vertexColors",default:!0}}),d$t=()=>({name:{path:"name",default:"standard"},type:{path:"type",default:"standard"},params:{path:"params",transform:(e,t,r)=>(0,fw.default)(r,p$t())}}),m$t=()=>({id:{path:"id"},size:{path:"size"},href:{path:"href",default:["../textures/0"]},length:{path:"length"}}),g$t=()=>({encoding:{path:"encoding"},wrap:{path:"wrap",default:["none"]},atlas:{path:"atlas",default:!1},uvSet:{path:"uvSet",default:"uv0"},channels:{path:"channels",default:"rgb"},images:{path:"images",transform:(e,t,r)=>e.map(n=>(0,fw.default)(n,m$t()))}}),nBe=()=>({materialDefinitions:{path:"materialDefinitionInfos",transform:v$t},textureDefinitions:{path:"textureDefinitionInfos",transform:b$t}});function v$t(e,t,r){let n={};for(let[i,a]of e.entries())n[`Mat${r.nodePath}${i}`]=(0,fw.default)(a,d$t());return n}function b$t(e,t,r){if(!e)return null;let n={};for(let[i,a]of e.entries()){let o=`${r.nodePath}${i}`;a.imageIndex=o,n[o]=(0,fw.default)(a,g$t())}return n}var y$t=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]);function aBe(e){var r,n;if(!((r=e==null?void 0:e.parentNode)!=null&&r.obb)||!((n=e==null?void 0:e.parentNode)!=null&&n.mbs))return[];let t=[];return x$t(t,e),_$t(t,e),t}function x$t(e,t){var o;let r=w$t(t.parentNode.obb),n=E$t(t);if(A$t(r,n))return;let a=`OBB of Tile (${t.id}) doesn't fit into Parent (${(o=t.parentNode)==null?void 0:o.id}) tile OBB`;e.push(a)}function _$t(e,t){var a;let r=iBe(t.mbs),n=iBe(t.parentNode.mbs);if(r.center.distanceTo(n.center)+r.radius>n.radius){let o=`MBS of Tile (${t.id}) doesn't fit into Parent (${(a=t.parentNode)==null?void 0:a.id}) tile MBS`;e.push(o)}}function iBe(e){return new Ya([e[0],e[1],e[2]],e[3])}function w$t(e){let{center:t,halfSize:r,quaternion:n}=e;return new aa().fromCenterHalfSizeQuaternion(t,r,n)}function E$t(e){let t=e.obb.halfSize,r=y$t,n=or.WGS84.cartographicToCartesian(e.obb.center),i=[];for(let a=0;a<r.length;a+=3){let s=new ce(r[a]*=t[0],r[a+1]*=t[1],r[a+2]*=t[2]).transformByQuaternion(e.obb.quaternion).add(n);i=i.concat(s)}return i}function A$t(e,t){let r=!0;for(let n=0;n<t.length/3;n+=3){let i=[t[n],t[n+1],t[n+2]],a=or.WGS84.cartesianToCartographic(i);if(e.distanceTo(a)>0){r=!1;break}}return r}var ek=class extends Array{enqueue(t){this.push(t)}dequeue(){return this.shift()}peek(){return this[0]}isEmpty(){return this.length===0}};var oBe=$t(require("process"),1),S$t=4*1024*1024*1024,ey=class extends ek{intervalId;writePromise=null;fileMap={};listeningInterval;writeConcurrency;constructor(t=2e3,r=400){super(),this.listeningInterval=t,this.writeConcurrency=r}async enqueue(t,r=!1){if(r){let{archiveKey:n,writePromise:i}=t,a=await i();n&&a&&(this.fileMap[n]=a)}else super.enqueue(t),oBe.default.memoryUsage().rss>S$t&&await this.startWrite()}startListening(){this.intervalId=setInterval(this.startWrite.bind(this),this.listeningInterval)}stopListening(){this.intervalId&&clearInterval(this.intervalId)}async startWrite(){this.writePromise||(this.writePromise=this.doWrite()),await this.writePromise,this.writePromise=null}async finalize(){this.stopListening(),await this.startWrite()}async doWrite(){for(;this.length;){let t=[],r=[];for(let i=0;i<this.writeConcurrency;i++){let a=this.dequeue();if(!a)break;let{archiveKey:o,writePromise:s}=a;r.push(o);let u=s();t.push(u)}let n=await Promise.allSettled(t);this.updateFileMap(r,n)}}updateFileMap(t,r){for(let n=0;n<t.length;n++){let i=t[n];i&&"value"in r[n]&&(this.fileMap[i]=r[n].value)}}};var ty="Tile converter does not work in browser, only in node js environment";var GW=require("path"),zW=$t(_u(),1);var sBe=$t(_u(),1),uBe=()=>({mbs:{path:"mbs"},obb:{path:"obb"}}),T$t=()=>({href:{path:"href"}}),C$t=()=>({id:{path:"id"},...T$t(),...uBe()}),UW=()=>({version:{path:"version"},id:{path:"id"},path:{path:"path"},level:{path:"level"},...uBe(),lodSelection:{path:"lodSelection",default:[{metricType:"maxScreenThresholdSQ",maxError:196349.54374999998},{metricType:"maxScreenThreshold",maxError:999.9999999999999}]},children:{path:"children",default:null},neighbors:{path:"neighbors",default:null},parentNode:{path:"parentNode",transform:e=>(0,sBe.default)(e,C$t()),default:null},sharedResource:{path:"sharedResource",default:null},featureData:{path:"featureData",default:null},geometryData:{path:"geometryData",default:null},textureData:{path:"textureData",default:null},attributeData:{path:"attributeData",default:null}});var Au=class{id;inPageId;data=null;children=[];converter;_finalized=!1;get finalized(){return this._finalized}constructor(t,r){this.inPageId=t,this.id=t===0?"root":t.toString(),this.converter=r}async addData(t){return this.converter.options.instantNodeWriting?await this.write(t):this.data=t,this}async addChildren(t){let r=[];for(let i of t){let a=await i.load();r.push({id:i.id,href:`../${i.id}`,obb:a.obb,mbs:a.mbs})}this.children=this.children.concat(t);let n=this.data;this.converter.options.instantNodeWriting&&(n=await this.load()),n&&(n.children=n.children??[],n.children=n.children.concat(r)),this.converter.options.instantNodeWriting&&n&&await this.write(n)}async addNeighbors(){var r;if(this.finalized)return;let t=await this.load();for(let n of this.children){let i=await n.load();if(i.neighbors=i.neighbors??[],Number((r=t==null?void 0:t.children)==null?void 0:r.length)<1e3)for(let a of t.children||[])n.id!==a.id&&i.neighbors.push({...a});else console.warn(`Node ${n.id}: neighbors attribute is omited because of large number of neigbors`),delete i.neighbors;this.converter.options.instantNodeWriting&&i&&await n.write(i),await n.save()}this.finalize()}async save(){this.data&&await this.write(this.data)}finalize(){this._finalized=!0;for(let t of this.children)t.flush()}async write(t){let r=(0,GW.join)(this.converter.layers0Path,"nodes",this.id);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodes/${this.id}/3dNodeIndexDocument.json.gz`,writePromise:()=>Mc(r,JSON.stringify(t),"3dNodeIndexDocument.json",!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>Fi(r,JSON.stringify(t))},!0)}async load(){if(this.data)return this.data;let t=this.id,r=(0,GW.join)(this.converter.layers0Path,"nodes",t),n="index.json";return this.converter.options.slpk&&(n="3dNodeIndexDocument.json"),await KF(r,n)}flush(){this.data=null}static async createRootNode(t,r){let n=Au.createRootNodeIndexDocument(t);return await new Au(0,r).addData(n)}static async createNode(t,r,n,i,a,o){let s=await Au.createNodeIndexDocument(t,r,n,i,a);return await new Au(i.index,o).addData(s)}static createRootNodeIndexDocument(t){let r={version:`{${Bc().toUpperCase()}}`,id:"root",level:0,lodSelection:[{metricType:"maxScreenThresholdSQ",maxError:0},{metricType:"maxScreenThreshold",maxError:0}],...t,children:[]};return(0,zW.default)(r,UW())}static async createNodeIndexDocument(t,r,n,i,a){var h,p;let{texture:o,attributes:s}=a,u=i.index,c=await t.load(),l={version:c.version,id:u.toString(),level:c.level+1,...r,lodSelection:n,parentNode:{id:t.id,href:`../${t.id}`,mbs:c.mbs,obb:c.obb},children:[],neighbors:[]},f=(0,zW.default)(l,UW());if(i.mesh&&(f.geometryData=[{href:"./geometries/0"}],f.sharedResource={href:"./shared"},o&&(f.textureData=[{href:"./textures/0"},{href:"./textures/1"}]),s&&s.length&&((p=(h=t.converter.layers0)==null?void 0:h.attributeStorageInfo)!=null&&p.length))){f.attributeData=[];let d=s.length<t.converter.layers0.attributeStorageInfo.length?s.length:t.converter.layers0.attributeStorageInfo.length;for(let b=0;b<d;b++){let g=t.converter.layers0.attributeStorageInfo[b].key;f.attributeData.push({href:`./attributes/${g}/0`})}}return f}};var HW=async(e,t,r)=>{let n=hw(t);if(!e||!t.contentUrl||!n)return;let i={...r,[e.loader.id]:{isTileset:n,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}},a=await tk(t.contentUrl,e.loader,i);a.root&&(t.children=[a.root])},WW=async(e,t,r)=>{let n=hw(t);if(!e||!t.contentUrl||n)return null;let i={...r,[e.loader.id]:{...r[e.loader.id]||{},isTileset:n,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}};return await tk(t.contentUrl,e.loader,i)};async function tk(e,t,r){let n=e.split(".3tz"),i;if(n.length===1)i=null;else if(n.length===2)i=n[1].slice(1),i===""&&(i="tileset.json");else throw new Error("Unexpected URL format");if(i){let a=`${n[0]}.3tz`,o=new i2(a),s=await An(i,t,{...r,fetch:o.fetch.bind(o)});return await o.destroy(),s}return await An(e,t,r)}function hw(e){return(e==null?void 0:e.type)==="json"||(e==null?void 0:e.type)==="3tz"}var rk=async(e,t,r,n,i,a=0)=>{if(i&&a>i)return;let o=[],s=await r(e,t);o.push(s);for(let u of e.children)await rk(u,s,r,n,i,a+1);n&&await n(o,t)};var D$t=["POINTS","LINES","LINE_LOOP","LINE_STRIP","TRIANGLES","TRIANGLE_STRIP","TRIANGLE_FAN"],cBe=async e=>{let t={meshTopologyTypes:new Set,metadataClasses:new Set};if(!(e!=null&&e.gltfArrayBuffer))return t;let n=(await ko(e.gltfArrayBuffer,Il,{gltf:{normalize:!1,loadBuffers:!1,loadImages:!1,decompressMeshes:!1}})).json;if(!n)return t;let i=F$t(n),a=k$t(n);return{meshTopologyTypes:i,metadataClasses:a}},F$t=e=>{let t=new Set;for(let r of e.meshes||[])for(let n of r.primitives){let{mode:i}=n;typeof i!="number"&&(i=4),t.add(D$t[i])}return t},k$t=e=>{var i,a,o,s,u,c;let t=new Set,r=(o=(a=(i=e.extensions)==null?void 0:i[gs])==null?void 0:a.schema)==null?void 0:o.classes;if(r)for(let l of Object.keys(r))t.add(l);let n=(c=(u=(s=e.extensions)==null?void 0:s[Ol])==null?void 0:u.schema)==null?void 0:c.classes;if(n)for(let l of Object.keys(n))t.add(l);return t},lBe=(e,t)=>{for(let r of t.meshTopologyTypes)e.meshTopologyTypes.add(r);for(let r of t.metadataClasses)e.metadataClasses.add(r)};var hBe,B$t=(hBe=C0.default.env)==null?void 0:hBe.IonToken,fBe=64,O$t="3DTILES",I$t="3DObject",P$t=1800,R$t="https://",ry=class{nodePages;options;layers0Path;materialMap;materialDefinitions;geometryMap;geometryConfigs;vertexCounter;layers0;featuresHashArray;refinementCounter;validate;boundingVolumeWarnings=[];conversionStartTime=[0,0];refreshTokenTime=[0,0];sourceTileset=null;loadOptions={_nodeWorkers:!0,reuseWorkers:!0,useLocalLibraries:!0,basis:{format:"rgba32",workerUrl:"./modules/textures/dist/basis-worker-node.js"},draco:{workerUrl:"./modules/draco/dist/draco-worker-node.js"},fetch:{},modules:{}};geoidHeightModel=null;Loader=Ec;generateTextures;generateBoundingVolumes;layersHasTexture;workerSource={};writeQueue=new ey;compressList=null;preprocessData={meshTopologyTypes:new Set,metadataClasses:new Set};constructor(){this.nodePages=new Za(Fi,fBe,this),this.options={},this.layers0Path="",this.materialMap=new Map,this.materialDefinitions=[],this.geometryMap=new Map,this.geometryConfigs=[],this.vertexCounter=0,this.layers0=null,this.featuresHashArray=[],this.refinementCounter={tilesCount:0,tilesWithAddRefineCount:0},this.validate=!1,this.generateTextures=!1,this.generateBoundingVolumes=!1,this.layersHasTexture=!1,this.compressList=null}async convert(t){if(gn)return console.log(ty),ty;this.conversionStartTime=C0.default.hrtime();let{tilesetName:r,slpk:n,egmFilePath:i,inputUrl:a,validate:o,outputPath:s,draco:u=!0,sevenZipExe:c,maxDepth:l,token:f,generateTextures:h,generateBoundingVolumes:p,instantNodeWriting:d=!1,mergeMaterials:b=!0,inquirer:g,metadataClass:x,analyze:E=!1}=t;this.options={maxDepth:l,slpk:n,sevenZipExe:c,egmFilePath:i,draco:u,token:f,inputUrl:a,instantNodeWriting:d,mergeMaterials:b,inquirer:g,metadataClass:x},this.compressList=this.options.instantNodeWriting&&[]||null,this.validate=Boolean(o),this.Loader=a.indexOf(R$t)!==-1?hD:Ec,this.generateTextures=Boolean(h),this.generateBoundingVolumes=Boolean(p),this.writeQueue=new ey,this.writeQueue.startListening(),console.log("Loading egm file..."),this.geoidHeightModel=await An(i,ZF),console.log("Loading egm file completed!"),n&&this.nodePages.useWriteFunction(Mc);try{let S=await this._fetchPreloadOptions(),F=a;S.url&&(F=S.url),S.headers&&(this.loadOptions.fetch={headers:S.headers}),this.sourceTileset=await tk(F,this.Loader,this.loadOptions),(this.Loader===Ec||E?await this.preprocessConversion():!0)&&!E&&await this.selectMetadataClass()&&(await this._createAndSaveTileset(s,r),await this._finishConversion({slpk:Boolean(n),outputPath:s,tilesetName:r}))}catch(S){throw S}finally{await this.writeQueue.finalize(),Ra.getWorkerFarm({}).destroy()}return"success"}async preprocessConversion(){console.log("Analyze source tileset");let t=this.sourceTileset.root;await rk(t,null,this.analyzeTile.bind(this),void 0,this.options.maxDepth);let{meshTopologyTypes:r,metadataClasses:n}=this.preprocessData;return console.log("------------------------------------------------"),console.log("Preprocess results:"),console.log(`glTF mesh topology types: ${Array.from(r).join(", ")}`),n.size?console.log(`Feature metadata classes have been found: ${Array.from(n).join(", ")}`):console.log("Feature metadata classes have not been found"),console.log("------------------------------------------------"),!r.has("TRIANGLES")&&!r.has("TRIANGLE_STRIP")?(console.log("The tileset is of unsupported mesh topology types. The conversion will be interrupted."),console.log("------------------------------------------------"),!1):!0}async analyzeTile(t,r){if(hw(t))return await HW(this.sourceTileset,t,this.loadOptions),null;t.id&&console.log(`[analyze]: ${t.id}`);let i=null;try{i=await WW(this.sourceTileset,t,{...this.loadOptions,"3d-tiles":{...this.loadOptions["3d-tiles"],loadGLTF:!1}})}catch{console.log(`[warning]: Failed to load ${t.contentUrl}. An I3S tile with empty content will be added to the output tileset`)}let a=await cBe(i);return lBe(this.preprocessData,a),null}async selectMetadataClass(){var r;let{metadataClasses:t}=this.preprocessData;if(t.size>1)if((r=this.options.metadataClass)!=null&&r.length)console.log(`${this.options.metadataClass} has been selected`);else if(this.options.inquirer){let n=await this.options.inquirer.prompt([{name:"metadataClass",type:"list",message:"Select feature metadata data class to convert...",choices:Array.from(t)}]);this.options.metadataClass=n.metadataClass,console.log(`${n.metadataClass} has been selected`)}else return console.log(`A feature metadata class has not been selected. Start the converter with option "--metadata-class". For example, "npx tile-converter ... --metadata-class ${Array.from(t)[0]}"`),console.log("------------------------------------------------"),!1;return!0}async _createAndSaveTileset(t,r){var u,c,l;let n=(0,Na.join)(`${t}`,`${r}`);try{await aw(n)}catch{}this.layers0Path=(0,Na.join)(n,"SceneServer","layers","0"),this.materialDefinitions=[],this.materialMap=new Map;let i=this.sourceTileset.root,a=C8(i.boundingVolume,new Kr(i.transform),null);this._formLayers0(r,a,(l=(c=(u=this.sourceTileset)==null?void 0:u.root)==null?void 0:c.boundingVolume)==null?void 0:l.region);let o=IW(a,this.geoidHeightModel);await this.nodePages.push({index:0,lodThreshold:0,obb:o.obb,children:[]});let s=await Au.createRootNode(o,this);await rk(i,{transform:new Kr(i.transform),parentNodes:[s]},this.convertTile.bind(this),this.finalizeTile.bind(this),this.options.maxDepth),this.layers0.materialDefinitions=this.materialDefinitions,this.layers0.geometryDefinitions=(0,nk.default)(this.geometryConfigs.map(f=>({geometryConfig:{...f,draco:this.options.draco}})),rBe()),this.layersHasTexture===!1&&(this.layers0.store.defaultGeometrySchema.ordering=this.layers0.store.defaultGeometrySchema.ordering.filter(f=>f!=="uv0")),await this._writeLayers0(),Jke(r,this.layers0,n);for(let f of this.compressList||[])await VF(f),await OW(f);await this.nodePages.save(),await this.writeQueue.finalize(),await this._createSlpk(n)}_formLayers0(t,r,n){var s;if(!((s=this.sourceTileset)!=null&&s.root))return;let i=Ske(r);n&&(i.zmin=n[4],i.zmax=n[5]);let a=[i.xmin,i.ymin,i.xmax,i.ymax],o={version:`{${Bc().toUpperCase()}}`,id:0,name:t,href:"./layers/0",store:{id:`{${Bc().toUpperCase()}}`,extent:a},nodePages:{nodesPerPage:fBe},compressGeometry:this.options.draco,fullExtent:i};this.layers0=(0,nk.default)(o,tBe())}async _writeLayers0(){this.options.slpk?await this.writeQueue.enqueue({archiveKey:"3dSceneLayer.json.gz",writePromise:()=>Mc(this.layers0Path,JSON.stringify(this.layers0),"3dSceneLayer.json")}):await this.writeQueue.enqueue({writePromise:()=>Fi(this.layers0Path,JSON.stringify(this.layers0))})}async _createSlpk(t){if(this.options.slpk){let r=(0,Na.join)(t,"SceneServer","layers","0"),n=`${t}.slpk`;await vke(r,n,0,".",this.options.sevenZipExe);try{await aw(t)}catch{}}}async convertTile(t,r){let n=hw(t);if(n||t.type==="empty")return n&&(t.id&&console.log(`[load]: ${t.id}`),await HW(this.sourceTileset,t,this.loadOptions)),r;t.id&&console.log(`[convert]: ${t.id}`);let{parentNodes:i,transform:a}=r,o=a.clone();t.transform&&(o=o.multiplyRight(t.transform));let s=i[0],u=await this._createNode(s,t,o);return await s.addChildren(u),{transform:o,parentNodes:u}}async finalizeTile(t,r){for(let n of t)for(let i of n.parentNodes)await i.addNeighbors();for(let n of r.parentNodes)await n.save()}async _createNode(t,r,n){this._checkAddRefinementTypeForTile(r),await this._updateTilesetOptions();let i=null;try{i=await WW(this.sourceTileset,r,this.loadOptions)}catch{console.log(`[warning]: Failed to load ${r.contentUrl}`)}let a=C8(r.boundingVolume,n,null),o=IW(a,this.geoidHeightModel),s=Vke(i,this.options.metadataClass);this.createAttributeStorageInfo(i,s);let u=await this._convertResources(r,n,a,i,t.inPageId,s),c=[],l=[],f=[],h={geometry:null,compressedGeometry:null,texture:null,hasUvRegions:!1,sharedResources:null,meshMaterial:null,vertexCount:null,attributes:null,featureCount:null,boundingVolumes:null};for(let p of u||[h]){this.layersHasTexture=this.layersHasTexture||Boolean(p.texture),this.generateBoundingVolumes&&p.boundingVolumes&&(o=p.boundingVolumes);let d=Xke(r,o),b=d.find(S=>S.metricType==="maxScreenThresholdSQ")||{maxError:0},g=await this._updateNodeInNodePages(b,o,r,t.inPageId,p),x=await Au.createNodeIndexDocument(t,o,d,g,p),E=await new Au(g.index,this).addData(x);c.push(E),g.mesh&&await this._writeResources(p,E.id),this.validate&&(this.boundingVolumeWarnings=aBe(x),this.boundingVolumeWarnings&&this.boundingVolumeWarnings.length&&console.warn("Bounding Volume Warnings: ",...this.boundingVolumeWarnings)),l.push(g.index),f.push(g)}return c}async _convertResources(t,r,n,i,a,o){var c;if(!this.isContentSupported(t)||!i)return null;let s={center:[],halfSize:[],quaternion:[]};return await RW(i,r,n,async()=>(await this.nodePages.push({index:0,obb:s},a)).index,o,this.featuresHashArray,(c=this.layers0)==null?void 0:c.attributeStorageInfo,this.options.draco,this.generateBoundingVolumes,this.options.mergeMaterials,this.geoidHeightModel,this.loadOptions.modules,this.options.metadataClass)}async _updateNodeInNodePages(t,r,n,i,a){let{meshMaterial:o,texture:s,vertexCount:u,featureCount:c,geometry:l,hasUvRegions:f}=a,h={index:0,lodThreshold:t.maxError,obb:r.obb,children:[]};l&&this.isContentSupported(n)&&(h.mesh={geometry:{definition:this.findOrCreateGeometryDefinition(Boolean(s),f),resource:0},attribute:{resource:0},material:{definition:0}});let p=a.nodeId,d;if(p?d=await this.nodePages.getNodeById(p):d=await this.nodePages.push(h,i),h.mesh||console.log(`[warning]: node ${d.index} is created with empty content`),Za.updateAll(d,h),o&&Za.updateMaterialByNodeId(d,this._findOrCreateMaterial(o)),s){let b=s.image.height*s.image.width;Za.updateTexelCountHintByNodeId(d,b)}return u&&(this.vertexCounter+=u,Za.updateVertexCountByNodeId(d,u)),Za.updateNodeAttributeByNodeId(d),c&&Za.updateFeatureCountByNodeId(d,c),this.nodePages.saveNode(d),d}async _writeResources(t,r){let{geometry:n,compressedGeometry:i,texture:a,sharedResources:o,attributes:s}=t,u=(0,Na.join)(this.layers0Path,"nodes",r),c=(0,Na.join)("nodes",r);await this._writeGeometries(n,i,u,c),await this._writeShared(o,u,c,r),await this._writeTexture(a,u,c),await this._writeAttributes(s,u,c)}async _writeGeometries(t,r,n,i){if(this.options.slpk){let a=(0,Na.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/0.bin.gz`,writePromise:()=>Mc(a,t,"0.bin")})}else{let a=(0,Na.join)(n,"geometries/0/");await this.writeQueue.enqueue({writePromise:()=>Fi(a,t,"index.bin")})}if(this.options.draco)if(this.options.slpk){let a=(0,Na.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/1.bin.gz`,writePromise:()=>Mc(a,r,"1.bin")})}else{let a=(0,Na.join)(n,"geometries/1/");await this.writeQueue.enqueue({writePromise:()=>Fi(a,r,"index.bin")})}}async _writeShared(t,r,n,i){if(!t)return;t.nodePath=i;let a=(0,nk.default)(t,nBe()),o=JSON.stringify(a);if(this.options.slpk){let s=(0,Na.join)(r,"shared");await this.writeQueue.enqueue({archiveKey:`${n}/shared/sharedResource.json.gz`,writePromise:()=>Mc(s,o,"sharedResource.json")})}else{let s=(0,Na.join)(r,"shared/");await this.writeQueue.enqueue({writePromise:()=>Fi(s,o)})}}async _writeTexture(t,r,n){if(t){let i=this._getFormatByMimeType(t==null?void 0:t.mimeType),a=[],o=t.bufferView.data;switch(i){case"jpg":case"png":{if(a.push({name:"0",format:i}),await this.writeTextureFile(o,"0",i,r,n),this.generateTextures){a.push({name:"1",format:"ktx2"});let s=t.image.data.subarray(),u=new Uint8Array(s),c=hv({...t.image,data:u},xq,{...xq.options,["ktx2-basis-writer"]:{workerUrl:"./modules/textures/dist/ktx2-basis-writer-worker-node.js"},reuseWorkers:!0,_nodeWorkers:!0,useLocalLibraries:!0});await this.writeTextureFile(c,"1","ktx2",r,n)}break}case"ktx2":if(a.push({name:"1",format:i}),await this.writeTextureFile(o,"1",i,r,n),this.generateTextures){a.push({name:"0",format:"jpg"});let s=hv(t.image.data[0],nq);await this.writeTextureFile(s,"0","jpg",r,n)}}this.layers0.textureSetDefinitions.length||(this.layers0.textureSetDefinitions.push({formats:a}),this.layers0.textureSetDefinitions.push({formats:a,atlas:!0}))}}async writeTextureFile(t,r,n,i,a){if(this.options.slpk){let o=(0,Na.join)(i,"textures"),s=!1;await this.writeQueue.enqueue({archiveKey:`${a}/textures/${r}.${n}`,writePromise:()=>Mc(o,t,`${r}.${n}`,s)})}else{let o=(0,Na.join)(i,`textures/${r}/`);await this.writeQueue.enqueue({writePromise:()=>Fi(o,t,`index.${n}`)})}}async _writeAttributes(t=[],r,n){var i,a;if(t!=null&&t.length&&((a=(i=this.layers0)==null?void 0:i.attributeStorageInfo)!=null&&a.length)){let o=t.length<this.layers0.attributeStorageInfo.length?t.length:this.layers0.attributeStorageInfo.length;for(let s=0;s<o;s++){let u=this.layers0.attributeStorageInfo[s].key,c=new Uint8Array(t[s]);if(this.options.slpk){let l=(0,Na.join)(r,"attributes",u);await this.writeQueue.enqueue({archiveKey:`${n}/attributes/${u}.bin.gz`,writePromise:()=>Mc(l,c,"0.bin")})}else{let l=(0,Na.join)(r,`attributes/${u}/0`);await this.writeQueue.enqueue({writePromise:()=>Fi(l,c,"index.bin")})}}}}_getFormatByMimeType(t){switch(t){case"image/jpeg":return"jpg";case"image/png":return"png";case"image/ktx2":return"ktx2";default:return"jpg"}}_findOrCreateMaterial(t){let r=(0,VW.default)(JSON.stringify(t));if(this.materialMap.has(r))return this.materialMap.get(r)||0;let n=this.materialDefinitions.push(t)-1;return this.materialMap.set(r,n),n}findOrCreateGeometryDefinition(t,r){let n={hasTexture:t,hasUvRegions:r},i=(0,VW.default)(JSON.stringify(n));if(this.geometryMap.has(i))return this.geometryMap.get(i)||0;let a=this.geometryConfigs.push(n)-1;return this.geometryMap.set(i,a),a}createAttributeStorageInfo(t,r){let n=null;this.options.metadataClass?!this.layers0.attributeStorageInfo.length&&(t!=null&&t.gltf)&&(n=qke(t.gltf,this.options.metadataClass)):r&&(n=Mke(r)),n&&this.createStorageAttributes(n)}createStorageAttributes(t){if(!Object.keys(t).length)return;let r={OBJECTID:"OBJECTID",...t},n=!1,i=this.layers0.attributeStorageInfo.length;for(let a in r)if(!this.layers0.attributeStorageInfo.find(s=>s.name===a)){let s=r[a],u=Pke(i,a,s),c=Rke(s),l=jke(a,c);this.layers0.attributeStorageInfo.push(u),this.layers0.fields.push(l),i+=1,n=!0}if(n){let a=[];for(let o of this.layers0.attributeStorageInfo)a.push(o.name);this.layers0.popupInfo=Lke(a),this.layers0.layerType=I$t}}async _finishConversion(t){let{tilesCount:r,tilesWithAddRefineCount:n}=this.refinementCounter,i=n?n/r*100:0,a=await JF(t),o=C0.default.hrtime(this.conversionStartTime),s=YF(o);console.log("------------------------------------------------"),console.log(`Finishing conversion of ${O$t}`),console.log(`Total conversion time: ${s}`),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",a," bytes"),console.log('Percentage of tiles with "ADD" refinement type:',i,"%"),console.log("------------------------------------------------")}async _fetchPreloadOptions(){if(!this.Loader.preload)return{};let t={"cesium-ion":{accessToken:this.options.token||B$t}},r=await this.Loader.preload(this.options.inputUrl,t);return this.refreshTokenTime=C0.default.hrtime(),{...t,...r}}async _updateTilesetOptions(){if(C0.default.hrtime(this.refreshTokenTime)[0]<P$t)return;this.refreshTokenTime=C0.default.hrtime();let r=await this._fetchPreloadOptions();r.headers&&(this.loadOptions.fetch={...this.loadOptions.fetch,headers:r.headers},console.log("Authorization Bearer token has been updated"))}_checkAddRefinementTypeForTile(t){t.refine===1&&(this.refinementCounter.tilesWithAddRefineCount+=1,console.warn('This tile uses "ADD" type of refinement')),this.refinementCounter.tilesCount+=1}isContentSupported(t){return["b3dm","glTF","scenegraph"].includes(t.type||"")}};var RBe=require("path"),XW=$t(require("process"),1),jBe=$t(_u(),1);function KW(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 pBe={UInt8:Ht.UNSIGNED_BYTE,UInt16:Ht.UNSIGNED_SHORT,Float32:Ht.FLOAT,UInt32:Ht.UNSIGNED_INT,UInt64:Ht.DOUBLE};function ny(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 dBe="String",mBe="Oid32",gBe="Float64",vBe="Int16";function ik(e){let t;try{let r=new URL(e);t=`${r.origin}${r.pathname}`}catch{}return t||e}function iy(e,t=null){return t?`${e}?token=${t}`:e}function bBe(e,t){let{attributeData:r=[]}=t,n=[];for(let i=0;i<r.length;i++){let a=r[i].href.replace("./","");n.push(`${e}/${a}`)}return n}function yBe(e,t,r){let n=[],{attributeStorageInfo:i=[]}=e;for(let a=0;a<i.length;a++){let o=i[a].key;n.push(`${t}/nodes/${r}/attributes/${o}/0`)}return n}var ak=new ce([0,0,0]);function L$t(e){switch(e){case"ktx-etc2":case"dds":return Y8;case"ktx2":return Id;case"jpg":case"png":default:return Tv}}var M$t="i3s-attribute-type";async function EBe(e,t,r,n,i){var o;let a={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new Kr,coordinateSystem:0,byteLength:0,texture:null};if(t.textureUrl){let s=iy(t.textureUrl,(o=n==null?void 0:n.i3s)==null?void 0:o.token),u=L$t(t.textureFormat),f=await(await((i==null?void 0:i.fetch)||fetch)(s)).arrayBuffer();if(n!=null&&n.i3s.decodeTextures){if(u===Tv){let h={...t.textureLoaderOptions,image:{type:"data"}};try{let p=await So(f,[],h,i);a.texture=p}catch{let d=await ko(f,u,h,i);a.texture=d}}else if(u===Y8||u===Id){let h=await An(f,u,t.textureLoaderOptions);u===Id&&(h=h[0]),a.texture={compressed:!0,mipmaps:!1,width:h[0].width,height:h[0].height,data:h}}}else a.texture=f}return a.material=K$t(t.materialDefinition,a.texture),a.material&&(a.texture=null),await q$t(e,a,t,r,n)}async function q$t(e,t,r,n,i){var f,h;let a=e.byteLength,o,s,u=0,c=0,l;if(r.isDracoGeometry){let p=await ko(e,xv,{draco:{attributeNameEntry:M$t}});s=p.header.vertexCount,l=(f=p.indices)==null?void 0:f.value;let{POSITION:d,NORMAL:b,COLOR_0:g,TEXCOORD_0:x,["feature-index"]:E,["uv-region"]:S}=p.attributes;o={position:d,normal:b,color:g,uv0:x,uvRegion:S,id:E},N$t(o,p);let F=X$t(E);F&&J$t(o,F)}else{let{vertexAttributes:p,ordering:d,featureAttributes:b,featureAttributeOrder:g}=n.store.defaultGeometrySchema,x=G$t(e,n);u=x.byteOffset,s=x.vertexCount,c=x.featureCount;let{attributes:E,byteOffset:S}=_Be(e,u,p,s,d),{attributes:F}=_Be(e,S,b,c,g);Y$t(F),o=U$t(E,F)}if(!((h=i==null?void 0:i.i3s)!=null&&h.coordinateSystem)||i.i3s.coordinateSystem===2){let p=H$t(o.position,r);t.modelMatrix=p.invert(),t.coordinateSystem=2}else t.modelMatrix=V$t(o.position),t.coordinateSystem=3;t.attributes={positions:o.position,normals:o.normal,colors:xBe(o.color),texCoords:o.uv0,uvRegions:xBe(o.uvRegion||o.region)},t.indices=l||null,o.id&&o.id.value&&(t.featureIds=o.id.value);for(let p in t.attributes)t.attributes[p]||delete t.attributes[p];return t.vertexCount=s,t.byteLength=a,t}function N$t(e,t){for(let r in t.loaderData.attributes){let n=t.loaderData.attributes[r];switch(n.name){case"POSITION":e.position.metadata=n.metadata;break;case"feature-index":e.id.metadata=n.metadata;break;default:break}}}function U$t(e,t){return{...e,...t}}function xBe(e){return e&&(e.normalized=!0,e)}function G$t(e,t){let r=0,n=0,i=0;for(let{property:a,type:o}of t.store.defaultGeometrySchema.header){let s=KW(o);switch(a){case"vertexCount":n=new s(e,0,4)[0],r+=ny(o);break;case"featureCount":i=new s(e,4,4)[0],r+=ny(o);break;default:break}}return{vertexCount:n,featureCount:i,byteOffset:r}}function _Be(e,t,r,n,i){let a={};for(let o of i)if(r[o]){let{valueType:s,valuesPerElement:u}=r[o];if(t+n*u*ny(s)<=e.byteLength){let c=e.slice(t),l;if(s==="UInt64")l=z$t(c,n*u,ny(s));else{let f=KW(s);l=new f(c,0,n*u)}switch(a[o]={value:l,type:pBe[s],size:u},o){case"color":a.color.normalized=!0;break;case"position":case"region":case"normal":default:}t=t+n*u*ny(s)}else if(o!=="uv0")break}return{attributes:a,byteOffset:t}}function z$t(e,t,r){let n=[],i=new DataView(e),a=0;for(let o=0;o<t;o++){let s=i.getUint32(a,!0),u=i.getUint32(a+4,!0),c=s+2**32*u;n.push(c),a+=r}return new Uint32Array(n)}function H$t(e,t){let r=t.mbs,n=e.value,i=e.metadata,a=new Kr,o=new ce(r[0],r[1],r[2]),s=new ce;return or.WGS84.cartographicToCartesian(o,s),or.WGS84.eastNorthUpToFixedFrame(s,a),e.value=W$t(n,i,o),a}function W$t(e,t={},r){let n=new Float64Array(e.length),i=t["i3s-scale_x"]&&t["i3s-scale_x"].double||1,a=t["i3s-scale_y"]&&t["i3s-scale_y"].double||1;for(let o=0;o<n.length;o+=3)n[o]=e[o]*i+r.x,n[o+1]=e[o+1]*a+r.y,n[o+2]=e[o+2]+r.z;for(let o=0;o<n.length;o+=3)or.WGS84.cartographicToCartesian(n.subarray(o,o+3),ak),n[o]=ak.x,n[o+1]=ak.y,n[o+2]=ak.z;return n}function V$t(e){var a,o;let t=e.metadata,r=((a=t==null?void 0:t["i3s-scale_x"])==null?void 0:a.double)||1,n=((o=t==null?void 0:t["i3s-scale_y"])==null?void 0:o.double)||1,i=new Kr;return i[0]=r,i[5]=n,i}function K$t(e,t){let r;return e?r={...e,pbrMetallicRoughness:e.pbrMetallicRoughness?{...e.pbrMetallicRoughness}:{baseColorFactor:[255,255,255,255]}}:(r={pbrMetallicRoughness:{}},t?r.pbrMetallicRoughness.baseColorTexture={texCoord:0}:r.pbrMetallicRoughness.baseColorFactor=[255,255,255,255]),r.alphaCutoff=r.alphaCutoff||.25,r.alphaMode&&(r.alphaMode=r.alphaMode.toUpperCase()),r.emissiveFactor&&(r.emissiveFactor=wBe(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=wBe(r.pbrMetallicRoughness.baseColorFactor)),t&&$$t(r,t),r}function wBe(e){let t=[...e];for(let r=0;r<e.length;r++)t[r]=e[r]/255;return t}function $$t(e,t){let r={source:{image:t}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture={...e.pbrMetallicRoughness.baseColorTexture,texture:r}:e.emissiveTexture?e.emissiveTexture={...e.emissiveTexture,texture:r}:e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture={...e.pbrMetallicRoughness.metallicRoughnessTexture,texture:r}:e.normalTexture?e.normalTexture={...e.normalTexture,texture:r}:e.occlusionTexture&&(e.occlusionTexture={...e.occlusionTexture,texture:r})}function Y$t(e){let{id:t,faceRange:r}=e;if(!t||!r)return;let n=t.value,i=r.value,a=i[i.length-1]+1,o=new Uint32Array(a*3),s=0,u=0;for(let c=1;c<i.length;c+=2){let l=Number(n[s]),f=i[c],h=i[c-1],p=f-h+1,d=u+p*3;o.fill(l,u,d),s++,u=d}e.id.value=o}function J$t(e,t){let r=e.id.value,n=new Float32Array(r.length);for(let i=0;i<r.length;i++)n[i]=t[r[i]];e.id.value=n}function X$t(e){var t,r;return(r=(t=e==null?void 0:e.metadata)==null?void 0:t["i3s-feature-ids"])==null?void 0:r.intArray}var Q$t="4.0.0-beta.8",ABe={name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:Q$t,mimeTypes:["application/octet-stream"],parse:Z$t,extensions:["bin"],options:{"i3s-content":{}}};async function Z$t(e,t,r){let{tile:n,_tileOptions:i,tileset:a,_tilesetOptions:o}=(t==null?void 0:t.i3s)||{},s=i||n,u=o||a;return!s||!u?null:await EBe(e,s,u,t,r)}var eYt="4.0.0-beta.8",SBe={name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:eYt,mimeTypes:["application/json"],parse:tYt,extensions:["json"],options:{i3s:{}}};async function tYt(e,t){return JSON.parse(new TextDecoder().decode(e))}var pw=class{tileset;nodePages=[];pendingNodePages=[];nodesPerPage;options;lodSelectionMetricType;textureDefinitionsSelectedFormats=[];nodesInNodePages;url;textureLoaderOptions={};constructor(t,r="",n){var i,a;this.tileset={...t},this.url=r,this.nodesPerPage=((i=t.nodePages)==null?void 0:i.nodesPerPage)||64,this.lodSelectionMetricType=(a=t.nodePages)==null?void 0:a.lodSelectionMetricType,this.options=n,this.nodesInNodePages=0,this.initSelectedFormatsForTextureDefinitions(t)}async getNodeById(t){var i;let r=Math.floor(t/this.nodesPerPage);if(!this.nodePages[r]&&!this.pendingNodePages[r]){let a=iy(`${this.url}/nodepages/${r}`,(i=this.options.i3s)==null?void 0:i.token);this.pendingNodePages[r]={status:"Pending",promise:An(a,SBe,this.options)},this.nodePages[r]=await this.pendingNodePages[r].promise,this.nodesInNodePages+=this.nodePages[r].nodes.length,this.pendingNodePages[r].status="Done"}this.pendingNodePages[r].status==="Pending"&&(this.nodePages[r]=await this.pendingNodePages[r].promise);let n=t%this.nodesPerPage;return this.nodePages[r].nodes[n]}async formTileFromNodePages(t){let r=await this.getNodeById(t),n=[],i=[];for(let p of r.children||[])i.push(this.getNodeById(p));let a=await Promise.all(i);for(let p of a)n.push({id:p.index.toString(),obb:p.obb});let o,s,u,c="jpg",l=[],f=!1;if(r&&r.mesh){let{url:p,isDracoGeometry:d}=r.mesh.geometry&&this.getContentUrl(r.mesh.geometry)||{isDracoGeometry:!1};o=p,f=d;let{textureData:b,materialDefinition:g}=this.getInformationFromMaterial(r.mesh.material);u=g,c=b.format||c,b.name&&(s=`${this.url}/nodes/${r.mesh.material.resource}/textures/${b.name}`),this.tileset.attributeStorageInfo&&(l=yBe(this.tileset,this.url,r.mesh.attribute.resource))}let h=this.getLodSelection(r);return $W({id:t.toString(),lodSelection:h,obb:r.obb,contentUrl:o,textureUrl:s,attributeUrls:l,materialDefinition:u,textureFormat:c,textureLoaderOptions:this.textureLoaderOptions,children:n,isDracoGeometry:f})}getContentUrl(t){let r=null,n=this.tileset.geometryDefinitions[t.definition],i=-1;if(this.options.i3s&&this.options.i3s.useDracoGeometry&&(i=n.geometryBuffers.findIndex(a=>a.compressedAttributes&&a.compressedAttributes.encoding==="draco")),i===-1&&(i=n.geometryBuffers.findIndex(a=>!a.compressedAttributes)),i!==-1){let a=Boolean(n.geometryBuffers[i].compressedAttributes);r={url:`${this.url}/nodes/${t.resource}/geometries/${i}`,isDracoGeometry:a}}return r}getLodSelection(t){let r=[];return this.lodSelectionMetricType==="maxScreenThresholdSQ"&&r.push({metricType:"maxScreenThreshold",maxError:Math.sqrt(t.lodThreshold/(Math.PI*.25))}),r.push({metricType:this.lodSelectionMetricType,maxError:t.lodThreshold}),r}getInformationFromMaterial(t){var n,i,a;let r={textureData:{name:null}};if(t){let o=(n=this.tileset.materialDefinitions)==null?void 0:n[t.definition];if(o){r.materialDefinition=o;let s=(a=(i=o==null?void 0:o.pbrMetallicRoughness)==null?void 0:i.baseColorTexture)==null?void 0:a.textureSetDefinitionId;typeof s=="number"&&(r.textureData=this.textureDefinitionsSelectedFormats[s]||r.textureData)}}return r}initSelectedFormatsForTextureDefinitions(t){this.textureDefinitionsSelectedFormats=[];let r=this.getSupportedTextureFormats(),n=t.textureSetDefinitions||[];for(let i of n){let a=i&&i.formats||[],o=null;for(let s of r){let u=a.find(c=>c.format===s);if(u){o=u;break}}o&&o.format==="ktx2"&&(this.textureLoaderOptions.basis={format:Pv(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(o)}}getSupportedTextureFormats(){let t=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){let r=s_();r.has("etc2")&&t.push("ktx-etc2"),r.has("dxt")&&t.push("dds"),t.push("ktx2")}return t.push("jpg"),t.push("png"),t}};function TBe(e,t){let r=t.url||"",n;e.geometryData&&(n=`${r}/${e.geometryData[0].href}`);let i;e.textureData&&(i=`${r}/${e.textureData[0].href}`);let a;e.attributeData&&(a=bBe(r,e));let o=e.children||[];return $W({...e,children:o,url:r,contentUrl:n,textureUrl:i,textureFormat:"jpg",attributeUrls:a,isDracoGeometry:!1})}function $W(e){var s,u;let t={},r=[0,0,0,1];if(e.mbs)r=e.mbs,t.sphere=[...or.WGS84.cartographicToCartesian(e.mbs.slice(0,3)),e.mbs[3]];else if(e.obb){t.box=[...or.WGS84.cartographicToCartesian(e.obb.center),...e.obb.halfSize,...e.obb.quaternion];let l=new aa().fromCenterHalfSizeQuaternion(t.box.slice(0,3),e.obb.halfSize,e.obb.quaternion).getBoundingSphere();t.sphere=[...l.center,l.radius],r=[...e.obb.center,l.radius]}let n=(s=e.lodSelection)==null?void 0:s[0].metricType,i=(u=e.lodSelection)==null?void 0:u[0].maxError,a="mesh",o=2;return{...e,mbs:r,boundingVolume:t,lodMetricType:n,lodMetricValue:i,type:a,refine:o}}async function CBe(e,t,r){let n=ik(r.url||""),i,a;if(e.nodePages)i=new pw(e,n,t),a=await i.formTileFromNodePages(0);else{let o=t.i3s,s=iy(`${n}/nodes/root`,o.token);a=await An(s,Zl,{...t,i3s:{...t.i3s,loadContent:!1,isTileHeader:!0,isTileset:!1}})}return{...e,loader:Zl,url:n,basePath:n,type:"I3S",nodePagesTile:i,root:a,lodMetricType:a.lodMetricType,lodMetricValue:a.lodMetricValue}}var rYt="4.0.0-beta.8",nYt=/layers\/[0-9]+$/,iYt=/nodes\/([0-9-]+|root)$/,aYt="504b0304",oYt="PointCloud",Zl={name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:rYt,mimeTypes:["application/octet-stream"],parse:sYt,extensions:["bin"],options:{i3s:{token:null,isTileset:"auto",isTileHeader:"auto",tile:null,tileset:null,_tileOptions:null,_tilesetOptions:null,useDracoGeometry:!0,useCompressedTextures:!0,decodeTextures:!0,coordinateSystem:2}}};async function sYt(e,t={},r){let n=r.url;if(t.i3s=t.i3s||{},fYt(e)===aYt)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let a=ik(n),o;t.i3s.isTileset==="auto"?o=nYt.test(a):o=t.i3s.isTileset;let s;return t.isTileHeader==="auto"?s=iYt.test(a):s=t.i3s.isTileHeader,o?e=await cYt(e,t,r):s?e=await lYt(e,r):e=await uYt(e,t),e}async function uYt(e,t){return await ko(e,ABe,t)}async function cYt(e,t,r){let n=JSON.parse(new TextDecoder().decode(e));if((n==null?void 0:n.layerType)===oYt)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return await CBe(n,t,r)}async function lYt(e,t){return e=JSON.parse(new TextDecoder().decode(e)),TBe(e,t)}function fYt(e){return e instanceof ArrayBuffer?[...new Uint8Array(e,0,4)].map(t=>t.toString(16).padStart(2,"0")).join(""):null}function FBe(e,t){let{attributeName:r,attributeType:n}=t;return r?{[r]:n?hYt(n,e):null}:{}}function hYt(e,t){switch(e){case dBe:return mYt(t);case mBe:return DBe(t);case gBe:return dYt(t);case vBe:return pYt(t);default:return DBe(t)}}function DBe(e){return new Uint32Array(e,4)}function pYt(e){return new Int16Array(e,4)}function dYt(e){return new Float64Array(e,8)}function mYt(e){let i=[];try{let a=new DataView(e,0,4).getUint32(0,!0),o=new Uint32Array(e,8,a),s=8+a*4;for(let u of o){let c=new TextDecoder("utf-8"),l=new Uint8Array(e,s,u);i.push(c.decode(l)),s+=u}}catch(a){console.error("Parse string attribute error: ",a.message)}return i}var gYt="4.0.0-beta.8";var YW={name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:gYt,mimeTypes:["application/binary"],parse:async(e,t)=>FBe(e,t),extensions:["bin"],options:{},binary:!0};function JW(e,t){let r=[e.center[0],e.center[1],e.center[2]+t.getHeight(e.center[1],e.center[0])],n=or.WGS84.cartographicToCartesian(r,new ce),i=new aa().fromCenterHalfSizeQuaternion(n,e.halfSize,e.quaternion);return[...i.center,...i.halfAxes.toArray()]}var ok=$t(_u(),1),vYt=()=>({version:{path:"version",default:"1.0"}}),kBe=()=>({boundingVolume:{path:"boundingVolume"},geometricError:{path:"geometricError"},content:{path:"content"},children:{path:"children",transform:e=>e.map(t=>(0,ok.default)(t,kBe()))}}),BBe=()=>({asset:{path:"asset",transform:e=>(0,ok.default)(e,vYt())},geometricError:{path:"root",transform:e=>e.geometricError},root:{path:"root",transform:e=>(0,ok.default)(e,kBe())}});function OBe(e,t){let r=new Float32Array(e.length),n=yYt(t);for(let i=0;i<e.length;i+=2){let a=e.subarray(i,i+2),o=n.slice(i*2,i*2+4),s=bYt([a[0],a[1]]),u=[o[2]-o[0],o[3]-o[1]],c=[s[0]*u[0],s[1]*u[1]],l=[c[0]+o[0],c[1]+o[1]];r[i]=l[0],r[i+1]=l[1]}return r}function bYt(e){return[e[0]-Math.floor(e[0]),e[1]-Math.floor(e[1])]}function yYt(e){let r=[];for(let n=0;n<e.length;n++)r[n]=e[n]/65535;return r}var xYt=new Kr([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),IBe=new ce,dw=class{rtcCenter;i3sTile;async convert(t,r=null){let n=await this.buildGLTF(t,r);return a8({gltfEncoded:new Uint8Array(n),type:"b3dm",featuresLength:this._getFeaturesLength(r),batchTable:r},ZU)}async buildGLTF(t,r){let{tileContent:n,textureFormat:i,box:a}=t,{material:o,attributes:s,indices:u,modelMatrix:c}=n,l=new qr,f=await this._addI3sTextureToGLTF(n,i,l),h=this._convertI3sMaterialToGLTFMaterial(o,f),p=l.addMaterial(h),d=s.positions,b=d.value;s.uvRegions&&s.texCoords&&(s.texCoords.value=OBe(s.texCoords.value,s.uvRegions.value));let g=new ce(a),x=or.WGS84.cartesianToCartographic(g,new ce);s.positions.value=this._normalizePositions(b,g,x,c),this._createBatchIds(n,r),s.normals&&!this._checkNormals(s.normals.value)&&delete s.normals;let E=u||XF(b.length/d.size),S=l.addMesh({attributes:s,indices:E,material:p,mode:4}),F=this._generateTransformMatrix(g),D=l.addNode({meshIndex:S,matrix:F}),j=l.addScene({nodeIndices:[D]});return l.setDefaultScene(j),l.createBinaryChunk(),a8(l.gltf,qq)}async _addI3sTextureToGLTF(t,r,n){let{texture:i,material:a,attributes:o}=t,s=null,u=i;if(!i&&a&&(u=a.pbrMetallicRoughness&&a.pbrMetallicRoughness.baseColorTexture&&a.pbrMetallicRoughness.baseColorTexture.texture.source.image),u){let c=this._deduceMimeTypeFromFormat(r),l=n.addImage(u,c);s=n.addTexture({imageIndex:l}),delete o.colors}return s}_normalizePositions(t,r,n,i){let a=new Float32Array(t.length);for(let o=0;o<t.length;o+=3){let s=t.subarray(o,o+3),u=new ce(r),c=new ce(Array.from(s)).transform(i).add(n);or.WGS84.cartographicToCartesian(c,IBe),c=IBe.subtract(u),a.set(c,o)}return a}_generateTransformMatrix(t){return new Kr().translate(t).multiplyLeft(xYt)}_createBatchIds(t,r){let{featureIds:n}=t,{OBJECTID:i}=r||{};if(!(!n||!i)){for(let a=0;a<n.length;a++){let o=n[a],s=i.indexOf(o);n[a]=s}t.attributes._BATCHID={size:1,byteOffset:0,value:n}}}_deduceMimeTypeFromFormat(t){switch(t){case"jpg":return"image/jpeg";case"png":return"image/png";case"ktx2":return"image/ktx2";default:return console.warn(`Unexpected texture format in I3S: ${t}`),"image/jpeg"}}_convertI3sMaterialToGLTFMaterial(t,r){let n=r!==null;return t?(r!==null&&(t=this._setGLTFTexture(t,r)),t):(t={alphaMode:"OPAQUE",doubleSided:!1,pbrMetallicRoughness:{metallicFactor:0,roughnessFactor:1}},n?t.pbrMetallicRoughness.baseColorTexture={index:r,texCoord:0}:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,1],t)}_setGLTFTexture(t,r){let n={...t,pbrMetallicRoughness:{...t.pbrMetallicRoughness}};return t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture?n.pbrMetallicRoughness.baseColorTexture={index:r,texCoord:0}:t.emissiveTexture?n.emissiveTexture={index:r,texCoord:0}:t.pbrMetallicRoughness&&t.pbrMetallicRoughness.metallicRoughnessTexture?n.pbrMetallicRoughness.metallicRoughnessTexture={index:r,texCoord:0}:t.normalTexture?n.normalTexture={index:r,texCoord:0}:t.occlusionTexture&&(n.occlusionTexture={index:r,texCoord:0}),n}_getFeaturesLength(t){if(!t)return 0;let r=Object.keys(t)[0];return r?t[r].length:0}_checkNormals(t){return t.find(r=>r)}};var PBe=async(e,t,r)=>{if(!e||!t.contentUrl)return null;let n={...r,i3s:{...r.i3s,isTileset:!1,isTileHeader:!1,_tileOptions:{attributeUrls:t.attributeUrls,textureUrl:t.textureUrl,textureFormat:t.textureFormat,textureLoaderOptions:t.textureLoaderOptions,materialDefinition:t.materialDefinition,isDracoGeometry:t.isDracoGeometry,mbs:t.mbs},_tilesetOptions:{store:e.store,attributeStorageInfo:e.attributeStorageInfo,fields:e.fields}}};return await An(t.contentUrl,Zl,n)};var _Yt="I3S",ay=class{options;tilesetPath;vertexCounter;conversionStartTime;geoidHeightModel;sourceTileset;attributeStorageInfo;workerSource={};loaderOptions={_nodeWorkers:!0,reuseWorkers:!0,i3s:{coordinateSystem:3,decodeTextures:!1},"i3s-content":{workerUrl:"./modules/i3s/dist/i3s-content-worker-node.js"}};constructor(){this.options={},this.tilesetPath="",this.vertexCounter=0,this.conversionStartTime=[0,0],this.geoidHeightModel=null,this.sourceTileset=null,this.attributeStorageInfo=null,this.workerSource={}}async convert(t){var f;if(gn)return console.log(ty),ty;let{inputUrl:r,outputPath:n,tilesetName:i,maxDepth:a,egmFilePath:o}=t;if(this.conversionStartTime=XW.default.hrtime(),this.options={maxDepth:a},console.log("Loading egm file..."),this.geoidHeightModel=await An(o,ZF),console.log("Loading egm file completed!"),this.sourceTileset=await An(r,Zl,this.loaderOptions),!this.sourceTileset)return;let s=(f=this.sourceTileset)==null?void 0:f.root;s.obb||(s.obb=PW(s.mbs)),this.tilesetPath=(0,RBe.join)(`${n}`,`${i}`),this.attributeStorageInfo=this.sourceTileset.attributeStorageInfo;try{await aw(this.tilesetPath)}catch{}let u={boundingVolume:{box:JW(s.obb,this.geoidHeightModel)},geometricError:LW(s),children:[]};await this._addChildren(s,u,1);let c=(0,jBe.default)({root:u},BBe());await Fi(this.tilesetPath,JSON.stringify(c),"tileset.json"),this._finishConversion({slpk:!1,outputPath:n,tilesetName:i}),Ra.getWorkerFarm({}).destroy()}async convertChildNode(t,r,n,i){let a=await this._loadChildNode(t,i);if(a.contentUrl){let o=await PBe(this.sourceTileset,a,this.loaderOptions);if(!o){await this._addChildren(a,r,n+1);return}this.vertexCounter+=(o==null?void 0:o.vertexCount)||0;let s=null;this.attributeStorageInfo&&(s=await this._loadChildAttributes(a,this.attributeStorageInfo)),a.obb||(a.obb=PW(a.mbs));let u={box:JW(a.obb,this.geoidHeightModel)},c={boundingVolume:u,geometricError:LW(a),children:[]},l={tileContent:o,box:u.box,textureFormat:a.textureFormat},h=await new dw().convert(l,s);c.content={uri:`${a.id}.b3dm`,boundingVolume:u},await Fi(this.tilesetPath,new Uint8Array(h),`${a.id}.b3dm`),r.children.push(c),await this._addChildren(a,c,n+1)}else await this._addChildren(a,r,n+1)}async _addChildren(t,r,n){if(this.options.maxDepth&&n>this.options.maxDepth)return;let i=[];for(let a of t.children||[])i.push(this.convertChildNode(t,r,n,a));await Promise.all(i)}async _loadChildNode(t,r){var i;let n;if((i=this.sourceTileset)!=null&&i.nodePagesTile)console.log(`Node conversion: ${r.id}`),n=await this.sourceTileset.nodePagesTile.formTileFromNodePages(parseInt(r.id));else{let a=this._relativeUrlToFullUrl(t.url,r.href),o={i3s:{...this.loaderOptions,isTileHeader:!0,loadContent:!1}};console.log(`Node conversion: ${a}`),n=await An(a,Zl,o)}return n}_relativeUrlToFullUrl(t="",r){let n=t.split("/"),i=r.split("/");for(let a of i)switch(a){case".":continue;case"..":n=n.slice(0,-1);break;default:n.push(a)}return n.join("/")}async _loadChildAttributes(t,r){let n=[],{attributeUrls:i=[]}=t;for(let o=0;o<i.length;o++){let s=i[o],u=r[o],c={attributeName:u.name,attributeType:this._getAttributeType(u)};n.push(An(s,YW,c))}let a=await Promise.all(n);return this._replaceNestedArrays(a),Object.assign({},...a)}_getAttributeType(t){return t.attributeValues?t.attributeValues.valueType:t.objectIds?"Oid32":""}_replaceNestedArrays(t){for(let r=0;r<t.length;r++){let n=t[r];for(let i in n)n[i]=Array.from(n[i])}}async _finishConversion(t){let r=await JF(t),n=XW.default.hrtime(this.conversionStartTime),i=YF(n);console.log("------------------------------------------------"),console.log(`Finish conversion of ${_Yt}`),console.log(`Total conversion time: ${i}`),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",r," bytes"),console.log("------------------------------------------------")}};var sk=require("path");var wYt="4.0.0-beta.8",EYt="https://raw.githubusercontent.com/visgl/deck.gl-data/master/egm/egm2008-5.zip",uk=class{async install(t=""){console.log('Installing "EGM2008-5" model...');let r=await An(EYt,$U,{}),n=process.cwd();t&&(n=(0,sk.join)(n,t)),await Fi(n,new Uint8Array(r["geoids/egm2008-5.pgm"]),"egm2008-5.pgm"),console.log('Installing "I3S Content Loader" worker'),await this.installFromNpm("i3s","i3s-content-worker-node.js"),console.log('Installing "Draco Loader" worker'),await this.installFromNpm("draco","draco-worker-node.js"),console.log('Installing "Draco Writer" worker'),await this.installFromNpm("draco","draco-writer-worker-node.js"),console.log('Installing "Basis Loader" worker'),await this.installFromNpm("textures","basis-worker-node.js"),console.log('Installing "KTX2 Basis Writer" worker'),await this.installFromNpm("textures","ktx2-basis-writer-worker-node.js"),console.log('Installing "Draco decoder" library'),await this.installFromUrl(Eh[ii.DECODER],"draco",ii.DECODER),await this.installFromUrl(Eh[ii.DECODER_WASM],"draco",ii.DECODER_WASM),console.log('Installing "Draco encoder" library'),await this.installFromUrl(Eh[ii.ENCODER],"draco",ii.ENCODER),console.log('Installing "Basis transcoder" library'),await this.installFromNpm("textures",_c.TRANSCODER,"libs"),await this.installFromNpm("textures",_c.TRANSCODER_WASM,"libs"),console.log('Installing "Basis encoder" library'),await this.installFromNpm("textures",_c.ENCODER,"libs"),await this.installFromNpm("textures",_c.ENCODER_WASM,"libs"),console.log('Installing "join-images" npm package'),await new ll().start({command:process.platform==="win32"?"npm.cmd":"npm",arguments:["install","sharp@0.30.4","join-images@1.1.3"],wait:0,ignoreStderr:!0}),console.log("All dependencies were installed succesfully.")}async installFromNpm(t,r,n=""){let a=await(await Fo(`https://unpkg.com/@loaders.gl/${t}@${wYt}/dist/${n}/${r}`)).arrayBuffer();if(!a)return;let o=(0,sk.join)(process.cwd(),"modules",t,"dist",n);await Fi(o,a,r)}async installFromUrl(t,r,n){let a=await(await Fo(t)).arrayBuffer();if(!a)return;let o=(0,sk.join)(process.cwd(),"modules",r,"dist","libs");await Fi(o,a,n)}};function Su(e,t){if(e+1>=t.length)return"";let r=t[e+1];return r.indexOf("--")===0?"":r}function LBe(e,t){let r=Su(e,t);return console.log(`Input tileset value: ${r}`),console.log(`Modified tileset value: ${r.replace(/\\/g,"/")}`),r.replace(/\\/g,"/")}function MBe(e){return e.reduce((t,r)=>{let n=r.indexOf("="),i=r.slice(0,n),a=r.slice(n+1,r.length);return r.includes("=")&&r.startsWith("--")&&a?t.concat(i,a):t.concat(r)},[])}function qBe(e,t){let r=Su(e,t),n=Number.parseInt(r);return isFinite(n)?n:NaN}function Nc(e,t){let r=Su(e,t).toLowerCase().trim();return["--no-draco","--split-nodes"].includes(t[e])&&!r?!1:!r||r==="true"}var QW={I3S:"I3S",_3DTILES:"3DTILES"};async function AYt(){let[,,...e]=process.argv;e.length===0&&ZW();let t=MBe(e),r=CYt(t);if(r.installDependencies){new uk().install("deps");return}let n=TYt(r);await SYt(n)}AYt().catch(e=>{console.log(e),process.exit(1)});function ZW(){console.log("cli: converter 3dTiles to I3S or I3S to 3dTiles..."),console.log('--install-dependencies [Run the script for installing dependencies. Run this options separate from others. Now "*.pgm" file installation is implemented]'),console.log("--max-depth [Maximal depth of hierarchical tiles tree traversal, default: infinite]"),console.log("--name [Tileset name]"),console.log('--output [Output folder, default: "data" folder]'),console.log("--instant-node-writing [Keep created 3DNodeIndexDocument files on disk instead of memory. This option reduce memory usage but decelerates conversion speed]"),console.log("--split-nodes [Prevent to merge similar materials that could lead to incorrect visualization (I3S to 3DTiles conversion only)]"),console.log("--slpk [Generate slpk (Scene Layer Packages) I3S output file]"),console.log("--tileset [tileset.json file (3DTiles) / http://..../SceneServer/layers/0 resource (I3S)]"),console.log("--input-type [tileset input type: I3S or 3DTILES]"),console.log('--7zExe [location of 7z.exe archiver to create slpk on Windows, default: "C:\\Program Files\\7-Zip\\7z.exe"]'),console.log('--egm [location of Earth Gravity Model *.pgm file to convert heights from ellipsoidal to gravity-related format. A model file can be loaded from GeographicLib https://geographiclib.sourceforge.io/html/geoid.html], default: "./deps/egm2008-5.zip"'),console.log("--token [Token for Cesium ION tilesets authentication]"),console.log("--no-draco [Disable draco compression for geometry]"),console.log("--generate-textures [Enable KTX2 textures generation if only one of (JPG, PNG) texture is provided or generate JPG texture if only KTX2 is provided]"),console.log("--generate-bounding-volumes [Generate obb and mbs bounding volumes from geometry]"),console.log("--analyze [Analyze the input tileset content without conversion, default: false]"),console.log('--metadata-class [One of the list of feature metadata classes, detected by converter on "analyze" stage, default: not set]'),console.log("--validate [Enable validation]"),process.exit(0)}async function SYt(e){switch(console.log("------------------------------------------------"),console.log(`Starting conversion of ${e.inputType}`),console.log("------------------------------------------------"),e.inputType.toUpperCase()){case QW.I3S:new ay().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,egmFilePath:e.egm});break;case QW._3DTILES:await new ry().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,slpk:e.slpk,sevenZipExe:e.sevenZipExe,egmFilePath:e.egm,token:e.token,draco:e.draco,mergeMaterials:e.mergeMaterials,generateTextures:e.generateTextures,generateBoundingVolumes:e.generateBoundingVolumes,validate:e.validate,instantNodeWriting:e.instantNodeWriting,metadataClass:e.metadataClass,analyze:e.analyze,inquirer:UBe.default});break;default:ZW()}}function TYt(e){let t={name:{getMessage:()=>console.log("Missed: --name [Tileset name]"),condition:n=>Boolean(n)||Boolean(e.analyze)},output:{getMessage:()=>console.log("Missed: --output [Output path name]")},sevenZipExe:{getMessage:()=>console.log("Missed: --7zExe [7z archiver executable path]")},egm:{getMessage:()=>console.log("Missed: --egm [*.pgm earth gravity model file path]")},tileset:{getMessage:()=>console.log("Missed: --tileset [tileset.json file]")},inputType:{getMessage:()=>console.log("Missed/Incorrect: --input-type [tileset input type: I3S or 3DTILES]"),condition:n=>Boolean(n)&&Object.values(QW).includes(n.toUpperCase())}},r=[];for(let n in t){let i=e[n],a=t[n].condition;(a?a(i):i)||r.push(t[n].getMessage)}return r.length&&(r.forEach(n=>n()),process.exit(1)),e}function CYt(e){let t={output:"data",instantNodeWriting:!1,mergeMaterials:!0,sevenZipExe:"C:\\Program Files\\7-Zip\\7z.exe",egm:(0,NBe.join)(process.cwd(),"deps","egm2008-5.pgm"),draco:!0,installDependencies:!1,generateTextures:!1,generateBoundingVolumes:!1,validate:!1,slpk:!1};return e.forEach((r,n)=>{if(r.indexOf("--")===0)switch(r){case"--input-type":t.inputType=Su(n,e);break;case"--tileset":t.tileset=LBe(n,e);break;case"--name":t.name=Su(n,e);break;case"--output":t.output=Su(n,e);break;case"--instant-node-writing":t.instantNodeWriting=Nc(n,e);break;case"--split-nodes":t.mergeMaterials=Nc(n,e);break;case"--max-depth":t.maxDepth=qBe(n,e);break;case"--slpk":t.slpk=Nc(n,e);break;case"--7zExe":t.sevenZipExe=Su(n,e);break;case"--egm":t.egm=Su(n,e);break;case"--token":t.token=Su(n,e);break;case"--no-draco":t.draco=Nc(n,e);break;case"--validate":t.validate=Nc(n,e);break;case"--install-dependencies":t.installDependencies=Nc(n,e);break;case"--generate-textures":t.generateTextures=Nc(n,e);break;case"--generate-bounding-volumes":t.generateBoundingVolumes=Nc(n,e);break;case"--analyze":t.analyze=Nc(n,e);break;case"--metadata-class":t.metadataClass=Su(n,e);break;case"--help":ZW();break;default:console.warn(`Unknown option ${r}`),process.exit(0)}}),t}
|
|
179
|
+
`).forEach(s=>{let u=a.exec(s);u&&i.push(Number(u[1]))});let o=e;for(;i.includes(o);)o++;t(o)})})}var wae={command:"",arguments:[],port:5e3,autoPort:!0,wait:2e3,onSuccess:e=>{console.log(`Started ${e.props.command}`)}},ll=class{id;props={...wae};childProcess=null;port=0;successTimer;constructor({id:t="browser-driver"}={}){this.id=t}async start(t){t={...wae,...t},this.props=t;let r=[...t.arguments];return this.port=Number(t.port),t.portArg&&(t.autoPort&&(this.port=await _ae(t.port)),r.push(t.portArg,String(this.port))),await new Promise((n,i)=>{try{this._setTimeout(()=>{t.onSuccess&&t.onSuccess(this),n({})}),console.log(`Spawning ${t.command} ${t.arguments.join(" ")}`);let a=Eae.spawn(t.command,r,t.spawn);this.childProcess=a,a.stdout.on("data",o=>{console.log(o.toString())}),a.stderr.on("data",o=>{console.log(`Child process wrote to stderr: "${o}".`),t.ignoreStderr||(this._clearTimeout(),i(new Error(o)))}),a.on("error",o=>{console.log(`Child process errored with ${o}`),this._clearTimeout(),i(o)}),a.on("close",o=>{console.log(`Child process exited with ${o}`),this.childProcess=null,this._clearTimeout(),n({})})}catch(a){i(a)}})}async stop(){this.childProcess&&(this.childProcess.kill(),this.childProcess=null)}async exit(t=0){try{await this.stop(),process.exit(t)}catch(r){console.error(r.message||r),process.exit(1)}}_setTimeout(t){Number(this.props.wait)>0&&(this.successTimer=setTimeout(t,this.props.wait))}_clearTimeout(){this.successTimer&&clearTimeout(this.successTimer)}};function MI(e,t){return!Ra.isSupported()||!$a&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}async function qI(e,t,r,n,i){let a=e.id,o=Tx(e,r),u=Ra.getWorkerFarm(r).getWorkerPool({name:a,url:o});r=JSON.parse(JSON.stringify(r)),n=JSON.parse(JSON.stringify(n||{}));let c=await u.startJob("process-on-worker",OWe.bind(null,i));return c.postMessage("process",{input:t,options:r,context:n}),await(await c.result).result}async function OWe(e,t,r,n){switch(r){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":let{id:i,input:a,options:o}=n;try{let s=await e(a,o);t.postMessage("done",{id:i,result:s})}catch(s){let u=s instanceof Error?s.message:"unknown error";t.postMessage("error",{id:i,error:u})}break;default:console.warn(`parse-with-worker unknown message ${r}`)}}function NI(e,t){return!Ra.isSupported()||!gn&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}function Sae(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?Aae(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?Aae(e,0,t):""}function Aae(e,t,r){if(e.byteLength<=t+r)return"";let n=new DataView(e),i="";for(let a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function UI(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${Sae(e)}"`)}}function Zu(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let n=new Uint8Array(e),i=new Uint8Array(t);for(let a=0;a<n.length;++a)if(n[a]!==i[a])return!1;return!0}function ec(...e){let t=e.map(a=>a instanceof ArrayBuffer?new Uint8Array(a):a),r=t.reduce((a,o)=>a+o.byteLength,0),n=new Uint8Array(r),i=0;for(let a of t)n.set(a,i),i+=a.byteLength;return n.buffer}function To(...e){let t=e,r=t&&t.length>1&&t[0].constructor||null;if(!r)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');let n=t.reduce((o,s)=>o+s.length,0),i=new r(n),a=0;for(let o of t)i.set(o,a),a+=o.length;return i}function Gp(e,t,r){let n=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function Co(e,t){return Qt(e>=0),Qt(t>0),e+(t-1)&~(t-1)}function GI(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let i=e.byteOffset,a=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,i,a)}return t.set(n,r),r+Co(n.byteLength,4)}function zI(e,t){let r=e.length,i=Math.ceil(r/t)*t-r,a="";for(let o=0;o<i;++o)a+=" ";return e+a}function km(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r.charCodeAt(i));return t+n}function Cx(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r[i]);return t+n}function BA(e,t,r,n){let i=Co(r.byteLength,n),a=i-r.byteLength;if(e){let o=new Uint8Array(e.buffer,e.byteOffset+t,r.byteLength),s=new Uint8Array(r);o.set(s);for(let u=0;u<a;++u)e.setUint8(t+r.byteLength+u,32)}return t+=i,t}function Bm(e,t,r,n){let a=new TextEncoder().encode(r);return t=BA(e,t,a,n),t}async function zp(e){let t=[];for await(let r of e)t.push(r);return ec(...t)}function jf(e){return jf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jf(e)}function HI(e,t){if(jf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(jf(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function WI(e){var t=HI(e,"string");return jf(t)==="symbol"?t:String(t)}function zt(e,t,r){return t=WI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var IWe="",Tae={};function tc(e){for(let t in Tae)if(e.startsWith(t)){let r=Tae[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${IWe}${e}`),e}var PWe="4.0.0",VI={name:"JSON",id:"json",module:"json",version:PWe,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:Cae,parse:async e=>Cae(new TextDecoder().decode(e)),options:{}};function Cae(e){return JSON.parse(e)}function Dae(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function Fae(e){return e&&typeof e=="object"&&e.isBuffer}function fl(e){if(Fae(e))return Dae(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 t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function Om(e){return t=>new Promise((r,n)=>e(t,(i,a)=>i?n(i):r(a)))}var eu={};ca(eu,{dirname:()=>LWe,filename:()=>jWe,join:()=>MWe,resolve:()=>qWe});function kae(){var t;if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=(t=window.location)==null?void 0:t.pathname;return(e==null?void 0:e.slice(0,e.lastIndexOf("/")+1))||""}function jWe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function LWe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function MWe(...e){let t="/";return e=e.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${t}`),"")),n!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function qWe(...e){let t=[];for(let a=0;a<e.length;a++)t[a]=e[a];let r="",n=!1,i;for(let a=t.length-1;a>=-1&&!n;a--){let o;a>=0?o=t[a]:(i===void 0&&(i=kae()),o=i),o.length!==0&&(r=`${o}/${r}`,n=o.charCodeAt(0)===Dx)}return r=NWe(r,!n),n?`/${r}`:r.length>0?r:"."}var Dx=47,KI=46;function NWe(e,t){let r="",n=-1,i=0,a,o=!1;for(let s=0;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else{if(a===Dx)break;a=Dx}if(a===Dx){if(!(n===s-1||i===1))if(n!==s-1&&i===2){if(r.length<2||!o||r.charCodeAt(r.length-1)!==KI||r.charCodeAt(r.length-2)!==KI){if(r.length>2){let u=r.length-1,c=u;for(;c>=0&&r.charCodeAt(c)!==Dx;--c);if(c!==u){r=c===-1?"":r.slice(0,c),n=s,i=0,o=!1;continue}}else if(r.length===2||r.length===1){r="",n=s,i=0,o=!1;continue}}t&&(r.length>0?r+="/..":r="..",o=!0)}else{let u=e.slice(n+1,s);r.length>0?r+=`/${u}`:r=u,o=!1}n=s,i=0}else a===KI&&i!==-1?++i:i=-1}return r}var $I=new Error("Not implemented"),Hp=class{handle;size=0;bigsize=0n;url="";constructor(t,r,n){var i;if((i=globalThis.loaders)!=null&&i.NodeFile)return new globalThis.loaders.NodeFile(t,r,n);throw gn?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(t,r){throw $I}async write(t,r,n){throw $I}async stat(){throw $I}async close(){}};var YI=e=>(e==null?void 0:e.getUint8)&&(e==null?void 0:e.slice)&&(e==null?void 0:e.length);var Fx=class{file;size;constructor(t){this.file=new Hp(t,"r"),this.size=this.file.bigsize}async destroy(){await this.file.close()}async getUint8(t){let r=await this.file.read(t,1),n=new Uint8Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint16(t){let r=await this.file.read(t,2),n=new Uint16Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint32(t){let r=await this.file.read(t,4),n=new Uint32Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getBigUint64(t){let r=await this.file.read(t,8),n=new BigInt64Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async slice(t,r){let n=r-t;if(n>Number.MAX_SAFE_INTEGER)throw new Error("too big slice");let i=Number(n);return await this.file.read(t,i)}get length(){return this.size}};var Wp=$t(require("fs"),1),Vp=class{handle;size;bigsize;url;constructor(t,r,n){t=tc(t),this.handle=Wp.default.openSync(t,r,n);let i=Wp.default.fstatSync(this.handle,{bigint:!0});this.size=Number(i.size),this.bigsize=i.size,this.url=t}async close(){return new Promise((t,r)=>{Wp.default.close(this.handle,n=>n?r(n):t())})}async stat(){return await new Promise((t,r)=>Wp.default.fstat(this.handle,{bigint:!0},(n,i)=>{let a={size:Number(i.size),bigsize:i.size,isDirectory:i.isDirectory()};n?r(n):t(a)}))}async read(t,r){let n=new ArrayBuffer(r),i=BigInt(t),a=0,o=new Uint8Array(n),s;for(;r>0;){let u=await GWe(this.handle,o,0,r,i);if(u===0)break;a+=u,i+=BigInt(u),r-=u,s!==void 0&&(s+=u)}return a<r?n.slice(0,a):n}async write(t,r=0,n=t.byteLength){return new Promise((i,a)=>{let o=Number(r),s=new Uint8Array(t,Number(r),n);Wp.default.write(this.handle,s,0,n,o,(u,c)=>u?a(u):i(c))})}};async function GWe(e,t,r,n,i){return await new Promise((a,o)=>Wp.default.read(e,t,r,n,i,(s,u)=>s?o(s):a(u)))}var RA=$t(require("fs/promises"),1);var XI=$t(require("fs"),1),JI=require("stream");var OA=$t(require("zlib"),1),zWe=e=>e&&e instanceof ArrayBuffer,HWe=e=>e&&e instanceof Buffer;function IA(e,t){switch(t==null?void 0:t.get("content-encoding")){case"br":return e.pipe(OA.default.createBrotliDecompress());case"gzip":return e.pipe(OA.default.createGunzip());case"deflate":return e.pipe(OA.default.createDeflate());default:return e}}async function Bae(e){let t=[];return await new Promise((r,n)=>{e.on("error",i=>n(i)),e.on("readable",()=>e.read()),e.on("data",i=>{typeof i=="string"&&n(new Error("Read stream not binary")),t.push(VWe(i))}),e.on("end",()=>{let i=WWe(t);r(i)})})}function WWe(e){let t=e.map(a=>a instanceof ArrayBuffer?new Uint8Array(a):a),r=t.reduce((a,o)=>a+o.byteLength,0),n=new Uint8Array(r),i=0;for(let a of t)n.set(a,i),i+=a.byteLength;return n.buffer}function VWe(e){if(zWe(e))return e;if(HWe(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var KWe=e=>typeof e=="boolean",Oae=e=>typeof e=="function",$We=e=>e!==null&&typeof e=="object",YWe=e=>$We(e)&&Oae(e.read)&&Oae(e.pipe)&&KWe(e.readable);async function PA(e,t){let r=/^file:\/\//;e.replace(r,"/");let n=e.split("?")[0];n=tc(n);let i=new Headers;e.endsWith(".gz")&&(i["content-encoding"]="gzip"),e.endsWith(".br")&&(i["content-encoding"]="br");try{let a=await new Promise((f,h)=>{let p=XI.default.createReadStream(n,{encoding:null});p.once("readable",()=>f(p)),p.on("error",d=>h(d))}),o=a;YWe(a)?o=IA(a,i):typeof a=="string"?o=JI.Readable.from([new TextEncoder().encode(a)]):o=JI.Readable.from([a||new ArrayBuffer(0)]);let s=200,u="OK",c=JWe(n),l=new Response(o,{headers:c,status:s,statusText:u});return Object.defineProperty(l,"url",{value:e}),l}catch(a){let o=a.message,s=400,u=o,c={},l=new Response(o,{headers:c,status:s,statusText:u});return Object.defineProperty(l,"url",{value:e}),l}}function JWe(e){let t={};if(!t["content-length"]){let r=XI.default.statSync(e);t["content-length"]=r.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip"),new Headers(t)}var jA=class{readable=!0;writable=!0;constructor(){}async readdir(t=".",r){return await RA.default.readdir(t,r)}async stat(t){let r=await RA.default.stat(t,{bigint:!0});return{size:Number(r.size),bigsize:r.size,isDirectory:r.isDirectory()}}async unlink(t){return await RA.default.unlink(t)}async fetch(t,r){return await PA(t,r)}async openReadableFile(t,r="r"){return new Vp(t,r)}async openWritableFile(t,r="w",n){return new Vp(t,r,n)}};var Kp=class{constructor(t={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(t,r="base64"){var o,s;let n=[];for await(let u of t)n.push(u),yield u;let i=await this.concatenate(n),a=await this.hash(i,r);(s=(o=this.options.crypto)==null?void 0:o.onEnd)==null||s.call(o,{hash:a})}async concatenate(t){return await zp(t)}};function Iae(e){e=`${e}`;for(let r=0;r<e.length;r++)if(e.charCodeAt(r)>255)return null;let t="";for(let r=0;r<e.length;r+=3){let n=[void 0,void 0,void 0,void 0];n[0]=e.charCodeAt(r)>>2,n[1]=(e.charCodeAt(r)&3)<<4,e.length>r+1&&(n[1]|=e.charCodeAt(r+1)>>4,n[2]=(e.charCodeAt(r+1)&15)<<2),e.length>r+2&&(n[2]|=e.charCodeAt(r+2)>>6,n[3]=e.charCodeAt(r+2)&63);for(let i=0;i<n.length;i++)typeof n[i]>"u"?t+="=":t+=XWe(n[i])}return t}function XWe(e){if(e<26)return String.fromCharCode(e+"A".charCodeAt(0));if(e<52)return String.fromCharCode(e-26+"a".charCodeAt(0));if(e<62)return String.fromCharCode(e-52+"0".charCodeAt(0));if(e===62)return"+";if(e===63)return"/"}function Pae(e,t){switch(t){case"hex":return e;case"base64":return QWe(e);default:throw new Error(t)}}function QWe(e){e.length%2!==0&&(e=`0${e}`);let r=(e.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return Iae(r)||""}var jae=typeof atob=="function"?atob:typeof Buffer=="function"?aVe:Mae,ZWe=jae("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALB7oCJQhvbmVGdWxsQQAYCG9uZUZ1bGxCABkIb25lRnVsbEMAGghvbmVGdWxsRAAbBWxvb3BzAAEEbG9vcAACBXByaW1lAAMFbG9vcEEABAZsb29wQTEABQZsb29wQTIABgZsb29wQTMABwZsb29wQTQACAVsb29wQgAJBmxvb3BCMQAKBmxvb3BCMgALBmxvb3BCMwAMBmxvb3BCNAANBWxvb3BDAA4GbG9vcEMxAA8GbG9vcEMyABAGbG9vcEMzABEGbG9vcEM0ABIFbG9vcEQAEwZsb29wRDEAFAZsb29wRDIAFQZsb29wRDMAFgZsb29wRDQAFwRnZXRBACgEZ2V0QgApBGdldEMAKgRnZXREACsEZ2V0WAAsBHNldEEALQRzZXRCAC4Ec2V0QwAvBHNldEQAMARzZXRYADEKzA0xWwEBf0EAJAggAEEGdCEBAkADQCMIIAFGDQEjACQEIwEkBSMCJAYjAyQHEAIjBCMAaiQAIwUjAWokASMGIwJqJAIjByMDaiQDIwhBwABqJAgMAAsLIwgjGmokGgsTACMIIxpqJAkQAxAEEAkQDhATC6IBAEEAIwlqKAIAJApBBCMJaigCACQLQQgjCWooAgAkDEEMIwlqKAIAJA1BECMJaigCACQOQRQjCWooAgAkD0EYIwlqKAIAJBBBHCMJaigCACQRQSAjCWooAgAkEkEkIwlqKAIAJBNBKCMJaigCACQUQSwjCWooAgAkFUEwIwlqKAIAJBZBNCMJaigCACQXQTgjCWooAgAkGEE8IwlqKAIAJBkLCgAQBRAGEAcQCAsuAEH4yKq7fSMKahAYQdbunsZ+IwtqEBtB2+GBoQIjDGoQGkHunfeNfCMNahAZCy0AQa+f8Kt/Iw5qEBhBqoyfvAQjD2oQG0GTjMHBeiMQahAaQYGqmmojEWoQGQssAEHYsYLMBiMSahAYQa/vk9p4IxNqEBtBsbd9IxRqEBpBvq/zyngjFWoQGQstAEGiosDcBiMWahAYQZPj4WwjF2oQG0GOh+WzeiMYahAaQaGQ0M0EIxlqEBkLCgAQChALEAwQDQsuAEHiyviwfyMLahAcQcDmgoJ8IxBqEB9B0bT5sgIjFWoQHkGqj9vNfiMKahAdCy0AQd2gvLF9Iw9qEBxB06iQEiMUahAfQYHNh8V9IxlqEB5ByPfPvn4jDmoQHQsuAEHmm4ePAiMTahAcQdaP3Jl8IxhqEB9Bh5vUpn8jDWoQHkHtqeiqBCMSahAdCy0AQYXSj896IxdqEBxB+Me+ZyMMahAfQdmFvLsGIxFqEB5Bipmp6XgjFmoQHQsKABAPEBAQERASCysAQcLyaCMPahAgQYHtx7t4IxJqECNBosL17AYjFWoQIkGM8JRvIxhqECELLgBBxNT7pXojC2oQIEGpn/veBCMOahAjQeCW7bV/IxFqECJB8Pj+9XsjFGoQIQstAEHG/e3EAiMXahAgQfrPhNV+IwpqECNBheG8p30jDWoQIkGFuqAkIxBqECELLgBBuaDTzn0jE2oQIEHls+62fiMWahAjQfj5if0BIxlqECJB5ayxpXwjDGoQIQsKABAUEBUQFhAXCy0AQcTEpKF/IwpqECRBl/+rmQQjEWoQJ0Gnx9DceiMYahAmQbnAzmQjD2oQJQstAEHDs+2qBiMWahAkQZKZs/h4Iw1qECdB/ei/fyMUahAmQdG7kax4IwtqECULLQBBz/yh/QYjEmoQJEHgzbNxIxlqECdBlIaFmHojEGoQJkGho6DwBCMXahAlCy4AQYL9zbp/Iw5qECRBteTr6XsjFWoQJ0G7pd/WAiMMahAmQZGnm9x+IxNqECULKAEBf0F/IwFzIwNxIwEjAnFyIwBqIABqIgFBB3QgAUEZdnIjAWokAAsoAQF/QX8jAnMjAHEjAiMDcXIjAWogAGoiAUEWdCABQQp2ciMCaiQBCygBAX9BfyMDcyMBcSMDIwBxciMCaiAAaiIBQRF0IAFBD3ZyIwNqJAILKAEBf0F/IwBzIwJxIwAjAXFyIwNqIABqIgFBDHQgAUEUdnIjAGokAwsoAQF/IwJBfyMDc3EjASMDcXIjAGogAGoiAUEFdCABQRt2ciMBaiQACygBAX8jA0F/IwBzcSMCIwBxciMBaiAAaiIBQRR0IAFBDHZyIwJqJAELKAEBfyMAQX8jAXNxIwMjAXFyIwJqIABqIgFBDnQgAUESdnIjA2okAgsoAQF/IwFBfyMCc3EjACMCcXIjA2ogAGoiAUEJdCABQRd2ciMAaiQDCyIBAX8jASMCcyMDcyMAaiAAaiIBQQR0IAFBHHZyIwFqJAALIgEBfyMCIwNzIwBzIwFqIABqIgFBF3QgAUEJdnIjAmokAQsiAQF/IwMjAHMjAXMjAmogAGoiAUEQdCABQRB2ciMDaiQCCyIBAX8jACMBcyMCcyMDaiAAaiIBQQt0IAFBFXZyIwBqJAMLJQEBf0F/IwNzIwFyIwJzIwBqIABqIgFBBnQgAUEadnIjAWokAAslAQF/QX8jAHMjAnIjA3MjAWogAGoiAUEVdCABQQt2ciMCaiQBCyUBAX9BfyMBcyMDciMAcyMCaiAAaiIBQQ90IAFBEXZyIwNqJAILJQEBf0F/IwJzIwByIwFzIwNqIABqIgFBCnQgAUEWdnIjAGokAwsEACMACwQAIwELBAAjAgsEACMDCwQAIxoLBgAgACQACwYAIAAkAQsGACAAJAILBgAgACQDCwYAIAAkGgsA6gQEbmFtZQGSAzIAA2xvZwEFbG9vcHMCBGxvb3ADBXByaW1lBAVsb29wQQUGbG9vcEExBgZsb29wQTIHBmxvb3BBMwgGbG9vcEE0CQVsb29wQgoGbG9vcEIxCwZsb29wQjIMBmxvb3BCMw0GbG9vcEI0DgVsb29wQw8GbG9vcEMxEAZsb29wQzIRBmxvb3BDMxIGbG9vcEM0EwVsb29wRBQGbG9vcEQxFQZsb29wRDIWBmxvb3BEMxcGbG9vcEQ0GAhvbmVGdWxsQRkIb25lRnVsbEIaCG9uZUZ1bGxDGwhvbmVGdWxsRBwIdHdvRnVsbEEdCHR3b0Z1bGxCHgh0d29GdWxsQx8IdHdvRnVsbEQgCHRyZUZ1bGxBIQh0cmVGdWxsQiIIdHJlRnVsbEMjCHRyZUZ1bGxEJAhxdWFGdWxsQSUIcXVhRnVsbEImCHF1YUZ1bGxDJwhxdWFGdWxsRCgEZ2V0QSkEZ2V0QioEZ2V0QysEZ2V0RCwEZ2V0WC0Ec2V0QS4Ec2V0Qi8Ec2V0QzAEc2V0RDEEc2V0WALNATIAAQAAAQIAAAEIbnVtbG9vcHMCAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),QI=WebAssembly&&jae!==Mae?iVe(ZWe).buffer:!1,rc=oVe(),ZI=240*16*16,Lae=Math.floor(ZI*16*1.066666667),eVe=268435456-65536,Rae="Parameter must be Buffer, ArrayBuffer or Uint8Array",tVe="Parameter exceeds max size of 255.9 Mbytes";QI||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function eP(e){var t,r,n,i,a,o,s,u,c,l;let f=nVe(),h=rVe(),p={},d=new Date().getTime();return p.then=function(E){return s=E,g(),p},p.catch=function(E){return u=E,p},e&&typeof e=="object"?typeof Buffer=="function"&&e.constructor===Buffer?o=e:e.constructor===Uint8Array||e.constructor===ArrayBuffer?o=e.constructor===ArrayBuffer?new Uint8Array(e):e:x(new TypeError(Rae)):x(new TypeError(Rae)),o&&(a=o.length,QI&&a>Lae?a>eVe?x(new Error(tVe)):(t=new WebAssembly.Memory({initial:a>32e6?a>64e6?a>128e6?4096:2048:1024:512}),r=new Uint32Array(t.buffer),i={mem:t,log:console.log},n={imports:i},WebAssembly.instantiate(QI,n).then(b)):g(f(o))),p;function b(E){g(h(o,E.instance.exports,r))}function g(E){var S=Boolean(E)?E:c;Boolean(E)&&(l=new Date().getTime()),typeof s=="function"?Boolean(S)&&(s(S,l-d),s=u=null):Boolean(E)&&(c=E)}function x(E){typeof u=="function"&&u(E)}}function rVe(){var e,t,r,n,i,a,o,s,u,c,l,f,h,p=function(d){var b,g,x,E,S,F,D,j,k,N,C,I,P,U,Y,J,re,ee,ge,ye,pe,Te,$e=new Date().getTime(),We=0,oe=1732584193,V=-271733879,ne=-1732584194,se=271733878,Ge=0,at=d.length*8,ft;for(ft=Ie(d,h),h[at>>>5]|=128<<at%32,h[(at+64>>>9<<4)+14]=at,ft=(at+64>>>9<<4)+15,pe=h;Ge<ft;)ft>Ge+Lae?(n(oe),a(V),s(ne),c(se),t(ZI),Ge=Ge+ZI*16,oe=r(),V=i(),ne=o(),se=u(),We++):(re=oe,ee=V,ge=ne,ye=se,b=pe[Ge+0]>>>0,g=pe[Ge+1]>>>0,x=pe[Ge+2]>>>0,E=pe[Ge+3]>>>0,S=pe[Ge+4]>>>0,F=pe[Ge+5]>>>0,D=pe[Ge+6]>>>0,j=pe[Ge+7]>>>0,k=pe[Ge+8]>>>0,N=pe[Ge+9]>>>0,C=pe[Ge+10]>>>0,I=pe[Ge+11]>>>0,P=pe[Ge+12]>>>0,U=pe[Ge+13]>>>0,Y=pe[Ge+14]>>>0,J=pe[Ge+15]>>>0,oe=me(7,25,oe+(V&ne|~V&se)+b-680876936)+V,se=me(12,20,se+(oe&V|~oe&ne)+g-389564586)+oe,ne=me(17,15,ne+(se&oe|~se&V)+x+606105819)+se,V=me(22,10,V+(ne&se|~ne&oe)+E-1044525330)+ne,oe=me(7,25,oe+(V&ne|~V&se)+S-176418897)+V,se=me(12,20,se+(oe&V|~oe&ne)+F+1200080426)+oe,ne=me(17,15,ne+(se&oe|~se&V)+D-1473231341)+se,V=me(22,10,V+(ne&se|~ne&oe)+j-45705983)+ne,oe=me(7,25,oe+(V&ne|~V&se)+k+1770035416)+V,se=me(12,20,se+(oe&V|~oe&ne)+N-1958414417)+oe,ne=me(17,15,ne+(se&oe|~se&V)+C-42063)+se,V=me(22,10,V+(ne&se|~ne&oe)+I-1990404162)+ne,oe=me(7,25,oe+(V&ne|~V&se)+P+1804603682)+V,se=me(12,20,se+(oe&V|~oe&ne)+U-40341101)+oe,ne=me(17,15,ne+(se&oe|~se&V)+Y-1502002290)+se,V=me(22,10,V+(ne&se|~ne&oe)+J+1236535329)+ne,oe=me(5,27,oe+(V&se|ne&~se)+g-165796510)+V,se=me(9,23,se+(oe&ne|V&~ne)+D-1069501632)+oe,ne=me(14,18,ne+(se&V|oe&~V)+I+643717713)+se,V=me(20,12,V+(ne&oe|se&~oe)+b-373897302)+ne,oe=me(5,27,oe+(V&se|ne&~se)+F-701558691)+V,se=me(9,23,se+(oe&ne|V&~ne)+C+38016083)+oe,ne=me(14,18,ne+(se&V|oe&~V)+J-660478335)+se,V=me(20,12,V+(ne&oe|se&~oe)+S-405537848)+ne,oe=me(5,27,oe+(V&se|ne&~se)+N+568446438)+V,se=me(9,23,se+(oe&ne|V&~ne)+Y-1019803690)+oe,ne=me(14,18,ne+(se&V|oe&~V)+E-187363961)+se,V=me(20,12,V+(ne&oe|se&~oe)+k+1163531501)+ne,oe=me(5,27,oe+(V&se|ne&~se)+U-1444681467)+V,se=me(9,23,se+(oe&ne|V&~ne)+x-51403784)+oe,ne=me(14,18,ne+(se&V|oe&~V)+j+1735328473)+se,V=me(20,12,V+(ne&oe|se&~oe)+P-1926607734)+ne,oe=me(4,28,oe+(V^ne^se)+F-378558)+V,se=me(11,21,se+(oe^V^ne)+k-2022574463)+oe,ne=me(16,16,ne+(se^oe^V)+I+1839030562)+se,V=me(23,9,V+(ne^se^oe)+Y-35309556)+ne,oe=me(4,28,oe+(V^ne^se)+g-1530992060)+V,se=me(11,21,se+(oe^V^ne)+S+1272893353)+oe,ne=me(16,16,ne+(se^oe^V)+j-155497632)+se,V=me(23,9,V+(ne^se^oe)+C-1094730640)+ne,oe=me(4,28,oe+(V^ne^se)+U+681279174)+V,se=me(11,21,se+(oe^V^ne)+b-358537222)+oe,ne=me(16,16,ne+(se^oe^V)+E-722521979)+se,V=me(23,9,V+(ne^se^oe)+D+76029189)+ne,oe=me(4,28,oe+(V^ne^se)+N-640364487)+V,se=me(11,21,se+(oe^V^ne)+P-421815835)+oe,ne=me(16,16,ne+(se^oe^V)+J+530742520)+se,V=me(23,9,V+(ne^se^oe)+x-995338651)+ne,oe=me(6,26,oe+(ne^(V|~se))+b-198630844)+V,se=me(10,22,se+(V^(oe|~ne))+j+1126891415)+oe,ne=me(15,17,ne+(oe^(se|~V))+Y-1416354905)+se,V=me(21,11,V+(se^(ne|~oe))+F-57434055)+ne,oe=me(6,26,oe+(ne^(V|~se))+P+1700485571)+V,se=me(10,22,se+(V^(oe|~ne))+E-1894986606)+oe,ne=me(15,17,ne+(oe^(se|~V))+C-1051523)+se,V=me(21,11,V+(se^(ne|~oe))+g-2054922799)+ne,oe=me(6,26,oe+(ne^(V|~se))+k+1873313359)+V,se=me(10,22,se+(V^(oe|~ne))+J-30611744)+oe,ne=me(15,17,ne+(oe^(se|~V))+D-1560198380)+se,V=me(21,11,V+(se^(ne|~oe))+U+1309151649)+ne,oe=me(6,26,oe+(ne^(V|~se))+S-145523070)+V,se=me(10,22,se+(V^(oe|~ne))+I-1120210379)+oe,ne=me(15,17,ne+(oe^(se|~V))+x+718787259)+se,V=me(21,11,V+(se^(ne|~oe))+N-343485551)+ne,Ge=Ge+16,oe=oe+re>>>0,V=V+ee>>>0,ne=ne+ge>>>0,se=se+ye>>>0);return rc.endian([oe,V,ne,se]);function me(Oe,gt,Ue){return Ue<<Oe|Ue>>>gt}function Ie(Oe,gt){for(var Ue=-1,_t=Math.floor((Oe.length-1)/4),Mt=0,Sr,he,Xe,ct;_t-8>Ue++;)Mt=Ue<<2,gt[Ue]=Oe[Mt+0]|Oe[Mt+1]<<8|Oe[Mt+2]<<16|Oe[Mt+3]<<24;for(Ue--;_t>Ue++;)Mt=Ue<<2,Sr=typeof Oe[Mt+0]>"u"?0:Oe[Mt+0],he=typeof Oe[Mt+1]>"u"?0:Oe[Mt+1],Xe=typeof Oe[Mt+2]>"u"?0:Oe[Mt+2],ct=typeof Oe[Mt+3]>"u"?0:Oe[Mt+3],gt[Ue]=Sr|he<<8|Xe<<16|ct<<24;return _t+1}};return function(d,b,g,x){var E;return t=b.loops,e=b.loop,r=b.getA,i=b.getB,o=b.getC,u=b.getD,l=b.getX,n=b.setA,a=b.setB,s=b.setC,c=b.setD,f=b.setX,h=g,E=rc.wordsToBytes(p(d)),x&&x.asBytes?E:rc.bytesconvertNumberToHex(E)}}function nVe(){var e=function(t,r){var n,i,a,o,s,u,c,l,f,h,p,d,b,g,x,E,S,F,D,j,k,N=new Date().getTime(),C=1732584193,I=-271733879,P=-1732584194,U=271733878,Y=t.length*8;k=rc.bytesToWords(t);for(var J=0;J<k.length;J++)k[J]=(k[J]<<8|k[J]>>>24)&16711935|(k[J]<<24|k[J]>>>8)&4278255360;k[Y>>>5]|=128<<Y%32,k[(Y+64>>>9<<4)+14]=Y;for(var re=0;re<k.length;re+=16)S=C,F=I,D=P,j=U,n=k[re+0]>>>0,i=k[re+1]>>>0,a=k[re+2]>>>0,o=k[re+3]>>>0,s=k[re+4]>>>0,u=k[re+5]>>>0,c=k[re+6]>>>0,l=k[re+7]>>>0,f=k[re+8]>>>0,h=k[re+9]>>>0,p=k[re+10]>>>0,d=k[re+11]>>>0,b=k[re+12]>>>0,g=k[re+13]>>>0,x=k[re+14]>>>0,E=k[re+15]>>>0,C=ee(7,25,C+(I&P|~I&U)+n-680876936)+I,U=ee(12,20,U+(C&I|~C&P)+i-389564586)+C,P=ee(17,15,P+(U&C|~U&I)+a+606105819)+U,I=ee(22,10,I+(P&U|~P&C)+o-1044525330)+P,C=ee(7,25,C+(I&P|~I&U)+s-176418897)+I,U=ee(12,20,U+(C&I|~C&P)+u+1200080426)+C,P=ee(17,15,P+(U&C|~U&I)+c-1473231341)+U,I=ee(22,10,I+(P&U|~P&C)+l-45705983)+P,C=ee(7,25,C+(I&P|~I&U)+f+1770035416)+I,U=ee(12,20,U+(C&I|~C&P)+h-1958414417)+C,P=ee(17,15,P+(U&C|~U&I)+p-42063)+U,I=ee(22,10,I+(P&U|~P&C)+d-1990404162)+P,C=ee(7,25,C+(I&P|~I&U)+b+1804603682)+I,U=ee(12,20,U+(C&I|~C&P)+g-40341101)+C,P=ee(17,15,P+(U&C|~U&I)+x-1502002290)+U,I=ee(22,10,I+(P&U|~P&C)+E+1236535329)+P,C=ee(5,27,C+(I&U|P&~U)+i-165796510)+I,U=ee(9,23,U+(C&P|I&~P)+c-1069501632)+C,P=ee(14,18,P+(U&I|C&~I)+d+643717713)+U,I=ee(20,12,I+(P&C|U&~C)+n-373897302)+P,C=ee(5,27,C+(I&U|P&~U)+u-701558691)+I,U=ee(9,23,U+(C&P|I&~P)+p+38016083)+C,P=ee(14,18,P+(U&I|C&~I)+E-660478335)+U,I=ee(20,12,I+(P&C|U&~C)+s-405537848)+P,C=ee(5,27,C+(I&U|P&~U)+h+568446438)+I,U=ee(9,23,U+(C&P|I&~P)+x-1019803690)+C,P=ee(14,18,P+(U&I|C&~I)+o-187363961)+U,I=ee(20,12,I+(P&C|U&~C)+f+1163531501)+P,C=ee(5,27,C+(I&U|P&~U)+g-1444681467)+I,U=ee(9,23,U+(C&P|I&~P)+a-51403784)+C,P=ee(14,18,P+(U&I|C&~I)+l+1735328473)+U,I=ee(20,12,I+(P&C|U&~C)+b-1926607734)+P,C=ee(4,28,C+(I^P^U)+u-378558)+I,U=ee(11,21,U+(C^I^P)+f-2022574463)+C,P=ee(16,16,P+(U^C^I)+d+1839030562)+U,I=ee(23,9,I+(P^U^C)+x-35309556)+P,C=ee(4,28,C+(I^P^U)+i-1530992060)+I,U=ee(11,21,U+(C^I^P)+s+1272893353)+C,P=ee(16,16,P+(U^C^I)+l-155497632)+U,I=ee(23,9,I+(P^U^C)+p-1094730640)+P,C=ee(4,28,C+(I^P^U)+g+681279174)+I,U=ee(11,21,U+(C^I^P)+n-358537222)+C,P=ee(16,16,P+(U^C^I)+o-722521979)+U,I=ee(23,9,I+(P^U^C)+c+76029189)+P,C=ee(4,28,C+(I^P^U)+h-640364487)+I,U=ee(11,21,U+(C^I^P)+b-421815835)+C,P=ee(16,16,P+(U^C^I)+E+530742520)+U,I=ee(23,9,I+(P^U^C)+a-995338651)+P,C=ee(6,26,C+(P^(I|~U))+n-198630844)+I,U=ee(10,22,U+(I^(C|~P))+l+1126891415)+C,P=ee(15,17,P+(C^(U|~I))+x-1416354905)+U,I=ee(21,11,I+(U^(P|~C))+u-57434055)+P,C=ee(6,26,C+(P^(I|~U))+b+1700485571)+I,U=ee(10,22,U+(I^(C|~P))+o-1894986606)+C,P=ee(15,17,P+(C^(U|~I))+p-1051523)+U,I=ee(21,11,I+(U^(P|~C))+i-2054922799)+P,C=ee(6,26,C+(P^(I|~U))+f+1873313359)+I,U=ee(10,22,U+(I^(C|~P))+E-30611744)+C,P=ee(15,17,P+(C^(U|~I))+c-1560198380)+U,I=ee(21,11,I+(U^(P|~C))+g+1309151649)+P,C=ee(6,26,C+(P^(I|~U))+s-145523070)+I,U=ee(10,22,U+(I^(C|~P))+d-1120210379)+C,P=ee(15,17,P+(C^(U|~I))+a+718787259)+U,I=ee(21,11,I+(U^(P|~C))+h-343485551)+P,C=C+S>>>0,I=I+F>>>0,P=P+D>>>0,U=U+j>>>0;return rc.endian([C,I,P,U]);function ee(ge,ye,pe){return pe<<ge|pe>>>ye}};return function(t,r){var n=rc.wordsToBytes(e(t,r)),i=r&&r.asBytes?n:rc.bytesconvertNumberToHex(n);return i}}function iVe(e){var t,r,n,i=-1;for(t=e.length-1,r=new ArrayBuffer(e.length),n=new Uint8Array(r);t>i++;)n[i]=e.charCodeAt(i);return n}function aVe(e){return Buffer.from(e,"base64").toString("binary")}function Mae(e){return e}function oVe(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(t,r){return t<<r|t>>>32-r},endian:function(t){if(t.constructor==Number)return rc.rotl(t,8)&16711935|rc.rotl(t,24)&4278255360;for(var r=0;r<t.length;r++)t[r]=rc.endian(t[r]);return t},bytesToWords:function(t){for(var r=[],n=0,i=0;n<t.length;n++,i+=8)r[i>>>5]|=t[n]<<24-i%32;return r},wordsToBytes:function(t){for(var r=[],n=0;n<t.length*32;n+=8)r.push(t[n>>>5]>>>24-n%32&255);return r},bytesconvertNumberToHex:function(t){for(var r=[],n=0;n<t.length;n++)r.push((t[n]>>>4).toString(16)),r.push((t[n]&15).toString(16));return r.join("")}}}var kx=class extends Kp{name="md5";options;constructor(t={}){super(),this.options=t}async hash(t,r){let i=await new Promise((a,o)=>eP(t).then(a).catch(o));return Pae(i,r)}};var Bx=$t(require("crypto"),1),LA=class extends Kp{name="crypto-node";options;_algorithm;_hash;constructor(t){var r,n;if(super(),this.options=t,!((n=(r=this.options)==null?void 0:r.crypto)!=null&&n.algorithm))throw new Error(this.name)}async hash(t,r){var i,a,o,s;let n=(o=(a=(i=this.options)==null?void 0:i.crypto)==null?void 0:a.algorithm)==null?void 0:o.toLowerCase();try{if(!Bx.createHash)throw new Error("crypto.createHash not available");let u=(s=Bx.createHash)==null?void 0:s(n),c=new Uint8Array(t);return u.update(c).digest("base64")}catch(u){throw Error(`${n} hash not available. ${u}`)}}async*hashBatches(t,r="base64"){var a,o,s,u,c,l,f;if(!Bx.createHash)throw new Error("crypto.createHash not available");let n=(u=Bx.createHash)==null?void 0:u((s=(o=(a=this.options)==null?void 0:a.crypto)==null?void 0:o.algorithm)==null?void 0:s.toLowerCase());for await(let h of t){let p=new Uint8Array(h);n.update(p),yield h}let i=n.digest(r);(f=(l=(c=this.options)==null?void 0:c.crypto)==null?void 0:l.onEnd)==null||f.call(l,{hash:i})}};var Zae=require("process");var qae=$t(require("stream"),1),tP=class{},sVe=qae.Readable||tP;function nP(e,t){let r=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new rP(r,t)}var rP=class extends sVe{_pulling;_bytesMode;_iterator;constructor(t,r){super(r),this._iterator=t,this._pulling=!1,this._bytesMode=!r||!r.objectMode}async _read(t){this._pulling||(this._pulling=!0,this._pulling=await this._pull(t,this._iterator))}async _destroy(t,r){var n,i,a,o;this._iterator&&(t?await((i=(n=this._iterator)==null?void 0:n.throw)==null?void 0:i.call(n,t)):await((o=(a=this._iterator)==null?void 0:a.return)==null?void 0:o.call(a,t)),r==null||r(null))}async _pull(t,r){var a;let n=this._bytesMode,i=null;for(;this.readable&&!(i=await r.next()).done&&(t!==null&&(t-=n&&ArrayBuffer.isView(i.value)?i.value.byteLength:1),!(!this.push(new Uint8Array(i.value))||t<=0)););return(i!=null&&i.done||!this.readable)&&(this.push(null)||!0)&&((a=r==null?void 0:r.return)==null||a.call(r)),!this.readable}};var Gae=$t(Uae(),1);delete globalThis.ReadableStream;var qA=class extends Gae.ReadableStream{};var NA=class{chunks;isWorking=!1;isCancelled=!1;constructor(t){this.chunks=t}start(t){this.work(t)}async work(t){let{chunks:r}=this;for(this.isWorking=!0;!this.isCancelled&&(t.desiredSize||0)>0;){let n;try{n=r.next()}catch(i){t.error(i);break}n&&(!n.done&&!this.isCancelled?t.enqueue(n.value):t.close())}this.isWorking=!1}pull(t){this.isWorking||this.work(t)}cancel(){this.isCancelled=!0}};var UA=class extends qA{_chunks;constructor(t){super(new NA(t.values()),{type:"bytes"}),this._chunks=t}async*[Symbol.asyncIterator](t){let r=this.getReader();yield*this._chunks,r.releaseLock()}};var $p=class{type;size;parts;constructor(t=[],r={}){this.parts=[],this.size=0;for(let n of t)if(typeof n=="string"){let i=new TextEncoder().encode(n);this.parts.push(i),this.size+=i.byteLength}else if(n instanceof $p)this.size+=n.size,this.parts.push(...n.parts);else if(n instanceof ArrayBuffer)this.parts.push(new Uint8Array(n)),this.size+=n.byteLength;else if(n instanceof Uint8Array)this.parts.push(n),this.size+=n.byteLength;else if(ArrayBuffer.isView(n)){let{buffer:i,byteOffset:a,byteLength:o}=n;this.parts.push(new Uint8Array(i,a,o)),this.size+=o}else{let i=new TextEncoder().encode(String(n));this.parts.push(i),this.size+=i.byteLength}this.type=uVe(r.type)}slice(t=0,r=this.size,n=""){let{size:i,parts:a}=this,o=t<0?Math.max(i+t,0):Math.min(t,i),s=r<0?Math.max(i+r,0):Math.min(r,i),u=Math.max(s-o,0),c=new $p([],{type:n});if(u===0)return c;let l=0,f=[];for(let h of a){let{byteLength:p}=h;if(o>0&&p<=o)o-=p,s-=p;else{let d=h.subarray(o,Math.min(p,s));if(f.push(d),l+=d.byteLength,o=0,l>=u)break}}return c.parts=f,c.size=l,c}async arrayBuffer(){return this._toArrayBuffer()}async text(){let t=new TextDecoder,r="";for(let n of this.parts)r+=t.decode(n);return r}stream(){return new UA(this.parts)}toString(){return"[object Blob]"}get[Symbol.toStringTag](){return"Blob"}_toArrayBuffer(){let t=new ArrayBuffer(this.size),r=new Uint8Array(t),n=0;for(let i of this.parts)r.set(i,n),n+=i.byteLength;return t}};function uVe(e=""){let t=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(t)?"":t}function cVe(){return typeof Blob>"u"&&!globalThis.Blob&&(globalThis.Blob=$p),globalThis.Blob}var lVe=cVe();var GA=class{onload;onabort;onerror;error;onloadstart;onloadend;onprogress;readyState;result;DONE;EMPTY;LOADING;addEventListener;removeEventListener;dispatchEvent;constructor(){this.onload=null}abort(){}async readAsArrayBuffer(t){let r=await t.arrayBuffer();this.onload&&this.onload({target:{result:r}})}async readAsBinaryString(t){throw Error("Not implemented")}async readAsDataURL(t){let r=await t.text(),n=`data://;base64,${by(r)}`;this.onload&&this.onload({target:{result:n}})}async readAsText(t){let r=await t.text();this.onload&&this.onload({target:{result:r}})}};var zA=class extends globalThis.Blob{name="";webkitRelativePath="";lastModified;constructor(t,r,n={}){super(t,n),this.name=String(r).replace(/\//g,":"),this.lastModified=(n==null?void 0:n.lastModified)||Date.now()}get[Symbol.toStringTag](){return"File"}};function zae(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=GA),typeof File>"u"&&!globalThis.File&&(globalThis.File=zA),global}var fVe=zae();var iP=$t(require("module"),1),Hae=$t(require("path"),1),WA=$t(require("fs"),1);async function Wae(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():WA.default.readFileSync(e).buffer}async function Vae(e){return e.startsWith("http")?await(await fetch(e)).text():WA.default.readFileSync(e,"utf8")}async function Kae(e){if(e.startsWith("http")){let n=await(await fetch(e)).text();return HA(n)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let t=await WA.default.readFileSync(e,"utf8");return HA(t)}function HA(e,t="",r){if(typeof t=="object"&&(r=t,t=""),t=t.replace("file://",""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let n=iP.default._nodeModulePaths(Hae.default.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),a=new iP.default(t,i);return a.filename=t,a.paths=[].concat((r==null?void 0:r.prependPaths)||[]).concat(n).concat((r==null?void 0:r.appendPaths)||[]),a._compile(e,t),i&&i.children&&i.children.splice(i.children.indexOf(a),1),a.exports}var tu=class{map;constructor(t){this.map={},t instanceof tu?t.forEach((r,n)=>this.append(n,r)):Array.isArray(t)?t.forEach(r=>this.append(r[0],r[1])):t&&Object.getOwnPropertyNames(t).forEach(r=>this.append(r,t[r]))}append(t,r){t=Ox(t),r=$ae(r);let n=this.map[t];this.map[t]=n?`${n}, ${r}`:r}delete(t){delete this.map[Ox(t)]}get(t){return t=Ox(t),this.has(t)?this.map[t]:null}has(t){return this.map.hasOwnProperty(Ox(t))}set(t,r){this.map[Ox(t)]=$ae(r)}forEach(t,r=null){for(let n in this.map)this.map.hasOwnProperty(n)&&(r?t.call(r,this.map[n],n,this):t(this.map[n],n,this))}keys(){let t=[];return this.forEach(function(r,n){t.push(n)}),aP(t)}values(){let t=[];return this.forEach(function(r){t.push(r)}),aP(t)}entries(){let t=[];return this.forEach(function(r,n){t.push([n,r])}),aP(t)}*[Symbol.iterator](){yield*this.entries()}};function Ox(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 $ae(e){return typeof e!="string"&&(e=String(e)),e}function aP(e){let t={next(){let r=e.shift();return{done:r===void 0,value:r}}};return t[Symbol.iterator]=function(){return t},t}function oP(e,t){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${t}`)}var uP=$t(require("stream"),1),hVe=e=>typeof e=="boolean",Yae=e=>typeof e=="function",pVe=e=>e!==null&&typeof e=="object",sP=e=>pVe(e)&&Yae(e.read)&&Yae(e.pipe)&&hVe(e.readable),hl=class{ok;status;statusText;headers;url;bodyUsed=!1;_body;constructor(t,r){let{headers:n,status:i=200,statusText:a="OK",url:o}=r||{};this.url=o,this.ok=i===200,this.status=i,this.statusText=a,this.headers=new tu((r==null?void 0:r.headers)||{}),sP(t)?this._body=IA(t,n):typeof t=="string"?this._body=uP.Readable.from([new TextEncoder().encode(t)]):this._body=uP.Readable.from([t||new ArrayBuffer(0)])}get body(){return oP(!this.bodyUsed),oP(sP(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return sP(this._body)?await Bae(this._body):this._body||new ArrayBuffer(0)}async text(){let t=await this.arrayBuffer();return new TextDecoder().decode(t)}async json(){let t=await this.text();return JSON.parse(t)}async blob(){if(typeof Blob>"u")throw new Error("Blob polyfill not installed");return new Blob([await this.arrayBuffer()])}};var Xae=$t(require("http"),1),Qae=$t(require("https"),1);var dVe=e=>e&&e instanceof ArrayBuffer,mVe=e=>e&&e instanceof Buffer;function Jae(e){let t=e.indexOf(","),r,n;return e.slice(t-7,t)===";base64"?(r=Buffer.from(e.slice(t+1),"base64"),n=e.slice(5,t-7).trim()):(r=Buffer.from(decodeURIComponent(e.slice(t+1))),n=e.slice(5,t).trim()),n?n.startsWith(";")&&(n=`text/plain${n}`):n="text/plain;charset=US-ASCII",{arrayBuffer:gVe(r),mimeType:n}}function gVe(e){if(dVe(e))return e;if(mVe(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var cP=e=>e.startsWith("data:"),vVe=e=>e.startsWith("http:")||e.startsWith("https:");async function Ix(e,t){try{if(globalThis.fetch!==Ix&&(vVe(e)||cP(e)))return await fetch(e,t);if(cP(e)){let{arrayBuffer:c,mimeType:l}=Jae(e);return new hl(c,{headers:{"content-type":l},url:e})}let r={},n=e;e.endsWith(".gz")&&(e=e.slice(0,-3),r["content-encoding"]="gzip");let i=await bVe(n,t),a=wVe(e,i,r),{status:o,statusText:s}=_Ve(i),u=!t||t.followRedirect||t.followRedirect===void 0;if(o>=300&&o<400&&a.has("location")&&u){let c=yVe(e,a.get("location"));return await Ix(c,t)}return new hl(i,{headers:a,status:o,statusText:s,url:e})}catch(r){return new hl(null,{status:400,statusText:String(r),url:e})}}async function bVe(e,t){return await new Promise((r,n)=>{let i=xVe(e,t),a=e.startsWith("https:")?Qae.default.request(i,o=>r(o)):Xae.default.request(i,o=>r(o));a.on("error",o=>n(o)),a.end()})}function yVe(e,t){if(t.startsWith("http"))return t;let r=new URL(e);return r.pathname=t,r.href}function xVe(e,t){let r=(t==null?void 0:t.headers)||{},n={};for(let a of Object.keys(r))n[a.toLowerCase()]=r[a];n["accept-encoding"]=n["accept-encoding"]||"gzip,br,deflate";let i=new URL(e);return{hostname:i.hostname,path:i.pathname,method:"GET",...t,...t==null?void 0:t.fetch,headers:n,port:i.port}}function _Ve(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function wVe(e,t,r={}){let n={};if(t&&t.headers){let i=t.headers;for(let a in i){let o=i[a];n[a.toLowerCase()]=String(o)}}if(!n["content-length"]){let i=EVe(e);Number.isFinite(i)&&(n["content-length"]=i)}return Object.assign(n,r),new tu(n)}function EVe(e){return cP(e)?e.length-5:null}var AVe=parseInt(Zae.versions.node.split(".")[0]);_V&&console.error("loaders.gl: The @loaders.gl/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=nP;globalThis.loaders.NodeFile=Vp;globalThis.loaders.NodeFileSystem=jA;globalThis.loaders.fetchNode=PA;globalThis.loaders.NodeHash=LA;globalThis.TextEncoder||(globalThis.TextEncoder=vy);globalThis.TextDecoder||(globalThis.TextDecoder=_p);!("atob"in globalThis)&&by&&(globalThis.atob=by);!("btoa"in globalThis)&&Ek&&(globalThis.btoa=Ek);globalThis.loaders.encodeImageNode=AY;globalThis.loaders.parseImageNode=CI;globalThis.loaders.imageFormatsNode=TI;globalThis._parseImageNode=CI;globalThis._imageFormatsNode=TI;globalThis.loaders.readFileAsArrayBuffer=Wae;globalThis.loaders.readFileAsText=Vae;globalThis.loaders.requireFromFile=Kae;globalThis.loaders.requireFromString=HA;AVe<18&&(!("Headers"in globalThis)&&tu&&(globalThis.Headers=tu),!("Response"in globalThis)&&hl&&(globalThis.Response=hl),!("fetch"in globalThis)&&Ix&&(globalThis.fetch=Ix));var NBe=require("path"),UBe=$t(Hye(),1);var nTt=e=>typeof e=="boolean",z1=e=>typeof e=="function",wd=e=>e!==null&&typeof e=="object",HM=e=>wd(e)&&e.constructor==={}.constructor;var Wye=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",Vye=e=>e&&typeof e[Symbol.asyncIterator]=="function";var us=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var cs=e=>typeof Blob<"u"&&e instanceof Blob,Kye=e=>e&&typeof e=="object"&&e.isBuffer;var iTt=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||wd(e)&&z1(e.tee)&&z1(e.cancel)&&z1(e.getReader);var aTt=e=>wd(e)&&z1(e.read)&&z1(e.pipe)&&nTt(e.readable),JC=e=>iTt(e)||aTt(e);var oTt=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,sTt=/^([-\w.]+\/[-\w.+]+)/;function $ye(e){let t=sTt.exec(e);return t?t[1]:e}function WM(e){let t=oTt.exec(e);return t?t[1]:""}var Yye=/\?.*/;function Jye(e){let t=e.match(Yye);return t&&t[0]}function sv(e){return e.replace(Yye,"")}function Ed(e){return us(e)?e.url:cs(e)?e.name||"":typeof e=="string"?e:""}function H1(e){if(us(e)){let t=e,r=t.headers.get("content-type")||"",n=sv(t.url);return $ye(r)||WM(n)}return cs(e)?e.type||"":typeof e=="string"?WM(e):""}function Xye(e){return us(e)?e.headers["content-length"]||-1:cs(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function XC(e){if(us(e))return e;let t={},r=Xye(e);r>=0&&(t["content-length"]=String(r));let n=Ed(e),i=H1(e);i&&(t["content-type"]=i);let a=await cTt(e);a&&(t["x-first-bytes"]=a),typeof e=="string"&&(e=new TextEncoder().encode(e));let o=new Response(e,{headers:t});return Object.defineProperty(o,"url",{value:n}),o}async function Qye(e){if(!e.ok){let t=await uTt(e);throw new Error(t)}}async function uTt(e){let t=`Failed to fetch resource ${e.url} (${e.status}): `;try{let r=e.headers.get("Content-Type"),n=e.statusText;r.includes("application/json")&&(n+=` ${await e.text()}`),t+=n,t=t.length>60?`${t.slice(0,60)}...`:t}catch{}return t}async function cTt(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let r=e.slice(0,5);return await new Promise(n=>{let i=new FileReader;i.onload=a=>{var o;return n((o=a==null?void 0:a.target)==null?void 0:o.result)},i.readAsDataURL(r)})}if(e instanceof ArrayBuffer){let r=e.slice(0,5);return`data:base64,${lTt(r)}`}return null}function lTt(e){let t="",r=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)t+=String.fromCharCode(r[n]);return btoa(t)}function fTt(e){return!hTt(e)&&!pTt(e)}function hTt(e){return e.startsWith("http:")||e.startsWith("https:")}function pTt(e){return e.startsWith("data:")}async function Fo(e,t){var r,n;if(typeof e=="string"){let i=tc(e);return fTt(i)&&(r=globalThis.loaders)!=null&&r.fetchNode?(n=globalThis.loaders)==null?void 0:n.fetchNode(i,t):await fetch(i,t)}return await XC(e)}function VM(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 t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function lu(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||VM()}var dTt=globalThis.self||globalThis.window||globalThis.global,uv=globalThis.window||globalThis.self||globalThis.global,mTt=globalThis.document||{},Ad=globalThis.process||{},gTt=globalThis.console,Wdr=globalThis.navigator||{};var QC="4.0.0",$dr=lu();function vTt(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var ZC=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";zt(this,"storage",void 0),zt(this,"id",void 0),zt(this,"config",void 0),this.storage=vTt(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function Zye(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function exe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function e8(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var t8;(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"})(t8||(t8={}));var bTt=10;function txe(e){return typeof e!="string"?e:(e=e.toUpperCase(),t8[e]||t8.WHITE)}function rxe(e,t,r){if(!lu&&typeof e=="string"){if(t){let n=txe(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=txe(r);e="\x1B[".concat(n+bTt,"m").concat(e,"\x1B[49m")}}return e}function nxe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),i=e;for(let a of n){let o=i[a];typeof o=="function"&&(t.find(s=>a===s)||(i[a]=o.bind(e)))}}function cv(e,t){if(!e)throw new Error(t||"Assertion failed")}function Sd(){let e;if(lu()&&uv.performance){var t,r;e=uv===null||uv===void 0||(t=uv.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Ad){var n;let i=Ad===null||Ad===void 0||(n=Ad.hrtime)===null||n===void 0?void 0:n.call(Ad);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var lv={debug:lu()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},yTt={enabled:!0,level:0};function ls(){}var ixe={},axe={once:!0},vc=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};zt(this,"id",void 0),zt(this,"VERSION",QC),zt(this,"_startTs",Sd()),zt(this,"_deltaTs",Sd()),zt(this,"_storage",void 0),zt(this,"userData",{}),zt(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new ZC("__probe-".concat(this.id,"__"),yTt),this.timeStamp("".concat(this.id," started")),nxe(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Sd()-this._startTs).toPrecision(10))}getDelta(){return Number((Sd()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){cv(t,r)}warn(t){return this._getLogFunction(0,t,lv.warn,arguments,axe)}error(t){return this._getLogFunction(0,t,lv.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,lv.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,lv.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,lv.debug||lv.info,arguments,axe)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||ls,n&&[n],{tag:ETt(r)}):ls}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?lu()?wTt({image:i,message:a,scale:o}):_Tt({image:i,message:a,scale:o}):ls}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||ls)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=oxe({logLevel:t,message:r,opts:n}),{collapsed:a}=n;return i.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||ls)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=sxe(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=oxe({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,cv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Sd();let o=a.tag||a.message;if(a.once&&o)if(!ixe[o])ixe[o]=Sd();else return ls;return r=xTt(this.id,a.message,a),n.bind(console,r,...a.args)}return ls}};zt(vc,"VERSION",QC);function sxe(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return cv(Number.isFinite(t)&&t>=0),t}function oxe(e){let{logLevel:t,message:r}=e;e.logLevel=sxe(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let i=typeof e.message;return cv(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function xTt(e,t,r){if(typeof t=="string"){let n=r.time?exe(Zye(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=rxe(t,r.color,r.background)}return t}function _Tt(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),ls}function wTt(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=e8(a,r,n);console.log(...o)},a.src=t,ls}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...e8(t,r,n)),ls;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...e8(a,r,n)),a.src=t.toDataURL(),ls}return ls}function ETt(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var _0r=new vc({id:"@probe.gl/log"});var KM=new vc({id:"loaders.gl"}),r8=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},n8=class{console;constructor(){this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}};var $M={fetch:null,mimeType:void 0,nothrow:!1,log:new n8,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:gn,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},uxe={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 YM(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state=e._state||{},e._state}function fv(){let e=YM();return e.globalOptions=e.globalOptions||{...$M},e.globalOptions}function fxe(e,t,r,n){return r=r||[],r=Array.isArray(r)?r:[r],ATt(e,r),TTt(t,e,n)}function ATt(e,t){cxe(e,null,$M,uxe,t);for(let r of t){let n=e&&e[r.id]||{},i=r.options&&r.options[r.id]||{},a=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};cxe(n,r.id,i,a,t)}}function cxe(e,t,r,n,i){let a=t||"Top level",o=t?`${t}.`:"";for(let s in e){let u=!t&&wd(e[s]),c=s==="baseUri"&&!t,l=s==="workerUrl"&&t;if(!(s in r)&&!c&&!l){if(s in n)KM.warn(`${a} loader option '${o}${s}' no longer supported, use '${n[s]}'`)();else if(!u){let f=STt(s,i);KM.warn(`${a} loader option '${o}${s}' not recognized. ${f}`)()}}}}function STt(e,t){let r=e.toLowerCase(),n="";for(let i of t)for(let a in i.options){if(e===a)return`Did you mean '${i.id}.${a}'?`;let o=a.toLowerCase();(r.startsWith(o)||o.startsWith(r))&&(n=n||`Did you mean '${i.id}.${a}'?`)}return n}function TTt(e,t,r){let i={...e.options||{}};return CTt(i,r),i.log===null&&(i.log=new r8),lxe(i,fv()),lxe(i,t),i}function lxe(e,t){for(let r in t)if(r in t){let n=t[r];HM(n)&&HM(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function CTt(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function W1(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function JM(e){Qt(e,"null loader"),Qt(W1(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e={...e,options:{...e.options,...t}}),(e!=null&&e.parseTextSync||e!=null&&e.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var DTt=()=>{let e=YM();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function hxe(){return DTt()}var pxe=new vc({id:"loaders.gl"});var FTt=/\.([^.]+)$/;async function gxe(e,t=[],r,n){if(!vxe(e))return null;let i=dxe(e,t,{...r,nothrow:!0},n);if(i)return i;if(cs(e)&&(e=await e.slice(0,10).arrayBuffer(),i=dxe(e,t,r,n)),!i&&!(r!=null&&r.nothrow))throw new Error(bxe(e));return i}function dxe(e,t=[],r,n){if(!vxe(e))return null;if(t&&!Array.isArray(t))return JM(t);let i=[];t&&(i=i.concat(t)),r!=null&&r.ignoreRegisteredLoaders||i.push(...hxe()),BTt(i);let a=kTt(e,i,r,n);if(!a&&!(r!=null&&r.nothrow))throw new Error(bxe(e));return a}function kTt(e,t,r,n){let i=Ed(e),a=H1(e),o=sv(i)||(n==null?void 0:n.url),s=null,u="";return r!=null&&r.mimeType&&(s=XM(t,r==null?void 0:r.mimeType),u=`match forced by supplied MIME type ${r==null?void 0:r.mimeType}`),s=s||OTt(t,o),u=u||(s?`matched url ${o}`:""),s=s||XM(t,a),u=u||(s?`matched MIME type ${a}`:""),s=s||PTt(t,e),u=u||(s?`matched initial data ${yxe(e)}`:""),r!=null&&r.fallbackMimeType&&(s=s||XM(t,r==null?void 0:r.fallbackMimeType),u=u||(s?`matched fallback MIME type ${a}`:"")),u&&pxe.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${u}.`),s}function vxe(e){return!(e instanceof Response&&e.status===204)}function bxe(e){let t=Ed(e),r=H1(e),n="No valid loader found (";n+=t?`${eu.filename(t)}, `:"no url provided, ",n+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let i=e?yxe(e):"";return n+=i?` first bytes: "${i}"`:"first bytes: not available",n+=")",n}function BTt(e){for(let t of e)JM(t)}function OTt(e,t){let r=t&&FTt.exec(t),n=r&&r[1];return n?ITt(e,n):null}function ITt(e,t){t=t.toLowerCase();for(let r of e)for(let n of r.extensions)if(n.toLowerCase()===t)return r;return null}function XM(e,t){for(let r of e)if(r.mimeTypes&&r.mimeTypes.includes(t)||t===`application/x.${r.id}`)return r;return null}function PTt(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(RTt(t,r))return r}else if(ArrayBuffer.isView(t)){if(mxe(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&mxe(t,0,r))return r;return null}function RTt(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(n=>e.startsWith(n))}function mxe(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(i=>jTt(e,t,r,i))}function jTt(e,t,r,n){if(n instanceof ArrayBuffer)return Zu(n,e,n.byteLength);switch(typeof n){case"function":return n(e);case"string":let i=QM(e,t,n.length);return n===i;default:return!1}}function yxe(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?QM(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?QM(e,0,t):""}function QM(e,t,r){if(e.byteLength<t+r)return"";let n=new DataView(e),i="";for(let a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function*xxe(e,t){let r=(t==null?void 0:t.chunkSize)||262144,n=0,i=new TextEncoder;for(;n<e.length;){let a=Math.min(e.length-n,r),o=e.slice(n,n+a);n+=a,yield i.encode(o)}}function*_xe(e,t={}){let{chunkSize:r=262144}=t,n=0;for(;n<e.byteLength;){let i=Math.min(e.byteLength-n,r),a=new ArrayBuffer(i),o=new Uint8Array(e,n,i);new Uint8Array(a).set(o),n+=i,yield a}}async function*wxe(e,t){let r=(t==null?void 0:t.chunkSize)||1048576,n=0;for(;n<e.size;){let i=n+r,a=await e.slice(n,i).arrayBuffer();n=i,yield a}}function ZM(e,t){return gn?LTt(e,t):MTt(e,t)}async function*LTt(e,t){let r=e.getReader(),n;try{for(;;){let i=n||r.read();t!=null&&t._streamReadAhead&&(n=r.read());let{done:a,value:o}=await i;if(a)return;yield fl(o)}}catch{r.releaseLock()}}async function*MTt(e,t){for await(let r of e)yield fl(r)}function Exe(e,t){if(typeof e=="string")return xxe(e,t);if(e instanceof ArrayBuffer)return _xe(e,t);if(cs(e))return wxe(e,t);if(JC(e))return ZM(e,t);if(us(e))return ZM(e.body,t);throw new Error("makeIterator")}var Axe="Cannot convert supplied data type";function qTt(e,t,r){if(t.text&&typeof e=="string")return e;if(Kye(e)&&(e=e.buffer),e instanceof ArrayBuffer){let n=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);let n=e.buffer,i=e.byteLength||e.length;return(e.byteOffset!==0||i!==n.byteLength)&&(n=n.slice(e.byteOffset,e.byteOffset+i)),n}throw new Error(Axe)}async function Sxe(e,t,r){let n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||n)return qTt(e,t,r);if(cs(e)&&(e=await XC(e)),us(e)){let i=e;return await Qye(i),t.binary?await i.arrayBuffer():await i.text()}if(JC(e)&&(e=Exe(e,r)),Wye(e)||Vye(e))return zp(e);throw new Error(Axe)}function i8(e,t){let r=fv(),n=e||r;return typeof n.fetch=="function"?n.fetch:wd(n.fetch)?i=>Fo(i,n.fetch):t!=null&&t.fetch?t==null?void 0:t.fetch:Fo}function Txe(e,t,r){if(r)return r;let n={fetch:i8(t,e),...e};if(n.url){let i=sv(n.url);n.baseUrl=i,n.queryString=Jye(n.url),n.filename=eu.filename(i),n.baseUrl=eu.dirname(i)}return Array.isArray(n.loaders)||(n.loaders=null),n}function Cxe(e,t){if(e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){let n=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...n]:n}return r&&r.length?r:void 0}async function ko(e,t,r,n){t&&!Array.isArray(t)&&!W1(t)&&(n=void 0,r=t,t=void 0),e=await e,r=r||{};let i=Ed(e),o=Cxe(t,n),s=await gxe(e,o,r);return s?(r=fxe(r,s,o,i),n=Txe({url:i,_parse:ko,loaders:o},r,n||null),await NTt(s,e,r,n)):null}async function NTt(e,t,r,n){if(PI(e),r=DI(e.options,r),us(t)){let a=t,{ok:o,redirected:s,status:u,statusText:c,type:l,url:f}=a,h=Object.fromEntries(a.headers.entries());n.response={headers:h,ok:o,redirected:s,status:u,statusText:c,type:l,url:f}}t=await Sxe(t,e,r);let i=e;if(i.parseTextSync&&typeof t=="string")return i.parseTextSync(t,r,n);if(MI(e,r))return await qI(e,t,r,n,ko);if(i.parseText&&typeof t=="string")return await i.parseText(t,r,n);if(i.parse)return await i.parse(t,r,n);throw pa(!i.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}async function An(e,t,r,n){let i,a;!Array.isArray(t)&&!W1(t)?(i=[],a=t,n=void 0):(i=t,a=r);let o=i8(a),s=e;return typeof e=="string"&&(s=await o(e)),cs(e)&&(s=await o(e)),Array.isArray(i)?await ko(s,i,a):await ko(s,i,a)}async function hv(e,t,r){if(r={...fv(),...r},NI(t,r))return await II(t,e,r);if(t.encode)return await t.encode(e,r);if(t.encodeSync)return t.encodeSync(e,r);if(t.encodeText)return new TextEncoder().encode(await t.encodeText(e,r));if(t.encodeInBatches){let i=Fxe(e,t,r),a=[];for await(let o of i)a.push(o);return ec(...a)}if(!gn&&t.encodeURLtoURL){let i=Dxe("input");await new Hp(i,"w").write(e);let o=Dxe("output"),s=await kxe(i,o,t,r);return(await Fo(s)).arrayBuffer()}throw new Error("Writer could not encode data")}function a8(e,t,r){if(t.encodeSync)return t.encodeSync(e,r);throw new Error("Writer could not synchronously encode data")}function Fxe(e,t,r){if(t.encodeInBatches){let n=UTt(e);return t.encodeInBatches(n,r)}throw new Error("Writer could not encode data in batches")}async function kxe(e,t,r,n){if(e=tc(e),t=tc(t),gn||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,n)}function UTt(e){return[{...e,start:0,end:e.length}]}function Dxe(e){return`/tmp/${e}`}var GTt=1/Math.PI*180,zTt=1/180*Math.PI,HTt={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...HTt}};var Sn=globalThis.mathgl.config;function e7(e,{precision:t=Sn.precision}={}){return e=WTt(e),"".concat(parseFloat(e.toPrecision(t)))}function fs(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function t7(e){return Bxe(e)}function r7(e){return Cl(e)}function Bxe(e,t){return i7(e,r=>r*zTt,t)}function Cl(e,t){return i7(e,r=>r*GTt,t)}function n7(e,t,r){return i7(e,n=>Math.max(t,Math.min(r,n)))}function Bo(e,t,r){let n=Sn.EPSILON;r&&(Sn.EPSILON=r);try{if(e===t)return!0;if(fs(e)&&fs(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!Bo(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=Sn.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{Sn.EPSILON=n}}function WTt(e){return Math.round(e/Sn.EPSILON)*Sn.EPSILON}function VTt(e){return e.clone?e.clone():new Array(e.length)}function i7(e,t,r){if(fs(e)){let n=e;r=r||VTt(n);for(let i=0;i<r.length&&i<n.length;++i){let a=typeof e=="number"?e:e[i];r[i]=t(a,i,r)}return r}return t(e)}function KTt(e){function t(){var r=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var bh=class extends KTt(Array){clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:fs(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Sn)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+e7(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!Bo(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let i=0;i<this.ELEMENTS;++i){let a=t[i],o=typeof r=="number"?r:r[i];this[i]=a+n*(o-a)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(Sn.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function $Tt(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function Ar(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function yh(e,t,r=""){if(Sn.debug&&!$Tt(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function na(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var xh=class extends bh{get x(){return this[0]}set x(t){this[0]=Ar(t)}get y(){return this[1]}set y(t){this[1]=Ar(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let i=this[n]-t[n];r+=i*i}return Ar(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return Ar(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return na(t>=0&&t<this.ELEMENTS,"index is out of range"),Ar(this[t])}setComponent(t,r){return na(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var Ln=typeof Float32Array<"u"?Float32Array:Array,V1=Math.random;function pv(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var ugr=Math.PI/180;function YTt(){let e=new Ln(2);return Ln!=Float32Array&&(e[0]=0,e[1]=0),e}function Oxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e}function Ixe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5],e}function o8(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function s8(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}var cgr=function(){let e=YTt();return function(t,r,n,i,a,o){let s,u;for(r||(r=2),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],a(e,e,o),t[s]=e[0],t[s+1]=e[1];return t}}();function u8(e,t,r){let n=t[0],i=t[1],a=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/a,e[1]=(r[1]*n+r[5]*i)/a,e}function c8(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a||1;return e[0]=(r[0]*n+r[4]*i+r[8]*a)/o,e[1]=(r[1]*n+r[5]*i+r[9]*a)/o,e[2]=(r[2]*n+r[6]*i+r[10]*a)/o,e}function Pxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e}function Rxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e[3]=t[3],e}function l8(e,t,r){let n=t[0],i=t[1],a=t[2];return e[0]=r[0]*n+r[3]*i+r[6]*a,e[1]=r[1]*n+r[4]*i+r[7]*a,e[2]=r[2]*n+r[5]*i+r[8]*a,e[3]=t[3],e}var Td=class extends xh{constructor(t=0,r=0){super(2),fs(t)&&arguments.length===1?this.copy(t):(Sn.debug&&(Ar(t),Ar(r)),this[0]=t,this[1]=r)}set(t,r){return this[0]=t,this[1]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return Sn.debug&&(Ar(t.x),Ar(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return s8(this,this,t),this.check()}transformAsVector(t){return u8(this,this,t),this.check()}transformByMatrix3(t){return o8(this,this,t),this.check()}transformByMatrix2x3(t){return Ixe(this,this,t),this.check()}transformByMatrix2(t){return Oxe(this,this,t),this.check()}};var mv={};ca(mv,{add:()=>ZTt,angle:()=>c7,bezier:()=>h6t,ceil:()=>e6t,clone:()=>JTt,copy:()=>XTt,create:()=>f8,cross:()=>Cd,dist:()=>_6t,distance:()=>Nxe,div:()=>x6t,divide:()=>qxe,dot:()=>K1,equals:()=>v6t,exactEquals:()=>g6t,floor:()=>t6t,forEach:()=>A6t,fromValues:()=>h8,hermite:()=>f6t,inverse:()=>u6t,len:()=>l7,length:()=>jxe,lerp:()=>c6t,max:()=>n6t,min:()=>r6t,mul:()=>y6t,multiply:()=>Mxe,negate:()=>s6t,normalize:()=>a7,random:()=>p6t,rotateX:()=>o7,rotateY:()=>s7,rotateZ:()=>u7,round:()=>i6t,scale:()=>a6t,scaleAndAdd:()=>o6t,set:()=>QTt,slerp:()=>l6t,sqrDist:()=>w6t,sqrLen:()=>E6t,squaredDistance:()=>Uxe,squaredLength:()=>Gxe,str:()=>m6t,sub:()=>b6t,subtract:()=>Lxe,transformMat3:()=>$1,transformMat4:()=>Dd,transformQuat:()=>Y1,zero:()=>d6t});function f8(){let e=new Ln(3);return Ln!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function JTt(e){let t=new Ln(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function jxe(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function h8(e,t,r){let n=new Ln(3);return n[0]=e,n[1]=t,n[2]=r,n}function XTt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function QTt(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function ZTt(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function Lxe(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function Mxe(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function qxe(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function e6t(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function t6t(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function r6t(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function n6t(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function i6t(e,t){return e[0]=pv(t[0]),e[1]=pv(t[1]),e[2]=pv(t[2]),e}function a6t(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function o6t(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}function Nxe(e,t){let r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+n*n+i*i)}function Uxe(e,t){let r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i}function Gxe(e){let t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function s6t(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function u6t(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function a7(e,t){let r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function K1(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Cd(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2];return e[0]=i*u-a*s,e[1]=a*o-n*u,e[2]=n*s-i*o,e}function c6t(e,t,r,n){let i=t[0],a=t[1],o=t[2];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e}function l6t(e,t,r,n){let i=Math.acos(Math.min(Math.max(K1(t,r),-1),1)),a=Math.sin(i),o=Math.sin((1-n)*i)/a,s=Math.sin(n*i)/a;return e[0]=o*t[0]+s*r[0],e[1]=o*t[1]+s*r[1],e[2]=o*t[2]+s*r[2],e}function f6t(e,t,r,n,i,a){let o=a*a,s=o*(2*a-3)+1,u=o*(a-2)+a,c=o*(a-1),l=o*(3-2*a);return e[0]=t[0]*s+r[0]*u+n[0]*c+i[0]*l,e[1]=t[1]*s+r[1]*u+n[1]*c+i[1]*l,e[2]=t[2]*s+r[2]*u+n[2]*c+i[2]*l,e}function h6t(e,t,r,n,i,a){let o=1-a,s=o*o,u=a*a,c=s*o,l=3*a*s,f=3*u*o,h=u*a;return e[0]=t[0]*c+r[0]*l+n[0]*f+i[0]*h,e[1]=t[1]*c+r[1]*l+n[1]*f+i[1]*h,e[2]=t[2]*c+r[2]*l+n[2]*f+i[2]*h,e}function p6t(e,t){t=t===void 0?1:t;let r=V1()*2*Math.PI,n=V1()*2-1,i=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*i,e[1]=Math.sin(r)*i,e[2]=n*t,e}function Dd(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}function $1(e,t,r){let n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}function Y1(e,t,r){let n=r[0],i=r[1],a=r[2],o=r[3],s=t[0],u=t[1],c=t[2],l=i*c-a*u,f=a*s-n*c,h=n*u-i*s,p=i*h-a*f,d=a*l-n*h,b=n*f-i*l,g=o*2;return l*=g,f*=g,h*=g,p*=2,d*=2,b*=2,e[0]=s+l+p,e[1]=u+f+d,e[2]=c+h+b,e}function o7(e,t,r,n){let i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function s7(e,t,r,n){let i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function u7(e,t,r,n){let i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function c7(e,t){let r=e[0],n=e[1],i=e[2],a=t[0],o=t[1],s=t[2],u=Math.sqrt((r*r+n*n+i*i)*(a*a+o*o+s*s)),c=u&&K1(e,t)/u;return Math.acos(Math.min(Math.max(c,-1),1))}function d6t(e){return e[0]=0,e[1]=0,e[2]=0,e}function m6t(e){return"vec3(".concat(e[0],", ").concat(e[1],", ").concat(e[2],")")}function g6t(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function v6t(e,t){let r=e[0],n=e[1],i=e[2],a=t[0],o=t[1],s=t[2];return Math.abs(r-a)<=1e-6*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-o)<=1e-6*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=1e-6*Math.max(1,Math.abs(i),Math.abs(s))}var b6t=Lxe,y6t=Mxe,x6t=qxe,_6t=Nxe,w6t=Uxe,l7=jxe,E6t=Gxe,A6t=function(){let e=f8();return function(t,r,n,i,a,o){let s,u;for(r||(r=3),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2];return t}}();var f7=[0,0,0],p8,ce=class extends xh{static get ZERO(){return p8||(p8=new ce(0,0,0),Object.freeze(p8)),p8}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&fs(t)?this.copy(t):(Sn.debug&&(Ar(t),Ar(r),Ar(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return Sn.debug&&(Ar(t.x),Ar(t.y),Ar(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=Ar(t)}angle(t){return c7(this,t)}cross(t){return Cd(this,this,t),this.check()}rotateX({radians:t,origin:r=f7}){return o7(this,this,r,t),this.check()}rotateY({radians:t,origin:r=f7}){return s7(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=f7}){return u7(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Dd(this,this,t),this.check()}transformAsVector(t){return c8(this,this,t),this.check()}transformByMatrix3(t){return $1(this,this,t),this.check()}transformByMatrix2(t){return Pxe(this,this,t),this.check()}transformByQuaternion(t){return Y1(this,this,t),this.check()}};var d8,hs=class extends xh{static get ZERO(){return d8||(d8=new hs(0,0,0,0),Object.freeze(d8)),d8}constructor(t=0,r=0,n=0,i=0){super(-0,-0,-0,-0),fs(t)&&arguments.length===1?this.copy(t):(Sn.debug&&(Ar(t),Ar(r),Ar(n),Ar(i)),this[0]=t,this[1]=r,this[2]=n,this[3]=i)}set(t,r,n,i){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return Sn.debug&&(Ar(t.x),Ar(t.y),Ar(t.z),Ar(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=Ar(t)}get w(){return this[3]}set w(t){this[3]=Ar(t)}transform(t){return Dd(this,this,t),this.check()}transformByMatrix3(t){return l8(this,this,t),this.check()}transformByMatrix2(t){return Rxe(this,this,t),this.check()}transformByQuaternion(t){return Y1(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var gv=class extends bh{toString(){let t="[";if(Sn.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+r])}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=Ar(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(t,r){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}};function zxe(){let e=new Ln(9);return Ln!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function Hxe(e,t){if(e===t){let r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function Wxe(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=l*o-s*c,h=-l*a+s*u,p=c*a-o*u,d=r*f+n*h+i*p;return d?(d=1/d,e[0]=f*d,e[1]=(-l*n+i*c)*d,e[2]=(s*n-i*o)*d,e[3]=h*d,e[4]=(l*r-i*u)*d,e[5]=(-s*r+i*a)*d,e[6]=p*d,e[7]=(-c*r+n*u)*d,e[8]=(o*r-n*a)*d,e):null}function Vxe(e){let t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8];return t*(c*a-o*u)+r*(-c*i+o*s)+n*(u*i-a*s)}function h7(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=r[0],p=r[1],d=r[2],b=r[3],g=r[4],x=r[5],E=r[6],S=r[7],F=r[8];return e[0]=h*n+p*o+d*c,e[1]=h*i+p*s+d*l,e[2]=h*a+p*u+d*f,e[3]=b*n+g*o+x*c,e[4]=b*i+g*s+x*l,e[5]=b*a+g*u+x*f,e[6]=E*n+S*o+F*c,e[7]=E*i+S*s+F*l,e[8]=E*a+S*u+F*f,e}function Kxe(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=r[0],p=r[1];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=h*n+p*o+c,e[7]=h*i+p*s+l,e[8]=h*a+p*u+f,e}function $xe(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=Math.sin(r),p=Math.cos(r);return e[0]=p*n+h*o,e[1]=p*i+h*s,e[2]=p*a+h*u,e[3]=p*o-h*n,e[4]=p*s-h*i,e[5]=p*u-h*a,e[6]=c,e[7]=l,e[8]=f,e}function p7(e,t,r){let n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Yxe(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,h=i*o,p=i*s,d=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-d,e[3]=l-x,e[6]=h+g,e[1]=l+x,e[4]=1-c-d,e[7]=p-b,e[2]=h-g,e[5]=p+b,e[8]=1-c-f,e}var d7;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(d7||(d7={}));var T6t=Object.freeze([1,0,0,0,1,0,0,0,1]),Rr=class extends gv{static get IDENTITY(){return D6t()}static get ZERO(){return C6t()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return d7}constructor(t,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):r.length>0?this.copy([t,...r]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(T6t)}fromObject(t){return this.check()}fromQuaternion(t){return Yxe(this,t),this.check()}set(t,r,n,i,a,o,s,u,c){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=a,this[5]=o,this[6]=s,this[7]=u,this[8]=c,this.check()}setRowMajor(t,r,n,i,a,o,s,u,c){return this[0]=t,this[1]=i,this[2]=s,this[3]=r,this[4]=a,this[5]=u,this[6]=n,this[7]=o,this[8]=c,this.check()}determinant(){return Vxe(this)}transpose(){return Hxe(this,this),this.check()}invert(){return Wxe(this,this),this.check()}multiplyLeft(t){return h7(this,t,this),this.check()}multiplyRight(t){return h7(this,this,t),this.check()}rotate(t){return $xe(this,this,t),this.check()}scale(t){return Array.isArray(t)?p7(this,this,t):p7(this,this,[t,t]),this.check()}translate(t){return Kxe(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=o8(r||[-0,-0],t,this);break;case 3:n=$1(r||[-0,-0,-0],t,this);break;case 4:n=l8(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return yh(n,t.length),n}transformVector(t,r){return this.transform(t,r)}transformVector2(t,r){return this.transform(t,r)}transformVector3(t,r){return this.transform(t,r)}},m8,g8=null;function C6t(){return m8||(m8=new Rr([0,0,0,0,0,0,0,0,0]),Object.freeze(m8)),m8}function D6t(){return g8||(g8=new Rr,Object.freeze(g8)),g8}var v8={};ca(v8,{add:()=>Z6t,adjoint:()=>P6t,clone:()=>k6t,copy:()=>B6t,create:()=>F6t,decompose:()=>H6t,determinant:()=>v7,equals:()=>n3t,exactEquals:()=>r3t,frob:()=>Q6t,fromQuat:()=>A7,fromQuat2:()=>U6t,fromRotation:()=>L6t,fromRotationTranslation:()=>Xxe,fromRotationTranslationScale:()=>W6t,fromRotationTranslationScaleOrigin:()=>V6t,fromScaling:()=>j6t,fromTranslation:()=>R6t,fromValues:()=>O6t,fromXRotation:()=>M6t,fromYRotation:()=>q6t,fromZRotation:()=>N6t,frustum:()=>S7,getRotation:()=>z6t,getScaling:()=>Qxe,getTranslation:()=>G6t,identity:()=>Jxe,invert:()=>g7,lookAt:()=>D7,mul:()=>i3t,multiply:()=>J1,multiplyScalar:()=>e3t,multiplyScalarAndAdd:()=>t3t,ortho:()=>C7,orthoNO:()=>e1e,orthoZO:()=>Y6t,perspective:()=>T7,perspectiveFromFieldOfView:()=>$6t,perspectiveNO:()=>Zxe,perspectiveZO:()=>K6t,rotate:()=>x7,rotateX:()=>_7,rotateY:()=>w7,rotateZ:()=>E7,scale:()=>y7,set:()=>I6t,str:()=>X6t,sub:()=>a3t,subtract:()=>t1e,targetTo:()=>J6t,translate:()=>b7,transpose:()=>m7});function F6t(){let e=new Ln(16);return Ln!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function k6t(e){let t=new Ln(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function B6t(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function O6t(e,t,r,n,i,a,o,s,u,c,l,f,h,p,d,b){let g=new Ln(16);return g[0]=e,g[1]=t,g[2]=r,g[3]=n,g[4]=i,g[5]=a,g[6]=o,g[7]=s,g[8]=u,g[9]=c,g[10]=l,g[11]=f,g[12]=h,g[13]=p,g[14]=d,g[15]=b,g}function I6t(e,t,r,n,i,a,o,s,u,c,l,f,h,p,d,b,g){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=a,e[5]=o,e[6]=s,e[7]=u,e[8]=c,e[9]=l,e[10]=f,e[11]=h,e[12]=p,e[13]=d,e[14]=b,e[15]=g,e}function Jxe(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 m7(e,t){if(e===t){let r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function g7(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],h=t[10],p=t[11],d=t[12],b=t[13],g=t[14],x=t[15],E=r*s-n*o,S=r*u-i*o,F=r*c-a*o,D=n*u-i*s,j=n*c-a*s,k=i*c-a*u,N=l*b-f*d,C=l*g-h*d,I=l*x-p*d,P=f*g-h*b,U=f*x-p*b,Y=h*x-p*g,J=E*Y-S*U+F*P+D*I-j*C+k*N;return J?(J=1/J,e[0]=(s*Y-u*U+c*P)*J,e[1]=(i*U-n*Y-a*P)*J,e[2]=(b*k-g*j+x*D)*J,e[3]=(h*j-f*k-p*D)*J,e[4]=(u*I-o*Y-c*C)*J,e[5]=(r*Y-i*I+a*C)*J,e[6]=(g*F-d*k-x*S)*J,e[7]=(l*k-h*F+p*S)*J,e[8]=(o*U-s*I+c*N)*J,e[9]=(n*I-r*U-a*N)*J,e[10]=(d*j-b*F+x*E)*J,e[11]=(f*F-l*j-p*E)*J,e[12]=(s*C-o*P-u*N)*J,e[13]=(r*P-n*C+i*N)*J,e[14]=(b*S-d*D-g*E)*J,e[15]=(l*D-f*S+h*E)*J,e):null}function P6t(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],h=t[10],p=t[11],d=t[12],b=t[13],g=t[14],x=t[15],E=r*s-n*o,S=r*u-i*o,F=r*c-a*o,D=n*u-i*s,j=n*c-a*s,k=i*c-a*u,N=l*b-f*d,C=l*g-h*d,I=l*x-p*d,P=f*g-h*b,U=f*x-p*b,Y=h*x-p*g;return e[0]=s*Y-u*U+c*P,e[1]=i*U-n*Y-a*P,e[2]=b*k-g*j+x*D,e[3]=h*j-f*k-p*D,e[4]=u*I-o*Y-c*C,e[5]=r*Y-i*I+a*C,e[6]=g*F-d*k-x*S,e[7]=l*k-h*F+p*S,e[8]=o*U-s*I+c*N,e[9]=n*I-r*U-a*N,e[10]=d*j-b*F+x*E,e[11]=f*F-l*j-p*E,e[12]=s*C-o*P-u*N,e[13]=r*P-n*C+i*N,e[14]=b*S-d*D-g*E,e[15]=l*D-f*S+h*E,e}function v7(e){let t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=e[11],p=e[12],d=e[13],b=e[14],g=e[15],x=t*o-r*a,E=t*s-n*a,S=r*s-n*o,F=c*d-l*p,D=c*b-f*p,j=l*b-f*d,k=t*j-r*D+n*F,N=a*j-o*D+s*F,C=c*S-l*E+f*x,I=p*S-d*E+b*x;return u*k-i*N+g*C-h*I}function J1(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],p=t[10],d=t[11],b=t[12],g=t[13],x=t[14],E=t[15],S=r[0],F=r[1],D=r[2],j=r[3];return e[0]=S*n+F*s+D*f+j*b,e[1]=S*i+F*u+D*h+j*g,e[2]=S*a+F*c+D*p+j*x,e[3]=S*o+F*l+D*d+j*E,S=r[4],F=r[5],D=r[6],j=r[7],e[4]=S*n+F*s+D*f+j*b,e[5]=S*i+F*u+D*h+j*g,e[6]=S*a+F*c+D*p+j*x,e[7]=S*o+F*l+D*d+j*E,S=r[8],F=r[9],D=r[10],j=r[11],e[8]=S*n+F*s+D*f+j*b,e[9]=S*i+F*u+D*h+j*g,e[10]=S*a+F*c+D*p+j*x,e[11]=S*o+F*l+D*d+j*E,S=r[12],F=r[13],D=r[14],j=r[15],e[12]=S*n+F*s+D*f+j*b,e[13]=S*i+F*u+D*h+j*g,e[14]=S*a+F*c+D*p+j*x,e[15]=S*o+F*l+D*d+j*E,e}function b7(e,t,r){let n=r[0],i=r[1],a=r[2],o,s,u,c,l,f,h,p,d,b,g,x;return t===e?(e[12]=t[0]*n+t[4]*i+t[8]*a+t[12],e[13]=t[1]*n+t[5]*i+t[9]*a+t[13],e[14]=t[2]*n+t[6]*i+t[10]*a+t[14],e[15]=t[3]*n+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],u=t[2],c=t[3],l=t[4],f=t[5],h=t[6],p=t[7],d=t[8],b=t[9],g=t[10],x=t[11],e[0]=o,e[1]=s,e[2]=u,e[3]=c,e[4]=l,e[5]=f,e[6]=h,e[7]=p,e[8]=d,e[9]=b,e[10]=g,e[11]=x,e[12]=o*n+l*i+d*a+t[12],e[13]=s*n+f*i+b*a+t[13],e[14]=u*n+h*i+g*a+t[14],e[15]=c*n+p*i+x*a+t[15]),e}function y7(e,t,r){let n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function x7(e,t,r,n){let i=n[0],a=n[1],o=n[2],s=Math.sqrt(i*i+a*a+o*o),u,c,l,f,h,p,d,b,g,x,E,S,F,D,j,k,N,C,I,P,U,Y,J,re;return s<1e-6?null:(s=1/s,i*=s,a*=s,o*=s,c=Math.sin(r),u=Math.cos(r),l=1-u,f=t[0],h=t[1],p=t[2],d=t[3],b=t[4],g=t[5],x=t[6],E=t[7],S=t[8],F=t[9],D=t[10],j=t[11],k=i*i*l+u,N=a*i*l+o*c,C=o*i*l-a*c,I=i*a*l-o*c,P=a*a*l+u,U=o*a*l+i*c,Y=i*o*l+a*c,J=a*o*l-i*c,re=o*o*l+u,e[0]=f*k+b*N+S*C,e[1]=h*k+g*N+F*C,e[2]=p*k+x*N+D*C,e[3]=d*k+E*N+j*C,e[4]=f*I+b*P+S*U,e[5]=h*I+g*P+F*U,e[6]=p*I+x*P+D*U,e[7]=d*I+E*P+j*U,e[8]=f*Y+b*J+S*re,e[9]=h*Y+g*J+F*re,e[10]=p*Y+x*J+D*re,e[11]=d*Y+E*J+j*re,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function _7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],h=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*n,e[5]=o*i+l*n,e[6]=s*i+f*n,e[7]=u*i+h*n,e[8]=c*i-a*n,e[9]=l*i-o*n,e[10]=f*i-s*n,e[11]=h*i-u*n,e}function w7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[8],l=t[9],f=t[10],h=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*n,e[1]=o*i-l*n,e[2]=s*i-f*n,e[3]=u*i-h*n,e[8]=a*n+c*i,e[9]=o*n+l*i,e[10]=s*n+f*i,e[11]=u*n+h*i,e}function E7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[4],l=t[5],f=t[6],h=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*n,e[1]=o*i+l*n,e[2]=s*i+f*n,e[3]=u*i+h*n,e[4]=c*i-a*n,e[5]=l*i-o*n,e[6]=f*i-s*n,e[7]=h*i-u*n,e}function R6t(e,t){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]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function j6t(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function L6t(e,t,r){let n=r[0],i=r[1],a=r[2],o=Math.sqrt(n*n+i*i+a*a),s,u,c;return o<1e-6?null:(o=1/o,n*=o,i*=o,a*=o,u=Math.sin(t),s=Math.cos(t),c=1-s,e[0]=n*n*c+s,e[1]=i*n*c+a*u,e[2]=a*n*c-i*u,e[3]=0,e[4]=n*i*c-a*u,e[5]=i*i*c+s,e[6]=a*i*c+n*u,e[7]=0,e[8]=n*a*c+i*u,e[9]=i*a*c-n*u,e[10]=a*a*c+s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function M6t(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function q6t(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function N6t(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,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 Xxe(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,u=i+i,c=a+a,l=n*s,f=n*u,h=n*c,p=i*u,d=i*c,b=a*c,g=o*s,x=o*u,E=o*c;return e[0]=1-(p+b),e[1]=f+E,e[2]=h-x,e[3]=0,e[4]=f-E,e[5]=1-(l+b),e[6]=d+g,e[7]=0,e[8]=h+x,e[9]=d-g,e[10]=1-(l+p),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function U6t(e,t){let r=new Ln(3),n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=n*n+i*i+a*a+o*o;return f>0?(r[0]=(s*o+l*n+u*a-c*i)*2/f,r[1]=(u*o+l*i+c*n-s*a)*2/f,r[2]=(c*o+l*a+s*i-u*n)*2/f):(r[0]=(s*o+l*n+u*a-c*i)*2,r[1]=(u*o+l*i+c*n-s*a)*2,r[2]=(c*o+l*a+s*i-u*n)*2),Xxe(e,t,r),e}function G6t(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Qxe(e,t){let r=t[0],n=t[1],i=t[2],a=t[4],o=t[5],s=t[6],u=t[8],c=t[9],l=t[10];return e[0]=Math.sqrt(r*r+n*n+i*i),e[1]=Math.sqrt(a*a+o*o+s*s),e[2]=Math.sqrt(u*u+c*c+l*l),e}function z6t(e,t){let r=new Ln(3);Qxe(r,t);let n=1/r[0],i=1/r[1],a=1/r[2],o=t[0]*n,s=t[1]*i,u=t[2]*a,c=t[4]*n,l=t[5]*i,f=t[6]*a,h=t[8]*n,p=t[9]*i,d=t[10]*a,b=o+l+d,g=0;return b>0?(g=Math.sqrt(b+1)*2,e[3]=.25*g,e[0]=(f-p)/g,e[1]=(h-u)/g,e[2]=(s-c)/g):o>l&&o>d?(g=Math.sqrt(1+o-l-d)*2,e[3]=(f-p)/g,e[0]=.25*g,e[1]=(s+c)/g,e[2]=(h+u)/g):l>d?(g=Math.sqrt(1+l-o-d)*2,e[3]=(h-u)/g,e[0]=(s+c)/g,e[1]=.25*g,e[2]=(f+p)/g):(g=Math.sqrt(1+d-o-l)*2,e[3]=(s-c)/g,e[0]=(h+u)/g,e[1]=(f+p)/g,e[2]=.25*g),e}function H6t(e,t,r,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];let i=n[0],a=n[1],o=n[2],s=n[4],u=n[5],c=n[6],l=n[8],f=n[9],h=n[10];r[0]=Math.sqrt(i*i+a*a+o*o),r[1]=Math.sqrt(s*s+u*u+c*c),r[2]=Math.sqrt(l*l+f*f+h*h);let p=1/r[0],d=1/r[1],b=1/r[2],g=i*p,x=a*d,E=o*b,S=s*p,F=u*d,D=c*b,j=l*p,k=f*d,N=h*b,C=g+F+N,I=0;return C>0?(I=Math.sqrt(C+1)*2,e[3]=.25*I,e[0]=(D-k)/I,e[1]=(j-E)/I,e[2]=(x-S)/I):g>F&&g>N?(I=Math.sqrt(1+g-F-N)*2,e[3]=(D-k)/I,e[0]=.25*I,e[1]=(x+S)/I,e[2]=(j+E)/I):F>N?(I=Math.sqrt(1+F-g-N)*2,e[3]=(j-E)/I,e[0]=(x+S)/I,e[1]=.25*I,e[2]=(D+k)/I):(I=Math.sqrt(1+N-g-F)*2,e[3]=(x-S)/I,e[0]=(j+E)/I,e[1]=(D+k)/I,e[2]=.25*I),e}function W6t(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3],u=i+i,c=a+a,l=o+o,f=i*u,h=i*c,p=i*l,d=a*c,b=a*l,g=o*l,x=s*u,E=s*c,S=s*l,F=n[0],D=n[1],j=n[2];return e[0]=(1-(d+g))*F,e[1]=(h+S)*F,e[2]=(p-E)*F,e[3]=0,e[4]=(h-S)*D,e[5]=(1-(f+g))*D,e[6]=(b+x)*D,e[7]=0,e[8]=(p+E)*j,e[9]=(b-x)*j,e[10]=(1-(f+d))*j,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function V6t(e,t,r,n,i){let a=t[0],o=t[1],s=t[2],u=t[3],c=a+a,l=o+o,f=s+s,h=a*c,p=a*l,d=a*f,b=o*l,g=o*f,x=s*f,E=u*c,S=u*l,F=u*f,D=n[0],j=n[1],k=n[2],N=i[0],C=i[1],I=i[2],P=(1-(b+x))*D,U=(p+F)*D,Y=(d-S)*D,J=(p-F)*j,re=(1-(h+x))*j,ee=(g+E)*j,ge=(d+S)*k,ye=(g-E)*k,pe=(1-(h+b))*k;return e[0]=P,e[1]=U,e[2]=Y,e[3]=0,e[4]=J,e[5]=re,e[6]=ee,e[7]=0,e[8]=ge,e[9]=ye,e[10]=pe,e[11]=0,e[12]=r[0]+N-(P*N+J*C+ge*I),e[13]=r[1]+C-(U*N+re*C+ye*I),e[14]=r[2]+I-(Y*N+ee*C+pe*I),e[15]=1,e}function A7(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,h=i*o,p=i*s,d=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-d,e[1]=l+x,e[2]=h-g,e[3]=0,e[4]=l-x,e[5]=1-c-d,e[6]=p+b,e[7]=0,e[8]=h+g,e[9]=p-b,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function S7(e,t,r,n,i,a,o){let s=1/(r-t),u=1/(i-n),c=1/(a-o);return e[0]=a*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*u,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*u,e[10]=(o+a)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*c,e[15]=0,e}function Zxe(e,t,r,n,i){let a=1/Math.tan(t/2);if(e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let o=1/(n-i);e[10]=(i+n)*o,e[14]=2*i*n*o}else e[10]=-1,e[14]=-2*n;return e}var T7=Zxe;function K6t(e,t,r,n,i){let a=1/Math.tan(t/2);if(e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let o=1/(n-i);e[10]=i*o,e[14]=i*n*o}else e[10]=-1,e[14]=-n;return e}function $6t(e,t,r,n){let i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),u=2/(o+s),c=2/(i+a);return e[0]=u,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-((o-s)*u*.5),e[9]=(i-a)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function e1e(e,t,r,n,i,a,o){let s=1/(t-r),u=1/(n-i),c=1/(a-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*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=(o+a)*c,e[15]=1,e}var C7=e1e;function Y6t(e,t,r,n,i,a,o){let s=1/(t-r),u=1/(n-i),c=1/(a-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]=c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=a*c,e[15]=1,e}function D7(e,t,r,n){let i,a,o,s,u,c,l,f,h,p,d=t[0],b=t[1],g=t[2],x=n[0],E=n[1],S=n[2],F=r[0],D=r[1],j=r[2];return Math.abs(d-F)<1e-6&&Math.abs(b-D)<1e-6&&Math.abs(g-j)<1e-6?Jxe(e):(f=d-F,h=b-D,p=g-j,i=1/Math.sqrt(f*f+h*h+p*p),f*=i,h*=i,p*=i,a=E*p-S*h,o=S*f-x*p,s=x*h-E*f,i=Math.sqrt(a*a+o*o+s*s),i?(i=1/i,a*=i,o*=i,s*=i):(a=0,o=0,s=0),u=h*s-p*o,c=p*a-f*s,l=f*o-h*a,i=Math.sqrt(u*u+c*c+l*l),i?(i=1/i,u*=i,c*=i,l*=i):(u=0,c=0,l=0),e[0]=a,e[1]=u,e[2]=f,e[3]=0,e[4]=o,e[5]=c,e[6]=h,e[7]=0,e[8]=s,e[9]=l,e[10]=p,e[11]=0,e[12]=-(a*d+o*b+s*g),e[13]=-(u*d+c*b+l*g),e[14]=-(f*d+h*b+p*g),e[15]=1,e)}function J6t(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=n[0],u=n[1],c=n[2],l=i-r[0],f=a-r[1],h=o-r[2],p=l*l+f*f+h*h;p>0&&(p=1/Math.sqrt(p),l*=p,f*=p,h*=p);let d=u*h-c*f,b=c*l-s*h,g=s*f-u*l;return p=d*d+b*b+g*g,p>0&&(p=1/Math.sqrt(p),d*=p,b*=p,g*=p),e[0]=d,e[1]=b,e[2]=g,e[3]=0,e[4]=f*g-h*b,e[5]=h*d-l*g,e[6]=l*b-f*d,e[7]=0,e[8]=l,e[9]=f,e[10]=h,e[11]=0,e[12]=i,e[13]=a,e[14]=o,e[15]=1,e}function X6t(e){return"mat4(".concat(e[0],", ").concat(e[1],", ").concat(e[2],", ").concat(e[3],", ").concat(e[4],", ").concat(e[5],", ").concat(e[6],", ").concat(e[7],", ").concat(e[8],", ").concat(e[9],", ").concat(e[10],", ").concat(e[11],", ").concat(e[12],", ").concat(e[13],", ").concat(e[14],", ").concat(e[15],")")}function Q6t(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}function Z6t(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function t1e(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function e3t(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function t3t(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function r3t(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function n3t(e,t){let r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=e[9],h=e[10],p=e[11],d=e[12],b=e[13],g=e[14],x=e[15],E=t[0],S=t[1],F=t[2],D=t[3],j=t[4],k=t[5],N=t[6],C=t[7],I=t[8],P=t[9],U=t[10],Y=t[11],J=t[12],re=t[13],ee=t[14],ge=t[15];return Math.abs(r-E)<=1e-6*Math.max(1,Math.abs(r),Math.abs(E))&&Math.abs(n-S)<=1e-6*Math.max(1,Math.abs(n),Math.abs(S))&&Math.abs(i-F)<=1e-6*Math.max(1,Math.abs(i),Math.abs(F))&&Math.abs(a-D)<=1e-6*Math.max(1,Math.abs(a),Math.abs(D))&&Math.abs(o-j)<=1e-6*Math.max(1,Math.abs(o),Math.abs(j))&&Math.abs(s-k)<=1e-6*Math.max(1,Math.abs(s),Math.abs(k))&&Math.abs(u-N)<=1e-6*Math.max(1,Math.abs(u),Math.abs(N))&&Math.abs(c-C)<=1e-6*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(l-I)<=1e-6*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(f-P)<=1e-6*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(h-U)<=1e-6*Math.max(1,Math.abs(h),Math.abs(U))&&Math.abs(p-Y)<=1e-6*Math.max(1,Math.abs(p),Math.abs(Y))&&Math.abs(d-J)<=1e-6*Math.max(1,Math.abs(d),Math.abs(J))&&Math.abs(b-re)<=1e-6*Math.max(1,Math.abs(b),Math.abs(re))&&Math.abs(g-ee)<=1e-6*Math.max(1,Math.abs(g),Math.abs(ee))&&Math.abs(x-ge)<=1e-6*Math.max(1,Math.abs(x),Math.abs(ge))}var i3t=J1,a3t=t1e;function o3t(){let e=new Ln(4);return Ln!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function r1e(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function n1e(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function i1e(e){let t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)}function a1e(e){let t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function o1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o,e}function s1e(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function u1e(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e}function c1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}function l1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],c=r[3],l=c*n+s*a-u*i,f=c*i+u*n-o*a,h=c*a+o*i-s*n,p=-o*n-s*i-u*a;return e[0]=l*c+p*-o+f*-u-h*-s,e[1]=f*c+p*-s+h*-o-l*-u,e[2]=h*c+p*-u+l*-s-f*-o,e[3]=t[3],e}var Ugr=function(){let e=o3t();return function(t,r,n,i,a,o){let s,u;for(r||(r=4),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}}();var B7;(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"})(B7||(B7={}));var u3t=45*Math.PI/180,c3t=1,F7=.1,k7=500,l3t=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Kr=class extends gv{static get IDENTITY(){return h3t()}static get ZERO(){return f3t()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return B7}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,i,a,o,s,u,c,l,f,h,p,d,b,g){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=a,this[5]=o,this[6]=s,this[7]=u,this[8]=c,this[9]=l,this[10]=f,this[11]=h,this[12]=p,this[13]=d,this[14]=b,this[15]=g,this.check()}setRowMajor(t,r,n,i,a,o,s,u,c,l,f,h,p,d,b,g){return this[0]=t,this[1]=a,this[2]=c,this[3]=p,this[4]=r,this[5]=o,this[6]=l,this[7]=d,this[8]=n,this[9]=s,this[10]=f,this[11]=b,this[12]=i,this[13]=u,this[14]=h,this[15]=g,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(l3t)}fromObject(t){return this.check()}fromQuaternion(t){return A7(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:i,top:a,near:o=F7,far:s=k7}=t;return s===1/0?p3t(this,r,n,i,a,o):S7(this,r,n,i,a,o,s),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=t;return D7(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:a,near:o=F7,far:s=k7}=t;return C7(this,r,n,i,a,o,s),this.check()}orthographic(t){let{fovy:r=u3t,aspect:n=c3t,focalDistance:i=1,near:a=F7,far:o=k7}=t;f1e(r);let s=r/2,u=i*Math.tan(s),c=u*n;return this.ortho({left:-c,right:c,bottom:-u,top:u,near:a,far:o})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:a=500}=t;return f1e(r),T7(this,r,n,i,a),this.check()}determinant(){return v7(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],a=1/n[1],o=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*a,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*a,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*a,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],a=1/n[1],o=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*a,t[2]=this[2]*o,t[3]=this[4]*i,t[4]=this[5]*a,t[5]=this[6]*o,t[6]=this[8]*i,t[7]=this[9]*a,t[8]=this[10]*o,t}transpose(){return m7(this,this),this.check()}invert(){return g7(this,this),this.check()}multiplyLeft(t){return J1(this,t,this),this.check()}multiplyRight(t){return J1(this,this,t),this.check()}rotateX(t){return _7(this,this,t),this.check()}rotateY(t){return w7(this,this,t),this.check()}rotateZ(t){return E7(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return x7(this,this,t,r),this.check()}scale(t){return y7(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return b7(this,this,t),this.check()}transform(t,r){return t.length===4?(r=c1e(r||[-0,-0,-0,-0],t,this),yh(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=s8(r||[-0,-0],t,this);break;case 3:i=Dd(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return yh(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=u8(r||[-0,-0],t,this);break;case 3:n=c8(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return yh(n,t.length),n}transformPoint(t,r){return this.transformAsPoint(t,r)}transformVector(t,r){return this.transformAsPoint(t,r)}transformDirection(t,r){return this.transformAsVector(t,r)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}},b8,y8;function f3t(){return b8||(b8=new Kr([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(b8)),b8}function h3t(){return y8||(y8=new Kr,Object.freeze(y8)),y8}function f1e(e){if(e>Math.PI*2)throw Error("expected radians")}function p3t(e,t,r,n,i,a){let o=2*a/(r-t),s=2*a/(i-n),u=(r+t)/(r-t),c=(i+n)/(i-n),l=-1,f=-1,h=-2*a;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]=c,e[10]=l,e[11]=f,e[12]=0,e[13]=0,e[14]=h,e[15]=0,e}function h1e(){let e=new Ln(4);return Ln!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function p1e(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function O7(e,t,r){r=r*.5;let n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function I7(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=r[0],u=r[1],c=r[2],l=r[3];return e[0]=n*l+o*s+i*c-a*u,e[1]=i*l+o*u+a*s-n*c,e[2]=a*l+o*c+n*u-i*s,e[3]=o*l-n*s-i*u-a*c,e}function d1e(e,t,r){r*=.5;let n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+o*s,e[1]=i*u+a*s,e[2]=a*u-i*s,e[3]=o*u-n*s,e}function m1e(e,t,r){r*=.5;let n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u-a*s,e[1]=i*u+o*s,e[2]=a*u+n*s,e[3]=o*u-i*s,e}function g1e(e,t,r){r*=.5;let n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+i*s,e[1]=i*u-n*s,e[2]=a*u+o*s,e[3]=o*u-a*s,e}function v1e(e,t){let r=t[0],n=t[1],i=t[2];return e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),e}function X1(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3],u=r[0],c=r[1],l=r[2],f=r[3],h,p,d,b,g;return h=i*u+a*c+o*l+s*f,h<0&&(h=-h,u=-u,c=-c,l=-l,f=-f),1-h>1e-6?(p=Math.acos(h),g=Math.sin(p),d=Math.sin((1-n)*p)/g,b=Math.sin(n*p)/g):(d=1-n,b=n),e[0]=d*i+b*u,e[1]=d*a+b*c,e[2]=d*o+b*l,e[3]=d*s+b*f,e}function b1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return e[0]=-r*s,e[1]=-n*s,e[2]=-i*s,e[3]=a*s,e}function y1e(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function P7(e,t){let r=t[0]+t[4]+t[8],n;if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);let a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(t[i*3+i]-t[a*3+a]-t[o*3+o]+1),e[i]=.5*n,n=.5/n,e[3]=(t[a*3+o]-t[o*3+a])*n,e[a]=(t[a*3+i]+t[i*3+a])*n,e[o]=(t[o*3+i]+t[i*3+o])*n}return e}var x1e=r1e;var _1e=n1e,w1e=s1e,E1e=u1e,A1e=i1e;var S1e=a1e;var T1e=o1e;var C1e=function(){let e=f8(),t=h8(1,0,0),r=h8(0,1,0);return function(n,i,a){let o=K1(i,a);return o<-.999999?(Cd(e,t,i),l7(e)<1e-6&&Cd(e,r,i),a7(e,e),O7(n,e,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Cd(e,i,a),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+o,T1e(n,n))}}(),tvr=function(){let e=h1e(),t=h1e();return function(r,n,i,a,o,s){return X1(e,n,o,s),X1(t,i,a,s),X1(r,e,t,2*s*(1-s)),r}}(),rvr=function(){let e=zxe();return function(t,r,n,i){return e[0]=n[0],e[3]=n[1],e[6]=n[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],T1e(t,P7(t,e))}}();var d3t=[0,0,0,1],ps=class extends bh{constructor(t=0,r=0,n=0,i=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,r,n,i)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,r,n,i){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return P7(this,t),this.check()}fromAxisRotation(t,r){return O7(this,t,r),this.check()}identity(){return p1e(this),this.check()}setAxisAngle(t,r){return this.fromAxisRotation(t,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=Ar(t)}get y(){return this[1]}set y(t){this[1]=Ar(t)}get z(){return this[2]}set z(t){this[2]=Ar(t)}get w(){return this[3]}set w(t){this[3]=Ar(t)}len(){return A1e(this)}lengthSquared(){return S1e(this)}dot(t){return w1e(this,t)}rotationTo(t,r){return C1e(this,t,r),this.check()}add(t){return x1e(this,this,t),this.check()}calculateW(){return v1e(this,this),this.check()}conjugate(){return y1e(this,this),this.check()}invert(){return b1e(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(E1e(this,t,r,n),this.check())}multiplyRight(t){return I7(this,this,t),this.check()}multiplyLeft(t){return I7(this,t,this),this.check()}normalize(){let t=this.len(),r=t>0?1/t:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,t===0&&(this[3]=1),this.check()}rotateX(t){return d1e(this,this,t),this.check()}rotateY(t){return m1e(this,this,t),this.check()}rotateZ(t){return g1e(this,this,t),this.check()}scale(t){return _1e(this,this,t),this.check()}slerp(t,r,n){let i,a,o;switch(arguments.length){case 1:({start:i=d3t,target:a,ratio:o}=t);break;case 2:i=this,a=t,o=r;break;default:i=t,a=r,o=n}return X1(this,i,a,o),this.check()}transformVector4(t,r=new hs){return l1e(r,t,this),yh(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,r){return this.setAxisAngle(t,r)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}};var fu={};ca(fu,{EPSILON1:()=>m3t,EPSILON10:()=>A3t,EPSILON11:()=>S3t,EPSILON12:()=>T3t,EPSILON13:()=>C3t,EPSILON14:()=>D3t,EPSILON15:()=>F3t,EPSILON16:()=>k3t,EPSILON17:()=>B3t,EPSILON18:()=>O3t,EPSILON19:()=>I3t,EPSILON2:()=>g3t,EPSILON20:()=>P3t,EPSILON3:()=>v3t,EPSILON4:()=>b3t,EPSILON5:()=>y3t,EPSILON6:()=>x3t,EPSILON7:()=>_3t,EPSILON8:()=>w3t,EPSILON9:()=>E3t,PI_OVER_FOUR:()=>j3t,PI_OVER_SIX:()=>L3t,PI_OVER_TWO:()=>R3t,TWO_PI:()=>M3t});var m3t=.1,g3t=.01,v3t=.001,b3t=1e-4,y3t=1e-5,x3t=1e-6,_3t=1e-7,w3t=1e-8,E3t=1e-9,A3t=1e-10,S3t=1e-11,T3t=1e-12,C3t=1e-13,D3t=1e-14,F3t=1e-15,k3t=1e-16,B3t=1e-17,O3t=1e-18,I3t=1e-19,P3t=1e-20,R3t=Math.PI/2,j3t=Math.PI/4,L3t=Math.PI/6,M3t=Math.PI*2;var Dl=6356752314245179e-9,q3t={radii:[6378137,6378137,Dl],radiiSquared:[6378137*6378137,6378137*6378137,Dl*Dl],oneOverRadii:[1/6378137,1/6378137,1/Dl],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Dl*Dl)],maximumRadius:Math.max(6378137,6378137,Dl),centerToleranceSquared:.1};function x8(e){return e}var Ivr=new ce;function N3t(e,t=[],r=x8){return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function D1e(e,t=[]){return N3t(e,t,Sn._cartographicRadians?x8:t7)}function U3t(e,t,r=x8){return"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):"x"in t?(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function F1e(e,t){return U3t(e,t,Sn._cartographicRadians?x8:r7)}var k1e=1e-14,G3t=new ce,B1e={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"}},R7={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Q1={east:new ce,north:new ce,up:new ce,west:new ce,south:new ce,down:new ce},z3t=new ce,H3t=new ce,W3t=new ce;function j7(e,t,r,n,i,a){let o=B1e[t]&&B1e[t][r];na(o&&(!n||n===o));let s,u,c,l=G3t.copy(i);if(Bo(l.x,0,k1e)&&Bo(l.y,0,k1e)){let h=Math.sign(l.z);s=z3t.fromArray(R7[t]),t!=="east"&&t!=="west"&&s.scale(h),u=H3t.fromArray(R7[r]),r!=="east"&&r!=="west"&&u.scale(h),c=W3t.fromArray(R7[n]),n!=="east"&&n!=="west"&&c.scale(h)}else{let{up:h,east:p,north:d}=Q1;p.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,h),d.copy(h).cross(p);let{down:b,west:g,south:x}=Q1;b.copy(h).scale(-1),g.copy(p).scale(-1),x.copy(d).scale(-1),s=Q1[t],u=Q1[r],c=Q1[n]}return a[0]=s.x,a[1]=s.y,a[2]=s.z,a[3]=0,a[4]=u.x,a[5]=u.y,a[6]=u.z,a[7]=0,a[8]=c.x,a[9]=c.y,a[10]=c.z,a[11]=0,a[12]=l.x,a[13]=l.y,a[14]=l.z,a[15]=1,a}var vv=new ce,V3t=new ce,K3t=new ce;function O1e(e,t,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:i,centerToleranceSquared:a}=t;vv.from(e);let o=vv.x,s=vv.y,u=vv.z,c=n.x,l=n.y,f=n.z,h=o*o*c*c,p=s*s*l*l,d=u*u*f*f,b=h+p+d,g=Math.sqrt(1/b);if(!Number.isFinite(g))return;let x=V3t;if(x.copy(e).scale(g),b<a)return x.to(r);let E=i.x,S=i.y,F=i.z,D=K3t;D.set(x.x*E*2,x.y*S*2,x.z*F*2);let j=(1-g)*vv.len()/(.5*D.len()),k=0,N,C,I,P;do{j-=k,N=1/(1+j*E),C=1/(1+j*S),I=1/(1+j*F);let U=N*N,Y=C*C,J=I*I,re=U*N,ee=Y*C,ge=J*I;P=h*U+p*Y+d*J-1;let pe=-2*(h*re*E+p*ee*S+d*ge*F);k=P/pe}while(Math.abs(P)>fu.EPSILON12);return vv.scale([N,C,I]).to(r)}var _8=new ce,I1e=new ce,J3t=new ce,hu=new ce,X3t=new ce,w8=new ce,or=class{constructor(t=0,r=0,n=0){zt(this,"radii",void 0),zt(this,"radiiSquared",void 0),zt(this,"radiiToTheFourth",void 0),zt(this,"oneOverRadii",void 0),zt(this,"oneOverRadiiSquared",void 0),zt(this,"minimumRadius",void 0),zt(this,"maximumRadius",void 0),zt(this,"centerToleranceSquared",fu.EPSILON1),zt(this,"squaredXOverSquaredZ",void 0),na(t>=0),na(r>=0),na(n>=0),this.radii=new ce(t,r,n),this.radiiSquared=new ce(t*t,r*r,n*n),this.radiiToTheFourth=new ce(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new ce(t===0?0:1/t,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new ce(t===0?0:1/(t*t),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,r=[0,0,0]){let n=I1e,i=J3t,[,,a]=t;this.geodeticSurfaceNormalCartographic(t,n),i.copy(this.radiiSquared).scale(n);let o=Math.sqrt(n.dot(i));return i.scale(1/o),n.scale(a),i.add(n),i.to(r)}cartesianToCartographic(t,r=[0,0,0]){w8.from(t);let n=this.scaleToGeodeticSurface(w8,hu);if(!n)return;let i=this.geodeticSurfaceNormal(n,I1e),a=X3t;a.copy(w8).subtract(n);let o=Math.atan2(i.y,i.x),s=Math.asin(i.z),u=Math.sign(mv.dot(a,w8))*mv.length(a);return F1e([o,s,u],r)}eastNorthUpToFixedFrame(t,r=new Kr){return j7(this,"east","north","up",t,r)}localFrameToFixedFrame(t,r,n,i,a=new Kr){return j7(this,t,r,n,i,a)}geocentricSurfaceNormal(t,r=[0,0,0]){return _8.from(t).normalize().to(r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=D1e(t),i=n[0],a=n[1],o=Math.cos(a);return _8.set(o*Math.cos(i),o*Math.sin(i),Math.sin(a)).normalize(),_8.to(r)}geodeticSurfaceNormal(t,r=[0,0,0]){return _8.from(t).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(t,r){return O1e(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){hu.from(t);let n=hu.x,i=hu.y,a=hu.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(n*n*o.x+i*i*o.y+a*a*o.z);return hu.multiplyScalar(s).to(r)}transformPositionToScaledSpace(t,r=[0,0,0]){return hu.from(t).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(t,r=[0,0,0]){return hu.from(t).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){na(Bo(this.radii.x,this.radii.y,fu.EPSILON15)),na(this.radii.z>0),hu.from(t);let i=hu.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-r))return hu.set(0,0,i).to(n)}};zt(or,"WGS84",new or(6378137,6378137,Dl));var ia={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var ebr=new ce,tbr=new ce;var Z1=new ce,P1e=new ce,Ya=class{constructor(t=[0,0,0],r=0){zt(this,"center",void 0),zt(this,"radius",void 0),this.radius=-0,this.center=new ce,this.fromCenterRadius(t,r)}fromCenterRadius(t,r){return this.center.from(t),this.radius=r,this}fromCornerPoints(t,r){return r=Z1.from(r),this.center=new ce().from(t).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new Ya(this.center,this.radius)}union(t){let r=this.center,n=this.radius,i=t.center,a=t.radius,o=Z1.copy(i).subtract(r),s=o.magnitude();if(n>=s+a)return this.clone();if(a>=s+n)return t.clone();let u=(n+s+a)*.5;return P1e.copy(o).scale((-n+u)/s).add(r),this.center.copy(P1e),this.radius=u,this}expand(t){let n=Z1.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=v8.getScaling(Z1,t);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(t){let r=this.distanceTo(t);return r*r}distanceTo(t){let n=Z1.from(t).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(t){let r=this.center,n=this.radius,a=t.normal.dot(r)+t.distance;return a<-n?ia.OUTSIDE:a<n?ia.INTERSECTING:ia.INSIDE}};var Q3t=new ce,Z3t=new ce,E8=new ce,A8=new ce,S8=new ce,eCt=new ce,tCt=new ce,Fl={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},aa=class{constructor(t=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){zt(this,"center",void 0),zt(this,"halfAxes",void 0),this.center=new ce().from(t),this.halfAxes=new Rr(r)}get halfSize(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new ce(t).len(),new ce(r).len(),new ce(n).len()]}get quaternion(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),i=new ce(t).normalize(),a=new ce(r).normalize(),o=new ce(n).normalize();return new ps().fromMatrix3(new Rr([...i,...a,...o]))}fromCenterHalfSizeQuaternion(t,r,n){let i=new ps(n),a=new Rr().fromQuaternion(i);return a[0]=a[0]*r[0],a[1]=a[1]*r[0],a[2]=a[2]*r[0],a[3]=a[3]*r[1],a[4]=a[4]*r[1],a[5]=a[5]*r[1],a[6]=a[6]*r[2],a[7]=a[7]*r[2],a[8]=a[8]*r[2],this.center=new ce().from(t),this.halfAxes=a,this}clone(){return new aa(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new Ya){let r=this.halfAxes,n=r.getColumn(0,E8),i=r.getColumn(1,A8),a=r.getColumn(2,S8),o=Q3t.copy(n).add(i).add(a);return t.center.copy(this.center),t.radius=o.magnitude(),t}intersectPlane(t){let r=this.center,n=t.normal,i=this.halfAxes,a=n.x,o=n.y,s=n.z,u=Math.abs(a*i[Fl.COLUMN0ROW0]+o*i[Fl.COLUMN0ROW1]+s*i[Fl.COLUMN0ROW2])+Math.abs(a*i[Fl.COLUMN1ROW0]+o*i[Fl.COLUMN1ROW1]+s*i[Fl.COLUMN1ROW2])+Math.abs(a*i[Fl.COLUMN2ROW0]+o*i[Fl.COLUMN2ROW1]+s*i[Fl.COLUMN2ROW2]),c=n.dot(r)+t.distance;return c<=-u?ia.OUTSIDE:c>=u?ia.INSIDE:ia.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=Z3t.from(t).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,E8),a=n.getColumn(1,A8),o=n.getColumn(2,S8),s=i.magnitude(),u=a.magnitude(),c=o.magnitude();i.normalize(),a.normalize(),o.normalize();let l=0,f;return f=Math.abs(r.dot(i))-s,f>0&&(l+=f*f),f=Math.abs(r.dot(a))-u,f>0&&(l+=f*f),f=Math.abs(r.dot(o))-c,f>0&&(l+=f*f),l}computePlaneDistances(t,r,n=[-0,-0]){let i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=this.center,s=this.halfAxes,u=s.getColumn(0,E8),c=s.getColumn(1,A8),l=s.getColumn(2,S8),f=eCt.copy(u).add(c).add(l).add(o),h=tCt.copy(f).subtract(t),p=r.dot(h);return i=Math.min(p,i),a=Math.max(p,a),f.copy(o).add(u).add(c).subtract(l),h.copy(f).subtract(t),p=r.dot(h),i=Math.min(p,i),a=Math.max(p,a),f.copy(o).add(u).subtract(c).add(l),h.copy(f).subtract(t),p=r.dot(h),i=Math.min(p,i),a=Math.max(p,a),f.copy(o).add(u).subtract(c).subtract(l),h.copy(f).subtract(t),p=r.dot(h),i=Math.min(p,i),a=Math.max(p,a),o.copy(f).subtract(u).add(c).add(l),h.copy(f).subtract(t),p=r.dot(h),i=Math.min(p,i),a=Math.max(p,a),o.copy(f).subtract(u).add(c).subtract(l),h.copy(f).subtract(t),p=r.dot(h),i=Math.min(p,i),a=Math.max(p,a),o.copy(f).subtract(u).subtract(c).add(l),h.copy(f).subtract(t),p=r.dot(h),i=Math.min(p,i),a=Math.max(p,a),o.copy(f).subtract(u).subtract(c).subtract(l),h.copy(f).subtract(t),p=r.dot(h),i=Math.min(p,i),a=Math.max(p,a),n[0]=i,n[1]=a,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,E8);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,A8);n.transformAsPoint(t);let i=this.halfAxes.getColumn(2,S8);return i.transformAsPoint(t),this.halfAxes=new Rr([...r,...n,...i]),this}getTransform(){throw new Error("not implemented")}};var R1e=new ce,j1e=new ce,kl=class{constructor(t=[0,0,1],r=0){zt(this,"normal",void 0),zt(this,"distance",void 0),this.normal=new ce,this.distance=-0,this.fromNormalDistance(t,r)}fromNormalDistance(t,r){return na(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=R1e.from(t),this.normal.from(r).normalize();let n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,r,n,i){return this.normal.set(t,r,n),na(Bo(this.normal.len(),1)),this.distance=i,this}clone(){return new kl(this.normal,this.distance)}equals(t){return Bo(this.distance,t.distance)&&Bo(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=j1e.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,r)}projectPointOntoPlane(t,r=[0,0,0]){let n=R1e.from(t),i=this.getPointDistance(n),a=j1e.copy(this.normal).scale(i);return n.subtract(a).to(r)}};var L1e=[new ce([1,0,0]),new ce([0,1,0]),new ce([0,0,1])],M1e=new ce,rCt=new ce,ds=class{constructor(t=[]){zt(this,"planes",void 0),this.planes=t}fromBoundingSphere(t){this.planes.length=2*L1e.length;let r=t.center,n=t.radius,i=0;for(let a of L1e){let o=this.planes[i],s=this.planes[i+1];o||(o=this.planes[i]=new kl),s||(s=this.planes[i+1]=new kl);let u=M1e.copy(a).scale(-n).add(r);o.fromPointNormal(u,a);let c=M1e.copy(a).scale(n).add(r),l=rCt.copy(a).negate();s.fromPointNormal(c,l),i+=2}return this}computeVisibility(t){let r=ia.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case ia.OUTSIDE:return ia.OUTSIDE;case ia.INTERSECTING:r=ia.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(na(Number.isFinite(r),"parentPlaneMask is required."),r===ds.MASK_OUTSIDE||r===ds.MASK_INSIDE)return r;let n=ds.MASK_INSIDE,i=this.planes;for(let a=0;a<this.planes.length;++a){let o=a<31?1<<a:0;if(a<31&&!(r&o))continue;let s=i[a],u=t.intersectPlane(s);if(u===ia.OUTSIDE)return ds.MASK_OUTSIDE;u===ia.INTERSECTING&&(n|=o)}return n}};zt(ds,"MASK_OUTSIDE",4294967295);zt(ds,"MASK_INSIDE",0);zt(ds,"MASK_INDETERMINATE",2147483647);var Abr=new ce,Sbr=new ce,Tbr=new ce,Cbr=new ce,Dbr=new ce;var iCt=new ce,aCt=new ce,oCt=new ce,sCt=new ce,uCt=new ce,cCt=new ce,lCt=new ce,bv=new ce,fCt=new ce,hCt=new ce,pCt=new ce,dCt=new ce;function L7(e,t=new Ya){if(!e||e.length===0)return t.fromCenterRadius([0,0,0],0);let r=lCt.copy(e[0]),n=iCt.copy(r),i=aCt.copy(r),a=oCt.copy(r),o=sCt.copy(r),s=uCt.copy(r),u=cCt.copy(r);for(let j of e){r.copy(j);let k=r.x,N=r.y,C=r.z;k<n.x&&n.copy(r),k>o.x&&o.copy(r),N<i.y&&i.copy(r),N>s.y&&s.copy(r),C<a.z&&a.copy(r),C>u.z&&u.copy(r)}let c=bv.copy(o).subtract(n).magnitudeSquared(),l=bv.copy(s).subtract(i).magnitudeSquared(),f=bv.copy(u).subtract(a).magnitudeSquared(),h=n,p=o,d=c;l>d&&(d=l,h=i,p=s),f>d&&(d=f,h=a,p=u);let b=fCt;b.x=(h.x+p.x)*.5,b.y=(h.y+p.y)*.5,b.z=(h.z+p.z)*.5;let g=bv.copy(p).subtract(b).magnitudeSquared(),x=Math.sqrt(g),E=hCt;E.x=n.x,E.y=i.y,E.z=a.z;let S=pCt;S.x=o.x,S.y=s.y,S.z=u.z;let F=dCt.copy(E).add(S).multiplyByScalar(.5),D=0;for(let j of e){r.copy(j);let k=bv.copy(r).subtract(F).magnitude();k>D&&(D=k);let N=bv.copy(r).subtract(b).magnitudeSquared();if(N>g){let C=Math.sqrt(N);x=(x+C)*.5,g=x*x;let I=C-x;b.x=(x*b.x+I*r.x)/C,b.y=(x*b.y+I*r.y)/C,b.z=(x*b.z+I*r.z)/C}}return x<D?(b.to(t.center),t.radius=x):(F.to(t.center),t.radius=D),t}var bc=new Rr,mCt=new Rr,gCt=new Rr,T8=new Rr,q1e=new Rr;function N7(e,t={}){let r=fu.EPSILON20,n=10,i=0,a=0,o=mCt,s=gCt;o.identity(),s.copy(e);let u=r*vCt(s);for(;a<n&&bCt(s)>u;)yCt(s,T8),q1e.copy(T8).transpose(),s.multiplyRight(T8),s.multiplyLeft(q1e),o.multiplyRight(T8),++i>2&&(++a,i=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=s.toTarget(t.diagonal),t}function vCt(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var M7=[1,0,0],q7=[2,2,1];function bCt(e){let t=0;for(let r=0;r<3;++r){let n=e[bc.getElementIndex(q7[r],M7[r])];t+=2*n*n}return Math.sqrt(t)}function yCt(e,t){let r=fu.EPSILON15,n=0,i=1;for(let c=0;c<3;++c){let l=Math.abs(e[bc.getElementIndex(q7[c],M7[c])]);l>n&&(i=c,n=l)}let a=M7[i],o=q7[i],s=1,u=0;if(Math.abs(e[bc.getElementIndex(o,a)])>r){let c=e[bc.getElementIndex(o,o)],l=e[bc.getElementIndex(a,a)],f=e[bc.getElementIndex(o,a)],h=(c-l)/2/f,p;h<0?p=-1/(-h+Math.sqrt(1+h*h)):p=1/(h+Math.sqrt(1+h*h)),s=1/Math.sqrt(1+p*p),u=p*s}return Rr.IDENTITY.to(t),t[bc.getElementIndex(a,a)]=t[bc.getElementIndex(o,o)]=s,t[bc.getElementIndex(o,a)]=u,t[bc.getElementIndex(a,o)]=-u,t}var _h=new ce,_Ct=new ce,wCt=new ce,ECt=new ce,ACt=new ce,SCt=new Rr,TCt={diagonal:new Rr,unitary:new Rr};function e_(e,t=new aa){if(!e||e.length===0)return t.halfAxes=new Rr([0,0,0,0,0,0,0,0,0]),t.center=new ce,t;let r=e.length,n=new ce(0,0,0);for(let C of e)n.add(C);let i=1/r;n.multiplyByScalar(i);let a=0,o=0,s=0,u=0,c=0,l=0;for(let C of e){let I=_h.copy(C).subtract(n);a+=I.x*I.x,o+=I.x*I.y,s+=I.x*I.z,u+=I.y*I.y,c+=I.y*I.z,l+=I.z*I.z}a*=i,o*=i,s*=i,u*=i,c*=i,l*=i;let f=SCt;f[0]=a,f[1]=o,f[2]=s,f[3]=o,f[4]=u,f[5]=c,f[6]=s,f[7]=c,f[8]=l;let{unitary:h}=N7(f,TCt),p=t.halfAxes.copy(h),d=p.getColumn(0,wCt),b=p.getColumn(1,ECt),g=p.getColumn(2,ACt),x=-Number.MAX_VALUE,E=-Number.MAX_VALUE,S=-Number.MAX_VALUE,F=Number.MAX_VALUE,D=Number.MAX_VALUE,j=Number.MAX_VALUE;for(let C of e)_h.copy(C),x=Math.max(_h.dot(d),x),E=Math.max(_h.dot(b),E),S=Math.max(_h.dot(g),S),F=Math.min(_h.dot(d),F),D=Math.min(_h.dot(b),D),j=Math.min(_h.dot(g),j);d=d.multiplyByScalar(.5*(F+x)),b=b.multiplyByScalar(.5*(D+E)),g=g.multiplyByScalar(.5*(j+S)),t.center.copy(d).add(b).add(g);let k=_Ct.set(x-F,E-D,S-j).multiplyByScalar(.5),N=new Rr([k[0],0,0,0,k[1],0,0,0,k[2]]);return t.halfAxes.multiplyRight(N),t}function z1e(e){return e!=null}var syr=new ce,CCt=new ce,DCt=new ce,FCt=new ce,Fd=new ce,N1e=new ce,U1e=new ce,G1e=new ce;function C8(e,t,r){if(Qt(e,"3D Tile: boundingVolume must be defined"),e.box)return H1e(e.box,t,r);if(e.region)return BCt(e.region);if(e.sphere)return kCt(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function H1e(e,t,r){let n=new ce(e[0],e[1],e[2]);t.transform(n,n);let i=[];if(e.length===10){let c=e.slice(3,6),l=new ps;l.fromArray(e,6);let f=new ce([1,0,0]),h=new ce([0,1,0]),p=new ce([0,0,1]);f.transformByQuaternion(l),f.scale(c[0]),h.transformByQuaternion(l),h.scale(c[1]),p.transformByQuaternion(l),p.scale(c[2]),i=[...f.toArray(),...h.toArray(),...p.toArray()]}else i=[...e.slice(3,6),...e.slice(6,9),...e.slice(9,12)];let a=t.transformAsVector(i.slice(0,3)),o=t.transformAsVector(i.slice(3,6)),s=t.transformAsVector(i.slice(6,9)),u=new Rr([a[0],a[1],a[2],o[0],o[1],o[2],s[0],s[1],s[2]]);return z1e(r)?(r.center=n,r.halfAxes=u,r):new aa(n,u)}function kCt(e,t,r){let n=new ce(e[0],e[1],e[2]);t.transform(n,n);let i=t.getScale(CCt),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return z1e(r)?(r.center=n,r.radius=o,r):new Ya(n,o)}function BCt(e){let[t,r,n,i,a,o]=e,s=or.WGS84.cartographicToCartesian([Cl(t),Cl(i),a],DCt),u=or.WGS84.cartographicToCartesian([Cl(n),Cl(r),o],FCt),c=new ce().addVectors(s,u).multiplyByScalar(.5);return or.WGS84.cartesianToCartographic(c,Fd),or.WGS84.cartographicToCartesian([Cl(n),Fd[1],Fd[2]],N1e),or.WGS84.cartographicToCartesian([Fd[0],Cl(i),Fd[2]],U1e),or.WGS84.cartographicToCartesian([Fd[0],Fd[1],o],G1e),H1e([...c,...N1e.subtract(c),...U1e.subtract(c),...G1e.subtract(c)],new Kr)}var yv="4.0.0";var ms={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},hyr=Object.keys(ms),wh={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function U7(e,t,r){Qt(e instanceof ArrayBuffer);let n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}function W1e(e,t=0){let r=new DataView(e);return`${String.fromCharCode(r.getUint8(t+0))}${String.fromCharCode(r.getUint8(t+1))}${String.fromCharCode(r.getUint8(t+2))}${String.fromCharCode(r.getUint8(t+3))}`}var D8="4.0.0";var OCt={draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},V1e={name:"Draco",id:"draco",module:"draco",version:D8,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:OCt};function K1e(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 G7(e){let t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length;for(let c=0;c<u;c+=3){let l=s[c],f=s[c+1],h=s[c+2];t=l<t?l:t,r=f<r?f:r,n=h<n?h:n,i=l>i?l:i,a=f>a?f:a,o=h>o?h:o}return[[t,r,n],[i,a,o]]}function z7(e,t,r){let n=K1e(t.value),i=r||$1e(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:i}}function $1e(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),t}function J1e(e,t,r){let n=X1e(t.metadata),i=[],a=ICt(t.attributes);for(let o in e){let s=e[o],u=Y1e(o,s,a[o]);i.push(u)}if(r){let o=Y1e("indices",r);i.push(o)}return{fields:i,metadata:n}}function ICt(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function Y1e(e,t,r){let n=r?X1e(r.metadata):void 0;return z7(e,t,n)}function X1e(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var Q1e={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},PCt={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},RCt=4,t_=class{draco;decoder;metadataQuerier;constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,r={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(r);let i=this.decoder.GetEncodedGeometryType(n),a=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(i){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(n,a);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(n,a);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!a.ptr){let h=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(h)}let s=this._getDracoLoaderData(a,i,r),u=this._getMeshData(a,s,r),c=G7(u.attributes),l=J1e(u.attributes,s,u.indices);return{loader:"draco",loaderData:s,header:{vertexCount:a.num_points(),boundingBox:c},...u,schema:l}}finally{this.draco.destroy(n),a&&this.draco.destroy(a)}}_getDracoLoaderData(t,r,n){let i=this._getTopLevelMetadata(t),a=this._getDracoAttributes(t,n);return{geometry_type:r,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:i,attributes:a}}_getDracoAttributes(t,r){let n={};for(let i=0;i<t.num_attributes();i++){let a=this.decoder.GetAttribute(t,i),o=this._getAttributeMetadata(t,i);n[a.unique_id()]={unique_id:a.unique_id(),attribute_type:a.attribute_type(),data_type:a.data_type(),num_components:a.num_components(),byte_offset:a.byte_offset(),byte_stride:a.byte_stride(),normalized:a.normalized(),attribute_index:i,metadata:o};let s=this._getQuantizationTransform(a,r);s&&(n[a.unique_id()].quantization_transform=s);let u=this._getOctahedronTransform(a,r);u&&(n[a.unique_id()].octahedron_transform=u)}return n}_getMeshData(t,r,n){let i=this._getMeshAttributes(r,t,n);if(!i.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(n.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:i,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:i,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:i}}_getMeshAttributes(t,r,n){let i={};for(let a of Object.values(t.attributes)){let o=this._deduceAttributeName(a,n);a.name=o;let{value:s,size:u}=this._getAttributeValues(r,a);i[o]={value:s,size:u,byteOffset:a.byte_offset,byteStride:a.byte_stride,normalized:a.normalized}}return i}_getTriangleListIndices(t){let n=t.num_faces()*3,i=n*RCt,a=this.draco._malloc(i);try{return this.decoder.GetTrianglesUInt32Array(t,i,a),new Uint32Array(this.draco.HEAPF32.buffer,a,n).slice()}finally{this.draco._free(a)}}_getTriangleStripIndices(t){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,r),MCt(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=PCt[r.data_type],i=r.num_components,o=t.num_points()*i,s=o*n.BYTES_PER_ELEMENT,u=jCt(this.draco,n),c,l=this.draco._malloc(s);try{let f=this.decoder.GetAttribute(t,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,f,u,s,l),c=new n(this.draco.HEAPF32.buffer,l,o).slice()}finally{this.draco._free(l)}return{value:c,size:i}}_deduceAttributeName(t,r){let n=t.unique_id;for(let[o,s]of Object.entries(r.extraAttributes||{}))if(s===n)return o;let i=t.attribute_type;for(let o in Q1e)if(this.draco[o]===i)return Q1e[o];let a=r.attributeNameEntry||"name";return t.metadata[a]?t.metadata[a].string:`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(t){let r=this.decoder.GetMetadata(t);return this._getDracoMetadata(r)}_getAttributeMetadata(t,r){let n=this.decoder.GetAttributeMetadata(t,r);return this._getDracoMetadata(n)}_getDracoMetadata(t){if(!t||!t.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(t);for(let i=0;i<n;i++){let a=this.metadataQuerier.GetEntryName(t,i);r[a]=this._getDracoMetadataField(t,a)}return r}_getDracoMetadataField(t,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,r,n);let i=LCt(n);return{int:this.metadataQuerier.GetIntEntry(t,r),string:this.metadataQuerier.GetStringEntry(t,r),double:this.metadataQuerier.GetDoubleEntry(t,r),intArray:i}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(t){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=t,i=[...r,...n];for(let a of i)this.decoder.SkipAttributeTransform(this.draco[a])}_getQuantizationTransform(t,r){let{quantizedAttributes:n=[]}=r,i=t.attribute_type();if(n.map(o=>this.decoder[o]).includes(i)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(t))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(t,r){let{octahedronAttributes:n=[]}=r,i=t.attribute_type();if(n.map(o=>this.decoder[o]).includes(i)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(t))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}};function jCt(e,t){switch(t){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 LCt(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function MCt(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}var qCt="1.5.6",NCt="1.4.1",H7=`https://www.gstatic.com/draco/versioned/decoders/${qCt}`,ii={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},Eh={[ii.DECODER]:`${H7}/${ii.DECODER}`,[ii.DECODER_WASM]:`${H7}/${ii.DECODER_WASM}`,[ii.FALLBACK_DECODER]:`${H7}/${ii.FALLBACK_DECODER}`,[ii.ENCODER]:`https://raw.githubusercontent.com/google/draco/${NCt}/javascript/${ii.ENCODER}`},r_;async function Z1e(e){let t=e.modules||{};return t.draco3d?r_=r_||t.draco3d.createDecoderModule({}).then(r=>({draco:r})):r_=r_||UCt(e),await r_}async function UCt(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await Qu(Eh[ii.FALLBACK_DECODER],"draco",e,ii.FALLBACK_DECODER);break;case"wasm":default:[t,r]=await Promise.all([await Qu(Eh[ii.DECODER],"draco",e,ii.DECODER),await Qu(Eh[ii.DECODER_WASM],"draco",e,ii.DECODER_WASM)])}return t=t||globalThis.DracoDecoderModule,await GCt(t,r)}function GCt(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e({...r,onModuleLoaded:i=>n({draco:i})})})}var W7={id:"draco-writer",name:"Draco compressed geometry writer",module:"draco",version:D8,worker:!0,options:{draco:{},source:null}};var xv={...V1e,parse:zCt};async function zCt(e,t){let{draco:r}=await Z1e(t),n=new t_(r);try{return n.parseSync(e,t==null?void 0:t.draco)}finally{n.destroy()}}var HCt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},vi={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},Ht={...HCt,...vi};var V7={[vi.DOUBLE]:Float64Array,[vi.FLOAT]:Float32Array,[vi.UNSIGNED_SHORT]:Uint16Array,[vi.UNSIGNED_INT]:Uint32Array,[vi.UNSIGNED_BYTE]:Uint8Array,[vi.BYTE]:Int8Array,[vi.SHORT]:Int16Array,[vi.INT]:Int32Array},WCt={DOUBLE:vi.DOUBLE,FLOAT:vi.FLOAT,UNSIGNED_SHORT:vi.UNSIGNED_SHORT,UNSIGNED_INT:vi.UNSIGNED_INT,UNSIGNED_BYTE:vi.UNSIGNED_BYTE,BYTE:vi.BYTE,SHORT:vi.SHORT,INT:vi.INT},K7="Failed to convert GL type",La=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in V7)if(V7[r]===t)return r;throw new Error(K7)}static fromName(t){let r=WCt[t];if(!r)throw new Error(K7);return r}static getArrayType(t){switch(t){case vi.UNSIGNED_SHORT_5_6_5:case vi.UNSIGNED_SHORT_4_4_4_4:case vi.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=V7[t];if(!r)throw new Error(K7);return r}}static getByteSize(t){return La.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(La.getArrayType(t))}static createTypedArray(t,r,n=0,i){i===void 0&&(i=(r.byteLength-n)/La.getByteSize(t));let a=La.getArrayType(t);return new a(r,n,i)}};function e_e(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function $7(e,t=[0,0,0]){let r=e>>11&31,n=e>>5&63,i=e&31;return t[0]=r<<3,t[1]=n<<2,t[2]=i<<3,t}var Yyr=1/256;var Jyr=new Td,Xyr=new ce,Qyr=new Td,Zyr=new Td,exr=new Uint8Array(1);function t_e(e,t=255){return n7(e,0,t)/t*2-1}function r_e(e){return e<0?-1:1}function n_e(e,t,r,n){if(e_e(n),e<0||e>r||t<0||t>r)throw new Error(`x and y must be unsigned normalized integers between 0 and ${r}`);if(n.x=t_e(e,r),n.y=t_e(t,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){let i=n.x;n.x=(1-Math.abs(n.y))*r_e(i),n.y=(1-Math.abs(i))*r_e(n.y)}return n.normalize()}function Y7(e,t,r){return n_e(e,t,255,r)}function kd(e){return(e%1+1)%1}var Bl=class{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(t,r){this.json=t,this.buffer=r}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t,r=Ht.UNSIGNED_INT,n=1){let i=this.json[t];return i&&Number.isFinite(i.byteOffset)?this._getTypedArrayFromBinary(t,r,n,1,i.byteOffset):i}getPropertyArray(t,r,n){let i=this.json[t];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(r=La.fromName(i.componentType)),this._getTypedArrayFromBinary(t,r,n,this.featuresLength,i.byteOffset)):this._getTypedArrayFromArray(t,r,i)}getProperty(t,r,n,i,a){let o=this.json[t];if(!o)return o;let s=this.getPropertyArray(t,r,n);if(n===1)return s[i];for(let u=0;u<n;++u)a[u]=s[n*i+u];return a}_getTypedArrayFromBinary(t,r,n,i,a){let o=this._cachedTypedArrays,s=o[t];return s||(s=La.createTypedArray(r,this.buffer.buffer,this.buffer.byteOffset+a,i*n),o[t]=s),s}_getTypedArrayFromArray(t,r,n){let i=this._cachedTypedArrays,a=i[t];return a||(a=La.createTypedArray(r,n),i[t]=a),a}};var VCt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},KCt={SCALAR:(e,t)=>e[t],VEC2:(e,t)=>[e[2*t+0],e[2*t+1]],VEC3:(e,t)=>[e[3*t+0],e[3*t+1],e[3*t+2]],VEC4:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT2:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT3:(e,t)=>[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]],MAT4:(e,t)=>[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]},$Ct={SCALAR:(e,t,r)=>{t[r]=e},VEC2:(e,t,r)=>{t[2*r+0]=e[0],t[2*r+1]=e[1]},VEC3:(e,t,r)=>{t[3*r+0]=e[0],t[3*r+1]=e[1],t[3*r+2]=e[2]},VEC4:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT2:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT3:(e,t,r)=>{t[9*r+0]=e[0],t[9*r+1]=e[1],t[9*r+2]=e[2],t[9*r+3]=e[3],t[9*r+4]=e[4],t[9*r+5]=e[5],t[9*r+6]=e[6],t[9*r+7]=e[7],t[9*r+8]=e[8],t[9*r+9]=e[9]},MAT4:(e,t,r)=>{t[16*r+0]=e[0],t[16*r+1]=e[1],t[16*r+2]=e[2],t[16*r+3]=e[3],t[16*r+4]=e[4],t[16*r+5]=e[5],t[16*r+6]=e[6],t[16*r+7]=e[7],t[16*r+8]=e[8],t[16*r+9]=e[9],t[16*r+10]=e[10],t[16*r+11]=e[11],t[16*r+12]=e[12],t[16*r+13]=e[13],t[16*r+14]=e[14],t[16*r+15]=e[15]}};function i_e(e,t,r,n){let{componentType:i}=e;Qt(e.componentType);let a=typeof i=="string"?La.fromName(i):i,o=VCt[e.type],s=KCt[e.type],u=$Ct[e.type];return r+=e.byteOffset,{values:La.createTypedArray(a,t,r,o*n),type:a,size:o,unpacker:s,packer:u}}var yc=e=>e!==void 0;function a_e(e,t,r){if(!t)return null;let n=e.getExtension("3DTILES_batch_table_hierarchy"),i=t.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?YCt(n,r):null}function YCt(e,t){let r,n,i,a=e.instancesLength,o=e.classes,s=e.classIds,u=e.parentCounts,c=e.parentIds,l=a;yc(s.byteOffset)&&(s.componentType=defaultValue(s.componentType,GL.UNSIGNED_SHORT),s.type=AttributeType.SCALAR,i=getBinaryAccessor(s),s=i.createArrayBufferView(t.buffer,t.byteOffset+s.byteOffset,a));let f;if(yc(u))for(yc(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,a)),f=new Uint16Array(a),l=0,r=0;r<a;++r)f[r]=l,l+=u[r];yc(c)&&yc(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,l));let h=o.length;for(r=0;r<h;++r){let g=o[r].length,x=o[r].instances,E=getBinaryProperties(g,x,t);o[r].instances=combine(E,x)}let p=new Array(h).fill(0),d=new Uint16Array(a);for(r=0;r<a;++r)n=s[r],d[r]=p[n],++p[n];let b={classes:o,classIds:s,classIndexes:d,parentCounts:u,parentIndexes:f,parentIds:c};return QCt(b),b}function _v(e,t,r){if(!e)return;let n=e.parentCounts;return e.parentIds?r(e,t):n>0?JCt(e,t,r):XCt(e,t,r)}function JCt(e,t,r){let n=e.classIds,i=e.parentCounts,a=e.parentIds,o=e.parentIndexes,s=n.length,u=scratchVisited;u.length=Math.max(u.length,s);let c=++marker,l=scratchStack;for(l.length=0,l.push(t);l.length>0;){if(t=l.pop(),u[t]===c)continue;u[t]=c;let f=r(e,t);if(yc(f))return f;let h=i[t],p=o[t];for(let d=0;d<h;++d){let b=a[p+d];b!==t&&l.push(b)}}return null}function XCt(e,t,r){let n=!0;for(;n;){let i=r(e,t);if(yc(i))return i;let a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}function QCt(e){let t=[],n=e.classIds.length;for(let i=0;i<n;++i)o_e(e,i,stack)}function o_e(e,t,r){let n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,s=e.classIds.length;if(!yc(i))return;assert(t<s,`Parent index ${t} exceeds the total number of instances: ${s}`),assert(r.indexOf(t)===-1,"Circular dependency detected in the batch table hierarchy."),r.push(t);let u=yc(n)?n[t]:1,c=yc(n)?a[t]:t;for(let l=0;l<u;++l){let f=i[c+l];f!==t&&o_e(e,f,r)}r.pop(t)}function po(e){return e!=null}var F8=(e,t)=>e,ZCt={HIERARCHY:!0,extensions:!0,extras:!0},Bd=class{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(t,r,n,i={}){var a;Qt(n>=0),this.json=t||{},this.binary=r,this.featureCount=n,this._extensions=((a=this.json)==null?void 0:a.extensions)||{},this._properties={};for(let o in this.json)ZCt[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),i["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=a_e(this,this.json,this.binary))}getExtension(t){return this.json&&this.json.extensions&&this.json.extensions[t]}memorySizeInBytes(){return 0}isClass(t,r){if(this._checkBatchId(t),Qt(typeof r=="string",r),this._hierarchy){let n=_v(this._hierarchy,t,(i,a)=>{let o=i.classIds[a];return i.classes[o].name===r});return po(n)}return!1}isExactClass(t,r){return Qt(typeof r=="string",r),this.getExactClassName(t)===r}getExactClassName(t){if(this._checkBatchId(t),this._hierarchy){let r=this._hierarchy.classIds[t];return this._hierarchy.classes[r].name}}hasProperty(t,r){return this._checkBatchId(t),Qt(typeof r=="string",r),po(this._properties[r])||this._hasPropertyInHierarchy(t,r)}getPropertyNames(t,r){this._checkBatchId(t),r=po(r)?r:[],r.length=0;let n=Object.keys(this._properties);return r.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(t,r),r}getProperty(t,r){if(this._checkBatchId(t),Qt(typeof r=="string",r),this._binaryProperties){let i=this._binaryProperties[r];if(po(i))return this._getBinaryProperty(i,t)}let n=this._properties[r];if(po(n))return F8(n[t],!0);if(this._hierarchy){let i=this._getHierarchyProperty(t,r);if(po(i))return i}}setProperty(t,r,n){let i=this.featureCount;if(this._checkBatchId(t),Qt(typeof r=="string",r),this._binaryProperties){let o=this._binaryProperties[r];if(o){this._setBinaryProperty(o,t,n);return}}if(this._hierarchy&&this._setHierarchyProperty(this,t,r,n))return;let a=this._properties[r];po(a)||(this._properties[r]=new Array(i),a=this._properties[r]),a[t]=F8(n,!0)}_checkBatchId(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(t,r){return t.unpack(t.typedArray,r)}_setBinaryProperty(t,r,n){t.pack(n,t.typedArray,r)}_initializeBinaryProperties(){let t=null;for(let r in this._properties){let n=this._properties[r],i=this._initializeBinaryProperty(r,n);i&&(t=t||{},t[r]=i)}return t}_initializeBinaryProperty(t,r){if("byteOffset"in r){let n=r;Qt(this.binary,`Property ${t} requires a batch table binary.`),Qt(n.type,`Property ${t} requires a type.`);let i=i_e(n,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:i.values,componentCount:i.size,unpack:i.unpacker,pack:i.packer}}return null}_hasPropertyInHierarchy(t,r){if(!this._hierarchy)return!1;let n=_v(this._hierarchy,t,(i,a)=>{let o=i.classIds[a],s=i.classes[o].instances;return po(s[r])});return po(n)}_getPropertyNamesInHierarchy(t,r){_v(this._hierarchy,t,(n,i)=>{let a=n.classIds[i],o=n.classes[a].instances;for(let s in o)o.hasOwnProperty(s)&&r.indexOf(s)===-1&&r.push(s)})}_getHierarchyProperty(t,r){return _v(this._hierarchy,t,(n,i)=>{let a=n.classIds[i],o=n.classes[a],s=n.classIndexes[i],u=o.instances[r];return po(u)?po(u.typedArray)?this._getBinaryProperty(u,s):F8(u[s],!0):null})}_setHierarchyProperty(t,r,n,i){let a=_v(this._hierarchy,r,(o,s)=>{let u=o.classIds[s],c=o.classes[u],l=o.classIndexes[s],f=c.instances[n];return po(f)?(Qt(s===r,`Inherited property "${n}" is read-only.`),po(f.typedArray)?this._setBinaryProperty(f,l,i):f[l]=F8(i,!0),!0):!1});return po(a)}};var J7=4;function Ah(e,t,r=0){let n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=J7,e.version=n.getUint32(r,!0),r+=J7,e.byteLength=n.getUint32(r,!0),r+=J7,e.version!==1)throw new Error(`3D Tile Version ${e.version} not supported`);return r}var wv=4,s_e="b3dm tile in legacy format.";function Ev(e,t,r){let n=new DataView(t),i;e.header=e.header||{};let a=n.getUint32(r,!0);r+=wv;let o=n.getUint32(r,!0);r+=wv;let s=n.getUint32(r,!0);r+=wv;let u=n.getUint32(r,!0);return r+=wv,s>=570425344?(r-=wv*2,i=a,s=o,u=0,a=0,o=0,console.warn(s_e)):u>=570425344&&(r-=wv,i=s,s=a,u=o,a=0,o=0,console.warn(s_e)),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=u,e.header.batchLength=i,r}function Av(e,t,r,n){return r=e8t(e,t,r,n),r=t8t(e,t,r,n),r}function e8t(e,t,r,n){let{featureTableJsonByteLength:i,featureTableBinaryByteLength:a,batchLength:o}=e.header||{};if(e.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){let s=U7(t,r,i);e.featureTableJson=JSON.parse(s)}return r+=i||0,e.featureTableBinary=new Uint8Array(t,r,a),r+=a||0,r}function t8t(e,t,r,n){let{batchTableJsonByteLength:i,batchTableBinaryByteLength:a}=e.header||{};if(i&&i>0){let o=U7(t,r,i);e.batchTableJson=JSON.parse(o),r+=i,a&&a>0&&(e.batchTableBinary=new Uint8Array(t,r,a),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=a)}return r}function X7(e,t,r){if(!t&&(!e||!e.batchIds||!r))return null;let{batchIds:n,isRGB565:i,pointCount:a=0}=e;if(n&&r){let o=new Uint8ClampedArray(a*3);for(let s=0;s<a;s++){let u=n[s],l=r.getProperty(u,"dimensions").map(f=>f*255);o[s*3]=l[0],o[s*3+1]=l[1],o[s*3+2]=l[2]}return{type:Ht.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}if(t&&i){let o=new Uint8ClampedArray(a*3);for(let s=0;s<a;s++){let u=$7(t[s]);o[s*3]=u[0],o[s*3+1]=u[1],o[s*3+2]=u[2]}return{type:Ht.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}return t&&t.length===a*3?{type:Ht.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:Ht.UNSIGNED_BYTE,value:t||new Uint8ClampedArray,size:4,normalized:!0}}var u_e=new ce;function c_e(e,t){if(!t)return null;if(e.isOctEncoded16P){let r=new Float32Array((e.pointsLength||0)*3);for(let n=0;n<(e.pointsLength||0);n++)Y7(t[n*2],t[n*2+1],u_e),u_e.toArray(r,n*3);return{type:Ht.FLOAT,size:2,value:r}}return{type:Ht.FLOAT,size:2,value:t}}function l_e(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,r8t(e,t)):{type:Ht.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function r8t(e,t){let r=new ce,n=new Float32Array(e.pointCount*3);for(let i=0;i<e.pointCount;i++)r.set(t[i*3],t[i*3+1],t[i*3+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,i*3);return n}async function f_e(e,t,r,n,i){r=Ah(e,t,r),r=Ev(e,t,r),r=Av(e,t,r,n),n8t(e);let{featureTable:a,batchTable:o}=i8t(e);return await c8t(e,a,o,n,i),a8t(e,a,n),o8t(e,a,o),s8t(e,a),r}function n8t(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function i8t(e){let t=new Bl(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3);let n=u8t(e,t);return{featureTable:t,batchTable:n}}function a8t(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.positions){if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",Ht.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){let n=t.getPropertyArray("POSITION_QUANTIZED",Ht.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=(1<<16)-1,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Ht.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Ht.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=l_e(e,n,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function o8t(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.colors){let n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",Ht.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",Ht.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",Ht.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=X7(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",Ht.UNSIGNED_BYTE,4))}function s8t(e,t){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.normals){let r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",Ht.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",Ht.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=c_e(e,r)}}function u8t(e,t){let r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",Ht.UNSIGNED_SHORT,1),e.batchIds)){let n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");let{batchTableJson:i,batchTableBinary:a}=e;r=new Bd(i,a,n)}return r}async function c8t(e,t,r,n,i){let a,o,s,u=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];u&&(s=u.properties);let c=t.getExtension("3DTILES_draco_point_compression");if(c){o=c.properties;let f=c.byteOffset,h=c.byteLength;if(!o||!Number.isFinite(f)||!h)throw new Error("Draco properties, byteOffset, and byteLength must be defined");a=(e.featureTableBinary||[]).slice(f,f+h),e.hasPositions=Number.isFinite(o.POSITION),e.hasColors=Number.isFinite(o.RGB)||Number.isFinite(o.RGBA),e.hasNormals=Number.isFinite(o.NORMAL),e.hasBatchIds=Number.isFinite(o.BATCH_ID),e.isTranslucent=Number.isFinite(o.RGBA)}if(!a)return!0;let l={buffer:a,properties:{...o,...s},featureTableProperties:o,batchTableProperties:s,dequantizeInShader:!1};return await l8t(e,l,n,i)}async function l8t(e,t,r,n){if(!n)return;let i={...r,draco:{...r==null?void 0:r.draco,extraAttributes:t.batchTableProperties||{}}};delete i["3d-tiles"];let a=await So(t.buffer,xv,i,n),o=a.attributes.POSITION&&a.attributes.POSITION.value,s=a.attributes.COLOR_0&&a.attributes.COLOR_0.value,u=a.attributes.NORMAL&&a.attributes.NORMAL.value,c=a.attributes.BATCH_ID&&a.attributes.BATCH_ID.value,l=o&&a.attributes.POSITION.value.quantization,f=u&&a.attributes.NORMAL.value.quantization;if(l){let p=a.POSITION.data.quantization,d=p.range;e.quantizedVolumeScale=new ce(d,d,d),e.quantizedVolumeOffset=new ce(p.minValues),e.quantizedRange=(1<<p.quantizationBits)-1,e.isQuantizedDraco=!0}f&&(e.octEncodedRange=(1<<a.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);let h={};if(t.batchTableProperties)for(let p of Object.keys(t.batchTableProperties))a.attributes[p]&&a.attributes[p].value&&(h[p.toLowerCase()]=a.attributes[p].value);e.attributes={positions:o,colors:X7(e,s,void 0),normals:u,batchIds:c,...h}}var oq={};ca(oq,{decode:()=>Y8t,name:()=>N8});var k8="4.0.0";var h_e,f8t=(h_e=globalThis.loaders)==null?void 0:h_e.parseImageNode,Q7=typeof Image<"u",Z7=typeof ImageBitmap<"u",h8t=Boolean(f8t),eq=gn?!0:h8t;function p_e(e){switch(e){case"auto":return Z7||Q7||eq;case"imagebitmap":return Z7;case"image":return Q7;case"data":return eq;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function d_e(){if(Z7)return"imagebitmap";if(Q7)return"image";if(eq)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function m_e(e){let t=p8t(e);if(!t)throw new Error("Not an image");return t}function tq(e){return Sv(e)}function Sv(e){switch(m_e(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function p8t(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 d8t=/^data:image\/svg\+xml/,m8t=/\.svg((\?|#).*)?$/;function B8(e){return e&&(d8t.test(e)||m8t.test(e))}function g_e(e,t){if(B8(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(a){throw new Error(a.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return rq(e,t)}function rq(e,t){if(B8(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function O8(e,t,r){let n=g_e(e,r),i=self.URL||self.webkitURL,a=typeof n!="string"&&i.createObjectURL(n);try{return await g8t(a||n,t)}finally{a&&i.revokeObjectURL(a)}}async function g8t(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,i)=>{try{r.onload=()=>n(r),r.onerror=a=>i(new Error(`Could not load image ${e}: ${a}`))}catch(a){i(a)}})}var v8t={},v_e=!0;async function b_e(e,t,r){let n;B8(r)?n=await O8(e,t,r):n=rq(e,r);let i=t&&t.imagebitmap;return await b8t(n,i)}async function b8t(e,t=null){if((y8t(t)||!v_e)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),v_e=!1}return await createImageBitmap(e)}function y8t(e){for(let t in e||v8t)return!1;return!0}function y_e(e){return!E8t(e,"ftyp",4)||!(e[8]&96)?null:x8t(e)}function x8t(e){switch(_8t(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function _8t(e,t,r){return String.fromCharCode(...e.slice(t,r))}function w8t(e){return[...e].map(t=>t.charCodeAt(0))}function E8t(e,t,r=0){let n=w8t(t);for(let i=0;i<n.length;++i)if(n[i]!==e[i+r])return!1;return!0}var xc=!1,n_=!0;function Od(e){let t=i_(e);return S8t(t)||D8t(t)||T8t(t)||C8t(t)||A8t(t)}function A8t(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=y_e(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function S8t(e){let t=i_(e);return t.byteLength>=24&&t.getUint32(0,xc)===2303741511?{mimeType:"image/png",width:t.getUint32(16,xc),height:t.getUint32(20,xc)}:null}function T8t(e){let t=i_(e);return t.byteLength>=10&&t.getUint32(0,xc)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,n_),height:t.getUint16(8,n_)}:null}function C8t(e){let t=i_(e);return t.byteLength>=14&&t.getUint16(0,xc)===16973&&t.getUint32(2,n_)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,n_),height:t.getUint32(22,n_)}:null}function D8t(e){let t=i_(e);if(!(t.byteLength>=3&&t.getUint16(0,xc)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=F8t(),a=2;for(;a+9<t.byteLength;){let o=t.getUint16(a,xc);if(i.has(o))return{mimeType:"image/jpeg",height:t.getUint16(a+5,xc),width:t.getUint16(a+7,xc)};if(!n.has(o))return null;a+=2,a+=t.getUint16(a,xc)}return null}function F8t(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function i_(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 x_e(e,t){var i;let{mimeType:r}=Od(e)||{},n=(i=globalThis.loaders)==null?void 0:i.parseImageNode;return Qt(n),await n(e,r)}async function __e(e,t,r){t=t||{};let i=(t.image||{}).type||"auto",{url:a}=r||{},o=k8t(i),s;switch(o){case"imagebitmap":s=await b_e(e,t,a);break;case"image":s=await O8(e,t,a);break;case"data":s=await x_e(e,t);break;default:Qt(!1)}return i==="data"&&(s=Sv(s)),s}function k8t(e){switch(e){case"auto":case"data":return d_e();default:return p_e(e),e}}var B8t=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],O8t=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],I8t={image:{type:"auto",decode:!0}},Tv={id:"image",module:"images",name:"Images",version:k8,mimeTypes:O8t,extensions:B8t,parse:__e,tests:[e=>Boolean(Od(new DataView(e)))],options:I8t};var A_e,w_e=(A_e=globalThis.loaders)==null?void 0:A_e.encodeImageNode;async function S_e(e,t){return t=t||{},t.image=t.image||{},w_e?w_e(e,{type:t.image.mimeType}):P8t(e,t)}var E_e=!0;async function P8t(e,t){let{mimeType:r,jpegQuality:n}=t.image,{width:i,height:a}=tq(e),o=document.createElement("canvas");o.width=i,o.height=a,R8t(e,o);let s=await new Promise(u=>{if(n&&E_e)try{o.toBlob(u,r,n);return}catch{E_e=!1}o.toBlob(u,r)});if(!s)throw new Error("image encoding failed");return await s.arrayBuffer()}function R8t(e,t,r=0,n=0){if(r===0&&n===0&&typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let a=t.getContext("bitmaprenderer");if(a)return a.transferFromImageBitmap(e),t}let i=t.getContext("2d");if(e.data){let a=new Uint8ClampedArray(e.data),o=new ImageData(a,e.width,e.height);return i.putImageData(o,0,0),t}return i.drawImage(e,0,0),t}var nq={name:"Images",id:"image",module:"images",version:k8,extensions:["jpeg"],options:{image:{mimeType:"image/png",jpegQuality:null}},encode:S_e};var iq={};function aq(e){if(iq[e]===void 0){let t=gn?L8t(e):j8t(e);iq[e]=t}return iq[e]}function j8t(e){var i,a;let t=["image/png","image/jpeg","image/gif"],r=((i=globalThis.loaders)==null?void 0:i.imageFormatsNode)||t,n=(a=globalThis.loaders)==null?void 0:a.parseImageNode;return Boolean(n)&&r.includes(e)}function L8t(e){switch(e){case"image/avif":case"image/webp":return M8t(e);default:return!0}}function M8t(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}function Ni(e,t){if(!e)throw new Error(t||"assert failed: gltf")}var I8={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},P8={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var q8t=1.33,T_e=["SCALAR","VEC2","VEC3","VEC4"],N8t=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],U8t=new Map(N8t),G8t={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},z8t={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},H8t={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function R8(e){return T_e[e-1]||T_e[0]}function Cv(e){let t=U8t.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Dv(e,t){let r=H8t[e.componentType],n=G8t[e.type],i=z8t[e.componentType],a=e.count*n,o=e.count*n*i;Ni(o>=0&&o<=t.byteLength);let s=P8[e.componentType],u=I8[e.type];return{ArrayType:r,length:a,byteLength:o,componentByteSize:s,numberOfComponentsInElement:u}}function a_(e){let{images:t,bufferViews:r}=e;t=t||[],r=r||[];let n=t.map(o=>o.bufferView);r=r.filter(o=>!n.includes(o));let i=r.reduce((o,s)=>o+s.byteLength,0),a=t.reduce((o,s)=>{let{width:u,height:c}=s.image;return o+u*c},0);return i+Math.ceil(4*a*q8t)}function C_e(e,t,r){let n=e.bufferViews[r];Ni(n);let i=n.buffer,a=t[i];Ni(a);let o=(n.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,o,n.byteLength)}function D_e(e,t,r){var b,g;let n=typeof r=="number"?(b=e.accessors)==null?void 0:b[r]:r;if(!n)throw new Error(`No gltf accessor ${r}`);let i=(g=e.bufferViews)==null?void 0:g[n.bufferView||0];if(!i)throw new Error(`No gltf buffer view for accessor ${i}`);let{arrayBuffer:a,byteOffset:o}=t[i.buffer],s=(o||0)+(n.byteOffset||0)+(i.byteOffset||0),{ArrayType:u,length:c,componentByteSize:l,numberOfComponentsInElement:f}=Dv(n,i),h=l*f,p=i.byteStride||h;if(typeof i.byteStride>"u"||i.byteStride===h)return new u(a,s,c);let d=new u(c);for(let x=0;x<n.count;x++){let E=new u(a,s+x*p,f);d.set(E,x*f)}return d}function W8t(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var qr=class{gltf;sourceBuffers;byteLength;constructor(t){this.gltf={json:(t==null?void 0:t.json)||W8t(),buffers:(t==null?void 0:t.buffers)||[],images:(t==null?void 0:t.images)||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}hasExtension(t){let r=this.getUsedExtensions().find(i=>i===t),n=this.getRequiredExtensions().find(i=>i===t);return typeof r=="string"||typeof n=="string"}getExtension(t){let r=this.getUsedExtensions().find(i=>i===t),n=this.json.extensions||{};return r?n[t]:null}getRequiredExtension(t){return this.getRequiredExtensions().find(n=>n===t)?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(t,r){return(t.extensions||{})[r]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,r){if(typeof r=="object")return r;let n=this.json[t]&&this.json[t][r];if(!n)throw new Error(`glTF file error: Could not find ${t}[${r}]`);return n}getTypedArrayForBufferView(t){t=this.getBufferView(t);let r=t.buffer,n=this.gltf.buffers[r];Ni(n);let i=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,i,t.byteLength)}getTypedArrayForAccessor(t){let r=this.getAccessor(t);return D_e(this.gltf.json,this.gltf.buffers,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);let r=this.getBufferView(t.bufferView),i=this.getBuffer(r.buffer).data,a=r.byteOffset||0;return new Uint8Array(i,a,r.byteLength)}addApplicationData(t,r){return this.json[t]=r,this}addExtraData(t,r){return this.json.extras=this.json.extras||{},this.json.extras[t]=r,this}addObjectExtension(t,r,n){return t.extensions=t.extensions||{},t.extensions[r]=n,this.registerUsedExtension(r),this}setObjectExtension(t,r,n){let i=t.extensions||{};i[r]=n}removeObjectExtension(t,r){let n=(t==null?void 0:t.extensions)||{};if(n[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let i=this.json.extensionsRemoved;i.includes(r)||i.push(r)}delete n[r]}addExtension(t,r={}){return Ni(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return Ni(r),this.addExtension(t,r),this.registerRequiredExtension(t),r}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===t)||this.json.extensionsRequired.push(t)}removeExtension(t){var r;if((r=this.json.extensions)!=null&&r[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let n=this.json.extensionsRemoved;n.includes(t)||n.push(t)}this.json.extensions&&delete this.json.extensions[t],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t)}setDefaultScene(t){this.json.scene=t}addScene(t){let{nodeIndices:r}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(t){let{meshIndex:r,matrix:n}=t;this.json.nodes=this.json.nodes||[];let i={mesh:r};return n&&(i.matrix=n),this.json.nodes.push(i),this.json.nodes.length-1}addMesh(t){let{attributes:r,indices:n,material:i,mode:a=4}=t,s={primitives:[{attributes:this._addAttributes(r),mode:a}]};if(n){let u=this._addIndices(n);s.primitives[0].indices=u}return Number.isFinite(i)&&(s.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(s),this.json.meshes.length-1}addPointCloud(t){let n={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(t,r){let n=Od(t),i=r||(n==null?void 0:n.mimeType),o={bufferView:this.addBufferView(t),mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(t,r=0,n=this.byteLength){let i=t.byteLength;Ni(Number.isFinite(i)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let a={buffer:r,byteOffset:n,byteLength:i};return this.byteLength+=Co(i,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(a),this.json.bufferViews.length-1}addAccessor(t,r){let n={bufferView:t,type:R8(r.size),componentType:r.componentType,count:r.count,max:r.max,min:r.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(t,r={size:3}){let n=this.addBufferView(t),i={min:r.min,max:r.max};(!i.min||!i.max)&&(i=this._getAccessorMinMax(t,r.size));let a={size:r.size,componentType:Cv(t),count:Math.round(t.length/r.size),min:i.min,max:i.max};return this.addAccessor(n,Object.assign(a,r))}addTexture(t){let{imageIndex:r}=t,n={source:r};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var a,o;this.gltf.buffers=[];let t=this.byteLength,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;for(let s of this.sourceBuffers||[])i=GI(s,n,i);(o=(a=this.json)==null?void 0:a.buffers)!=null&&o[0]?this.json.buffers[0].byteLength=t:this.json.buffers=[{byteLength:t}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(t,r){let n=!0;for(;n;){let i=t.indexOf(r);i>-1?t.splice(i,1):n=!1}}_addAttributes(t={}){let r={};for(let n in t){let i=t[n],a=this._getGltfAttributeName(n),o=this.addBinaryBuffer(i.value,i);r[a]=o}return r}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,r){let n={min:null,max:null};if(t.length<r)return n;n.min=[],n.max=[];let i=t.subarray(0,r);for(let a of i)n.min.push(a),n.max.push(a);for(let a=r;a<t.length;a+=r)for(let o=0;o<r;o++)n.min[0+o]=Math.min(n.min[0+o],t[a+o]),n.max[0+o]=Math.max(n.max[0+o],t[a+o]);return n}};var F_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},V8t={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},k_e={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function o_(e,t){return k_e[t]*F_e[e]}function Fv(e,t,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let i=e.getTypedArrayForBufferView(t),a=kv(i,"SCALAR",r,n+1);return a instanceof BigInt64Array||a instanceof BigUint64Array?null:a}function kv(e,t,r,n=1){let i=F_e[t],a=V8t[r],o=k_e[r],s=n*i,u=s*o,c=e.buffer,l=e.byteOffset;return l%o!==0&&(c=new Uint8Array(c).slice(l,l+u).buffer,l=0),new a(c,l,s)}function Bv(e,t,r){var c,l,f,h,p;let n=`TEXCOORD_${t.texCoord||0}`,i=r.attributes[n],a=e.getTypedArrayForAccessor(i),o=e.gltf.json,s=t.index,u=(l=(c=o.textures)==null?void 0:c[s])==null?void 0:l.source;if(typeof u<"u"){let d=(h=(f=o.images)==null?void 0:f[u])==null?void 0:h.mimeType,b=(p=e.gltf.images)==null?void 0:p[u];if(b&&typeof b.width<"u"){let g=[];for(let x=0;x<a.length;x+=2){let E=K8t(b,d,a,x,t.channels);g.push(E)}return g}}return[]}function j8(e,t,r,n,i){if(!(r!=null&&r.length))return;let a=[];for(let l of r){let f=n.findIndex(h=>h===l);f===-1&&(f=n.push(l)-1),a.push(f)}let o=new Uint32Array(a),s=e.gltf.buffers.push({arrayBuffer:o.buffer,byteOffset:o.byteOffset,byteLength:o.byteLength})-1,u=e.addBufferView(o,s,0),c=e.addAccessor(u,{size:1,componentType:Cv(o),count:o.length});i.attributes[t]=c}function K8t(e,t,r,n,i=[0]){let a={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=r[n],s=r[n+1],u=1;t&&(t.indexOf("image/jpeg")!==-1||t.indexOf("image/png")!==-1)&&(u=4);let c=$8t(o,s,e,u),l=0;for(let f of i){let h=typeof f=="number"?Object.values(a)[f]:a[f],p=c+h.offset,d=Sv(e);if(d.data.length<=p)throw new Error(`${d.data.length} <= ${p}`);let b=d.data[p];l|=b<<h.shift}return l}function $8t(e,t,r,n=1){let i=r.width,a=kd(e)*(i-1),o=Math.round(a),s=r.height,u=kd(t)*(s-1),c=Math.round(u),l=r.components?r.components:n;return(c*i+o)*l}function L8(e,t,r,n,i){let a=[];for(let o=0;o<t;o++){let s=r[o],u=r[o+1]-r[o];if(u+s>n)break;let c=s/i,l=u/i;a.push(e.slice(c,c+l))}return a}function M8(e,t,r){let n=[];for(let i=0;i<t;i++){let a=i*r;n.push(e.slice(a,a+r))}return n}function q8(e,t,r,n){if(r)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){let i=[],a=new TextDecoder("utf8"),o=0;for(let s=0;s<e;s++){let u=n[s+1]-n[s];if(u+o<=t.length){let c=t.subarray(o,u+o),l=a.decode(c);i.push(l),o+=u}}return i}return[]}var B_e="EXT_mesh_features",N8=B_e;async function Y8t(e,t){let r=new qr(e);J8t(r,t)}function J8t(e,t){let r=e.gltf.json;if(r.meshes)for(let n of r.meshes)for(let i of n.primitives)X8t(e,i,t)}function X8t(e,t,r){var a,o,s;if(!((a=r==null?void 0:r.gltf)!=null&&a.loadBuffers))return;let n=(o=t.extensions)==null?void 0:o[B_e],i=n==null?void 0:n.featureIds;if(i)for(let u of i){let c;if(typeof u.attribute<"u"){let l=`_FEATURE_ID_${u.attribute}`,f=t.attributes[l];c=e.getTypedArrayForAccessor(f)}else typeof u.texture<"u"&&((s=r==null?void 0:r.gltf)!=null&&s.loadImages)?c=Bv(e,u.texture,t):c=[];u.data=c}}var cq={};ca(cq,{decode:()=>Q8t,name:()=>Ol});var sq="EXT_structural_metadata",Ol=sq;async function Q8t(e,t){let r=new qr(e);Z8t(r,t)}function Z8t(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(sq);r&&((i=t.gltf)!=null&&i.loadImages&&eDt(e,r),tDt(e,r))}function eDt(e,t){let r=t.propertyTextures,n=e.gltf.json;if(r&&n.meshes)for(let i of n.meshes)for(let a of i.primitives)nDt(e,r,a,t)}function tDt(e,t){let r=t.schema;if(!r)return;let n=r.classes,i=t.propertyTables;if(n&&i)for(let a in n){let o=rDt(i,a);o&&aDt(e,r,o)}}function rDt(e,t){for(let r of e)if(r.class===t)return r;return null}function nDt(e,t,r,n){var o;if(!t)return;let i=(o=r.extensions)==null?void 0:o[sq],a=i==null?void 0:i.propertyTextures;if(a)for(let s of a){let u=t[s];iDt(e,u,r,n)}}function iDt(e,t,r,n){var a;if(!t.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let i=t.class;for(let o in t.properties){let s=`${i}_${o}`,u=(a=t.properties)==null?void 0:a[o];if(!u)continue;u.data||(u.data=[]);let c=u.data,l=Bv(e,u,r);l!==null&&(j8(e,s,l,c,r),u.data=c,n.dataAttributeNames.push(s))}}function aDt(e,t,r){var a,o;let n=(a=t.classes)==null?void 0:a[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let i=r.count;for(let s in n.properties){let u=n.properties[s],c=(o=r.properties)==null?void 0:o[s];if(c){let l=oDt(e,t,u,i,c);c.data=l}}}function oDt(e,t,r,n,i){let a=[],o=i.values,s=e.getTypedArrayForBufferView(o),u=sDt(e,r,i,n),c=uDt(e,i,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{a=cDt(r,n,s,u);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{a=q8(n,s,u,c);break}case"ENUM":{a=lDt(t,r,n,s,u);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return a}function sDt(e,t,r,n){return t.array&&typeof t.count>"u"&&typeof r.arrayOffsets<"u"?Fv(e,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function uDt(e,t,r){return typeof t.stringOffsets<"u"?Fv(e,t.stringOffsets,t.stringOffsetType||"UINT32",r):null}function cDt(e,t,r,n){let i=e.array,a=e.count,o=o_(e.type,e.componentType),s=r.byteLength/o,u;return e.componentType?u=kv(r,e.type,e.componentType,s):u=r,i?n?L8(u,t,n,r.length,o):a?M8(u,t,a):[]:u}function lDt(e,t,r,n,i){var f;let a=t.enumType;if(!a)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let o=(f=e.enums)==null?void 0:f[a];if(!o)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${a}`);let s=o.valueType||"UINT16",u=o_(t.type,s),c=n.byteLength/u,l=kv(n,t.type,s,c);if(l||(l=n),t.array){if(i)return fDt({valuesData:l,numberOfElements:r,arrayOffsets:i,valuesDataBytesLength:n.length,elementSize:u,enumEntry:o});let h=t.count;return h?hDt(l,r,h,o):[]}return uq(l,0,r,o)}function fDt(e){let{valuesData:t,numberOfElements:r,arrayOffsets:n,valuesDataBytesLength:i,elementSize:a,enumEntry:o}=e,s=[];for(let u=0;u<r;u++){let c=n[u],l=n[u+1]-n[u];if(l+c>i)break;let f=c/a,h=l/a,p=uq(t,f,h,o);s.push(p)}return s}function hDt(e,t,r,n){let i=[];for(let a=0;a<t;a++){let o=r*a,s=uq(e,o,r,n);i.push(s)}return i}function uq(e,t,r,n){let i=[];for(let a=0;a<r;a++)if(e instanceof BigInt64Array||e instanceof BigUint64Array)i.push("");else{let o=e[t+a],s=pDt(n,o);s?i.push(s.name):i.push("")}return i}function pDt(e,t){for(let r of e.values)if(r.value===t)return r;return null}var lq={};ca(lq,{decode:()=>dDt,name:()=>gs});var O_e="EXT_feature_metadata",gs=O_e;async function dDt(e,t){let r=new qr(e);mDt(r,t)}function mDt(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(O_e);r&&((i=t.gltf)!=null&&i.loadImages&&gDt(e,r),vDt(e,r))}function gDt(e,t){let r=t.schema;if(!r)return;let n=r.classes,{featureTextures:i}=t;if(n&&i)for(let a in n){let o=n[a],s=yDt(i,a);s&&_Dt(e,s,o)}}function vDt(e,t){let r=t.schema;if(!r)return;let n=r.classes,i=t.featureTables;if(n&&i)for(let a in n){let o=bDt(i,a);o&&xDt(e,r,o)}}function bDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function yDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function xDt(e,t,r){var a,o;if(!r.class)return;let n=(a=t.classes)==null?void 0:a[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let i=r.count;for(let s in n.properties){let u=n.properties[s],c=(o=r.properties)==null?void 0:o[s];if(c){let l=wDt(e,t,u,i,c);c.data=l}}}function _Dt(e,t,r){var i;let n=t.class;for(let a in r.properties){let o=(i=t==null?void 0:t.properties)==null?void 0:i[a];if(o){let s=CDt(e,o,n);o.data=s}}}function wDt(e,t,r,n,i){let a=[],o=i.bufferView,s=e.getTypedArrayForBufferView(o),u=EDt(e,r,i,n),c=ADt(e,r,i,n);return r.type==="STRING"||r.componentType==="STRING"?a=q8(n,s,u,c):SDt(r)&&(a=TDt(r,n,s,u)),a}function EDt(e,t,r,n){return t.type==="ARRAY"&&typeof t.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?Fv(e,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function ADt(e,t,r,n){return typeof r.stringOffsetBufferView<"u"?Fv(e,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function SDt(e){let t=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return t.includes(e.type)||typeof e.componentType<"u"&&t.includes(e.componentType)}function TDt(e,t,r,n){let i=e.type==="ARRAY",a=e.componentCount,o="SCALAR",s=e.componentType||e.type,u=o_(o,s),c=r.byteLength/u,l=kv(r,o,s,c);return i?n?L8(l,t,n,r.length,u):a?M8(l,t,a):[]:l}function CDt(e,t,r){let n=e.gltf.json;if(!n.meshes)return[];let i=[];for(let a of n.meshes)for(let o of a.primitives)DDt(e,r,t,i,o);return i}function DDt(e,t,r,n,i){let a={channels:r.channels,...r.texture},o=Bv(e,a,i);o&&j8(e,t,o,n,i)}var U8="4.0.0";var Ov="4.0.0";var _c={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},fq;async function pq(e){let t=e.modules||{};return t.basis?t.basis:(fq=fq||FDt(e),await fq)}async function FDt(e){let t=null,r=null;return[t,r]=await Promise.all([await Qu(_c.TRANSCODER,"textures",e),await Qu(_c.TRANSCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await kDt(t,r)}function kDt(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(i=>{let{BasisFile:a,initializeBasis:o}=i;o(),n({BasisFile:a})})})}var hq;async function dq(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:(hq=hq||BDt(e),await hq)}async function BDt(e){let t=null,r=null;return[t,r]=await Promise.all([await Qu(_c.ENCODER,"textures",e),await Qu(_c.ENCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await ODt(t,r)}function ODt(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(i=>{let{BasisFile:a,KTX2File:o,initializeBasis:s,BasisEncoder:u}=i;s(),n({BasisFile:a,KTX2File:o,BasisEncoder:u})})})}var ke={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 IDt=["","WEBKIT_","MOZ_"],I_e={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"},G8=null;function s_(e){if(!G8){e=e||PDt()||void 0,G8=new Set;for(let t of IDt)for(let r in I_e)if(e&&e.getExtension(`${t}${r}`)){let n=I_e[r];G8.add(n)}}return G8}function PDt(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var W_e=$t(z_e(),1);function Iv(e,t){let r=new Array(t.mipMapLevels),n=t.width,i=t.height,a=0;for(let o=0;o<t.mipMapLevels;++o){let s=LDt(t,n,i,e,o),u=jDt(e,o,a,s);r[o]={compressed:!0,format:t.internalFormat,data:u,width:n,height:i,levelSize:s},n=Math.max(1,n>>1),i=Math.max(1,i>>1),a+=s}return r}function jDt(e,t,r,n){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,n)}function LDt(e,t,r,n,i){return Array.isArray(n)?e.sizeFunction(n[i]):e.sizeFunction(t,r)}var MDt={131:ke.COMPRESSED_RGB_S3TC_DXT1_EXT,132:ke.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:ke.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:ke.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:ke.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:ke.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:ke.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:ke.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:ke.COMPRESSED_RED_RGTC1_EXT,140:ke.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:ke.COMPRESSED_RED_GREEN_RGTC2_EXT,142:ke.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:ke.COMPRESSED_RGB8_ETC2,148:ke.COMPRESSED_SRGB8_ETC2,149:ke.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:ke.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:ke.COMPRESSED_RGBA8_ETC2_EAC,152:ke.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:ke.COMPRESSED_R11_EAC,154:ke.COMPRESSED_SIGNED_R11_EAC,155:ke.COMPRESSED_RG11_EAC,156:ke.COMPRESSED_SIGNED_RG11_EAC,157:ke.COMPRESSED_RGBA_ASTC_4x4_KHR,158:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:ke.COMPRESSED_RGBA_ASTC_5x4_KHR,160:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:ke.COMPRESSED_RGBA_ASTC_5x5_KHR,162:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:ke.COMPRESSED_RGBA_ASTC_6x5_KHR,164:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:ke.COMPRESSED_RGBA_ASTC_6x6_KHR,166:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:ke.COMPRESSED_RGBA_ASTC_8x5_KHR,168:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:ke.COMPRESSED_RGBA_ASTC_8x6_KHR,170:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:ke.COMPRESSED_RGBA_ASTC_8x8_KHR,172:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:ke.COMPRESSED_RGBA_ASTC_10x5_KHR,174:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:ke.COMPRESSED_RGBA_ASTC_10x6_KHR,176:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:ke.COMPRESSED_RGBA_ASTC_10x8_KHR,178:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:ke.COMPRESSED_RGBA_ASTC_10x10_KHR,180:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:ke.COMPRESSED_RGBA_ASTC_12x10_KHR,182:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:ke.COMPRESSED_RGBA_ASTC_12x12_KHR,184:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:ke.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:ke.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:ke.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:ke.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:ke.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:ke.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:ke.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:ke.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:ke.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:ke.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:ke.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:ke.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:ke.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:ke.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:ke.COMPRESSED_RGBA_ASTC_12x12_KHR};function H_e(e){return MDt[e]}var Oo=[171,75,84,88,32,50,48,187,13,10,26,10];function K8(e){let t=new Uint8Array(e);return!(t.byteLength<Oo.length||t[0]!==Oo[0]||t[1]!==Oo[1]||t[2]!==Oo[2]||t[3]!==Oo[3]||t[4]!==Oo[4]||t[5]!==Oo[5]||t[6]!==Oo[6]||t[7]!==Oo[7]||t[8]!==Oo[8]||t[9]!==Oo[9]||t[10]!==Oo[10]||t[11]!==Oo[11])}function V_e(e){let t=new Uint8Array(e),r=(0,W_e.read)(t),n=Math.max(1,r.levels.length),i=r.pixelWidth,a=r.pixelHeight,o=H_e(r.vkFormat);return Iv(r.levels,{mipMapLevels:n,width:i,height:a,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var qDt={etc1:{basisFormat:0,compressed:!0,format:ke.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:ke.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:ke.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:ke.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:ke.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 c_(e,t){if(t.basis.containerFormat==="auto"){if(K8(e)){let n=await dq(t);return K_e(n.KTX2File,e,t)}let{BasisFile:r}=await pq(t);return yq(r,e,t)}switch(t.basis.module){case"encoder":let r=await dq(t);switch(t.basis.containerFormat){case"ktx2":return K_e(r.KTX2File,e,t);case"basis":default:return yq(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:n}=await pq(t);return yq(n,e,t)}}function yq(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let i=n.getNumImages(),a=[];for(let o=0;o<i;o++){let s=n.getNumLevels(o),u=[];for(let c=0;c<s;c++)u.push(NDt(n,o,c,r));a.push(u)}return a}finally{n.close(),n.delete()}}function NDt(e,t,r,n){let i=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),{compressed:s,format:u,basisFormat:c}=$_e(n,o),l=e.getImageTranscodedSizeInBytes(t,r,c),f=new Uint8Array(l);if(!e.transcodeImage(f,t,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:a,data:f,compressed:s,format:u,hasAlpha:o}}function K_e(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");let i=n.getLevels(),a=[];for(let o=0;o<i;o++){a.push(UDt(n,o,r));break}return[a]}finally{n.close(),n.delete()}}function UDt(e,t,r){let{alphaFlag:n,height:i,width:a}=e.getImageLevelInfo(t,0,0),{compressed:o,format:s,basisFormat:u}=$_e(r,n),c=e.getImageTranscodedSizeInBytes(t,0,0,u),l=new Uint8Array(c);if(!e.transcodeImage(l,t,0,0,u,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:a,height:i,data:l,compressed:o,levelSize:c,hasAlpha:n,format:s}}function $_e(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=Pv()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),qDt[r]}function Pv(){let e=s_();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 Y_e={name:"Basis",id:"basis",module:"textures",version:Ov,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"}}},Id={...Y_e,parse:c_};var Io={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},GDt={DXT1:ke.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:ke.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:ke.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":ke.COMPRESSED_RGB_ATC_WEBGL,ATCA:ke.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:ke.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},zDt=Q_e,HDt=$8,WDt=$8,VDt={DXT1:Q_e,DXT3:$8,DXT5:$8,"ATC ":zDt,ATCA:HDt,ATCI:WDt};function J_e(e){return new Uint32Array(e,0,Io.HEADER_LENGTH)[Io.MAGIC_NUMBER_INDEX]===Io.MAGIC_NUMBER}function X_e(e){let t=new Int32Array(e,0,Io.HEADER_LENGTH),r=t[Io.HEADER_PF_FOURCC_INDEX];Qt(Boolean(t[Io.HEADER_PF_FLAGS_INDEX]&Io.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=KDt(r),i=GDt[n],a=VDt[n];Qt(i&&a,`DDS: Unknown pixel format ${r}`);let o=1;t[Io.HEADER_FLAGS_INDEX]&Io.DDSD_MIPMAPCOUNT&&(o=Math.max(1,t[Io.MIPMAPCOUNT_INDEX]));let s=t[Io.HEADER_WIDTH_INDEX],u=t[Io.HEADER_HEIGHT_INDEX],c=t[Io.HEADER_SIZE_INDEX]+4,l=new Uint8Array(e,c);return Iv(l,{mipMapLevels:o,width:s,height:u,sizeFunction:a,internalFormat:i})}function Q_e(e,t){return(e+3>>2)*(t+3>>2)*8}function $8(e,t){return(e+3>>2)*(t+3>>2)*16}function KDt(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var vs={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},$Dt={0:[ke.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[ke.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[ke.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[ke.COMPRESSED_RGB_ETC1_WEBGL],7:[ke.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[ke.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[ke.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[ke.COMPRESSED_RGB8_ETC2],23:[ke.COMPRESSED_RGBA8_ETC2_EAC],24:[ke.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[ke.COMPRESSED_R11_EAC],26:[ke.COMPRESSED_RG11_EAC],27:[ke.COMPRESSED_RGBA_ASTC_4X4_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[ke.COMPRESSED_RGBA_ASTC_5X4_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[ke.COMPRESSED_RGBA_ASTC_5X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[ke.COMPRESSED_RGBA_ASTC_6X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[ke.COMPRESSED_RGBA_ASTC_6X6_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[ke.COMPRESSED_RGBA_ASTC_8X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[ke.COMPRESSED_RGBA_ASTC_8X6_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[ke.COMPRESSED_RGBA_ASTC_8X8_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[ke.COMPRESSED_RGBA_ASTC_10X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[ke.COMPRESSED_RGBA_ASTC_10X6_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[ke.COMPRESSED_RGBA_ASTC_10X8_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[ke.COMPRESSED_RGBA_ASTC_10X10_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[ke.COMPRESSED_RGBA_ASTC_12X10_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[ke.COMPRESSED_RGBA_ASTC_12X12_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},YDt={0:Z_e,1:Z_e,2:e2e,3:e2e,6:l_,7:l_,9:f_,11:f_,22:l_,23:f_,24:l_,25:l_,26:f_,27:f_,28:JDt,29:XDt,30:QDt,31:ZDt,32:e4t,33:t4t,34:r4t,35:n4t,36:i4t,37:a4t,38:o4t,39:s4t,40:u4t};function t2e(e){let r=new Uint32Array(e,0,vs.HEADER_LENGTH)[vs.MAGIC_NUMBER_INDEX];return r===vs.MAGIC_NUMBER||r===vs.MAGIC_NUMBER_EXTRA}function r2e(e){let t=new Uint32Array(e,0,vs.HEADER_LENGTH),r=t[vs.PIXEL_FORMAT_INDEX],n=t[vs.COLOUR_SPACE_INDEX],i=$Dt[r]||[],a=i.length>1&&n?i[1]:i[0],o=YDt[r],s=t[vs.MIPMAPCOUNT_INDEX],u=t[vs.WIDTH_INDEX],c=t[vs.HEIGHT_INDEX],l=vs.HEADER_SIZE+t[vs.METADATA_SIZE_INDEX],f=new Uint8Array(e,l);return Iv(f,{mipMapLevels:s,width:u,height:c,sizeFunction:o,internalFormat:a})}function Z_e(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function e2e(e,t){return e=Math.max(e,8),t=Math.max(t,8),e*t/2}function l_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function f_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function JDt(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16}function XDt(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16}function QDt(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16}function ZDt(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16}function e4t(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16}function t4t(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16}function r4t(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16}function n4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16}function i4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16}function a4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16}function o4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16}function s4t(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16}function u4t(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}function n2e(e){if(K8(e))return V_e(e);if(J_e(e))return X_e(e);if(t2e(e))return r2e(e);throw new Error("Texture container format not recognized")}var i2e={name:"Texture Containers",id:"compressed-texture",module:"textures",version:Ov,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}}},Y8={...i2e,parse:async(e,t)=>{var r;return(r=t==null?void 0:t["compressed-texture"])!=null&&r.useBasis?(t.basis={format:{alpha:"BC3",noAlpha:"BC1"},...t.basis,containerFormat:"ktx2",module:"encoder"},(await c_(e,t))[0]):n2e(e)}};var xq={name:"Basis Universal Supercompressed GPU Texture",id:"ktx2-basis-writer",module:"textures",version:Ov,extensions:["ktx2"],worker:!0,options:{useSRGB:!1,qualityLevel:10,encodeUASTC:!1,mipmaps:!1}};var Rv=!0,a2e=1735152710,Eq=12,J8=8,c4t=1313821514,l4t=5130562,f4t=0,h4t=0,p4t=1;function d4t(e,t=0){return`${String.fromCharCode(e.getUint8(t+0))}${String.fromCharCode(e.getUint8(t+1))}${String.fromCharCode(e.getUint8(t+2))}${String.fromCharCode(e.getUint8(t+3))}`}function o2e(e,t=0,r={}){let n=new DataView(e),{magic:i=a2e}=r,a=n.getUint32(t,!1);return a===i||a===a2e}function s2e(e,t,r=0,n={}){let i=new DataView(t),a=d4t(i,r+0),o=i.getUint32(r+4,Rv),s=i.getUint32(r+8,Rv);switch(Object.assign(e,{header:{byteOffset:r,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),r+=Eq,e.version){case 1:return m4t(e,i,r);case 2:return g4t(e,i,r,n={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports version 1 and 2.`)}}function m4t(e,t,r){Qt(e.header.byteLength>Eq+J8);let n=t.getUint32(r+0,Rv),i=t.getUint32(r+4,Rv);return r+=J8,Qt(i===f4t),_q(e,t,r,n),r+=n,r+=wq(e,t,r,e.header.byteLength),r}function g4t(e,t,r,n){return Qt(e.header.byteLength>Eq+J8),v4t(e,t,r,n),r+e.header.byteLength}function v4t(e,t,r,n){for(;r+8<=e.header.byteLength;){let i=t.getUint32(r+0,Rv),a=t.getUint32(r+4,Rv);switch(r+=J8,a){case c4t:_q(e,t,r,i);break;case l4t:wq(e,t,r,i);break;case h4t:n.strict||_q(e,t,r,i);break;case p4t:n.strict||wq(e,t,r,i);break;default:break}r+=Co(i,4)}return r}function _q(e,t,r,n){let i=new Uint8Array(t.buffer,r,n),o=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(o),Co(n,4)}function wq(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),Co(n,4)}function Aq(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;let n=t.baseUri||t.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${e}`);return n.substr(0,n.lastIndexOf("/")+1)+e}var Tq={};ca(Tq,{decode:()=>F4t,name:()=>D4t});var b4t="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",y4t="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",x4t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),_4t=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),w4t={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},E4t={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function u2e(e,t,r,n,i,a="NONE"){let o=await A4t();C4t(o,o.exports[E4t[i]],e,t,r,n,o.exports[w4t[a||"NONE"]])}var Sq;async function A4t(){return Sq||(Sq=S4t()),Sq}async function S4t(){let e=b4t;WebAssembly.validate(x4t)&&(e=y4t,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate(T4t(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function T4t(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n){let i=e.charCodeAt(n);t[n]=i>96?i-71:i>64?i-65:i>47?i+4:i>46?63:62}let r=0;for(let n=0;n<e.length;++n)t[r++]=t[n]<60?_4t[t[n]]:(t[n]-60)*64+t[++n];return t.buffer.slice(0,r)}function C4t(e,t,r,n,i,a,o){let s=e.exports.sbrk,u=n+3&-4,c=s(u*i),l=s(a.length),f=new Uint8Array(e.exports.memory.buffer);f.set(a,l);let h=t(c,n,i,l,a.length);if(h===0&&o&&o(c,u,i),r.set(f.subarray(c,c+n*i)),s(c-s(0)),h!==0)throw new Error(`Malformed buffer data: ${h}`)}var X8="EXT_meshopt_compression",D4t=X8;async function F4t(e,t){var i,a;let r=new qr(e);if(!((i=t==null?void 0:t.gltf)!=null&&i.decompressMeshes)||!((a=t.gltf)!=null&&a.loadBuffers))return;let n=[];for(let o of e.json.bufferViews||[])n.push(k4t(r,o));await Promise.all(n),r.removeExtension(X8)}async function k4t(e,t){let r=e.getObjectExtension(t,X8);if(r){let{byteOffset:n=0,byteLength:i=0,byteStride:a,count:o,mode:s,filter:u="NONE",buffer:c}=r,l=e.gltf.buffers[c],f=new Uint8Array(l.arrayBuffer,l.byteOffset+n,i),h=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);await u2e(h,o,a,f,s,u),e.removeObjectExtension(t,X8)}}var Cq={};ca(Cq,{name:()=>B4t,preprocess:()=>O4t});var jv="EXT_texture_webp",B4t=jv;function O4t(e,t){let r=new qr(e);if(!aq("image/webp")){if(r.getRequiredExtensions().includes(jv))throw new Error(`gltf: Required extension ${jv} not supported by browser`);return}let{json:n}=r;for(let i of n.textures||[]){let a=r.getObjectExtension(i,jv);a&&(i.source=a.source),r.removeObjectExtension(i,jv)}r.removeExtension(jv)}var Dq={};ca(Dq,{name:()=>I4t,preprocess:()=>P4t});var Q8="KHR_texture_basisu",I4t=Q8;function P4t(e,t){let r=new qr(e),{json:n}=r;for(let i of n.textures||[]){let a=r.getObjectExtension(i,Q8);a&&(i.source=a.source,r.removeObjectExtension(i,Q8))}r.removeExtension(Q8)}var kq={};ca(kq,{decode:()=>q4t,encode:()=>N4t,name:()=>L4t,preprocess:()=>M4t});function c2e(e){let t={};for(let r in e){let n=e[r];if(r!=="indices"){let i=Fq(n);t[r]=i}}return t}function Fq(e){let{buffer:t,size:r,count:n}=R4t(e);return{value:t,size:r,byteOffset:0,count:n,type:R8(r),componentType:Cv(t)}}function R4t(e){let t=e,r=1,n=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=j4t(t,Float32Array)),n=t.length/r),{buffer:t,size:r,count:n}}function j4t(e,t,r=!1){return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}var Sh="KHR_draco_mesh_compression",L4t=Sh;function M4t(e,t,r){let n=new qr(e);for(let i of l2e(n))n.getObjectExtension(i,Sh)}async function q4t(e,t,r){var a;if(!((a=t==null?void 0:t.gltf)!=null&&a.decompressMeshes))return;let n=new qr(e),i=[];for(let o of l2e(n))n.getObjectExtension(o,Sh)&&i.push(U4t(n,o,t,r));await Promise.all(i),n.removeExtension(Sh)}function N4t(e,t={}){let r=new qr(e);for(let n of r.json.meshes||[])G4t(n,t),r.addRequiredExtension(Sh)}async function U4t(e,t,r,n){let i=e.getObjectExtension(t,Sh);if(!i)return;let a=e.getTypedArrayForBufferView(i.bufferView),o=Gp(a.buffer,a.byteOffset),s={...r};delete s["3d-tiles"];let u=await So(o,xv,s,n),c=c2e(u.attributes);for(let[l,f]of Object.entries(c))if(l in t.attributes){let h=t.attributes[l],p=e.getAccessor(h);p!=null&&p.min&&(p!=null&&p.max)&&(f.min=p.min,f.max=p.max)}t.attributes=c,u.indices&&(t.indices=Fq(u.indices)),e.removeObjectExtension(t,Sh),z4t(t)}function G4t(e,t,r=4,n,i){var l;if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");let a=n.DracoWriter.encodeSync({attributes:e}),o=(l=i==null?void 0:i.parseSync)==null?void 0:l.call(i,{attributes:e}),s=n._addFauxAttributes(o.attributes),u=n.addBufferView(a);return{primitives:[{attributes:s,mode:r,extensions:{[Sh]:{bufferView:u,attributes:s}}}]}}function z4t(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*l2e(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var Oq={};ca(Oq,{decode:()=>K4t,name:()=>H4t});var Bq="KHR_texture_transform",H4t=Bq,Z8=new ce,W4t=new Rr,V4t=new Rr;async function K4t(e,t){var a;if(!new qr(e).hasExtension(Bq)||!((a=t.gltf)!=null&&a.loadBuffers))return;let i=e.json.materials||[];for(let o=0;o<i.length;o++)$4t(o,e)}function $4t(e,t){var c,l,f;let r=[],n=(c=t.json.materials)==null?void 0:c[e],i=(l=n==null?void 0:n.pbrMetallicRoughness)==null?void 0:l.baseColorTexture;i&&h_(t,e,i,r);let a=n==null?void 0:n.emissiveTexture;a&&h_(t,e,a,r);let o=n==null?void 0:n.normalTexture;o&&h_(t,e,o,r);let s=n==null?void 0:n.occlusionTexture;s&&h_(t,e,s,r);let u=(f=n==null?void 0:n.pbrMetallicRoughness)==null?void 0:f.metallicRoughnessTexture;u&&h_(t,e,u,r)}function h_(e,t,r,n){let i=Y4t(r,n);if(!i)return;let a=e.json.meshes||[];for(let o of a)for(let s of o.primitives){let u=s.material;Number.isFinite(u)&&t===u&&J4t(e,s,i)}}function Y4t(e,t){var o;let r=(o=e.extensions)==null?void 0:o[Bq],{texCoord:n=0}=e,{texCoord:i=n}=r;if(!(t.findIndex(([s,u])=>s===n&&u===i)!==-1)){let s=Z4t(r);return n!==i&&(e.texCoord=i),t.push([n,i]),{originalTexCoord:n,texCoord:i,matrix:s}}return null}function J4t(e,t,r){var s,u;let{originalTexCoord:n,texCoord:i,matrix:a}=r,o=t.attributes[`TEXCOORD_${n}`];if(Number.isFinite(o)){let c=(s=e.json.accessors)==null?void 0:s[o];if(c&&c.bufferView){let l=(u=e.json.bufferViews)==null?void 0:u[c.bufferView];if(l){let{arrayBuffer:f,byteOffset:h}=e.buffers[l.buffer],p=(h||0)+(c.byteOffset||0)+(l.byteOffset||0),{ArrayType:d,length:b}=Dv(c,l),g=P8[c.componentType],x=I8[c.type],E=l.byteStride||g*x,S=new Float32Array(b);for(let F=0;F<c.count;F++){let D=new d(f,p+F*E,2);Z8.set(D[0],D[1],1),Z8.transformByMatrix3(a),S.set([Z8[0],Z8[1]],F*x)}n===i?X4t(c,l,e.buffers,S):Q4t(i,c,t,e,S)}}}}function X4t(e,t,r,n){e.componentType=5126,r.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),t.buffer=r.length-1,t.byteLength=n.buffer.byteLength,t.byteOffset=0,delete t.byteStride}function Q4t(e,t,r,n,i){n.buffers.push({arrayBuffer:i.buffer,byteOffset:0,byteLength:i.buffer.byteLength});let a=n.json.bufferViews;if(!a)return;a.push({buffer:n.buffers.length-1,byteLength:i.buffer.byteLength,byteOffset:0});let o=n.json.accessors;o&&(o.push({bufferView:(a==null?void 0:a.length)-1,byteOffset:0,componentType:5126,count:t.count,type:"VEC2"}),r.attributes[`TEXCOORD_${e}`]=o.length-1)}function Z4t(e){let{offset:t=[0,0],rotation:r=0,scale:n=[1,1]}=e,i=new Rr().set(1,0,0,0,1,0,t[0],t[1],1),a=W4t.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),o=V4t.set(n[0],0,0,0,n[1],0,0,0,1);return i.multiplyRight(a).multiplyRight(o)}var Iq={};ca(Iq,{decode:()=>tFt,encode:()=>rFt,name:()=>eFt});var Pd="KHR_lights_punctual",eFt=Pd;async function tFt(e){let t=new qr(e),{json:r}=t,n=t.getExtension(Pd);n&&(t.json.lights=n.lights,t.removeExtension(Pd));for(let i of r.nodes||[]){let a=t.getObjectExtension(i,Pd);a&&(i.light=a.light),t.removeObjectExtension(i,Pd)}}async function rFt(e){let t=new qr(e),{json:r}=t;if(r.lights){let n=t.addExtension(Pd);Ni(!n.lights),n.lights=r.lights,delete r.lights}if(t.json.lights){for(let n of t.json.lights){let i=n.node;t.addObjectExtension(i,Pd,n)}delete t.json.lights}}var Pq={};ca(Pq,{decode:()=>iFt,encode:()=>aFt,name:()=>nFt});var p_="KHR_materials_unlit",nFt=p_;async function iFt(e){let t=new qr(e),{json:r}=t;for(let n of r.materials||[])n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),t.removeObjectExtension(n,p_);t.removeExtension(p_)}function aFt(e){let t=new qr(e),{json:r}=t;if(t.materials)for(let n of r.materials||[])n.unlit&&(delete n.unlit,t.addObjectExtension(n,p_,{}),t.addExtension(p_))}var Rq={};ca(Rq,{decode:()=>sFt,encode:()=>uFt,name:()=>oFt});var d_="KHR_techniques_webgl",oFt=d_;async function sFt(e){let t=new qr(e),{json:r}=t,n=t.getExtension(d_);if(n){let i=cFt(n,t);for(let a of r.materials||[]){let o=t.getObjectExtension(a,d_);o&&(a.technique=Object.assign({},o,i[o.technique]),a.technique.values=lFt(a.technique,t)),t.removeObjectExtension(a,d_)}t.removeExtension(d_)}}async function uFt(e,t){}function cFt(e,t){let{programs:r=[],shaders:n=[],techniques:i=[]}=e,a=new TextDecoder;return n.forEach(o=>{if(Number.isFinite(o.bufferView))o.code=a.decode(t.getTypedArrayForBufferView(o.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),r.forEach(o=>{o.fragmentShader=n[o.fragmentShader],o.vertexShader=n[o.vertexShader]}),i.forEach(o=>{o.program=r[o.program]}),i}function lFt(e,t){let r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(n=>{e.uniforms[n].value&&!(n in r)&&(r[n]=e.uniforms[n].value)}),Object.keys(r).forEach(n=>{typeof r[n]=="object"&&r[n].index!==void 0&&(r[n].texture=t.getTexture(r[n].index))}),r}var f2e=[cq,oq,Tq,Cq,Dq,kq,Iq,Pq,Rq,Oq,lq];function h2e(e,t={},r){var i;let n=f2e.filter(a=>d2e(a.name,t));for(let a of n)(i=a.preprocess)==null||i.call(a,e,t,r)}async function p2e(e,t={},r){var i;let n=f2e.filter(a=>d2e(a.name,t));for(let a of n)await((i=a.decode)==null?void 0:i.call(a,e,t,r))}function d2e(e,t){var i;let r=((i=t==null?void 0:t.gltf)==null?void 0:i.excludeExtensions)||{};return!(e in r&&!r[e])}var jq="KHR_binary_glTF";function m2e(e){let t=new qr(e),{json:r}=t;for(let n of r.images||[]){let i=t.getObjectExtension(n,jq);i&&Object.assign(n,i),t.removeObjectExtension(n,jq)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(jq)}var g2e={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},hFt={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Lq=class{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(t,r){this.json=t.json;let n=t.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${n.asset.version}`);return}if(!r.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),m2e(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(let r in g2e)this._convertTopLevelObjectToArray(t,r)}_convertTopLevelObjectToArray(t,r){let n=t[r];if(!(!n||Array.isArray(n))){t[r]=[];for(let i in n){let a=n[i];a.id=a.id||i;let o=t[r].length;t[r].push(a),this.idToIndexMap[r][i]=o}}}_convertObjectIdsToArrayIndices(t){for(let r in g2e)this._convertIdsToIndices(t,r);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(let r of t.textures)this._convertTextureIds(r);for(let r of t.meshes)this._convertMeshIds(r);for(let r of t.nodes)this._convertNodeIds(r);for(let r of t.scenes)this._convertSceneIds(r)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(let r of t.primitives){let{attributes:n,indices:i,material:a}=r;for(let o in n)n[o]=this._convertIdToIndex(n[o],"accessor");i&&(r.indices=this._convertIdToIndex(i,"accessor")),a&&(r.material=this._convertIdToIndex(a,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map(r=>this._convertIdToIndex(r,"node"))),t.meshes&&(t.meshes=t.meshes.map(r=>this._convertIdToIndex(r,"mesh")))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map(r=>this._convertIdToIndex(r,"node")))}_convertIdsToIndices(t,r){t[r]||(console.warn(`gltf v1: json doesn't contain attribute ${r}`),t[r]=[]);for(let n of t[r])for(let i in n){let a=n[i],o=this._convertIdToIndex(a,i);n[i]=o}}_convertIdToIndex(t,r){let n=hFt[r];if(n in this.idToIndexMap){let i=this.idToIndexMap[n][t];if(!Number.isFinite(i))throw new Error(`gltf v1: failed to resolve ${r} with id ${t}`);return i}return t}_updateObjects(t){for(let r of this.json.buffers)delete r.type}_updateMaterial(t){var r,n,i;for(let a of t.materials){a.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};let o=((r=a.values)==null?void 0:r.tex)||((n=a.values)==null?void 0:n.texture2d_0)||((i=a.values)==null?void 0:i.diffuseTex),s=t.textures.findIndex(u=>u.id===o);s!==-1&&(a.pbrMetallicRoughness.baseColorTexture={index:s})}}};function v2e(e,t={}){return new Lq().normalize(e,t)}async function b2e(e,t,r=0,n,i){var a,o,s;return pFt(e,t,r,n),v2e(e,{normalize:(a=n==null?void 0:n.gltf)==null?void 0:a.normalize}),h2e(e,n,i),(o=n==null?void 0:n.gltf)!=null&&o.loadBuffers&&e.json.buffers&&await dFt(e,n,i),(s=n==null?void 0:n.gltf)!=null&&s.loadImages&&await mFt(e,n,i),await p2e(e,n,i),e}function pFt(e,t,r,n){if(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!o2e(t,r,n)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=UI(t);else if(t instanceof ArrayBuffer){let o={};r=s2e(o,t,r,n.glb),Ni(o.type==="glTF",`Invalid GLB magic string ${o.type}`),e._glb=o,e.json=o.json}else Ni(!1,"GLTF: must be ArrayBuffer or string");let i=e.json.buffers||[];if(e.buffers=new Array(i.length).fill(null),e._glb&&e._glb.header.hasBinChunk){let{binChunks:o}=e._glb;e.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}let a=e.json.images||[];e.images=new Array(a.length).fill({})}async function dFt(e,t,r){var i,a;let n=e.json.buffers||[];for(let o=0;o<n.length;++o){let s=n[o];if(s.uri){let{fetch:u}=r;Ni(u);let c=Aq(s.uri,t),l=await((i=r==null?void 0:r.fetch)==null?void 0:i.call(r,c)),f=await((a=l==null?void 0:l.arrayBuffer)==null?void 0:a.call(l));e.buffers[o]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete s.uri}else e.buffers[o]===null&&(e.buffers[o]={arrayBuffer:new ArrayBuffer(s.byteLength),byteOffset:0,byteLength:s.byteLength})}}async function mFt(e,t,r){let n=gFt(e),i=e.json.images||[],a=[];for(let o of n)a.push(vFt(e,i[o],o,t,r));return await Promise.all(a)}function gFt(e){let t=new Set,r=e.json.textures||[];for(let n of r)n.source!==void 0&&t.add(n.source);return Array.from(t).sort()}async function vFt(e,t,r,n,i){let a;if(t.uri&&!t.hasOwnProperty("bufferView")){let s=Aq(t.uri,n),{fetch:u}=i;a=await(await u(s)).arrayBuffer(),t.bufferView={data:a}}if(Number.isFinite(t.bufferView)){let s=C_e(e.json,e.buffers,t.bufferView);a=Gp(s.buffer,s.byteOffset,s.byteLength)}Ni(a,"glTF image has no data");let o=await So(a,[Tv,Id],{...n,mimeType:t.mimeType,basis:n.basis||{format:Pv()}},i);o&&o[0]&&(o={compressed:!0,mipmaps:!1,width:o[0].width,height:o[0].height,data:o[0]}),e.images=e.images||[],e.images[r]=o}var Il={name:"glTF",id:"gltf",module:"gltf",version:U8,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:bFt,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function bFt(e,t={},r){t={...Il.options,...t},t.gltf={...Il.options.gltf,...t.gltf};let{byteOffset:n=0}=t;return await b2e({},e,n,t,r)}var yFt=1179937895,xFt=1313821514,_Ft=5130562,wc=!0;function y2e(e,t,r=0,n={}){let{magic:i=yFt,version:a=2,json:o={},binary:s}=e,u=r;t&&(t.setUint32(r+0,i,wc),t.setUint32(r+4,a,wc),t.setUint32(r+8,0,wc));let c=r+8;r+=12;let l=r;t&&(t.setUint32(r+0,0,wc),t.setUint32(r+4,xFt,wc)),r+=8;let f=JSON.stringify(o);if(r=Bm(t,r,f,4),t){let h=r-l-8;t.setUint32(l+0,h,wc)}if(s){let h=r;if(t&&(t.setUint32(r+0,0,wc),t.setUint32(r+4,_Ft,wc)),r+=8,r=BA(t,r,s,4),t){let p=r-h-8;t.setUint32(h+0,p,wc)}}if(t){let h=r-u;t.setUint32(c,h,wc)}return r}function Mq(e,t,r,n){return wFt(e),y2e(e,t,r,n)}function wFt(e,{firstBuffer:t=0}={}){if(e.buffers&&e.buffers.length>t)throw new Error("encodeGLTF: multiple buffers not yet implemented")}var qq={name:"glTF",id:"gltf",module:"gltf",version:U8,extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,encodeSync:EFt,options:{gltf:{}}};function EFt(e,t={}){let{byteOffset:r=0}=t,n=Mq(e,null,r,t),i=new ArrayBuffer(n),a=new DataView(i);return Mq(e,a,r,t),i}var AFt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},SFt={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},bs={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},TFt={magFilter:bs.TEXTURE_MAG_FILTER,minFilter:bs.TEXTURE_MIN_FILTER,wrapS:bs.TEXTURE_WRAP_S,wrapT:bs.TEXTURE_WRAP_T},CFt={[bs.TEXTURE_MAG_FILTER]:bs.LINEAR,[bs.TEXTURE_MIN_FILTER]:bs.NEAREST_MIPMAP_LINEAR,[bs.TEXTURE_WRAP_S]:bs.REPEAT,[bs.TEXTURE_WRAP_T]:bs.REPEAT};function DFt(){return{id:"default-sampler",parameters:CFt}}function FFt(e){return SFt[e]}function kFt(e){return AFt[e]}var Nq=class{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(t,r={}){let{json:n,buffers:i=[],images:a=[]}=t,{baseUri:o=""}=t;return Ni(n),this.baseUri=o,this.buffers=i,this.images=a,this.jsonUnprocessed=n,this.json=this._resolveTree(t.json,r),this.json}_resolveTree(t,r={}){let n={...t};return this.json=n,t.bufferViews&&(n.bufferViews=t.bufferViews.map((i,a)=>this._resolveBufferView(i,a))),t.images&&(n.images=t.images.map((i,a)=>this._resolveImage(i,a))),t.samplers&&(n.samplers=t.samplers.map((i,a)=>this._resolveSampler(i,a))),t.textures&&(n.textures=t.textures.map((i,a)=>this._resolveTexture(i,a))),t.accessors&&(n.accessors=t.accessors.map((i,a)=>this._resolveAccessor(i,a))),t.materials&&(n.materials=t.materials.map((i,a)=>this._resolveMaterial(i,a))),t.meshes&&(n.meshes=t.meshes.map((i,a)=>this._resolveMesh(i,a))),t.nodes&&(n.nodes=t.nodes.map((i,a)=>this._resolveNode(i,a)),n.nodes=n.nodes.map((i,a)=>this._resolveNodeChildren(i))),t.skins&&(n.skins=t.skins.map((i,a)=>this._resolveSkin(i,a))),t.scenes&&(n.scenes=t.scenes.map((i,a)=>this._resolveScene(i,a))),typeof this.json.scene=="number"&&n.scenes&&(n.scene=n.scenes[this.json.scene]),n}getScene(t){return this._get(this.json.scenes,t)}getNode(t){return this._get(this.json.nodes,t)}getSkin(t){return this._get(this.json.skins,t)}getMesh(t){return this._get(this.json.meshes,t)}getMaterial(t){return this._get(this.json.materials,t)}getAccessor(t){return this._get(this.json.accessors,t)}getCamera(t){return this._get(this.json.cameras,t)}getTexture(t){return this._get(this.json.textures,t)}getSampler(t){return this._get(this.json.samplers,t)}getImage(t){return this._get(this.json.images,t)}getBufferView(t){return this._get(this.json.bufferViews,t)}getBuffer(t){return this._get(this.json.buffers,t)}_get(t,r){if(typeof r=="object")return r;let n=t&&t[r];return n||console.warn(`glTF file error: Could not find ${t}[${r}]`),n}_resolveScene(t,r){return{...t,id:t.id||`scene-${r}`,nodes:(t.nodes||[]).map(n=>this.getNode(n))}}_resolveNode(t,r){let n={...t,id:(t==null?void 0:t.id)||`node-${r}`};return t.mesh!==void 0&&(n.mesh=this.getMesh(t.mesh)),t.camera!==void 0&&(n.camera=this.getCamera(t.camera)),t.skin!==void 0&&(n.skin=this.getSkin(t.skin)),t.meshes!==void 0&&t.meshes.length&&(n.mesh=t.meshes.reduce((i,a)=>{let o=this.getMesh(a);return i.id=o.id,i.primitives=i.primitives.concat(o.primitives),i},{primitives:[]})),n}_resolveNodeChildren(t){return t.children&&(t.children=t.children.map(r=>this.getNode(r))),t}_resolveSkin(t,r){let n=typeof t.inverseBindMatrices=="number"?this.getAccessor(t.inverseBindMatrices):void 0;return{...t,id:t.id||`skin-${r}`,inverseBindMatrices:n}}_resolveMesh(t,r){let n={...t,id:t.id||`mesh-${r}`,primitives:[]};return t.primitives&&(n.primitives=t.primitives.map(i=>{let a={...i,attributes:{},indices:void 0,material:void 0},o=i.attributes;for(let s in o)a.attributes[s]=this.getAccessor(o[s]);return i.indices!==void 0&&(a.indices=this.getAccessor(i.indices)),i.material!==void 0&&(a.material=this.getMaterial(i.material)),a})),n}_resolveMaterial(t,r){let n={...t,id:t.id||`material-${r}`};if(n.normalTexture&&(n.normalTexture={...n.normalTexture},n.normalTexture.texture=this.getTexture(n.normalTexture.index)),n.occlusionTexture&&(n.occlusionTexture={...n.occlusionTexture},n.occlusionTexture.texture=this.getTexture(n.occlusionTexture.index)),n.emissiveTexture&&(n.emissiveTexture={...n.emissiveTexture},n.emissiveTexture.texture=this.getTexture(n.emissiveTexture.index)),n.emissiveFactor||(n.emissiveFactor=n.emissiveTexture?[1,1,1]:[0,0,0]),n.pbrMetallicRoughness){n.pbrMetallicRoughness={...n.pbrMetallicRoughness};let i=n.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture={...i.baseColorTexture},i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture={...i.metallicRoughnessTexture},i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return n}_resolveAccessor(t,r){let n=FFt(t.componentType),i=kFt(t.type),a=n*i,o={...t,id:t.id||`accessor-${r}`,bytesPerComponent:n,components:i,bytesPerElement:a,value:void 0,bufferView:void 0,sparse:void 0};if(t.bufferView!==void 0&&(o.bufferView=this.getBufferView(t.bufferView)),o.bufferView){let s=o.bufferView.buffer,{ArrayType:u,byteLength:c}=Dv(o,o.bufferView),l=(o.bufferView.byteOffset||0)+(o.byteOffset||0)+s.byteOffset,f=s.arrayBuffer.slice(l,l+c);o.bufferView.byteStride&&(f=this._getValueFromInterleavedBuffer(s,l,o.bufferView.byteStride,o.bytesPerElement,o.count)),o.value=new u(f)}return o}_getValueFromInterleavedBuffer(t,r,n,i,a){let o=new Uint8Array(a*i);for(let s=0;s<a;s++){let u=r+s*n;o.set(new Uint8Array(t.arrayBuffer.slice(u,u+i)),s*i)}return o.buffer}_resolveTexture(t,r){return{...t,id:t.id||`texture-${r}`,sampler:typeof t.sampler=="number"?this.getSampler(t.sampler):DFt(),source:typeof t.source=="number"?this.getImage(t.source):void 0}}_resolveSampler(t,r){let n={id:t.id||`sampler-${r}`,...t,parameters:{}};for(let i in n){let a=this._enumSamplerParameter(i);a!==void 0&&(n.parameters[a]=n[i])}return n}_enumSamplerParameter(t){return TFt[t]}_resolveImage(t,r){let n={...t,id:t.id||`image-${r}`,image:null,bufferView:t.bufferView!==void 0?this.getBufferView(t.bufferView):void 0},i=this.images[r];return i&&(n.image=i),n}_resolveBufferView(t,r){let n=t.buffer,i=this.buffers[n].arrayBuffer,a=this.buffers[n].byteOffset||0;return t.byteOffset&&(a+=t.byteOffset),{id:`bufferView-${r}`,...t,buffer:this.buffers[n],data:new Uint8Array(i,a,t.byteLength)}}_resolveCamera(t,r){let n={...t,id:t.id||`camera-${r}`};return n.perspective,n.orthographic,n}};function m_(e,t){return new Nq().postProcess(e,t)}var eD={URI:0,EMBEDDED:1};function tD(e,t,r,n){e.rotateYtoZ=!0;let i=(e.byteOffset||0)+(e.byteLength||0)-r;if(i===0)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n!=null&&n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=Gp(t,r,i),e.gltfByteOffset=0,e.gltfByteLength=i,r%4===0||console.warn(`${e.type}: embedded glb is not aligned to a 4-byte boundary.`),(e.byteOffset||0)+(e.byteLength||0)}async function rD(e,t,r,n){let i=(r==null?void 0:r["3d-tiles"])||{};if(BFt(e,t,r),i.loadGLTF){if(!n)return;if(e.gltfUrl){let{fetch:a}=n,o=await a(e.gltfUrl,r);e.gltfArrayBuffer=await o.arrayBuffer(),e.gltfByteOffset=0}if(e.gltfArrayBuffer){let a=await So(e.gltfArrayBuffer,Il,r,n);e.gltf=m_(a),e.gpuMemoryUsageInBytes=a_(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength}}}function BFt(e,t,r){switch(t){case eD.URI:if(e.gltfArrayBuffer){let n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),a=new TextDecoder().decode(n);e.gltfUrl=a.replace(/[\s\0]+$/,"")}delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case eD.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function x2e(e,t,r,n,i){var o;r=OFt(e,t,r,n,i),await rD(e,eD.EMBEDDED,n,i);let a=(o=e==null?void 0:e.gltf)==null?void 0:o.extensions;return a&&a.CESIUM_RTC&&(e.rtcCenter=a.CESIUM_RTC.center),r}function OFt(e,t,r,n,i){r=Ah(e,t,r),r=Ev(e,t,r),r=Av(e,t,r,n),r=tD(e,t,r,n);let a=new Bl(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3),r}async function _2e(e,t,r,n,i){return r=IFt(e,t,r,n,i),await rD(e,e.gltfFormat||0,n,i),r}function IFt(e,t,r,n,i){var c;if(r=Ah(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=Ev(e,t,r);let a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r+=4,r=Av(e,t,r,n),r=tD(e,t,r,n),!((c=e==null?void 0:e.header)!=null&&c.featureTableJsonByteLength)||e.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let o=new Bl(e.featureTableJson,e.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=o.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3);let u=new Bd(e.batchTableJson,e.batchTableBinary,s);return PFt(e,o,u,s),r}function PFt(e,t,r,n){let i=new Array(n),a=new ce,o=new ce,s=new ce,u=new ce,c=new Rr,l=new ps,f=new ce,h={},p=new Kr,d=[],b=[],g=[],x=[];for(let E=0;E<n;E++){let S;if(t.hasProperty("POSITION"))S=t.getProperty("POSITION",Ht.FLOAT,3,E,a);else if(t.hasProperty("POSITION_QUANTIZED")){S=t.getProperty("POSITION_QUANTIZED",Ht.UNSIGNED_SHORT,3,E,a);let I=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Ht.FLOAT,3);if(!I)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let P=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Ht.FLOAT,3);if(!P)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let U=65535;for(let Y=0;Y<3;Y++)S[Y]=S[Y]/U*P[Y]+I[Y]}if(!S)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");a.copy(S),h.translation=a,e.normalUp=t.getProperty("NORMAL_UP",Ht.FLOAT,3,E,d),e.normalRight=t.getProperty("NORMAL_RIGHT",Ht.FLOAT,3,E,b);let F=!1;if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",Ht.UNSIGNED_SHORT,2,E,d),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",Ht.UNSIGNED_SHORT,2,E,b),e.octNormalUp)throw e.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");e.eastNorthUp?(or.WGS84.eastNorthUpToFixedFrame(a,p),p.getRotationMatrix3(c)):c.identity()}F&&(u.copy(o).cross(s).normalize(),c.setColumn(0,o),c.setColumn(1,s),c.setColumn(2,u)),l.fromMatrix3(c),h.rotation=l,f.set(1,1,1);let D=t.getProperty("SCALE",Ht.FLOAT,1,E,g);Number.isFinite(D)&&f.multiplyByScalar(D);let j=t.getProperty("SCALE_NON_UNIFORM",Ht.FLOAT,3,E,d);j&&f.scale(j),h.scale=f;let k=t.getProperty("BATCH_ID",Ht.UNSIGNED_SHORT,1,E,x);k===void 0&&(k=E);let N=new Kr().fromQuaternion(h.rotation);p.identity(),p.translate(h.translation),p.multiplyRight(N),p.scale(h.scale);let C=p.clone();i[E]={modelMatrix:C,batchId:k}}e.instances=i}async function w2e(e,t,r,n,i,a){r=Ah(e,t,r);let o=new DataView(t);for(e.tilesLength=o.getUint32(r,!0),r+=4,e.tiles=[];e.tiles.length<e.tilesLength&&(e.byteLength||0)-r>12;){let s={shape:"tile3d"};e.tiles.push(s),r=await a(t,r,n,i,s)}return r}async function E2e(e,t,r,n){var i,a;if(e.rotateYtoZ=!0,e.gltfUpAxis=(i=r==null?void 0:r["3d-tiles"])!=null&&i.assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",(a=r==null?void 0:r["3d-tiles"])!=null&&a.loadGLTF){if(!n)return t.byteLength;let o=await So(t,Il,r,n);e.gltf=m_(o),e.gpuMemoryUsageInBytes=a_(e.gltf)}else e.gltfArrayBuffer=t;return t.byteLength}async function Uq(e,t=0,r,n,i={shape:"tile3d"}){switch(i.byteOffset=t,i.type=W1e(e,t),i.type){case ms.COMPOSITE:return await w2e(i,e,t,r,n,Uq);case ms.BATCHED_3D_MODEL:return await x2e(i,e,t,r,n);case ms.GLTF:return await E2e(i,e,r,n);case ms.INSTANCED_3D_MODEL:return await _2e(i,e,t,r,n);case ms.POINT_CLOUD:return await f_e(i,e,t,r,n);default:throw new Error(`3DTileLoader: unknown type ${i.type}`)}}async function Gq(e,t,r){if(new Uint32Array(e.slice(0,4))[0]!==1952609651)throw new Error("Wrong subtree file magic number");if(new Uint32Array(e.slice(4,8))[0]!==1)throw new Error("Wrong subtree file verson, must be 1");let a=A2e(e.slice(8,16)),o=new Uint8Array(e,24,a),u=new TextDecoder("utf8").decode(o),c=JSON.parse(u),l=A2e(e.slice(16,24)),f=new ArrayBuffer(0);if(l&&(f=e.slice(24+a)),await nD(c,c.tileAvailability,f,r),Array.isArray(c.contentAvailability))for(let h of c.contentAvailability)await nD(c,h,f,r);else await nD(c,c.contentAvailability,f,r);return await nD(c,c.childSubtreeAvailability,f,r),c}async function nD(e,t,r,n){let i=Number.isFinite(t.bitstream)?t.bitstream:t.bufferView;if(typeof i!="number")return;let a=e.bufferViews[i],o=e.buffers[a.buffer];if(!(n!=null&&n.baseUrl))throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(o.uri){let s=`${(n==null?void 0:n.baseUrl)||""}/${o.uri}`,c=await(await n.fetch(s)).arrayBuffer();t.explicitBitstream=new Uint8Array(c,a.byteOffset,a.byteLength);return}t.explicitBitstream=new Uint8Array(r,a.byteOffset,a.byteLength)}function A2e(e){let t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+2**32*n}var iD={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:yv,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Gq,options:{}};function zq(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 t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function pu(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||zq()}var RFt=globalThis.self||globalThis.window||globalThis.global,Lv=globalThis.window||globalThis.self||globalThis.global,jFt=globalThis.document||{},Rd=globalThis.process||{},LFt=globalThis.console,$wr=globalThis.navigator||{};var aD="4.0.0",Xwr=pu();function MFt(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var oD=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=MFt(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function S2e(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function T2e(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function sD(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var uD;(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"})(uD||(uD={}));var qFt=10;function C2e(e){return typeof e!="string"?e:(e=e.toUpperCase(),uD[e]||uD.WHITE)}function D2e(e,t,r){if(!pu&&typeof e=="string"){if(t){let n=C2e(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=C2e(r);e="\x1B[".concat(n+qFt,"m").concat(e,"\x1B[49m")}}return e}function F2e(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),i=e;for(let a of n){let o=i[a];typeof o=="function"&&(t.find(s=>a===s)||(i[a]=o.bind(e)))}}function Mv(e,t){if(!e)throw new Error(t||"Assertion failed")}function jd(){let e;if(pu()&&Lv.performance){var t,r;e=Lv===null||Lv===void 0||(t=Lv.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Rd){var n;let i=Rd===null||Rd===void 0||(n=Rd.hrtime)===null||n===void 0?void 0:n.call(Rd);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var qv={debug:pu()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},NFt={enabled:!0,level:0};function ys(){}var k2e={},B2e={once:!0},g_=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=aD,this._startTs=jd(),this._deltaTs=jd(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new oD("__probe-".concat(this.id,"__"),NFt),this.timeStamp("".concat(this.id," started")),F2e(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((jd()-this._startTs).toPrecision(10))}getDelta(){return Number((jd()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){Mv(t,r)}warn(t){return this._getLogFunction(0,t,qv.warn,arguments,B2e)}error(t){return this._getLogFunction(0,t,qv.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,qv.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,qv.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,qv.debug||qv.info,arguments,B2e)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||ys,n&&[n],{tag:HFt(r)}):ys}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?pu()?zFt({image:i,message:a,scale:o}):GFt({image:i,message:a,scale:o}):ys}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||ys)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=O2e({logLevel:t,message:r,opts:n}),{collapsed:a}=n;return i.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||ys)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=I2e(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=O2e({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,Mv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=jd();let o=a.tag||a.message;if(a.once&&o)if(!k2e[o])k2e[o]=jd();else return ys;return r=UFt(this.id,a.message,a),n.bind(console,r,...a.args)}return ys}};g_.VERSION=aD;function I2e(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Mv(Number.isFinite(t)&&t>=0),t}function O2e(e){let{logLevel:t,message:r}=e;e.logLevel=I2e(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let i=typeof e.message;return Mv(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function UFt(e,t,r){if(typeof t=="string"){let n=r.time?T2e(S2e(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=D2e(t,r.color,r.background)}return t}function GFt(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),ys}function zFt(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=sD(a,r,n);console.log(...o)},a.src=t,ys}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...sD(t,r,n)),ys;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...sD(a,r,n)),a.src=t.toDataURL(),ys}return ys}function HFt(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Hq=new g_({id:"@probe.gl/log"});var xs=null;try{xs=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function kn(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}kn.prototype.__isLong__;Object.defineProperty(kn.prototype,"__isLong__",{value:!0});function Ma(e){return(e&&e.__isLong__)===!0}function P2e(e){var t=Math.clz32(e&-e);return e?31-t:t}kn.isLong=Ma;var R2e={},j2e={};function Ld(e,t){var r,n,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(n=j2e[e],n)?n:(r=$r(e,0,!0),i&&(j2e[e]=r),r)):(e|=0,(i=-128<=e&&e<128)&&(n=R2e[e],n)?n:(r=$r(e,e<0?-1:0,!1),i&&(R2e[e]=r),r))}kn.fromInt=Ld;function _s(e,t){if(isNaN(e))return t?Pl:du;if(t){if(e<0)return Pl;if(e>=N2e)return z2e}else{if(e<=-M2e)return mo;if(e+1>=M2e)return G2e}return e<0?_s(-e,t).neg():$r(e%Uv|0,e/Uv|0,t)}kn.fromNumber=_s;function $r(e,t,r){return new kn(e,t,r)}kn.fromBits=$r;var cD=Math.pow;function Vq(e,t,r){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(r=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?Pl:du;if(r=r||10,r<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return Vq(e.substring(1),t,r).neg();for(var i=_s(cD(r,8)),a=du,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),u=parseInt(e.substring(o,o+s),r);if(s<8){var c=_s(cD(r,s));a=a.mul(c).add(_s(u))}else a=a.mul(i),a=a.add(_s(u))}return a.unsigned=t,a}kn.fromString=Vq;function mu(e,t){return typeof e=="number"?_s(e,t):typeof e=="string"?Vq(e,t):$r(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}kn.fromValue=mu;var L2e=1<<16,WFt=1<<24,Uv=L2e*L2e,N2e=Uv*Uv,M2e=N2e/2,q2e=Ld(WFt),du=Ld(0);kn.ZERO=du;var Pl=Ld(0,!0);kn.UZERO=Pl;var Nv=Ld(1);kn.ONE=Nv;var U2e=Ld(1,!0);kn.UONE=U2e;var Wq=Ld(-1);kn.NEG_ONE=Wq;var G2e=$r(-1,2147483647,!1);kn.MAX_VALUE=G2e;var z2e=$r(-1,-1,!0);kn.MAX_UNSIGNED_VALUE=z2e;var mo=$r(0,-2147483648,!1);kn.MIN_VALUE=mo;var Ke=kn.prototype;Ke.toInt=function(){return this.unsigned?this.low>>>0:this.low};Ke.toNumber=function(){return this.unsigned?(this.high>>>0)*Uv+(this.low>>>0):this.high*Uv+(this.low>>>0)};Ke.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(mo)){var r=_s(t),n=this.div(r),i=n.mul(r).sub(this);return n.toString(t)+i.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var a=_s(cD(t,6),this.unsigned),o=this,s="";;){var u=o.div(a),c=o.sub(u.mul(a)).toInt()>>>0,l=c.toString(t);if(o=u,o.isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}};Ke.getHighBits=function(){return this.high};Ke.getHighBitsUnsigned=function(){return this.high>>>0};Ke.getLowBits=function(){return this.low};Ke.getLowBitsUnsigned=function(){return this.low>>>0};Ke.getNumBitsAbs=function(){if(this.isNegative())return this.eq(mo)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&!(t&1<<r);r--);return this.high!=0?r+33:r+1};Ke.isZero=function(){return this.high===0&&this.low===0};Ke.eqz=Ke.isZero;Ke.isNegative=function(){return!this.unsigned&&this.high<0};Ke.isPositive=function(){return this.unsigned||this.high>=0};Ke.isOdd=function(){return(this.low&1)===1};Ke.isEven=function(){return(this.low&1)===0};Ke.equals=function(t){return Ma(t)||(t=mu(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};Ke.eq=Ke.equals;Ke.notEquals=function(t){return!this.eq(t)};Ke.neq=Ke.notEquals;Ke.ne=Ke.notEquals;Ke.lessThan=function(t){return this.comp(t)<0};Ke.lt=Ke.lessThan;Ke.lessThanOrEqual=function(t){return this.comp(t)<=0};Ke.lte=Ke.lessThanOrEqual;Ke.le=Ke.lessThanOrEqual;Ke.greaterThan=function(t){return this.comp(t)>0};Ke.gt=Ke.greaterThan;Ke.greaterThanOrEqual=function(t){return this.comp(t)>=0};Ke.gte=Ke.greaterThanOrEqual;Ke.ge=Ke.greaterThanOrEqual;Ke.compare=function(t){if(Ma(t)||(t=mu(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};Ke.comp=Ke.compare;Ke.negate=function(){return!this.unsigned&&this.eq(mo)?mo:this.not().add(Nv)};Ke.neg=Ke.negate;Ke.add=function(t){Ma(t)||(t=mu(t));var r=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=t.high>>>16,s=t.high&65535,u=t.low>>>16,c=t.low&65535,l=0,f=0,h=0,p=0;return p+=a+c,h+=p>>>16,p&=65535,h+=i+u,f+=h>>>16,h&=65535,f+=n+s,l+=f>>>16,f&=65535,l+=r+o,l&=65535,$r(h<<16|p,l<<16|f,this.unsigned)};Ke.subtract=function(t){return Ma(t)||(t=mu(t)),this.add(t.neg())};Ke.sub=Ke.subtract;Ke.multiply=function(t){if(this.isZero())return this;if(Ma(t)||(t=mu(t)),xs){var r=xs.mul(this.low,this.high,t.low,t.high);return $r(r,xs.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?Pl:du;if(this.eq(mo))return t.isOdd()?mo:du;if(t.eq(mo))return this.isOdd()?mo:du;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(q2e)&&t.lt(q2e))return _s(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=t.high>>>16,u=t.high&65535,c=t.low>>>16,l=t.low&65535,f=0,h=0,p=0,d=0;return d+=o*l,p+=d>>>16,d&=65535,p+=a*l,h+=p>>>16,p&=65535,p+=o*c,h+=p>>>16,p&=65535,h+=i*l,f+=h>>>16,h&=65535,h+=a*c,f+=h>>>16,h&=65535,h+=o*u,f+=h>>>16,h&=65535,f+=n*l+i*c+a*u+o*s,f&=65535,$r(p<<16|d,f<<16|h,this.unsigned)};Ke.mul=Ke.multiply;Ke.divide=function(t){if(Ma(t)||(t=mu(t)),t.isZero())throw Error("division by zero");if(xs){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?xs.div_u:xs.div_s)(this.low,this.high,t.low,t.high);return $r(r,xs.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Pl:du;var n,i,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Pl;if(t.gt(this.shru(1)))return U2e;a=Pl}else{if(this.eq(mo)){if(t.eq(Nv)||t.eq(Wq))return mo;if(t.eq(mo))return Nv;var o=this.shr(1);return n=o.div(t).shl(1),n.eq(du)?t.isNegative()?Nv:Wq:(i=this.sub(t.mul(n)),a=n.add(i.div(t)),a)}else if(t.eq(mo))return this.unsigned?Pl:du;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();a=du}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),u=s<=48?1:cD(2,s-48),c=_s(n),l=c.mul(t);l.isNegative()||l.gt(i);)n-=u,c=_s(n,this.unsigned),l=c.mul(t);c.isZero()&&(c=Nv),a=a.add(c),i=i.sub(l)}return a};Ke.div=Ke.divide;Ke.modulo=function(t){if(Ma(t)||(t=mu(t)),xs){var r=(this.unsigned?xs.rem_u:xs.rem_s)(this.low,this.high,t.low,t.high);return $r(r,xs.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};Ke.mod=Ke.modulo;Ke.rem=Ke.modulo;Ke.not=function(){return $r(~this.low,~this.high,this.unsigned)};Ke.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};Ke.clz=Ke.countLeadingZeros;Ke.countTrailingZeros=function(){return this.low?P2e(this.low):P2e(this.high)+32};Ke.ctz=Ke.countTrailingZeros;Ke.and=function(t){return Ma(t)||(t=mu(t)),$r(this.low&t.low,this.high&t.high,this.unsigned)};Ke.or=function(t){return Ma(t)||(t=mu(t)),$r(this.low|t.low,this.high|t.high,this.unsigned)};Ke.xor=function(t){return Ma(t)||(t=mu(t)),$r(this.low^t.low,this.high^t.high,this.unsigned)};Ke.shiftLeft=function(t){return Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?$r(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):$r(0,this.low<<t-32,this.unsigned)};Ke.shl=Ke.shiftLeft;Ke.shiftRight=function(t){return Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?$r(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):$r(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};Ke.shr=Ke.shiftRight;Ke.shiftRightUnsigned=function(t){return Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?$r(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?$r(this.high,0,this.unsigned):$r(this.high>>>t-32,0,this.unsigned)};Ke.shru=Ke.shiftRightUnsigned;Ke.shr_u=Ke.shiftRightUnsigned;Ke.rotateLeft=function(t){var r;return Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?$r(this.high,this.low,this.unsigned):t<32?(r=32-t,$r(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,$r(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))};Ke.rotl=Ke.rotateLeft;Ke.rotateRight=function(t){var r;return Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?$r(this.high,this.low,this.unsigned):t<32?(r=32-t,$r(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,$r(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};Ke.rotr=Ke.rotateRight;Ke.toSigned=function(){return this.unsigned?$r(this.low,this.high,!1):this};Ke.toUnsigned=function(){return this.unsigned?this:$r(this.low,this.high,!0)};Ke.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};Ke.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};Ke.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};kn.fromBytes=function(t,r,n){return n?kn.fromBytesLE(t,r):kn.fromBytesBE(t,r)};kn.fromBytesLE=function(t,r){return new kn(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};kn.fromBytesBE=function(t,r){return new kn(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)};var Gv=kn;var VFt=16;function v_(e){e==="X"&&(e="");let t=e.padEnd(VFt,"0");return Gv.fromString(t,!0,16)}function Kq(e){if(e.isZero())return"X";let t=e.countTrailingZeros(),r=t%4;t=(t-r)/4;let n=t;t*=4;let a=e.shiftRightUnsigned(t).toString(16).replace(/0+$/,"");return Array(17-n-a.length).join("0")+a}function $q(e,t){let r=KFt(e).shiftRightUnsigned(2);return e.add(Gv.fromNumber(2*t+1-4).multiply(r))}function KFt(e){return e.and(e.not().add(1))}var $Ft=3,YFt=30,JFt=2*YFt+1,H2e=180/Math.PI;function V2e(e){if(e.length===0)throw new Error(`Invalid Hilbert quad key ${e}`);let t=e.split("/"),r=parseInt(t[0],10),n=t[1],i=n.length,a=0,o=[0,0];for(let s=i-1;s>=0;s--){a=i-s;let u=n[s],c=0,l=0;u==="1"?l=1:u==="2"?(c=1,l=1):u==="3"&&(c=1);let f=Math.pow(2,a-1);XFt(f,o,c,l),o[0]+=f*c,o[1]+=f*l}if(r%2===1){let s=o[0];o[0]=o[1],o[1]=s}return{face:r,ij:o,level:a}}function K2e(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<$Ft+JFt;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),i=t.substring(3,r),a=i.length/2,o=Gv.fromString(n,!0,2).toString(10),s="";if(a!==0)for(s=Gv.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return`${o}/${s}`}function Yq(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function W2e(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Jq(e){return[W2e(e[0]),W2e(e[1])]}function Xq(e,[t,r]){switch(e){case 0:return[1,t,r];case 1:return[-t,1,r];case 2:return[-t,-r,1];case 3:return[-1,-r,-t];case 4:return[r,-1,-t];case 5:return[r,t,-1];default:throw new Error("Invalid face")}}function Qq([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*H2e,n*H2e]}function XFt(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let i=t[0];t[0]=t[1],t[1]=i}}function $2e(e){let t=Yq(e.ij,e.level,[.5,.5]),r=Jq(t),n=Xq(e.face,r);return Qq(n)}var QFt=100;function Zq(e){let{face:t,ij:r,level:n}=e,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],a=Math.max(1,Math.ceil(QFt*Math.pow(2,-n))),o=new Float64Array(4*a*2+2),s=0,u=0;for(let c=0;c<4;c++){let l=i[c].slice(0),f=i[c+1],h=(f[0]-l[0])/a,p=(f[1]-l[1])/a;for(let d=0;d<a;d++){l[0]+=h,l[1]+=p;let b=Yq(r,n,l),g=Jq(b),x=Xq(t,g),E=Qq(x);Math.abs(E[1])>89.999&&(E[0]=u);let S=E[0]-u;E[0]+=S>180?-360:S<-180?360:0,o[s++]=E[0],o[s++]=E[1],u=E[0]}}return o[s++]=o[0],o[s++]=o[1],o}function zv(e){let t=ZFt(e);return V2e(t)}function ZFt(e){if(e.indexOf("/")>0)return e;let t=v_(e);return K2e(t)}function eN(e){let t=zv(e);return $2e(t)}function J2e(e){let t;if(e.face===2||e.face===5){let r=null,n=0;for(let i=0;i<4;i++){let a=`${e.face}/${i}`,o=zv(a),s=Zq(o);(typeof r>"u"||r===null)&&(r=new Float64Array(4*s.length)),r.set(s,n),n+=s.length}t=Y2e(r)}else{let r=Zq(e);t=Y2e(r)}return t}function Y2e(e){if(e.length%2!==0)throw new Error("Invalid corners");let t=[],r=[];for(let n=0;n<e.length;n+=2)t.push(e[n]),r.push(e[n+1]);return t.sort((n,i)=>n-i),r.sort((n,i)=>n-i),{west:t[0],east:t[t.length-1],north:r[r.length-1],south:r[0]}}function tN(e,t){let r=(t==null?void 0:t.minimumHeight)||0,n=(t==null?void 0:t.maximumHeight)||0,i=zv(e),a=J2e(i),o=a.west,s=a.south,u=a.east,c=a.north,l=[];return l.push(new ce(o,c,r)),l.push(new ce(u,c,r)),l.push(new ce(u,s,r)),l.push(new ce(o,s,r)),l.push(new ce(o,c,n)),l.push(new ce(u,c,n)),l.push(new ce(u,s,n)),l.push(new ce(o,s,n)),l}function lD(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=tN(t,r),i=eN(t),a=i[0],o=i[1],s=or.WGS84.cartographicToCartesian([a,o,r.maximumHeight]),u=new ce(s[0],s[1],s[2]);n.push(u);let c=e_(n);return[...c.center,...c.halfAxes]}var ekt=4,tkt=8,rkt={QUADTREE:ekt,OCTREE:tkt};function nkt(e,t,r){if(e!=null&&e.box){let n=v_(e.s2VolumeInfo.token),i=$q(n,t),a=Kq(i),o={...e.s2VolumeInfo};switch(o.token=a,r){case"OCTREE":let c=e.s2VolumeInfo,l=c.maximumHeight-c.minimumHeight,f=l/2,h=c.minimumHeight+l/2;c.minimumHeight=h-f,c.maximumHeight=h+f;break;default:break}return{box:lD(o),s2VolumeInfo:o}}}async function nN(e){let{implicitOptions:t,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,globalData:i={level:0,mortonIndex:0,x:0,y:0,z:0},s2VolumeBox:a,loaderOptions:o}=e,{subtree:s,level:u=0}=e,{subdivisionScheme:c,subtreeLevels:l,maximumLevel:f,contentUrlTemplate:h,subtreesUriTemplate:p,basePath:d}=t,b={children:[],lodMetricValue:0,contentUrl:""};if(!f)return Hq.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${h} won't be loaded...`),b;let g=u+i.level;if(g>f)return b;let x=rkt[c],E=Math.log2(x),S=n&1,F=n>>1&1,D=n>>2&1,j=(x**u-1)/(x-1),k=Md(r.mortonIndex,n,E),N=j+k,C=Md(r.x,S,1),I=Md(r.y,F,1),P=Md(r.z,D,1),U=!1;u>=l&&(U=rN(s.childSubtreeAvailability,k));let Y=Md(i.x,C,u*E),J=Md(i.y,I,u*E),re=Md(i.z,P,u*E);if(U){let Te=`${d}/${p}`,$e=fD(Te,g,Y,J,re);s=await An($e,iD,o),i.mortonIndex=k,i.x=C,i.y=I,i.z=P,i.level=u,k=0,N=0,C=0,I=0,P=0,u=0}if(!rN(s.tileAvailability,N))return b;rN(s.contentAvailability,N)&&(b.contentUrl=fD(h,g,Y,J,re));let ye=u+1,pe={mortonIndex:k,x:C,y:I,z:P};for(let Te=0;Te<x;Te++){let $e=nkt(a,Te,c),We=await nN({subtree:s,implicitOptions:t,loaderOptions:o,parentData:pe,childIndex:Te,level:ye,globalData:{...i},s2VolumeBox:$e});if(We.contentUrl||We.children.length){let oe=g+1,ne=ikt(We,oe,{childTileX:C,childTileY:I,childTileZ:P},t,a);b.children.push(ne)}}return b}function rN(e,t){let r;return Array.isArray(e)?(r=e[0],e.length>1&&Hq.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=e,"constant"in r?Boolean(r.constant):r.explicitBitstream?skt(t,r.explicitBitstream):!1}function ikt(e,t,r,n,i){let{basePath:a,refine:o,getRefine:s,lodMetricType:u,getTileType:c,rootLodMetricValue:l,rootBoundingVolume:f}=n,h=e.contentUrl&&e.contentUrl.replace(`${a}/`,""),p=l/2**t,d=i!=null&&i.box?{box:i.box}:f,b=akt(t,d,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:h},id:e.contentUrl,refine:s(o),type:c(e),lodMetricType:u,lodMetricValue:p,geometricError:p,transform:e.transform,boundingVolume:b}}function akt(e,t,r){if(t.region){let{childTileX:n,childTileY:i,childTileZ:a}=r,[o,s,u,c,l,f]=t.region,h=2**e,p=(u-o)/h,d=(c-s)/h,b=(f-l)/h,[g,x]=[o+p*n,o+p*(n+1)],[E,S]=[s+d*i,s+d*(i+1)],[F,D]=[l+b*a,l+b*(a+1)];return{region:[g,E,x,S,F,D]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${t}`)}function Md(e,t,r){return(e<<r)+t}function fD(e,t,r,n,i){let a=okt({level:t,x:r,y:n,z:i});return e.replace(/{level}|{x}|{y}|{z}/gi,o=>a[o])}function okt(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function skt(e,t){let r=Math.floor(e/8),n=e%8;return(t[r]>>n&1)===1}function aN(e,t=""){if(!t)return"empty";let n=t.split("?")[0].split(".").pop();switch(n){case"pnts":return"pointcloud";case"i3dm":case"b3dm":case"glb":case"gltf":return"scenegraph";default:return n||"empty"}}function oN(e){switch(e){case"REPLACE":case"replace":return 2;case"ADD":case"add":return 1;default:return e}}function iN(e="",t){if(/^[a-z][0-9a-z+.-]*:/i.test(t)){let n=new URL(e,`${t}/`);return decodeURI(n.toString())}else if(e.startsWith("/"))return e;return eu.resolve(t,e)}function X2e(e,t){var i;if(!e)return null;let r;if(e.content){let a=e.content.uri||((i=e.content)==null?void 0:i.url);r=iN(a,t)}return{...e,id:r,contentUrl:r,lodMetricType:"geometricError",lodMetricValue:e.geometricError,transformMatrix:e.transform,type:aN(e,r),refine:oN(e.refine)}}async function ewe(e,t,r){let n=null,i=Z2e(e.root);i&&e.root?n=await Q2e(e.root,e,t,i,r):n=X2e(e.root,t);let a=[];for(a.push(n);a.length>0;){let o=a.pop()||{},s=o.children||[],u=[];for(let c of s){let l=Z2e(c),f;l?f=await Q2e(c,e,t,l,r):f=X2e(c,t),f&&(u.push(f),a.push(f))}o.children=u}return n}async function Q2e(e,t,r,n,i){var S,F,D;let{subdivisionScheme:a,maximumLevel:o,availableLevels:s,subtreeLevels:u,subtrees:{uri:c}}=n,l=fD(c,0,0,0,0),f=iN(l,r),h=await An(f,iD,i),p=iN((S=e.content)==null?void 0:S.uri,r),d=(F=t==null?void 0:t.root)==null?void 0:F.refine,b=e.geometricError,g=(D=e.boundingVolume.extensions)==null?void 0:D["3DTILES_bounding_volume_S2"];if(g){let k={box:lD(g),s2VolumeInfo:g};e.boundingVolume=k}let x=e.boundingVolume,E={contentUrlTemplate:p,subtreesUriTemplate:c,subdivisionScheme:a,subtreeLevels:u,maximumLevel:Number.isFinite(s)?s-1:o,refine:d,basePath:r,lodMetricType:"geometricError",rootLodMetricValue:b,rootBoundingVolume:x,getTileType:aN,getRefine:oN};return await ukt(e,r,h,E,i)}async function ukt(e,t,r,n,i){if(!e)return null;let{children:a,contentUrl:o}=await nN({subtree:r,implicitOptions:n,loaderOptions:i}),s,u=null;return o&&(s=o,u={uri:o.replace(`${t}/`,"")}),{...e,id:s,contentUrl:s,lodMetricType:"geometricError",lodMetricValue:e.geometricError,transformMatrix:e.transform,type:aN(e,s),refine:oN(e.refine),content:u||e.content,children:a}}function Z2e(e){var t;return((t=e==null?void 0:e.extensions)==null?void 0:t["3DTILES_implicit_tiling"])||(e==null?void 0:e.implicitTiling)}var Ec={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:yv,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:ckt,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function ckt(e,t={},r){let n=t["3d-tiles"]||{},i;return n.isTileset==="auto"?i=(r==null?void 0:r.url)&&r.url.indexOf(".json")!==-1:i=n.isTileset,i?lkt(e,t,r):fkt(e,t,r)}async function lkt(e,t,r){var u;let n=JSON.parse(new TextDecoder().decode(e)),i=(r==null?void 0:r.url)||"",a=hkt(i),o=await ewe(n,a,t||{});return{...n,shape:"tileset3d",loader:Ec,url:i,queryString:(r==null?void 0:r.queryString)||"",basePath:a,root:o||n.root,type:"TILES3D",lodMetricType:"geometricError",lodMetricValue:((u=n.root)==null?void 0:u.geometricError)||0}}async function fkt(e,t,r){let n={content:{shape:"tile3d",featureIds:null}};return await Uq(e,0,t,r,n.content),n.content}function hkt(e){return eu.dirname(e)}var twe="https://api.cesium.com/v1/assets";async function rwe(e,t){if(!t){let a=await pkt(e);for(let o of a.items)o.type==="3DTILES"&&(t=o.id)}let r=await dkt(e,t),{type:n,url:i}=r;return Qt(n==="3DTILES"&&i),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function pkt(e){Qt(e);let t=twe,r={Authorization:`Bearer ${e}`},n=await Fo(t,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function dkt(e,t){Qt(e,t);let r={Authorization:`Bearer ${e}`},n=`${twe}/${t}`,i=await Fo(`${n}`,{headers:r});if(!i.ok)throw new Error(i.statusText);let a=await i.json();if(i=await Fo(`${n}/endpoint`,{headers:r}),!i.ok)throw new Error(i.statusText);let o=await i.json();return a={...a,...o},a}async function mkt(e,t={}){t=t["cesium-ion"]||{};let{accessToken:r}=t,n=t.assetId;if(!Number.isFinite(n)){let i=e.match(/\/([0-9]+)\/tileset.json/);n=i&&i[1]}return rwe(r,n)}var hD={...Ec,id:"cesium-ion",name:"Cesium Ion",preload:mkt,parse:async(e,t,r)=>(t={...t},t["3d-tiles"]=t["cesium-ion"],t.loader=hD,Ec.parse(e,t,r)),options:{"cesium-ion":{...Ec.options["3d-tiles"],accessToken:null}}};var lTe=$t(KU(),1),RIt="4.0.0",$U={id:"zip",module:"zip",name:"Zip Archive",version:RIt,extensions:["zip"],mimeTypes:["application/zip"],category:"archive",tests:["PK"],options:{},parse:jIt};async function jIt(e,t={}){let r=[],n={};try{let i=new lTe.default;return(await i.loadAsync(e,t)).forEach((o,s)=>{let u=s.name,c=LIt(i,u,t).then(l=>{n[o]=l});r.push(c)}),await Promise.all(r),n}catch(i){throw t.log.error(`Unable to read zip archive: ${i}`),i}}async function LIt(e,t,r={}){try{return await e.file(t).async(r.dataType||"arraybuffer")}catch(n){return r.log.error(`Unable to read ${t} from zip archive: ${n}`),n}}var e2=async(e,t)=>{let r=[await e.getUint8(e.length-1n),await e.getUint8(e.length-2n),await e.getUint8(e.length-3n),void 0],n=0n;for(let i=e.length-4n;i>-1;i--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=await e.getUint8(i),r.every((a,o)=>a===t[o])){n=i;break}return n};var MIt=new Uint8Array([80,75,5,6]),qIt=new Uint8Array([80,75,6,7]),NIt=new Uint8Array([80,75,6,6]),UIt=8n,GIt=16n,zIt=8n,HIt=24n,WIt=48n,fTe=async e=>{let t=await e2(e,MIt),r=BigInt(await e.getUint16(t+UIt)),n=BigInt(await e.getUint32(t+GIt));if(n===BigInt(4294967295)||r===BigInt(4294967295)){let i=t-20n,a=await e.slice(i,i+4n);if(!Zu(a,qIt))throw new Error("zip64 EoCD locator not found");let o=await e.getBigUint64(i+zIt),s=await e.slice(o,o+4n);if(!Zu(s,NIt.buffer))throw new Error("zip64 EoCD not found");r=await e.getBigUint64(o+HIt),n=await e.getBigUint64(o+WIt)}return{cdRecordsNumber:r,cdStartOffset:n}};var VIt=20n,KIt=24n,$It=28n,YIt=30n,JIt=42n,YU=46n,n4=new Uint8Array([80,75,1,2]),t2=async(e,t)=>{let r=await t.slice(e,e+4n);if(!Zu(r,n4.buffer))return null;let n=BigInt(await t.getUint32(e+VIt)),i=BigInt(await t.getUint32(e+KIt)),a=await t.getUint16(e+YIt),o=await t.getUint16(e+$It),s=await t.slice(e+YU,e+YU+BigInt(o)),u=new TextDecoder().decode(s),c=e+YU+BigInt(o),l=await t.getUint32(e+JIt),f=BigInt(l),h=4n;return i===BigInt(4294967295)&&(i=await t.getBigUint64(c+h),h+=8n),n===BigInt(4294967295)&&(n=await t.getBigUint64(c+h),h+=8n),f===BigInt(4294967295)&&(f=await t.getBigUint64(c+h)),{compressedSize:n,uncompressedSize:i,extraFieldLength:a,fileNameLength:o,fileName:u,extraOffset:c,localHeaderOffset:f}};async function*i4(e){let{cdStartOffset:t}=await fTe(e),r=await t2(t,e);for(;r;)yield r,r=await t2(r.extraOffset+BigInt(r.extraFieldLength),e)}var XIt=8n,QIt=18n,ZIt=22n,ePt=26n,tPt=28n,a4=30n,hTe=new Uint8Array([80,75,3,4]),Zd=async(e,t)=>{let r=await t.slice(e,e+4n);if(!Zu(r,hTe))return null;let n=await t.getUint16(e+ePt),i=new TextDecoder().decode(await t.slice(e+a4,e+a4+BigInt(n))).split("\\").join("/"),a=await t.getUint16(e+tPt),o=e+a4+BigInt(n+a),s=await t.getUint16(e+XIt),u=BigInt(await t.getUint32(e+QIt)),c=BigInt(await t.getUint32(e+ZIt)),l=e+a4+BigInt(n),f=4n;return c===BigInt(4294967295)&&(c=await t.getBigUint64(l+f),f+=8n),u===BigInt(4294967295)&&(u=await t.getBigUint64(l+f),f+=8n),o===BigInt(4294967295)&&(o=await t.getBigUint64(l+f)),{fileNameLength:n,fileName:i,extraFieldLength:a,fileDataOffset:o,compressedSize:u,compressionMethod:s}};function JU(e){let t=new DataView(e),r={};for(let n=0;n<e.byteLength;n=n+24){let i=t.getBigUint64(n+16,!0),a=rPt(e,n,16);r[a]=i}return r}function rPt(e,t,r){return[...new Uint8Array(e,t,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}var mb=class{constructor(t){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(){}async compress(t){return await this.preload(),this.compressSync(t)}async decompress(t,r){return await this.preload(),this.decompressSync(t,r)}compressSync(t){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(t,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(t){let r=await this.concatenate(t);yield this.compress(r)}async*decompressBatches(t){let r=await this.concatenate(t);yield this.decompress(r)}concatenate(t){return zp(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var r2=class extends mb{name="uncompressed";extensions=[];contentEncodings=[];isSupported=!0;options;constructor(t){super(t),this.options=t||{}}compressSync(t){return t}decompressSync(t){return t}async*compressBatches(t){return yield*t}async*decompressBatches(t){return yield*t}};var e0=$t(PU(),1),Wl=$t(require("zlib"),1);var t0=class extends mb{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(t={}){super(t),this.options=t}async compress(t){var r,n;if(!gn&&((r=this.options.deflate)!=null&&r.useZlib)){let i=(n=this.options.deflate)!=null&&n.gzip?await Om(Wl.default.gzip)(t):await Om(Wl.default.deflate)(t);return fl(i)}return this.compressSync(t)}async decompress(t){var r,n;if(!gn&&((r=this.options.deflate)!=null&&r.useZlib)){let i=(n=this.options.deflate)!=null&&n.gzip?await Om(Wl.default.gunzip)(t):await Om(Wl.default.inflate)(t);return fl(i)}return this.decompressSync(t)}compressSync(t){var a,o,s,u;if(!gn&&((a=this.options.deflate)!=null&&a.useZlib)){let c=(o=this.options.deflate)!=null&&o.gzip?Wl.default.gzipSync(t):Wl.default.deflateSync(t);return fl(c)}let r=((s=this.options)==null?void 0:s.deflate)||{},n=new Uint8Array(t);return((u=this.options)!=null&&u.raw?e0.default.deflateRaw:e0.default.deflate)(n,r).buffer}decompressSync(t){var a,o,s,u;if(!gn&&((a=this.options.deflate)!=null&&a.useZlib)){let c=(o=this.options.deflate)!=null&&o.gzip?Wl.default.gunzipSync(t):Wl.default.inflateSync(t);return fl(c)}let r=((s=this.options)==null?void 0:s.deflate)||{},n=new Uint8Array(t);return((u=this.options)!=null&&u.raw?e0.default.inflateRaw:e0.default.inflate)(n,r).buffer}async*compressBatches(t){var i;let r=((i=this.options)==null?void 0:i.deflate)||{},n=new e0.default.Deflate(r);yield*this.transformBatches(n,t)}async*decompressBatches(t){var i;let r=((i=this.options)==null?void 0:i.deflate)||{},n=new e0.default.Inflate(r);yield*this.transformBatches(n,t)}async*transformBatches(t,r){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(let o of r){let s=new Uint8Array(o);if(!t.push(s,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),i=t.push(n,!0);yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){let t=this._chunks;return this._chunks=[],t}_getError(t=0){let r={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${r[t]}`}};var nPt={0:async e=>e,8:async e=>await new t0({raw:!0}).decompress(e)},n2=class{fileProvider=null;fileName;constructor(t){if(typeof t=="string")if(this.fileName=t,!gn)this.fileProvider=new Fx(t);else throw new Error("Cannot open file for random access in a WEB browser");else YI(t)&&(this.fileProvider=t)}async destroy(){this.fileProvider&&await this.fileProvider.destroy()}async readdir(){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let t=[],r=i4(this.fileProvider);for await(let n of r)t.push(n.fileName);return t}async stat(t){let r=await this.getCDFileHeader(t);return{...r,size:Number(r.uncompressedSize)}}async fetch(t){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=await this.getCDFileHeader(t),n=await Zd(r.localHeaderOffset,this.fileProvider);if(!n)throw new Error("Local file header has not been found in the zip archive`");let i=nPt[n.compressionMethod.toString()];if(!i)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(n.fileDataOffset,n.fileDataOffset+n.compressedSize),o=await i(a),s=new Response(o);return Object.defineProperty(s,"url",{value:`${this.fileName||""}/${t}`}),s}async getCDFileHeader(t){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=i4(this.fileProvider),n=null;for await(let i of r)if(i.fileName===t){n=i;break}if(!n)throw new Error("File has not been found in the zip archive");return n}};var iPt={0:e=>new r2().decompress(e),8:e=>new t0({raw:!0}).decompress(e)},o4=class{fileProvider;hashTable;constructor(t,r){this.fileProvider=t,this.hashTable=r}async getFile(t){let r=await this.getFileBytes(t.toLocaleLowerCase());if(r||(r=await this.getFileBytes(t)),!r)throw new Error(`No such file in the archive: ${t}`);return r}async getFileBytes(t){let r=new TextEncoder().encode(t).buffer,n=await new kx().hash(r,"hex"),i=this.hashTable[n];if(i===void 0)return null;let a=await Zd(i,this.fileProvider);if(!a)return null;let o=await this.fileProvider.slice(a.fileDataOffset,a.fileDataOffset+a.compressedSize),s=iPt[a.compressionMethod];if(!s)throw Error("Only Deflation compression is supported");return s(o)}};var i2=class extends n2{hashTable;constructor(t){super(t)}async fetch(t){let r=this.fileProvider;if(!r)throw new Error("No data detected in the zip archive");if(await this.parseHashTable(),this.hashTable){let i=await new o4(r,this.hashTable).getFile(t),a=new Response(i);return Object.defineProperty(a,"url",{value:`${this.fileName||""}/${t}`}),a}return super.fetch(t)}async parseHashTable(){if(this.hashTable!==void 0)return;let t=this.fileProvider;if(!t)throw new Error("No data detected in the zip archive");let r=await e2(t,n4),n=await t2(r,t);if((n==null?void 0:n.fileName)==="@3dtilesIndex1@"){let i=await Zd(n.localHeaderOffset,t);if(!i)throw new Error("corrupted 3tz");let a=i.fileDataOffset,o=await t.slice(a,a+i.compressedSize);this.hashTable=JU(o)}else this.hashTable=null}};function Lh(e,t,r){if(!t)return r+12;let{magic:i,version:a=1,byteLength:o=12}=e;return Qt(Array.isArray(i)&&Number.isFinite(a)&&Number.isFinite(o)),t.setUint8(r+0,i[0]),t.setUint8(r+1,i[1]),t.setUint8(r+2,i[2]),t.setUint8(r+3,i[3]),t.setUint32(r+4,a,!0),t.setUint32(r+8,o,!0),r+=12,r}function Mh(e,t,r){e&&e.setUint32(t+8,r,!0)}function pTe(e,t,r,n,i){e={magic:wh.COMPOSITE,tiles:[],...e};let a=r;r+=Lh(e,t,r),t&&t.setUint32(r,e.tiles.length,!0),r+=4;for(let o=0;o<e.tiles.length;++o)r+=i(e.tiles[o],t,r,n);return Mh(t,a,r-a),r}function dTe(e,t,r,n){let{featuresLength:i=0,batchTable:a}=e,s=JSON.stringify({BATCH_LENGTH:i}),u=a?JSON.stringify(a):"",c=Co(s.length,8),l=u?Co(u.length,8):0;e={magic:wh.BATCHED_MODEL,...e};let f=r;r=Lh(e,t,r),t&&(t.setUint32(12,c,!0),t.setUint32(16,0,!0),t.setUint32(20,l,!0),t.setUint32(24,0,!0)),r+=16,r=Bm(t,r,s,8),a&&(r=Bm(t,r,u,8));let h=e.gltfEncoded;return h&&(r=Cx(t,r,h,h.byteLength)),Mh(t,f,r-f),r}function mTe(e,t,r,n){let{featuresLength:i=1,gltfFormat:a=1,gltfUri:o=""}=e,s=o.length,u={INSTANCES_LENGTH:i,POSITION:new Array(i*3).fill(0)},c=JSON.stringify(u),l=c.length;e={magic:wh.INSTANCED_MODEL,...e};let f=r;return r=Lh(e,t,0),t&&(t.setUint32(12,l,!0),t.setUint32(16,0,!0),t.setUint32(20,0,!0),t.setUint32(24,0,!0),t.setUint32(28,a,!0)),r+=20,r+=km(t,r,c,l),r+=km(t,r,o,s),Mh(t,f,r-f),r}var aPt={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function gTe(e,t,r,n){let{featureTableJson:i=aPt}=e,a=JSON.stringify(i);a=zI(a,4);let{featureTableJsonByteLength:o=a.length}=e,s=new ArrayBuffer(12),u=s.byteLength;e={magic:wh.POINT_CLOUD,...e};let c=r;return r+=Lh(e,t,0),t&&(t.setUint32(r+0,o,!0),t.setUint32(r+4,u,!0),t.setUint32(r+8,0,!0),t.setUint32(r+12,0,!0)),r+=16,r+=km(t,r,a,o),r+=Cx(t,r,s,u),Mh(t,c,r-c),r}function QU(e,t){let r=XU(e,null,0,t),n=new ArrayBuffer(r),i=new DataView(n);return XU(e,i,0,t),n}function XU(e,t,r,n){switch(Qt(typeof e.type=="string"),e.type){case ms.COMPOSITE:return pTe(e,t,r,n,XU);case ms.POINT_CLOUD:return gTe(e,t,r,n);case ms.BATCHED_3D_MODEL:return dTe(e,t,r,n);case ms.INSTANCED_3D_MODEL:return mTe(e,t,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var ZU={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:yv,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],encodeSync:oPt,binary:!0,options:{["3d-tiles"]:{}}};function oPt(e,t){return QU(e,t)}var Na=require("path");var vTe=$t(require("crypto")),u4=new Uint8Array(256),s4=u4.length;function eG(){return s4>u4.length-16&&(vTe.default.randomFillSync(u4),s4=0),u4.slice(s4,s4+=16)}var wa=[];for(let e=0;e<256;++e)wa.push((e+256).toString(16).slice(1));function bTe(e,t=0){return(wa[e[t+0]]+wa[e[t+1]]+wa[e[t+2]]+wa[e[t+3]]+"-"+wa[e[t+4]]+wa[e[t+5]]+"-"+wa[e[t+6]]+wa[e[t+7]]+"-"+wa[e[t+8]]+wa[e[t+9]]+"-"+wa[e[t+10]]+wa[e[t+11]]+wa[e[t+12]]+wa[e[t+13]]+wa[e[t+14]]+wa[e[t+15]]).toLowerCase()}var yTe=$t(require("crypto")),tG={randomUUID:yTe.default.randomUUID};function sPt(e,t,r){if(tG.randomUUID&&!t&&!e)return tG.randomUUID();e=e||{};let n=e.random||(e.rng||eG)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return bTe(n)}var Bc=sPt;var C0=$t(require("process"),1),nk=$t(_u(),1),VW=$t(aG(),1);var Jb=require("path"),yke=$t(_u(),1);var kTe=()=>({folderPattern:{path:"folderPattern",default:"BASIC"},archiveCompressionType:{path:"archiveCompressionType",default:"STORE"},resourceCompressionType:{path:"resourceCompressionType",default:"GZIP"},I3SVersion:{path:"I3SVersion",default:"1.8"},nodeCount:{path:"nodeCount"}});var $b=require("fs"),Yb=require("path");var mke=require("zlib"),gke=require("path"),nw=require("fs"),IVt=$t(dke(),1);var PVt=$t(KU(),1);var RVt=$t(rG(),1);function VF(e){let t=`${e}.gz`,r=(0,mke.createGzip)(),n=(0,nw.createReadStream)(e),i=(0,nw.createWriteStream)(t);return new Promise((a,o)=>{n.on("end",()=>{console.log(`${t} compressed and saved.`),a(t)}),n.on("error",s=>{console.log(`${t}: compression error!`),o(s)}),n.pipe(r).pipe(i)})}async function vke(e,t,r,n,i){process.platform==="win32"?await LVt(e,t,r,n,i):await jVt(e,t,r,n)}async function jVt(e,t,r=0,n="."){let i=iw(t),a=[`-${r}`,"-r",i,n];await new ll().start({command:"zip",arguments:a,spawn:{cwd:e},wait:0})}async function LVt(e,t,r=0,n=(0,gke.join)(".","*"),i){n[0]==="@"&&(n=`*${n.substr(1)}`);let a=iw(t),o=["a","-tzip",`-mx=${r}`,a,n];await new ll().start({command:i,arguments:o,spawn:{cwd:`${e}`},wait:0})}async function Fi(e,t,r="index.json"){let n;t instanceof Promise?n=new Uint8Array(await t):t instanceof ArrayBuffer?n=new Uint8Array(t):n=t,await $b.promises.mkdir(e,{recursive:!0});let i=(0,Yb.join)(e,r);try{await $b.promises.writeFile(i,n)}catch(a){throw a}return console.log(`${i} saved.`),i}async function Mc(e,t,r="index.json",n=!0,i){let a=await Fi(e,t,r);if(n){if(i)return i.includes(a)?null:(i.push(a),`${a}.gz`);{let o=await VF(a);return await OW(a),o}}return a}async function KF(e,t){return new Promise((r,n)=>{let i=0;console.log(`load ${e}/${t}.`);let a=setInterval(()=>{let o=(0,Yb.join)(e,t);An(o,VI).then(s=>{clearInterval(a),r(s)}).catch(()=>{i++,i>100&&(clearInterval(a),n(new Error(`Cannon load ${e}/${t}.`)))})},200)})}async function bke(e){try{return await $b.promises.stat(e),!0}catch{return!1}}function aw(e){return $b.promises.rm(e,{recursive:!0})}function OW(e){return $b.promises.unlink(e)}function iw(e){return(0,Yb.isAbsolute)(e)?e:(0,Yb.join)(process.cwd(),e)}var Za=class{nodesPerPage;nodesCounter;writeFile;converter;nodePages;length=0;constructor(t,r,n){this.nodesPerPage=r,this.nodesCounter=0,this.nodePages=[{}],this.nodePages[0].nodes=[],this.writeFile=t,this.converter=n,this.length=0}useWriteFunction(t){this.writeFile=t}getNodePageFileName(t){let r,n;return this.converter.options.slpk?(r=(0,Jb.join)(this.converter.layers0Path,"nodepages"),n=`${t.toString()}.json`):(r=(0,Jb.join)(this.converter.layers0Path,"nodepages",t.toString()),n="index.json"),{filePath:r,fileName:n}}async loadNodePage(t){let{filePath:r,fileName:n}=this.getNodePageFileName(t),i=(0,Jb.join)(r,n);return await bke(i)?(console.log(`load ${i}.`),await KF(r,n)):{nodes:[]}}getPageIndexByNodeId(t){return Math.floor(t/this.nodesPerPage)}async getPageByNodeId(t){let r=this.getPageIndexByNodeId(t);return this.converter.options.instantNodeWriting?await this.loadNodePage(r):this.nodePages[r]}async getNodeById(t,r){let n=t%this.nodesPerPage;return r=r||await this.getPageByNodeId(t),r.nodes[n]}async addChildRelation(t,r){var i;if(t==null)return;let n=await this.getNodeById(t);(i=n.children)==null||i.push(r),await this.saveNode(n)}async push(t,r){if(t.index=this.nodesCounter++,!this.converter.options.instantNodeWriting){let n=this.nodePages[this.nodePages.length-1];n.nodes.length===this.nodesPerPage&&(n={nodes:[]},this.nodePages.push(n)),n.nodes.push(t)}return await this.addChildRelation(r,t.index),Za.updateResourceInMesh(t),await this.saveNode(t),t}async saveNode(t){if(this.converter.options.instantNodeWriting){let r=this.getPageIndexByNodeId(t.index),n=await this.getPageByNodeId(t.index),{filePath:i,fileName:a}=this.getNodePageFileName(r),o=await this.getNodeById(t.index,n);o?Za.updateAll(o,t):n.nodes.push(t);let s=JSON.stringify(n);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodePages/${r.toString()}.json.gz`,writePromise:()=>this.writeFile(i,s,a,!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>this.writeFile(i,s)},!0)}else return}async saveMetadata(){let t=(0,yke.default)({nodeCount:this.nodesCounter},kTe()),r=!1;await this.converter.writeQueue.enqueue({archiveKey:"metadata.json",writePromise:()=>this.writeFile(this.converter.layers0Path,JSON.stringify(t),"metadata.json",r)})}async save(){if(this.converter.options.instantNodeWriting){await this.saveMetadata();return}if(this.converter.options.slpk){for(let[t,r]of this.nodePages.entries()){let n=JSON.stringify(r),i=(0,Jb.join)(this.converter.layers0Path,"nodepages");await this.converter.writeQueue.enqueue({archiveKey:`nodePages/${t.toString()}.json.gz`,writePromise:()=>this.writeFile(i,n,`${t.toString()}.json`)})}await this.saveMetadata()}else for(let[t,r]of this.nodePages.entries()){let n=JSON.stringify(r),i=(0,Jb.join)(this.converter.layers0Path,"nodepages",t.toString());await this.converter.writeQueue.enqueue({writePromise:()=>this.writeFile(i,n)})}}static updateResourceInMesh(t){t.mesh&&isFinite(t.index)&&(t.mesh.geometry.resource=t.index)}static updateAll(t,r){return Object.assign(t,r,{index:t.index}),Za.updateResourceInMesh(t),t}static updateMaterialByNodeId(t,r){t.mesh&&(t.mesh.material={definition:r,resource:t.index})}static updateVertexCountByNodeId(t,r){t.mesh&&(t.mesh.geometry.vertexCount=r)}static updateNodeAttributeByNodeId(t){!t.mesh||!t.index||(t.mesh.attribute.resource=t.index)}static updateFeatureCountByNodeId(t,r){t.mesh&&(t.mesh.geometry.featureCount=r)}static updateTexelCountHintByNodeId(t,r){!t.mesh||!t.mesh.material||(t.mesh.material.texelCountHint=r)}};var ow=require("path"),$F=require("fs");function YF(e){let r=e[0],n=Math.floor(r/3600);r=r-n*3600;let i=Math.floor(r/60);r=r-i*60;let a=Math.floor(r),o=e[1]/1e6,s="";return n&&(s+=`${n}h `),i&&(s+=`${i}m `),a&&(s+=`${a}s`),s||(s+=`${o}ms`),s}async function JF(e){let{slpk:t,outputPath:r,tilesetName:n}=e,i=iw(r);try{if(t){let s=(0,ow.join)(i,`${n}.slpk`);return(await $F.promises.stat(s)).size}let a=(0,ow.join)(i,n);return await xke(a)}catch(a){return console.log("Calculate file sizes error: ",a),null}}async function xke(e){let t=0,r=await $F.promises.readdir(e);for(let n of r){let i=await $F.promises.stat((0,ow.join)(e,n));i.isDirectory()?t+=await xke((0,ow.join)(e,n)):t+=i.size}return t}var Hke=$t(aG(),1);var T0=3,Xb=9;function wke(e){let{positions:t,normals:r,texCoords:n,colors:i,uvRegions:a,featureIndices:o}=e,s=t.length/Xb;if(!o.length)return{faceRange:new Uint32Array([0,s-1]),featureIds:[0],featureCount:1,positions:t,normals:r,texCoords:n,colors:i,uvRegions:a};let u=MVt(o),c=qVt({...u,...e}),l=NVt(c);return UVt(l,u.featureCount)}function MVt(e){let t=1,r=1,n=_ke(e.slice(0,T0)),i=[],a=[],o=[n];i[0]=0,a[0]=n;for(let c=T0;c<e.length;c+=T0){let l=_ke(e.slice(c,c+T0));n!==l&&(i[t]=c/T0-1,i[t+1]=c/T0,a[r]=l,o.includes(l)||o.push(l),t+=2,r+=1),n=l}i[t]=e.length/T0-1;let s=new Uint32Array(i),u=o.length;return{faceRange:s,featureCount:u,featureIds:a}}function _ke(e){let t={},r=e[0],n=1;for(let i of e)t[i]=(t[i]||0)+1,n=n>t[i]?n:t[i],r=n>t[i]?r:i;return r}function qVt(e){let{featureIds:t,positions:r,normals:n,colors:i,uvRegions:a,texCoords:o,faceRange:s=new Uint32Array(0)}=e,u=[],c=new Float32Array(r),l=new Float32Array(n),f=new Uint8Array(i),h=new Float32Array(o),p=new Uint16Array(a),d=0,b=0,g=0,x=0,E=0;for(let S=0;S<t.length;S++){let F=s[S*2],D=s[S*2+1],j=sw("positions",F,D),k=sw("normals",F,D),N=sw("colors",F,D),C=sw("uvRegions",F,D),I=sw("texCoords",F,D);u.push({featureId:t[S],positions:c.subarray(d,d+j),normals:l.subarray(b,b+k),colors:f.subarray(g,g+N),uvRegions:p.subarray(x,x+C),texCoords:h.subarray(E,E+I)}),d+=j,b+=k,g+=N,x+=C,E+=I}return u}function sw(e,t,r){let a=r-t+1,o=a*3;switch(e){case"positions":case"normals":return a*Xb;case"colors":case"uvRegions":return o*4;case"texCoords":return o*2;default:return 0}}function NVt(e){let t=[];for(let n of e){let i=t.find(a=>a.featureId===n.featureId);i?i.attributes.push(n):t.push({featureId:n.featureId,attributes:[n]})}let r=[];for(let n of t){let i=Eke(n.attributes);r.push({featureId:n.featureId,...i})}return r}function UVt(e,t){let n=[e[0].featureId||0],i=[0],a=0,o=0;for(let c=1;c<e.length;c++){let l=e[c];n.push(l.featureId||0);let f=e[a];i.push(f.positions.length/Xb-1+o),i.push(f.positions.length/Xb+o),o+=f.positions.length/Xb,a+=1}let s=Eke(e);return i.push(s.positions.length/Xb-1),{faceRange:new Uint32Array(i),featureIds:n,featureCount:t,...s}}function Eke(e){let t=e.map(({positions:f})=>f),r=t.length>1?To(...t):t[0],n=e.map(({normals:f})=>f),i=n.length>1?To(...n):n[0],a=e.map(({colors:f})=>f),o=a.length>1?To(...a):a[0],s=e.map(({texCoords:f})=>f),u=s.length>1?To(...s):s[0],c=e.map(({uvRegions:f})=>f),l=c.length>1?To(...c):c[0];return{positions:r,normals:i,colors:o,texCoords:u,uvRegions:l}}function IW(e,t){let r,n,i,a=or.WGS84.cartesianToCartographic(e.center,new ce);return a[2]=a[2]-t.getHeight(a[1],a[0]),e instanceof aa?(n=e.halfSize,r=new ce(n[0],n[1],n[2]).len(),i=e.quaternion):(r=e.radius,n=[r,r,r],i=new ps().fromMatrix3(new Rr([n[0],0,0,0,n[1],0,0,0,n[2]])).normalize()),{mbs:[a[0],a[1],a[2],r],obb:{center:[a[0],a[1],a[2]],halfSize:n,quaternion:i}}}function Ake(e,t){let r=GVt(e),n=e_(r),i=L7(r),a=or.WGS84.cartesianToCartographic(i.center,new ce),o=or.WGS84.cartesianToCartographic(n.center,new ce);return a[2]=a[2]-t.getHeight(a[1],a[0]),o[2]=o[2]-t.getHeight(o[1],o[0]),{mbs:[a[0],a[1],a[2],i.radius],obb:{center:o,halfSize:n.halfSize,quaternion:n.quaternion}}}function GVt(e){let t=[];for(let r=0;r<e.length;r+=3){let n=new ce([e[r],e[r+1],e[r+2]]);t.push(n)}return t}function Ske(e){let t;e instanceof Ya?t=e:t=e.getBoundingSphere();let r=t.center,n=t.radius,i=or.WGS84.cartesianToCartographic(new ce(r[0]+n,r[1]+n,r[2]+n),new ce),a=or.WGS84.cartesianToCartographic(new ce(r[0]-n,r[1]-n,r[2]-n),new ce);return{xmin:Math.min(a[0],i[0]),xmax:Math.max(a[0],i[0]),ymin:Math.min(a[1],i[1]),ymax:Math.max(a[1],i[1]),zmin:Math.min(a[2],i[2]),zmax:Math.max(a[2],i[2])}}function PW(e){let t=e[3],r=new ce(e[0],e[1],e[2]),n=new Rr([t,0,0,0,t,0,0,0,t]);return new aa(r,n)}function Tke(e,t,r){var s,u,c,l,f,h,p,d;let n=((u=(s=e.gltf)==null?void 0:s.scene)==null?void 0:u.nodes)||((f=(l=(c=e.gltf)==null?void 0:c.scenes)==null?void 0:l[0])==null?void 0:f.nodes)||((h=e.gltf)==null?void 0:h.nodes)||[],i=((d=(p=e.gltf)==null?void 0:p.images)==null?void 0:d.map(b=>{var g,x;if((g=b==null?void 0:b.image)!=null&&g.compressed)return null;{let E=(x=b==null?void 0:b.image)==null?void 0:x.data,S=new Uint8Array(E.length);return S.set(E),{data:S,compressed:!1,height:b.image.height,width:b.image.width,components:b.image.components,mimeType:b.mimeType}}}))||[];Cke(n);let{cartographicOrigin:a,modelMatrix:o}=HVt(e,t,r);return{nodes:n,images:i,cartographicOrigin:a,cartesianModelMatrix:o}}function zVt(e){let t={};for(let r in e)t[r]={value:e[r].value};return t}function HVt(e,t,r){let{rtcCenter:n,gltfUpAxis:i}=e,{center:a}=r,o=new Kr(t);switch(n&&o.translate(n),i){case"Z":break;case"Y":let c=new Kr().rotateX(Math.PI/2);o=o.multiplyRight(c);break;case"X":let l=new Kr().rotateY(-Math.PI/2);o=o.multiplyRight(l);break;default:break}let s=new ce(a),u=or.WGS84.cartesianToCartographic(s,new ce);return{modelMatrix:o,cartographicOrigin:u}}function Cke(e){var t;for(let r=0;r<e.length;r++){let n=e[r];n.mesh&&(e[r]={...n,mesh:{...n.mesh,primitives:(t=n.mesh)==null?void 0:t.primitives.map(i=>{var a,o,s;return{...i,indices:{value:(a=i==null?void 0:i.indices)==null?void 0:a.value},attributes:zVt(i.attributes),material:{id:(o=i==null?void 0:i.material)==null?void 0:o.id,uniqueId:(s=i==null?void 0:i.material)==null?void 0:s.uniqueId}}})}}),n.children&&Cke(n.children)}}function Dke(e,t){var n,i;let r=(i=(n=e.gltf)==null?void 0:n.extensions)==null?void 0:i[gs];if(!(r!=null&&r.featureTextures))return null;for(let a in r.featureTextures)if(r.featureTextures[a].class===t)return a;return null}function Fke(e,t,r,n){let i=t==null?void 0:t.extensions;if(!i)return[];for(let[a,o]of Object.entries(i||{}))switch(a){case gs:return VVt(e,o,r,n);case N8:return WVt(e,o);default:return[]}return[]}function WVt(e,t){for(let r of t.featureIds)if(typeof r.propertyTable<"u")return r.data;return[]}function VVt(e,t,r,n){var o,s,u,c,l,f,h;let i=(o=t==null?void 0:t.featureIdAttributes)==null?void 0:o[0];if((s=i==null?void 0:i.featureIds)!=null&&s.attribute)return e[i.featureIds.attribute].value;if((u=i==null?void 0:i.featureIds)!=null&&u.hasOwnProperty("constant")&&((c=i==null?void 0:i.featureIds)!=null&&c.hasOwnProperty("divisor"))){let p=((l=e==null?void 0:e.POSITIONS)==null?void 0:l.value.length)/3||0;return KVt(p,i.featureIds.constant,i.featureIds.divisor)}let a=(t==null?void 0:t.featureIdTextures)&&(t==null?void 0:t.featureIdTextures[0]);if(a){let d=`TEXCOORD_${((h=(f=a==null?void 0:a.featureIds)==null?void 0:f.texture)==null?void 0:h.texCoord)||0}`,b=e[d].value;return $Vt(a,b,r)}return n?e[n].value:[]}function KVt(e,t=0,r=0){let n=[];if(r>0){let i=t,a=r;for(let o=0;o<e;o++)n.push(i),a-=1,a===0&&(i++,a=r)}else n=Array(e).fill(t,0,e);return n}function $Vt(e,t,r){var c,l,f;if(!(r!=null&&r.length))return[];let n={r:0,g:1,b:2,a:3},i=(l=(c=e==null?void 0:e.featureIds)==null?void 0:c.texture)==null?void 0:l.index,a=(f=e==null?void 0:e.featureIds)==null?void 0:f.channels;if(!a||i===void 0)return[];let o=r[i],s=[],u=n[a];if(o&&(o!=null&&o.width)&&(o!=null&&o.height)&&(o!=null&&o.components))for(let h=0;h<t.length;h+=2){let p=t[h],d=t[h+1],b=Math.min(kd(p)*o.width|0,o.width-1),x=(Math.min(kd(d)*o.height|0,o.height-1)*o.width+b)*o.components+u,E=new Uint8Array(o.data)[x];s.push(E)}else console.warn(`Can't get batch Ids from ${(o==null?void 0:o.mimeType)||""} compressed texture`);return s}function Bke(e,t){let r={};for(let n in t){let i=t[n];r[n]=YVt(i,e)}return r}function YVt(e,t){let r=[];if(e)for(let n in t){let i=e[n]||null;r.push(i)}return r}function Oke(e,t){let r=!1;for(let n of Object.values(t))(!e||!n||e.length!==n.length)&&(r=!0);return r}var qc="string",uw="Int32",cw="double",Ike="OBJECTID";function JVt(e){return typeof e===qc||typeof e=="bigint"?qc:typeof e=="number"?Number.isInteger(e)?uw:cw:qc}function Pke(e,t,r){let n={key:`f_${e}`,name:t,ordering:["attributeValues"],header:[{property:"count",valueType:"UInt32"}],attributeValues:{valueType:"Int32",valuesPerElement:1}};switch(r){case Ike:XVt(n);break;case qc:kke(n);break;case cw:QVt(n);break;case uw:break;default:kke(n)}return n}function Rke(e){switch(e){case Ike:return"esriFieldTypeOID";case qc:return"esriFieldTypeString";case uw:return"esriFieldTypeInteger";case cw:return"esriFieldTypeDouble";default:return"esriFieldTypeString"}}function jke(e,t){return{name:e,type:t,alias:e}}function Lke(e){let t="{OBJECTID}",r=[],n=[],i=[],a=[];for(let o of e)n.push({fieldName:o,visible:!0,isEditable:!1,label:o});return i.push({fieldInfos:n,type:"fields"}),{title:t,mediaInfos:r,popupElements:i,fieldInfos:n,expressionInfos:a}}function kke(e){e.ordering.unshift("attributeByteCounts"),e.header.push({property:"attributeValuesByteCount",valueType:"UInt32"}),e.attributeValues={valueType:"String",encoding:"UTF-8",valuesPerElement:1},e.attributeByteCounts={valueType:"UInt32",valuesPerElement:1}}function XVt(e){e.attributeValues={valueType:"Oid32",valuesPerElement:1}}function QVt(e){e.attributeValues={valueType:"Float64",valuesPerElement:1}}function Mke(e){let t={};for(let r in e){let n=e[r][0],i=JVt(n);t[r]=i}return t}var qke=(e,t)=>{var a,o,s,u,c,l,f,h;let r={},n=(u=(s=(o=(a=e.extensions)==null?void 0:a[gs])==null?void 0:o.schema)==null?void 0:s.classes)==null?void 0:u[t];if(n){for(let p in n.properties){let d=n.properties[p],b=ZVt(d);r[p]=b}return r}let i=(h=(f=(l=(c=e.extensions)==null?void 0:c[Ol])==null?void 0:l.schema)==null?void 0:f.classes)==null?void 0:h[t];if(i){for(let p in i.properties){let d=i.properties[p],b=eKt(d);r[p]=b}return r}return null},ZVt=e=>{let t;switch(e.type){case"INT8":case"UINT8":case"INT16":case"UINT16":case"INT32":case"UINT32":t=uw;break;case"FLOAT32":case"FLOAT64":t=cw;break;case"INT64":case"UINT64":case"BOOLEAN":case"ENUM":case"STRING":case"ARRAY":t=qc;break;default:t=qc;break}return t},eKt=e=>{let t;if(e.array)t=qc;else switch(e.componentType){case"INT8":case"UINT8":case"INT16":case"UINT16":case"INT32":case"UINT32":t=uw;break;case"FLOAT32":case"FLOAT64":t=cw;break;case"INT64":case"UINT64":t=qc;break;default:t=qc;break}return t};var XF=e=>{let t=new Uint32Array(e);for(let r=0;r<e;r++)t[r]=r;return t};var tKt=1,rKt=1,Eu=3,lw=2,nKt=4,iKt="string",aKt="Int32",oKt="Float64",sKt="Oid32",Nke=["CUSTOM_ATTRIBUTE_2","_BATCHID","BATCHID"],bp=new ce;async function RW(e,t,r,n,i,a,o,s,u,c,l,f,h){var S;let p=u,d=await wKt((S=e.gltf)==null?void 0:S.materials,c),b=Tke(e,t,r),g=Dke(e,h),x=await lKt(b,d,p,g);u&&uKt(x,l);let E=[];for(let F of d){let D=F.mergedMaterials[0].originalMaterialId;if(!x.has(D))continue;let j=x.get(D);if(!j)continue;let{material:k,texture:N}=F,C=await n();E.push(await cKt({convertedAttributes:j,material:k,texture:N,tileContent:e,nodeId:C,featuresHashArray:a,propertyTable:i,attributeStorageInfo:o,draco:s,libraries:f}))}return E.length?E:null}function uKt(e,t){for(let r of e.values()){let n=Ake(r.positions,t);r.boundingVolumes=n;let i=n.obb.center;for(let a=0;a<r.positions.length;a+=Eu){let o=r.positions.subarray(a,a+Eu);or.WGS84.cartesianToCartographic(Array.from(o),bp),bp[2]=bp[2]-t.getHeight(bp[1],bp[0]),bp=bp.subtract(i),r.positions.set(bp,a)}}}async function cKt({convertedAttributes:e,material:t,texture:r,tileContent:n,nodeId:i,featuresHashArray:a,propertyTable:o,attributeStorageInfo:s,draco:u,libraries:c}){var I;let l=e.boundingVolumes,f=e.positions.length/Eu,{faceRange:h,featureIds:p,positions:d,normals:b,colors:g,uvRegions:x,texCoords:E,featureCount:S}=wke(e),F={};o&&(F=IKt(p,e.featureIndices,a,o));let D=new Uint32Array(2),j=GKt(p);D.set([f,S],0);let k=new Uint8Array(ec(D.buffer,d.buffer,b.buffer,r?E.buffer:new ArrayBuffer(0),g.buffer,x,j.buffer,h.buffer)),N=u?zKt(f,e,{positions:d,normals:b,texCoords:r?E:new Float32Array(0),colors:g,uvRegions:x,featureIds:p,faceRange:h},c):null,C=[];return s&&o&&(C=LKt(p,F,o,s)),{nodeId:i,geometry:k,compressedGeometry:N,texture:r,hasUvRegions:Boolean(x.length),sharedResources:DKt(((I=n.gltf)==null?void 0:I.materials)||[],i),meshMaterial:t,vertexCount:f,attributes:C,featureCount:S,boundingVolumes:l}}async function lKt(e,t,r,n){let{nodes:i,images:a,cartographicOrigin:o,cartesianModelMatrix:s}=e,u=new Map;for(let c of t){let l={positions:new Float32Array(0),normals:new Float32Array(0),texCoords:new Float32Array(0),colors:new Uint8Array(0),uvRegions:new Uint16Array(0),featureIndicesGroups:[],featureIndices:[],boundingVolumes:null,mergedMaterials:c.mergedMaterials};for(let f of c.mergedMaterials)u.set(f.originalMaterialId,l)}Wke(i,a,o,s,u,r,void 0,n);for(let c of u.keys()){let l=u.get(c);if(l){if(l.positions.length===0){u.delete(c);continue}l.featureIndicesGroups&&(l.featureIndices=l.featureIndicesGroups.reduce((f,h)=>f.concat(h)),delete l.featureIndicesGroups)}}return u}function Wke(e,t,r,n,i,a,o=new Kr([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),s){if(e)for(let u of e)hKt(u,t,r,n,i,a,o,s)}function fKt(e,t){let r=t,{matrix:n,rotation:i,scale:a,translation:o}=e;return n&&(r=t.multiplyRight(n)),o&&(r=r.translate(o)),i&&(r=r.rotateXYZ(i)),a&&(r=r.scale(a)),r}function hKt(e,t,r,n,i,a,o=new Kr([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),s){let u=fKt(e,o),c=e.mesh;c&&pKt(c,t,r,n,i,a,u,s),Wke(e.children||[],t,r,n,i,a,u,s)}function pKt(e,t,r,n,i,a=!1,o=new Kr([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),s){var u;for(let c of e.primitives){let l=null,f;c.material?(l=i.get(c.material.id),f=(u=l==null?void 0:l.mergedMaterials.find(({originalMaterialId:d})=>{var b;return d===((b=c.material)==null?void 0:b.id)}))==null?void 0:u.uvRegion):i.has("default")&&(l=i.get("default")),Qt(l!==null,"Primitive - material mapping failed"),Qt(c.mode===void 0||c.mode===Ht.TRIANGLES||c.mode===Ht.TRIANGLE_STRIP,`Primitive - unsupported mode ${c.mode}`);let h=c.attributes;if(!l)continue;let p=dKt(c);l.positions=To(l.positions,Uke({vertices:h.POSITION.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:p,attributeSpecificTransformation:mKt,useCartesianPositions:a})),l.normals=To(l.normals,Uke({vertices:h.NORMAL&&h.NORMAL.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:p,attributeSpecificTransformation:gKt,useCartesianPositions:!1})),l.texCoords=To(l.texCoords,vKt(h.TEXCOORD_0&&h.TEXCOORD_0.value,p)),l.colors=To(l.colors,bKt(h.COLOR_0,p)),f&&(l.uvRegions=To(l.uvRegions,yKt(f,p))),l.featureIndicesGroups=l.featureIndicesGroups||[],l.featureIndicesGroups.push(xKt(_Kt(h,c,t,s),p))}}function dKt(e){var r;let t=(r=e.indices)==null?void 0:r.value;if(!t){let n=e.attributes.POSITION.value;return XF(n.length/Eu)}if(t&&e.mode===Ht.TRIANGLE_STRIP){let n=t.constructor,i=new n((t.length-2)*3),a=0,o=t.slice(0,3);i.set(o,0);for(let s=1;s+2<t.length;s++)a+=3,o=t.slice(s,s+3),s%2===0?i.set(o,a):i.set(o.reverse(),a);t=i}return t}function Uke(e){let{vertices:t,indices:r,attributeSpecificTransformation:n}=e,i=new Float32Array(r.length*Eu);if(!t)return i;for(let a=0;a<r.length;a++){let o=r[a]*Eu,s=t.subarray(o,o+Eu),u=new ce(Array.from(s));u=n(u,e),i[a*Eu]=u.x,i[a*Eu+1]=u.y,i[a*Eu+2]=u.z}return i}function mKt(e,t){let{cartesianModelMatrix:r,cartographicOrigin:n,nodeMatrix:i,useCartesianPositions:a}=t;return i&&(e=e.transform(i)),e=e.transform(r),a||(or.WGS84.cartesianToCartographic([e[0],e[1],e[2]],e),e=e.subtract(n)),e}function gKt(e,t){let{cartesianModelMatrix:r,nodeMatrix:n}=t;return n&&(e=e.transformAsVector(n)),e=e.transformAsVector(r),e}function vKt(e,t){let r=new Float32Array(t.length*lw);if(!e)return r.fill(1),r;for(let n=0;n<t.length;n++){let i=t[n]*lw,a=e.subarray(i,i+lw);r[n*lw]=a[0],r[n*lw+1]=a[1]}return r}function bKt(e,t){let r=(e==null?void 0:e.components)||nKt,n=new Uint8Array(t.length*r);if(!e)return n.fill(255),n;let i=e.value;for(let a=0;a<t.length;a++){let o=t[a]*r,s=i.subarray(o,o+r),u=new Uint8Array(r);for(let c=0;c<s.length;c++)u[c]=s[c]*255;n.set(u,a*r)}return n}function yKt(e,t){let r=new Uint16Array(t.length*4);for(let n=0;n<r.length;n+=4)r.set(e,n);return r}function xKt(e,t){if(!e.length||!t.length)return[];let r=[];for(let n=0;n<t.length;n++){let i=t[n];r.push(e[i])}return r}function _Kt(e,t,r,n){let i=Fke(e,t,r,n);if(i.length)return i;for(let a=0;a<Nke.length;a++){let o=Nke[a];if(e[o]&&e[o].value)return e[o].value}return[]}async function wKt(e=[],t){let r=[];for(let n of e)r.push(SKt(n));return t&&(r=await EKt(r)),r}async function EKt(e){var r,n;let t=[];for(;e.length>0;){let i=e.splice(0,1)[0],a=[];for(let o=0;o<e.length;o++){let s=e[o];(i.texture&&s.texture||!i.texture&&!s.texture)&&(i=await AKt(i,s),a.push(o))}if(i.texture&&a.length){let o=(r=i.mergedMaterials)==null?void 0:r.reduce((c,{textureSize:l})=>c+((l==null?void 0:l.width)||0),0),s=(n=i.mergedMaterials)==null?void 0:n.reduce((c,{textureSize:l})=>Math.max(c,(l==null?void 0:l.height)||0),0),u=-1;for(let c of i.mergedMaterials)if(c.textureSize){let l=u+1+c.textureSize.width/o*2**(Uint16Array.BYTES_PER_ELEMENT*8)-1;c.uvRegion=new Uint16Array([u+1,0,l,c.textureSize.height/s*2**(Uint16Array.BYTES_PER_ELEMENT*8)-1]),u=l}i.texture.image.width=o,i.texture.image.height=s}for(let o of a.reverse())e.splice(o,1);t.push(i)}return t.length||t.push({material:CKt(),mergedMaterials:[{originalMaterialId:"default"}]}),t}async function AKt(e,t){var r,n;if((r=e.texture)!=null&&r.bufferView&&((n=t.texture)!=null&&n.bufferView)&&e.mergedMaterials&&t.mergedMaterials){let i=Buffer.from(e.texture.bufferView.data),a=Buffer.from(t.texture.bufferView.data);try{let{joinImages:o}=await import("join-images"),s=await o([i,a],{direction:"horizontal"});e.texture.bufferView.data=await s.toFormat(e.texture.mimeType==="image/png"?"png":"jpeg").toBuffer()}catch(o){throw console.log("Join images into a texture atlas has failed. Consider usage `--split-nodes` option. (See documentation https://loaders.gl/modules/tile-converter/docs/cli-reference/tile-converter)"),o}e.material.pbrMetallicRoughness.baseColorTexture.textureSetDefinitionId=1}return e.mergedMaterials=e.mergedMaterials.concat(t.mergedMaterials),e}function SKt(e){var i,a,o,s,u;let t={doubleSided:e.doubleSided,emissiveFactor:(i=e.emissiveFactor)==null?void 0:i.map(c=>Math.round(c*255)),alphaMode:TKt(e.alphaMode),pbrMetallicRoughness:{roughnessFactor:((a=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:a.roughnessFactor)||tKt,metallicFactor:((o=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:o.metallicFactor)||rKt}},r;(s=e==null?void 0:e.pbrMetallicRoughness)!=null&&s.baseColorTexture?(r=e.pbrMetallicRoughness.baseColorTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}):e.emissiveTexture&&(r=e.emissiveTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}),e.id=Number.isFinite(e.id)?e.id:Bc();let n=[{originalMaterialId:e.id}];if(r)n[0].textureSize={width:r.image.width,height:r.image.height};else{let c=(u=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:u.baseColorFactor;t.pbrMetallicRoughness.baseColorFactor=c&&c.map(l=>Math.round(l*255))||void 0}return{material:t,texture:r,mergedMaterials:n}}function TKt(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend";default:return"opaque"}}function CKt(){return{alphaMode:"opaque",pbrMetallicRoughness:{metallicFactor:1,roughnessFactor:1}}}function DKt(e,t){let r={};if(!e||!e.length)return r;r.materialDefinitionInfos=[];for(let n of e){let{materialDefinitionInfo:i,textureDefinitionInfo:a}=FKt(n,t);r.materialDefinitionInfos.push(i),a&&(r.textureDefinitionInfos=r.textureDefinitionInfos||[],r.textureDefinitionInfos.push(a))}return r}function FKt(e,t){var s;let r=((s=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:s.baseColorTexture)||e.emissiveTexture,n=null;r&&(n=BKt(r.texture,t));let{baseColorFactor:i,metallicFactor:a}=(e==null?void 0:e.pbrMetallicRoughness)||{},o=i;return(!i||i[3]===0)&&e.emissiveFactor&&(o=e.emissiveFactor,o[3]=o[3]||1),{materialDefinitionInfo:kKt(o||[1,1,1,1],a),textureDefinitionInfo:n}}function kKt(e,t=1){let r=.00015686274509803922,n=new hs(0,0,0,1),i=new hs(1,1,1,1),a=new hs(r,r,r,0),o=new hs(e),s=i.subtract(a).multiply(o),u=s.lerp(s,n,t);a[3]=1;let c=a.lerp(a,o,t);return{params:{diffuse:u.toArray(),specular:c.toArray(),renderMode:"solid"}}}function BKt(e,t){var r,n,i,a;return{encoding:(r=e==null?void 0:e.source)!=null&&r.mimeType?[e.source.mimeType]:void 0,images:[{id:OKt(e,t),size:(n=e.source)==null?void 0:n.image.width,length:(i=e.source)!=null&&i.image.data.length?[(a=e.source)==null?void 0:a.image.data.length]:void 0}]}}function OKt(e,t){var b;let{width:r,height:n}=((b=e.source)==null?void 0:b.image)||{};if(!r||!n)return"";let i=1,a=0,o=t+1,s=32-o.toString(2).length,u="0".repeat(s).concat(o.toString(2)),c=i<<28,l=a<<24,f=r-1<<12,h=n-1<<0,p=c+l+f+h;return BigInt(`0b${p.toString(2)}${u}`).toString()}function IKt(e,t,r,n){let i=PKt(e,n,r);return Gke(t,i),Gke(e,i),i}function PKt(e,t,r){let n={};for(let i=0;i<e.length;i++){let a=e[i],o=jKt(i,t,r);n[a.toString()]=o}return n}function RKt(e,t){let r="";for(let n in e)r+=e[n][t];return r}function jKt(e,t,r){let n=RKt(t,e),i=(0,Hke.default)(n);return r.includes(i)?r.indexOf(i):r.push(i)-1}function Gke(e,t){for(let r=0;r<e.length;r++)e[r]=t[e[r]]}function LKt(e,t,r,n){let i=[],o=Oke(e,r)?Bke(t,r):r,s={OBJECTID:e,...o};for(let u in s){let c=qKt(u,n);if(c){let l=s[u],f=MKt(c,l);i.push(f)}}return i}function MKt(e,t){let r;switch(e){case sKt:case aKt:r=NKt(t);break;case oKt:r=UKt(t);break;case iKt:r=zke(t);break;default:r=zke(t)}return r}function qKt(e,t){let r=t.find(n=>n.name===e);return r?r.attributeValues?r.attributeValues.valueType:(console.error(`attributeValues is null, attribute=${r}`),""):(console.error(`attribute is null, key=${e}, attributeStorageInfo=${JSON.stringify(t,null,2)}`),"")}function NKt(e){let t=new Uint32Array([e.length]),r=new Uint32Array(e);return ec(t.buffer,r.buffer)}function UKt(e){let t=new Uint32Array([e.length]),r=new Uint8Array(4),n=new Float64Array(e);return ec(t.buffer,r.buffer,n.buffer)}function zke(e){let t=new Uint32Array([e.length]),r=0,n=new Uint32Array(e.length),i=[];for(let o=0;o<e.length;o++){let s=`${String(e[o])}\0`,u=Buffer.from(s),c=u.length;r+=c,n[o]=c,i.push(u)}let a=new Uint32Array([r]);return ec(t.buffer,a.buffer,n.buffer,...i)}function GKt(e){let t=new BigUint64Array(e.length);for(let r=0;r<e.length;r++)t[r]=BigInt(e[r]);return t}async function zKt(e,t,r,n){let{positions:i,normals:a,texCoords:o,colors:s,uvRegions:u,featureIds:c,faceRange:l}=r,f=new Uint32Array(e);for(let g=0;g<f.length;g++)f.set([g],g);let h=new Uint32Array(t.featureIndices.length?t.featureIndices:e),p=HKt(h,l),d={positions:i,normals:a,colors:s,"feature-index":p};o.length&&(d.texCoords=o);let b={"feature-index":{"i3s-attribute-type":"feature-index","i3s-feature-ids":new Int32Array(c)}};return u.length&&(d["uv-region"]=u,b["uv-region"]={"i3s-attribute-type":"uv-region"}),hv({attributes:d,indices:f},W7,{...W7.options,reuseWorkers:!0,_nodeWorkers:!0,modules:n,useLocalLibraries:!0,draco:{method:"MESH_SEQUENTIAL_ENCODING",attributesMetadata:b},["draco-writer"]:{workerUrl:"./modules/draco/dist/draco-writer-worker-node.js"}})}function HKt(e,t){let r=new Uint32Array(e.length),n=0,i=0;for(let a=1;a<t.length;a+=2){let o=(t[a]+1)*Eu;r.fill(n,i,o),n++,i=o+1}return r}function Vke(e,t){if(!e)return null;let r,n=e.batchTableJson;if(n)return n;let{extensionName:i,extension:a}=KKt(e);switch(i){case Ol:return r=WKt(a,t),r;case gs:return r=VKt(a,t),r;default:return null}}function WKt(e,t){if(e.propertyTables){for(let r of e.propertyTables)if(r.class===t||!t)return QF(r)}if(e.propertyTextures){for(let r of e.propertyTextures)if(r.class===t||!t)return QF(r)}return null}function VKt(e,t){if(e.featureTables)for(let r in e.featureTables){let n=e.featureTables[r];if(n.class===t||!t)return QF(n)}if(e.featureTextures)for(let r in e.featureTextures){let n=e.featureTextures[r];if(n.class===t||!t)return QF(n)}return null}function QF(e){let t={};for(let r in e.properties)t[r]=e.properties[r].data;return t}function KKt(e){var a,o,s,u;let t=[gs,Ol];if(!((a=e==null?void 0:e.gltf)==null?void 0:a.extensionsUsed))return{extensionName:null,extension:null};let n="";for(let c of((o=e==null?void 0:e.gltf)==null?void 0:o.extensionsUsed)||[])if(t.includes(c)){n=c;break}if(!n)return{extensionName:null,extension:null};let i=(u=(s=e==null?void 0:e.gltf)==null?void 0:s.extensions)==null?void 0:u[n];return{extensionName:n,extension:i}}var $ke=$t(_u(),1),Yke=require("path");var Kke=()=>({serviceItemId:{path:"serviceItemId"},serviceName:{path:"layerName"},name:{path:"layerName"},currentVersion:{path:"currentVersion",default:10.7},serviceVersion:{path:"serviceVersion",default:"1.8"},supportedBindings:{path:"supportedBindings",default:["REST"]},layers:{path:"layers0",transform:e=>[e]}});async function Jke(e,t,r){let n={serviceItemId:Bc().replace(/-/gi,""),layerName:e,layers0:t},i=(0,$ke.default)(n,Kke()),a=(0,Yke.join)(r,"SceneServer");await Fi(a,JSON.stringify(i))}var jW=16;function Xke(e,t){let r=[],n=e.boundingVolume,i=e.lodMetricValue||.1,a={metricType:"maxScreenThreshold",maxError:t.mbs[3]*2*jW/i},o={metricType:"maxScreenThresholdSQ",maxError:Math.PI*.25*a.maxError*a.maxError};return n.constructor.name==="OrientedBoundingBox"?(r.push(o),r.push(a)):(r.push(a),r.push(o)),r}function LW(e){var n,i;let t=(n=e.lodSelection)==null?void 0:n.find(a=>a.metricType==="maxScreenThreshold"),r=t==null?void 0:t.maxError;if(!r){let a=(i=e.lodSelection)==null?void 0:i.find(o=>o.metricType==="maxScreenThresholdSQ");a&&(r=Math.sqrt(a.maxError/(Math.PI*.25)))}return r||(r=jW),e.mbs[3]*2*jW/r}var $Kt=240,YKt=[9,-18,-88,0,96,90,0,0,-60,-20,-9,18,8,0,-96,30,0,0,60,-20,9,-88,-18,90,96,0,-20,-60,0,0,186,-42,-42,-150,-96,-150,60,60,60,60,54,162,-78,30,-24,-90,-60,60,-60,60,-9,-32,18,30,24,0,20,-60,0,0,-9,8,18,30,-96,0,-20,60,0,0,54,-78,162,-90,-24,30,60,-60,60,-60,-54,78,78,90,144,90,-60,-60,-60,-60,9,-8,-18,-30,-24,0,20,60,0,0,-9,18,-32,0,24,30,0,0,-60,20,9,-18,-8,0,-24,-30,0,0,60,20],JKt=372,XKt=[0,0,-131,0,138,144,0,0,-102,-31,0,0,7,0,-138,42,0,0,102,-31,62,0,-31,0,0,-62,0,0,0,31,124,0,-62,0,0,-124,0,0,0,62,124,0,-62,0,0,-124,0,0,0,62,62,0,-31,0,0,-62,0,0,0,31,0,0,45,0,-183,-9,0,93,18,0,0,0,216,0,33,87,0,-93,12,-93,0,0,156,0,153,99,0,-93,-12,-93,0,0,-45,0,-3,9,0,93,-18,0,0,0,-55,0,48,42,0,0,-84,31,0,0,-7,0,-48,-42,0,0,84,31],QKt=372,ZKt=[18,-36,-122,0,120,135,0,0,-84,-31,-18,36,-2,0,-120,51,0,0,84,-31,36,-165,-27,93,147,-9,0,-93,18,0,210,45,-111,-93,-57,-192,0,93,12,93,162,141,-75,-93,-129,-180,0,93,-12,93,-36,-21,27,93,39,9,0,-93,-18,0,0,0,62,0,0,31,0,0,0,-31,0,0,124,0,0,62,0,0,0,-62,0,0,124,0,0,62,0,0,0,-62,0,0,62,0,0,31,0,0,0,-31,-18,36,-64,0,66,51,0,0,-102,31,18,-36,2,0,-66,-51,0,0,102,31],e$t=12,MW=(3+1)*(3+2)/2,t$t=2,Qb=class{constructor(t){zt(this,"_v00",0),zt(this,"_v01",0),zt(this,"_v10",0),zt(this,"_v11",0),zt(this,"_t",[]),zt(this,"_ix",void 0),zt(this,"_iy",void 0),zt(this,"options",void 0),this.options=t,this._ix=this.options._width,this._iy=this.options._height}getHeight(t,r){if(t=Math.abs(t)>90?NaN:t,isNaN(t)||isNaN(r))return NaN;let n=r$t(r,360);r=n!==-180?n:180;let i=r*this.options._rlonres,a=-t*this.options._rlatres,o=Math.floor(i),s=Math.min(Math.round((this.options._height-1)/2-1),Math.floor(a));i-=o,a-=s,s+=(this.options._height-1)/2,o+=o<0?this.options._width:o>=this.options._width?-this.options._width:0;let u=0,c=0,l=0,f=0,h=new Array(MW);if(o===this._ix&&s===this._iy)this.options.cubic?h=this._t:(u=this._v00,c=this._v01,l=this._v10,f=this._v11);else if(!this.options.cubic)u=this._rawval(o,s),c=this._rawval(o+1,s),l=this._rawval(o,s+1),f=this._rawval(o+1,s+1);else{let d=[this._rawval(o,s-1),this._rawval(o+1,s-1),this._rawval(o-1,s),this._rawval(o,s),this._rawval(o+1,s),this._rawval(o+2,s),this._rawval(o-1,s+1),this._rawval(o,s+1),this._rawval(o+1,s+1),this._rawval(o+2,s+1),this._rawval(o,s+2),this._rawval(o+1,s+2)],b=XKt;s!==0&&(b=s===this.options._height-2?ZKt:YKt);let g=JKt;s!==0&&(g=s===this.options._height-2?QKt:$Kt);for(let x=0;x<MW;++x){h[x]=0;for(let E=0;E<e$t;++E)h[x]+=d[E]*b[MW*E+x];h[x]/=g}}if(!this.options.cubic){let d=(1-i)*u+i*c,b=(1-i)*l+i*f,g=(1-a)*d+a*b,x=this.options._offset+this.options._scale*g;return this._ix=o,this._iy=s,this._v00=u,this._v01=c,this._v10=l,this._v11=f,x}let p=h[0]+i*(h[1]+i*(h[3]+i*h[6]))+a*(h[2]+i*(h[4]+i*h[7])+a*(h[5]+i*h[8]+a*h[9]));return p=this.options._offset+this.options._scale*p,this._ix=o,this._iy=s,this._t=h,p}_rawval(t,r){t<0?t+=this.options._width:t>=this.options._width&&(t-=this.options._width),(r<0||r>=this.options._height)&&(r=r<0?-r:2*(this.options._height-1)-r,t+=(t<this.options._width/2?1:-1)*this.options._width/2);let n=this.options._datastart+t$t*(r*this.options._swidth+t),i=this.options.data[n],a=this.options.data[n+1];return i<<8|a}};function r$t(e,t){t=Math.abs(t);let r=Qke(e,t);return 2*Math.abs(r)===t?r-=Qke(e,2*t)-r:2*Math.abs(r)>t&&(r+=r<0?t:-t),r}function Qke(e,t){return e-Math.floor(e/t)*t}var n$t=10,i$t=65535;function qW(e,t){let r=a$t(e),n=r.next();if(n.done||n.value.line!=="P5")throw new Error("Geoid model file: File not in PGM format");let i=Number.MAX_VALUE,a=0,o=-1,s=-1,u="NONE",c="UNKNOWN",l=0,f=0,h=null,p=null;do{n=r.next();let x=n.value.line;if(x.length)if(x[0]==="#"){let E=x.split(" "),S=E[0],F=E[1];if(S!=="#"||!F)continue;let D=E.length>2?E.slice(2):[];if(F==="Description")u=D.join(" ");else if(F==="DateTime")c=D.join(" ");else if(F==="Offset"){if(!E[2])throw new Error("Geoid model file: Error reading offset");i=parseInt(E[2],10)}else if(F==="Scale"){if(!E[2])throw new Error("Geoid model file: Error reading scale");a=parseFloat(E[2])}else F===(t.cubic?"MaxCubicError":"MaxBilinearError")?isFinite(parseFloat(E[2]))&&(o=parseFloat(E[2])):F===(t.cubic?"RMSCubicError":"RMSBilinearError")&&isFinite(parseFloat(E[2]))&&(s=parseFloat(E[2]))}else{let E=x.split(" ");if(E=E.filter(S=>S!==""),l=parseInt(E[0],10),f=parseInt(E[1],10),!(l&&f))throw new Error("Geoid model file: Error reading raster size");break}}while(!n.done);n=r.next();let d=parseInt(n.value.line,10);if(n.done)throw new Error("Geoid model file: Error reading maxval");if(d!==i$t)throw new Error("Geoid model file: Incorrect value of maxval");if(h=n.value.offset,p=l,i===Number.MAX_VALUE)throw new Error("Geoid model file: Offset not set");if(a===0)throw new Error("Geoid model file: Scale not set");if(a<0)throw new Error("Geoid model file: Scale must be positive");if(f<2||l<2)throw new Error("Geoid model file: Raster size too small");if(l&1)throw new Error("Geoid model file: Raster width is odd");if(!(f&1))throw new Error("Geoid model file: Raster height is even");let b=l/360,g=(f-1)/180;return new Qb({cubic:t.cubic,_width:l,_height:f,_rlonres:b,_rlatres:g,_offset:i,_scale:a,_swidth:p,_datastart:h,_maxerror:o,_rmserror:s,_description:u,_datetime:c,data:e})}function*a$t(e){let t=0;do{let r=e.indexOf(n$t,t);if(r!==-1){let n=e.subarray(t,r);t=r+1,yield{offset:t,line:Zke(n)}}else{let n=e.subarray(t,e.length);t=e.length,yield{offset:t,line:Zke(n)}}}while(t<e.length);return{offset:t,line:""}}function Zke(e){let t="";for(let r of e)t+=String.fromCharCode(r);return t}var o$t="4.0.0";var ZF={name:"PGM - Netpbm grayscale image format",id:"pgm",module:"tile-converter",version:o$t,mimeTypes:["image/x-portable-graymap"],parse:async(e,t)=>qW(new Uint8Array(e),(t==null?void 0:t.pgm)||{}),extensions:["pgm"],options:{pgm:{cubic:!1}}};var Zb=$t(_u(),1);var eBe={id:{path:"id",transform:e=>e.toUpperCase()},profile:{path:"profile",default:"meshpyramids"},version:{path:"version",default:"1.8"},resourcePattern:{path:"resourcePattern",default:["3dNodeIndexDocument","Attributes","SharedResource","Geometry"]},rootNode:{path:"rootNode",default:"./nodes/root"},extent:{path:"extent"},indexCRS:{path:"indexCRS",default:"http://www.opengis.net/def/crs/EPSG/0/4326"},vertexCRS:{path:"vertexCRS",default:"http://www.opengis.net/def/crs/EPSG/0/4326"},normalReferenceFrame:{path:"normalReferenceFrame",default:"east-north-up"},attributeEncoding:{path:"attributeEncoding",default:"application/octet-stream; version=1.6"},textureEncoding:{path:"textureEncoding",default:["image/jpeg","image/ktx2"]},lodType:{path:"lodType",default:"MeshPyramid"},lodModel:{path:"lodModel",default:"node-switching"},defaultGeometrySchema:{path:"defaultGeometrySchema",default:{geometryType:"triangles",header:[{property:"vertexCount",type:"UInt32"},{property:"featureCount",type:"UInt32"}],topology:"PerAttributeArray",ordering:["position","normal","uv0","color"],vertexAttributes:{position:{valueType:"Float32",valuesPerElement:3},normal:{valueType:"Float32",valuesPerElement:3},uv0:{valueType:"Float32",valuesPerElement:2},color:{valueType:"UInt8",valuesPerElement:4}},featureAttributeOrder:["id","faceRange"],featureAttributes:{id:{valueType:"UInt64",valuesPerElement:1},faceRange:{valueType:"UInt32",valuesPerElement:2}}}}};var s$t=()=>({wkid:{path:"wkid",default:4326},latestWkid:{path:"latestWkid",default:4326},vcsWkid:{path:"vcsWkid",default:5773},latestVcsWkid:{path:"latestVcsWkid",default:5773}}),u$t=()=>({heightModel:{path:"heightModel",default:"gravity_related_height"},vertCRS:{path:"vertCRS",default:"EGM96_Geoid"},heightUnit:{path:"heightUnit",default:"meter"}}),c$t=()=>({nodesPerPage:{path:"nodesPerPage"},lodSelectionMetricType:{path:"lodSelectionMetricType",default:"maxScreenThresholdSQ"}}),l$t=()=>({xmin:{path:"xmin"},ymin:{path:"ymin"},xmax:{path:"xmax"},ymax:{path:"ymax"},zmin:{path:"zmin"},zmax:{path:"zmax"}}),tBe=()=>({version:{path:"version",transform:e=>e.toUpperCase()},id:{path:"id",default:0},name:{path:"name"},href:{path:"href",default:"./layers/0"},layerType:{path:"layerType",default:"IntegratedMesh"},spatialReference:{path:"spatialReference",transform:e=>(0,Zb.default)(e,s$t())},capabilities:{path:"capabilities",default:["View","Query"]},store:{path:"store",transform:e=>(0,Zb.default)(e,eBe)},fullExtent:{path:"fullExtent",transform:e=>(0,Zb.default)(e,l$t())},heightModelInfo:{path:"heightModelInfo",transform:e=>(0,Zb.default)(e,u$t())},nodePages:{path:"nodePages",transform:e=>(0,Zb.default)(e,c$t())},materialDefinitions:{path:"materialDefinitions",default:[]},textureSetDefinitions:{path:"textureSetDefinitions",default:[]},geometryDefinitions:{path:"geometryDefinitions",default:[]},attributeStorageInfo:{path:"attributeStorageInfo",default:[]},fields:{path:"fields",default:[]},popupInfo:{path:"popupInfo",default:null}});var NW=$t(_u(),1),f$t=()=>({offset:{default:8},position:{default:{type:"Float32",component:3}},normal:{default:{type:"Float32",component:3}},uv0:{path:"hasTexture",transform:e=>e&&{type:"Float32",component:2}||!1,omitValues:[!1]},color:{default:{type:"UInt8",component:4}},uvRegion:{path:"hasUvRegions",transform:e=>e&&{type:"UInt16",component:4}||!1,omitValues:[!1]},featureId:{default:{binding:"per-feature",type:"UInt64",component:1}},faceRange:{default:{binding:"per-feature",type:"UInt32",component:2}}}),h$t=()=>({"compressedAttributes.encoding":{default:"draco"},"compressedAttributes.attributes":{path:"geometryConfig",transform:e=>{let t=["position","normal"];return e.hasTexture&&t.push("uv0"),t.push("color"),e.hasUvRegions&&t.push("uv-region"),t.push("feature-index"),t}}}),rBe=()=>({geometryBuffers:{path:"geometryConfig",transform:e=>{let t=[(0,NW.default)(e,f$t())];return e.draco&&t.push((0,NW.default)({geometryConfig:e},h$t())),t}}});var fw=$t(_u(),1),p$t=()=>({renderMode:{path:"renderMode",default:"solid"},shininess:{path:"shininess",default:1},reflectivity:{path:"reflectivity",default:0},ambient:{path:"ambient",default:[1,1,1]},diffuse:{path:"diffuse",default:[1,1,1]},specular:{path:"specular",default:[0,0,0]},useVertexColorAlpha:{path:"useVertexColorAlpha",default:!1},vertexRegions:{path:"vertexRegions",default:!1},vertexColors:{path:"vertexColors",default:!0}}),d$t=()=>({name:{path:"name",default:"standard"},type:{path:"type",default:"standard"},params:{path:"params",transform:(e,t,r)=>(0,fw.default)(r,p$t())}}),m$t=()=>({id:{path:"id"},size:{path:"size"},href:{path:"href",default:["../textures/0"]},length:{path:"length"}}),g$t=()=>({encoding:{path:"encoding"},wrap:{path:"wrap",default:["none"]},atlas:{path:"atlas",default:!1},uvSet:{path:"uvSet",default:"uv0"},channels:{path:"channels",default:"rgb"},images:{path:"images",transform:(e,t,r)=>e.map(n=>(0,fw.default)(n,m$t()))}}),nBe=()=>({materialDefinitions:{path:"materialDefinitionInfos",transform:v$t},textureDefinitions:{path:"textureDefinitionInfos",transform:b$t}});function v$t(e,t,r){let n={};for(let[i,a]of e.entries())n[`Mat${r.nodePath}${i}`]=(0,fw.default)(a,d$t());return n}function b$t(e,t,r){if(!e)return null;let n={};for(let[i,a]of e.entries()){let o=`${r.nodePath}${i}`;a.imageIndex=o,n[o]=(0,fw.default)(a,g$t())}return n}var y$t=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]);function aBe(e){var r,n;if(!((r=e==null?void 0:e.parentNode)!=null&&r.obb)||!((n=e==null?void 0:e.parentNode)!=null&&n.mbs))return[];let t=[];return x$t(t,e),_$t(t,e),t}function x$t(e,t){var o;let r=w$t(t.parentNode.obb),n=E$t(t);if(A$t(r,n))return;let a=`OBB of Tile (${t.id}) doesn't fit into Parent (${(o=t.parentNode)==null?void 0:o.id}) tile OBB`;e.push(a)}function _$t(e,t){var a;let r=iBe(t.mbs),n=iBe(t.parentNode.mbs);if(r.center.distanceTo(n.center)+r.radius>n.radius){let o=`MBS of Tile (${t.id}) doesn't fit into Parent (${(a=t.parentNode)==null?void 0:a.id}) tile MBS`;e.push(o)}}function iBe(e){return new Ya([e[0],e[1],e[2]],e[3])}function w$t(e){let{center:t,halfSize:r,quaternion:n}=e;return new aa().fromCenterHalfSizeQuaternion(t,r,n)}function E$t(e){let t=e.obb.halfSize,r=y$t,n=or.WGS84.cartographicToCartesian(e.obb.center),i=[];for(let a=0;a<r.length;a+=3){let s=new ce(r[a]*=t[0],r[a+1]*=t[1],r[a+2]*=t[2]).transformByQuaternion(e.obb.quaternion).add(n);i=i.concat(s)}return i}function A$t(e,t){let r=!0;for(let n=0;n<t.length/3;n+=3){let i=[t[n],t[n+1],t[n+2]],a=or.WGS84.cartesianToCartographic(i);if(e.distanceTo(a)>0){r=!1;break}}return r}var ek=class extends Array{enqueue(t){this.push(t)}dequeue(){return this.shift()}peek(){return this[0]}isEmpty(){return this.length===0}};var oBe=$t(require("process"),1),S$t=4*1024*1024*1024,ey=class extends ek{intervalId;writePromise=null;fileMap={};listeningInterval;writeConcurrency;constructor(t=2e3,r=400){super(),this.listeningInterval=t,this.writeConcurrency=r}async enqueue(t,r=!1){if(r){let{archiveKey:n,writePromise:i}=t,a=await i();n&&a&&(this.fileMap[n]=a)}else super.enqueue(t),oBe.default.memoryUsage().rss>S$t&&await this.startWrite()}startListening(){this.intervalId=setInterval(this.startWrite.bind(this),this.listeningInterval)}stopListening(){this.intervalId&&clearInterval(this.intervalId)}async startWrite(){this.writePromise||(this.writePromise=this.doWrite()),await this.writePromise,this.writePromise=null}async finalize(){this.stopListening(),await this.startWrite()}async doWrite(){for(;this.length;){let t=[],r=[];for(let i=0;i<this.writeConcurrency;i++){let a=this.dequeue();if(!a)break;let{archiveKey:o,writePromise:s}=a;r.push(o);let u=s();t.push(u)}let n=await Promise.allSettled(t);this.updateFileMap(r,n)}}updateFileMap(t,r){for(let n=0;n<t.length;n++){let i=t[n];i&&"value"in r[n]&&(this.fileMap[i]=r[n].value)}}};var ty="Tile converter does not work in browser, only in node js environment";var GW=require("path"),zW=$t(_u(),1);var sBe=$t(_u(),1),uBe=()=>({mbs:{path:"mbs"},obb:{path:"obb"}}),T$t=()=>({href:{path:"href"}}),C$t=()=>({id:{path:"id"},...T$t(),...uBe()}),UW=()=>({version:{path:"version"},id:{path:"id"},path:{path:"path"},level:{path:"level"},...uBe(),lodSelection:{path:"lodSelection",default:[{metricType:"maxScreenThresholdSQ",maxError:196349.54374999998},{metricType:"maxScreenThreshold",maxError:999.9999999999999}]},children:{path:"children",default:null},neighbors:{path:"neighbors",default:null},parentNode:{path:"parentNode",transform:e=>(0,sBe.default)(e,C$t()),default:null},sharedResource:{path:"sharedResource",default:null},featureData:{path:"featureData",default:null},geometryData:{path:"geometryData",default:null},textureData:{path:"textureData",default:null},attributeData:{path:"attributeData",default:null}});var Au=class{id;inPageId;data=null;children=[];converter;_finalized=!1;get finalized(){return this._finalized}constructor(t,r){this.inPageId=t,this.id=t===0?"root":t.toString(),this.converter=r}async addData(t){return this.converter.options.instantNodeWriting?await this.write(t):this.data=t,this}async addChildren(t){let r=[];for(let i of t){let a=await i.load();r.push({id:i.id,href:`../${i.id}`,obb:a.obb,mbs:a.mbs})}this.children=this.children.concat(t);let n=this.data;this.converter.options.instantNodeWriting&&(n=await this.load()),n&&(n.children=n.children??[],n.children=n.children.concat(r)),this.converter.options.instantNodeWriting&&n&&await this.write(n)}async addNeighbors(){var r;if(this.finalized)return;let t=await this.load();for(let n of this.children){let i=await n.load();if(i.neighbors=i.neighbors??[],Number((r=t==null?void 0:t.children)==null?void 0:r.length)<1e3)for(let a of t.children||[])n.id!==a.id&&i.neighbors.push({...a});else console.warn(`Node ${n.id}: neighbors attribute is omited because of large number of neigbors`),delete i.neighbors;this.converter.options.instantNodeWriting&&i&&await n.write(i),await n.save()}this.finalize()}async save(){this.data&&await this.write(this.data)}finalize(){this._finalized=!0;for(let t of this.children)t.flush()}async write(t){let r=(0,GW.join)(this.converter.layers0Path,"nodes",this.id);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodes/${this.id}/3dNodeIndexDocument.json.gz`,writePromise:()=>Mc(r,JSON.stringify(t),"3dNodeIndexDocument.json",!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>Fi(r,JSON.stringify(t))},!0)}async load(){if(this.data)return this.data;let t=this.id,r=(0,GW.join)(this.converter.layers0Path,"nodes",t),n="index.json";return this.converter.options.slpk&&(n="3dNodeIndexDocument.json"),await KF(r,n)}flush(){this.data=null}static async createRootNode(t,r){let n=Au.createRootNodeIndexDocument(t);return await new Au(0,r).addData(n)}static async createNode(t,r,n,i,a,o){let s=await Au.createNodeIndexDocument(t,r,n,i,a);return await new Au(i.index,o).addData(s)}static createRootNodeIndexDocument(t){let r={version:`{${Bc().toUpperCase()}}`,id:"root",level:0,lodSelection:[{metricType:"maxScreenThresholdSQ",maxError:0},{metricType:"maxScreenThreshold",maxError:0}],...t,children:[]};return(0,zW.default)(r,UW())}static async createNodeIndexDocument(t,r,n,i,a){var h,p;let{texture:o,attributes:s}=a,u=i.index,c=await t.load(),l={version:c.version,id:u.toString(),level:c.level+1,...r,lodSelection:n,parentNode:{id:t.id,href:`../${t.id}`,mbs:c.mbs,obb:c.obb},children:[],neighbors:[]},f=(0,zW.default)(l,UW());if(i.mesh&&(f.geometryData=[{href:"./geometries/0"}],f.sharedResource={href:"./shared"},o&&(f.textureData=[{href:"./textures/0"},{href:"./textures/1"}]),s&&s.length&&((p=(h=t.converter.layers0)==null?void 0:h.attributeStorageInfo)!=null&&p.length))){f.attributeData=[];let d=s.length<t.converter.layers0.attributeStorageInfo.length?s.length:t.converter.layers0.attributeStorageInfo.length;for(let b=0;b<d;b++){let g=t.converter.layers0.attributeStorageInfo[b].key;f.attributeData.push({href:`./attributes/${g}/0`})}}return f}};var HW=async(e,t,r)=>{let n=hw(t);if(!e||!t.contentUrl||!n)return;let i={...r,[e.loader.id]:{isTileset:n,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}},a=await tk(t.contentUrl,e.loader,i);a.root&&(t.children=[a.root])},WW=async(e,t,r)=>{let n=hw(t);if(!e||!t.contentUrl||n)return null;let i={...r,[e.loader.id]:{...r[e.loader.id]||{},isTileset:n,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}};return await tk(t.contentUrl,e.loader,i)};async function tk(e,t,r){let n=e.split(".3tz"),i;if(n.length===1)i=null;else if(n.length===2)i=n[1].slice(1),i===""&&(i="tileset.json");else throw new Error("Unexpected URL format");if(i){let a=`${n[0]}.3tz`,o=new i2(a),s=await An(i,t,{...r,fetch:o.fetch.bind(o)});return await o.destroy(),s}return await An(e,t,r)}function hw(e){return(e==null?void 0:e.type)==="json"||(e==null?void 0:e.type)==="3tz"}var rk=async(e,t,r,n,i,a=0)=>{if(i&&a>i)return;let o=[],s=await r(e,t);o.push(s);for(let u of e.children)await rk(u,s,r,n,i,a+1);n&&await n(o,t)};var D$t=["POINTS","LINES","LINE_LOOP","LINE_STRIP","TRIANGLES","TRIANGLE_STRIP","TRIANGLE_FAN"],cBe=async e=>{let t={meshTopologyTypes:new Set,metadataClasses:new Set};if(!(e!=null&&e.gltfArrayBuffer))return t;let n=(await ko(e.gltfArrayBuffer,Il,{gltf:{normalize:!1,loadBuffers:!1,loadImages:!1,decompressMeshes:!1}})).json;if(!n)return t;let i=F$t(n),a=k$t(n);return{meshTopologyTypes:i,metadataClasses:a}},F$t=e=>{let t=new Set;for(let r of e.meshes||[])for(let n of r.primitives){let{mode:i}=n;typeof i!="number"&&(i=4),t.add(D$t[i])}return t},k$t=e=>{var i,a,o,s,u,c;let t=new Set,r=(o=(a=(i=e.extensions)==null?void 0:i[gs])==null?void 0:a.schema)==null?void 0:o.classes;if(r)for(let l of Object.keys(r))t.add(l);let n=(c=(u=(s=e.extensions)==null?void 0:s[Ol])==null?void 0:u.schema)==null?void 0:c.classes;if(n)for(let l of Object.keys(n))t.add(l);return t},lBe=(e,t)=>{for(let r of t.meshTopologyTypes)e.meshTopologyTypes.add(r);for(let r of t.metadataClasses)e.metadataClasses.add(r)};var hBe,B$t=(hBe=C0.default.env)==null?void 0:hBe.IonToken,fBe=64,O$t="3DTILES",I$t="3DObject",P$t=1800,R$t="https://",ry=class{nodePages;options;layers0Path;materialMap;materialDefinitions;geometryMap;geometryConfigs;vertexCounter;layers0;featuresHashArray;refinementCounter;validate;boundingVolumeWarnings=[];conversionStartTime=[0,0];refreshTokenTime=[0,0];sourceTileset=null;loadOptions={_nodeWorkers:!0,reuseWorkers:!0,useLocalLibraries:!0,basis:{format:"rgba32",workerUrl:"./modules/textures/dist/basis-worker-node.js"},draco:{workerUrl:"./modules/draco/dist/draco-worker-node.js"},fetch:{},modules:{}};geoidHeightModel=null;Loader=Ec;generateTextures;generateBoundingVolumes;layersHasTexture;workerSource={};writeQueue=new ey;compressList=null;preprocessData={meshTopologyTypes:new Set,metadataClasses:new Set};constructor(){this.nodePages=new Za(Fi,fBe,this),this.options={},this.layers0Path="",this.materialMap=new Map,this.materialDefinitions=[],this.geometryMap=new Map,this.geometryConfigs=[],this.vertexCounter=0,this.layers0=null,this.featuresHashArray=[],this.refinementCounter={tilesCount:0,tilesWithAddRefineCount:0},this.validate=!1,this.generateTextures=!1,this.generateBoundingVolumes=!1,this.layersHasTexture=!1,this.compressList=null}async convert(t){if(gn)return console.log(ty),ty;this.conversionStartTime=C0.default.hrtime();let{tilesetName:r,slpk:n,egmFilePath:i,inputUrl:a,validate:o,outputPath:s,draco:u=!0,sevenZipExe:c,maxDepth:l,token:f,generateTextures:h,generateBoundingVolumes:p,instantNodeWriting:d=!1,mergeMaterials:b=!0,inquirer:g,metadataClass:x,analyze:E=!1}=t;this.options={maxDepth:l,slpk:n,sevenZipExe:c,egmFilePath:i,draco:u,token:f,inputUrl:a,instantNodeWriting:d,mergeMaterials:b,inquirer:g,metadataClass:x},this.compressList=this.options.instantNodeWriting&&[]||null,this.validate=Boolean(o),this.Loader=a.indexOf(R$t)!==-1?hD:Ec,this.generateTextures=Boolean(h),this.generateBoundingVolumes=Boolean(p),this.writeQueue=new ey,this.writeQueue.startListening(),console.log("Loading egm file..."),this.geoidHeightModel=await An(i,ZF),console.log("Loading egm file completed!"),n&&this.nodePages.useWriteFunction(Mc);try{let S=await this._fetchPreloadOptions(),F=a;S.url&&(F=S.url),S.headers&&(this.loadOptions.fetch={headers:S.headers}),this.sourceTileset=await tk(F,this.Loader,this.loadOptions),(this.Loader===Ec||E?await this.preprocessConversion():!0)&&!E&&await this.selectMetadataClass()&&(await this._createAndSaveTileset(s,r),await this._finishConversion({slpk:Boolean(n),outputPath:s,tilesetName:r}))}catch(S){throw S}finally{await this.writeQueue.finalize(),Ra.getWorkerFarm({}).destroy()}return"success"}async preprocessConversion(){console.log("Analyze source tileset");let t=this.sourceTileset.root;await rk(t,null,this.analyzeTile.bind(this),void 0,this.options.maxDepth);let{meshTopologyTypes:r,metadataClasses:n}=this.preprocessData;return console.log("------------------------------------------------"),console.log("Preprocess results:"),console.log(`glTF mesh topology types: ${Array.from(r).join(", ")}`),n.size?console.log(`Feature metadata classes have been found: ${Array.from(n).join(", ")}`):console.log("Feature metadata classes have not been found"),console.log("------------------------------------------------"),!r.has("TRIANGLES")&&!r.has("TRIANGLE_STRIP")?(console.log("The tileset is of unsupported mesh topology types. The conversion will be interrupted."),console.log("------------------------------------------------"),!1):!0}async analyzeTile(t,r){if(hw(t))return await HW(this.sourceTileset,t,this.loadOptions),null;t.id&&console.log(`[analyze]: ${t.id}`);let i=null;try{i=await WW(this.sourceTileset,t,{...this.loadOptions,"3d-tiles":{...this.loadOptions["3d-tiles"],loadGLTF:!1}})}catch{console.log(`[warning]: Failed to load ${t.contentUrl}. An I3S tile with empty content will be added to the output tileset`)}let a=await cBe(i);return lBe(this.preprocessData,a),null}async selectMetadataClass(){var r;let{metadataClasses:t}=this.preprocessData;if(t.size>1)if((r=this.options.metadataClass)!=null&&r.length)console.log(`${this.options.metadataClass} has been selected`);else if(this.options.inquirer){let n=await this.options.inquirer.prompt([{name:"metadataClass",type:"list",message:"Select feature metadata data class to convert...",choices:Array.from(t)}]);this.options.metadataClass=n.metadataClass,console.log(`${n.metadataClass} has been selected`)}else return console.log(`A feature metadata class has not been selected. Start the converter with option "--metadata-class". For example, "npx tile-converter ... --metadata-class ${Array.from(t)[0]}"`),console.log("------------------------------------------------"),!1;return!0}async _createAndSaveTileset(t,r){var u,c,l;let n=(0,Na.join)(`${t}`,`${r}`);try{await aw(n)}catch{}this.layers0Path=(0,Na.join)(n,"SceneServer","layers","0"),this.materialDefinitions=[],this.materialMap=new Map;let i=this.sourceTileset.root,a=C8(i.boundingVolume,new Kr(i.transform),null);this._formLayers0(r,a,(l=(c=(u=this.sourceTileset)==null?void 0:u.root)==null?void 0:c.boundingVolume)==null?void 0:l.region);let o=IW(a,this.geoidHeightModel);await this.nodePages.push({index:0,lodThreshold:0,obb:o.obb,children:[]});let s=await Au.createRootNode(o,this);await rk(i,{transform:new Kr(i.transform),parentNodes:[s]},this.convertTile.bind(this),this.finalizeTile.bind(this),this.options.maxDepth),this.layers0.materialDefinitions=this.materialDefinitions,this.layers0.geometryDefinitions=(0,nk.default)(this.geometryConfigs.map(f=>({geometryConfig:{...f,draco:this.options.draco}})),rBe()),this.layersHasTexture===!1&&(this.layers0.store.defaultGeometrySchema.ordering=this.layers0.store.defaultGeometrySchema.ordering.filter(f=>f!=="uv0")),await this._writeLayers0(),Jke(r,this.layers0,n);for(let f of this.compressList||[])await VF(f),await OW(f);await this.nodePages.save(),await this.writeQueue.finalize(),await this._createSlpk(n)}_formLayers0(t,r,n){var s;if(!((s=this.sourceTileset)!=null&&s.root))return;let i=Ske(r);n&&(i.zmin=n[4],i.zmax=n[5]);let a=[i.xmin,i.ymin,i.xmax,i.ymax],o={version:`{${Bc().toUpperCase()}}`,id:0,name:t,href:"./layers/0",store:{id:`{${Bc().toUpperCase()}}`,extent:a},nodePages:{nodesPerPage:fBe},compressGeometry:this.options.draco,fullExtent:i};this.layers0=(0,nk.default)(o,tBe())}async _writeLayers0(){this.options.slpk?await this.writeQueue.enqueue({archiveKey:"3dSceneLayer.json.gz",writePromise:()=>Mc(this.layers0Path,JSON.stringify(this.layers0),"3dSceneLayer.json")}):await this.writeQueue.enqueue({writePromise:()=>Fi(this.layers0Path,JSON.stringify(this.layers0))})}async _createSlpk(t){if(this.options.slpk){let r=(0,Na.join)(t,"SceneServer","layers","0"),n=`${t}.slpk`;await vke(r,n,0,".",this.options.sevenZipExe);try{await aw(t)}catch{}}}async convertTile(t,r){let n=hw(t);if(n||t.type==="empty")return n&&(t.id&&console.log(`[load]: ${t.id}`),await HW(this.sourceTileset,t,this.loadOptions)),r;t.id&&console.log(`[convert]: ${t.id}`);let{parentNodes:i,transform:a}=r,o=a.clone();t.transform&&(o=o.multiplyRight(t.transform));let s=i[0],u=await this._createNode(s,t,o);return await s.addChildren(u),{transform:o,parentNodes:u}}async finalizeTile(t,r){for(let n of t)for(let i of n.parentNodes)await i.addNeighbors();for(let n of r.parentNodes)await n.save()}async _createNode(t,r,n){this._checkAddRefinementTypeForTile(r),await this._updateTilesetOptions();let i=null;try{i=await WW(this.sourceTileset,r,this.loadOptions)}catch{console.log(`[warning]: Failed to load ${r.contentUrl}`)}let a=C8(r.boundingVolume,n,null),o=IW(a,this.geoidHeightModel),s=Vke(i,this.options.metadataClass);this.createAttributeStorageInfo(i,s);let u=await this._convertResources(r,n,a,i,t.inPageId,s),c=[],l=[],f=[],h={geometry:null,compressedGeometry:null,texture:null,hasUvRegions:!1,sharedResources:null,meshMaterial:null,vertexCount:null,attributes:null,featureCount:null,boundingVolumes:null};for(let p of u||[h]){this.layersHasTexture=this.layersHasTexture||Boolean(p.texture),this.generateBoundingVolumes&&p.boundingVolumes&&(o=p.boundingVolumes);let d=Xke(r,o),b=d.find(S=>S.metricType==="maxScreenThresholdSQ")||{maxError:0},g=await this._updateNodeInNodePages(b,o,r,t.inPageId,p),x=await Au.createNodeIndexDocument(t,o,d,g,p),E=await new Au(g.index,this).addData(x);c.push(E),g.mesh&&await this._writeResources(p,E.id),this.validate&&(this.boundingVolumeWarnings=aBe(x),this.boundingVolumeWarnings&&this.boundingVolumeWarnings.length&&console.warn("Bounding Volume Warnings: ",...this.boundingVolumeWarnings)),l.push(g.index),f.push(g)}return c}async _convertResources(t,r,n,i,a,o){var c;if(!this.isContentSupported(t)||!i)return null;let s={center:[],halfSize:[],quaternion:[]};return await RW(i,r,n,async()=>(await this.nodePages.push({index:0,obb:s},a)).index,o,this.featuresHashArray,(c=this.layers0)==null?void 0:c.attributeStorageInfo,this.options.draco,this.generateBoundingVolumes,this.options.mergeMaterials,this.geoidHeightModel,this.loadOptions.modules,this.options.metadataClass)}async _updateNodeInNodePages(t,r,n,i,a){let{meshMaterial:o,texture:s,vertexCount:u,featureCount:c,geometry:l,hasUvRegions:f}=a,h={index:0,lodThreshold:t.maxError,obb:r.obb,children:[]};l&&this.isContentSupported(n)&&(h.mesh={geometry:{definition:this.findOrCreateGeometryDefinition(Boolean(s),f),resource:0},attribute:{resource:0},material:{definition:0}});let p=a.nodeId,d;if(p?d=await this.nodePages.getNodeById(p):d=await this.nodePages.push(h,i),h.mesh||console.log(`[warning]: node ${d.index} is created with empty content`),Za.updateAll(d,h),o&&Za.updateMaterialByNodeId(d,this._findOrCreateMaterial(o)),s){let b=s.image.height*s.image.width;Za.updateTexelCountHintByNodeId(d,b)}return u&&(this.vertexCounter+=u,Za.updateVertexCountByNodeId(d,u)),Za.updateNodeAttributeByNodeId(d),c&&Za.updateFeatureCountByNodeId(d,c),this.nodePages.saveNode(d),d}async _writeResources(t,r){let{geometry:n,compressedGeometry:i,texture:a,sharedResources:o,attributes:s}=t,u=(0,Na.join)(this.layers0Path,"nodes",r),c=(0,Na.join)("nodes",r);await this._writeGeometries(n,i,u,c),await this._writeShared(o,u,c,r),await this._writeTexture(a,u,c),await this._writeAttributes(s,u,c)}async _writeGeometries(t,r,n,i){if(this.options.slpk){let a=(0,Na.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/0.bin.gz`,writePromise:()=>Mc(a,t,"0.bin")})}else{let a=(0,Na.join)(n,"geometries/0/");await this.writeQueue.enqueue({writePromise:()=>Fi(a,t,"index.bin")})}if(this.options.draco)if(this.options.slpk){let a=(0,Na.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/1.bin.gz`,writePromise:()=>Mc(a,r,"1.bin")})}else{let a=(0,Na.join)(n,"geometries/1/");await this.writeQueue.enqueue({writePromise:()=>Fi(a,r,"index.bin")})}}async _writeShared(t,r,n,i){if(!t)return;t.nodePath=i;let a=(0,nk.default)(t,nBe()),o=JSON.stringify(a);if(this.options.slpk){let s=(0,Na.join)(r,"shared");await this.writeQueue.enqueue({archiveKey:`${n}/shared/sharedResource.json.gz`,writePromise:()=>Mc(s,o,"sharedResource.json")})}else{let s=(0,Na.join)(r,"shared/");await this.writeQueue.enqueue({writePromise:()=>Fi(s,o)})}}async _writeTexture(t,r,n){if(t){let i=this._getFormatByMimeType(t==null?void 0:t.mimeType),a=[],o=t.bufferView.data;switch(i){case"jpg":case"png":{if(a.push({name:"0",format:i}),await this.writeTextureFile(o,"0",i,r,n),this.generateTextures){a.push({name:"1",format:"ktx2"});let s=t.image.data.subarray(),u=new Uint8Array(s),c=hv({...t.image,data:u},xq,{...xq.options,["ktx2-basis-writer"]:{workerUrl:"./modules/textures/dist/ktx2-basis-writer-worker-node.js"},reuseWorkers:!0,_nodeWorkers:!0,useLocalLibraries:!0});await this.writeTextureFile(c,"1","ktx2",r,n)}break}case"ktx2":if(a.push({name:"1",format:i}),await this.writeTextureFile(o,"1",i,r,n),this.generateTextures){a.push({name:"0",format:"jpg"});let s=hv(t.image.data[0],nq);await this.writeTextureFile(s,"0","jpg",r,n)}}this.layers0.textureSetDefinitions.length||(this.layers0.textureSetDefinitions.push({formats:a}),this.layers0.textureSetDefinitions.push({formats:a,atlas:!0}))}}async writeTextureFile(t,r,n,i,a){if(this.options.slpk){let o=(0,Na.join)(i,"textures"),s=!1;await this.writeQueue.enqueue({archiveKey:`${a}/textures/${r}.${n}`,writePromise:()=>Mc(o,t,`${r}.${n}`,s)})}else{let o=(0,Na.join)(i,`textures/${r}/`);await this.writeQueue.enqueue({writePromise:()=>Fi(o,t,`index.${n}`)})}}async _writeAttributes(t=[],r,n){var i,a;if(t!=null&&t.length&&((a=(i=this.layers0)==null?void 0:i.attributeStorageInfo)!=null&&a.length)){let o=t.length<this.layers0.attributeStorageInfo.length?t.length:this.layers0.attributeStorageInfo.length;for(let s=0;s<o;s++){let u=this.layers0.attributeStorageInfo[s].key,c=new Uint8Array(t[s]);if(this.options.slpk){let l=(0,Na.join)(r,"attributes",u);await this.writeQueue.enqueue({archiveKey:`${n}/attributes/${u}.bin.gz`,writePromise:()=>Mc(l,c,"0.bin")})}else{let l=(0,Na.join)(r,`attributes/${u}/0`);await this.writeQueue.enqueue({writePromise:()=>Fi(l,c,"index.bin")})}}}}_getFormatByMimeType(t){switch(t){case"image/jpeg":return"jpg";case"image/png":return"png";case"image/ktx2":return"ktx2";default:return"jpg"}}_findOrCreateMaterial(t){let r=(0,VW.default)(JSON.stringify(t));if(this.materialMap.has(r))return this.materialMap.get(r)||0;let n=this.materialDefinitions.push(t)-1;return this.materialMap.set(r,n),n}findOrCreateGeometryDefinition(t,r){let n={hasTexture:t,hasUvRegions:r},i=(0,VW.default)(JSON.stringify(n));if(this.geometryMap.has(i))return this.geometryMap.get(i)||0;let a=this.geometryConfigs.push(n)-1;return this.geometryMap.set(i,a),a}createAttributeStorageInfo(t,r){let n=null;this.options.metadataClass?!this.layers0.attributeStorageInfo.length&&(t!=null&&t.gltf)&&(n=qke(t.gltf,this.options.metadataClass)):r&&(n=Mke(r)),n&&this.createStorageAttributes(n)}createStorageAttributes(t){if(!Object.keys(t).length)return;let r={OBJECTID:"OBJECTID",...t},n=!1,i=this.layers0.attributeStorageInfo.length;for(let a in r)if(!this.layers0.attributeStorageInfo.find(s=>s.name===a)){let s=r[a],u=Pke(i,a,s),c=Rke(s),l=jke(a,c);this.layers0.attributeStorageInfo.push(u),this.layers0.fields.push(l),i+=1,n=!0}if(n){let a=[];for(let o of this.layers0.attributeStorageInfo)a.push(o.name);this.layers0.popupInfo=Lke(a),this.layers0.layerType=I$t}}async _finishConversion(t){let{tilesCount:r,tilesWithAddRefineCount:n}=this.refinementCounter,i=n?n/r*100:0,a=await JF(t),o=C0.default.hrtime(this.conversionStartTime),s=YF(o);console.log("------------------------------------------------"),console.log(`Finishing conversion of ${O$t}`),console.log(`Total conversion time: ${s}`),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",a," bytes"),console.log('Percentage of tiles with "ADD" refinement type:',i,"%"),console.log("------------------------------------------------")}async _fetchPreloadOptions(){if(!this.Loader.preload)return{};let t={"cesium-ion":{accessToken:this.options.token||B$t}},r=await this.Loader.preload(this.options.inputUrl,t);return this.refreshTokenTime=C0.default.hrtime(),{...t,...r}}async _updateTilesetOptions(){if(C0.default.hrtime(this.refreshTokenTime)[0]<P$t)return;this.refreshTokenTime=C0.default.hrtime();let r=await this._fetchPreloadOptions();r.headers&&(this.loadOptions.fetch={...this.loadOptions.fetch,headers:r.headers},console.log("Authorization Bearer token has been updated"))}_checkAddRefinementTypeForTile(t){t.refine===1&&(this.refinementCounter.tilesWithAddRefineCount+=1,console.warn('This tile uses "ADD" type of refinement')),this.refinementCounter.tilesCount+=1}isContentSupported(t){return["b3dm","glTF","scenegraph"].includes(t.type||"")}};var RBe=require("path"),XW=$t(require("process"),1),jBe=$t(_u(),1);function KW(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 pBe={UInt8:Ht.UNSIGNED_BYTE,UInt16:Ht.UNSIGNED_SHORT,Float32:Ht.FLOAT,UInt32:Ht.UNSIGNED_INT,UInt64:Ht.DOUBLE};function ny(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 dBe="String",mBe="Oid32",gBe="Float64",vBe="Int16";function ik(e){let t;try{let r=new URL(e);t=`${r.origin}${r.pathname}`}catch{}return t||e}function iy(e,t=null){return t?`${e}?token=${t}`:e}function bBe(e,t){let{attributeData:r=[]}=t,n=[];for(let i=0;i<r.length;i++){let a=r[i].href.replace("./","");n.push(`${e}/${a}`)}return n}function yBe(e,t,r){let n=[],{attributeStorageInfo:i=[]}=e;for(let a=0;a<i.length;a++){let o=i[a].key;n.push(`${t}/nodes/${r}/attributes/${o}/0`)}return n}var ak=new ce([0,0,0]);function L$t(e){switch(e){case"ktx-etc2":case"dds":return Y8;case"ktx2":return Id;case"jpg":case"png":default:return Tv}}var M$t="i3s-attribute-type";async function EBe(e,t,r,n,i){var o;let a={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new Kr,coordinateSystem:0,byteLength:0,texture:null};if(t.textureUrl){let s=iy(t.textureUrl,(o=n==null?void 0:n.i3s)==null?void 0:o.token),u=L$t(t.textureFormat),f=await(await((i==null?void 0:i.fetch)||fetch)(s)).arrayBuffer();if(n!=null&&n.i3s.decodeTextures){if(u===Tv){let h={...t.textureLoaderOptions,image:{type:"data"}};try{let p=await So(f,[],h,i);a.texture=p}catch{let d=await ko(f,u,h,i);a.texture=d}}else if(u===Y8||u===Id){let h=await An(f,u,t.textureLoaderOptions);u===Id&&(h=h[0]),a.texture={compressed:!0,mipmaps:!1,width:h[0].width,height:h[0].height,data:h}}}else a.texture=f}return a.material=K$t(t.materialDefinition,a.texture),a.material&&(a.texture=null),await q$t(e,a,t,r,n)}async function q$t(e,t,r,n,i){var f,h;let a=e.byteLength,o,s,u=0,c=0,l;if(r.isDracoGeometry){let p=await ko(e,xv,{draco:{attributeNameEntry:M$t}});s=p.header.vertexCount,l=(f=p.indices)==null?void 0:f.value;let{POSITION:d,NORMAL:b,COLOR_0:g,TEXCOORD_0:x,["feature-index"]:E,["uv-region"]:S}=p.attributes;o={position:d,normal:b,color:g,uv0:x,uvRegion:S,id:E},N$t(o,p);let F=X$t(E);F&&J$t(o,F)}else{let{vertexAttributes:p,ordering:d,featureAttributes:b,featureAttributeOrder:g}=n.store.defaultGeometrySchema,x=G$t(e,n);u=x.byteOffset,s=x.vertexCount,c=x.featureCount;let{attributes:E,byteOffset:S}=_Be(e,u,p,s,d),{attributes:F}=_Be(e,S,b,c,g);Y$t(F),o=U$t(E,F)}if(!((h=i==null?void 0:i.i3s)!=null&&h.coordinateSystem)||i.i3s.coordinateSystem===2){let p=H$t(o.position,r);t.modelMatrix=p.invert(),t.coordinateSystem=2}else t.modelMatrix=V$t(o.position),t.coordinateSystem=3;t.attributes={positions:o.position,normals:o.normal,colors:xBe(o.color),texCoords:o.uv0,uvRegions:xBe(o.uvRegion||o.region)},t.indices=l||null,o.id&&o.id.value&&(t.featureIds=o.id.value);for(let p in t.attributes)t.attributes[p]||delete t.attributes[p];return t.vertexCount=s,t.byteLength=a,t}function N$t(e,t){for(let r in t.loaderData.attributes){let n=t.loaderData.attributes[r];switch(n.name){case"POSITION":e.position.metadata=n.metadata;break;case"feature-index":e.id.metadata=n.metadata;break;default:break}}}function U$t(e,t){return{...e,...t}}function xBe(e){return e&&(e.normalized=!0,e)}function G$t(e,t){let r=0,n=0,i=0;for(let{property:a,type:o}of t.store.defaultGeometrySchema.header){let s=KW(o);switch(a){case"vertexCount":n=new s(e,0,4)[0],r+=ny(o);break;case"featureCount":i=new s(e,4,4)[0],r+=ny(o);break;default:break}}return{vertexCount:n,featureCount:i,byteOffset:r}}function _Be(e,t,r,n,i){let a={};for(let o of i)if(r[o]){let{valueType:s,valuesPerElement:u}=r[o];if(t+n*u*ny(s)<=e.byteLength){let c=e.slice(t),l;if(s==="UInt64")l=z$t(c,n*u,ny(s));else{let f=KW(s);l=new f(c,0,n*u)}switch(a[o]={value:l,type:pBe[s],size:u},o){case"color":a.color.normalized=!0;break;case"position":case"region":case"normal":default:}t=t+n*u*ny(s)}else if(o!=="uv0")break}return{attributes:a,byteOffset:t}}function z$t(e,t,r){let n=[],i=new DataView(e),a=0;for(let o=0;o<t;o++){let s=i.getUint32(a,!0),u=i.getUint32(a+4,!0),c=s+2**32*u;n.push(c),a+=r}return new Uint32Array(n)}function H$t(e,t){let r=t.mbs,n=e.value,i=e.metadata,a=new Kr,o=new ce(r[0],r[1],r[2]),s=new ce;return or.WGS84.cartographicToCartesian(o,s),or.WGS84.eastNorthUpToFixedFrame(s,a),e.value=W$t(n,i,o),a}function W$t(e,t={},r){let n=new Float64Array(e.length),i=t["i3s-scale_x"]&&t["i3s-scale_x"].double||1,a=t["i3s-scale_y"]&&t["i3s-scale_y"].double||1;for(let o=0;o<n.length;o+=3)n[o]=e[o]*i+r.x,n[o+1]=e[o+1]*a+r.y,n[o+2]=e[o+2]+r.z;for(let o=0;o<n.length;o+=3)or.WGS84.cartographicToCartesian(n.subarray(o,o+3),ak),n[o]=ak.x,n[o+1]=ak.y,n[o+2]=ak.z;return n}function V$t(e){var a,o;let t=e.metadata,r=((a=t==null?void 0:t["i3s-scale_x"])==null?void 0:a.double)||1,n=((o=t==null?void 0:t["i3s-scale_y"])==null?void 0:o.double)||1,i=new Kr;return i[0]=r,i[5]=n,i}function K$t(e,t){let r;return e?r={...e,pbrMetallicRoughness:e.pbrMetallicRoughness?{...e.pbrMetallicRoughness}:{baseColorFactor:[255,255,255,255]}}:(r={pbrMetallicRoughness:{}},t?r.pbrMetallicRoughness.baseColorTexture={texCoord:0}:r.pbrMetallicRoughness.baseColorFactor=[255,255,255,255]),r.alphaCutoff=r.alphaCutoff||.25,r.alphaMode&&(r.alphaMode=r.alphaMode.toUpperCase()),r.emissiveFactor&&(r.emissiveFactor=wBe(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=wBe(r.pbrMetallicRoughness.baseColorFactor)),t&&$$t(r,t),r}function wBe(e){let t=[...e];for(let r=0;r<e.length;r++)t[r]=e[r]/255;return t}function $$t(e,t){let r={source:{image:t}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture={...e.pbrMetallicRoughness.baseColorTexture,texture:r}:e.emissiveTexture?e.emissiveTexture={...e.emissiveTexture,texture:r}:e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture={...e.pbrMetallicRoughness.metallicRoughnessTexture,texture:r}:e.normalTexture?e.normalTexture={...e.normalTexture,texture:r}:e.occlusionTexture&&(e.occlusionTexture={...e.occlusionTexture,texture:r})}function Y$t(e){let{id:t,faceRange:r}=e;if(!t||!r)return;let n=t.value,i=r.value,a=i[i.length-1]+1,o=new Uint32Array(a*3),s=0,u=0;for(let c=1;c<i.length;c+=2){let l=Number(n[s]),f=i[c],h=i[c-1],p=f-h+1,d=u+p*3;o.fill(l,u,d),s++,u=d}e.id.value=o}function J$t(e,t){let r=e.id.value,n=new Float32Array(r.length);for(let i=0;i<r.length;i++)n[i]=t[r[i]];e.id.value=n}function X$t(e){var t,r;return(r=(t=e==null?void 0:e.metadata)==null?void 0:t["i3s-feature-ids"])==null?void 0:r.intArray}var Q$t="4.0.0",ABe={name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:Q$t,mimeTypes:["application/octet-stream"],parse:Z$t,extensions:["bin"],options:{"i3s-content":{}}};async function Z$t(e,t,r){let{tile:n,_tileOptions:i,tileset:a,_tilesetOptions:o}=(t==null?void 0:t.i3s)||{},s=i||n,u=o||a;return!s||!u?null:await EBe(e,s,u,t,r)}var eYt="4.0.0",SBe={name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:eYt,mimeTypes:["application/json"],parse:tYt,extensions:["json"],options:{i3s:{}}};async function tYt(e,t){return JSON.parse(new TextDecoder().decode(e))}var pw=class{tileset;nodePages=[];pendingNodePages=[];nodesPerPage;options;lodSelectionMetricType;textureDefinitionsSelectedFormats=[];nodesInNodePages;url;textureLoaderOptions={};constructor(t,r="",n){var i,a;this.tileset={...t},this.url=r,this.nodesPerPage=((i=t.nodePages)==null?void 0:i.nodesPerPage)||64,this.lodSelectionMetricType=(a=t.nodePages)==null?void 0:a.lodSelectionMetricType,this.options=n,this.nodesInNodePages=0,this.initSelectedFormatsForTextureDefinitions(t)}async getNodeById(t){var i;let r=Math.floor(t/this.nodesPerPage);if(!this.nodePages[r]&&!this.pendingNodePages[r]){let a=iy(`${this.url}/nodepages/${r}`,(i=this.options.i3s)==null?void 0:i.token);this.pendingNodePages[r]={status:"Pending",promise:An(a,SBe,this.options)},this.nodePages[r]=await this.pendingNodePages[r].promise,this.nodesInNodePages+=this.nodePages[r].nodes.length,this.pendingNodePages[r].status="Done"}this.pendingNodePages[r].status==="Pending"&&(this.nodePages[r]=await this.pendingNodePages[r].promise);let n=t%this.nodesPerPage;return this.nodePages[r].nodes[n]}async formTileFromNodePages(t){let r=await this.getNodeById(t),n=[],i=[];for(let p of r.children||[])i.push(this.getNodeById(p));let a=await Promise.all(i);for(let p of a)n.push({id:p.index.toString(),obb:p.obb});let o,s,u,c="jpg",l=[],f=!1;if(r&&r.mesh){let{url:p,isDracoGeometry:d}=r.mesh.geometry&&this.getContentUrl(r.mesh.geometry)||{isDracoGeometry:!1};o=p,f=d;let{textureData:b,materialDefinition:g}=this.getInformationFromMaterial(r.mesh.material);u=g,c=b.format||c,b.name&&(s=`${this.url}/nodes/${r.mesh.material.resource}/textures/${b.name}`),this.tileset.attributeStorageInfo&&(l=yBe(this.tileset,this.url,r.mesh.attribute.resource))}let h=this.getLodSelection(r);return $W({id:t.toString(),lodSelection:h,obb:r.obb,contentUrl:o,textureUrl:s,attributeUrls:l,materialDefinition:u,textureFormat:c,textureLoaderOptions:this.textureLoaderOptions,children:n,isDracoGeometry:f})}getContentUrl(t){let r=null,n=this.tileset.geometryDefinitions[t.definition],i=-1;if(this.options.i3s&&this.options.i3s.useDracoGeometry&&(i=n.geometryBuffers.findIndex(a=>a.compressedAttributes&&a.compressedAttributes.encoding==="draco")),i===-1&&(i=n.geometryBuffers.findIndex(a=>!a.compressedAttributes)),i!==-1){let a=Boolean(n.geometryBuffers[i].compressedAttributes);r={url:`${this.url}/nodes/${t.resource}/geometries/${i}`,isDracoGeometry:a}}return r}getLodSelection(t){let r=[];return this.lodSelectionMetricType==="maxScreenThresholdSQ"&&r.push({metricType:"maxScreenThreshold",maxError:Math.sqrt(t.lodThreshold/(Math.PI*.25))}),r.push({metricType:this.lodSelectionMetricType,maxError:t.lodThreshold}),r}getInformationFromMaterial(t){var n,i,a;let r={textureData:{name:null}};if(t){let o=(n=this.tileset.materialDefinitions)==null?void 0:n[t.definition];if(o){r.materialDefinition=o;let s=(a=(i=o==null?void 0:o.pbrMetallicRoughness)==null?void 0:i.baseColorTexture)==null?void 0:a.textureSetDefinitionId;typeof s=="number"&&(r.textureData=this.textureDefinitionsSelectedFormats[s]||r.textureData)}}return r}initSelectedFormatsForTextureDefinitions(t){this.textureDefinitionsSelectedFormats=[];let r=this.getSupportedTextureFormats(),n=t.textureSetDefinitions||[];for(let i of n){let a=i&&i.formats||[],o=null;for(let s of r){let u=a.find(c=>c.format===s);if(u){o=u;break}}o&&o.format==="ktx2"&&(this.textureLoaderOptions.basis={format:Pv(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(o)}}getSupportedTextureFormats(){let t=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){let r=s_();r.has("etc2")&&t.push("ktx-etc2"),r.has("dxt")&&t.push("dds"),t.push("ktx2")}return t.push("jpg"),t.push("png"),t}};function TBe(e,t){let r=t.url||"",n;e.geometryData&&(n=`${r}/${e.geometryData[0].href}`);let i;e.textureData&&(i=`${r}/${e.textureData[0].href}`);let a;e.attributeData&&(a=bBe(r,e));let o=e.children||[];return $W({...e,children:o,url:r,contentUrl:n,textureUrl:i,textureFormat:"jpg",attributeUrls:a,isDracoGeometry:!1})}function $W(e){var s,u;let t={},r=[0,0,0,1];if(e.mbs)r=e.mbs,t.sphere=[...or.WGS84.cartographicToCartesian(e.mbs.slice(0,3)),e.mbs[3]];else if(e.obb){t.box=[...or.WGS84.cartographicToCartesian(e.obb.center),...e.obb.halfSize,...e.obb.quaternion];let l=new aa().fromCenterHalfSizeQuaternion(t.box.slice(0,3),e.obb.halfSize,e.obb.quaternion).getBoundingSphere();t.sphere=[...l.center,l.radius],r=[...e.obb.center,l.radius]}let n=(s=e.lodSelection)==null?void 0:s[0].metricType,i=(u=e.lodSelection)==null?void 0:u[0].maxError,a="mesh",o=2;return{...e,mbs:r,boundingVolume:t,lodMetricType:n,lodMetricValue:i,type:a,refine:o}}async function CBe(e,t,r){let n=ik(r.url||""),i,a;if(e.nodePages)i=new pw(e,n,t),a=await i.formTileFromNodePages(0);else{let o=t.i3s,s=iy(`${n}/nodes/root`,o.token);a=await An(s,Zl,{...t,i3s:{...t.i3s,loadContent:!1,isTileHeader:!0,isTileset:!1}})}return{...e,loader:Zl,url:n,basePath:n,type:"I3S",nodePagesTile:i,root:a,lodMetricType:a.lodMetricType,lodMetricValue:a.lodMetricValue}}var rYt="4.0.0",nYt=/layers\/[0-9]+$/,iYt=/nodes\/([0-9-]+|root)$/,aYt="504b0304",oYt="PointCloud",Zl={name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:rYt,mimeTypes:["application/octet-stream"],parse:sYt,extensions:["bin"],options:{i3s:{token:null,isTileset:"auto",isTileHeader:"auto",tile:null,tileset:null,_tileOptions:null,_tilesetOptions:null,useDracoGeometry:!0,useCompressedTextures:!0,decodeTextures:!0,coordinateSystem:2}}};async function sYt(e,t={},r){let n=r.url;if(t.i3s=t.i3s||{},fYt(e)===aYt)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let a=ik(n),o;t.i3s.isTileset==="auto"?o=nYt.test(a):o=t.i3s.isTileset;let s;return t.isTileHeader==="auto"?s=iYt.test(a):s=t.i3s.isTileHeader,o?e=await cYt(e,t,r):s?e=await lYt(e,r):e=await uYt(e,t),e}async function uYt(e,t){return await ko(e,ABe,t)}async function cYt(e,t,r){let n=JSON.parse(new TextDecoder().decode(e));if((n==null?void 0:n.layerType)===oYt)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return await CBe(n,t,r)}async function lYt(e,t){return e=JSON.parse(new TextDecoder().decode(e)),TBe(e,t)}function fYt(e){return e instanceof ArrayBuffer?[...new Uint8Array(e,0,4)].map(t=>t.toString(16).padStart(2,"0")).join(""):null}function FBe(e,t){let{attributeName:r,attributeType:n}=t;return r?{[r]:n?hYt(n,e):null}:{}}function hYt(e,t){switch(e){case dBe:return mYt(t);case mBe:return DBe(t);case gBe:return dYt(t);case vBe:return pYt(t);default:return DBe(t)}}function DBe(e){return new Uint32Array(e,4)}function pYt(e){return new Int16Array(e,4)}function dYt(e){return new Float64Array(e,8)}function mYt(e){let i=[];try{let a=new DataView(e,0,4).getUint32(0,!0),o=new Uint32Array(e,8,a),s=8+a*4;for(let u of o){let c=new TextDecoder("utf-8"),l=new Uint8Array(e,s,u);i.push(c.decode(l)),s+=u}}catch(a){console.error("Parse string attribute error: ",a.message)}return i}var gYt="4.0.0";var YW={name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:gYt,mimeTypes:["application/binary"],parse:async(e,t)=>FBe(e,t),extensions:["bin"],options:{},binary:!0};function JW(e,t){let r=[e.center[0],e.center[1],e.center[2]+t.getHeight(e.center[1],e.center[0])],n=or.WGS84.cartographicToCartesian(r,new ce),i=new aa().fromCenterHalfSizeQuaternion(n,e.halfSize,e.quaternion);return[...i.center,...i.halfAxes.toArray()]}var ok=$t(_u(),1),vYt=()=>({version:{path:"version",default:"1.0"}}),kBe=()=>({boundingVolume:{path:"boundingVolume"},geometricError:{path:"geometricError"},content:{path:"content"},children:{path:"children",transform:e=>e.map(t=>(0,ok.default)(t,kBe()))}}),BBe=()=>({asset:{path:"asset",transform:e=>(0,ok.default)(e,vYt())},geometricError:{path:"root",transform:e=>e.geometricError},root:{path:"root",transform:e=>(0,ok.default)(e,kBe())}});function OBe(e,t){let r=new Float32Array(e.length),n=yYt(t);for(let i=0;i<e.length;i+=2){let a=e.subarray(i,i+2),o=n.slice(i*2,i*2+4),s=bYt([a[0],a[1]]),u=[o[2]-o[0],o[3]-o[1]],c=[s[0]*u[0],s[1]*u[1]],l=[c[0]+o[0],c[1]+o[1]];r[i]=l[0],r[i+1]=l[1]}return r}function bYt(e){return[e[0]-Math.floor(e[0]),e[1]-Math.floor(e[1])]}function yYt(e){let r=[];for(let n=0;n<e.length;n++)r[n]=e[n]/65535;return r}var xYt=new Kr([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),IBe=new ce,dw=class{rtcCenter;i3sTile;async convert(t,r=null){let n=await this.buildGLTF(t,r);return a8({gltfEncoded:new Uint8Array(n),type:"b3dm",featuresLength:this._getFeaturesLength(r),batchTable:r},ZU)}async buildGLTF(t,r){let{tileContent:n,textureFormat:i,box:a}=t,{material:o,attributes:s,indices:u,modelMatrix:c}=n,l=new qr,f=await this._addI3sTextureToGLTF(n,i,l),h=this._convertI3sMaterialToGLTFMaterial(o,f),p=l.addMaterial(h),d=s.positions,b=d.value;s.uvRegions&&s.texCoords&&(s.texCoords.value=OBe(s.texCoords.value,s.uvRegions.value));let g=new ce(a),x=or.WGS84.cartesianToCartographic(g,new ce);s.positions.value=this._normalizePositions(b,g,x,c),this._createBatchIds(n,r),s.normals&&!this._checkNormals(s.normals.value)&&delete s.normals;let E=u||XF(b.length/d.size),S=l.addMesh({attributes:s,indices:E,material:p,mode:4}),F=this._generateTransformMatrix(g),D=l.addNode({meshIndex:S,matrix:F}),j=l.addScene({nodeIndices:[D]});return l.setDefaultScene(j),l.createBinaryChunk(),a8(l.gltf,qq)}async _addI3sTextureToGLTF(t,r,n){let{texture:i,material:a,attributes:o}=t,s=null,u=i;if(!i&&a&&(u=a.pbrMetallicRoughness&&a.pbrMetallicRoughness.baseColorTexture&&a.pbrMetallicRoughness.baseColorTexture.texture.source.image),u){let c=this._deduceMimeTypeFromFormat(r),l=n.addImage(u,c);s=n.addTexture({imageIndex:l}),delete o.colors}return s}_normalizePositions(t,r,n,i){let a=new Float32Array(t.length);for(let o=0;o<t.length;o+=3){let s=t.subarray(o,o+3),u=new ce(r),c=new ce(Array.from(s)).transform(i).add(n);or.WGS84.cartographicToCartesian(c,IBe),c=IBe.subtract(u),a.set(c,o)}return a}_generateTransformMatrix(t){return new Kr().translate(t).multiplyLeft(xYt)}_createBatchIds(t,r){let{featureIds:n}=t,{OBJECTID:i}=r||{};if(!(!n||!i)){for(let a=0;a<n.length;a++){let o=n[a],s=i.indexOf(o);n[a]=s}t.attributes._BATCHID={size:1,byteOffset:0,value:n}}}_deduceMimeTypeFromFormat(t){switch(t){case"jpg":return"image/jpeg";case"png":return"image/png";case"ktx2":return"image/ktx2";default:return console.warn(`Unexpected texture format in I3S: ${t}`),"image/jpeg"}}_convertI3sMaterialToGLTFMaterial(t,r){let n=r!==null;return t?(r!==null&&(t=this._setGLTFTexture(t,r)),t):(t={alphaMode:"OPAQUE",doubleSided:!1,pbrMetallicRoughness:{metallicFactor:0,roughnessFactor:1}},n?t.pbrMetallicRoughness.baseColorTexture={index:r,texCoord:0}:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,1],t)}_setGLTFTexture(t,r){let n={...t,pbrMetallicRoughness:{...t.pbrMetallicRoughness}};return t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture?n.pbrMetallicRoughness.baseColorTexture={index:r,texCoord:0}:t.emissiveTexture?n.emissiveTexture={index:r,texCoord:0}:t.pbrMetallicRoughness&&t.pbrMetallicRoughness.metallicRoughnessTexture?n.pbrMetallicRoughness.metallicRoughnessTexture={index:r,texCoord:0}:t.normalTexture?n.normalTexture={index:r,texCoord:0}:t.occlusionTexture&&(n.occlusionTexture={index:r,texCoord:0}),n}_getFeaturesLength(t){if(!t)return 0;let r=Object.keys(t)[0];return r?t[r].length:0}_checkNormals(t){return t.find(r=>r)}};var PBe=async(e,t,r)=>{if(!e||!t.contentUrl)return null;let n={...r,i3s:{...r.i3s,isTileset:!1,isTileHeader:!1,_tileOptions:{attributeUrls:t.attributeUrls,textureUrl:t.textureUrl,textureFormat:t.textureFormat,textureLoaderOptions:t.textureLoaderOptions,materialDefinition:t.materialDefinition,isDracoGeometry:t.isDracoGeometry,mbs:t.mbs},_tilesetOptions:{store:e.store,attributeStorageInfo:e.attributeStorageInfo,fields:e.fields}}};return await An(t.contentUrl,Zl,n)};var _Yt="I3S",ay=class{options;tilesetPath;vertexCounter;conversionStartTime;geoidHeightModel;sourceTileset;attributeStorageInfo;workerSource={};loaderOptions={_nodeWorkers:!0,reuseWorkers:!0,i3s:{coordinateSystem:3,decodeTextures:!1},"i3s-content":{workerUrl:"./modules/i3s/dist/i3s-content-worker-node.js"}};constructor(){this.options={},this.tilesetPath="",this.vertexCounter=0,this.conversionStartTime=[0,0],this.geoidHeightModel=null,this.sourceTileset=null,this.attributeStorageInfo=null,this.workerSource={}}async convert(t){var f;if(gn)return console.log(ty),ty;let{inputUrl:r,outputPath:n,tilesetName:i,maxDepth:a,egmFilePath:o}=t;if(this.conversionStartTime=XW.default.hrtime(),this.options={maxDepth:a},console.log("Loading egm file..."),this.geoidHeightModel=await An(o,ZF),console.log("Loading egm file completed!"),this.sourceTileset=await An(r,Zl,this.loaderOptions),!this.sourceTileset)return;let s=(f=this.sourceTileset)==null?void 0:f.root;s.obb||(s.obb=PW(s.mbs)),this.tilesetPath=(0,RBe.join)(`${n}`,`${i}`),this.attributeStorageInfo=this.sourceTileset.attributeStorageInfo;try{await aw(this.tilesetPath)}catch{}let u={boundingVolume:{box:JW(s.obb,this.geoidHeightModel)},geometricError:LW(s),children:[]};await this._addChildren(s,u,1);let c=(0,jBe.default)({root:u},BBe());await Fi(this.tilesetPath,JSON.stringify(c),"tileset.json"),this._finishConversion({slpk:!1,outputPath:n,tilesetName:i}),Ra.getWorkerFarm({}).destroy()}async convertChildNode(t,r,n,i){let a=await this._loadChildNode(t,i);if(a.contentUrl){let o=await PBe(this.sourceTileset,a,this.loaderOptions);if(!o){await this._addChildren(a,r,n+1);return}this.vertexCounter+=(o==null?void 0:o.vertexCount)||0;let s=null;this.attributeStorageInfo&&(s=await this._loadChildAttributes(a,this.attributeStorageInfo)),a.obb||(a.obb=PW(a.mbs));let u={box:JW(a.obb,this.geoidHeightModel)},c={boundingVolume:u,geometricError:LW(a),children:[]},l={tileContent:o,box:u.box,textureFormat:a.textureFormat},h=await new dw().convert(l,s);c.content={uri:`${a.id}.b3dm`,boundingVolume:u},await Fi(this.tilesetPath,new Uint8Array(h),`${a.id}.b3dm`),r.children.push(c),await this._addChildren(a,c,n+1)}else await this._addChildren(a,r,n+1)}async _addChildren(t,r,n){if(this.options.maxDepth&&n>this.options.maxDepth)return;let i=[];for(let a of t.children||[])i.push(this.convertChildNode(t,r,n,a));await Promise.all(i)}async _loadChildNode(t,r){var i;let n;if((i=this.sourceTileset)!=null&&i.nodePagesTile)console.log(`Node conversion: ${r.id}`),n=await this.sourceTileset.nodePagesTile.formTileFromNodePages(parseInt(r.id));else{let a=this._relativeUrlToFullUrl(t.url,r.href),o={i3s:{...this.loaderOptions,isTileHeader:!0,loadContent:!1}};console.log(`Node conversion: ${a}`),n=await An(a,Zl,o)}return n}_relativeUrlToFullUrl(t="",r){let n=t.split("/"),i=r.split("/");for(let a of i)switch(a){case".":continue;case"..":n=n.slice(0,-1);break;default:n.push(a)}return n.join("/")}async _loadChildAttributes(t,r){let n=[],{attributeUrls:i=[]}=t;for(let o=0;o<i.length;o++){let s=i[o],u=r[o],c={attributeName:u.name,attributeType:this._getAttributeType(u)};n.push(An(s,YW,c))}let a=await Promise.all(n);return this._replaceNestedArrays(a),Object.assign({},...a)}_getAttributeType(t){return t.attributeValues?t.attributeValues.valueType:t.objectIds?"Oid32":""}_replaceNestedArrays(t){for(let r=0;r<t.length;r++){let n=t[r];for(let i in n)n[i]=Array.from(n[i])}}async _finishConversion(t){let r=await JF(t),n=XW.default.hrtime(this.conversionStartTime),i=YF(n);console.log("------------------------------------------------"),console.log(`Finish conversion of ${_Yt}`),console.log(`Total conversion time: ${i}`),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",r," bytes"),console.log("------------------------------------------------")}};var sk=require("path");var wYt="4.0.0",EYt="https://raw.githubusercontent.com/visgl/deck.gl-data/master/egm/egm2008-5.zip",uk=class{async install(t=""){console.log('Installing "EGM2008-5" model...');let r=await An(EYt,$U,{}),n=process.cwd();t&&(n=(0,sk.join)(n,t)),await Fi(n,new Uint8Array(r["geoids/egm2008-5.pgm"]),"egm2008-5.pgm"),console.log('Installing "I3S Content Loader" worker'),await this.installFromNpm("i3s","i3s-content-worker-node.js"),console.log('Installing "Draco Loader" worker'),await this.installFromNpm("draco","draco-worker-node.js"),console.log('Installing "Draco Writer" worker'),await this.installFromNpm("draco","draco-writer-worker-node.js"),console.log('Installing "Basis Loader" worker'),await this.installFromNpm("textures","basis-worker-node.js"),console.log('Installing "KTX2 Basis Writer" worker'),await this.installFromNpm("textures","ktx2-basis-writer-worker-node.js"),console.log('Installing "Draco decoder" library'),await this.installFromUrl(Eh[ii.DECODER],"draco",ii.DECODER),await this.installFromUrl(Eh[ii.DECODER_WASM],"draco",ii.DECODER_WASM),console.log('Installing "Draco encoder" library'),await this.installFromUrl(Eh[ii.ENCODER],"draco",ii.ENCODER),console.log('Installing "Basis transcoder" library'),await this.installFromNpm("textures",_c.TRANSCODER,"libs"),await this.installFromNpm("textures",_c.TRANSCODER_WASM,"libs"),console.log('Installing "Basis encoder" library'),await this.installFromNpm("textures",_c.ENCODER,"libs"),await this.installFromNpm("textures",_c.ENCODER_WASM,"libs"),console.log('Installing "join-images" npm package'),await new ll().start({command:process.platform==="win32"?"npm.cmd":"npm",arguments:["install","sharp@0.30.4","join-images@1.1.3"],wait:0,ignoreStderr:!0}),console.log("All dependencies were installed succesfully.")}async installFromNpm(t,r,n=""){let a=await(await Fo(`https://unpkg.com/@loaders.gl/${t}@${wYt}/dist/${n}/${r}`)).arrayBuffer();if(!a)return;let o=(0,sk.join)(process.cwd(),"modules",t,"dist",n);await Fi(o,a,r)}async installFromUrl(t,r,n){let a=await(await Fo(t)).arrayBuffer();if(!a)return;let o=(0,sk.join)(process.cwd(),"modules",r,"dist","libs");await Fi(o,a,n)}};function Su(e,t){if(e+1>=t.length)return"";let r=t[e+1];return r.indexOf("--")===0?"":r}function LBe(e,t){let r=Su(e,t);return console.log(`Input tileset value: ${r}`),console.log(`Modified tileset value: ${r.replace(/\\/g,"/")}`),r.replace(/\\/g,"/")}function MBe(e){return e.reduce((t,r)=>{let n=r.indexOf("="),i=r.slice(0,n),a=r.slice(n+1,r.length);return r.includes("=")&&r.startsWith("--")&&a?t.concat(i,a):t.concat(r)},[])}function qBe(e,t){let r=Su(e,t),n=Number.parseInt(r);return isFinite(n)?n:NaN}function Nc(e,t){let r=Su(e,t).toLowerCase().trim();return["--no-draco","--split-nodes"].includes(t[e])&&!r?!1:!r||r==="true"}var QW={I3S:"I3S",_3DTILES:"3DTILES"};async function AYt(){let[,,...e]=process.argv;e.length===0&&ZW();let t=MBe(e),r=CYt(t);if(r.installDependencies){new uk().install("deps");return}let n=TYt(r);await SYt(n)}AYt().catch(e=>{console.log(e),process.exit(1)});function ZW(){console.log("cli: converter 3dTiles to I3S or I3S to 3dTiles..."),console.log('--install-dependencies [Run the script for installing dependencies. Run this options separate from others. Now "*.pgm" file installation is implemented]'),console.log("--max-depth [Maximal depth of hierarchical tiles tree traversal, default: infinite]"),console.log("--name [Tileset name]"),console.log('--output [Output folder, default: "data" folder]'),console.log("--instant-node-writing [Keep created 3DNodeIndexDocument files on disk instead of memory. This option reduce memory usage but decelerates conversion speed]"),console.log("--split-nodes [Prevent to merge similar materials that could lead to incorrect visualization (I3S to 3DTiles conversion only)]"),console.log("--slpk [Generate slpk (Scene Layer Packages) I3S output file]"),console.log("--tileset [tileset.json file (3DTiles) / http://..../SceneServer/layers/0 resource (I3S)]"),console.log("--input-type [tileset input type: I3S or 3DTILES]"),console.log('--7zExe [location of 7z.exe archiver to create slpk on Windows, default: "C:\\Program Files\\7-Zip\\7z.exe"]'),console.log('--egm [location of Earth Gravity Model *.pgm file to convert heights from ellipsoidal to gravity-related format. A model file can be loaded from GeographicLib https://geographiclib.sourceforge.io/html/geoid.html], default: "./deps/egm2008-5.zip"'),console.log("--token [Token for Cesium ION tilesets authentication]"),console.log("--no-draco [Disable draco compression for geometry]"),console.log("--generate-textures [Enable KTX2 textures generation if only one of (JPG, PNG) texture is provided or generate JPG texture if only KTX2 is provided]"),console.log("--generate-bounding-volumes [Generate obb and mbs bounding volumes from geometry]"),console.log("--analyze [Analyze the input tileset content without conversion, default: false]"),console.log('--metadata-class [One of the list of feature metadata classes, detected by converter on "analyze" stage, default: not set]'),console.log("--validate [Enable validation]"),process.exit(0)}async function SYt(e){switch(console.log("------------------------------------------------"),console.log(`Starting conversion of ${e.inputType}`),console.log("------------------------------------------------"),e.inputType.toUpperCase()){case QW.I3S:new ay().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,egmFilePath:e.egm});break;case QW._3DTILES:await new ry().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,slpk:e.slpk,sevenZipExe:e.sevenZipExe,egmFilePath:e.egm,token:e.token,draco:e.draco,mergeMaterials:e.mergeMaterials,generateTextures:e.generateTextures,generateBoundingVolumes:e.generateBoundingVolumes,validate:e.validate,instantNodeWriting:e.instantNodeWriting,metadataClass:e.metadataClass,analyze:e.analyze,inquirer:UBe.default});break;default:ZW()}}function TYt(e){let t={name:{getMessage:()=>console.log("Missed: --name [Tileset name]"),condition:n=>Boolean(n)||Boolean(e.analyze)},output:{getMessage:()=>console.log("Missed: --output [Output path name]")},sevenZipExe:{getMessage:()=>console.log("Missed: --7zExe [7z archiver executable path]")},egm:{getMessage:()=>console.log("Missed: --egm [*.pgm earth gravity model file path]")},tileset:{getMessage:()=>console.log("Missed: --tileset [tileset.json file]")},inputType:{getMessage:()=>console.log("Missed/Incorrect: --input-type [tileset input type: I3S or 3DTILES]"),condition:n=>Boolean(n)&&Object.values(QW).includes(n.toUpperCase())}},r=[];for(let n in t){let i=e[n],a=t[n].condition;(a?a(i):i)||r.push(t[n].getMessage)}return r.length&&(r.forEach(n=>n()),process.exit(1)),e}function CYt(e){let t={output:"data",instantNodeWriting:!1,mergeMaterials:!0,sevenZipExe:"C:\\Program Files\\7-Zip\\7z.exe",egm:(0,NBe.join)(process.cwd(),"deps","egm2008-5.pgm"),draco:!0,installDependencies:!1,generateTextures:!1,generateBoundingVolumes:!1,validate:!1,slpk:!1};return e.forEach((r,n)=>{if(r.indexOf("--")===0)switch(r){case"--input-type":t.inputType=Su(n,e);break;case"--tileset":t.tileset=LBe(n,e);break;case"--name":t.name=Su(n,e);break;case"--output":t.output=Su(n,e);break;case"--instant-node-writing":t.instantNodeWriting=Nc(n,e);break;case"--split-nodes":t.mergeMaterials=Nc(n,e);break;case"--max-depth":t.maxDepth=qBe(n,e);break;case"--slpk":t.slpk=Nc(n,e);break;case"--7zExe":t.sevenZipExe=Su(n,e);break;case"--egm":t.egm=Su(n,e);break;case"--token":t.token=Su(n,e);break;case"--no-draco":t.draco=Nc(n,e);break;case"--validate":t.validate=Nc(n,e);break;case"--install-dependencies":t.installDependencies=Nc(n,e);break;case"--generate-textures":t.generateTextures=Nc(n,e);break;case"--generate-bounding-volumes":t.generateBoundingVolumes=Nc(n,e);break;case"--analyze":t.analyze=Nc(n,e);break;case"--metadata-class":t.metadataClass=Su(n,e);break;case"--help":ZW();break;default:console.warn(`Unknown option ${r}`),process.exit(0)}}),t}
|
|
180
180
|
/*! Bundled license information:
|
|
181
181
|
|
|
182
182
|
is-buffer/index.js:
|