@loaders.gl/tile-converter 3.4.2 → 3.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -115,13 +115,13 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof Gn))r
115
115
  `));var r=e.pax;if(r)for(var i in r)t+=hj(" "+i+"="+r[i]+`
116
116
  `);return Buffer.from(t)};y0.decodePax=function(e){for(var t={};e.length;){for(var r=0;r<e.length&&e[r]!==32;)r++;var i=parseInt(e.slice(0,r).toString(),10);if(!i)return t;var n=e.slice(r+1,i-1).toString(),a=n.indexOf("=");if(a===-1)return t;t[n.slice(0,a)]=n.slice(a+1),e=e.slice(i)}return t};y0.encode=function(e){var t=uit(512),r=e.name,i="";if(e.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var n=r.indexOf("/");if(n===-1)return null;i+=i?"/"+r.slice(0,n):r.slice(0,n),r=r.slice(n+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(i)>155||e.linkname&&Buffer.byteLength(e.linkname)>100?null:(t.write(r),t.write(Th(e.mode&pit,6),100),t.write(Th(e.uid,6),108),t.write(Th(e.gid,6),116),t.write(Th(e.size,11),124),t.write(Th(e.mtime.getTime()/1e3|0,11),136),t[156]=vfe+vit(e.type),e.linkname&&t.write(e.linkname,157),yfe.copy(t,e_),fit.copy(t,fj),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(Th(e.devmajor||0,6),329),t.write(Th(e.devminor||0,6),337),i&&t.write(i,345),t.write(Th(_fe(t),6),148),t)};y0.decode=function(e,t,r){var i=e[156]===0?0:e[156]-vfe,n=v0(e,0,100,t),a=kh(e,100,8),o=kh(e,108,8),s=kh(e,116,8),u=kh(e,124,12),l=kh(e,136,12),c=git(i),f=e[157]===0?null:v0(e,157,100,t),h=v0(e,265,32),d=v0(e,297,32),p=kh(e,329,8),y=kh(e,337,8),g=_fe(e);if(g===8*32)return null;if(g!==kh(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(yfe.compare(e,e_,e_+6)===0)e[345]&&(n=v0(e,345,155,t)+"/"+n);else if(!(hit.compare(e,e_,e_+6)===0&&dit.compare(e,fj,fj+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return i===0&&n&&n[n.length-1]==="/"&&(i=5),{name:n,mode:a,uid:o,gid:s,size:u,mtime:new Date(1e3*l),type:c,linkname:f,uname:h,gname:d,devmajor:p,devminor:y}}});var pj=T((hPt,xfe)=>{xfe.exports=require("stream")});var kfe=T((dPt,Tfe)=>{"use strict";function wfe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function Efe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wfe(Object(r),!0).forEach(function(i){bit(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wfe(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function bit(e,t,r){return t=Afe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _it(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sfe(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Afe(i.key),i)}}function xit(e,t,r){return t&&Sfe(e.prototype,t),r&&Sfe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Afe(e){var t=wit(e,"string");return typeof t=="symbol"?t:String(t)}function wit(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Eit=require("buffer"),IT=Eit.Buffer,Sit=require("util"),mj=Sit.inspect,Ait=mj&&mj.custom||"inspect";function Tit(e,t,r){IT.prototype.copy.call(e,t,r)}Tfe.exports=function(){function e(){_it(this,e),this.head=null,this.tail=null,this.length=0}return xit(e,[{key:"push",value:function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++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 i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return IT.alloc(0);for(var i=IT.allocUnsafe(r>>>0),n=this.head,a=0;n;)Tit(n.data,i,a),a+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var i=this.head,n=1,a=i.data;for(r-=a.length;i=i.next;){var o=i.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?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(s));break}++n}return this.length-=n,a}},{key:"_getBuffer",value:function(r){var i=IT.allocUnsafe(r),n=this.head,a=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var o=n.data,s=r>o.length?o.length:r;if(o.copy(i,i.length-r,0,s),r-=s,r===0){s===o.length?(++a,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(s));break}++a}return this.length-=a,i}},{key:Ait,value:function(r,i){return mj(this,Efe(Efe({},i),{},{depth:0,customInspect:!1}))}}]),e}()});var vj=T((pPt,Cfe)=>{"use strict";function kit(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(gj,this,e)):process.nextTick(gj,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(OT,r):(r._writableState.errorEmitted=!0,process.nextTick(Rfe,r,a)):process.nextTick(Rfe,r,a):t?(process.nextTick(OT,r),t(a)):process.nextTick(OT,r)}),this)}function Rfe(e,t){gj(e,t),OT(e)}function OT(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Rit(){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 gj(e,t){e.emit("error",t)}function Cit(e,t){var r=e._readableState,i=e._writableState;r&&r.autoDestroy||i&&i.autoDestroy?e.destroy(t):e.emit("error",t)}Cfe.exports={destroy:kit,undestroy:Rit,errorOrDestroy:Cit}});var Rh=T((mPt,Pfe)=>{"use strict";var Ife={};function Cs(e,t,r){r||(r=Error);function i(a,o,s){return typeof t=="string"?t:t(a,o,s)}class n extends r{constructor(o,s,u){super(i(o,s,u))}}n.prototype.name=r.name,n.prototype.code=e,Ife[e]=n}function Ofe(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(i=>String(i)),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 Iit(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function Oit(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function Pit(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Cs("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Cs("ERR_INVALID_ARG_TYPE",function(e,t,r){let i;typeof t=="string"&&Iit(t,"not ")?(i="must not be",t=t.replace(/^not /,"")):i="must be";let n;if(Oit(e," argument"))n=`The ${e} ${i} ${Ofe(t,"type")}`;else{let a=Pit(e,".")?"property":"argument";n=`The "${e}" ${a} ${i} ${Ofe(t,"type")}`}return n+=`. Received type ${typeof r}`,n},TypeError);Cs("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Cs("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Cs("ERR_STREAM_PREMATURE_CLOSE","Premature close");Cs("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Cs("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Cs("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Cs("ERR_STREAM_WRITE_AFTER_END","write after end");Cs("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Cs("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Cs("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Pfe.exports.codes=Ife});var yj=T((gPt,Bfe)=>{"use strict";var Bit=Rh().codes.ERR_INVALID_OPT_VALUE;function Mit(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function Dit(e,t,r,i){var n=Mit(t,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var a=i?r:"highWaterMark";throw new Bit(a,n)}return Math.floor(n)}return e.objectMode?16:16*1024}Bfe.exports={getHighWaterMark:Dit}});var xj=T((vPt,Nfe)=>{"use strict";Nfe.exports=rn;function Mfe(e){var t=this;this.next=null,this.entry=null,this.finish=function(){unt(t,e)}}var b0;rn.WritableState=t_;var Fit={deprecate:Yd()},Dfe=pj(),PT=require("buffer").Buffer,jit=(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function Lit(e){return PT.from(e)}function Nit(e){return PT.isBuffer(e)||e instanceof jit}var bj=vj(),qit=yj(),Uit=qit.getHighWaterMark,Ch=Rh().codes,Git=Ch.ERR_INVALID_ARG_TYPE,zit=Ch.ERR_METHOD_NOT_IMPLEMENTED,Hit=Ch.ERR_MULTIPLE_CALLBACK,Vit=Ch.ERR_STREAM_CANNOT_PIPE,Wit=Ch.ERR_STREAM_DESTROYED,Kit=Ch.ERR_STREAM_NULL_VALUES,Yit=Ch.ERR_STREAM_WRITE_AFTER_END,$it=Ch.ERR_UNKNOWN_ENCODING,_0=bj.errorOrDestroy;er()(rn,Dfe);function Xit(){}function t_(e,t,r){b0=b0||_p(),e=e||{},typeof r!="boolean"&&(r=t instanceof b0),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=Uit(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=e.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){int(t,n)},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 Mfe(this)}t_.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(t_.prototype,"buffer",{get:Fit.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var BT;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(BT=Function.prototype[Symbol.hasInstance],Object.defineProperty(rn,Symbol.hasInstance,{value:function(t){return BT.call(this,t)?!0:this!==rn?!1:t&&t._writableState instanceof t_}})):BT=function(t){return t instanceof this};function rn(e){b0=b0||_p();var t=this instanceof b0;if(!t&&!BT.call(rn,this))return new rn(e);this._writableState=new t_(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)),Dfe.call(this)}rn.prototype.pipe=function(){_0(this,new Vit)};function Jit(e,t){var r=new Yit;_0(e,r),process.nextTick(t,r)}function Qit(e,t,r,i){var n;return r===null?n=new Kit:typeof r!="string"&&!t.objectMode&&(n=new Git("chunk",["string","Buffer"],r)),n?(_0(e,n),process.nextTick(i,n),!1):!0}rn.prototype.write=function(e,t,r){var i=this._writableState,n=!1,a=!i.objectMode&&Nit(e);return a&&!PT.isBuffer(e)&&(e=Lit(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),typeof r!="function"&&(r=Xit),i.ending?Jit(this,r):(a||Qit(this,i,e,r))&&(i.pendingcb++,n=ent(this,i,a,e,t,r)),n};rn.prototype.cork=function(){this._writableState.corked++};rn.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&jfe(this,e))};rn.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 $it(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(rn.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Zit(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=PT.from(t,r)),t}Object.defineProperty(rn.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ent(e,t,r,i,n,a){if(!r){var o=Zit(t,i,n);i!==o&&(r=!0,n="buffer",i=o)}var s=t.objectMode?1:i.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else _j(e,t,!1,s,i,n,a);return u}function _j(e,t,r,i,n,a,o){t.writelen=i,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new Wit("write")):r?e._writev(n,t.onwrite):e._write(n,a,t.onwrite),t.sync=!1}function tnt(e,t,r,i,n){--t.pendingcb,r?(process.nextTick(n,i),process.nextTick(r_,e,t),e._writableState.errorEmitted=!0,_0(e,i)):(n(i),e._writableState.errorEmitted=!0,_0(e,i),r_(e,t))}function rnt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function int(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new Hit;if(rnt(r),t)tnt(e,r,i,t,n);else{var a=Lfe(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&jfe(e,r),i?process.nextTick(Ffe,e,r,a,n):Ffe(e,r,a,n)}}function Ffe(e,t,r,i){r||nnt(e,t),t.pendingcb--,i(),r_(e,t)}function nnt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function jfe(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),a=t.corkedRequestsFree;a.entry=r;for(var o=0,s=!0;r;)n[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;n.allBuffers=s,_j(e,t,!0,t.length,n,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new Mfe(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,c=r.callback,f=t.objectMode?1:u.length;if(_j(e,t,!1,f,u,l,c),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}rn.prototype._write=function(e,t,r){r(new zit("_write()"))};rn.prototype._writev=null;rn.prototype.end=function(e,t,r){var i=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),i.corked&&(i.corked=1,this.uncork()),i.ending||snt(this,i,r),this};Object.defineProperty(rn.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Lfe(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function ant(e,t){e._final(function(r){t.pendingcb--,r&&_0(e,r),t.prefinished=!0,e.emit("prefinish"),r_(e,t)})}function ont(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(ant,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function r_(e,t){var r=Lfe(t);if(r&&(ont(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return r}function snt(e,t,r){t.ending=!0,r_(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function unt(e,t,r){var i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}Object.defineProperty(rn.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){!this._writableState||(this._writableState.destroyed=t)}});rn.prototype.destroy=bj.destroy;rn.prototype._undestroy=bj.undestroy;rn.prototype._destroy=function(e,t){t(e)}});var _p=T((yPt,Ufe)=>{"use strict";var lnt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};Ufe.exports=xl;var qfe=Sj(),wj=xj();er()(xl,qfe);for(Ej=lnt(wj.prototype),MT=0;MT<Ej.length;MT++)DT=Ej[MT],xl.prototype[DT]||(xl.prototype[DT]=wj.prototype[DT]);var Ej,DT,MT;function xl(e){if(!(this instanceof xl))return new xl(e);qfe.call(this,e),wj.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",cnt)))}Object.defineProperty(xl.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(xl.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(xl.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function cnt(){this._writableState.ended||process.nextTick(fnt,this)}function fnt(e){e.end()}Object.defineProperty(xl.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 kj=T(zfe=>{"use strict";var Aj=Vs().Buffer,Gfe=Aj.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 hnt(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 dnt(e){var t=hnt(e);if(typeof t!="string"&&(Aj.isEncoding===Gfe||!Gfe(e)))throw new Error("Unknown encoding: "+e);return t||e}zfe.StringDecoder=i_;function i_(e){this.encoding=dnt(e);var t;switch(this.encoding){case"utf16le":this.text=bnt,this.end=_nt,t=4;break;case"utf8":this.fillLast=gnt,t=4;break;case"base64":this.text=xnt,this.end=wnt,t=3;break;default:this.write=Ent,this.end=Snt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Aj.allocUnsafe(t)}i_.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||""};i_.prototype.end=ynt;i_.prototype.text=vnt;i_.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 Tj(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function pnt(e,t,r){var i=t.length-1;if(i<r)return 0;var n=Tj(t[i]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--i<r||n===-2?0:(n=Tj(t[i]),n>=0?(n>0&&(e.lastNeed=n-2),n):--i<r||n===-2?0:(n=Tj(t[i]),n>=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}function mnt(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 gnt(e){var t=this.lastTotal-this.lastNeed,r=mnt(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 vnt(e,t){var r=pnt(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)}function ynt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function bnt(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=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 _nt(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 xnt(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 wnt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Ent(e){return e.toString(this.encoding)}function Snt(e){return e&&e.length?this.write(e):""}});var FT=T((_Pt,Wfe)=>{"use strict";var Hfe=Rh().codes.ERR_STREAM_PREMATURE_CLOSE;function Ant(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];e.apply(this,i)}}}function Tnt(){}function knt(e){return e.setHeader&&typeof e.abort=="function"}function Vfe(e,t,r){if(typeof t=="function")return Vfe(e,null,t);t||(t={}),r=Ant(r||Tnt);var i=t.readable||t.readable!==!1&&e.readable,n=t.writable||t.writable!==!1&&e.writable,a=function(){e.writable||s()},o=e._writableState&&e._writableState.finished,s=function(){n=!1,o=!0,i||r.call(e)},u=e._readableState&&e._readableState.endEmitted,l=function(){i=!1,u=!0,n||r.call(e)},c=function(p){r.call(e,p)},f=function(){var p;if(i&&!u)return(!e._readableState||!e._readableState.ended)&&(p=new Hfe),r.call(e,p);if(n&&!o)return(!e._writableState||!e._writableState.ended)&&(p=new Hfe),r.call(e,p)},h=function(){e.req.on("finish",s)};return knt(e)?(e.on("complete",s),e.on("abort",f),e.req?h():e.on("request",h)):n&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",l),e.on("finish",s),t.error!==!1&&e.on("error",c),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",l),e.removeListener("error",c),e.removeListener("close",f)}}Wfe.exports=Vfe});var Yfe=T((xPt,Kfe)=>{"use strict";var jT;function Ih(e,t,r){return t=Rnt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rnt(e){var t=Cnt(e,"string");return typeof t=="symbol"?t:String(t)}function Cnt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Int=FT(),Oh=Symbol("lastResolve"),xp=Symbol("lastReject"),n_=Symbol("error"),LT=Symbol("ended"),wp=Symbol("lastPromise"),Rj=Symbol("handlePromise"),Ep=Symbol("stream");function Ph(e,t){return{value:e,done:t}}function Ont(e){var t=e[Oh];if(t!==null){var r=e[Ep].read();r!==null&&(e[wp]=null,e[Oh]=null,e[xp]=null,t(Ph(r,!1)))}}function Pnt(e){process.nextTick(Ont,e)}function Bnt(e,t){return function(r,i){e.then(function(){if(t[LT]){r(Ph(void 0,!0));return}t[Rj](r,i)},i)}}var Mnt=Object.getPrototypeOf(function(){}),Dnt=Object.setPrototypeOf((jT={get stream(){return this[Ep]},next:function(){var t=this,r=this[n_];if(r!==null)return Promise.reject(r);if(this[LT])return Promise.resolve(Ph(void 0,!0));if(this[Ep].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[n_]?s(t[n_]):o(Ph(void 0,!0))})});var i=this[wp],n;if(i)n=new Promise(Bnt(i,this));else{var a=this[Ep].read();if(a!==null)return Promise.resolve(Ph(a,!1));n=new Promise(this[Rj])}return this[wp]=n,n}},Ih(jT,Symbol.asyncIterator,function(){return this}),Ih(jT,"return",function(){var t=this;return new Promise(function(r,i){t[Ep].destroy(null,function(n){if(n){i(n);return}r(Ph(void 0,!0))})})}),jT),Mnt),Fnt=function(t){var r,i=Object.create(Dnt,(r={},Ih(r,Ep,{value:t,writable:!0}),Ih(r,Oh,{value:null,writable:!0}),Ih(r,xp,{value:null,writable:!0}),Ih(r,n_,{value:null,writable:!0}),Ih(r,LT,{value:t._readableState.endEmitted,writable:!0}),Ih(r,Rj,{value:function(a,o){var s=i[Ep].read();s?(i[wp]=null,i[Oh]=null,i[xp]=null,a(Ph(s,!1))):(i[Oh]=a,i[xp]=o)},writable:!0}),r));return i[wp]=null,Int(t,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=i[xp];a!==null&&(i[wp]=null,i[Oh]=null,i[xp]=null,a(n)),i[n_]=n;return}var o=i[Oh];o!==null&&(i[wp]=null,i[Oh]=null,i[xp]=null,o(Ph(void 0,!0))),i[LT]=!0}),t.on("readable",Pnt.bind(null,i)),i};Kfe.exports=Fnt});var Qfe=T((wPt,Jfe)=>{"use strict";function $fe(e,t,r,i,n,a,o){try{var s=e[a](o),u=s.value}catch(l){r(l);return}s.done?t(u):Promise.resolve(u).then(i,n)}function jnt(e){return function(){var t=this,r=arguments;return new Promise(function(i,n){var a=e.apply(t,r);function o(u){$fe(a,i,n,o,s,"next",u)}function s(u){$fe(a,i,n,o,s,"throw",u)}o(void 0)})}}function Xfe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function Lnt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xfe(Object(r),!0).forEach(function(i){Nnt(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xfe(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Nnt(e,t,r){return t=qnt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qnt(e){var t=Unt(e,"string");return typeof t=="symbol"?t:String(t)}function Unt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Gnt=Rh().codes.ERR_INVALID_ARG_TYPE;function znt(e,t,r){var i;if(t&&typeof t.next=="function")i=t;else if(t&&t[Symbol.asyncIterator])i=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])i=t[Symbol.iterator]();else throw new Gnt("iterable",["Iterable"],t);var n=new e(Lnt({objectMode:!0},r)),a=!1;n._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=jnt(function*(){try{var u=yield i.next(),l=u.value,c=u.done;c?n.push(null):n.push(yield l)?o():a=!1}catch(f){n.destroy(f)}}),s.apply(this,arguments)}return n}Jfe.exports=znt});var Sj=T((SPt,uhe)=>{"use strict";uhe.exports=zr;var x0;zr.ReadableState=ehe;var EPt=require("events").EventEmitter,Zfe=function(t,r){return t.listeners(r).length},a_=pj(),NT=require("buffer").Buffer,Hnt=(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function Vnt(e){return NT.from(e)}function Wnt(e){return NT.isBuffer(e)||e instanceof Hnt}var Cj=require("util"),yr;Cj&&Cj.debuglog?yr=Cj.debuglog("stream"):yr=function(){};var Knt=kfe(),Ij=vj(),Ynt=yj(),$nt=Ynt.getHighWaterMark,qT=Rh().codes,Xnt=qT.ERR_INVALID_ARG_TYPE,Jnt=qT.ERR_STREAM_PUSH_AFTER_EOF,Qnt=qT.ERR_METHOD_NOT_IMPLEMENTED,Znt=qT.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,w0,Oj,Pj;er()(zr,a_);var o_=Ij.errorOrDestroy,Bj=["error","close","destroy","pause","resume"];function eat(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 ehe(e,t,r){x0=x0||_p(),e=e||{},typeof r!="boolean"&&(r=t instanceof x0),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=$nt(this,e,"readableHighWaterMark",r),this.buffer=new Knt,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&&(w0||(w0=kj().StringDecoder),this.decoder=new w0(e.encoding),this.encoding=e.encoding)}function zr(e){if(x0=x0||_p(),!(this instanceof zr))return new zr(e);var t=this instanceof x0;this._readableState=new ehe(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),a_.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=Ij.destroy;zr.prototype._undestroy=Ij.undestroy;zr.prototype._destroy=function(e,t){t(e)};zr.prototype.push=function(e,t){var r=this._readableState,i;return r.objectMode?i=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=NT.from(e,t),t=""),i=!0),the(this,e,t,!1,i)};zr.prototype.unshift=function(e){return the(this,e,null,!0,!1)};function the(e,t,r,i,n){yr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,iat(e,a);else{var o;if(n||(o=tat(a,t)),o)o_(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==NT.prototype&&(t=Vnt(t)),i)a.endEmitted?o_(e,new Znt):Mj(e,a,t,!0);else if(a.ended)o_(e,new Jnt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?Mj(e,a,t,!1):Dj(e,a)):Mj(e,a,t,!1)}else i||(a.reading=!1,Dj(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function Mj(e,t,r,i){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&UT(e)),Dj(e,t)}function tat(e,t){var r;return!Wnt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new Xnt("chunk",["string","Buffer","Uint8Array"],t)),r}zr.prototype.isPaused=function(){return this._readableState.flowing===!1};zr.prototype.setEncoding=function(e){w0||(w0=kj().StringDecoder);var t=new w0(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var rhe=1073741824;function rat(e){return e>=rhe?e=rhe:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function ihe(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=rat(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}zr.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?jj(this):UT(this),null;if(e=ihe(e,t),e===0&&t.ended)return t.length===0&&jj(this),null;var i=t.needReadable;yr("need readable",i),(t.length===0||t.length-e<t.highWaterMark)&&(i=!0,yr("length less than watermark",i)),t.ended||t.reading?(i=!1,yr("reading or ended",i)):i&&(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=ihe(r,t)));var n;return e>0?n=ohe(e,t):n=null,n===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&&jj(this)),n!==null&&this.emit("data",n),n};function iat(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?UT(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,nhe(e)))}}function UT(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(nhe,e))}function nhe(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,Fj(e)}function Dj(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(nat,e,t))}function nat(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}zr.prototype._read=function(e){o_(this,new Qnt("_read()"))};zr.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,yr("pipe count=%d opts=%j",i.pipesCount,t);var n=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=n?s:y;i.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",o);function o(g,b){yr("onunpipe"),g===r&&b&&b.hasUnpiped===!1&&(b.hasUnpiped=!0,c())}function s(){yr("onend"),e.end()}var u=aat(r);e.on("drain",u);var l=!1;function c(){yr("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",u),e.removeListener("error",h),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",y),r.removeListener("data",f),l=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){yr("ondata");var b=e.write(g);yr("dest.write",b),b===!1&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&she(i.pipes,e)!==-1)&&!l&&(yr("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function h(g){yr("onerror",g),y(),e.removeListener("error",h),Zfe(e,"error")===0&&o_(e,g)}eat(e,"error",h);function d(){e.removeListener("finish",p),y()}e.once("close",d);function p(){yr("onfinish"),e.removeListener("close",d),y()}e.once("finish",p);function y(){yr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),i.flowing||(yr("pipe resume"),r.resume()),e};function aat(e){return function(){var r=e._readableState;yr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&Zfe(e,"data")&&(r.flowing=!0,Fj(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 i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<n;a++)i[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=she(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=a_.prototype.on.call(this,e,t),i=this._readableState;return e==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):e==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,yr("on readable",i.length,i.reading),i.length?UT(this):i.reading||process.nextTick(oat,this)),r};zr.prototype.addListener=zr.prototype.on;zr.prototype.removeListener=function(e,t){var r=a_.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(ahe,this),r};zr.prototype.removeAllListeners=function(e){var t=a_.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(ahe,this),t};function ahe(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 oat(e){yr("readable nexttick read 0"),e.read(0)}zr.prototype.resume=function(){var e=this._readableState;return e.flowing||(yr("resume"),e.flowing=!e.readableListening,sat(this,e)),e.paused=!1,this};function sat(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(uat,e,t))}function uat(e,t){yr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Fj(e),t.flowing&&!t.reading&&e.read(0)}zr.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 Fj(e){var t=e._readableState;for(yr("flow",t.flowing);t.flowing&&e.read()!==null;);}zr.prototype.wrap=function(e){var t=this,r=this._readableState,i=!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||(i=!0,e.pause())}});for(var n in e)this[n]===void 0&&typeof e[n]=="function"&&(this[n]=function(s){return function(){return e[s].apply(e,arguments)}}(n));for(var a=0;a<Bj.length;a++)e.on(Bj[a],this.emit.bind(this,Bj[a]));return this._read=function(o){yr("wrapped _read",o),i&&(i=!1,e.resume())},this};typeof Symbol=="function"&&(zr.prototype[Symbol.asyncIterator]=function(){return Oj===void 0&&(Oj=Yfe()),Oj(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=ohe;Object.defineProperty(zr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ohe(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 jj(e){var t=e._readableState;yr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(lat,t,e))}function lat(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"&&(zr.from=function(e,t){return Pj===void 0&&(Pj=Qfe()),Pj(zr,e,t)});function she(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}});var Lj=T((APt,che)=>{"use strict";che.exports=jc;var GT=Rh().codes,cat=GT.ERR_METHOD_NOT_IMPLEMENTED,fat=GT.ERR_MULTIPLE_CALLBACK,hat=GT.ERR_TRANSFORM_ALREADY_TRANSFORMING,dat=GT.ERR_TRANSFORM_WITH_LENGTH_0,zT=_p();er()(jc,zT);function pat(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new fat);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function jc(e){if(!(this instanceof jc))return new jc(e);zT.call(this,e),this._transformState={afterTransform:pat.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",mat)}function mat(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){lhe(e,t,r)}):lhe(this,null,null)}jc.prototype.push=function(e,t){return this._transformState.needTransform=!1,zT.prototype.push.call(this,e,t)};jc.prototype._transform=function(e,t,r){r(new cat("_transform()"))};jc.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};jc.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};jc.prototype._destroy=function(e,t){zT.prototype._destroy.call(this,e,function(r){t(r)})};function lhe(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new dat;if(e._transformState.transforming)throw new hat;return e.push(null)}});var dhe=T((TPt,hhe)=>{"use strict";hhe.exports=s_;var fhe=Lj();er()(s_,fhe);function s_(e){if(!(this instanceof s_))return new s_(e);fhe.call(this,e)}s_.prototype._transform=function(e,t,r){r(null,e)}});var yhe=T((kPt,vhe)=>{"use strict";var Nj;function gat(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var phe=Rh().codes,vat=phe.ERR_MISSING_ARGS,yat=phe.ERR_STREAM_DESTROYED;function mhe(e){if(e)throw e}function bat(e){return e.setHeader&&typeof e.abort=="function"}function _at(e,t,r,i){i=gat(i);var n=!1;e.on("close",function(){n=!0}),Nj===void 0&&(Nj=FT()),Nj(e,{readable:t,writable:r},function(o){if(o)return i(o);n=!0,i()});var a=!1;return function(o){if(!n&&!a){if(a=!0,bat(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();i(o||new yat("pipe"))}}}function ghe(e){e()}function xat(e,t){return e.pipe(t)}function wat(e){return!e.length||typeof e[e.length-1]!="function"?mhe:e.pop()}function Eat(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i=wat(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new vat("streams");var n,a=t.map(function(o,s){var u=s<t.length-1,l=s>0;return _at(o,u,l,function(c){n||(n=c),c&&a.forEach(ghe),!u&&(a.forEach(ghe),i(n))})});return t.reduce(xat)}vhe.exports=Eat});var c_=T((Is,l_)=>{var u_=require("stream");process.env.READABLE_STREAM==="disable"&&u_?(l_.exports=u_.Readable,Object.assign(l_.exports,u_),l_.exports.Stream=u_):(Is=l_.exports=Sj(),Is.Stream=u_||Is,Is.Readable=Is,Is.Writable=xj(),Is.Duplex=_p(),Is.Transform=Lj(),Is.PassThrough=dhe(),Is.finished=FT(),Is.pipeline=yhe())});var Ahe=T((RPt,She)=>{var bhe=require("util"),Sat=gfe(),f_=dj(),_he=c_().Writable,xhe=c_().PassThrough,whe=function(){},Ehe=function(e){return e&=511,e&&512-e},Aat=function(e,t){var r=new HT(e,t);return r.end(),r},Tat=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},HT=function(e,t){this._parent=e,this.offset=t,xhe.call(this,{autoDestroy:!1})};bhe.inherits(HT,xhe);HT.prototype.destroy=function(e){this._parent.destroy(e)};var Lc=function(e){if(!(this instanceof Lc))return new Lc(e);_he.call(this,e),e=e||{},this._offset=0,this._buffer=Sat(),this._missing=0,this._partial=!1,this._onparse=whe,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,i=function(){t._continue()},n=function(h){if(t._locked=!1,h)return t.destroy(h);t._stream||i()},a=function(){t._stream=null;var h=Ehe(t._header.size);h?t._parse(h,o):t._parse(512,f),t._locked||i()},o=function(){t._buffer.consume(Ehe(t._header.size)),t._parse(512,f),i()},s=function(){var h=t._header.size;t._paxGlobal=f_.decodePax(r.slice(0,h)),r.consume(h),a()},u=function(){var h=t._header.size;t._pax=f_.decodePax(r.slice(0,h)),t._paxGlobal&&(t._pax=Object.assign({},t._paxGlobal,t._pax)),r.consume(h),a()},l=function(){var h=t._header.size;this._gnuLongPath=f_.decodeLongPath(r.slice(0,h),e.filenameEncoding),r.consume(h),a()},c=function(){var h=t._header.size;this._gnuLongLinkPath=f_.decodeLongPath(r.slice(0,h),e.filenameEncoding),r.consume(h),a()},f=function(){var h=t._offset,d;try{d=t._header=f_.decode(r.slice(0,512),e.filenameEncoding,e.allowUnknownFormat)}catch(p){t.emit("error",p)}if(r.consume(512),!d){t._parse(512,f),i();return}if(d.type==="gnu-long-path"){t._parse(d.size,l),i();return}if(d.type==="gnu-long-link-path"){t._parse(d.size,c),i();return}if(d.type==="pax-global-header"){t._parse(d.size,s),i();return}if(d.type==="pax-header"){t._parse(d.size,u),i();return}if(t._gnuLongPath&&(d.name=t._gnuLongPath,t._gnuLongPath=null),t._gnuLongLinkPath&&(d.linkname=t._gnuLongLinkPath,t._gnuLongLinkPath=null),t._pax&&(t._header=d=Tat(d,t._pax),t._pax=null),t._locked=!0,!d.size||d.type==="directory"){t._parse(512,f),t.emit("entry",d,Aat(t,h),n);return}t._stream=new HT(t,h),t.emit("entry",d,t._stream,n),t._parse(d.size,a),i()};this._onheader=f,this._parse(512,f)};bhe.inherits(Lc,_he);Lc.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))};Lc.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)};Lc.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=whe,this._overflow?this._write(this._overflow,void 0,e):e()}};Lc.prototype._write=function(e,t,r){if(!this._destroyed){var i=this._stream,n=this._buffer,a=this._missing;if(e.length&&(this._partial=!0),e.length<a)return this._missing-=e.length,this._overflow=null,i?i.write(e,r):(n.append(e),r());this._cb=r,this._missing=0;var o=null;e.length>a&&(o=e.slice(a),e=e.slice(0,a)),i?i.end(e):n.append(e),this._overflow=o,this._onparse()}};Lc.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};She.exports=Lc});var khe=T((CPt,The)=>{The.exports=require("fs").constants||require("constants")});var Ihe=T((IPt,Che)=>{var kat=EA(),Rat=function(){},Cat=function(e){return e.setHeader&&typeof e.abort=="function"},Iat=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},Rhe=function(e,t,r){if(typeof t=="function")return Rhe(e,null,t);t||(t={}),r=kat(r||Rat);var i=e._writableState,n=e._readableState,a=t.readable||t.readable!==!1&&e.readable,o=t.writable||t.writable!==!1&&e.writable,s=!1,u=function(){e.writable||l()},l=function(){o=!1,a||r.call(e)},c=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)},d=function(){process.nextTick(p)},p=function(){if(!s){if(a&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"));if(o&&!(i&&i.ended&&!i.destroyed))return r.call(e,new Error("premature close"))}},y=function(){e.req.on("finish",l)};return Cat(e)?(e.on("complete",l),e.on("abort",d),e.req?y():e.on("request",y)):o&&!i&&(e.on("end",u),e.on("close",u)),Iat(e)&&e.on("exit",f),e.on("end",c),e.on("finish",l),t.error!==!1&&e.on("error",h),e.on("close",d),function(){s=!0,e.removeListener("complete",l),e.removeListener("abort",d),e.removeListener("request",y),e.req&&e.req.removeListener("finish",l),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",l),e.removeListener("exit",f),e.removeListener("end",c),e.removeListener("error",h),e.removeListener("close",d)}};Che.exports=Rhe});var Dhe=T((OPt,Mhe)=>{var E0=khe(),Ohe=Ihe(),VT=er(),Oat=Buffer.alloc,Phe=c_().Readable,S0=c_().Writable,Pat=require("string_decoder").StringDecoder,WT=dj(),Bat=parseInt("755",8),Mat=parseInt("644",8),Bhe=Oat(1024),qj=function(){},Uj=function(e,t){t&=511,t&&e.push(Bhe.slice(0,512-t))};function Dat(e){switch(e&E0.S_IFMT){case E0.S_IFBLK:return"block-device";case E0.S_IFCHR:return"character-device";case E0.S_IFDIR:return"directory";case E0.S_IFIFO:return"fifo";case E0.S_IFLNK:return"symlink"}return"file"}var KT=function(e){S0.call(this),this.written=0,this._to=e,this._destroyed=!1};VT(KT,S0);KT.prototype._write=function(e,t,r){if(this.written+=e.length,this._to.push(e))return r();this._to._drain=r};KT.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var YT=function(){S0.call(this),this.linkname="",this._decoder=new Pat("utf-8"),this._destroyed=!1};VT(YT,S0);YT.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e),r()};YT.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var h_=function(){S0.call(this),this._destroyed=!1};VT(h_,S0);h_.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))};h_.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var wl=function(e){if(!(this instanceof wl))return new wl(e);Phe.call(this,e),this._drain=qj,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};VT(wl,Phe);wl.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=qj);var i=this;if((!e.size||e.type==="symlink")&&(e.size=0),e.type||(e.type=Dat(e.mode)),e.mode||(e.mode=e.type==="directory"?Bat:Mat),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 n=this.push(t);return Uj(i,e.size),n?process.nextTick(r):this._drain=r,new h_}if(e.type==="symlink"&&!e.linkname){var a=new YT;return Ohe(a,function(s){if(s)return i.destroy(),r(s);e.linkname=a.linkname,i._encode(e),r()}),a}if(this._encode(e),e.type!=="file"&&e.type!=="contiguous-file")return process.nextTick(r),new h_;var o=new KT(this);return this._stream=o,Ohe(o,function(s){if(i._stream=null,s)return i.destroy(),r(s);if(o.written!==e.size)return i.destroy(),r(new Error("size mismatch"));Uj(i,e.size),i._finalizing&&i.finalize(),r()}),o}};wl.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(Bhe),this.push(null))};wl.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())};wl.prototype._encode=function(e){if(!e.pax){var t=WT.encode(e);if(t){this.push(t);return}}this._encodePax(e)};wl.prototype._encodePax=function(e){var t=WT.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(WT.encode(r)),this.push(t),Uj(this,t.length),r.size=e.size,r.type=e.type,this.push(WT.encode(r))};wl.prototype._read=function(e){var t=this._drain;this._drain=qj,t()};Mhe.exports=wl});var Fhe=T(Gj=>{Gj.extract=Ahe();Gj.pack=Dhe()});var Nhe=T((BPt,Lhe)=>{var Fat=require("zlib"),jat=Fhe(),jhe=Zg(),Nc=function(e){if(!(this instanceof Nc))return new Nc(e);e=this.options=jhe.defaults(e,{gzip:!1}),typeof e.gzipOptions!="object"&&(e.gzipOptions={}),this.supports={directory:!0,symlink:!0},this.engine=jat.pack(e),this.compressor=!1,e.gzip&&(this.compressor=Fat.createGzip(e.gzipOptions),this.compressor.on("error",this._onCompressorError.bind(this)))};Nc.prototype._onCompressorError=function(e){this.engine.emit("error",e)};Nc.prototype.append=function(e,t,r){var i=this;t.mtime=t.date;function n(o,s){if(o){r(o);return}i.engine.entry(t,s,function(u){r(u,t)})}if(t.sourceType==="buffer")n(null,e);else if(t.sourceType==="stream"&&t.stats){t.size=t.stats.size;var a=i.engine.entry(t,function(o){r(o,t)});e.pipe(a)}else t.sourceType==="stream"&&jhe.collectStream(e,n)};Nc.prototype.finalize=function(){this.engine.finalize()};Nc.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};Nc.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)};Nc.prototype.unpipe=function(){return this.compressor?this.compressor.unpipe.apply(this.compressor,arguments):this.engine.unpipe.apply(this.engine,arguments)};Lhe.exports=Nc});var zhe=T((MPt,Ghe)=>{var Lat=require("util").inherits,qhe=yF().Transform,Nat=a6(),Uhe=Zg(),Bh=function(e){if(!(this instanceof Bh))return new Bh(e);e=this.options=Uhe.defaults(e,{}),qhe.call(this,e),this.supports={directory:!0,symlink:!0},this.files=[]};Lat(Bh,qhe);Bh.prototype._transform=function(e,t,r){r(null,e)};Bh.prototype._writeStringified=function(){var e=JSON.stringify(this.files);this.write(e)};Bh.prototype.append=function(e,t,r){var i=this;t.crc32=0;function n(a,o){if(a){r(a);return}t.size=o.length||0,t.crc32=Nat.unsigned(o),i.files.push(t),r(null,t)}t.sourceType==="buffer"?n(null,e):t.sourceType==="stream"&&Uhe.collectStream(e,n)};Bh.prototype.finalize=function(){this._writeStringified(),this.end()};Ghe.exports=Bh});var Vhe=T((DPt,Hhe)=>{var qat=Bse(),d_={},Mh=function(e,t){return Mh.create(e,t)};Mh.create=function(e,t){if(d_[e]){var r=new qat(e,t);return r.setFormat(e),r.setModule(new d_[e](t)),r}else throw new Error("create("+e+"): format not registered")};Mh.registerFormat=function(e,t){if(d_[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");d_[e]=t};Mh.isRegisteredFormat=function(e){return!!d_[e]};Mh.registerFormat("zip",dce());Mh.registerFormat("tar",Nhe());Mh.registerFormat("json",zhe());Hhe.exports=Mh});var qc=T(Go=>{"use strict";Go.base64=!0;Go.array=!0;Go.string=!0;Go.arraybuffer=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined";Go.nodebuffer=typeof Buffer!="undefined";Go.uint8array=typeof Uint8Array!="undefined";if(typeof ArrayBuffer=="undefined")Go.blob=!1;else{zj=new ArrayBuffer(0);try{Go.blob=new Blob([zj],{type:"application/zip"}).size===0}catch{try{Whe=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,Hj=new Whe,Hj.append(zj),Go.blob=Hj.getBlob("application/zip").size===0}catch{Go.blob=!1}}}var zj,Whe,Hj;try{Go.nodestream=!!s1().Readable}catch{Go.nodestream=!1}});var Wj=T(Vj=>{"use strict";var Uat=qi(),Gat=qc(),El="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";Vj.encode=function(e){for(var t=[],r,i,n,a,o,s,u,l=0,c=e.length,f=c,h=Uat.getTypeOf(e)!=="string";l<e.length;)f=c-l,h?(r=e[l++],i=l<c?e[l++]:0,n=l<c?e[l++]:0):(r=e.charCodeAt(l++),i=l<c?e.charCodeAt(l++):0,n=l<c?e.charCodeAt(l++):0),a=r>>2,o=(r&3)<<4|i>>4,s=f>1?(i&15)<<2|n>>6:64,u=f>2?n&63:64,t.push(El.charAt(a)+El.charAt(o)+El.charAt(s)+El.charAt(u));return t.join("")};Vj.decode=function(e){var t,r,i,n,a,o,s,u=0,l=0,c="data:";if(e.substr(0,c.length)===c)throw new Error("Invalid base64 input, it looks like a data url.");e=e.replace(/[^A-Za-z0-9+/=]/g,"");var f=e.length*3/4;if(e.charAt(e.length-1)===El.charAt(64)&&f--,e.charAt(e.length-2)===El.charAt(64)&&f--,f%1!=0)throw new Error("Invalid base64 input, bad content length.");var h;for(Gat.uint8array?h=new Uint8Array(f|0):h=new Array(f|0);u<e.length;)n=El.indexOf(e.charAt(u++)),a=El.indexOf(e.charAt(u++)),o=El.indexOf(e.charAt(u++)),s=El.indexOf(e.charAt(u++)),t=n<<2|a>>4,r=(a&15)<<4|o>>2,i=(o&3)<<6|s,h[l++]=t,o!==64&&(h[l++]=r),s!==64&&(h[l++]=i);return h}});var p_=T((LPt,Khe)=>{"use strict";Khe.exports={isNode:typeof Buffer!="undefined",newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if(typeof e=="number")throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&typeof e.on=="function"&&typeof e.pause=="function"&&typeof e.resume=="function"}}});var Jhe=T((NPt,Xhe)=>{"use strict";var Yhe=global.MutationObserver||global.WebKitMutationObserver,A0;process.browser?Yhe?(Kj=0,$he=new Yhe(g_),Yj=global.document.createTextNode(""),$he.observe(Yj,{characterData:!0}),A0=function(){Yj.data=Kj=++Kj%2}):!global.setImmediate&&typeof global.MessageChannel!="undefined"?($j=new global.MessageChannel,$j.port1.onmessage=g_,A0=function(){$j.port2.postMessage(0)}):"document"in global&&"onreadystatechange"in global.document.createElement("script")?A0=function(){var e=global.document.createElement("script");e.onreadystatechange=function(){g_(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},global.document.documentElement.appendChild(e)}:A0=function(){setTimeout(g_,0)}:A0=function(){process.nextTick(g_)};var Kj,$he,Yj,$j,Xj,m_=[];function g_(){Xj=!0;for(var e,t,r=m_.length;r;){for(t=m_,m_=[],e=-1;++e<r;)t[e]();r=m_.length}Xj=!1}Xhe.exports=zat;function zat(e){m_.push(e)===1&&!Xj&&A0()}});var nde=T((qPt,ide)=>{"use strict";var Qhe=Jhe();function T0(){}var ja={},Zhe=["REJECTED"],Jj=["FULFILLED"],ede=["PENDING"];process.browser||(v_=["UNHANDLED"]);var v_;ide.exports=Dh;function Dh(e){if(typeof e!="function")throw new TypeError("resolver must be a function");this.state=ede,this.queue=[],this.outcome=void 0,process.browser||(this.handled=v_),e!==T0&&tde(this,e)}Dh.prototype.finally=function(e){if(typeof e!="function")return this;var t=this.constructor;return this.then(r,i);function r(n){function a(){return n}return t.resolve(e()).then(a)}function i(n){function a(){throw n}return t.resolve(e()).then(a)}};Dh.prototype.catch=function(e){return this.then(null,e)};Dh.prototype.then=function(e,t){if(typeof e!="function"&&this.state===Jj||typeof t!="function"&&this.state===Zhe)return this;var r=new this.constructor(T0);if(process.browser||this.handled===v_&&(this.handled=null),this.state!==ede){var i=this.state===Jj?e:t;Qj(r,i,this.outcome)}else this.queue.push(new y_(r,e,t));return r};function y_(e,t,r){this.promise=e,typeof t=="function"&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),typeof r=="function"&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}y_.prototype.callFulfilled=function(e){ja.resolve(this.promise,e)};y_.prototype.otherCallFulfilled=function(e){Qj(this.promise,this.onFulfilled,e)};y_.prototype.callRejected=function(e){ja.reject(this.promise,e)};y_.prototype.otherCallRejected=function(e){Qj(this.promise,this.onRejected,e)};function Qj(e,t,r){Qhe(function(){var i;try{i=t(r)}catch(n){return ja.reject(e,n)}i===e?ja.reject(e,new TypeError("Cannot resolve promise with itself")):ja.resolve(e,i)})}ja.resolve=function(e,t){var r=rde(Hat,t);if(r.status==="error")return ja.reject(e,r.value);var i=r.value;if(i)tde(e,i);else{e.state=Jj,e.outcome=t;for(var n=-1,a=e.queue.length;++n<a;)e.queue[n].callFulfilled(t)}return e};ja.reject=function(e,t){e.state=Zhe,e.outcome=t,process.browser||e.handled===v_&&Qhe(function(){e.handled===v_&&process.emit("unhandledRejection",t,e)});for(var r=-1,i=e.queue.length;++r<i;)e.queue[r].callRejected(t);return e};function Hat(e){var t=e&&e.then;if(e&&(typeof e=="object"||typeof e=="function")&&typeof t=="function")return function(){t.apply(e,arguments)}}function tde(e,t){var r=!1;function i(s){r||(r=!0,ja.reject(e,s))}function n(s){r||(r=!0,ja.resolve(e,s))}function a(){t(n,i)}var o=rde(a);o.status==="error"&&i(o.value)}function rde(e,t){var r={};try{r.value=e(t),r.status="success"}catch(i){r.status="error",r.value=i}return r}Dh.resolve=Vat;function Vat(e){return e instanceof this?e:ja.resolve(new this(T0),e)}Dh.reject=Wat;function Wat(e){var t=new this(T0);return ja.reject(t,e)}Dh.all=Kat;function Kat(e){var t=this;if(Object.prototype.toString.call(e)!=="[object Array]")return this.reject(new TypeError("must be an array"));var r=e.length,i=!1;if(!r)return this.resolve([]);for(var n=new Array(r),a=0,o=-1,s=new this(T0);++o<r;)u(e[o],o);return s;function u(l,c){t.resolve(l).then(f,function(h){i||(i=!0,ja.reject(s,h))});function f(h){n[c]=h,++a===r&&!i&&(i=!0,ja.resolve(s,n))}}}Dh.race=Yat;function Yat(e){var t=this;if(Object.prototype.toString.call(e)!=="[object Array]")return this.reject(new TypeError("must be an array"));var r=e.length,i=!1;if(!r)return this.resolve([]);for(var n=-1,a=new this(T0);++n<r;)o(e[n]);return a;function o(s){t.resolve(s).then(function(u){i||(i=!0,ja.resolve(a,u))},function(u){i||(i=!0,ja.reject(a,u))})}}});var k0=T((UPt,ade)=>{"use strict";var Zj=null;typeof Promise!="undefined"?Zj=Promise:Zj=nde();ade.exports={Promise:Zj}});var sde=T(ode=>{(function(e,t){"use strict";if(e.setImmediate)return;var r=1,i={},n=!1,a=e.document,o;function s(E){typeof E!="function"&&(E=new Function(""+E));for(var S=new Array(arguments.length-1),k=0;k<S.length;k++)S[k]=arguments[k+1];var R={callback:E,args:S};return i[r]=R,o(r),r++}function u(E){delete i[E]}function l(E){var S=E.callback,k=E.args;switch(k.length){case 0:S();break;case 1:S(k[0]);break;case 2:S(k[0],k[1]);break;case 3:S(k[0],k[1],k[2]);break;default:S.apply(t,k);break}}function c(E){if(n)setTimeout(c,0,E);else{var S=i[E];if(S){n=!0;try{l(S)}finally{u(E),n=!1}}}}function f(){o=function(E){process.nextTick(function(){c(E)})}}function h(){if(e.postMessage&&!e.importScripts){var E=!0,S=e.onmessage;return e.onmessage=function(){E=!1},e.postMessage("","*"),e.onmessage=S,E}}function d(){var E="setImmediate$"+Math.random()+"$",S=function(k){k.source===e&&typeof k.data=="string"&&k.data.indexOf(E)===0&&c(+k.data.slice(E.length))};e.addEventListener?e.addEventListener("message",S,!1):e.attachEvent("onmessage",S),o=function(k){e.postMessage(E+k,"*")}}function p(){var E=new MessageChannel;E.port1.onmessage=function(S){var k=S.data;c(k)},o=function(S){E.port2.postMessage(S)}}function y(){var E=a.documentElement;o=function(S){var k=a.createElement("script");k.onreadystatechange=function(){c(S),k.onreadystatechange=null,E.removeChild(k),k=null},E.appendChild(k)}}function g(){o=function(E){setTimeout(c,0,E)}}var b=Object.getPrototypeOf&&Object.getPrototypeOf(e);b=b&&b.setTimeout?b:e,{}.toString.call(e.process)==="[object process]"?f():h()?d():e.MessageChannel?p():a&&"onreadystatechange"in a.createElement("script")?y():g(),b.setImmediate=s,b.clearImmediate=u})(typeof self=="undefined"?typeof global=="undefined"?ode:global:self)});var qi=T(kn=>{"use strict";var Fh=qc(),$at=Wj(),R0=p_(),e4=k0();sde();function Xat(e){var t=null;return Fh.uint8array?t=new Uint8Array(e.length):t=new Array(e.length),$T(e,t)}kn.newBlob=function(e,t){kn.checkSupport("blob");try{return new Blob([e],{type:t})}catch{try{var r=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,i=new r;return i.append(e),i.getBlob(t)}catch{throw new Error("Bug : can't construct the Blob.")}}};function b_(e){return e}function $T(e,t){for(var r=0;r<e.length;++r)t[r]=e.charCodeAt(r)&255;return t}var XT={stringifyByChunk:function(e,t,r){var i=[],n=0,a=e.length;if(a<=r)return String.fromCharCode.apply(null,e);for(;n<a;)t==="array"||t==="nodebuffer"?i.push(String.fromCharCode.apply(null,e.slice(n,Math.min(n+r,a)))):i.push(String.fromCharCode.apply(null,e.subarray(n,Math.min(n+r,a)))),n+=r;return i.join("")},stringifyByChar:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:function(){try{return Fh.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return Fh.nodebuffer&&String.fromCharCode.apply(null,R0.allocBuffer(1)).length===1}catch{return!1}}()}};function __(e){var t=65536,r=kn.getTypeOf(e),i=!0;if(r==="uint8array"?i=XT.applyCanBeUsed.uint8array:r==="nodebuffer"&&(i=XT.applyCanBeUsed.nodebuffer),i)for(;t>1;)try{return XT.stringifyByChunk(e,r,t)}catch{t=Math.floor(t/2)}return XT.stringifyByChar(e)}kn.applyFromCharCode=__;function JT(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}var jh={};jh.string={string:b_,array:function(e){return $T(e,new Array(e.length))},arraybuffer:function(e){return jh.string.uint8array(e).buffer},uint8array:function(e){return $T(e,new Uint8Array(e.length))},nodebuffer:function(e){return $T(e,R0.allocBuffer(e.length))}};jh.array={string:__,array:b_,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return R0.newBufferFrom(e)}};jh.arraybuffer={string:function(e){return __(new Uint8Array(e))},array:function(e){return JT(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:b_,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return R0.newBufferFrom(new Uint8Array(e))}};jh.uint8array={string:__,array:function(e){return JT(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:b_,nodebuffer:function(e){return R0.newBufferFrom(e)}};jh.nodebuffer={string:__,array:function(e){return JT(e,new Array(e.length))},arraybuffer:function(e){return jh.nodebuffer.uint8array(e).buffer},uint8array:function(e){return JT(e,new Uint8Array(e.length))},nodebuffer:b_};kn.transformTo=function(e,t){if(t||(t=""),!e)return t;kn.checkSupport(e);var r=kn.getTypeOf(t),i=jh[r][e](t);return i};kn.resolve=function(e){for(var t=e.split("/"),r=[],i=0;i<t.length;i++){var n=t[i];n==="."||n===""&&i!==0&&i!==t.length-1||(n===".."?r.pop():r.push(n))}return r.join("/")};kn.getTypeOf=function(e){if(typeof e=="string")return"string";if(Object.prototype.toString.call(e)==="[object Array]")return"array";if(Fh.nodebuffer&&R0.isBuffer(e))return"nodebuffer";if(Fh.uint8array&&e instanceof Uint8Array)return"uint8array";if(Fh.arraybuffer&&e instanceof ArrayBuffer)return"arraybuffer"};kn.checkSupport=function(e){var t=Fh[e.toLowerCase()];if(!t)throw new Error(e+" is not supported by this platform")};kn.MAX_VALUE_16BITS=65535;kn.MAX_VALUE_32BITS=-1;kn.pretty=function(e){var t="",r,i;for(i=0;i<(e||"").length;i++)r=e.charCodeAt(i),t+="\\x"+(r<16?"0":"")+r.toString(16).toUpperCase();return t};kn.delay=function(e,t,r){setImmediate(function(){e.apply(r||null,t||[])})};kn.inherits=function(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r};kn.extend=function(){var e={},t,r;for(t=0;t<arguments.length;t++)for(r in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],r)&&typeof e[r]=="undefined"&&(e[r]=arguments[t][r]);return e};kn.prepareContent=function(e,t,r,i,n){var a=e4.Promise.resolve(t).then(function(o){var s=Fh.blob&&(o instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(o))!==-1);return s&&typeof FileReader!="undefined"?new e4.Promise(function(u,l){var c=new FileReader;c.onload=function(f){u(f.target.result)},c.onerror=function(f){l(f.target.error)},c.readAsArrayBuffer(o)}):o});return a.then(function(o){var s=kn.getTypeOf(o);return s?(s==="arraybuffer"?o=kn.transformTo("uint8array",o):s==="string"&&(n?o=$at.decode(o):r&&i!==!0&&(o=Xat(o))),o):e4.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}});var zo=T((HPt,lde)=>{"use strict";function ude(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}ude.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return this.isFinished?!1:(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r<this._listeners[e].length;r++)this._listeners[e][r].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",function(r){t.processChunk(r)}),e.on("end",function(){t.end()}),e.on("error",function(r){t.error(r)}),this},pause:function(){return this.isPaused||this.isFinished?!1:(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var e=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)!Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)||(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}};lde.exports=ude});var I0=T(Lh=>{"use strict";var C0=qi(),Sp=qc(),Jat=p_(),QT=zo(),x_=new Array(256);for(Uc=0;Uc<256;Uc++)x_[Uc]=Uc>=252?6:Uc>=248?5:Uc>=240?4:Uc>=224?3:Uc>=192?2:1;var Uc;x_[254]=x_[254]=1;var Qat=function(e){var t,r,i,n,a,o=e.length,s=0;for(n=0;n<o;n++)r=e.charCodeAt(n),(r&64512)==55296&&n+1<o&&(i=e.charCodeAt(n+1),(i&64512)==56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(Sp.uint8array?t=new Uint8Array(s):t=new Array(s),a=0,n=0;a<s;n++)r=e.charCodeAt(n),(r&64512)==55296&&n+1<o&&(i=e.charCodeAt(n+1),(i&64512)==56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|r&63):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|r&63):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|r&63);return t},Zat=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)==128;)r--;return r<0||r===0?t:r+x_[e[r]]>t?r:t},eot=function(e){var t,r,i,n,a=e.length,o=new Array(a*2);for(r=0,t=0;t<a;){if(i=e[t++],i<128){o[r++]=i;continue}if(n=x_[i],n>4){o[r++]=65533,t+=n-1;continue}for(i&=n===2?31:n===3?15:7;n>1&&t<a;)i=i<<6|e[t++]&63,n--;if(n>1){o[r++]=65533;continue}i<65536?o[r++]=i:(i-=65536,o[r++]=55296|i>>10&1023,o[r++]=56320|i&1023)}return o.length!==r&&(o.subarray?o=o.subarray(0,r):o.length=r),C0.applyFromCharCode(o)};Lh.utf8encode=function(t){return Sp.nodebuffer?Jat.newBufferFrom(t,"utf-8"):Qat(t)};Lh.utf8decode=function(t){return Sp.nodebuffer?C0.transformTo("nodebuffer",t).toString("utf-8"):(t=C0.transformTo(Sp.uint8array?"uint8array":"array",t),eot(t))};function ZT(){QT.call(this,"utf-8 decode"),this.leftOver=null}C0.inherits(ZT,QT);ZT.prototype.processChunk=function(e){var t=C0.transformTo(Sp.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(Sp.uint8array){var r=t;t=new Uint8Array(r.length+this.leftOver.length),t.set(this.leftOver,0),t.set(r,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var i=Zat(t),n=t;i!==t.length&&(Sp.uint8array?(n=t.subarray(0,i),this.leftOver=t.subarray(i,t.length)):(n=t.slice(0,i),this.leftOver=t.slice(i,t.length))),this.push({data:Lh.utf8decode(n),meta:e.meta})};ZT.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:Lh.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)};Lh.Utf8DecodeWorker=ZT;function t4(){QT.call(this,"utf-8 encode")}C0.inherits(t4,QT);t4.prototype.processChunk=function(e){this.push({data:Lh.utf8encode(e.data),meta:e.meta})};Lh.Utf8EncodeWorker=t4});var dde=T((WPt,hde)=>{"use strict";var cde=zo(),fde=qi();function r4(e){cde.call(this,"ConvertWorker to "+e),this.destType=e}fde.inherits(r4,cde);r4.prototype.processChunk=function(e){this.push({data:fde.transformTo(this.destType,e.data),meta:e.meta})};hde.exports=r4});var gde=T((KPt,mde)=>{"use strict";var pde=s1().Readable,tot=qi();tot.inherits(i4,pde);function i4(e,t,r){pde.call(this,t),this._helper=e;var i=this;e.on("data",function(n,a){i.push(n)||i._helper.pause(),r&&r(a)}).on("error",function(n){i.emit("error",n)}).on("end",function(){i.push(null)})}i4.prototype._read=function(){this._helper.resume()};mde.exports=i4});var n4=T((YPt,bde)=>{"use strict";var Ap=qi(),rot=dde(),iot=zo(),not=Wj(),aot=qc(),oot=k0(),vde=null;if(aot.nodestream)try{vde=gde()}catch{}function sot(e,t,r){switch(e){case"blob":return Ap.newBlob(Ap.transformTo("arraybuffer",t),r);case"base64":return not.encode(t);default:return Ap.transformTo(e,t)}}function uot(e,t){var r,i=0,n=null,a=0;for(r=0;r<t.length;r++)a+=t[r].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(n=new Uint8Array(a),r=0;r<t.length;r++)n.set(t[r],i),i+=t[r].length;return n;case"nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}function lot(e,t){return new oot.Promise(function(r,i){var n=[],a=e._internalType,o=e._outputType,s=e._mimeType;e.on("data",function(u,l){n.push(u),t&&t(l)}).on("error",function(u){n=[],i(u)}).on("end",function(){try{var u=sot(o,uot(a,n),s);r(u)}catch(l){i(l)}n=[]}).resume()})}function yde(e,t,r){var i=t;switch(t){case"blob":case"arraybuffer":i="uint8array";break;case"base64":i="string";break}try{this._internalType=i,this._outputType=t,this._mimeType=r,Ap.checkSupport(i),this._worker=e.pipe(new rot(i)),e.lock()}catch(n){this._worker=new iot("error"),this._worker.error(n)}}yde.prototype={accumulate:function(e){return lot(this,e)},on:function(e,t){var r=this;return e==="data"?this._worker.on(e,function(i){t.call(r,i.data,i.meta)}):this._worker.on(e,function(){Ap.delay(t,arguments,r)}),this},resume:function(){return Ap.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(Ap.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new vde(this,{objectMode:this._outputType!=="nodebuffer"},e)}};bde.exports=yde});var a4=T(_u=>{"use strict";_u.base64=!1;_u.binary=!1;_u.dir=!1;_u.createFolders=!0;_u.date=null;_u.compression=null;_u.compressionOptions=null;_u.comment=null;_u.unixPermissions=null;_u.dosPermissions=null});var o4=T((XPt,_de)=>{"use strict";var ek=qi(),tk=zo(),cot=16*1024;function O0(e){tk.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(r){t.dataIsReady=!0,t.data=r,t.max=r&&r.length||0,t.type=ek.getTypeOf(r),t.isPaused||t._tickAndRepeat()},function(r){t.error(r)})}ek.inherits(O0,tk);O0.prototype.cleanUp=function(){tk.prototype.cleanUp.call(this),this.data=null};O0.prototype.resume=function(){return tk.prototype.resume.call(this)?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,ek.delay(this._tickAndRepeat,[],this)),!0):!1};O0.prototype._tickAndRepeat=function(){this._tickScheduled=!1,!(this.isPaused||this.isFinished)&&(this._tick(),this.isFinished||(ek.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))};O0.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=cot,t=null,r=Math.min(this.max,this.index+e);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,r);break;case"uint8array":t=this.data.subarray(this.index,r);break;case"array":case"nodebuffer":t=this.data.slice(this.index,r);break}return this.index=r,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})};_de.exports=O0});var rk=T((JPt,wde)=>{"use strict";var fot=qi();function hot(){for(var e,t=[],r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var xde=hot();function dot(e,t,r,i){var n=xde,a=i+r;e=e^-1;for(var o=i;o<a;o++)e=e>>>8^n[(e^t[o])&255];return e^-1}function pot(e,t,r,i){var n=xde,a=i+r;e=e^-1;for(var o=i;o<a;o++)e=e>>>8^n[(e^t.charCodeAt(o))&255];return e^-1}wde.exports=function(t,r){if(typeof t=="undefined"||!t.length)return 0;var i=fot.getTypeOf(t)!=="string";return i?dot(r|0,t,t.length,0):pot(r|0,t,t.length,0)}});var u4=T((QPt,Sde)=>{"use strict";var Ede=zo(),mot=rk(),got=qi();function s4(){Ede.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}got.inherits(s4,Ede);s4.prototype.processChunk=function(e){this.streamInfo.crc32=mot(e.data,this.streamInfo.crc32||0),this.push(e)};Sde.exports=s4});var Tde=T((ZPt,Ade)=>{"use strict";var vot=qi(),l4=zo();function c4(e){l4.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}vot.inherits(c4,l4);c4.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}l4.prototype.processChunk.call(this,e)};Ade.exports=c4});var ik=T((eBt,Cde)=>{"use strict";var kde=k0(),Rde=o4(),yot=u4(),f4=Tde();function h4(e,t,r,i,n){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=i,this.compressedContent=n}h4.prototype={getContentWorker:function(){var e=new Rde(kde.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new f4("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new Rde(kde.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};h4.createWorkerFrom=function(e,t,r){return e.pipe(new yot).pipe(new f4("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new f4("compressedSize")).withStreamInfo("compression",t)};Cde.exports=h4});var Bde=T((tBt,Pde)=>{"use strict";var bot=n4(),_ot=o4(),d4=I0(),p4=ik(),Ide=zo(),m4=function(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}};m4.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");r=e.toLowerCase();var i=r==="string"||r==="text";(r==="binarystring"||r==="text")&&(r="string"),t=this._decompressWorker();var n=!this._dataBinary;n&&!i&&(t=t.pipe(new d4.Utf8EncodeWorker)),!n&&i&&(t=t.pipe(new d4.Utf8DecodeWorker))}catch(a){t=new Ide("error"),t.error(a)}return new bot(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof p4&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new d4.Utf8EncodeWorker)),p4.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof p4?this._data.getContentWorker():this._data instanceof Ide?this._data:new _ot(this._data)}};var Ode=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],xot=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(nk=0;nk<Ode.length;nk++)m4.prototype[Ode[nk]]=xot;var nk;Pde.exports=m4});var Gc=T(ro=>{"use strict";var wot=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";function Eot(e,t){return Object.prototype.hasOwnProperty.call(e,t)}ro.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(!!r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var i in r)Eot(r,i)&&(e[i]=r[i])}}return e};ro.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var Sot={arraySet:function(e,t,r,i,n){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+i),n);return}for(var a=0;a<i;a++)e[n+a]=t[r+a]},flattenChunks:function(e){var t,r,i,n,a,o;for(i=0,t=0,r=e.length;t<r;t++)i+=e[t].length;for(o=new Uint8Array(i),n=0,t=0,r=e.length;t<r;t++)a=e[t],o.set(a,n),n+=a.length;return o}},Aot={arraySet:function(e,t,r,i,n){for(var a=0;a<i;a++)e[n+a]=t[r+a]},flattenChunks:function(e){return[].concat.apply([],e)}};ro.setTyped=function(e){e?(ro.Buf8=Uint8Array,ro.Buf16=Uint16Array,ro.Buf32=Int32Array,ro.assign(ro,Sot)):(ro.Buf8=Array,ro.Buf16=Array,ro.Buf32=Array,ro.assign(ro,Aot))};ro.setTyped(wot)});var rpe=T(M0=>{"use strict";var Tot=Gc(),kot=4,Mde=0,Dde=1,Rot=2;function P0(e){for(var t=e.length;--t>=0;)e[t]=0}var Cot=0,Fde=1,Iot=2,Oot=3,Pot=258,g4=29,w_=256,E_=w_+1+g4,B0=30,v4=19,jde=2*E_+1,Tp=15,y4=16,Bot=7,b4=256,Lde=16,Nde=17,qde=18,_4=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ak=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Mot=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Ude=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Dot=512,zc=new Array((E_+2)*2);P0(zc);var S_=new Array(B0*2);P0(S_);var A_=new Array(Dot);P0(A_);var T_=new Array(Pot-Oot+1);P0(T_);var x4=new Array(g4);P0(x4);var ok=new Array(B0);P0(ok);function w4(e,t,r,i,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=e&&e.length}var Gde,zde,Hde;function E4(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Vde(e){return e<256?A_[e]:A_[256+(e>>>7)]}function k_(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function xo(e,t,r){e.bi_valid>y4-r?(e.bi_buf|=t<<e.bi_valid&65535,k_(e,e.bi_buf),e.bi_buf=t>>y4-e.bi_valid,e.bi_valid+=r-y4):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function Sl(e,t,r){xo(e,r[t*2],r[t*2+1])}function Wde(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function Fot(e){e.bi_valid===16?(k_(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function jot(e,t){var r=t.dyn_tree,i=t.max_code,n=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,u=t.stat_desc.max_length,l,c,f,h,d,p,y=0;for(h=0;h<=Tp;h++)e.bl_count[h]=0;for(r[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<jde;l++)c=e.heap[l],h=r[r[c*2+1]*2+1]+1,h>u&&(h=u,y++),r[c*2+1]=h,!(c>i)&&(e.bl_count[h]++,d=0,c>=s&&(d=o[c-s]),p=r[c*2],e.opt_len+=p*(h+d),a&&(e.static_len+=p*(n[c*2+1]+d)));if(y!==0){do{for(h=u-1;e.bl_count[h]===0;)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[u]--,y-=2}while(y>0);for(h=u;h!==0;h--)for(c=e.bl_count[h];c!==0;)f=e.heap[--l],!(f>i)&&(r[f*2+1]!==h&&(e.opt_len+=(h-r[f*2+1])*r[f*2],r[f*2+1]=h),c--)}}function Kde(e,t,r){var i=new Array(Tp+1),n=0,a,o;for(a=1;a<=Tp;a++)i[a]=n=n+r[a-1]<<1;for(o=0;o<=t;o++){var s=e[o*2+1];s!==0&&(e[o*2]=Wde(i[s]++,s))}}function Lot(){var e,t,r,i,n,a=new Array(Tp+1);for(r=0,i=0;i<g4-1;i++)for(x4[i]=r,e=0;e<1<<_4[i];e++)T_[r++]=i;for(T_[r-1]=i,n=0,i=0;i<16;i++)for(ok[i]=n,e=0;e<1<<ak[i];e++)A_[n++]=i;for(n>>=7;i<B0;i++)for(ok[i]=n<<7,e=0;e<1<<ak[i]-7;e++)A_[256+n++]=i;for(t=0;t<=Tp;t++)a[t]=0;for(e=0;e<=143;)zc[e*2+1]=8,e++,a[8]++;for(;e<=255;)zc[e*2+1]=9,e++,a[9]++;for(;e<=279;)zc[e*2+1]=7,e++,a[7]++;for(;e<=287;)zc[e*2+1]=8,e++,a[8]++;for(Kde(zc,E_+1,a),e=0;e<B0;e++)S_[e*2+1]=5,S_[e*2]=Wde(e,5);Gde=new w4(zc,_4,w_+1,E_,Tp),zde=new w4(S_,ak,0,B0,Tp),Hde=new w4(new Array(0),Mot,0,v4,Bot)}function Yde(e){var t;for(t=0;t<E_;t++)e.dyn_ltree[t*2]=0;for(t=0;t<B0;t++)e.dyn_dtree[t*2]=0;for(t=0;t<v4;t++)e.bl_tree[t*2]=0;e.dyn_ltree[b4*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function $de(e){e.bi_valid>8?k_(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Not(e,t,r,i){$de(e),i&&(k_(e,r),k_(e,~r)),Tot.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function Xde(e,t,r,i){var n=t*2,a=r*2;return e[n]<e[a]||e[n]===e[a]&&i[t]<=i[r]}function S4(e,t,r){for(var i=e.heap[r],n=r<<1;n<=e.heap_len&&(n<e.heap_len&&Xde(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!Xde(t,i,e.heap[n],e.depth));)e.heap[r]=e.heap[n],r=n,n<<=1;e.heap[r]=i}function Jde(e,t,r){var i,n,a=0,o,s;if(e.last_lit!==0)do i=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],n=e.pending_buf[e.l_buf+a],a++,i===0?Sl(e,n,t):(o=T_[n],Sl(e,o+w_+1,t),s=_4[o],s!==0&&(n-=x4[o],xo(e,n,s)),i--,o=Vde(i),Sl(e,o,r),s=ak[o],s!==0&&(i-=ok[o],xo(e,i,s)));while(a<e.last_lit);Sl(e,b4,t)}function A4(e,t){var r=t.dyn_tree,i=t.stat_desc.static_tree,n=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,u=-1,l;for(e.heap_len=0,e.heap_max=jde,o=0;o<a;o++)r[o*2]!==0?(e.heap[++e.heap_len]=u=o,e.depth[o]=0):r[o*2+1]=0;for(;e.heap_len<2;)l=e.heap[++e.heap_len]=u<2?++u:0,r[l*2]=1,e.depth[l]=0,e.opt_len--,n&&(e.static_len-=i[l*2+1]);for(t.max_code=u,o=e.heap_len>>1;o>=1;o--)S4(e,r,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],S4(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,r[l*2]=r[o*2]+r[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,r[o*2+1]=r[s*2+1]=l,e.heap[1]=l++,S4(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],jot(e,t),Kde(r,u,e.bl_count)}function Qde(e,t,r){var i,n=-1,a,o=t[0*2+1],s=0,u=7,l=4;for(o===0&&(u=138,l=3),t[(r+1)*2+1]=65535,i=0;i<=r;i++)a=o,o=t[(i+1)*2+1],!(++s<u&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a!==0?(a!==n&&e.bl_tree[a*2]++,e.bl_tree[Lde*2]++):s<=10?e.bl_tree[Nde*2]++:e.bl_tree[qde*2]++,s=0,n=a,o===0?(u=138,l=3):a===o?(u=6,l=3):(u=7,l=4))}function Zde(e,t,r){var i,n=-1,a,o=t[0*2+1],s=0,u=7,l=4;for(o===0&&(u=138,l=3),i=0;i<=r;i++)if(a=o,o=t[(i+1)*2+1],!(++s<u&&a===o)){if(s<l)do Sl(e,a,e.bl_tree);while(--s!=0);else a!==0?(a!==n&&(Sl(e,a,e.bl_tree),s--),Sl(e,Lde,e.bl_tree),xo(e,s-3,2)):s<=10?(Sl(e,Nde,e.bl_tree),xo(e,s-3,3)):(Sl(e,qde,e.bl_tree),xo(e,s-11,7));s=0,n=a,o===0?(u=138,l=3):a===o?(u=6,l=3):(u=7,l=4)}}function qot(e){var t;for(Qde(e,e.dyn_ltree,e.l_desc.max_code),Qde(e,e.dyn_dtree,e.d_desc.max_code),A4(e,e.bl_desc),t=v4-1;t>=3&&e.bl_tree[Ude[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function Uot(e,t,r,i){var n;for(xo(e,t-257,5),xo(e,r-1,5),xo(e,i-4,4),n=0;n<i;n++)xo(e,e.bl_tree[Ude[n]*2+1],3);Zde(e,e.dyn_ltree,t-1),Zde(e,e.dyn_dtree,r-1)}function Got(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return Mde;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Dde;for(r=32;r<w_;r++)if(e.dyn_ltree[r*2]!==0)return Dde;return Mde}var epe=!1;function zot(e){epe||(Lot(),epe=!0),e.l_desc=new E4(e.dyn_ltree,Gde),e.d_desc=new E4(e.dyn_dtree,zde),e.bl_desc=new E4(e.bl_tree,Hde),e.bi_buf=0,e.bi_valid=0,Yde(e)}function tpe(e,t,r,i){xo(e,(Cot<<1)+(i?1:0),3),Not(e,t,r,!0)}function Hot(e){xo(e,Fde<<1,3),Sl(e,b4,zc),Fot(e)}function Vot(e,t,r,i){var n,a,o=0;e.level>0?(e.strm.data_type===Rot&&(e.strm.data_type=Got(e)),A4(e,e.l_desc),A4(e,e.d_desc),o=qot(e),n=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=n&&(n=a)):n=a=r+5,r+4<=n&&t!==-1?tpe(e,t,r,i):e.strategy===kot||a===n?(xo(e,(Fde<<1)+(i?1:0),3),Jde(e,zc,S_)):(xo(e,(Iot<<1)+(i?1:0),3),Uot(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Jde(e,e.dyn_ltree,e.dyn_dtree)),Yde(e),i&&$de(e)}function Wot(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(T_[r]+w_+1)*2]++,e.dyn_dtree[Vde(t)*2]++),e.last_lit===e.lit_bufsize-1}M0._tr_init=zot;M0._tr_stored_block=tpe;M0._tr_flush_block=Vot;M0._tr_tally=Wot;M0._tr_align=Hot});var T4=T((nBt,ipe)=>{"use strict";function Kot(e,t,r,i){for(var n=e&65535|0,a=e>>>16&65535|0,o=0;r!==0;){o=r>2e3?2e3:r,r-=o;do n=n+t[i++]|0,a=a+n|0;while(--o);n%=65521,a%=65521}return n|a<<16|0}ipe.exports=Kot});var k4=T((aBt,npe)=>{"use strict";function Yot(){for(var e,t=[],r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var $ot=Yot();function Xot(e,t,r,i){var n=$ot,a=i+r;e^=-1;for(var o=i;o<a;o++)e=e>>>8^n[(e^t[o])&255];return e^-1}npe.exports=Xot});var sk=T((oBt,ape)=>{"use strict";ape.exports={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"}});var ppe=T(kl=>{"use strict";var io=Gc(),Os=rpe(),ope=T4(),Nh=k4(),Jot=sk(),kp=0,Qot=1,Zot=3,qh=4,spe=5,Al=0,upe=1,Ps=-2,est=-3,R4=-5,tst=-1,rst=1,uk=2,ist=3,nst=4,ast=0,ost=2,lk=8,sst=9,ust=15,lst=8,cst=29,fst=256,C4=fst+1+cst,hst=30,dst=19,pst=2*C4+1,mst=15,Or=3,Uh=258,xu=Uh+Or+1,gst=32,ck=42,I4=69,fk=73,hk=91,dk=103,Rp=113,R_=666,zn=1,C_=2,Cp=3,D0=4,vst=3;function Gh(e,t){return e.msg=Jot[t],t}function lpe(e){return(e<<1)-(e>4?9:0)}function zh(e){for(var t=e.length;--t>=0;)e[t]=0}function Hh(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(io.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function ba(e,t){Os._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Hh(e.strm)}function Yr(e,t){e.pending_buf[e.pending++]=t}function I_(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function yst(e,t,r,i){var n=e.avail_in;return n>i&&(n=i),n===0?0:(e.avail_in-=n,io.arraySet(t,e.input,e.next_in,n,r),e.state.wrap===1?e.adler=ope(e.adler,t,n,r):e.state.wrap===2&&(e.adler=Nh(e.adler,t,n,r)),e.next_in+=n,e.total_in+=n,n)}function cpe(e,t){var r=e.max_chain_length,i=e.strstart,n,a,o=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-xu?e.strstart-(e.w_size-xu):0,l=e.window,c=e.w_mask,f=e.prev,h=e.strstart+Uh,d=l[i+o-1],p=l[i+o];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(n=t,!(l[n+o]!==p||l[n+o-1]!==d||l[n]!==l[i]||l[++n]!==l[i+1])){i+=2,n++;do;while(l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&i<h);if(a=Uh-(h-i),i=h-Uh,a>o){if(e.match_start=t,o=a,a>=s)break;d=l[i+o-1],p=l[i+o]}}while((t=f[t&c])>u&&--r!=0);return o<=e.lookahead?o:e.lookahead}function Ip(e){var t=e.w_size,r,i,n,a,o;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-xu)){io.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,i=e.hash_size,r=i;do n=e.head[--r],e.head[r]=n>=t?n-t:0;while(--i);i=t,r=i;do n=e.prev[--r],e.prev[r]=n>=t?n-t:0;while(--i);a+=t}if(e.strm.avail_in===0)break;if(i=yst(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=i,e.lookahead+e.insert>=Or)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+Or-1])&e.hash_mask,e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<Or)););}while(e.lookahead<xu&&e.strm.avail_in!==0)}function bst(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Ip(e),e.lookahead===0&&t===kp)return zn;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((e.strstart===0||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,ba(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-xu&&(ba(e,!1),e.strm.avail_out===0))return zn}return e.insert=0,t===qh?(ba(e,!0),e.strm.avail_out===0?Cp:D0):(e.strstart>e.block_start&&(ba(e,!1),e.strm.avail_out===0),zn)}function O4(e,t){for(var r,i;;){if(e.lookahead<xu){if(Ip(e),e.lookahead<xu&&t===kp)return zn;if(e.lookahead===0)break}if(r=0,e.lookahead>=Or&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Or-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-xu&&(e.match_length=cpe(e,r)),e.match_length>=Or)if(i=Os._tr_tally(e,e.strstart-e.match_start,e.match_length-Or),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Or){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Or-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!=0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else i=Os._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(ba(e,!1),e.strm.avail_out===0))return zn}return e.insert=e.strstart<Or-1?e.strstart:Or-1,t===qh?(ba(e,!0),e.strm.avail_out===0?Cp:D0):e.last_lit&&(ba(e,!1),e.strm.avail_out===0)?zn:C_}function F0(e,t){for(var r,i,n;;){if(e.lookahead<xu){if(Ip(e),e.lookahead<xu&&t===kp)return zn;if(e.lookahead===0)break}if(r=0,e.lookahead>=Or&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Or-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=Or-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-xu&&(e.match_length=cpe(e,r),e.match_length<=5&&(e.strategy===rst||e.match_length===Or&&e.strstart-e.match_start>4096)&&(e.match_length=Or-1)),e.prev_length>=Or&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-Or,i=Os._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-Or),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=n&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Or-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!=0);if(e.match_available=0,e.match_length=Or-1,e.strstart++,i&&(ba(e,!1),e.strm.avail_out===0))return zn}else if(e.match_available){if(i=Os._tr_tally(e,0,e.window[e.strstart-1]),i&&ba(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return zn}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=Os._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<Or-1?e.strstart:Or-1,t===qh?(ba(e,!0),e.strm.avail_out===0?Cp:D0):e.last_lit&&(ba(e,!1),e.strm.avail_out===0)?zn:C_}function _st(e,t){for(var r,i,n,a,o=e.window;;){if(e.lookahead<=Uh){if(Ip(e),e.lookahead<=Uh&&t===kp)return zn;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Or&&e.strstart>0&&(n=e.strstart-1,i=o[n],i===o[++n]&&i===o[++n]&&i===o[++n])){a=e.strstart+Uh;do;while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&n<a);e.match_length=Uh-(a-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Or?(r=Os._tr_tally(e,1,e.match_length-Or),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Os._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(ba(e,!1),e.strm.avail_out===0))return zn}return e.insert=0,t===qh?(ba(e,!0),e.strm.avail_out===0?Cp:D0):e.last_lit&&(ba(e,!1),e.strm.avail_out===0)?zn:C_}function xst(e,t){for(var r;;){if(e.lookahead===0&&(Ip(e),e.lookahead===0)){if(t===kp)return zn;break}if(e.match_length=0,r=Os._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(ba(e,!1),e.strm.avail_out===0))return zn}return e.insert=0,t===qh?(ba(e,!0),e.strm.avail_out===0?Cp:D0):e.last_lit&&(ba(e,!1),e.strm.avail_out===0)?zn:C_}function Tl(e,t,r,i,n){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=i,this.func=n}var j0;j0=[new Tl(0,0,0,0,bst),new Tl(4,4,8,4,O4),new Tl(4,5,16,8,O4),new Tl(4,6,32,32,O4),new Tl(4,4,16,16,F0),new Tl(8,16,32,32,F0),new Tl(8,16,128,128,F0),new Tl(8,32,128,256,F0),new Tl(32,128,258,1024,F0),new Tl(32,258,258,4096,F0)];function wst(e){e.window_size=2*e.w_size,zh(e.head),e.max_lazy_match=j0[e.level].max_lazy,e.good_match=j0[e.level].good_length,e.nice_match=j0[e.level].nice_length,e.max_chain_length=j0[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Or-1,e.match_available=0,e.ins_h=0}function Est(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=lk,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new io.Buf16(pst*2),this.dyn_dtree=new io.Buf16((2*hst+1)*2),this.bl_tree=new io.Buf16((2*dst+1)*2),zh(this.dyn_ltree),zh(this.dyn_dtree),zh(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new io.Buf16(mst+1),this.heap=new io.Buf16(2*C4+1),zh(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new io.Buf16(2*C4+1),zh(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function fpe(e){var t;return!e||!e.state?Gh(e,Ps):(e.total_in=e.total_out=0,e.data_type=ost,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?ck:Rp,e.adler=t.wrap===2?0:1,t.last_flush=kp,Os._tr_init(t),Al)}function hpe(e){var t=fpe(e);return t===Al&&wst(e.state),t}function Sst(e,t){return!e||!e.state||e.state.wrap!==2?Ps:(e.state.gzhead=t,Al)}function dpe(e,t,r,i,n,a){if(!e)return Ps;var o=1;if(t===tst&&(t=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),n<1||n>sst||r!==lk||i<8||i>15||t<0||t>9||a<0||a>nst)return Gh(e,Ps);i===8&&(i=9);var s=new Est;return e.state=s,s.strm=e,s.wrap=o,s.gzhead=null,s.w_bits=i,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=n+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+Or-1)/Or),s.window=new io.Buf8(s.w_size*2),s.head=new io.Buf16(s.hash_size),s.prev=new io.Buf16(s.w_size),s.lit_bufsize=1<<n+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new io.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=(1+2)*s.lit_bufsize,s.level=t,s.strategy=a,s.method=r,hpe(e)}function Ast(e,t){return dpe(e,t,lk,ust,lst,ast)}function Tst(e,t){var r,i,n,a;if(!e||!e.state||t>spe||t<0)return e?Gh(e,Ps):Ps;if(i=e.state,!e.output||!e.input&&e.avail_in!==0||i.status===R_&&t!==qh)return Gh(e,e.avail_out===0?R4:Ps);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===ck)if(i.wrap===2)e.adler=0,Yr(i,31),Yr(i,139),Yr(i,8),i.gzhead?(Yr(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Yr(i,i.gzhead.time&255),Yr(i,i.gzhead.time>>8&255),Yr(i,i.gzhead.time>>16&255),Yr(i,i.gzhead.time>>24&255),Yr(i,i.level===9?2:i.strategy>=uk||i.level<2?4:0),Yr(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(Yr(i,i.gzhead.extra.length&255),Yr(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=Nh(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=I4):(Yr(i,0),Yr(i,0),Yr(i,0),Yr(i,0),Yr(i,0),Yr(i,i.level===9?2:i.strategy>=uk||i.level<2?4:0),Yr(i,vst),i.status=Rp);else{var o=lk+(i.w_bits-8<<4)<<8,s=-1;i.strategy>=uk||i.level<2?s=0:i.level<6?s=1:i.level===6?s=2:s=3,o|=s<<6,i.strstart!==0&&(o|=gst),o+=31-o%31,i.status=Rp,I_(i,o),i.strstart!==0&&(I_(i,e.adler>>>16),I_(i,e.adler&65535)),e.adler=1}if(i.status===I4)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Nh(e.adler,i.pending_buf,i.pending-n,n)),Hh(e),n=i.pending,i.pending===i.pending_buf_size));)Yr(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=Nh(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=fk)}else i.status=fk;if(i.status===fk)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Nh(e.adler,i.pending_buf,i.pending-n,n)),Hh(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}i.gzindex<i.gzhead.name.length?a=i.gzhead.name.charCodeAt(i.gzindex++)&255:a=0,Yr(i,a)}while(a!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=Nh(e.adler,i.pending_buf,i.pending-n,n)),a===0&&(i.gzindex=0,i.status=hk)}else i.status=hk;if(i.status===hk)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Nh(e.adler,i.pending_buf,i.pending-n,n)),Hh(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}i.gzindex<i.gzhead.comment.length?a=i.gzhead.comment.charCodeAt(i.gzindex++)&255:a=0,Yr(i,a)}while(a!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=Nh(e.adler,i.pending_buf,i.pending-n,n)),a===0&&(i.status=dk)}else i.status=dk;if(i.status===dk&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Hh(e),i.pending+2<=i.pending_buf_size&&(Yr(i,e.adler&255),Yr(i,e.adler>>8&255),e.adler=0,i.status=Rp)):i.status=Rp),i.pending!==0){if(Hh(e),e.avail_out===0)return i.last_flush=-1,Al}else if(e.avail_in===0&&lpe(t)<=lpe(r)&&t!==qh)return Gh(e,R4);if(i.status===R_&&e.avail_in!==0)return Gh(e,R4);if(e.avail_in!==0||i.lookahead!==0||t!==kp&&i.status!==R_){var u=i.strategy===uk?xst(i,t):i.strategy===ist?_st(i,t):j0[i.level].func(i,t);if((u===Cp||u===D0)&&(i.status=R_),u===zn||u===Cp)return e.avail_out===0&&(i.last_flush=-1),Al;if(u===C_&&(t===Qot?Os._tr_align(i):t!==spe&&(Os._tr_stored_block(i,0,0,!1),t===Zot&&(zh(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),Hh(e),e.avail_out===0))return i.last_flush=-1,Al}return t!==qh?Al:i.wrap<=0?upe:(i.wrap===2?(Yr(i,e.adler&255),Yr(i,e.adler>>8&255),Yr(i,e.adler>>16&255),Yr(i,e.adler>>24&255),Yr(i,e.total_in&255),Yr(i,e.total_in>>8&255),Yr(i,e.total_in>>16&255),Yr(i,e.total_in>>24&255)):(I_(i,e.adler>>>16),I_(i,e.adler&65535)),Hh(e),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?Al:upe)}function kst(e){var t;return!e||!e.state?Ps:(t=e.state.status,t!==ck&&t!==I4&&t!==fk&&t!==hk&&t!==dk&&t!==Rp&&t!==R_?Gh(e,Ps):(e.state=null,t===Rp?Gh(e,est):Al))}function Rst(e,t){var r=t.length,i,n,a,o,s,u,l,c;if(!e||!e.state||(i=e.state,o=i.wrap,o===2||o===1&&i.status!==ck||i.lookahead))return Ps;for(o===1&&(e.adler=ope(e.adler,t,r,0)),i.wrap=0,r>=i.w_size&&(o===0&&(zh(i.head),i.strstart=0,i.block_start=0,i.insert=0),c=new io.Buf8(i.w_size),io.arraySet(c,t,r-i.w_size,i.w_size,0),t=c,r=i.w_size),s=e.avail_in,u=e.next_in,l=e.input,e.avail_in=r,e.next_in=0,e.input=t,Ip(i);i.lookahead>=Or;){n=i.strstart,a=i.lookahead-(Or-1);do i.ins_h=(i.ins_h<<i.hash_shift^i.window[n+Or-1])&i.hash_mask,i.prev[n&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=n,n++;while(--a);i.strstart=n,i.lookahead=Or-1,Ip(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=Or-1,i.match_available=0,e.next_in=u,e.input=l,e.avail_in=s,i.wrap=o,Al}kl.deflateInit=Ast;kl.deflateInit2=dpe;kl.deflateReset=hpe;kl.deflateResetKeep=fpe;kl.deflateSetHeader=Sst;kl.deflate=Tst;kl.deflateEnd=kst;kl.deflateSetDictionary=Rst;kl.deflateInfo="pako deflate (from Nodeca project)"});var P4=T(L0=>{"use strict";var pk=Gc(),mpe=!0,gpe=!0;try{String.fromCharCode.apply(null,[0])}catch{mpe=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{gpe=!1}var O_=new pk.Buf8(256);for(Hc=0;Hc<256;Hc++)O_[Hc]=Hc>=252?6:Hc>=248?5:Hc>=240?4:Hc>=224?3:Hc>=192?2:1;var Hc;O_[254]=O_[254]=1;L0.string2buf=function(e){var t,r,i,n,a,o=e.length,s=0;for(n=0;n<o;n++)r=e.charCodeAt(n),(r&64512)==55296&&n+1<o&&(i=e.charCodeAt(n+1),(i&64512)==56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new pk.Buf8(s),a=0,n=0;a<s;n++)r=e.charCodeAt(n),(r&64512)==55296&&n+1<o&&(i=e.charCodeAt(n+1),(i&64512)==56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|r&63):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|r&63):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|r&63);return t};function vpe(e,t){if(t<65534&&(e.subarray&&gpe||!e.subarray&&mpe))return String.fromCharCode.apply(null,pk.shrinkBuf(e,t));for(var r="",i=0;i<t;i++)r+=String.fromCharCode(e[i]);return r}L0.buf2binstring=function(e){return vpe(e,e.length)};L0.binstring2buf=function(e){for(var t=new pk.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t};L0.buf2string=function(e,t){var r,i,n,a,o=t||e.length,s=new Array(o*2);for(i=0,r=0;r<o;){if(n=e[r++],n<128){s[i++]=n;continue}if(a=O_[n],a>4){s[i++]=65533,r+=a-1;continue}for(n&=a===2?31:a===3?15:7;a>1&&r<o;)n=n<<6|e[r++]&63,a--;if(a>1){s[i++]=65533;continue}n<65536?s[i++]=n:(n-=65536,s[i++]=55296|n>>10&1023,s[i++]=56320|n&1023)}return vpe(s,i)};L0.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)==128;)r--;return r<0||r===0?t:r+O_[e[r]]>t?r:t}});var B4=T((lBt,ype)=>{"use strict";function Cst(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}ype.exports=Cst});var wpe=T(M_=>{"use strict";var P_=ppe(),B_=Gc(),M4=P4(),D4=sk(),Ist=B4(),bpe=Object.prototype.toString,Ost=0,F4=4,N0=0,_pe=1,xpe=2,Pst=-1,Bst=0,Mst=8;function Op(e){if(!(this instanceof Op))return new Op(e);this.options=B_.assign({level:Pst,method:Mst,chunkSize:16384,windowBits:15,memLevel:8,strategy:Bst,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ist,this.strm.avail_out=0;var r=P_.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==N0)throw new Error(D4[r]);if(t.header&&P_.deflateSetHeader(this.strm,t.header),t.dictionary){var i;if(typeof t.dictionary=="string"?i=M4.string2buf(t.dictionary):bpe.call(t.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(t.dictionary):i=t.dictionary,r=P_.deflateSetDictionary(this.strm,i),r!==N0)throw new Error(D4[r]);this._dict_set=!0}}Op.prototype.push=function(e,t){var r=this.strm,i=this.options.chunkSize,n,a;if(this.ended)return!1;a=t===~~t?t:t===!0?F4:Ost,typeof e=="string"?r.input=M4.string2buf(e):bpe.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new B_.Buf8(i),r.next_out=0,r.avail_out=i),n=P_.deflate(r,a),n!==_pe&&n!==N0)return this.onEnd(n),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(a===F4||a===xpe))&&(this.options.to==="string"?this.onData(M4.buf2binstring(B_.shrinkBuf(r.output,r.next_out))):this.onData(B_.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&n!==_pe);return a===F4?(n=P_.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===N0):(a===xpe&&(this.onEnd(N0),r.avail_out=0),!0)};Op.prototype.onData=function(e){this.chunks.push(e)};Op.prototype.onEnd=function(e){e===N0&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=B_.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function j4(e,t){var r=new Op(t);if(r.push(e,!0),r.err)throw r.msg||D4[r.err];return r.result}function Dst(e,t){return t=t||{},t.raw=!0,j4(e,t)}function Fst(e,t){return t=t||{},t.gzip=!0,j4(e,t)}M_.Deflate=Op;M_.deflate=j4;M_.deflateRaw=Dst;M_.gzip=Fst});var Spe=T((fBt,Epe)=>{"use strict";var mk=30,jst=12;Epe.exports=function(t,r){var i,n,a,o,s,u,l,c,f,h,d,p,y,g,b,E,S,k,R,M,I,L,B,V,N;i=t.state,n=t.next_in,V=t.input,a=n+(t.avail_in-5),o=t.next_out,N=t.output,s=o-(r-t.avail_out),u=o+(t.avail_out-257),l=i.dmax,c=i.wsize,f=i.whave,h=i.wnext,d=i.window,p=i.hold,y=i.bits,g=i.lencode,b=i.distcode,E=(1<<i.lenbits)-1,S=(1<<i.distbits)-1;e:do{y<15&&(p+=V[n++]<<y,y+=8,p+=V[n++]<<y,y+=8),k=g[p&E];t:for(;;){if(R=k>>>24,p>>>=R,y-=R,R=k>>>16&255,R===0)N[o++]=k&65535;else if(R&16){M=k&65535,R&=15,R&&(y<R&&(p+=V[n++]<<y,y+=8),M+=p&(1<<R)-1,p>>>=R,y-=R),y<15&&(p+=V[n++]<<y,y+=8,p+=V[n++]<<y,y+=8),k=b[p&S];r:for(;;){if(R=k>>>24,p>>>=R,y-=R,R=k>>>16&255,R&16){if(I=k&65535,R&=15,y<R&&(p+=V[n++]<<y,y+=8,y<R&&(p+=V[n++]<<y,y+=8)),I+=p&(1<<R)-1,I>l){t.msg="invalid distance too far back",i.mode=mk;break e}if(p>>>=R,y-=R,R=o-s,I>R){if(R=I-R,R>f&&i.sane){t.msg="invalid distance too far back",i.mode=mk;break e}if(L=0,B=d,h===0){if(L+=c-R,R<M){M-=R;do N[o++]=d[L++];while(--R);L=o-I,B=N}}else if(h<R){if(L+=c+h-R,R-=h,R<M){M-=R;do N[o++]=d[L++];while(--R);if(L=0,h<M){R=h,M-=R;do N[o++]=d[L++];while(--R);L=o-I,B=N}}}else if(L+=h-R,R<M){M-=R;do N[o++]=d[L++];while(--R);L=o-I,B=N}for(;M>2;)N[o++]=B[L++],N[o++]=B[L++],N[o++]=B[L++],M-=3;M&&(N[o++]=B[L++],M>1&&(N[o++]=B[L++]))}else{L=o-I;do N[o++]=N[L++],N[o++]=N[L++],N[o++]=N[L++],M-=3;while(M>2);M&&(N[o++]=N[L++],M>1&&(N[o++]=N[L++]))}}else if((R&64)==0){k=b[(k&65535)+(p&(1<<R)-1)];continue r}else{t.msg="invalid distance code",i.mode=mk;break e}break}}else if((R&64)==0){k=g[(k&65535)+(p&(1<<R)-1)];continue t}else if(R&32){i.mode=jst;break e}else{t.msg="invalid literal/length code",i.mode=mk;break e}break}}while(n<a&&o<u);M=y>>3,n-=M,y-=M<<3,p&=(1<<y)-1,t.next_in=n,t.next_out=o,t.avail_in=n<a?5+(a-n):5-(n-a),t.avail_out=o<u?257+(u-o):257-(o-u),i.hold=p,i.bits=y}});var Ope=T((hBt,Ipe)=>{"use strict";var Ape=Gc(),q0=15,Tpe=852,kpe=592,Rpe=0,L4=1,Cpe=2,Lst=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Nst=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],qst=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Ust=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];Ipe.exports=function(t,r,i,n,a,o,s,u){var l=u.bits,c=0,f=0,h=0,d=0,p=0,y=0,g=0,b=0,E=0,S=0,k,R,M,I,L,B=null,V=0,N,z=new Ape.Buf16(q0+1),j=new Ape.Buf16(q0+1),U=null,$=0,Z,te,ne;for(c=0;c<=q0;c++)z[c]=0;for(f=0;f<n;f++)z[r[i+f]]++;for(p=l,d=q0;d>=1&&z[d]===0;d--);if(p>d&&(p=d),d===0)return a[o++]=1<<24|64<<16|0,a[o++]=1<<24|64<<16|0,u.bits=1,0;for(h=1;h<d&&z[h]===0;h++);for(p<h&&(p=h),b=1,c=1;c<=q0;c++)if(b<<=1,b-=z[c],b<0)return-1;if(b>0&&(t===Rpe||d!==1))return-1;for(j[1]=0,c=1;c<q0;c++)j[c+1]=j[c]+z[c];for(f=0;f<n;f++)r[i+f]!==0&&(s[j[r[i+f]]++]=f);if(t===Rpe?(B=U=s,N=19):t===L4?(B=Lst,V-=257,U=Nst,$-=257,N=256):(B=qst,U=Ust,N=-1),S=0,f=0,c=h,L=o,y=p,g=0,M=-1,E=1<<p,I=E-1,t===L4&&E>Tpe||t===Cpe&&E>kpe)return 1;for(;;){Z=c-g,s[f]<N?(te=0,ne=s[f]):s[f]>N?(te=U[$+s[f]],ne=B[V+s[f]]):(te=32+64,ne=0),k=1<<c-g,R=1<<y,h=R;do R-=k,a[L+(S>>g)+R]=Z<<24|te<<16|ne|0;while(R!==0);for(k=1<<c-1;S&k;)k>>=1;if(k!==0?(S&=k-1,S+=k):S=0,f++,--z[c]==0){if(c===d)break;c=r[i+s[f]]}if(c>p&&(S&I)!==M){for(g===0&&(g=p),L+=h,y=c-g,b=1<<y;y+g<d&&(b-=z[y+g],!(b<=0));)y++,b<<=1;if(E+=1<<y,t===L4&&E>Tpe||t===Cpe&&E>kpe)return 1;M=S&I,a[M]=p<<24|y<<16|L-o|0}}return S!==0&&(a[L+S]=c-g<<24|64<<16|0),u.bits=p,0}});var hme=T(wu=>{"use strict";var Ho=Gc(),N4=T4(),Rl=k4(),Gst=Spe(),D_=Ope(),zst=0,Ppe=1,Bpe=2,Mpe=4,Hst=5,gk=6,Pp=0,Vst=1,Wst=2,Bs=-2,Dpe=-3,q4=-4,Kst=-5,Fpe=8,jpe=1,Lpe=2,Npe=3,qpe=4,Upe=5,Gpe=6,zpe=7,Hpe=8,Vpe=9,Wpe=10,vk=11,Vc=12,U4=13,Kpe=14,G4=15,Ype=16,$pe=17,Xpe=18,Jpe=19,yk=20,bk=21,Qpe=22,Zpe=23,eme=24,tme=25,rme=26,z4=27,ime=28,nme=29,Ri=30,H4=31,Yst=32,$st=852,Xst=592,Jst=15,Qst=Jst;function ame(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function Zst(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Ho.Buf16(320),this.work=new Ho.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ome(e){var t;return!e||!e.state?Bs:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=jpe,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Ho.Buf32($st),t.distcode=t.distdyn=new Ho.Buf32(Xst),t.sane=1,t.back=-1,Pp)}function sme(e){var t;return!e||!e.state?Bs:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,ome(e))}function ume(e,t){var r,i;return!e||!e.state||(i=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Bs:(i.window!==null&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,sme(e))}function lme(e,t){var r,i;return e?(i=new Zst,e.state=i,i.window=null,r=ume(e,t),r!==Pp&&(e.state=null),r):Bs}function eut(e){return lme(e,Qst)}var cme=!0,V4,W4;function tut(e){if(cme){var t;for(V4=new Ho.Buf32(512),W4=new Ho.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(D_(Ppe,e.lens,0,288,V4,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;D_(Bpe,e.lens,0,32,W4,0,e.work,{bits:5}),cme=!1}e.lencode=V4,e.lenbits=9,e.distcode=W4,e.distbits=5}function fme(e,t,r,i){var n,a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Ho.Buf8(a.wsize)),i>=a.wsize?(Ho.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(n=a.wsize-a.wnext,n>i&&(n=i),Ho.arraySet(a.window,t,r-i,n,a.wnext),i-=n,i?(Ho.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=n))),0}function rut(e,t){var r,i,n,a,o,s,u,l,c,f,h,d,p,y,g=0,b,E,S,k,R,M,I,L,B=new Ho.Buf8(4),V,N,z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Bs;r=e.state,r.mode===Vc&&(r.mode=U4),o=e.next_out,n=e.output,u=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,l=r.hold,c=r.bits,f=s,h=u,L=Pp;e:for(;;)switch(r.mode){case jpe:if(r.wrap===0){r.mode=U4;break}for(;c<16;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}if(r.wrap&2&&l===35615){r.check=0,B[0]=l&255,B[1]=l>>>8&255,r.check=Rl(r.check,B,2,0),l=0,c=0,r.mode=Lpe;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=Ri;break}if((l&15)!==Fpe){e.msg="unknown compression method",r.mode=Ri;break}if(l>>>=4,c-=4,I=(l&15)+8,r.wbits===0)r.wbits=I;else if(I>r.wbits){e.msg="invalid window size",r.mode=Ri;break}r.dmax=1<<I,e.adler=r.check=1,r.mode=l&512?Wpe:Vc,l=0,c=0;break;case Lpe:for(;c<16;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}if(r.flags=l,(r.flags&255)!==Fpe){e.msg="unknown compression method",r.mode=Ri;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=Ri;break}r.head&&(r.head.text=l>>8&1),r.flags&512&&(B[0]=l&255,B[1]=l>>>8&255,r.check=Rl(r.check,B,2,0)),l=0,c=0,r.mode=Npe;case Npe:for(;c<32;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}r.head&&(r.head.time=l),r.flags&512&&(B[0]=l&255,B[1]=l>>>8&255,B[2]=l>>>16&255,B[3]=l>>>24&255,r.check=Rl(r.check,B,4,0)),l=0,c=0,r.mode=qpe;case qpe:for(;c<16;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}r.head&&(r.head.xflags=l&255,r.head.os=l>>8),r.flags&512&&(B[0]=l&255,B[1]=l>>>8&255,r.check=Rl(r.check,B,2,0)),l=0,c=0,r.mode=Upe;case Upe:if(r.flags&1024){for(;c<16;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}r.length=l,r.head&&(r.head.extra_len=l),r.flags&512&&(B[0]=l&255,B[1]=l>>>8&255,r.check=Rl(r.check,B,2,0)),l=0,c=0}else r.head&&(r.head.extra=null);r.mode=Gpe;case Gpe:if(r.flags&1024&&(d=r.length,d>s&&(d=s),d&&(r.head&&(I=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Ho.arraySet(r.head.extra,i,a,d,I)),r.flags&512&&(r.check=Rl(r.check,i,d,a)),s-=d,a+=d,r.length-=d),r.length))break e;r.length=0,r.mode=zpe;case zpe:if(r.flags&2048){if(s===0)break e;d=0;do I=i[a+d++],r.head&&I&&r.length<65536&&(r.head.name+=String.fromCharCode(I));while(I&&d<s);if(r.flags&512&&(r.check=Rl(r.check,i,d,a)),s-=d,a+=d,I)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Hpe;case Hpe:if(r.flags&4096){if(s===0)break e;d=0;do I=i[a+d++],r.head&&I&&r.length<65536&&(r.head.comment+=String.fromCharCode(I));while(I&&d<s);if(r.flags&512&&(r.check=Rl(r.check,i,d,a)),s-=d,a+=d,I)break e}else r.head&&(r.head.comment=null);r.mode=Vpe;case Vpe:if(r.flags&512){for(;c<16;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}if(l!==(r.check&65535)){e.msg="header crc mismatch",r.mode=Ri;break}l=0,c=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Vc;break;case Wpe:for(;c<32;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}e.adler=r.check=ame(l),l=0,c=0,r.mode=vk;case vk:if(r.havedict===0)return e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=c,Wst;e.adler=r.check=1,r.mode=Vc;case Vc:if(t===Hst||t===gk)break e;case U4:if(r.last){l>>>=c&7,c-=c&7,r.mode=z4;break}for(;c<3;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}switch(r.last=l&1,l>>>=1,c-=1,l&3){case 0:r.mode=Kpe;break;case 1:if(tut(r),r.mode=yk,t===gk){l>>>=2,c-=2;break e}break;case 2:r.mode=$pe;break;case 3:e.msg="invalid block type",r.mode=Ri}l>>>=2,c-=2;break;case Kpe:for(l>>>=c&7,c-=c&7;c<32;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}if((l&65535)!=(l>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Ri;break}if(r.length=l&65535,l=0,c=0,r.mode=G4,t===gk)break e;case G4:r.mode=Ype;case Ype:if(d=r.length,d){if(d>s&&(d=s),d>u&&(d=u),d===0)break e;Ho.arraySet(n,i,a,d,o),s-=d,a+=d,u-=d,o+=d,r.length-=d;break}r.mode=Vc;break;case $pe:for(;c<14;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}if(r.nlen=(l&31)+257,l>>>=5,c-=5,r.ndist=(l&31)+1,l>>>=5,c-=5,r.ncode=(l&15)+4,l>>>=4,c-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Ri;break}r.have=0,r.mode=Xpe;case Xpe:for(;r.have<r.ncode;){for(;c<3;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}r.lens[z[r.have++]]=l&7,l>>>=3,c-=3}for(;r.have<19;)r.lens[z[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,V={bits:r.lenbits},L=D_(zst,r.lens,0,19,r.lencode,0,r.work,V),r.lenbits=V.bits,L){e.msg="invalid code lengths set",r.mode=Ri;break}r.have=0,r.mode=Jpe;case Jpe:for(;r.have<r.nlen+r.ndist;){for(;g=r.lencode[l&(1<<r.lenbits)-1],b=g>>>24,E=g>>>16&255,S=g&65535,!(b<=c);){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}if(S<16)l>>>=b,c-=b,r.lens[r.have++]=S;else{if(S===16){for(N=b+2;c<N;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}if(l>>>=b,c-=b,r.have===0){e.msg="invalid bit length repeat",r.mode=Ri;break}I=r.lens[r.have-1],d=3+(l&3),l>>>=2,c-=2}else if(S===17){for(N=b+3;c<N;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}l>>>=b,c-=b,I=0,d=3+(l&7),l>>>=3,c-=3}else{for(N=b+7;c<N;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}l>>>=b,c-=b,I=0,d=11+(l&127),l>>>=7,c-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Ri;break}for(;d--;)r.lens[r.have++]=I}}if(r.mode===Ri)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=Ri;break}if(r.lenbits=9,V={bits:r.lenbits},L=D_(Ppe,r.lens,0,r.nlen,r.lencode,0,r.work,V),r.lenbits=V.bits,L){e.msg="invalid literal/lengths set",r.mode=Ri;break}if(r.distbits=6,r.distcode=r.distdyn,V={bits:r.distbits},L=D_(Bpe,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,V),r.distbits=V.bits,L){e.msg="invalid distances set",r.mode=Ri;break}if(r.mode=yk,t===gk)break e;case yk:r.mode=bk;case bk:if(s>=6&&u>=258){e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=c,Gst(e,h),o=e.next_out,n=e.output,u=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,l=r.hold,c=r.bits,r.mode===Vc&&(r.back=-1);break}for(r.back=0;g=r.lencode[l&(1<<r.lenbits)-1],b=g>>>24,E=g>>>16&255,S=g&65535,!(b<=c);){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}if(E&&(E&240)==0){for(k=b,R=E,M=S;g=r.lencode[M+((l&(1<<k+R)-1)>>k)],b=g>>>24,E=g>>>16&255,S=g&65535,!(k+b<=c);){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}l>>>=k,c-=k,r.back+=k}if(l>>>=b,c-=b,r.back+=b,r.length=S,E===0){r.mode=rme;break}if(E&32){r.back=-1,r.mode=Vc;break}if(E&64){e.msg="invalid literal/length code",r.mode=Ri;break}r.extra=E&15,r.mode=Qpe;case Qpe:if(r.extra){for(N=r.extra;c<N;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}r.length+=l&(1<<r.extra)-1,l>>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Zpe;case Zpe:for(;g=r.distcode[l&(1<<r.distbits)-1],b=g>>>24,E=g>>>16&255,S=g&65535,!(b<=c);){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}if((E&240)==0){for(k=b,R=E,M=S;g=r.distcode[M+((l&(1<<k+R)-1)>>k)],b=g>>>24,E=g>>>16&255,S=g&65535,!(k+b<=c);){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}l>>>=k,c-=k,r.back+=k}if(l>>>=b,c-=b,r.back+=b,E&64){e.msg="invalid distance code",r.mode=Ri;break}r.offset=S,r.extra=E&15,r.mode=eme;case eme:if(r.extra){for(N=r.extra;c<N;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}r.offset+=l&(1<<r.extra)-1,l>>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Ri;break}r.mode=tme;case tme:if(u===0)break e;if(d=h-u,r.offset>d){if(d=r.offset-d,d>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Ri;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),y=r.window}else y=n,p=o-r.offset,d=r.length;d>u&&(d=u),u-=d,r.length-=d;do n[o++]=y[p++];while(--d);r.length===0&&(r.mode=bk);break;case rme:if(u===0)break e;n[o++]=r.length,u--,r.mode=bk;break;case z4:if(r.wrap){for(;c<32;){if(s===0)break e;s--,l|=i[a++]<<c,c+=8}if(h-=u,e.total_out+=h,r.total+=h,h&&(e.adler=r.check=r.flags?Rl(r.check,n,h,o-h):N4(r.check,n,h,o-h)),h=u,(r.flags?l:ame(l))!==r.check){e.msg="incorrect data check",r.mode=Ri;break}l=0,c=0}r.mode=ime;case ime:if(r.wrap&&r.flags){for(;c<32;){if(s===0)break e;s--,l+=i[a++]<<c,c+=8}if(l!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=Ri;break}l=0,c=0}r.mode=nme;case nme:L=Vst;break e;case Ri:L=Dpe;break e;case H4:return q4;case Yst:default:return Bs}return e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=c,(r.wsize||h!==e.avail_out&&r.mode<Ri&&(r.mode<z4||t!==Mpe))&&fme(e,e.output,e.next_out,h-e.avail_out)?(r.mode=H4,q4):(f-=e.avail_in,h-=e.avail_out,e.total_in+=f,e.total_out+=h,r.total+=h,r.wrap&&h&&(e.adler=r.check=r.flags?Rl(r.check,n,h,e.next_out-h):N4(r.check,n,h,e.next_out-h)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Vc?128:0)+(r.mode===yk||r.mode===G4?256:0),(f===0&&h===0||t===Mpe)&&L===Pp&&(L=Kst),L)}function iut(e){if(!e||!e.state)return Bs;var t=e.state;return t.window&&(t.window=null),e.state=null,Pp}function nut(e,t){var r;return!e||!e.state||(r=e.state,(r.wrap&2)==0)?Bs:(r.head=t,t.done=!1,Pp)}function aut(e,t){var r=t.length,i,n,a;return!e||!e.state||(i=e.state,i.wrap!==0&&i.mode!==vk)?Bs:i.mode===vk&&(n=1,n=N4(n,t,r,0),n!==i.check)?Dpe:(a=fme(e,t,r,r),a?(i.mode=H4,q4):(i.havedict=1,Pp))}wu.inflateReset=sme;wu.inflateReset2=ume;wu.inflateResetKeep=ome;wu.inflateInit=eut;wu.inflateInit2=lme;wu.inflate=rut;wu.inflateEnd=iut;wu.inflateGetHeader=nut;wu.inflateSetDictionary=aut;wu.inflateInfo="pako inflate (from Nodeca project)"});var K4=T((pBt,dme)=>{"use strict";dme.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var mme=T((mBt,pme)=>{"use strict";function out(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}pme.exports=out});var vme=T(j_=>{"use strict";var U0=hme(),F_=Gc(),_k=P4(),pn=K4(),Y4=sk(),sut=B4(),uut=mme(),gme=Object.prototype.toString;function Bp(e){if(!(this instanceof Bp))return new Bp(e);this.options=F_.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)==0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new sut,this.strm.avail_out=0;var r=U0.inflateInit2(this.strm,t.windowBits);if(r!==pn.Z_OK)throw new Error(Y4[r]);if(this.header=new uut,U0.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=_k.string2buf(t.dictionary):gme.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=U0.inflateSetDictionary(this.strm,t.dictionary),r!==pn.Z_OK)))throw new Error(Y4[r])}Bp.prototype.push=function(e,t){var r=this.strm,i=this.options.chunkSize,n=this.options.dictionary,a,o,s,u,l,c=!1;if(this.ended)return!1;o=t===~~t?t:t===!0?pn.Z_FINISH:pn.Z_NO_FLUSH,typeof e=="string"?r.input=_k.binstring2buf(e):gme.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new F_.Buf8(i),r.next_out=0,r.avail_out=i),a=U0.inflate(r,pn.Z_NO_FLUSH),a===pn.Z_NEED_DICT&&n&&(a=U0.inflateSetDictionary(this.strm,n)),a===pn.Z_BUF_ERROR&&c===!0&&(a=pn.Z_OK,c=!1),a!==pn.Z_STREAM_END&&a!==pn.Z_OK)return this.onEnd(a),this.ended=!0,!1;r.next_out&&(r.avail_out===0||a===pn.Z_STREAM_END||r.avail_in===0&&(o===pn.Z_FINISH||o===pn.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=_k.utf8border(r.output,r.next_out),u=r.next_out-s,l=_k.buf2string(r.output,s),r.next_out=u,r.avail_out=i-u,u&&F_.arraySet(r.output,r.output,s,u,0),this.onData(l)):this.onData(F_.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(c=!0)}while((r.avail_in>0||r.avail_out===0)&&a!==pn.Z_STREAM_END);return a===pn.Z_STREAM_END&&(o=pn.Z_FINISH),o===pn.Z_FINISH?(a=U0.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===pn.Z_OK):(o===pn.Z_SYNC_FLUSH&&(this.onEnd(pn.Z_OK),r.avail_out=0),!0)};Bp.prototype.onData=function(e){this.chunks.push(e)};Bp.prototype.onEnd=function(e){e===pn.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=F_.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function $4(e,t){var r=new Bp(t);if(r.push(e,!0),r.err)throw r.msg||Y4[r.err];return r.result}function lut(e,t){return t=t||{},t.raw=!0,$4(e,t)}j_.Inflate=Bp;j_.inflate=$4;j_.inflateRaw=lut;j_.ungzip=$4});var _me=T((vBt,bme)=>{"use strict";var cut=Gc().assign,fut=wpe(),hut=vme(),dut=K4(),yme={};cut(yme,fut,hut,dut);bme.exports=yme});var wme=T(wk=>{"use strict";var put=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Uint32Array!="undefined",mut=_me(),xme=qi(),xk=zo(),gut=put?"uint8array":"array";wk.magic="\b\0";function Mp(e,t){xk.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}xme.inherits(Mp,xk);Mp.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(xme.transformTo(gut,e.data),!1)};Mp.prototype.flush=function(){xk.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)};Mp.prototype.cleanUp=function(){xk.prototype.cleanUp.call(this),this._pako=null};Mp.prototype._createPako=function(){this._pako=new mut[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}};wk.compressWorker=function(e){return new Mp("Deflate",e)};wk.uncompressWorker=function(){return new Mp("Inflate",{})}});var J4=T(X4=>{"use strict";var Eme=zo();X4.STORE={magic:"\0\0",compressWorker:function(){return new Eme("STORE compression")},uncompressWorker:function(){return new Eme("STORE decompression")}};X4.DEFLATE=wme()});var Q4=T(Dp=>{"use strict";Dp.LOCAL_FILE_HEADER="PK";Dp.CENTRAL_FILE_HEADER="PK";Dp.CENTRAL_DIRECTORY_END="PK";Dp.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07";Dp.ZIP64_CENTRAL_DIRECTORY_END="PK";Dp.DATA_DESCRIPTOR="PK\x07\b"});var kme=T((xBt,Tme)=>{"use strict";var G0=qi(),z0=zo(),Z4=I0(),Sme=rk(),Ek=Q4(),Ai=function(e,t){var r="",i;for(i=0;i<t;i++)r+=String.fromCharCode(e&255),e=e>>>8;return r},vut=function(e,t){var r=e;return e||(r=t?16893:33204),(r&65535)<<16},yut=function(e){return(e||0)&63},Ame=function(e,t,r,i,n,a){var o=e.file,s=e.compression,u=a!==Z4.utf8encode,l=G0.transformTo("string",a(o.name)),c=G0.transformTo("string",Z4.utf8encode(o.name)),f=o.comment,h=G0.transformTo("string",a(f)),d=G0.transformTo("string",Z4.utf8encode(f)),p=c.length!==o.name.length,y=d.length!==f.length,g,b,E="",S="",k="",R=o.dir,M=o.date,I={crc32:0,compressedSize:0,uncompressedSize:0};(!t||r)&&(I.crc32=e.crc32,I.compressedSize=e.compressedSize,I.uncompressedSize=e.uncompressedSize);var L=0;t&&(L|=8),!u&&(p||y)&&(L|=2048);var B=0,V=0;R&&(B|=16),n==="UNIX"?(V=798,B|=vut(o.unixPermissions,R)):(V=20,B|=yut(o.dosPermissions,R)),g=M.getUTCHours(),g=g<<6,g=g|M.getUTCMinutes(),g=g<<5,g=g|M.getUTCSeconds()/2,b=M.getUTCFullYear()-1980,b=b<<4,b=b|M.getUTCMonth()+1,b=b<<5,b=b|M.getUTCDate(),p&&(S=Ai(1,1)+Ai(Sme(l),4)+c,E+="up"+Ai(S.length,2)+S),y&&(k=Ai(1,1)+Ai(Sme(h),4)+d,E+="uc"+Ai(k.length,2)+k);var N="";N+=`
117
117
  \0`,N+=Ai(L,2),N+=s.magic,N+=Ai(g,2),N+=Ai(b,2),N+=Ai(I.crc32,4),N+=Ai(I.compressedSize,4),N+=Ai(I.uncompressedSize,4),N+=Ai(l.length,2),N+=Ai(E.length,2);var z=Ek.LOCAL_FILE_HEADER+N+l+E,j=Ek.CENTRAL_FILE_HEADER+Ai(V,2)+N+Ai(h.length,2)+"\0\0\0\0"+Ai(B,4)+Ai(i,4)+l+E+h;return{fileRecord:z,dirRecord:j}},but=function(e,t,r,i,n){var a="",o=G0.transformTo("string",n(i));return a=Ek.CENTRAL_DIRECTORY_END+"\0\0\0\0"+Ai(e,2)+Ai(e,2)+Ai(t,4)+Ai(r,4)+Ai(o.length,2)+o,a},_ut=function(e){var t="";return t=Ek.DATA_DESCRIPTOR+Ai(e.crc32,4)+Ai(e.compressedSize,4)+Ai(e.uncompressedSize,4),t};function Eu(e,t,r,i){z0.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=i,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}G0.inherits(Eu,z0);Eu.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,z0.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-i-1))/r:100}}))};Eu.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=Ame(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0};Eu.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=Ame(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:_ut(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null};Eu.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,i=but(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})};Eu.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()};Eu.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(r){t.processChunk(r)}),e.on("end",function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on("error",function(r){t.error(r)}),this};Eu.prototype.resume=function(){if(!z0.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};Eu.prototype.error=function(e){var t=this._sources;if(!z0.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch{}return!0};Eu.prototype.lock=function(){z0.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()};Tme.exports=Eu});var Cme=T(Rme=>{"use strict";var xut=J4(),wut=kme(),Eut=function(e,t){var r=e||t,i=xut[r];if(!i)throw new Error(r+" is not a valid compression method !");return i};Rme.generateWorker=function(e,t,r){var i=new wut(t.streamFiles,r,t.platform,t.encodeFileName),n=0;try{e.forEach(function(a,o){n++;var s=Eut(o.options.compression,t.compression),u=o.options.compressionOptions||t.compressionOptions||{},l=o.dir,c=o.date;o._compressWorker(s,u).withStreamInfo("file",{name:a,dir:l,date:c,comment:o.comment||"",unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions}).pipe(i)}),i.entriesCount=n}catch(a){i.error(a)}return i}});var Ome=T((EBt,Ime)=>{"use strict";var Sut=qi(),Sk=zo();function L_(e,t){Sk.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}Sut.inherits(L_,Sk);L_.prototype._bindStream=function(e){var t=this;this._stream=e,e.pause(),e.on("data",function(r){t.push({data:r,meta:{percent:0}})}).on("error",function(r){t.isPaused?this.generatedError=r:t.error(r)}).on("end",function(){t.isPaused?t._upstreamEnded=!0:t.end()})};L_.prototype.pause=function(){return Sk.prototype.pause.call(this)?(this._stream.pause(),!0):!1};L_.prototype.resume=function(){return Sk.prototype.resume.call(this)?(this._upstreamEnded?this.end():this._stream.resume(),!0):!1};Ime.exports=L_});var Ume=T((SBt,qme)=>{"use strict";var Aut=I0(),N_=qi(),Pme=zo(),Tut=n4(),Bme=a4(),Mme=ik(),kut=Bde(),Rut=Cme(),Dme=p_(),Cut=Ome(),Fme=function(e,t,r){var i=N_.getTypeOf(t),n,a=N_.extend(r||{},Bme);a.date=a.date||new Date,a.compression!==null&&(a.compression=a.compression.toUpperCase()),typeof a.unixPermissions=="string"&&(a.unixPermissions=parseInt(a.unixPermissions,8)),a.unixPermissions&&a.unixPermissions&16384&&(a.dir=!0),a.dosPermissions&&a.dosPermissions&16&&(a.dir=!0),a.dir&&(e=jme(e)),a.createFolders&&(n=Iut(e))&&Lme.call(this,n,!0);var o=i==="string"&&a.binary===!1&&a.base64===!1;(!r||typeof r.binary=="undefined")&&(a.binary=!o);var s=t instanceof Mme&&t.uncompressedSize===0;(s||a.dir||!t||t.length===0)&&(a.base64=!1,a.binary=!0,t="",a.compression="STORE",i="string");var u=null;t instanceof Mme||t instanceof Pme?u=t:Dme.isNode&&Dme.isStream(t)?u=new Cut(e,t):u=N_.prepareContent(e,t,a.binary,a.optimizedBinaryString,a.base64);var l=new kut(e,u,a);this.files[e]=l},Iut=function(e){e.slice(-1)==="/"&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},jme=function(e){return e.slice(-1)!=="/"&&(e+="/"),e},Lme=function(e,t){return t=typeof t!="undefined"?t:Bme.createFolders,e=jme(e),this.files[e]||Fme.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function Nme(e){return Object.prototype.toString.call(e)==="[object RegExp]"}var Out={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,i;for(t in this.files)i=this.files[t],r=t.slice(this.root.length,t.length),r&&t.slice(0,this.root.length)===this.root&&e(r,i)},filter:function(e){var t=[];return this.forEach(function(r,i){e(r,i)&&t.push(i)}),t},file:function(e,t,r){if(arguments.length===1)if(Nme(e)){var i=e;return this.filter(function(a,o){return!o.dir&&i.test(a)})}else{var n=this.files[this.root+e];return n&&!n.dir?n:null}else e=this.root+e,Fme.call(this,e,t,r);return this},folder:function(e){if(!e)return this;if(Nme(e))return this.filter(function(n,a){return a.dir&&e.test(n)});var t=this.root+e,r=Lme.call(this,t),i=this.clone();return i.root=r.name,i},remove:function(e){e=this.root+e;var t=this.files[e];if(t||(e.slice(-1)!=="/"&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter(function(n,a){return a.name.slice(0,e.length)===e}),i=0;i<r.length;i++)delete this.files[r[i].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,r={};try{if(r=N_.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:Aut.utf8encode}),r.type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),r.type==="binarystring"&&(r.type="string"),!r.type)throw new Error("No output type specified.");N_.checkSupport(r.type),(r.platform==="darwin"||r.platform==="freebsd"||r.platform==="linux"||r.platform==="sunos")&&(r.platform="UNIX"),r.platform==="win32"&&(r.platform="DOS");var i=r.comment||this.comment||"";t=Rut.generateWorker(this,r,i)}catch(n){t=new Pme("error"),t.error(n)}return new Tut(t,r.type||"string",r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return e=e||{},e.type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};qme.exports=Out});var eL=T((ABt,zme)=>{"use strict";var Put=qi();function Gme(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}Gme.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t=0,r;for(this.checkOffset(e),r=this.index+e-1;r>=this.index;r--)t=(t<<8)+this.byteAt(r);return this.index+=e,t},readString:function(e){return Put.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC((e>>25&127)+1980,(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(e&31)<<1))}};zme.exports=Gme});var tL=T((TBt,Vme)=>{"use strict";var Hme=eL(),But=qi();function H0(e){Hme.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=e[t]&255}But.inherits(H0,Hme);H0.prototype.byteAt=function(e){return this.data[this.zero+e]};H0.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2),n=e.charCodeAt(3),a=this.length-4;a>=0;--a)if(this.data[a]===t&&this.data[a+1]===r&&this.data[a+2]===i&&this.data[a+3]===n)return a-this.zero;return-1};H0.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2),n=e.charCodeAt(3),a=this.readData(4);return t===a[0]&&r===a[1]&&i===a[2]&&n===a[3]};H0.prototype.readData=function(e){if(this.checkOffset(e),e===0)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};Vme.exports=H0});var Yme=T((kBt,Kme)=>{"use strict";var Wme=eL(),Mut=qi();function V0(e){Wme.call(this,e)}Mut.inherits(V0,Wme);V0.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)};V0.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero};V0.prototype.readAndCheckSignature=function(e){var t=this.readData(4);return e===t};V0.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};Kme.exports=V0});var iL=T((RBt,Xme)=>{"use strict";var $me=tL(),Dut=qi();function rL(e){$me.call(this,e)}Dut.inherits(rL,$me);rL.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};Xme.exports=rL});var Zme=T((CBt,Qme)=>{"use strict";var Jme=iL(),Fut=qi();function nL(e){Jme.call(this,e)}Fut.inherits(nL,Jme);nL.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};Qme.exports=nL});var aL=T((IBt,tge)=>{"use strict";var Ak=qi(),ege=qc(),jut=tL(),Lut=Yme(),Nut=Zme(),qut=iL();tge.exports=function(e){var t=Ak.getTypeOf(e);return Ak.checkSupport(t),t==="string"&&!ege.uint8array?new Lut(e):t==="nodebuffer"?new Nut(e):ege.uint8array?new qut(Ak.transformTo("uint8array",e)):new jut(Ak.transformTo("array",e))}});var age=T((OBt,nge)=>{"use strict";var oL=aL(),Vh=qi(),Uut=ik(),rge=rk(),Tk=I0(),kk=J4(),Gut=qc(),zut=0,Hut=3,Vut=function(e){for(var t in kk)if(!!Object.prototype.hasOwnProperty.call(kk,t)&&kk[t].magic===e)return kk[t];return null};function ige(e,t){this.options=e,this.loadOptions=t}ige.prototype={isEncrypted:function(){return(this.bitFlag&1)==1},useUTF8:function(){return(this.bitFlag&2048)==2048},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(t=Vut(this.compressionMethod),t===null)throw new Error("Corrupted zip : compression "+Vh.pretty(this.compressionMethod)+" unknown (inner file : "+Vh.transformTo("string",this.fileName)+")");this.decompressed=new Uut(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),e===zut&&(this.dosPermissions=this.externalFileAttributes&63),e===Hut&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(){if(!!this.extraFields[1]){var e=oL(this.extraFields[1].value);this.uncompressedSize===Vh.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===Vh.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===Vh.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===Vh.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t=e.index+this.extraFieldsLength,r,i,n;for(this.extraFields||(this.extraFields={});e.index+4<t;)r=e.readInt(2),i=e.readInt(2),n=e.readData(i),this.extraFields[r]={id:r,length:i,value:n};e.setIndex(t)},handleUTF8:function(){var e=Gut.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=Tk.utf8decode(this.fileName),this.fileCommentStr=Tk.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(t!==null)this.fileNameStr=t;else{var r=Vh.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var i=this.findExtraFieldUnicodeComment();if(i!==null)this.fileCommentStr=i;else{var n=Vh.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(n)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=oL(e.value);return t.readInt(1)!==1||rge(this.fileName)!==t.readInt(4)?null:Tk.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=oL(e.value);return t.readInt(1)!==1||rge(this.fileComment)!==t.readInt(4)?null:Tk.utf8decode(t.readData(e.length-5))}return null}};nge.exports=ige});var uge=T((PBt,sge)=>{"use strict";var Wut=aL(),Wc=qi(),Su=Q4(),Kut=age(),Yut=qc();function oge(e){this.files=[],this.loadOptions=e}oge.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+Wc.pretty(t)+", expected "+Wc.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var i=this.reader.readString(4),n=i===t;return this.reader.setIndex(r),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=Yut.uint8array?"uint8array":"array",r=Wc.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e=this.zip64EndOfCentralSize-44,t=0,r,i,n;t<e;)r=this.reader.readInt(2),i=this.reader.readInt(4),n=this.reader.readData(i),this.zip64ExtensibleData[r]={id:r,length:i,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(Su.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(Su.CENTRAL_FILE_HEADER);)e=new Kut({zip64:this.zip64},this.loadOptions),e.readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(Su.CENTRAL_DIRECTORY_END);if(e<0){var t=!this.isSignature(0,Su.LOCAL_FILE_HEADER);throw t?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory")}this.reader.setIndex(e);var r=e;if(this.checkSignature(Su.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===Wc.MAX_VALUE_16BITS||this.diskWithCentralDirStart===Wc.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===Wc.MAX_VALUE_16BITS||this.centralDirRecords===Wc.MAX_VALUE_16BITS||this.centralDirSize===Wc.MAX_VALUE_32BITS||this.centralDirOffset===Wc.MAX_VALUE_32BITS){if(this.zip64=!0,e=this.reader.lastIndexOfSignature(Su.ZIP64_CENTRAL_DIRECTORY_LOCATOR),e<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(Su.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,Su.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(Su.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(Su.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var i=this.centralDirOffset+this.centralDirSize;this.zip64&&(i+=20,i+=12+this.zip64EndOfCentralSize);var n=r-i;if(n>0)this.isSignature(r,Su.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=Wut(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};sge.exports=oge});var fge=T((BBt,cge)=>{"use strict";var sL=qi(),Rk=k0(),$ut=I0(),Xut=uge(),Jut=u4(),lge=p_();function Qut(e){return new Rk.Promise(function(t,r){var i=e.decompressed.getContentWorker().pipe(new Jut);i.on("error",function(n){r(n)}).on("end",function(){i.streamInfo.crc32!==e.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):t()}).resume()})}cge.exports=function(e,t){var r=this;return t=sL.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:$ut.utf8decode}),lge.isNode&&lge.isStream(e)?Rk.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):sL.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(i){var n=new Xut(t);return n.load(i),n}).then(function(n){var a=[Rk.Promise.resolve(n)],o=n.files;if(t.checkCRC32)for(var s=0;s<o.length;s++)a.push(Qut(o[s]));return Rk.Promise.all(a)}).then(function(n){for(var a=n.shift(),o=a.files,s=0;s<o.length;s++){var u=o[s],l=u.fileNameStr,c=sL.resolve(u.fileNameStr);r.file(c,u.decompressed,{binary:!0,optimizedBinaryString:!0,date:u.date,dir:u.dir,comment:u.fileCommentStr.length?u.fileCommentStr:null,unixPermissions:u.unixPermissions,dosPermissions:u.dosPermissions,createFolders:t.createFolders}),u.dir||(r.file(c).unsafeOriginalName=l)}return a.zipComment.length&&(r.comment=a.zipComment),r})}});var uL=T((MBt,hge)=>{"use strict";function Ms(){if(!(this instanceof Ms))return new Ms;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new Ms;for(var t in this)typeof this[t]!="function"&&(e[t]=this[t]);return e}}Ms.prototype=Ume();Ms.prototype.loadAsync=fge();Ms.support=qc();Ms.defaults=a4();Ms.version="3.10.1";Ms.loadAsync=function(e,t){return new Ms().loadAsync(e,t)};Ms.external=k0();hge.exports=Ms});var Xge=T((g8t,Yc)=>{var cct=Ka().default;function $ge(){"use strict";Yc.exports=$ge=function(){return e},Yc.exports.__esModule=!0,Yc.exports.default=Yc.exports;var e={},t=Object.prototype,r=t.hasOwnProperty,i=Object.defineProperty||function(z,j,U){z[j]=U.value},n=typeof Symbol=="function"?Symbol:{},a=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function u(z,j,U){return Object.defineProperty(z,j,{value:U,enumerable:!0,configurable:!0,writable:!0}),z[j]}try{u({},"")}catch{u=function(U,$,Z){return U[$]=Z}}function l(z,j,U,$){var Z=j&&j.prototype instanceof h?j:h,te=Object.create(Z.prototype),ne=new B($||[]);return i(te,"_invoke",{value:R(z,U,ne)}),te}function c(z,j,U){try{return{type:"normal",arg:z.call(j,U)}}catch($){return{type:"throw",arg:$}}}e.wrap=l;var f={};function h(){}function d(){}function p(){}var y={};u(y,a,function(){return this});var g=Object.getPrototypeOf,b=g&&g(g(V([])));b&&b!==t&&r.call(b,a)&&(y=b);var E=p.prototype=h.prototype=Object.create(y);function S(z){["next","throw","return"].forEach(function(j){u(z,j,function(U){return this._invoke(j,U)})})}function k(z,j){function U(Z,te,ne,ue){var me=c(z[Z],z,te);if(me.type!=="throw"){var Ne=me.arg,Me=Ne.value;return Me&&cct(Me)=="object"&&r.call(Me,"__await")?j.resolve(Me.__await).then(function(Ue){U("next",Ue,ne,ue)},function(Ue){U("throw",Ue,ne,ue)}):j.resolve(Me).then(function(Ue){Ne.value=Ue,ne(Ne)},function(Ue){return U("throw",Ue,ne,ue)})}ue(me.arg)}var $;i(this,"_invoke",{value:function(te,ne){function ue(){return new j(function(me,Ne){U(te,ne,me,Ne)})}return $=$?$.then(ue,ue):ue()}})}function R(z,j,U){var $="suspendedStart";return function(Z,te){if($==="executing")throw new Error("Generator is already running");if($==="completed"){if(Z==="throw")throw te;return N()}for(U.method=Z,U.arg=te;;){var ne=U.delegate;if(ne){var ue=M(ne,U);if(ue){if(ue===f)continue;return ue}}if(U.method==="next")U.sent=U._sent=U.arg;else if(U.method==="throw"){if($==="suspendedStart")throw $="completed",U.arg;U.dispatchException(U.arg)}else U.method==="return"&&U.abrupt("return",U.arg);$="executing";var me=c(z,j,U);if(me.type==="normal"){if($=U.done?"completed":"suspendedYield",me.arg===f)continue;return{value:me.arg,done:U.done}}me.type==="throw"&&($="completed",U.method="throw",U.arg=me.arg)}}}function M(z,j){var U=j.method,$=z.iterator[U];if($===void 0)return j.delegate=null,U==="throw"&&z.iterator.return&&(j.method="return",j.arg=void 0,M(z,j),j.method==="throw")||U!=="return"&&(j.method="throw",j.arg=new TypeError("The iterator does not provide a '"+U+"' method")),f;var Z=c($,z.iterator,j.arg);if(Z.type==="throw")return j.method="throw",j.arg=Z.arg,j.delegate=null,f;var te=Z.arg;return te?te.done?(j[z.resultName]=te.value,j.next=z.nextLoc,j.method!=="return"&&(j.method="next",j.arg=void 0),j.delegate=null,f):te:(j.method="throw",j.arg=new TypeError("iterator result is not an object"),j.delegate=null,f)}function I(z){var j={tryLoc:z[0]};1 in z&&(j.catchLoc=z[1]),2 in z&&(j.finallyLoc=z[2],j.afterLoc=z[3]),this.tryEntries.push(j)}function L(z){var j=z.completion||{};j.type="normal",delete j.arg,z.completion=j}function B(z){this.tryEntries=[{tryLoc:"root"}],z.forEach(I,this),this.reset(!0)}function V(z){if(z){var j=z[a];if(j)return j.call(z);if(typeof z.next=="function")return z;if(!isNaN(z.length)){var U=-1,$=function Z(){for(;++U<z.length;)if(r.call(z,U))return Z.value=z[U],Z.done=!1,Z;return Z.value=void 0,Z.done=!0,Z};return $.next=$}}return{next:N}}function N(){return{value:void 0,done:!0}}return d.prototype=p,i(E,"constructor",{value:p,configurable:!0}),i(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,s,"GeneratorFunction"),e.isGeneratorFunction=function(z){var j=typeof z=="function"&&z.constructor;return!!j&&(j===d||(j.displayName||j.name)==="GeneratorFunction")},e.mark=function(z){return Object.setPrototypeOf?Object.setPrototypeOf(z,p):(z.__proto__=p,u(z,s,"GeneratorFunction")),z.prototype=Object.create(E),z},e.awrap=function(z){return{__await:z}},S(k.prototype),u(k.prototype,o,function(){return this}),e.AsyncIterator=k,e.async=function(z,j,U,$,Z){Z===void 0&&(Z=Promise);var te=new k(l(z,j,U,$),Z);return e.isGeneratorFunction(j)?te:te.next().then(function(ne){return ne.done?ne.value:te.next()})},S(E),u(E,s,"Generator"),u(E,a,function(){return this}),u(E,"toString",function(){return"[object Generator]"}),e.keys=function(z){var j=Object(z),U=[];for(var $ in j)U.push($);return U.reverse(),function Z(){for(;U.length;){var te=U.pop();if(te in j)return Z.value=te,Z.done=!1,Z}return Z.done=!0,Z}},e.values=V,B.prototype={constructor:B,reset:function(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!j)for(var U in this)U.charAt(0)==="t"&&r.call(this,U)&&!isNaN(+U.slice(1))&&(this[U]=void 0)},stop:function(){this.done=!0;var j=this.tryEntries[0].completion;if(j.type==="throw")throw j.arg;return this.rval},dispatchException:function(j){if(this.done)throw j;var U=this;function $(Ne,Me){return ne.type="throw",ne.arg=j,U.next=Ne,Me&&(U.method="next",U.arg=void 0),!!Me}for(var Z=this.tryEntries.length-1;Z>=0;--Z){var te=this.tryEntries[Z],ne=te.completion;if(te.tryLoc==="root")return $("end");if(te.tryLoc<=this.prev){var ue=r.call(te,"catchLoc"),me=r.call(te,"finallyLoc");if(ue&&me){if(this.prev<te.catchLoc)return $(te.catchLoc,!0);if(this.prev<te.finallyLoc)return $(te.finallyLoc)}else if(ue){if(this.prev<te.catchLoc)return $(te.catchLoc,!0)}else{if(!me)throw new Error("try statement without catch or finally");if(this.prev<te.finallyLoc)return $(te.finallyLoc)}}}},abrupt:function(j,U){for(var $=this.tryEntries.length-1;$>=0;--$){var Z=this.tryEntries[$];if(Z.tryLoc<=this.prev&&r.call(Z,"finallyLoc")&&this.prev<Z.finallyLoc){var te=Z;break}}te&&(j==="break"||j==="continue")&&te.tryLoc<=U&&U<=te.finallyLoc&&(te=null);var ne=te?te.completion:{};return ne.type=j,ne.arg=U,te?(this.method="next",this.next=te.finallyLoc,f):this.complete(ne)},complete:function(j,U){if(j.type==="throw")throw j.arg;return j.type==="break"||j.type==="continue"?this.next=j.arg:j.type==="return"?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):j.type==="normal"&&U&&(this.next=U),f},finish:function(j){for(var U=this.tryEntries.length-1;U>=0;--U){var $=this.tryEntries[U];if($.finallyLoc===j)return this.complete($.completion,$.afterLoc),L($),f}},catch:function(j){for(var U=this.tryEntries.length-1;U>=0;--U){var $=this.tryEntries[U];if($.tryLoc===j){var Z=$.completion;if(Z.type==="throw"){var te=Z.arg;L($)}return te}}throw new Error("illegal catch attempt")},delegateYield:function(j,U,$){return this.delegate={iterator:V(j),resultName:U,nextLoc:$},this.method==="next"&&(this.arg=void 0),f}},e}Yc.exports=$ge,Yc.exports.__esModule=!0,Yc.exports.default=Yc.exports});var Qge=T((v8t,Jge)=>{var Dk=Xge()();Jge.exports=Dk;try{regeneratorRuntime=Dk}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Dk:Function("r","regeneratorRuntime = r")(Dk)}});var _L=T(Fk=>{"use strict";var yL=ti();Object.defineProperty(Fk,"__esModule",{value:!0});Fk.default=void 0;var fct=yL($i()),hct=yL(Xi()),Kh=yL(fs()),dct=240,pct=[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],mct=372,gct=[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],vct=372,yct=[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],bct=12,bL=(3+1)*(3+2)/2,_ct=2,xct=function(){function e(t){(0,fct.default)(this,e),(0,Kh.default)(this,"_v00",0),(0,Kh.default)(this,"_v01",0),(0,Kh.default)(this,"_v10",0),(0,Kh.default)(this,"_v11",0),(0,Kh.default)(this,"_t",[]),(0,Kh.default)(this,"_ix",void 0),(0,Kh.default)(this,"_iy",void 0),(0,Kh.default)(this,"options",void 0),this.options=t,this._ix=this.options._width,this._iy=this.options._height}return(0,hct.default)(e,[{key:"getHeight",value:function(r,i){if(r=Math.abs(r)>90?NaN:r,isNaN(r)||isNaN(i))return NaN;var n=wct(i,360);i=n!==-180?n:180;var a=i*this.options._rlonres,o=-r*this.options._rlatres,s=Math.floor(a),u=Math.min(Math.round((this.options._height-1)/2-1),Math.floor(o));a-=s,o-=u,u+=(this.options._height-1)/2,s+=s<0?this.options._width:s>=this.options._width?-this.options._width:0;var l=0,c=0,f=0,h=0,d=new Array(bL);if(s===this._ix&&u===this._iy)this.options.cubic?d=this._t:(l=this._v00,c=this._v01,f=this._v10,h=this._v11);else if(!this.options.cubic)l=this._rawval(s,u),c=this._rawval(s+1,u),f=this._rawval(s,u+1),h=this._rawval(s+1,u+1);else{var p=[this._rawval(s,u-1),this._rawval(s+1,u-1),this._rawval(s-1,u),this._rawval(s,u),this._rawval(s+1,u),this._rawval(s+2,u),this._rawval(s-1,u+1),this._rawval(s,u+1),this._rawval(s+1,u+1),this._rawval(s+2,u+1),this._rawval(s,u+2),this._rawval(s+1,u+2)],y=gct;u!==0&&(y=u===this.options._height-2?yct:pct);var g=mct;u!==0&&(g=u===this.options._height-2?vct:dct);for(var b=0;b<bL;++b){d[b]=0;for(var E=0;E<bct;++E)d[b]+=p[E]*y[bL*E+b];d[b]/=g}}if(!this.options.cubic){var S=(1-a)*l+a*c,k=(1-a)*f+a*h,R=(1-o)*S+o*k,M=this.options._offset+this.options._scale*R;return this._ix=s,this._iy=u,this._v00=l,this._v01=c,this._v10=f,this._v11=h,M}var I=d[0]+a*(d[1]+a*(d[3]+a*d[6]))+o*(d[2]+a*(d[4]+a*d[7])+o*(d[5]+a*d[8]+o*d[9]));return I=this.options._offset+this.options._scale*I,this._ix=s,this._iy=u,this._t=d,I}},{key:"_rawval",value:function(r,i){r<0?r+=this.options._width:r>=this.options._width&&(r-=this.options._width),(i<0||i>=this.options._height)&&(i=i<0?-i:2*(this.options._height-1)-i,r+=(r<this.options._width/2?1:-1)*this.options._width/2);var n=this.options._datastart+_ct*(i*this.options._swidth+r),a=this.options.data[n],o=this.options.data[n+1],s=a<<8|o;return s}}]),e}();Fk.default=xct;function wct(e,t){t=Math.abs(t);var r=Zge(e,t);return 2*Math.abs(r)===t?r-=Zge(e,2*t)-r:2*Math.abs(r)>t&&(r+=r<0?t:-t),r}function Zge(e,t){return e-Math.floor(e/t)*t}});var a0e=T(xL=>{"use strict";var e0e=ti();Object.defineProperty(xL,"__esModule",{value:!0});xL.parsePGM=Cct;var t0e=e0e(Qge()),Ect=e0e(_L());function Sct(e,t){var r=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Act(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
118
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function Act(e,t){if(!!e){if(typeof e=="string")return r0e(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return r0e(e,t)}}function r0e(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}var Tct=t0e.default.mark(i0e),kct=10,Rct=65535;function Cct(e,t){var r=i0e(e),i=r.next();if(i.done||i.value.line!=="P5")throw new Error("Geoid model file: File not in PGM format");var n=Number.MAX_VALUE,a=0,o=-1,s=-1,u="NONE",l="UNKNOWN",c=0,f=0,h=null,d=null;do{i=r.next();var p=i.value.line;if(!!p.length)if(p[0]==="#"){var y=p.split(" "),g=y[0],b=y[1];if(g!=="#"||!b)continue;var E=y.length>2?y.slice(2):[];if(b==="Description")u=E.join(" ");else if(b==="DateTime")l=E.join(" ");else if(b==="Offset"){if(!y[2])throw new Error("Geoid model file: Error reading offset");n=parseInt(y[2],10)}else if(b==="Scale"){if(!y[2])throw new Error("Geoid model file: Error reading scale");a=parseFloat(y[2])}else b===(t.cubic?"MaxCubicError":"MaxBilinearError")?isFinite(parseFloat(y[2]))&&(o=parseFloat(y[2])):b===(t.cubic?"RMSCubicError":"RMSBilinearError")&&isFinite(parseFloat(y[2]))&&(s=parseFloat(y[2]))}else{var S=p.split(" ");if(S=S.filter(function(I){return I!==""}),c=parseInt(S[0],10),f=parseInt(S[1],10),!(c&&f))throw new Error("Geoid model file: Error reading raster size");break}}while(!i.done);i=r.next();var k=parseInt(i.value.line,10);if(i.done)throw new Error("Geoid model file: Error reading maxval");if(k!==Rct)throw new Error("Geoid model file: Incorrect value of maxval");if(h=i.value.offset,d=c,n===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||c<2)throw new Error("Geoid model file: Raster size too small");if(c&1)throw new Error("Geoid model file: Raster width is odd");if(!(f&1))throw new Error("Geoid model file: Raster height is even");var R=c/360,M=(f-1)/180;return new Ect.default({cubic:t.cubic,_width:c,_height:f,_rlonres:R,_rlatres:M,_offset:n,_scale:a,_swidth:d,_datastart:h,_maxerror:o,_rmserror:s,_description:u,_datetime:l,data:e})}function i0e(e){var t,r,i,n;return t0e.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:t=0;case 1:if(r=e.indexOf(kct,t),r===-1){o.next=9;break}return i=e.subarray(t,r),t=r+1,o.next=7,{offset:t,line:n0e(i)};case 7:o.next=13;break;case 9:return n=e.subarray(t,e.length),t=e.length,o.next=13,{offset:t,line:n0e(n)};case 13:if(t<e.length){o.next=1;break}case 14:return o.abrupt("return",{offset:t,line:""});case 15:case"end":return o.stop()}},Tct)}function n0e(e){var t="",r=Sct(e),i;try{for(r.s();!(i=r.n()).done;){var n=i.value;t+=String.fromCharCode(n)}}catch(a){r.e(a)}finally{r.f()}return t}});var o0e=T(jk=>{"use strict";var Ict=ti();Object.defineProperty(jk,"__esModule",{value:!0});Object.defineProperty(jk,"parsePGM",{enumerable:!0,get:function(){return Oct.parsePGM}});Object.defineProperty(jk,"Geoid",{enumerable:!0,get:function(){return Pct.default}});var Oct=a0e(),Pct=Ict(_L())});var E0e=T(Uk=>{"use strict";Object.defineProperty(Uk,"__esModule",{value:!0});Uk.default=void 0;var sft={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,FUNC_ADD:32774,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,BLEND_COLOR:32773,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,VENDOR:7936,RENDERER:7937,VERSION:7938,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,BROWSER_DEFAULT_WEBGL:37444,STATIC_DRAW:35044,STREAM_DRAW:35040,DYNAMIC_DRAW:35048,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,CULL_FACE:2884,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,BLEND:3042,DEPTH_TEST:2929,DITHER:3024,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,SCISSOR_TEST:3089,STENCIL_TEST:2960,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CONTEXT_LOST_WEBGL:37442,CW:2304,CCW:2305,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,COMPILE_STATUS:35713,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_ATTRIBUTES:35721,ACTIVE_UNIFORMS:35718,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,ALWAYS:519,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,GEQUAL:518,NOTEQUAL:517,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,TEXTURE_WIDTH:4096,TEXTURE_HEIGHT:4097,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,MAX_3D_TEXTURE_SIZE:32883,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,MAX_TEXTURE_LOD_BIAS:34045,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,RASTERIZER_DISCARD:35977,VERTEX_ARRAY_BINDING:34229,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,MAX_ELEMENT_INDEX:36203,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,RGB9_E5:35901,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2UI:36975,TEXTURE_IMMUTABLE_FORMAT:37167,TEXTURE_IMMUTABLE_LEVELS:33503,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,UNSIGNED_INT_24_8:34042,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,INT_2_10_10_10_REV:36255,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,MAX_SAMPLES:36183,SAMPLER_BINDING:35097,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,UNSIGNED_NORMALIZED:35863,SIGNED_NORMALIZED:36764,VERTEX_ATTRIB_ARRAY_INTEGER:35069,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,DEPTH24_STENCIL8:35056,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,COLOR:6144,DEPTH:6145,STENCIL:6146,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,INVALID_INDEX:4294967295,TIMEOUT_IGNORED:-1,MAX_CLIENT_WAIT_TIMEOUT_WEBGL:37447,VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,UNMASKED_VENDOR_WEBGL:37445,UNMASKED_RENDERER_WEBGL:37446,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047,TEXTURE_MAX_ANISOTROPY_EXT:34046,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:35986,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,UNSIGNED_INT_24_8_WEBGL:34042,HALF_FLOAT_OES:36193,RGBA32F_EXT:34836,RGB32F_EXT:34837,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:33297,UNSIGNED_NORMALIZED_EXT:35863,MIN_EXT:32775,MAX_EXT:32776,SRGB_EXT:35904,SRGB_ALPHA_EXT:35906,SRGB8_ALPHA8_EXT:35907,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:33296,FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723,COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067,COLOR_ATTACHMENT4_WEBGL:36068,COLOR_ATTACHMENT5_WEBGL:36069,COLOR_ATTACHMENT6_WEBGL:36070,COLOR_ATTACHMENT7_WEBGL:36071,COLOR_ATTACHMENT8_WEBGL:36072,COLOR_ATTACHMENT9_WEBGL:36073,COLOR_ATTACHMENT10_WEBGL:36074,COLOR_ATTACHMENT11_WEBGL:36075,COLOR_ATTACHMENT12_WEBGL:36076,COLOR_ATTACHMENT13_WEBGL:36077,COLOR_ATTACHMENT14_WEBGL:36078,COLOR_ATTACHMENT15_WEBGL:36079,DRAW_BUFFER0_WEBGL:34853,DRAW_BUFFER1_WEBGL:34854,DRAW_BUFFER2_WEBGL:34855,DRAW_BUFFER3_WEBGL:34856,DRAW_BUFFER4_WEBGL:34857,DRAW_BUFFER5_WEBGL:34858,DRAW_BUFFER6_WEBGL:34859,DRAW_BUFFER7_WEBGL:34860,DRAW_BUFFER8_WEBGL:34861,DRAW_BUFFER9_WEBGL:34862,DRAW_BUFFER10_WEBGL:34863,DRAW_BUFFER11_WEBGL:34864,DRAW_BUFFER12_WEBGL:34865,DRAW_BUFFER13_WEBGL:34866,DRAW_BUFFER14_WEBGL:34867,DRAW_BUFFER15_WEBGL:34868,MAX_COLOR_ATTACHMENTS_WEBGL:36063,MAX_DRAW_BUFFERS_WEBGL:34852,VERTEX_ARRAY_BINDING_OES:34229,QUERY_COUNTER_BITS_EXT:34916,CURRENT_QUERY_EXT:34917,QUERY_RESULT_EXT:34918,QUERY_RESULT_AVAILABLE_EXT:34919,TIME_ELAPSED_EXT:35007,TIMESTAMP_EXT:36392,GPU_DISJOINT_EXT:36795};Uk.default=sft});var LO=Le(iN());var qs=typeof process!="object"||String(process)!=="[object process]"||process.browser,vR={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,global:typeof global!="undefined"&&global},Vi=vR.global||vR.self||vR.window;var nN={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]};global["encoding-indexes"]=nN||{};function Zt(e,t,r){return t<=e&&e<=r}function uye(e,t){return e.indexOf(t)!==-1}var Ul=Math.floor;function wx(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function lye(e){for(var t=String(e),r=t.length,i=0,n=[];i<r;){var a=t.charCodeAt(i);if(a<55296||a>57343)n.push(a);else if(56320<=a&&a<=57343)n.push(65533);else if(55296<=a&&a<=56319)if(i===r-1)n.push(65533);else{var o=t.charCodeAt(i+1);if(56320<=o&&o<=57343){var s=a&1023,u=o&1023;n.push(65536+(s<<10)+u),i+=1}else n.push(65533)}i+=1}return n}function cye(e){for(var t="",r=0;r<e.length;++r){var i=e[r];i<=65535?t+=String.fromCharCode(i):(i-=65536,t+=String.fromCharCode((i>>10)+55296,(i&1023)+56320))}return t}function Ko(e){return 0<=e&&e<=127}var Yo=Ko,Rr=-1;function yR(e){this.tokens=[].slice.call(e),this.tokens.reverse()}yR.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Rr},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 pi=-1;function Cr(e,t){if(e)throw TypeError("Decoder error");return t||65533}function Us(e){throw TypeError("The code point "+e+" could not be encoded.")}function fye(){}fye.prototype={handler:function(e,t){}};function hye(){}hye.prototype={handler:function(e,t){}};function bR(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(_R,e)?_R[e]:null}var aN=[{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"}],_R={};aN.forEach(function(e){e.encodings.forEach(function(t){t.labels.forEach(function(r){_R[r]=t})})});var uo={},lo={};function tm(e,t){return t&&t[e]||null}function rm(e,t){var r=t.indexOf(e);return r===-1?null:r}function Ua(e){if(!("encoding-indexes"in global))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return global["encoding-indexes"][e]}function dye(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var t=0,r=0,i=Ua("gb18030-ranges"),n;for(n=0;n<i.length;++n){var a=i[n];if(a[0]<=e)t=a[0],r=a[1];else break}return r+e-t}function pye(e){if(e===59335)return 7457;var t=0,r=0,i=Ua("gb18030-ranges"),n;for(n=0;n<i.length;++n){var a=i[n];if(a[1]<=e)t=a[1],r=a[0];else break}return r+e-t}function mye(e){xR=xR||Ua("jis0208").map(function(r,i){return Zt(i,8272,8835)?null:r});var t=xR;return t.indexOf(e)}var xR;function gye(e){wR=wR||Ua("big5").map(function(r,i){return i<(161-129)*157?null:r});var t=wR;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?t.lastIndexOf(e):rm(e,t)}var wR,oN="utf-8";function ed(e,t){if(!(this instanceof ed))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):oN,t=wx(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=bR(e);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!lo[r.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var i=this;return i._encoding=r,Boolean(t.fatal)&&(i._error_mode="fatal"),Boolean(t.ignoreBOM)&&(i._ignoreBOM=!0),Object.defineProperty||(this.encoding=i._encoding.name.toLowerCase(),this.fatal=i._error_mode==="fatal",this.ignoreBOM=i._ignoreBOM),i}Object.defineProperty&&(Object.defineProperty(ed.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(ed.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(ed.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));ed.prototype.decode=function(t,r){var i;typeof t=="object"&&t instanceof ArrayBuffer?i=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?i=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):i=new Uint8Array(0),r=wx(r),this._do_not_flush||(this._decoder=lo[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(r.stream);for(var n=new yR(i),a=[],o;;){var s=n.read();if(s===Rr||(o=this._decoder.handler(n,s),o===pi))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(n,n.read()),o===pi)break;o!==null&&(Array.isArray(o)?a.push.apply(a,o):a.push(o))}while(!n.endOfStream());this._decoder=null}function u(l){return uye(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(l.length>0&&l[0]===65279?(this._BOMseen=!0,l.shift()):l.length>0&&(this._BOMseen=!0)),cye(l)}return u.call(this,a)};function Rv(e,t){if(!(this instanceof Rv))throw TypeError("Called as a function. Did you forget 'new'?");t=wx(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):oN;var i=bR(e);if(i===null||i.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!uo[i.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=i}else r._encoding=bR("utf-8"),e!==void 0&&"console"in global&&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(Rv.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});Rv.prototype.encode=function(t,r){t=t===void 0?"":String(t),r=wx(r),this._do_not_flush||(this._encoder=uo[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(r.stream);for(var i=new yR(lye(t)),n=[],a;;){var o=i.read();if(o===Rr||(a=this._encoder.handler(i,o),a===pi))break;Array.isArray(a)?n.push.apply(n,a):n.push(a)}if(!this._do_not_flush){for(;a=this._encoder.handler(i,i.read()),a!==pi;)Array.isArray(a)?n.push.apply(n,a):n.push(a);this._encoder=null}return new Uint8Array(n)};function vye(e){var t=e.fatal,r=0,i=0,n=0,a=128,o=191;this.handler=function(s,u){if(u===Rr&&n!==0)return n=0,Cr(t);if(u===Rr)return pi;if(n===0){if(Zt(u,0,127))return u;if(Zt(u,194,223))n=1,r=u&31;else if(Zt(u,224,239))u===224&&(a=160),u===237&&(o=159),n=2,r=u&15;else if(Zt(u,240,244))u===240&&(a=144),u===244&&(o=143),n=3,r=u&7;else return Cr(t);return null}if(!Zt(u,a,o))return r=n=i=0,a=128,o=191,s.prepend(u),Cr(t);if(a=128,o=191,r=r<<6|u&63,i+=1,i!==n)return null;var l=r;return r=n=i=0,l}}function yye(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return pi;if(Yo(i))return i;var n,a;Zt(i,128,2047)?(n=1,a=192):Zt(i,2048,65535)?(n=2,a=224):Zt(i,65536,1114111)&&(n=3,a=240);for(var o=[(i>>6*n)+a];n>0;){var s=i>>6*(n-1);o.push(128|s&63),n-=1}return o}}uo["UTF-8"]=function(e){return new yye(e)};lo["UTF-8"]=function(e){return new vye(e)};function bye(e,t){var r=t.fatal;this.handler=function(i,n){if(n===Rr)return pi;if(Ko(n))return n;var a=e[n-128];return a===null?Cr(r):a}}function _ye(e,t){var r=t.fatal;this.handler=function(i,n){if(n===Rr)return pi;if(Yo(n))return n;var a=rm(n,e);return a===null&&Us(n),a+128}}(function(){"encoding-indexes"in global&&aN.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(t){var r=t.name,i=Ua(r.toLowerCase());lo[r]=function(n){return new bye(i,n)},uo[r]=function(n){return new _ye(i,n)}})})})();lo.GBK=function(e){return new sN(e)};uo.GBK=function(e){return new uN(e,!0)};function sN(e){var t=e.fatal,r=0,i=0,n=0;this.handler=function(a,o){if(o===Rr&&r===0&&i===0&&n===0)return pi;o===Rr&&(r!==0||i!==0||n!==0)&&(r=0,i=0,n=0,Cr(t));var s;if(n!==0){s=null,Zt(o,48,57)&&(s=dye((((r-129)*10+i-48)*126+n-129)*10+o-48));var u=[i,n,o];return r=0,i=0,n=0,s===null?(a.prepend(u),Cr(t)):s}if(i!==0)return Zt(o,129,254)?(n=o,null):(a.prepend([i,o]),r=0,i=0,Cr(t));if(r!==0){if(Zt(o,48,57))return i=o,null;var l=r,c=null;r=0;var f=o<127?64:65;return(Zt(o,64,126)||Zt(o,128,254))&&(c=(l-129)*190+(o-f)),s=c===null?null:tm(c,Ua("gb18030")),s===null&&Ko(o)&&a.prepend(o),s===null?Cr(t):s}return Ko(o)?o:o===128?8364:Zt(o,129,254)?(r=o,null):Cr(t)}}function uN(e,t){var r=e.fatal;this.handler=function(i,n){if(n===Rr)return pi;if(Yo(n))return n;if(n===58853)return Us(n);if(t&&n===8364)return 128;var a=rm(n,Ua("gb18030"));if(a!==null){var o=Ul(a/190)+129,s=a%190,u=s<63?64:65;return[o,s+u]}if(t)return Us(n);a=pye(n);var l=Ul(a/10/126/10);a=a-l*10*126*10;var c=Ul(a/10/126);a=a-c*10*126;var f=Ul(a/10),h=a-f*10;return[l+129,c+48,f+129,h+48]}}uo.gb18030=function(e){return new uN(e)};lo.gb18030=function(e){return new sN(e)};function xye(e){var t=e.fatal,r=0;this.handler=function(i,n){if(n===Rr&&r!==0)return r=0,Cr(t);if(n===Rr&&r===0)return pi;if(r!==0){var a=r,o=null;r=0;var s=n<127?64:98;switch((Zt(n,64,126)||Zt(n,161,254))&&(o=(a-129)*157+(n-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:tm(o,Ua("big5"));return u===null&&Ko(n)&&i.prepend(n),u===null?Cr(t):u}return Ko(n)?n:Zt(n,129,254)?(r=n,null):Cr(t)}}function wye(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return pi;if(Yo(i))return i;var n=gye(i);if(n===null)return Us(i);var a=Ul(n/157)+129;if(a<161)return Us(i);var o=n%157,s=o<63?64:98;return[a,o+s]}}uo.Big5=function(e){return new wye(e)};lo.Big5=function(e){return new xye(e)};function Eye(e){var t=e.fatal,r=!1,i=0;this.handler=function(n,a){if(a===Rr&&i!==0)return i=0,Cr(t);if(a===Rr&&i===0)return pi;if(i===142&&Zt(a,161,223))return i=0,65377-161+a;if(i===143&&Zt(a,161,254))return r=!0,i=a,null;if(i!==0){var o=i;i=0;var s=null;return Zt(o,161,254)&&Zt(a,161,254)&&(s=tm((o-161)*94+(a-161),Ua(r?"jis0212":"jis0208"))),r=!1,Zt(a,161,254)||n.prepend(a),s===null?Cr(t):s}return Ko(a)?a:a===142||a===143||Zt(a,161,254)?(i=a,null):Cr(t)}}function Sye(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return pi;if(Yo(i))return i;if(i===165)return 92;if(i===8254)return 126;if(Zt(i,65377,65439))return[142,i-65377+161];i===8722&&(i=65293);var n=rm(i,Ua("jis0208"));if(n===null)return Us(i);var a=Ul(n/94)+161,o=n%94+161;return[a,o]}}uo["EUC-JP"]=function(e){return new Sye(e)};lo["EUC-JP"]=function(e){return new Eye(e)};function Aye(e){var t=e.fatal,r={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},i=r.ASCII,n=r.ASCII,a=0,o=!1;this.handler=function(s,u){switch(i){default:case r.ASCII:return u===27?(i=r.EscapeStart,null):Zt(u,0,127)&&u!==14&&u!==15&&u!==27?(o=!1,u):u===Rr?pi:(o=!1,Cr(t));case r.Roman:return u===27?(i=r.EscapeStart,null):u===92?(o=!1,165):u===126?(o=!1,8254):Zt(u,0,127)&&u!==14&&u!==15&&u!==27&&u!==92&&u!==126?(o=!1,u):u===Rr?pi:(o=!1,Cr(t));case r.Katakana:return u===27?(i=r.EscapeStart,null):Zt(u,33,95)?(o=!1,65377-33+u):u===Rr?pi:(o=!1,Cr(t));case r.LeadByte:return u===27?(i=r.EscapeStart,null):Zt(u,33,126)?(o=!1,a=u,i=r.TrailByte,null):u===Rr?pi:(o=!1,Cr(t));case r.TrailByte:if(u===27)return i=r.EscapeStart,Cr(t);if(Zt(u,33,126)){i=r.LeadByte;var l=(a-33)*94+u-33,c=tm(l,Ua("jis0208"));return c===null?Cr(t):c}return u===Rr?(i=r.LeadByte,s.prepend(u),Cr(t)):(i=r.LeadByte,Cr(t));case r.EscapeStart:return u===36||u===40?(a=u,i=r.Escape,null):(s.prepend(u),o=!1,i=n,Cr(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){i=i=h;var d=o;return o=!0,d?Cr(t):null}return s.prepend([f,u]),o=!1,i=n,Cr(t)}}}function Tye(e){var t=e.fatal,r={ASCII:0,Roman:1,jis0208:2},i=r.ASCII;this.handler=function(n,a){if(a===Rr&&i!==r.ASCII)return n.prepend(a),i=r.ASCII,[27,40,66];if(a===Rr&&i===r.ASCII)return pi;if((i===r.ASCII||i===r.Roman)&&(a===14||a===15||a===27))return Us(65533);if(i===r.ASCII&&Yo(a))return a;if(i===r.Roman&&(Yo(a)&&a!==92&&a!==126||a==165||a==8254)){if(Yo(a))return a;if(a===165)return 92;if(a===8254)return 126}if(Yo(a)&&i!==r.ASCII)return n.prepend(a),i=r.ASCII,[27,40,66];if((a===165||a===8254)&&i!==r.Roman)return n.prepend(a),i=r.Roman,[27,40,74];a===8722&&(a=65293);var o=rm(a,Ua("jis0208"));if(o===null)return Us(a);if(i!==r.jis0208)return n.prepend(a),i=r.jis0208,[27,36,66];var s=Ul(o/94)+33,u=o%94+33;return[s,u]}}uo["ISO-2022-JP"]=function(e){return new Tye(e)};lo["ISO-2022-JP"]=function(e){return new Aye(e)};function kye(e){var t=e.fatal,r=0;this.handler=function(i,n){if(n===Rr&&r!==0)return r=0,Cr(t);if(n===Rr&&r===0)return pi;if(r!==0){var a=r,o=null;r=0;var s=n<127?64:65,u=a<160?129:193;if((Zt(n,64,126)||Zt(n,128,252))&&(o=(a-u)*188+n-s),Zt(o,8836,10715))return 57344-8836+o;var l=o===null?null:tm(o,Ua("jis0208"));return l===null&&Ko(n)&&i.prepend(n),l===null?Cr(t):l}return Ko(n)||n===128?n:Zt(n,161,223)?65377-161+n:Zt(n,129,159)||Zt(n,224,252)?(r=n,null):Cr(t)}}function Rye(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return pi;if(Yo(i)||i===128)return i;if(i===165)return 92;if(i===8254)return 126;if(Zt(i,65377,65439))return i-65377+161;i===8722&&(i=65293);var n=mye(i);if(n===null)return Us(i);var a=Ul(n/188),o=a<31?129:193,s=n%188,u=s<63?64:65;return[a+o,s+u]}}uo.Shift_JIS=function(e){return new Rye(e)};lo.Shift_JIS=function(e){return new kye(e)};function Cye(e){var t=e.fatal,r=0;this.handler=function(i,n){if(n===Rr&&r!==0)return r=0,Cr(t);if(n===Rr&&r===0)return pi;if(r!==0){var a=r,o=null;r=0,Zt(n,65,254)&&(o=(a-129)*190+(n-65));var s=o===null?null:tm(o,Ua("euc-kr"));return o===null&&Ko(n)&&i.prepend(n),s===null?Cr(t):s}return Ko(n)?n:Zt(n,129,254)?(r=n,null):Cr(t)}}function Iye(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return pi;if(Yo(i))return i;var n=rm(i,Ua("euc-kr"));if(n===null)return Us(i);var a=Ul(n/190)+129,o=n%190+65;return[a,o]}}uo["EUC-KR"]=function(e){return new Iye(e)};lo["EUC-KR"]=function(e){return new Cye(e)};function Ex(e,t){var r=e>>8,i=e&255;return t?[r,i]:[i,r]}function lN(e,t){var r=t.fatal,i=null,n=null;this.handler=function(a,o){if(o===Rr&&(i!==null||n!==null))return Cr(r);if(o===Rr&&i===null&&n===null)return pi;if(i===null)return i=o,null;var s;if(e?s=(i<<8)+o:s=(o<<8)+i,i=null,n!==null){var u=n;return n=null,Zt(s,56320,57343)?65536+(u-55296)*1024+(s-56320):(a.prepend(Ex(s,e)),Cr(r))}return Zt(s,55296,56319)?(n=s,null):Zt(s,56320,57343)?Cr(r):s}}function cN(e,t){var r=t.fatal;this.handler=function(i,n){if(n===Rr)return pi;if(Zt(n,0,65535))return Ex(n,e);var a=Ex((n-65536>>10)+55296,e),o=Ex((n-65536&1023)+56320,e);return a.concat(o)}}uo["UTF-16BE"]=function(e){return new cN(!0,e)};lo["UTF-16BE"]=function(e){return new lN(!0,e)};uo["UTF-16LE"]=function(e){return new cN(!1,e)};lo["UTF-16LE"]=function(e){return new lN(!1,e)};function Oye(e){var t=e.fatal;this.handler=function(r,i){return i===Rr?pi:Ko(i)?i:63360+i-128}}function Pye(e){var t=e.fatal;this.handler=function(r,i){return i===Rr?pi:Yo(i)?i:Zt(i,63360,63487)?i-63360+128:Us(i)}}uo["x-user-defined"]=function(e){return new Pye(e)};lo["x-user-defined"]=function(e){return new Oye(e)};var Bye="rejected",Mye="fulfilled";function fN(e){let t=e.map(r=>r.then(i=>({status:Mye,value:i})).catch(i=>({status:Bye,reason:i})));return Promise.all(t)}function Sx(e){return Buffer.from(e).toString("base64")}function ER(e){return Buffer.from(e,"base64").toString("ascii")}var $o=class{constructor(t){this.map={},t instanceof $o?t.forEach((r,i)=>this.append(i,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=Cv(t),r=hN(r);let i=this.map[t];this.map[t]=i?`${i}, ${r}`:r}delete(t){delete this.map[Cv(t)]}get(t){return t=Cv(t),this.has(t)?this.map[t]:null}has(t){return this.map.hasOwnProperty(Cv(t))}set(t,r){this.map[Cv(t)]=hN(r)}forEach(t,r=null){for(let i in this.map)this.map.hasOwnProperty(i)&&(r?t.call(r,this.map[i],i,this):t(this.map[i],i,this))}keys(){let t=[];return this.forEach(function(r,i){t.push(i)}),SR(t)}values(){let t=[];return this.forEach(function(r){t.push(r)}),SR(t)}entries(){let t=[];return this.forEach(function(r,i){t.push([i,r])}),SR(t)}*[Symbol.iterator](){yield*this.entries()}};function Cv(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 hN(e){return typeof e!="string"&&(e=String(e)),e}function SR(e){let t={next(){let r=e.shift();return{done:r===void 0,value:r}}};return t[Symbol.iterator]=function(){return t},t}function AR(e,t){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${t}`)}var Ax=Le(require("zlib"));var Dye=e=>e&&e instanceof ArrayBuffer,Fye=e=>e&&e instanceof Buffer;function dN(e){let t=e.indexOf(","),r,i;return e.slice(t-7,t)===";base64"?(r=Buffer.from(e.slice(t+1),"base64"),i=e.slice(5,t-7).trim()):(r=Buffer.from(decodeURIComponent(e.slice(t+1))),i=e.slice(5,t).trim()),i?i.startsWith(";")&&(i=`text/plain${i}`):i="text/plain;charset=US-ASCII",{arrayBuffer:TR(r),mimeType:i}}function TR(e){if(Dye(e))return e;if(Fye(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)})`)}function pN(e,t){switch(t.get("content-encoding")){case"br":return e.pipe(Ax.default.createBrotliDecompress());case"gzip":return e.pipe(Ax.default.createGunzip());case"deflate":return e.pipe(Ax.default.createDeflate());default:return e}}async function mN(e){let t=[];return await new Promise((r,i)=>{e.on("error",n=>i(n)),e.on("readable",()=>e.read()),e.on("data",n=>{typeof n=="string"&&i(new Error("Read stream not binary")),t.push(TR(n))}),e.on("end",()=>{let n=jye(t);r(n)})})}function jye(e){let t=e.map(a=>a instanceof ArrayBuffer?new Uint8Array(a):a),r=t.reduce((a,o)=>a+o.byteLength,0),i=new Uint8Array(r),n=0;for(let a of t)i.set(a,n),n+=a.byteLength;return i.buffer}var RR=Le(require("stream")),Lye=e=>typeof e=="boolean",gN=e=>typeof e=="function",Nye=e=>e!==null&&typeof e=="object",kR=e=>Nye(e)&&gN(e.read)&&gN(e.pipe)&&Lye(e.readable),Gs=class{constructor(t,r){this.bodyUsed=!1;let{headers:i,status:n=200,statusText:a="OK",url:o}=r||{};this.url=o,this.ok=n===200,this.status=n,this.statusText=a,this.headers=new $o((r==null?void 0:r.headers)||{}),kR(t)?this._body=pN(t,i):typeof t=="string"?this._body=RR.Readable.from([new TextEncoder().encode(t)]):this._body=RR.Readable.from([t||new ArrayBuffer(0)])}get body(){return AR(!this.bodyUsed),AR(kR(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return kR(this._body)?await mN(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=="undefined")throw new Error("Blob polyfill not installed");return new Blob([await this.arrayBuffer()])}};var vN=Le(require("http")),yN=Le(require("https"));var CR=Le(require("fs"));async function IR(e,t){let r=e.split("?")[0];try{let i=await new Promise((s,u)=>{let l=CR.default.createReadStream(r,{encoding:null});l.once("readable",()=>s(l)),l.on("error",c=>u(c))}),n=200,a="OK",o=qye(r);return new Gs(i,{headers:o,status:n,statusText:a,url:e})}catch(i){let n=400,a=i.message,o={};return new Gs(i.message,{headers:o,status:n,statusText:a,url:e})}}function qye(e){let t={};if(!t["content-length"]){let r=CR.default.statSync(e);t["content-length"]=r.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip"),new $o(t)}var OR=e=>e.startsWith("data:"),Uye=e=>e.startsWith("http:")||e.startsWith("https:");async function Iv(e,t){try{if(!Uye(e)&&!OR(e))return await IR(e,t);if(OR(e)){let{arrayBuffer:l,mimeType:c}=dN(e);return new Gs(l,{headers:{"content-type":c},url:e})}let r={},i=e;e.endsWith(".gz")&&(e=e.slice(0,-3),r["content-encoding"]="gzip");let n=await Gye(i,t),a=Wye(e,n,r),{status:o,statusText:s}=Vye(n),u=!t||t.followRedirect||t.followRedirect===void 0;if(o>=300&&o<400&&a.has("location")&&u){let l=zye(e,a.get("location"));return await Iv(l,t)}return new Gs(n,{headers:a,status:o,statusText:s,url:e})}catch(r){return new Gs(null,{status:400,statusText:String(r),url:e})}}async function Gye(e,t){return await new Promise((r,i)=>{let n=Hye(e,t),a=e.startsWith("https:")?yN.default.request(n,o=>r(o)):vN.default.request(n,o=>r(o));a.on("error",o=>i(o)),a.end()})}function zye(e,t){if(t.startsWith("http"))return t;let r=new URL(e);return r.pathname=t,r.href}function Hye(e,t){let r=(t==null?void 0:t.headers)||{},i={};for(let a of Object.keys(r))i[a.toLowerCase()]=r[a];i["accept-encoding"]=i["accept-encoding"]||"gzip,br,deflate";let n=new URL(e);return _t(ce(ce({hostname:n.hostname,path:n.pathname,method:"GET"},t),t==null?void 0:t.fetch),{headers:i,port:n.port})}function Vye(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function Wye(e,t,r={}){let i={};if(t&&t.headers){let n=t.headers;for(let a in n){let o=n[a];i[a.toLowerCase()]=String(o)}}if(!i["content-length"]){let n=Kye(e);Number.isFinite(n)&&(i["content-length"]=n)}return Object.assign(i,r),new $o(i)}function Kye(e){return OR(e)?e.length-"data:".length:null}var dU=Le(fU()),pU=Le(Lv());function hU(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function sxe(e,t){let r=t.type?t.type.replace("image/",""):"jpeg",i=(0,pU.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,dU.default)(i,r,t)}function I3(e,t){let r=sxe(e,t);return new Promise(i=>{let n=[];r.on("data",a=>n.push(a)),r.on("end",()=>{let a=Buffer.concat(n);i(hU(a))})})}var K$=Le(W$()),Y$=["image/png","image/jpeg","image/gif"];async function MO(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 bOe(r,t)}function bOe(e,t){return new Promise(r=>(0,K$.default)(e,t,(i,n)=>{if(i)throw i;let a=[...n.shape],o=n.shape.length===4?n.shape.shift():1,s=n.data instanceof Buffer?new Uint8Array(n.data):n.data;r({shape:a,data:s,width:n.shape[0],height:n.shape[1],components:n.shape[2],layers:o?[o]:[]})}))}var J$=Le(X$());delete global.ReadableStream;var My=class extends J$.ReadableStream{};var DO=class{constructor(t){this.isWorking=!1;this.isCancelled=!1;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 i;try{i=r.next()}catch(n){t.error(n);break}i&&(!i.done&&!this.isCancelled?t.enqueue(i.value):t.close())}this.isWorking=!1}pull(t){this.isWorking||this.work(t)}cancel(){this.isCancelled=!0}};var FO=class extends My{constructor(t){super(new DO(t.values()),{type:"bytes"});this._chunks=t}async*[Symbol.asyncIterator](t){let r=this.getReader();yield*this._chunks,r.releaseLock()}};var Bf=class{constructor(t=[],r={}){this.parts=[],this.size=0;for(let i of t)if(typeof i=="string"){let n=new TextEncoder().encode(i);this.parts.push(n),this.size+=n.byteLength}else if(i instanceof Bf)this.size+=i.size,this.parts.push(...i.parts);else if(i instanceof ArrayBuffer)this.parts.push(new Uint8Array(i)),this.size+=i.byteLength;else if(i instanceof Uint8Array)this.parts.push(i),this.size+=i.byteLength;else if(ArrayBuffer.isView(i)){let{buffer:n,byteOffset:a,byteLength:o}=i;this.parts.push(new Uint8Array(n,a,o)),this.size+=o}else{let n=new TextEncoder().encode(String(i));this.parts.push(n),this.size+=n.byteLength}this.type=_Oe(r.type)}slice(t=0,r=this.size,i=""){let{size:n,parts:a}=this,o=t<0?Math.max(n+t,0):Math.min(t,n),s=r<0?Math.max(n+r,0):Math.min(r,n),u=Math.max(s-o,0),l=new Bf([],{type:i});if(u===0)return l;let c=0,f=[];for(let h of a){let{byteLength:d}=h;if(o>0&&d<=o)o-=d,s-=d;else{let p=h.subarray(o,Math.min(d,s));if(f.push(p),c+=p.byteLength,o=0,c>=u)break}}return l.parts=f,l.size=c,l}async arrayBuffer(){return this._toArrayBuffer()}async text(){let t=new TextDecoder,r="";for(let i of this.parts)r+=t.decode(i);return r}stream(){return new FO(this.parts)}toString(){return"[object Blob]"}get[Symbol.toStringTag](){return"Blob"}_toArrayBuffer(){let t=new ArrayBuffer(this.size),r=new Uint8Array(t),i=0;for(let n of this.parts)r.set(n,i),i+=n.byteLength;return t}};function _Oe(e=""){let t=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(t)?"":t}var jO=class extends Bf{constructor(t,r,i={}){super(t,i);this.name="";this.webkitRelativePath="";this.name=String(r).replace(/\//g,":"),this.lastModified=(i==null?void 0:i.lastModified)||Date.now()}get[Symbol.toStringTag](){return"File"}};var wOe=!qs||!("TextEncoder"in Vi);wOe&&(Vi.TextEncoder=Rv);var EOe=!qs||!("TextDecoder"in Vi);EOe&&(Vi.TextDecoder=ed);!qs&&!("atob"in Vi)&&Sx&&(Vi.atob=Sx);!qs&&!("btoa"in Vi)&&ER&&(Vi.btoa=ER);!qs&&!("Headers"in Vi)&&$o&&(Vi.Headers=$o);!qs&&!("Response"in Vi)&&Gs&&(Vi.Response=Gs);!qs&&!("fetch"in Vi)&&Iv&&(Vi.fetch=Iv);!qs&&!("DOMParser"in Vi)&&LO.DOMParser&&(Vi.DOMParser=LO.DOMParser);!qs&&!("_encodeImageNode"in Vi)&&I3&&(Vi._encodeImageNode=I3);!qs&&!("_parseImageNode"in Vi)&&MO&&(Vi._parseImageNode=MO,Vi._imageFormatsNode=Y$);"allSettled"in Promise||(Promise.allSettled=fN);var Q0e=Le(require("path"));function zt(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var Qu={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,global:typeof global!="undefined"&&global,document:typeof document!="undefined"&&document},Q$=Qu.self||Qu.window||Qu.global||{},Z$=Qu.window||Qu.self||Qu.global||{},eX=Qu.global||Qu.self||Qu.window||{},tX=Qu.document||{};var ji=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var rX=typeof process!="undefined"&&process.version&&/v([0-9]*)/.exec(process.version),SOe=rX&&parseFloat(rX[1])||0;var Mf="3.4.2";function ia(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Zu={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,global:typeof global!="undefined"&&global,document:typeof document!="undefined"&&document},_yt=Zu.self||Zu.window||Zu.global||{},xyt=Zu.window||Zu.self||Zu.global||{},iX=Zu.global||Zu.self||Zu.window||{},wyt=Zu.document||{};var Ln=typeof process!="object"||String(process)!=="[object process]"||process.browser,Dy=typeof importScripts=="function",nX=typeof window!="undefined"&&typeof window.orientation!="undefined",aX=typeof process!="undefined"&&process.version&&/v([0-9]*)/.exec(process.version),Eyt=aX&&parseFloat(aX[1])||0;var xE=class{constructor(t,r){this.isRunning=!0;this._resolve=()=>{};this._reject=()=>{};this.name=t,this.workerThread=r,this.result=new Promise((i,n)=>{this._resolve=i,this._reject=n})}postMessage(t,r){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:r})}done(t){ia(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){ia(this.isRunning),this.isRunning=!1,this._reject(t)}};var Wm={};To(Wm,{NodeWorker:()=>Fy});var oX=Le(require("worker_threads"));dv(Wm,Le(require("worker_threads")));var Fy=oX.Worker;var NO=new Map;function sX(e){ia(e.source&&!e.url||!e.source&&e.url);let t=NO.get(e.source||e.url);return t||(e.url&&(t=AOe(e.url),NO.set(e.url,t)),e.source&&(t=uX(e.source),NO.set(e.source,t))),ia(t),t}function AOe(e){if(!e.startsWith("http"))return e;let t=TOe(e);return uX(t)}function uX(e){let t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function TOe(e){return`try {
118
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function Act(e,t){if(!!e){if(typeof e=="string")return r0e(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return r0e(e,t)}}function r0e(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}var Tct=t0e.default.mark(i0e),kct=10,Rct=65535;function Cct(e,t){var r=i0e(e),i=r.next();if(i.done||i.value.line!=="P5")throw new Error("Geoid model file: File not in PGM format");var n=Number.MAX_VALUE,a=0,o=-1,s=-1,u="NONE",l="UNKNOWN",c=0,f=0,h=null,d=null;do{i=r.next();var p=i.value.line;if(!!p.length)if(p[0]==="#"){var y=p.split(" "),g=y[0],b=y[1];if(g!=="#"||!b)continue;var E=y.length>2?y.slice(2):[];if(b==="Description")u=E.join(" ");else if(b==="DateTime")l=E.join(" ");else if(b==="Offset"){if(!y[2])throw new Error("Geoid model file: Error reading offset");n=parseInt(y[2],10)}else if(b==="Scale"){if(!y[2])throw new Error("Geoid model file: Error reading scale");a=parseFloat(y[2])}else b===(t.cubic?"MaxCubicError":"MaxBilinearError")?isFinite(parseFloat(y[2]))&&(o=parseFloat(y[2])):b===(t.cubic?"RMSCubicError":"RMSBilinearError")&&isFinite(parseFloat(y[2]))&&(s=parseFloat(y[2]))}else{var S=p.split(" ");if(S=S.filter(function(I){return I!==""}),c=parseInt(S[0],10),f=parseInt(S[1],10),!(c&&f))throw new Error("Geoid model file: Error reading raster size");break}}while(!i.done);i=r.next();var k=parseInt(i.value.line,10);if(i.done)throw new Error("Geoid model file: Error reading maxval");if(k!==Rct)throw new Error("Geoid model file: Incorrect value of maxval");if(h=i.value.offset,d=c,n===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||c<2)throw new Error("Geoid model file: Raster size too small");if(c&1)throw new Error("Geoid model file: Raster width is odd");if(!(f&1))throw new Error("Geoid model file: Raster height is even");var R=c/360,M=(f-1)/180;return new Ect.default({cubic:t.cubic,_width:c,_height:f,_rlonres:R,_rlatres:M,_offset:n,_scale:a,_swidth:d,_datastart:h,_maxerror:o,_rmserror:s,_description:u,_datetime:l,data:e})}function i0e(e){var t,r,i,n;return t0e.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:t=0;case 1:if(r=e.indexOf(kct,t),r===-1){o.next=9;break}return i=e.subarray(t,r),t=r+1,o.next=7,{offset:t,line:n0e(i)};case 7:o.next=13;break;case 9:return n=e.subarray(t,e.length),t=e.length,o.next=13,{offset:t,line:n0e(n)};case 13:if(t<e.length){o.next=1;break}case 14:return o.abrupt("return",{offset:t,line:""});case 15:case"end":return o.stop()}},Tct)}function n0e(e){var t="",r=Sct(e),i;try{for(r.s();!(i=r.n()).done;){var n=i.value;t+=String.fromCharCode(n)}}catch(a){r.e(a)}finally{r.f()}return t}});var o0e=T(jk=>{"use strict";var Ict=ti();Object.defineProperty(jk,"__esModule",{value:!0});Object.defineProperty(jk,"parsePGM",{enumerable:!0,get:function(){return Oct.parsePGM}});Object.defineProperty(jk,"Geoid",{enumerable:!0,get:function(){return Pct.default}});var Oct=a0e(),Pct=Ict(_L())});var E0e=T(Uk=>{"use strict";Object.defineProperty(Uk,"__esModule",{value:!0});Uk.default=void 0;var sft={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,FUNC_ADD:32774,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,BLEND_COLOR:32773,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,VENDOR:7936,RENDERER:7937,VERSION:7938,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,BROWSER_DEFAULT_WEBGL:37444,STATIC_DRAW:35044,STREAM_DRAW:35040,DYNAMIC_DRAW:35048,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,CULL_FACE:2884,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,BLEND:3042,DEPTH_TEST:2929,DITHER:3024,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,SCISSOR_TEST:3089,STENCIL_TEST:2960,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CONTEXT_LOST_WEBGL:37442,CW:2304,CCW:2305,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,COMPILE_STATUS:35713,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_ATTRIBUTES:35721,ACTIVE_UNIFORMS:35718,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,ALWAYS:519,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,GEQUAL:518,NOTEQUAL:517,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,TEXTURE_WIDTH:4096,TEXTURE_HEIGHT:4097,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,MAX_3D_TEXTURE_SIZE:32883,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,MAX_TEXTURE_LOD_BIAS:34045,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,RASTERIZER_DISCARD:35977,VERTEX_ARRAY_BINDING:34229,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,MAX_ELEMENT_INDEX:36203,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,RGB9_E5:35901,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2UI:36975,TEXTURE_IMMUTABLE_FORMAT:37167,TEXTURE_IMMUTABLE_LEVELS:33503,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,UNSIGNED_INT_24_8:34042,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,INT_2_10_10_10_REV:36255,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,MAX_SAMPLES:36183,SAMPLER_BINDING:35097,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,UNSIGNED_NORMALIZED:35863,SIGNED_NORMALIZED:36764,VERTEX_ATTRIB_ARRAY_INTEGER:35069,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,DEPTH24_STENCIL8:35056,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,COLOR:6144,DEPTH:6145,STENCIL:6146,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,INVALID_INDEX:4294967295,TIMEOUT_IGNORED:-1,MAX_CLIENT_WAIT_TIMEOUT_WEBGL:37447,VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,UNMASKED_VENDOR_WEBGL:37445,UNMASKED_RENDERER_WEBGL:37446,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047,TEXTURE_MAX_ANISOTROPY_EXT:34046,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:35986,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,UNSIGNED_INT_24_8_WEBGL:34042,HALF_FLOAT_OES:36193,RGBA32F_EXT:34836,RGB32F_EXT:34837,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:33297,UNSIGNED_NORMALIZED_EXT:35863,MIN_EXT:32775,MAX_EXT:32776,SRGB_EXT:35904,SRGB_ALPHA_EXT:35906,SRGB8_ALPHA8_EXT:35907,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:33296,FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723,COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067,COLOR_ATTACHMENT4_WEBGL:36068,COLOR_ATTACHMENT5_WEBGL:36069,COLOR_ATTACHMENT6_WEBGL:36070,COLOR_ATTACHMENT7_WEBGL:36071,COLOR_ATTACHMENT8_WEBGL:36072,COLOR_ATTACHMENT9_WEBGL:36073,COLOR_ATTACHMENT10_WEBGL:36074,COLOR_ATTACHMENT11_WEBGL:36075,COLOR_ATTACHMENT12_WEBGL:36076,COLOR_ATTACHMENT13_WEBGL:36077,COLOR_ATTACHMENT14_WEBGL:36078,COLOR_ATTACHMENT15_WEBGL:36079,DRAW_BUFFER0_WEBGL:34853,DRAW_BUFFER1_WEBGL:34854,DRAW_BUFFER2_WEBGL:34855,DRAW_BUFFER3_WEBGL:34856,DRAW_BUFFER4_WEBGL:34857,DRAW_BUFFER5_WEBGL:34858,DRAW_BUFFER6_WEBGL:34859,DRAW_BUFFER7_WEBGL:34860,DRAW_BUFFER8_WEBGL:34861,DRAW_BUFFER9_WEBGL:34862,DRAW_BUFFER10_WEBGL:34863,DRAW_BUFFER11_WEBGL:34864,DRAW_BUFFER12_WEBGL:34865,DRAW_BUFFER13_WEBGL:34866,DRAW_BUFFER14_WEBGL:34867,DRAW_BUFFER15_WEBGL:34868,MAX_COLOR_ATTACHMENTS_WEBGL:36063,MAX_DRAW_BUFFERS_WEBGL:34852,VERTEX_ARRAY_BINDING_OES:34229,QUERY_COUNTER_BITS_EXT:34916,CURRENT_QUERY_EXT:34917,QUERY_RESULT_EXT:34918,QUERY_RESULT_AVAILABLE_EXT:34919,TIME_ELAPSED_EXT:35007,TIMESTAMP_EXT:36392,GPU_DISJOINT_EXT:36795};Uk.default=sft});var LO=Le(iN());var qs=typeof process!="object"||String(process)!=="[object process]"||process.browser,vR={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,global:typeof global!="undefined"&&global},Vi=vR.global||vR.self||vR.window;var nN={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]};global["encoding-indexes"]=nN||{};function Zt(e,t,r){return t<=e&&e<=r}function uye(e,t){return e.indexOf(t)!==-1}var Ul=Math.floor;function wx(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function lye(e){for(var t=String(e),r=t.length,i=0,n=[];i<r;){var a=t.charCodeAt(i);if(a<55296||a>57343)n.push(a);else if(56320<=a&&a<=57343)n.push(65533);else if(55296<=a&&a<=56319)if(i===r-1)n.push(65533);else{var o=t.charCodeAt(i+1);if(56320<=o&&o<=57343){var s=a&1023,u=o&1023;n.push(65536+(s<<10)+u),i+=1}else n.push(65533)}i+=1}return n}function cye(e){for(var t="",r=0;r<e.length;++r){var i=e[r];i<=65535?t+=String.fromCharCode(i):(i-=65536,t+=String.fromCharCode((i>>10)+55296,(i&1023)+56320))}return t}function Ko(e){return 0<=e&&e<=127}var Yo=Ko,Rr=-1;function yR(e){this.tokens=[].slice.call(e),this.tokens.reverse()}yR.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Rr},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 pi=-1;function Cr(e,t){if(e)throw TypeError("Decoder error");return t||65533}function Us(e){throw TypeError("The code point "+e+" could not be encoded.")}function fye(){}fye.prototype={handler:function(e,t){}};function hye(){}hye.prototype={handler:function(e,t){}};function bR(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(_R,e)?_R[e]:null}var aN=[{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"}],_R={};aN.forEach(function(e){e.encodings.forEach(function(t){t.labels.forEach(function(r){_R[r]=t})})});var uo={},lo={};function tm(e,t){return t&&t[e]||null}function rm(e,t){var r=t.indexOf(e);return r===-1?null:r}function Ua(e){if(!("encoding-indexes"in global))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return global["encoding-indexes"][e]}function dye(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var t=0,r=0,i=Ua("gb18030-ranges"),n;for(n=0;n<i.length;++n){var a=i[n];if(a[0]<=e)t=a[0],r=a[1];else break}return r+e-t}function pye(e){if(e===59335)return 7457;var t=0,r=0,i=Ua("gb18030-ranges"),n;for(n=0;n<i.length;++n){var a=i[n];if(a[1]<=e)t=a[1],r=a[0];else break}return r+e-t}function mye(e){xR=xR||Ua("jis0208").map(function(r,i){return Zt(i,8272,8835)?null:r});var t=xR;return t.indexOf(e)}var xR;function gye(e){wR=wR||Ua("big5").map(function(r,i){return i<(161-129)*157?null:r});var t=wR;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?t.lastIndexOf(e):rm(e,t)}var wR,oN="utf-8";function ed(e,t){if(!(this instanceof ed))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):oN,t=wx(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=bR(e);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!lo[r.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var i=this;return i._encoding=r,Boolean(t.fatal)&&(i._error_mode="fatal"),Boolean(t.ignoreBOM)&&(i._ignoreBOM=!0),Object.defineProperty||(this.encoding=i._encoding.name.toLowerCase(),this.fatal=i._error_mode==="fatal",this.ignoreBOM=i._ignoreBOM),i}Object.defineProperty&&(Object.defineProperty(ed.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(ed.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(ed.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));ed.prototype.decode=function(t,r){var i;typeof t=="object"&&t instanceof ArrayBuffer?i=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?i=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):i=new Uint8Array(0),r=wx(r),this._do_not_flush||(this._decoder=lo[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(r.stream);for(var n=new yR(i),a=[],o;;){var s=n.read();if(s===Rr||(o=this._decoder.handler(n,s),o===pi))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(n,n.read()),o===pi)break;o!==null&&(Array.isArray(o)?a.push.apply(a,o):a.push(o))}while(!n.endOfStream());this._decoder=null}function u(l){return uye(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(l.length>0&&l[0]===65279?(this._BOMseen=!0,l.shift()):l.length>0&&(this._BOMseen=!0)),cye(l)}return u.call(this,a)};function Rv(e,t){if(!(this instanceof Rv))throw TypeError("Called as a function. Did you forget 'new'?");t=wx(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):oN;var i=bR(e);if(i===null||i.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!uo[i.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=i}else r._encoding=bR("utf-8"),e!==void 0&&"console"in global&&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(Rv.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});Rv.prototype.encode=function(t,r){t=t===void 0?"":String(t),r=wx(r),this._do_not_flush||(this._encoder=uo[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(r.stream);for(var i=new yR(lye(t)),n=[],a;;){var o=i.read();if(o===Rr||(a=this._encoder.handler(i,o),a===pi))break;Array.isArray(a)?n.push.apply(n,a):n.push(a)}if(!this._do_not_flush){for(;a=this._encoder.handler(i,i.read()),a!==pi;)Array.isArray(a)?n.push.apply(n,a):n.push(a);this._encoder=null}return new Uint8Array(n)};function vye(e){var t=e.fatal,r=0,i=0,n=0,a=128,o=191;this.handler=function(s,u){if(u===Rr&&n!==0)return n=0,Cr(t);if(u===Rr)return pi;if(n===0){if(Zt(u,0,127))return u;if(Zt(u,194,223))n=1,r=u&31;else if(Zt(u,224,239))u===224&&(a=160),u===237&&(o=159),n=2,r=u&15;else if(Zt(u,240,244))u===240&&(a=144),u===244&&(o=143),n=3,r=u&7;else return Cr(t);return null}if(!Zt(u,a,o))return r=n=i=0,a=128,o=191,s.prepend(u),Cr(t);if(a=128,o=191,r=r<<6|u&63,i+=1,i!==n)return null;var l=r;return r=n=i=0,l}}function yye(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return pi;if(Yo(i))return i;var n,a;Zt(i,128,2047)?(n=1,a=192):Zt(i,2048,65535)?(n=2,a=224):Zt(i,65536,1114111)&&(n=3,a=240);for(var o=[(i>>6*n)+a];n>0;){var s=i>>6*(n-1);o.push(128|s&63),n-=1}return o}}uo["UTF-8"]=function(e){return new yye(e)};lo["UTF-8"]=function(e){return new vye(e)};function bye(e,t){var r=t.fatal;this.handler=function(i,n){if(n===Rr)return pi;if(Ko(n))return n;var a=e[n-128];return a===null?Cr(r):a}}function _ye(e,t){var r=t.fatal;this.handler=function(i,n){if(n===Rr)return pi;if(Yo(n))return n;var a=rm(n,e);return a===null&&Us(n),a+128}}(function(){"encoding-indexes"in global&&aN.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(t){var r=t.name,i=Ua(r.toLowerCase());lo[r]=function(n){return new bye(i,n)},uo[r]=function(n){return new _ye(i,n)}})})})();lo.GBK=function(e){return new sN(e)};uo.GBK=function(e){return new uN(e,!0)};function sN(e){var t=e.fatal,r=0,i=0,n=0;this.handler=function(a,o){if(o===Rr&&r===0&&i===0&&n===0)return pi;o===Rr&&(r!==0||i!==0||n!==0)&&(r=0,i=0,n=0,Cr(t));var s;if(n!==0){s=null,Zt(o,48,57)&&(s=dye((((r-129)*10+i-48)*126+n-129)*10+o-48));var u=[i,n,o];return r=0,i=0,n=0,s===null?(a.prepend(u),Cr(t)):s}if(i!==0)return Zt(o,129,254)?(n=o,null):(a.prepend([i,o]),r=0,i=0,Cr(t));if(r!==0){if(Zt(o,48,57))return i=o,null;var l=r,c=null;r=0;var f=o<127?64:65;return(Zt(o,64,126)||Zt(o,128,254))&&(c=(l-129)*190+(o-f)),s=c===null?null:tm(c,Ua("gb18030")),s===null&&Ko(o)&&a.prepend(o),s===null?Cr(t):s}return Ko(o)?o:o===128?8364:Zt(o,129,254)?(r=o,null):Cr(t)}}function uN(e,t){var r=e.fatal;this.handler=function(i,n){if(n===Rr)return pi;if(Yo(n))return n;if(n===58853)return Us(n);if(t&&n===8364)return 128;var a=rm(n,Ua("gb18030"));if(a!==null){var o=Ul(a/190)+129,s=a%190,u=s<63?64:65;return[o,s+u]}if(t)return Us(n);a=pye(n);var l=Ul(a/10/126/10);a=a-l*10*126*10;var c=Ul(a/10/126);a=a-c*10*126;var f=Ul(a/10),h=a-f*10;return[l+129,c+48,f+129,h+48]}}uo.gb18030=function(e){return new uN(e)};lo.gb18030=function(e){return new sN(e)};function xye(e){var t=e.fatal,r=0;this.handler=function(i,n){if(n===Rr&&r!==0)return r=0,Cr(t);if(n===Rr&&r===0)return pi;if(r!==0){var a=r,o=null;r=0;var s=n<127?64:98;switch((Zt(n,64,126)||Zt(n,161,254))&&(o=(a-129)*157+(n-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:tm(o,Ua("big5"));return u===null&&Ko(n)&&i.prepend(n),u===null?Cr(t):u}return Ko(n)?n:Zt(n,129,254)?(r=n,null):Cr(t)}}function wye(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return pi;if(Yo(i))return i;var n=gye(i);if(n===null)return Us(i);var a=Ul(n/157)+129;if(a<161)return Us(i);var o=n%157,s=o<63?64:98;return[a,o+s]}}uo.Big5=function(e){return new wye(e)};lo.Big5=function(e){return new xye(e)};function Eye(e){var t=e.fatal,r=!1,i=0;this.handler=function(n,a){if(a===Rr&&i!==0)return i=0,Cr(t);if(a===Rr&&i===0)return pi;if(i===142&&Zt(a,161,223))return i=0,65377-161+a;if(i===143&&Zt(a,161,254))return r=!0,i=a,null;if(i!==0){var o=i;i=0;var s=null;return Zt(o,161,254)&&Zt(a,161,254)&&(s=tm((o-161)*94+(a-161),Ua(r?"jis0212":"jis0208"))),r=!1,Zt(a,161,254)||n.prepend(a),s===null?Cr(t):s}return Ko(a)?a:a===142||a===143||Zt(a,161,254)?(i=a,null):Cr(t)}}function Sye(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return pi;if(Yo(i))return i;if(i===165)return 92;if(i===8254)return 126;if(Zt(i,65377,65439))return[142,i-65377+161];i===8722&&(i=65293);var n=rm(i,Ua("jis0208"));if(n===null)return Us(i);var a=Ul(n/94)+161,o=n%94+161;return[a,o]}}uo["EUC-JP"]=function(e){return new Sye(e)};lo["EUC-JP"]=function(e){return new Eye(e)};function Aye(e){var t=e.fatal,r={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},i=r.ASCII,n=r.ASCII,a=0,o=!1;this.handler=function(s,u){switch(i){default:case r.ASCII:return u===27?(i=r.EscapeStart,null):Zt(u,0,127)&&u!==14&&u!==15&&u!==27?(o=!1,u):u===Rr?pi:(o=!1,Cr(t));case r.Roman:return u===27?(i=r.EscapeStart,null):u===92?(o=!1,165):u===126?(o=!1,8254):Zt(u,0,127)&&u!==14&&u!==15&&u!==27&&u!==92&&u!==126?(o=!1,u):u===Rr?pi:(o=!1,Cr(t));case r.Katakana:return u===27?(i=r.EscapeStart,null):Zt(u,33,95)?(o=!1,65377-33+u):u===Rr?pi:(o=!1,Cr(t));case r.LeadByte:return u===27?(i=r.EscapeStart,null):Zt(u,33,126)?(o=!1,a=u,i=r.TrailByte,null):u===Rr?pi:(o=!1,Cr(t));case r.TrailByte:if(u===27)return i=r.EscapeStart,Cr(t);if(Zt(u,33,126)){i=r.LeadByte;var l=(a-33)*94+u-33,c=tm(l,Ua("jis0208"));return c===null?Cr(t):c}return u===Rr?(i=r.LeadByte,s.prepend(u),Cr(t)):(i=r.LeadByte,Cr(t));case r.EscapeStart:return u===36||u===40?(a=u,i=r.Escape,null):(s.prepend(u),o=!1,i=n,Cr(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){i=i=h;var d=o;return o=!0,d?Cr(t):null}return s.prepend([f,u]),o=!1,i=n,Cr(t)}}}function Tye(e){var t=e.fatal,r={ASCII:0,Roman:1,jis0208:2},i=r.ASCII;this.handler=function(n,a){if(a===Rr&&i!==r.ASCII)return n.prepend(a),i=r.ASCII,[27,40,66];if(a===Rr&&i===r.ASCII)return pi;if((i===r.ASCII||i===r.Roman)&&(a===14||a===15||a===27))return Us(65533);if(i===r.ASCII&&Yo(a))return a;if(i===r.Roman&&(Yo(a)&&a!==92&&a!==126||a==165||a==8254)){if(Yo(a))return a;if(a===165)return 92;if(a===8254)return 126}if(Yo(a)&&i!==r.ASCII)return n.prepend(a),i=r.ASCII,[27,40,66];if((a===165||a===8254)&&i!==r.Roman)return n.prepend(a),i=r.Roman,[27,40,74];a===8722&&(a=65293);var o=rm(a,Ua("jis0208"));if(o===null)return Us(a);if(i!==r.jis0208)return n.prepend(a),i=r.jis0208,[27,36,66];var s=Ul(o/94)+33,u=o%94+33;return[s,u]}}uo["ISO-2022-JP"]=function(e){return new Tye(e)};lo["ISO-2022-JP"]=function(e){return new Aye(e)};function kye(e){var t=e.fatal,r=0;this.handler=function(i,n){if(n===Rr&&r!==0)return r=0,Cr(t);if(n===Rr&&r===0)return pi;if(r!==0){var a=r,o=null;r=0;var s=n<127?64:65,u=a<160?129:193;if((Zt(n,64,126)||Zt(n,128,252))&&(o=(a-u)*188+n-s),Zt(o,8836,10715))return 57344-8836+o;var l=o===null?null:tm(o,Ua("jis0208"));return l===null&&Ko(n)&&i.prepend(n),l===null?Cr(t):l}return Ko(n)||n===128?n:Zt(n,161,223)?65377-161+n:Zt(n,129,159)||Zt(n,224,252)?(r=n,null):Cr(t)}}function Rye(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return pi;if(Yo(i)||i===128)return i;if(i===165)return 92;if(i===8254)return 126;if(Zt(i,65377,65439))return i-65377+161;i===8722&&(i=65293);var n=mye(i);if(n===null)return Us(i);var a=Ul(n/188),o=a<31?129:193,s=n%188,u=s<63?64:65;return[a+o,s+u]}}uo.Shift_JIS=function(e){return new Rye(e)};lo.Shift_JIS=function(e){return new kye(e)};function Cye(e){var t=e.fatal,r=0;this.handler=function(i,n){if(n===Rr&&r!==0)return r=0,Cr(t);if(n===Rr&&r===0)return pi;if(r!==0){var a=r,o=null;r=0,Zt(n,65,254)&&(o=(a-129)*190+(n-65));var s=o===null?null:tm(o,Ua("euc-kr"));return o===null&&Ko(n)&&i.prepend(n),s===null?Cr(t):s}return Ko(n)?n:Zt(n,129,254)?(r=n,null):Cr(t)}}function Iye(e){var t=e.fatal;this.handler=function(r,i){if(i===Rr)return pi;if(Yo(i))return i;var n=rm(i,Ua("euc-kr"));if(n===null)return Us(i);var a=Ul(n/190)+129,o=n%190+65;return[a,o]}}uo["EUC-KR"]=function(e){return new Iye(e)};lo["EUC-KR"]=function(e){return new Cye(e)};function Ex(e,t){var r=e>>8,i=e&255;return t?[r,i]:[i,r]}function lN(e,t){var r=t.fatal,i=null,n=null;this.handler=function(a,o){if(o===Rr&&(i!==null||n!==null))return Cr(r);if(o===Rr&&i===null&&n===null)return pi;if(i===null)return i=o,null;var s;if(e?s=(i<<8)+o:s=(o<<8)+i,i=null,n!==null){var u=n;return n=null,Zt(s,56320,57343)?65536+(u-55296)*1024+(s-56320):(a.prepend(Ex(s,e)),Cr(r))}return Zt(s,55296,56319)?(n=s,null):Zt(s,56320,57343)?Cr(r):s}}function cN(e,t){var r=t.fatal;this.handler=function(i,n){if(n===Rr)return pi;if(Zt(n,0,65535))return Ex(n,e);var a=Ex((n-65536>>10)+55296,e),o=Ex((n-65536&1023)+56320,e);return a.concat(o)}}uo["UTF-16BE"]=function(e){return new cN(!0,e)};lo["UTF-16BE"]=function(e){return new lN(!0,e)};uo["UTF-16LE"]=function(e){return new cN(!1,e)};lo["UTF-16LE"]=function(e){return new lN(!1,e)};function Oye(e){var t=e.fatal;this.handler=function(r,i){return i===Rr?pi:Ko(i)?i:63360+i-128}}function Pye(e){var t=e.fatal;this.handler=function(r,i){return i===Rr?pi:Yo(i)?i:Zt(i,63360,63487)?i-63360+128:Us(i)}}uo["x-user-defined"]=function(e){return new Pye(e)};lo["x-user-defined"]=function(e){return new Oye(e)};var Bye="rejected",Mye="fulfilled";function fN(e){let t=e.map(r=>r.then(i=>({status:Mye,value:i})).catch(i=>({status:Bye,reason:i})));return Promise.all(t)}function Sx(e){return Buffer.from(e).toString("base64")}function ER(e){return Buffer.from(e,"base64").toString("ascii")}var $o=class{constructor(t){this.map={},t instanceof $o?t.forEach((r,i)=>this.append(i,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=Cv(t),r=hN(r);let i=this.map[t];this.map[t]=i?`${i}, ${r}`:r}delete(t){delete this.map[Cv(t)]}get(t){return t=Cv(t),this.has(t)?this.map[t]:null}has(t){return this.map.hasOwnProperty(Cv(t))}set(t,r){this.map[Cv(t)]=hN(r)}forEach(t,r=null){for(let i in this.map)this.map.hasOwnProperty(i)&&(r?t.call(r,this.map[i],i,this):t(this.map[i],i,this))}keys(){let t=[];return this.forEach(function(r,i){t.push(i)}),SR(t)}values(){let t=[];return this.forEach(function(r){t.push(r)}),SR(t)}entries(){let t=[];return this.forEach(function(r,i){t.push([i,r])}),SR(t)}*[Symbol.iterator](){yield*this.entries()}};function Cv(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 hN(e){return typeof e!="string"&&(e=String(e)),e}function SR(e){let t={next(){let r=e.shift();return{done:r===void 0,value:r}}};return t[Symbol.iterator]=function(){return t},t}function AR(e,t){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${t}`)}var Ax=Le(require("zlib"));var Dye=e=>e&&e instanceof ArrayBuffer,Fye=e=>e&&e instanceof Buffer;function dN(e){let t=e.indexOf(","),r,i;return e.slice(t-7,t)===";base64"?(r=Buffer.from(e.slice(t+1),"base64"),i=e.slice(5,t-7).trim()):(r=Buffer.from(decodeURIComponent(e.slice(t+1))),i=e.slice(5,t).trim()),i?i.startsWith(";")&&(i=`text/plain${i}`):i="text/plain;charset=US-ASCII",{arrayBuffer:TR(r),mimeType:i}}function TR(e){if(Dye(e))return e;if(Fye(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)})`)}function pN(e,t){switch(t.get("content-encoding")){case"br":return e.pipe(Ax.default.createBrotliDecompress());case"gzip":return e.pipe(Ax.default.createGunzip());case"deflate":return e.pipe(Ax.default.createDeflate());default:return e}}async function mN(e){let t=[];return await new Promise((r,i)=>{e.on("error",n=>i(n)),e.on("readable",()=>e.read()),e.on("data",n=>{typeof n=="string"&&i(new Error("Read stream not binary")),t.push(TR(n))}),e.on("end",()=>{let n=jye(t);r(n)})})}function jye(e){let t=e.map(a=>a instanceof ArrayBuffer?new Uint8Array(a):a),r=t.reduce((a,o)=>a+o.byteLength,0),i=new Uint8Array(r),n=0;for(let a of t)i.set(a,n),n+=a.byteLength;return i.buffer}var RR=Le(require("stream")),Lye=e=>typeof e=="boolean",gN=e=>typeof e=="function",Nye=e=>e!==null&&typeof e=="object",kR=e=>Nye(e)&&gN(e.read)&&gN(e.pipe)&&Lye(e.readable),Gs=class{constructor(t,r){this.bodyUsed=!1;let{headers:i,status:n=200,statusText:a="OK",url:o}=r||{};this.url=o,this.ok=n===200,this.status=n,this.statusText=a,this.headers=new $o((r==null?void 0:r.headers)||{}),kR(t)?this._body=pN(t,i):typeof t=="string"?this._body=RR.Readable.from([new TextEncoder().encode(t)]):this._body=RR.Readable.from([t||new ArrayBuffer(0)])}get body(){return AR(!this.bodyUsed),AR(kR(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return kR(this._body)?await mN(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=="undefined")throw new Error("Blob polyfill not installed");return new Blob([await this.arrayBuffer()])}};var vN=Le(require("http")),yN=Le(require("https"));var CR=Le(require("fs"));async function IR(e,t){let r=e.split("?")[0];try{let i=await new Promise((s,u)=>{let l=CR.default.createReadStream(r,{encoding:null});l.once("readable",()=>s(l)),l.on("error",c=>u(c))}),n=200,a="OK",o=qye(r);return new Gs(i,{headers:o,status:n,statusText:a,url:e})}catch(i){let n=400,a=i.message,o={};return new Gs(i.message,{headers:o,status:n,statusText:a,url:e})}}function qye(e){let t={};if(!t["content-length"]){let r=CR.default.statSync(e);t["content-length"]=r.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip"),new $o(t)}var OR=e=>e.startsWith("data:"),Uye=e=>e.startsWith("http:")||e.startsWith("https:");async function Iv(e,t){try{if(!Uye(e)&&!OR(e))return await IR(e,t);if(OR(e)){let{arrayBuffer:l,mimeType:c}=dN(e);return new Gs(l,{headers:{"content-type":c},url:e})}let r={},i=e;e.endsWith(".gz")&&(e=e.slice(0,-3),r["content-encoding"]="gzip");let n=await Gye(i,t),a=Wye(e,n,r),{status:o,statusText:s}=Vye(n),u=!t||t.followRedirect||t.followRedirect===void 0;if(o>=300&&o<400&&a.has("location")&&u){let l=zye(e,a.get("location"));return await Iv(l,t)}return new Gs(n,{headers:a,status:o,statusText:s,url:e})}catch(r){return new Gs(null,{status:400,statusText:String(r),url:e})}}async function Gye(e,t){return await new Promise((r,i)=>{let n=Hye(e,t),a=e.startsWith("https:")?yN.default.request(n,o=>r(o)):vN.default.request(n,o=>r(o));a.on("error",o=>i(o)),a.end()})}function zye(e,t){if(t.startsWith("http"))return t;let r=new URL(e);return r.pathname=t,r.href}function Hye(e,t){let r=(t==null?void 0:t.headers)||{},i={};for(let a of Object.keys(r))i[a.toLowerCase()]=r[a];i["accept-encoding"]=i["accept-encoding"]||"gzip,br,deflate";let n=new URL(e);return _t(ce(ce({hostname:n.hostname,path:n.pathname,method:"GET"},t),t==null?void 0:t.fetch),{headers:i,port:n.port})}function Vye(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function Wye(e,t,r={}){let i={};if(t&&t.headers){let n=t.headers;for(let a in n){let o=n[a];i[a.toLowerCase()]=String(o)}}if(!i["content-length"]){let n=Kye(e);Number.isFinite(n)&&(i["content-length"]=n)}return Object.assign(i,r),new $o(i)}function Kye(e){return OR(e)?e.length-"data:".length:null}var dU=Le(fU()),pU=Le(Lv());function hU(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function sxe(e,t){let r=t.type?t.type.replace("image/",""):"jpeg",i=(0,pU.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,dU.default)(i,r,t)}function I3(e,t){let r=sxe(e,t);return new Promise(i=>{let n=[];r.on("data",a=>n.push(a)),r.on("end",()=>{let a=Buffer.concat(n);i(hU(a))})})}var K$=Le(W$()),Y$=["image/png","image/jpeg","image/gif"];async function MO(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 bOe(r,t)}function bOe(e,t){return new Promise(r=>(0,K$.default)(e,t,(i,n)=>{if(i)throw i;let a=[...n.shape],o=n.shape.length===4?n.shape.shift():1,s=n.data instanceof Buffer?new Uint8Array(n.data):n.data;r({shape:a,data:s,width:n.shape[0],height:n.shape[1],components:n.shape[2],layers:o?[o]:[]})}))}var J$=Le(X$());delete global.ReadableStream;var My=class extends J$.ReadableStream{};var DO=class{constructor(t){this.isWorking=!1;this.isCancelled=!1;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 i;try{i=r.next()}catch(n){t.error(n);break}i&&(!i.done&&!this.isCancelled?t.enqueue(i.value):t.close())}this.isWorking=!1}pull(t){this.isWorking||this.work(t)}cancel(){this.isCancelled=!0}};var FO=class extends My{constructor(t){super(new DO(t.values()),{type:"bytes"});this._chunks=t}async*[Symbol.asyncIterator](t){let r=this.getReader();yield*this._chunks,r.releaseLock()}};var Bf=class{constructor(t=[],r={}){this.parts=[],this.size=0;for(let i of t)if(typeof i=="string"){let n=new TextEncoder().encode(i);this.parts.push(n),this.size+=n.byteLength}else if(i instanceof Bf)this.size+=i.size,this.parts.push(...i.parts);else if(i instanceof ArrayBuffer)this.parts.push(new Uint8Array(i)),this.size+=i.byteLength;else if(i instanceof Uint8Array)this.parts.push(i),this.size+=i.byteLength;else if(ArrayBuffer.isView(i)){let{buffer:n,byteOffset:a,byteLength:o}=i;this.parts.push(new Uint8Array(n,a,o)),this.size+=o}else{let n=new TextEncoder().encode(String(i));this.parts.push(n),this.size+=n.byteLength}this.type=_Oe(r.type)}slice(t=0,r=this.size,i=""){let{size:n,parts:a}=this,o=t<0?Math.max(n+t,0):Math.min(t,n),s=r<0?Math.max(n+r,0):Math.min(r,n),u=Math.max(s-o,0),l=new Bf([],{type:i});if(u===0)return l;let c=0,f=[];for(let h of a){let{byteLength:d}=h;if(o>0&&d<=o)o-=d,s-=d;else{let p=h.subarray(o,Math.min(d,s));if(f.push(p),c+=p.byteLength,o=0,c>=u)break}}return l.parts=f,l.size=c,l}async arrayBuffer(){return this._toArrayBuffer()}async text(){let t=new TextDecoder,r="";for(let i of this.parts)r+=t.decode(i);return r}stream(){return new FO(this.parts)}toString(){return"[object Blob]"}get[Symbol.toStringTag](){return"Blob"}_toArrayBuffer(){let t=new ArrayBuffer(this.size),r=new Uint8Array(t),i=0;for(let n of this.parts)r.set(n,i),i+=n.byteLength;return t}};function _Oe(e=""){let t=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(t)?"":t}var jO=class extends Bf{constructor(t,r,i={}){super(t,i);this.name="";this.webkitRelativePath="";this.name=String(r).replace(/\//g,":"),this.lastModified=(i==null?void 0:i.lastModified)||Date.now()}get[Symbol.toStringTag](){return"File"}};var wOe=!qs||!("TextEncoder"in Vi);wOe&&(Vi.TextEncoder=Rv);var EOe=!qs||!("TextDecoder"in Vi);EOe&&(Vi.TextDecoder=ed);!qs&&!("atob"in Vi)&&Sx&&(Vi.atob=Sx);!qs&&!("btoa"in Vi)&&ER&&(Vi.btoa=ER);!qs&&!("Headers"in Vi)&&$o&&(Vi.Headers=$o);!qs&&!("Response"in Vi)&&Gs&&(Vi.Response=Gs);!qs&&!("fetch"in Vi)&&Iv&&(Vi.fetch=Iv);!qs&&!("DOMParser"in Vi)&&LO.DOMParser&&(Vi.DOMParser=LO.DOMParser);!qs&&!("_encodeImageNode"in Vi)&&I3&&(Vi._encodeImageNode=I3);!qs&&!("_parseImageNode"in Vi)&&MO&&(Vi._parseImageNode=MO,Vi._imageFormatsNode=Y$);"allSettled"in Promise||(Promise.allSettled=fN);var Q0e=Le(require("path"));function zt(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var Qu={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,global:typeof global!="undefined"&&global,document:typeof document!="undefined"&&document},Q$=Qu.self||Qu.window||Qu.global||{},Z$=Qu.window||Qu.self||Qu.global||{},eX=Qu.global||Qu.self||Qu.window||{},tX=Qu.document||{};var ji=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var rX=typeof process!="undefined"&&process.version&&/v([0-9]*)/.exec(process.version),SOe=rX&&parseFloat(rX[1])||0;var Mf="3.4.3";function ia(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Zu={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,global:typeof global!="undefined"&&global,document:typeof document!="undefined"&&document},_yt=Zu.self||Zu.window||Zu.global||{},xyt=Zu.window||Zu.self||Zu.global||{},iX=Zu.global||Zu.self||Zu.window||{},wyt=Zu.document||{};var Ln=typeof process!="object"||String(process)!=="[object process]"||process.browser,Dy=typeof importScripts=="function",nX=typeof window!="undefined"&&typeof window.orientation!="undefined",aX=typeof process!="undefined"&&process.version&&/v([0-9]*)/.exec(process.version),Eyt=aX&&parseFloat(aX[1])||0;var xE=class{constructor(t,r){this.isRunning=!0;this._resolve=()=>{};this._reject=()=>{};this.name=t,this.workerThread=r,this.result=new Promise((i,n)=>{this._resolve=i,this._reject=n})}postMessage(t,r){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:r})}done(t){ia(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){ia(this.isRunning),this.isRunning=!1,this._reject(t)}};var Wm={};To(Wm,{NodeWorker:()=>Fy});var oX=Le(require("worker_threads"));dv(Wm,Le(require("worker_threads")));var Fy=oX.Worker;var NO=new Map;function sX(e){ia(e.source&&!e.url||!e.source&&e.url);let t=NO.get(e.source||e.url);return t||(e.url&&(t=AOe(e.url),NO.set(e.url,t)),e.source&&(t=uX(e.source),NO.set(e.source,t))),ia(t),t}function AOe(e){if(!e.startsWith("http"))return e;let t=TOe(e);return uX(t)}function uX(e){let t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function TOe(e){return`try {
119
119
  importScripts('${e}');
120
120
  } catch (error) {
121
121
  console.error(error);
122
122
  throw error;
123
123
  }`}function qO(e,t=!0,r){let i=r||new Set;if(e){if(lX(e))i.add(e);else if(lX(e.buffer))i.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(t&&typeof e=="object")for(let n in e)qO(e[n],t,i)}}return r===void 0?Array.from(i):[]}function lX(e){return e?e instanceof ArrayBuffer||typeof MessagePort!="undefined"&&e instanceof MessagePort||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas:!1}function UO(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]=UO(e[r]):typeof t[r]=="function"||t[r]instanceof RegExp?t[r]={}:t[r]=e[r]}),t}var GO=()=>{},bd=class{constructor(t){this.terminated=!1;this._loadableURL="";let{name:r,source:i,url:n}=t;ia(i||n),this.name=r,this.source=i,this.url=n,this.onMessage=GO,this.onError=a=>console.log(a),this.worker=Ln?this._createBrowserWorker():this._createNodeWorker()}static isSupported(){return typeof Worker!="undefined"&&Ln||typeof Fy!="undefined"&&!Ln}destroy(){this.onMessage=GO,this.onError=GO,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,r){r=r||qO(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=sX({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 i=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;t=new Fy(i,{eval:!1})}else if(this.source)t=new Fy(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 wE=class{constructor(t){this.name="unnamed";this.maxConcurrency=1;this.maxMobileConcurrency=1;this.onDebug=()=>{};this.reuseWorkers=!0;this.props={};this.jobQueue=[];this.idleQueue=[];this.count=0;this.isDestroyed=!1;this.source=t.source,this.url=t.url,this.setProps(t)}static isSupported(){return bd.isSupported()}destroy(){this.idleQueue.forEach(t=>t.destroy()),this.isDestroyed=!0}setProps(t){this.props=ce(ce({},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=(n,a,o)=>n.done(o),i=(n,a)=>n.error(a)){let n=new Promise(a=>(this.jobQueue.push({name:t,onMessage:r,onError:i,onStart:a}),this));return this._startQueuedJob(),await n}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 i=new xE(r.name,t);t.onMessage=n=>r.onMessage(i,n.type,n.payload),t.onError=n=>r.onError(i,n),r.onStart(i);try{await i.result}finally{this.returnWorkerToQueue(t)}}}returnWorkerToQueue(t){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 bd({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return nX?this.maxMobileConcurrency:this.maxConcurrency}};var kOe={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},En=class{constructor(t){this.workerPools=new Map;this.props=ce({},kOe),this.setProps(t),this.workerPools=new Map}static isSupported(){return bd.isSupported()}static getWorkerFarm(t={}){return En._workerFarm=En._workerFarm||new En({}),En._workerFarm.setProps(t),En._workerFarm}destroy(){for(let t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props=ce(ce({},this.props),t);for(let r of this.workerPools.values())r.setProps(this._getWorkerPoolProps())}getWorkerPool(t){let{name:r,source:i,url:n}=t,a=this.workerPools.get(r);return a||(a=new wE({name:r,source:i,url:n}),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}}};var cX="latest",fX=typeof Mf!="undefined"?Mf:cX;function hX(e){let t=e.version!==fX?` (worker-utils@${fX})`:"";return`${e.name}@${e.version}${t}`}function nu(e,t={}){let r=t[e.id]||{},i=`${e.id}-worker.js`,n=r.workerUrl;if(!n&&e.id==="compression"&&(n=t.workerUrl),t._workerType==="test"&&(n=`modules/${e.module}/dist/${i}`),!n){let a=e.version;a==="latest"&&(a=cX);let o=a?`@${a}`:"";n=`https://unpkg.com/@loaders.gl/${e.module}${o}/dist/${i}`}return ia(n),n}async function jy(e,t,r={},i={}){let n=hX(e),a=En.getWorkerFarm(r),{source:o}=r,s={name:n,source:o};o||(s.url=nu(e,r));let u=a.getWorkerPool(s),l=r.jobName||e.name,c=await u.startJob(l,ROe.bind(null,i)),f=UO(r);return c.postMessage("process",{input:t,options:f}),(await c.result).result}async function ROe(e,t,r,i){switch(r){case"done":t.done(i);break;case"error":t.error(new Error(i.error));break;case"process":let{id:n,input:a,options:o}=i;try{if(!e.process){t.postMessage("error",{id:n,error:"Worker not set up to process on main thread"});return}let s=await e.process(a,o);t.postMessage("done",{id:n,result:s})}catch(s){let u=s instanceof Error?s.message:"unknown error";t.postMessage("error",{id:n,error:u})}break;default:console.warn(`process-on-worker: unknown message ${r}`)}}function zO(e,t=Mf){ia(e,"no worker provided");let r=e.version;return!(!t||!r)}var WO={};To(WO,{requireFromFile:()=>VO,requireFromString:()=>EE});var HO=Le(require("module")),dX=Le(require("path"));async function VO(e){if(e.startsWith("http")){let r=await(await fetch(e)).text();return EE(r)}return e.startsWith("/")||(e=`${process.cwd()}/${e}`),require(e)}function EE(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 i=HO.default._nodeModulePaths(dX.default.dirname(t)),n=module.parent,a=new HO.default(t,n);return a.filename=t,a.paths=[].concat((r==null?void 0:r.prependPaths)||[]).concat(i).concat((r==null?void 0:r.appendPaths)||[]),a._compile(e,t),n&&n.children&&n.children.splice(n.children.indexOf(a),1),a.exports}var COe="latest",IOe=typeof Mf!="undefined"?Mf:COe,KO={};async function el(e,t=null,r={}){return t&&(e=pX(e,t,r)),KO[e]=KO[e]||OOe(e),await KO[e]}function pX(e,t,r){if(e.startsWith("http"))return e;let i=r.modules||{};return i[e]?i[e]:Ln?r.CDN?(ia(r.CDN.startsWith("http")),`${r.CDN}/${t}@${IOe}/dist/libs/${e}`):Dy?`../src/libs/${e}`:`modules/${t}/src/libs/${e}`:`modules/${t}/dist/libs/${e}`}async function OOe(e){if(e.endsWith("wasm"))return await(await fetch(e)).arrayBuffer();if(!Ln)try{return WO&&VO&&await VO(e)}catch{return null}if(Dy)return importScripts(e);let r=await(await fetch(e)).text();return POe(r,e)}function POe(e,t){if(!Ln)return EE&&EE(e,t);if(Dy)return eval.call(iX,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}var vX=Le(require("child_process"));var mX=Le(require("child_process"));function gX(e=3e3){return new Promise(t=>{mX.default.exec("lsof -i -P -n | grep LISTEN",(r,i)=>{if(r){t(e);return}let n=[],a=/:(\d+) \(LISTEN\)/;i.split(`
124
- `).forEach(s=>{let u=a.exec(s);u&&n.push(Number(u[1]))});let o=e;for(;n.includes(o);)o++;t(o)})})}var yX={command:"",arguments:[],port:5e3,autoPort:!0,wait:2e3,onSuccess:e=>{console.log(`Started ${e.props.command}`)}},Df=class{constructor({id:t="browser-driver"}={}){this.props=ce({},yX);this.childProcess=null;this.port=0;this.id=t}async start(t){t=ce(ce({},yX),t),this.props=t;let r=[...t.arguments];return this.port=Number(t.port),t.portArg&&(t.autoPort&&(this.port=await gX(t.port)),r.push(t.portArg,String(this.port))),await new Promise((i,n)=>{try{this._setTimeout(()=>{t.onSuccess&&t.onSuccess(this),i({})}),console.log(`Spawning ${t.command} ${t.arguments.join(" ")}`);let a=vX.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}".`),this._clearTimeout(),n(new Error(o))}),a.on("error",o=>{console.log(`Child process errored with ${o}`),this._clearTimeout(),n(o)}),a.on("close",o=>{console.log(`Child process exited with ${o}`),this.childProcess=null,this._clearTimeout(),i({})})}catch(a){n(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 YO(e,t){return!En.isSupported()||!Ln&&!(t==null?void 0:t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}async function $O(e,t,r,i,n){let a=e.id,o=nu(e,r),u=En.getWorkerFarm(r).getWorkerPool({name:a,url:o});r=JSON.parse(JSON.stringify(r)),i=JSON.parse(JSON.stringify(i||{}));let l=await u.startJob("process-on-worker",BOe.bind(null,n));return l.postMessage("process",{input:t,options:r,context:i}),await(await l.result).result}async function BOe(e,t,r,i){switch(r){case"done":t.done(i);break;case"error":t.error(new Error(i.error));break;case"process":let{id:n,input:a,options:o}=i;try{let s=await e(a,o);t.postMessage("done",{id:n,result:s})}catch(s){let u=s instanceof Error?s.message:"unknown error";t.postMessage("error",{id:n,error:u})}break;default:console.warn(`parse-with-worker unknown message ${r}`)}}function XO(e,t){return!En.isSupported()||!ji&&!(t==null?void 0:t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}function bX(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?_X(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?_X(e,0,t):""}function _X(e,t,r){if(e.byteLength<=t+r)return"";let i=new DataView(e),n="";for(let a=0;a<r;a++)n+=String.fromCharCode(i.getUint8(t+a));return n}function JO(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${bX(e)}"`)}}function QO(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let i=new Uint8Array(e),n=new Uint8Array(t);for(let a=0;a<i.length;++a)if(i[a]!==n[a])return!1;return!0}function tl(...e){let t=e.map(a=>a instanceof ArrayBuffer?new Uint8Array(a):a),r=t.reduce((a,o)=>a+o.byteLength,0),i=new Uint8Array(r),n=0;for(let a of t)i.set(a,n),n+=a.byteLength;return i.buffer}function ha(...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 i=t.reduce((o,s)=>o+s.length,0),n=new r(i),a=0;for(let o of t)n.set(o,a),a+=o.length;return n}function _d(e,t,r){let i=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(i).buffer}function Ff(e,t){return zt(e>=0),zt(t>0),e+(t-1)&~(t-1)}function ZO(e,t,r){let i;if(e instanceof ArrayBuffer)i=new Uint8Array(e);else{let n=e.byteOffset,a=e.byteLength;i=new Uint8Array(e.buffer||e.arrayBuffer,n,a)}return t.set(i,r),r+Ff(i.byteLength,4)}async function eP(e){let t=[];for await(let r of e)t.push(r);return tl(...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 tP(e,t){if(jf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(jf(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rP(e){var t=tP(e,"string");return jf(t)==="symbol"?t:String(t)}function Vt(e,t,r){return t=rP(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ly(){let e;if(typeof window!="undefined"&&window.performance)e=window.performance.now();else if(typeof process!="undefined"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var Km=class{constructor(t,r){Vt(this,"name",void 0),Vt(this,"type",void 0),Vt(this,"sampleSize",1),Vt(this,"time",0),Vt(this,"count",0),Vt(this,"samples",0),Vt(this,"lastTiming",0),Vt(this,"lastSampleTime",0),Vt(this,"lastSampleCount",0),Vt(this,"_count",0),Vt(this,"_time",0),Vt(this,"_samples",0),Vt(this,"_startTime",0),Vt(this,"_timerPending",!1),this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Ly(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Ly()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var Ny=class{constructor(t){Vt(this,"id",void 0),Vt(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:i}=t,n=this.stats[r];return n||(t instanceof Km?n=t:n=new Km(r,i),this.stats[r]=n),n}};var MOe="Queued Requests",DOe="Active Requests",FOe="Cancelled Requests",jOe="Queued Requests Ever",LOe="Active Requests Ever",NOe={id:"request-scheduler",throttleRequests:!0,maxRequests:6},qy=class{constructor(t={}){this.activeRequestCount=0;this.requestQueue=[];this.requestMap=new Map;this.deferredUpdate=null;this.props=ce(ce({},NOe),t),this.stats=new Ny({id:this.props.id}),this.stats.get(MOe),this.stats.get(DOe),this.stats.get(FOe),this.stats.get(jOe),this.stats.get(LOe)}scheduleRequest(t,r=()=>0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);let i={handle:t,priority:0,getPriority:r},n=new Promise(a=>(i.resolve=a,i));return this.requestQueue.push(i),this.requestMap.set(t,n),this._issueNewRequests(),n}_issueRequest(t){let{handle:r,resolve:i}=t,n=!1,a=()=>{n||(n=!0,this.requestMap.delete(r),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,i?i({done:a}):Promise.resolve({done:a})}_issueNewRequests(){this.deferredUpdate||(this.deferredUpdate=setTimeout(()=>this._issueNewRequestsAsync(),0))}_issueNewRequestsAsync(){this.deferredUpdate=null;let t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(t!==0){this._updateAllRequests();for(let r=0;r<t;++r){let i=this.requestQueue.shift();i&&this._issueRequest(i)}}}_updateAllRequests(){let t=this.requestQueue;for(let r=0;r<t.length;++r){let i=t[r];this._updateRequest(i)||(t.splice(r,1),this.requestMap.delete(i.handle),r--)}t.sort((r,i)=>r.priority-i.priority)}_updateRequest(t){return t.priority=t.getPriority(t.handle),t.priority<0?(t.resolve(null),!1):!0}};var qOe="",xX={};function Lf(e){for(let t in xX)if(e.startsWith(t)){let r=xX[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${qOe}${e}`),e}var UOe="3.4.2",iP={name:"JSON",id:"json",module:"json",version:UOe,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:wX,parse:async e=>wX(new TextDecoder().decode(e)),options:{}};function wX(e){return JSON.parse(e)}function SE(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function nP(e){if(Buffer.isBuffer(e))return e;if(ArrayBuffer.isView(e)&&(e=e.buffer),typeof Buffer!="undefined"&&e instanceof ArrayBuffer)return Buffer.from(e);throw new Error("toBuffer")}function EX(e){return e&&typeof e=="object"&&e.isBuffer}function aP(e){return nP?nP(e):e}function AE(e){if(EX(e))return SE(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 oP(e){return(t,r)=>new Promise((i,n)=>e(t,r,(a,o)=>a?n(a):i(o)))}function SX(e){return(t,r,i)=>new Promise((n,a)=>e(t,r,i,(o,s)=>o?a(o):n(s)))}var au={};To(au,{dirname:()=>zOe,filename:()=>GOe,join:()=>HOe,resolve:()=>VOe});function AX(){var t;if(typeof process!="undefined"&&typeof process.cwd!="undefined")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 GOe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function zOe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function HOe(...e){let t="/";return e=e.map((r,i)=>(i&&(r=r.replace(new RegExp(`^${t}`),"")),i!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function VOe(...e){let t=[];for(let a=0;a<e.length;a++)t[a]=e[a];let r="",i=!1,n;for(let a=t.length-1;a>=-1&&!i;a--){let o;a>=0?o=t[a]:(n===void 0&&(n=AX()),o=n),o.length!==0&&(r=`${o}/${r}`,i=o.charCodeAt(0)===Uy)}return r=WOe(r,!i),i?`/${r}`:r.length>0?r:"."}var Uy=47,sP=46;function WOe(e,t){let r="",i=-1,n=0,a,o=!1;for(let s=0;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else{if(a===Uy)break;a=Uy}if(a===Uy){if(!(i===s-1||n===1))if(i!==s-1&&n===2){if(r.length<2||!o||r.charCodeAt(r.length-1)!==sP||r.charCodeAt(r.length-2)!==sP){if(r.length>2){let u=r.length-1,l=u;for(;l>=0&&r.charCodeAt(l)!==Uy;--l);if(l!==u){r=l===-1?"":r.slice(0,l),i=s,n=0,o=!1;continue}}else if(r.length===2||r.length===1){r="",i=s,n=0,o=!1;continue}}t&&(r.length>0?r+="/..":r="..",o=!0)}else{let u=e.slice(i+1,s);r.length>0?r+=`/${u}`:r=u,o=!1}i=s,n=0}else a===sP&&n!==-1?++n:n=-1}return r}var TE={};To(TE,{_readToArrayBuffer:()=>KOe,close:()=>BX,createWriteStream:()=>DX,fstat:()=>MX,isSupported:()=>FX,open:()=>PX,read:()=>uP,readFile:()=>RX,readFileSync:()=>CX,readdir:()=>TX,stat:()=>kX,writeFile:()=>IX,writeFileSync:()=>OX});var go=Le(require("fs"));var TX,kX,RX,CX,IX,OX,PX,BX,uP,MX,DX,FX=Boolean(go.default);try{TX=oP(go.default.readdir),kX=oP(go.default.stat),RX=go.default.readFile,CX=go.default.readFileSync,IX=SX(go.default.writeFile),OX=go.default.writeFileSync,PX=go.default.open,BX=e=>new Promise((t,r)=>go.default.close(e,i=>i?r(i):t())),uP=go.default.read,MX=go.default.fstat,DX=go.default.createWriteStream,FX=Boolean(go.default)}catch{}async function KOe(e,t,r){let i=Buffer.alloc(r),{bytesRead:n}=await uP(e,i,0,r,t);if(n!==r)throw new Error("fs.read failed");return SE(i)}var $Oe=e=>typeof e=="boolean",Gy=e=>typeof e=="function",xd=e=>e!==null&&typeof e=="object",lP=e=>xd(e)&&e.constructor==={}.constructor;var jX=e=>e&&typeof e[Symbol.iterator]=="function",LX=e=>e&&typeof e[Symbol.asyncIterator]=="function";var os=e=>typeof Response!="undefined"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var ss=e=>typeof Blob!="undefined"&&e instanceof Blob,NX=e=>e&&typeof e=="object"&&e.isBuffer;var XOe=e=>typeof ReadableStream!="undefined"&&e instanceof ReadableStream||xd(e)&&Gy(e.tee)&&Gy(e.cancel)&&Gy(e.getReader);var JOe=e=>xd(e)&&Gy(e.read)&&Gy(e.pipe)&&$Oe(e.readable),kE=e=>XOe(e)||JOe(e);var QOe=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,ZOe=/^([-\w.]+\/[-\w.+]+)/;function qX(e){let t=ZOe.exec(e);return t?t[1]:e}function cP(e){let t=QOe.exec(e);return t?t[1]:""}var UX=/\?.*/;function GX(e){let t=e.match(UX);return t&&t[0]}function Ym(e){return e.replace(UX,"")}function wd(e){return os(e)?e.url:ss(e)?e.name||"":typeof e=="string"?e:""}function zy(e){if(os(e)){let t=e,r=t.headers.get("content-type")||"",i=Ym(t.url);return qX(r)||cP(i)}return ss(e)?e.type||"":typeof e=="string"?cP(e):""}function zX(e){return os(e)?e.headers["content-length"]||-1:ss(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function RE(e){if(os(e))return e;let t={},r=zX(e);r>=0&&(t["content-length"]=String(r));let i=wd(e),n=zy(e);n&&(t["content-type"]=n);let a=await tPe(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:i}),o}async function HX(e){if(!e.ok){let t=await ePe(e);throw new Error(t)}}async function ePe(e){let t=`Failed to fetch resource ${e.url} (${e.status}): `;try{let r=e.headers.get("Content-Type"),i=e.statusText;r.includes("application/json")&&(i+=` ${await e.text()}`),t+=i,t=t.length>60?`${t.slice(0,60)}...`:t}catch{}return t}async function tPe(e){let t=5;if(typeof e=="string")return`data:,${e.slice(0,t)}`;if(e instanceof Blob){let r=e.slice(0,5);return await new Promise(i=>{let n=new FileReader;n.onload=a=>{var o;return i((o=a==null?void 0:a.target)==null?void 0:o.result)},n.readAsDataURL(r)})}if(e instanceof ArrayBuffer){let r=e.slice(0,t);return`data:base64,${rPe(r)}`}return null}function rPe(e){let t="",r=new Uint8Array(e);for(let i=0;i<r.byteLength;i++)t+=String.fromCharCode(r[i]);return btoa(t)}async function na(e,t){if(typeof e=="string"){e=Lf(e);let r=t;return(t==null?void 0:t.fetch)&&typeof(t==null?void 0:t.fetch)!="function"&&(r=t.fetch),await fetch(e,r)}return await RE(e)}async function VX(e,t,r){e=Lf(e),ji||await TE.writeFile(e,aP(t),{flag:"w"}),zt(!1)}function fP(e){if(typeof window!="undefined"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process!="undefined"&&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 ou(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||fP()}var iPe=globalThis.self||globalThis.window||globalThis.global,$m=globalThis.window||globalThis.self||globalThis.global,nPe=globalThis.document||{},Ed=globalThis.process||{},aPe=globalThis.console,Y1t=globalThis.navigator||{};var CE="3.4.2",J1t=ou();function oPe(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var hP=class{constructor(t,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";Vt(this,"storage",void 0),Vt(this,"id",void 0),Vt(this,"config",void 0),this.storage=oPe(i),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 WX(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 KX(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 IE(e,t,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,n=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(r=Math.min(r,i/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(n,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var OE;(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"})(OE||(OE={}));var sPe=10;function YX(e){return typeof e!="string"?e:(e=e.toUpperCase(),OE[e]||OE.WHITE)}function $X(e,t,r){if(!ou&&typeof e=="string"){if(t){let i=YX(t);e="[".concat(i,"m").concat(e,"")}if(r){let i=YX(r);e="[".concat(i+sPe,"m").concat(e,"")}}return e}function XX(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(r),n=e;for(let a of i){let o=n[a];typeof o=="function"&&(t.find(s=>a===s)||(n[a]=o.bind(e)))}}function Xm(e,t){if(!e)throw new Error(t||"Assertion failed")}function Sd(){let e;if(ou()&&$m.performance){var t,r;e=$m===null||$m===void 0||(t=$m.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Ed){var i;let n=Ed===null||Ed===void 0||(i=Ed.hrtime)===null||i===void 0?void 0:i.call(Ed);e=n[0]*1e3+n[1]/1e6}else e=Date.now();return e}var Jm={debug:ou()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},uPe={enabled:!0,level:0};function us(){}var JX={},QX={once:!0},nc=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};Vt(this,"id",void 0),Vt(this,"VERSION",CE),Vt(this,"_startTs",Sd()),Vt(this,"_deltaTs",Sd()),Vt(this,"_storage",void 0),Vt(this,"userData",{}),Vt(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new hP("__probe-".concat(this.id,"__"),uPe),this.timeStamp("".concat(this.id," started")),XX(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){Xm(t,r)}warn(t){return this._getLogFunction(0,t,Jm.warn,arguments,QX)}error(t){return this._getLogFunction(0,t,Jm.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,Jm.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,Jm.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,Jm.debug||Jm.info,arguments,QX)}table(t,r,i){return r?this._getLogFunction(t,r,console.table||us,i&&[i],{tag:hPe(r)}):us}image(t){let{logLevel:r,priority:i,image:n,message:a="",scale:o=1}=t;return this._shouldLog(r||i)?ou()?fPe({image:n,message:a,scale:o}):cPe({image:n,message:a,scale:o}):us}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||us)}group(t,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},n=eJ({logLevel:t,message:r,opts:i}),{collapsed:a}=i;return n.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(t,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},i,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||us)}withGroup(t,r,i){this.group(t,r)();try{i()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=ZX(t)}_getLogFunction(t,r,i,n,a){if(this._shouldLog(t)){a=eJ({logLevel:t,message:r,args:n,opts:a}),i=i||a.method,Xm(i),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Sd();let o=a.tag||a.message;if(a.once&&o)if(!JX[o])JX[o]=Sd();else return us;return r=lPe(this.id,a.message,a),i.bind(console,r,...a.args)}return us}};Vt(nc,"VERSION",CE);function ZX(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 Xm(Number.isFinite(t)&&t>=0),t}function eJ(e){let{logLevel:t,message:r}=e;e.logLevel=ZX(t);let i=e.args?Array.from(e.args):[];for(;i.length&&i.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&i.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let n=typeof e.message;return Xm(n==="string"||n==="object"),Object.assign(e,{args:i},e.opts)}function lPe(e,t,r){if(typeof t=="string"){let i=r.time?KX(WX(r.total)):"";t=r.time?"".concat(e,": ").concat(i," ").concat(t):"".concat(e,": ").concat(t),t=$X(t,r.color,r.background)}return t}function cPe(e){let{image:t,message:r="",scale:i=1}=e;return console.warn("removed"),us}function fPe(e){let{image:t,message:r="",scale:i=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=IE(a,r,i);console.log(...o)},a.src=t,us}let n=t.nodeName||"";if(n.toLowerCase()==="img")return console.log(...IE(t,r,i)),us;if(n.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...IE(a,r,i)),a.src=t.toDataURL(),us}return us}function hPe(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var S_t=new nc({id:"@probe.gl/log"});var dP=new nc({id:"loaders.gl"}),pP=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},mP=class{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 gP={fetch:null,mimeType:void 0,nothrow:!1,log:new mP,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:ji,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},tJ={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 vP(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state=e._state||{},e._state}var Po=()=>{let e=vP();return e.globalOptions=e.globalOptions||ce({},gP),e.globalOptions};function rJ(e,t,r,i){return r=r||[],r=Array.isArray(r)?r:[r],dPe(e,r),mPe(t,e,i)}function dPe(e,t){iJ(e,null,gP,tJ,t);for(let r of t){let i=e&&e[r.id]||{},n=r.options&&r.options[r.id]||{},a=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};iJ(i,r.id,n,a,t)}}function iJ(e,t,r,i,n){let a=t||"Top level",o=t?`${t}.`:"";for(let s in e){let u=!t&&xd(e[s]),l=s==="baseUri"&&!t,c=s==="workerUrl"&&t;if(!(s in r)&&!l&&!c){if(s in i)dP.warn(`${a} loader option '${o}${s}' no longer supported, use '${i[s]}'`)();else if(!u){let f=pPe(s,n);dP.warn(`${a} loader option '${o}${s}' not recognized. ${f}`)()}}}}function pPe(e,t){let r=e.toLowerCase(),i="";for(let n of t)for(let a in n.options){if(e===a)return`Did you mean '${n.id}.${a}'?`;let o=a.toLowerCase();(r.startsWith(o)||o.startsWith(r))&&(i=i||`Did you mean '${n.id}.${a}'?`)}return i}function mPe(e,t,r){let i=e.options||{},n=ce({},i);return gPe(n,r),n.log===null&&(n.log=new pP),nJ(n,Po()),nJ(n,t),n}function nJ(e,t){for(let r in t)if(r in t){let i=t[r];lP(i)&&lP(e[r])?e[r]=ce(ce({},e[r]),t[r]):e[r]=t[r]}}function gPe(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function Hy(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function yP(e){zt(e,"null loader"),zt(Hy(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e=_t(ce({},e),{options:ce(ce({},e.options),t)})),((e==null?void 0:e.parseTextSync)||(e==null?void 0:e.parseText))&&(e.text=!0),e.text||(e.binary=!0),e}var vPe=()=>{let e=vP();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function aJ(){return vPe()}var oJ=new nc({id:"loaders.gl"});var yPe=/\.([^.]+)$/;async function sJ(e,t=[],r,i){if(!lJ(e))return null;let n=uJ(e,t,_t(ce({},r),{nothrow:!0}),i);if(n)return n;if(ss(e)&&(e=await e.slice(0,10).arrayBuffer(),n=uJ(e,t,r,i)),!n&&!(r==null?void 0:r.nothrow))throw new Error(cJ(e));return n}function uJ(e,t=[],r,i){if(!lJ(e))return null;if(t&&!Array.isArray(t))return yP(t);let n=[];t&&(n=n.concat(t)),(r==null?void 0:r.ignoreRegisteredLoaders)||n.push(...aJ()),_Pe(n);let a=bPe(e,n,r,i);if(!a&&!(r==null?void 0:r.nothrow))throw new Error(cJ(e));return a}function bPe(e,t,r,i){let n=wd(e),a=zy(e),o=Ym(n)||(i==null?void 0:i.url),s=null,u="";return(r==null?void 0:r.mimeType)&&(s=bP(t,r==null?void 0:r.mimeType),u=`match forced by supplied MIME type ${r==null?void 0:r.mimeType}`),s=s||xPe(t,o),u=u||(s?`matched url ${o}`:""),s=s||bP(t,a),u=u||(s?`matched MIME type ${a}`:""),s=s||EPe(t,e),u=u||(s?`matched initial data ${hJ(e)}`:""),s=s||bP(t,r==null?void 0:r.fallbackMimeType),u=u||(s?`matched fallback MIME type ${a}`:""),u&&oJ.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${u}.`),s}function lJ(e){return!(e instanceof Response&&e.status===204)}function cJ(e){let t=wd(e),r=zy(e),i="No valid loader found (";i+=t?`${au.filename(t)}, `:"no url provided, ",i+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let n=e?hJ(e):"";return i+=n?` first bytes: "${n}"`:"first bytes: not available",i+=")",i}function _Pe(e){for(let t of e)yP(t)}function xPe(e,t){let r=t&&yPe.exec(t),i=r&&r[1];return i?wPe(e,i):null}function wPe(e,t){t=t.toLowerCase();for(let r of e)for(let i of r.extensions)if(i.toLowerCase()===t)return r;return null}function bP(e,t){for(let r of e)if(r.mimeTypes&&r.mimeTypes.includes(t)||t===`application/x.${r.id}`)return r;return null}function EPe(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(SPe(t,r))return r}else if(ArrayBuffer.isView(t)){if(fJ(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&fJ(t,0,r))return r;return null}function SPe(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(i=>e.startsWith(i))}function fJ(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(n=>APe(e,t,r,n))}function APe(e,t,r,i){if(i instanceof ArrayBuffer)return QO(i,e,i.byteLength);switch(typeof i){case"function":return i(e,r);case"string":let n=_P(e,t,i.length);return i===n;default:return!1}}function hJ(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?_P(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?_P(e,0,t):""}function _P(e,t,r){if(e.byteLength<t+r)return"";let i=new DataView(e),n="";for(let a=0;a<r;a++)n+=String.fromCharCode(i.getUint8(t+a));return n}var TPe=256*1024;function*dJ(e,t){let r=(t==null?void 0:t.chunkSize)||TPe,i=0,n=new TextEncoder;for(;i<e.length;){let a=Math.min(e.length-i,r),o=e.slice(i,i+a);i+=a,yield n.encode(o)}}var kPe=256*1024;function*pJ(e,t={}){let{chunkSize:r=kPe}=t,i=0;for(;i<e.byteLength;){let n=Math.min(e.byteLength-i,r),a=new ArrayBuffer(n),o=new Uint8Array(e,i,n);new Uint8Array(a).set(o),i+=n,yield a}}var RPe=1024*1024;async function*mJ(e,t){let r=(t==null?void 0:t.chunkSize)||RPe,i=0;for(;i<e.size;){let n=i+r,a=await e.slice(i,n).arrayBuffer();i=n,yield a}}function xP(e,t){return ji?CPe(e,t):IPe(e,t)}async function*CPe(e,t){let r=e.getReader(),i;try{for(;;){let n=i||r.read();(t==null?void 0:t._streamReadAhead)&&(i=r.read());let{done:a,value:o}=await n;if(a)return;yield AE(o)}}catch{r.releaseLock()}}async function*IPe(e,t){for await(let r of e)yield AE(r)}function gJ(e,t){if(typeof e=="string")return dJ(e,t);if(e instanceof ArrayBuffer)return pJ(e,t);if(ss(e))return mJ(e,t);if(kE(e))return xP(e,t);if(os(e))return xP(e.body,t);throw new Error("makeIterator")}var vJ="Cannot convert supplied data type";function OPe(e,t,r){if(t.text&&typeof e=="string")return e;if(NX(e)&&(e=e.buffer),e instanceof ArrayBuffer){let i=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);let i=e.buffer,n=e.byteLength||e.length;return(e.byteOffset!==0||n!==i.byteLength)&&(i=i.slice(e.byteOffset,e.byteOffset+n)),i}throw new Error(vJ)}async function yJ(e,t,r){let i=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||i)return OPe(e,t,r);if(ss(e)&&(e=await RE(e)),os(e)){let n=e;return await HX(n),t.binary?await n.arrayBuffer():await n.text()}if(kE(e)&&(e=gJ(e,r)),jX(e)||LX(e))return eP(e);throw new Error(vJ)}function PE(e,t){let r=Po(),i=e||r;return typeof i.fetch=="function"?i.fetch:xd(i.fetch)?n=>na(n,i):(t==null?void 0:t.fetch)?t==null?void 0:t.fetch:na}function bJ(e,t,r){if(r)return r;let i=ce({fetch:PE(t,e)},e);if(i.url){let n=Ym(i.url);i.baseUrl=n,i.queryString=GX(i.url),i.filename=au.filename(n),i.baseUrl=au.dirname(n)}return Array.isArray(i.loaders)||(i.loaders=null),i}function _J(e,t){if(!t&&e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){let i=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...i]:i}return r&&r.length?r:null}async function rl(e,t,r,i){ia(!i||typeof i=="object"),t&&!Array.isArray(t)&&!Hy(t)&&(i=void 0,r=t,t=void 0),e=await e,r=r||{};let n=wd(e),o=_J(t,i),s=await sJ(e,o,r);return s?(r=rJ(r,s,o,n),i=bJ({url:n,parse:rl,loaders:o},r,i||null),await PPe(s,e,r,i)):null}async function PPe(e,t,r,i){if(zO(e),os(t)){let n=t,{ok:a,redirected:o,status:s,statusText:u,type:l,url:c}=n,f=Object.fromEntries(n.headers.entries());i.response={headers:f,ok:a,redirected:o,status:s,statusText:u,type:l,url:c}}if(t=await yJ(t,e,r),e.parseTextSync&&typeof t=="string")return r.dataType="text",e.parseTextSync(t,r,i,e);if(YO(e,r))return await $O(e,t,r,i,rl);if(e.parseText&&typeof t=="string")return await e.parseText(t,r,i,e);if(e.parse)return await e.parse(t,r,i,e);throw ia(!e.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}async function ci(e,t,r,i){!Array.isArray(t)&&!Hy(t)&&(i=void 0,r=t,t=void 0);let n=PE(r),a=e;return typeof e=="string"&&(a=await n(e)),ss(e)&&(a=await n(e)),await rl(a,t,r)}async function Qm(e,t,r){let i=Po();if(r=ce(ce({},i),r),XO(t,r))return await jy(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 n=xJ(e,t,r),a=[];for await(let o of n)a.push(o);return tl(...a)}if(!ji&&t.encodeURLtoURL){let n=EJ("input");await VX(n,e);let a=EJ("output"),o=await wJ(n,a,t,r);return(await na(o)).arrayBuffer()}throw new Error("Writer could not encode data")}function xJ(e,t,r){if(t.encodeInBatches){let i=BPe(e);return t.encodeInBatches(i,r)}throw new Error("Writer could not encode data in batches")}async function wJ(e,t,r,i){if(e=Lf(e),t=Lf(t),ji||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,i)}function BPe(e){return[{table:e,start:0,end:e.length}]}function EJ(e){return`/tmp/${e}`}var du=Le(Tr()),_g=Le(Ya());function hb(){let e;if(typeof window!="undefined"&&window.performance)e=window.performance.now();else if(typeof process!="undefined"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var dg=class{constructor(t,r){Vt(this,"name",void 0),Vt(this,"type",void 0),Vt(this,"sampleSize",1),Vt(this,"time",0),Vt(this,"count",0),Vt(this,"samples",0),Vt(this,"lastTiming",0),Vt(this,"lastSampleTime",0),Vt(this,"lastSampleCount",0),Vt(this,"_count",0),Vt(this,"_time",0),Vt(this,"_samples",0),Vt(this,"_startTime",0),Vt(this,"_timerPending",!1),this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=hb(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(hb()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var db=class{constructor(t){Vt(this,"id",void 0),Vt(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:i}=t,n=this.stats[r];return n||(t instanceof dg?n=t:n=new dg(r,i),this.stats[r]=n),n}};var sB=class{constructor(t,r,i){this.item=t,this.previous=r,this.next=i}};var uB=class{constructor(){this.head=null;this.tail=null;this._length=0}get length(){return this._length}add(t){let r=new sB(t,this.tail,null);return this.tail?(this.tail.next=r,this.tail=r):(this.head=r,this.tail=r),++this._length,r}remove(t){!t||(t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=null,this.tail=t.previous):t.next?(t.next.previous=null,this.head=t.next):(this.head=null,this.tail=null),t.next=null,t.previous=null,--this._length)}splice(t,r){t!==r&&(this.remove(r),this._insert(t,r))}_insert(t,r){let i=t.next;t.next=r,this.tail===t?this.tail=r:i.previous=r,r.next=i,r.previous=t,++this._length}};var lB=class{constructor(){this._list=new uB,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}reset(){this._list.splice(this._list.tail,this._sentinel)}touch(t){let r=t._cacheNode;r&&this._list.splice(this._sentinel,r)}add(t,r,i){r._cacheNode||(r._cacheNode=this._list.add(r),i&&i(t,r))}unloadTile(t,r,i){let n=r._cacheNode;!n||(this._list.remove(n),r._cacheNode=null,i&&i(t,r))}unloadTiles(t,r){let i=this._trimTiles;this._trimTiles=!1;let n=this._list,a=t.maximumMemoryUsage*1024*1024,o=this._sentinel,s=n.head;for(;s!==o&&(t.gpuMemoryUsageInBytes>a||i);){let u=s.item;s=s.next,this.unloadTile(t,u,r)}}trim(){this._trimTiles=!0}};var cB=Le(Ya()),Bd=Le(Tr());function BZ(e,t){zt(e),zt(t);let{rtcCenter:r,gltfUpAxis:i}=t,{computedTransform:n,boundingVolume:{center:a}}=e,o=new Bd.Matrix4(n);switch(r&&o.translate(r),i){case"Z":break;case"Y":let f=new Bd.Matrix4().rotateX(Math.PI/2);o=o.multiplyRight(f);break;case"X":let h=new Bd.Matrix4().rotateY(-Math.PI/2);o=o.multiplyRight(h);break;default:break}t.isQuantized&&o.translate(t.quantizedVolumeOffset).scale(t.quantizedVolumeScale);let s=new Bd.Vector3(a);t.cartesianModelMatrix=o,t.cartesianOrigin=s;let u=cB.Ellipsoid.WGS84.cartesianToCartographic(s,new Bd.Vector3),c=cB.Ellipsoid.WGS84.eastNorthUpToFixedFrame(s).invert();t.cartographicModelMatrix=c.multiplyRight(o),t.cartographicOrigin=u,t.coordinateSystem||(t.modelMatrix=t.cartographicModelMatrix)}var fl=Le(Tr()),gc=Le(cl()),HS=Le(Ya()),nee=new fl.Vector3,RB=new fl.Vector3,CB=new gc.CullingVolume([new gc.Plane,new gc.Plane,new gc.Plane,new gc.Plane,new gc.Plane,new gc.Plane]);function aee(e,t){let{cameraDirection:r,cameraUp:i,height:n}=e,{metersPerUnit:a}=e.distanceScales,o=VS(e,e.center),s=HS.Ellipsoid.WGS84.eastNorthUpToFixedFrame(o),u=e.unprojectPosition(e.cameraPosition),l=HS.Ellipsoid.WGS84.cartographicToCartesian(u,new fl.Vector3),c=new fl.Vector3(s.transformAsVector(new fl.Vector3(r).scale(a))).normalize(),f=new fl.Vector3(s.transformAsVector(new fl.Vector3(i).scale(a))).normalize();_5e(e);let h=e.constructor,{longitude:d,latitude:p,width:y,bearing:g,zoom:b}=e,E=new h({longitude:d,latitude:p,height:n,width:y,bearing:g,zoom:b,pitch:0});return{camera:{position:l,direction:c,up:f},viewport:e,topDownViewport:E,height:n,cullingVolume:CB,frameNumber:t,sseDenominator:1.15}}function oee(e,t,r){if(r===0||e.length<=r)return[e,[]];let i=[],{longitude:n,latitude:a}=t.viewport;for(let[l,c]of e.entries()){let[f,h]=c.header.mbs,d=Math.abs(n-f),p=Math.abs(a-h),y=Math.sqrt(p*p+d*d);i.push([l,y])}let o=i.sort((l,c)=>l[1]-c[1]),s=[];for(let l=0;l<r;l++)s.push(e[o[l][0]]);let u=[];for(let l=r;l<o.length;l++)u.push(e[o[l][0]]);return[s,u]}function _5e(e){let t=e.getFrustumPlanes(),r=see(t.near,e.cameraPosition),i=VS(e,r),n=VS(e,e.cameraPosition,RB),a=0;CB.planes[a++].fromPointNormal(i,nee.copy(i).subtract(n));for(let o in t){if(o==="near")continue;let s=t[o],u=see(s,r,RB),l=VS(e,u,RB);CB.planes[a++].fromPointNormal(l,nee.copy(i).subtract(l))}}function see(e,t,r=new fl.Vector3){let i=e.normal.dot(t);return r.copy(e.normal).scale(e.distance-i).add(t),r}function VS(e,t,r=new fl.Vector3){let i=e.unprojectPosition(t);return HS.Ellipsoid.WGS84.cartographicToCartesian(i,r)}var IB=Le(Tr()),WS=Le(cl()),uee=Le(Ya()),x5e=6378137,w5e=6378137,OB=6356752314245179e-9,lee=new IB.Vector3;function cee(e,t){if(e instanceof WS.OrientedBoundingBox){let{halfAxes:r}=e,i=E5e(r);return Math.log2(OB/(i+t[2]))}else if(e instanceof WS.BoundingSphere){let{radius:r}=e;return Math.log2(OB/(r+t[2]))}else if(e.width&&e.height){let{width:r,height:i}=e,n=Math.log2(x5e/r),a=Math.log2(w5e/i);return(n+a)/2}return 1}function PB(e,t,r){let i=uee.Ellipsoid.WGS84.cartographicToCartesian([e.xmax,e.ymax,e.zmax],new IB.Vector3),n=Math.sqrt(Math.pow(i[0]-r[0],2)+Math.pow(i[1]-r[1],2)+Math.pow(i[2]-r[2],2));return Math.log2(OB/(n+t[2]))}function fee(e,t,r){let[i,n,a,o]=e;return PB({xmin:i,xmax:a,ymin:n,ymax:o,zmin:0,zmax:0},t,r)}function E5e(e){e.getColumn(0,lee);let t=e.getColumn(1),r=e.getColumn(2);return lee.add(t).add(r).len()}var hu=Le(Tr()),QS=Le(cl());var Ja={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Ba={ADD:1,REPLACE:2},Fd={EMPTY:"empty",SCENEGRAPH:"scenegraph",POINTCLOUD:"pointcloud",MESH:"mesh"},aa={I3S:"I3S",TILES3D:"TILES3D"},jd={GEOMETRIC_ERROR:"geometricError",MAX_SCREEN_THRESHOLD:"maxScreenThreshold"},hee={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};var Lr=Le(Tr()),KS=Le(cl()),bg=Le(Ya());function dee(e){return e!=null}var Ma=new Lr.Vector3,YS=new Lr.Vector3,S5e=new Lr.Vector3,A5e=new Lr.Vector3;function $S(e,t,r){if(zt(e,"3D Tile: boundingVolume must be defined"),e.box)return T5e(e.box,t,r);if(e.region){let[i,n,a,o,s,u]=e.region,l=bg.Ellipsoid.WGS84.cartographicToCartesian([(0,Lr.degrees)(i),(0,Lr.degrees)(o),s],S5e),c=bg.Ellipsoid.WGS84.cartographicToCartesian([(0,Lr.degrees)(a),(0,Lr.degrees)(n),u],A5e),f=new Lr.Vector3().addVectors(l,c).multiplyScalar(.5),h=new Lr.Vector3().subVectors(l,c).len()/2;return mee([f[0],f[1],f[2],h],new Lr.Matrix4)}if(e.sphere)return mee(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function pee(e,t){if(e.box)return k5e(t);if(e.region){let[r,i,n,a,o,s]=e.region;return[[(0,Lr.degrees)(r),(0,Lr.degrees)(i),o],[(0,Lr.degrees)(n),(0,Lr.degrees)(a),s]]}if(e.sphere)return R5e(t);throw new Error("Unkown boundingVolume type")}function T5e(e,t,r){let i=new Lr.Vector3(e[0],e[1],e[2]);t.transform(i,i);let n=[];if(e.length===10){let l=e.slice(3,6),c=new Lr.Quaternion;c.fromArray(e,6);let f=new Lr.Vector3([1,0,0]),h=new Lr.Vector3([0,1,0]),d=new Lr.Vector3([0,0,1]);f.transformByQuaternion(c),f.scale(l[0]),h.transformByQuaternion(c),h.scale(l[1]),d.transformByQuaternion(c),d.scale(l[2]),n=[...f.toArray(),...h.toArray(),...d.toArray()]}else n=[...e.slice(3,6),...e.slice(6,9),...e.slice(9,12)];let a=t.transformAsVector(n.slice(0,3)),o=t.transformAsVector(n.slice(3,6)),s=t.transformAsVector(n.slice(6,9)),u=new Lr.Matrix3([a[0],a[1],a[2],o[0],o[1],o[2],s[0],s[1],s[2]]);return dee(r)?(r.center=i,r.halfAxes=u,r):new KS.OrientedBoundingBox(i,u)}function mee(e,t,r){let i=new Lr.Vector3(e[0],e[1],e[2]);t.transform(i,i);let n=t.getScale(YS),a=Math.max(Math.max(n[0],n[1]),n[2]),o=e[3]*a;return dee(r)?(r.center=i,r.radius=o,r):new KS.BoundingSphere(i,o)}function k5e(e){let t=gee(),{halfAxes:r}=e,i=new Lr.Vector3(r.getColumn(0)),n=new Lr.Vector3(r.getColumn(1)),a=new Lr.Vector3(r.getColumn(2));for(let o=0;o<2;o++){for(let s=0;s<2;s++){for(let u=0;u<2;u++)Ma.copy(e.center),Ma.add(i),Ma.add(n),Ma.add(a),vee(t,Ma),a.negate();n.negate()}i.negate()}return t}function R5e(e){let t=gee(),{center:r,radius:i}=e,n=bg.Ellipsoid.WGS84.scaleToGeodeticSurface(r,Ma),a;n?a=bg.Ellipsoid.WGS84.geodeticSurfaceNormal(n):a=new Lr.Vector3(0,0,1);let o=new Lr.Vector3(a[2],-a[1],0);o.len()>0?o.normalize():o=new Lr.Vector3(0,1,0);let s=o.clone().cross(a);for(let u of[o,s,a]){YS.copy(u).scale(i);for(let l=0;l<2;l++)Ma.copy(r),Ma.add(YS),vee(t,Ma),YS.negate()}return t}function gee(){return[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]]}function vee(e,t){bg.Ellipsoid.WGS84.cartesianToCartographic(t,Ma),e[0][0]=Math.min(e[0][0],Ma[0]),e[0][1]=Math.min(e[0][1],Ma[1]),e[0][2]=Math.min(e[0][2],Ma[2]),e[1][0]=Math.max(e[1][0],Ma[0]),e[1][1]=Math.max(e[1][1],Ma[1]),e[1][2]=Math.max(e[1][2],Ma[2])}var vc=Le(Tr()),UEt=new vc.Vector3,GEt=new vc.Vector3,zEt=new vc.Matrix4,HEt=new vc.Vector3,VEt=new vc.Vector3,WEt=new vc.Vector3;function C5e(e,t){let r=e*t;return 1-Math.exp(-(r*r))}function I5e(e,t){if(e.dynamicScreenSpaceError&&e.dynamicScreenSpaceErrorComputedDensity){let r=e.dynamicScreenSpaceErrorComputedDensity,i=e.dynamicScreenSpaceErrorFactor;return C5e(t,r)*i}return 0}function yee(e,t,r){let i=e.tileset,n=e.parent&&e.parent.lodMetricValue||e.lodMetricValue,a=r?n:e.lodMetricValue;if(a===0)return 0;let o=Math.max(e._distanceToCamera,1e-7),{height:s,sseDenominator:u}=t,{viewDistanceScale:l}=i.options,c=a*s*(l||1)/(o*u);return c-=I5e(i,o),c}var yc=Le(Tr()),XS=Le(Ya()),BB=new yc.Vector3,bee=new yc.Vector3,Yf=new yc.Vector3,_ee=new yc.Vector3,O5e=new yc.Vector3,MB=new yc.Matrix4,xee=new yc.Matrix4;function wee(e,t){if(e.lodMetricValue===0||isNaN(e.lodMetricValue))return"DIG";let r=2*DB(e,t);return r<2?"OUT":!e.header.children||r<=e.lodMetricValue?"DRAW":e.header.children?"DIG":"OUT"}function DB(e,t){let{topDownViewport:r}=t,i=e.header.mbs[1],n=e.header.mbs[0],a=e.header.mbs[2],o=e.header.mbs[3],s=[...e.boundingVolume.center],u=r.unprojectPosition(r.cameraPosition);XS.Ellipsoid.WGS84.cartographicToCartesian(u,BB),bee.copy(BB).subtract(s).normalize(),XS.Ellipsoid.WGS84.eastNorthUpToFixedFrame(s,MB),xee.copy(MB).invert(),Yf.copy(BB).transform(xee);let l=Math.sqrt(Yf[0]*Yf[0]+Yf[1]*Yf[1]),c=l*l/Yf[2];_ee.copy([Yf[0],Yf[1],c]);let h=_ee.transform(MB).subtract(s).normalize(),p=bee.cross(h).normalize().scale(o).add(s),y=XS.Ellipsoid.WGS84.cartesianToCartographic(p),g=r.project([n,i,a]),b=r.project(y);return O5e.copy(g).subtract(b).magnitude()}function Eee(e){return{assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}}var JS=class{constructor(t=0){this._map=new Map;this._array=new Array(t),this._length=t}get length(){return this._length}set length(t){this._length=t,t>this._array.length&&(this._array.length=t)}get values(){return this._array}get(t){return zt(t<this._array.length),this._array[t]}set(t,r){zt(t>=0),t>=this.length&&(this.length=t+1),this._map.has(this._array[t])&&this._map.delete(this._array[t]),this._array[t]=r,this._map.set(r,t)}delete(t){let r=this._map.get(t);r>=0&&(this._array.splice(r,1),this._map.delete(t),this.length--)}peek(){return this._array[this._length-1]}push(t){if(!this._map.has(t)){let r=this.length++;this._array[r]=t,this._map.set(t,r)}}pop(){let t=this._array[--this.length];return this._map.delete(t),t}reserve(t){zt(t>=0),t>this._array.length&&(this._array.length=t)}resize(t){zt(t>=0),this.length=t}trim(t){t==null&&(t=this.length),this._array.length=t}reset(){this._array=[],this._map=new Map,this._length=0}find(t){return this._map.has(t)}};var P5e={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:""},bc=class{constructor(t){this.root=null;this.selectedTiles={};this.requestedTiles={};this.emptyTiles={};this.lastUpdate=new Date().getTime();this.updateDebounceTime=1e3;this._traversalStack=new JS;this._emptyTraversalStack=new JS;this._frameNumber=null;this.options=ce(ce({},P5e),t)}traversalFinished(t){return!0}traverse(t,r,i){this.root=t,this.options=ce(ce({},this.options),i),this.reset(),this.updateTile(t,r),this._frameNumber=r.frameNumber,this.executeTraversal(t,r)}reset(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}executeTraversal(t,r){let i=this._traversalStack;for(t._selectionDepth=1,i.push(t);i.length>0;){let a=i.pop(),o=!1;this.canTraverse(a,r)&&(this.updateChildTiles(a,r),o=this.updateAndPushChildren(a,r,i,a.hasRenderContent?a._selectionDepth+1:a._selectionDepth));let s=a.parent,u=Boolean(!s||s._shouldRefine),l=!o;a.hasRenderContent?a.refine===Ba.ADD?(this.loadTile(a,r),this.selectTile(a,r)):a.refine===Ba.REPLACE&&(this.loadTile(a,r),l&&this.selectTile(a,r)):(this.emptyTiles[a.id]=a,this.loadTile(a,r),l&&this.selectTile(a,r)),this.touchTile(a,r),a._shouldRefine=o&&u}let n=new Date().getTime();(this.traversalFinished(r)||n-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=n,this.options.onTraversalEnd(r))}updateChildTiles(t,r){let i=t.children;for(let n of i)this.updateTile(n,r)}updateAndPushChildren(t,r,i,n){let{loadSiblings:a,skipLevelOfDetail:o}=this.options,s=t.children;s.sort(this.compareDistanceToCamera.bind(this));let u=t.refine===Ba.REPLACE&&t.hasRenderContent&&!o,l=!1,c=!0;for(let f of s)if(f._selectionDepth=n,f.isVisibleAndInRequestVolume?(i.find(f)&&i.delete(f),i.push(f),l=!0):(u||a)&&(this.loadTile(f,r),this.touchTile(f,r)),u){let h;if(f._inRequestVolume?f.hasRenderContent?h=f.contentAvailable:h=this.executeEmptyTraversal(f,r):h=!1,c=c&&h,!c)return!1}return l||(c=!1),c}updateTile(t,r){this.updateTileVisibility(t,r)}selectTile(t,r){this.shouldSelectTile(t)&&(t._selectedFrame=r.frameNumber,this.selectedTiles[t.id]=t)}loadTile(t,r){this.shouldLoadTile(t)&&(t._requestedFrame=r.frameNumber,t._priority=t._getPriority(),this.requestedTiles[t.id]=t)}touchTile(t,r){t.tileset._cache.touch(t),t._touchedFrame=r.frameNumber}canTraverse(t,r,i=!1,n=!1){return t.hasChildren?t.hasTilesetContent?!t.contentExpired:!n&&!t.isVisibleAndInRequestVolume?!1:this.shouldRefine(t,r,i):!1}shouldLoadTile(t){return t.hasUnloadedContent||t.contentExpired}shouldSelectTile(t){return t.contentAvailable&&!this.options.skipLevelOfDetail}shouldRefine(t,r,i=!1){let n=t._screenSpaceError;return i&&(n=t.getScreenSpaceError(r,!0)),n>this.options.maximumScreenSpaceError}updateTileVisibility(t,r){let i=[];if(this.options.viewportTraversersMap)for(let n in this.options.viewportTraversersMap)this.options.viewportTraversersMap[n]===r.viewport.id&&i.push(n);else i.push(r.viewport.id);t.updateVisibility(r,i)}compareDistanceToCamera(t,r){return t._distanceToCamera-r._distanceToCamera}anyChildrenVisible(t,r){let i=!1;for(let n of t.children)n.updateVisibility(r),i=i||n.isVisibleAndInRequestVolume;return i}executeEmptyTraversal(t,r){let i=!0,n=this._emptyTraversalStack;for(n.push(t);n.length>0&&i;){let a=n.pop();if(this.updateTile(a,r),a.isVisibleAndInRequestVolume||this.loadTile(a,r),this.touchTile(a,r),!a.hasRenderContent&&this.canTraverse(a,r,!1,!0)){let s=a.children;for(let u of s)n.find(u)&&n.delete(u),n.push(u)}else a.contentAvailable||(i=!1)}return i}};var See=new hu.Vector3;function B5e(e){return e!=null}var _c=class{constructor(t,r,i,n=""){this.lodMetricType="geometricError";this.lodMetricValue=0;this.boundingVolume=null;this.content=null;this.contentState=Ja.UNLOADED;this.gpuMemoryUsageInBytes=0;this.children=[];this.depth=0;this.viewportIds=[];this.transform=new hu.Matrix4;this.extensions=null;this.implicitTiling=null;this.userData={};this.hasEmptyContent=!1;this.hasTilesetContent=!1;this.traverser=new bc({});this._cacheNode=null;this._frameNumber=null;this._expireDate=null;this._expiredContent=null;this._distanceToCamera=0;this._screenSpaceError=0;this._visible=void 0;this._initialTransform=new hu.Matrix4;this._priority=0;this._selectedFrame=0;this._requestedFrame=0;this._selectionDepth=0;this._touchedFrame=0;this._centerZDepth=0;this._shouldRefine=!1;this._stackLength=0;this._visitedFrame=0;this._inRequestVolume=!1;this._lodJudge=null;this.header=r,this.tileset=t,this.id=n||r.id,this.url=r.url,this.parent=i,this.refine=this._getRefine(r.refine),this.type=r.type,this.contentUrl=r.contentUrl,this._initializeLodMetric(r),this._initializeTransforms(r),this._initializeBoundingVolumes(r),this._initializeContent(r),this._initializeRenderingState(r),Object.seal(this)}destroy(){this.header=null}isDestroyed(){return this.header===null}get selected(){return this._selectedFrame===this.tileset._frameNumber}get isVisible(){return this._visible}get isVisibleAndInRequestVolume(){return this._visible&&this._inRequestVolume}get hasRenderContent(){return!this.hasEmptyContent&&!this.hasTilesetContent}get hasChildren(){return this.children.length>0||this.header.children&&this.header.children.length>0}get contentReady(){return this.contentState===Ja.READY||this.hasEmptyContent}get contentAvailable(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}get hasUnloadedContent(){return this.hasRenderContent&&this.contentUnloaded}get contentUnloaded(){return this.contentState===Ja.UNLOADED}get contentExpired(){return this.contentState===Ja.EXPIRED}get contentFailed(){return this.contentState===Ja.FAILED}get distanceToCamera(){return this._distanceToCamera}get screenSpaceError(){return this._screenSpaceError}get boundingBox(){return this._boundingBox||(this._boundingBox=pee(this.header.boundingVolume,this.boundingVolume)),this._boundingBox}getScreenSpaceError(t,r){switch(this.tileset.type){case aa.I3S:return DB(this,t);case aa.TILES3D:return yee(this,t,r);default:throw new Error("Unsupported tileset type")}}unselect(){this._selectedFrame=0}_getGpuMemoryUsageInBytes(){return this.content.gpuMemoryUsageInBytes||this.content.byteLength||0}_getPriority(){let t=this.tileset._traverser,{skipLevelOfDetail:r}=t.options,i=this.refine===Ba.ADD||r;if(i&&!this.isVisible&&this._visible!==void 0||this.tileset._frameNumber-this._touchedFrame>=1||this.contentState===Ja.UNLOADED)return-1;let n=this.parent,o=n&&(!i||this._screenSpaceError===0||n.hasTilesetContent)?n._screenSpaceError:this._screenSpaceError,s=t.root?t.root._screenSpaceError:0;return Math.max(s-o,0)}async loadContent(){if(this.hasEmptyContent)return!1;if(this.content)return!0;this.contentExpired&&(this._expireDate=null),this.contentState=Ja.LOADING;let r=await this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));if(!r)return this.contentState=Ja.UNLOADED,!1;try{let i=this.tileset.getTileUrl(this.contentUrl),n=this.tileset.loader,a=_t(ce({},this.tileset.loadOptions),{[n.id]:ce(_t(ce({},this.tileset.loadOptions[n.id]),{isTileset:this.type==="json"}),this._getLoaderSpecificOptions(n.id))});return this.content=await ci(i,n,a),this.tileset.options.contentLoader&&await this.tileset.options.contentLoader(this),this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=Ja.READY,this._onContentLoaded(),!0}catch(i){throw this.contentState=Ja.FAILED,i}finally{r.done()}}unloadContent(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=Ja.UNLOADED,!0}updateVisibility(t,r){if(this._frameNumber===t.frameNumber)return;let i=this.parent,n=i?i._visibilityPlaneMask:QS.CullingVolume.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){let a=i?i.computedTransform:this.tileset.modelMatrix;this._updateTransform(a)}this._distanceToCamera=this.distanceToTile(t),this._screenSpaceError=this.getScreenSpaceError(t,!1),this._visibilityPlaneMask=this.visibility(t,n),this._visible=this._visibilityPlaneMask!==QS.CullingVolume.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(t),this._frameNumber=t.frameNumber,this.viewportIds=r}visibility(t,r){let{cullingVolume:i}=t,{boundingVolume:n}=this;return i.computeVisibilityWithPlaneMask(n,r)}contentVisibility(){return!0}distanceToTile(t){let r=this.boundingVolume;return Math.sqrt(Math.max(r.distanceSquaredTo(t.camera.position),0))}cameraSpaceZDepth({camera:t}){let r=this.boundingVolume;return See.subVectors(r.center,t.position),t.direction.dot(See)}insideViewerRequestVolume(t){let r=this._viewerRequestVolume;return!r||r.distanceSquaredTo(t.camera.position)<=0}updateExpiration(){if(B5e(this._expireDate)&&this.contentReady&&!this.hasEmptyContent){let t=Date.now();Date.lessThan(this._expireDate,t)&&(this.contentState=Ja.EXPIRED,this._expiredContent=this.content)}}get extras(){return this.header.extras}_initializeLodMetric(t){"lodMetricType"in t?this.lodMetricType=t.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in t?this.lodMetricValue=t.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}_initializeTransforms(t){this.transform=t.transform?new hu.Matrix4(t.transform):new hu.Matrix4;let r=this.parent,i=this.tileset,n=r&&r.computedTransform?r.computedTransform.clone():i.modelMatrix.clone();this.computedTransform=new hu.Matrix4(n).multiplyRight(this.transform);let a=r&&r._initialTransform?r._initialTransform.clone():new hu.Matrix4;this._initialTransform=new hu.Matrix4(a).multiplyRight(this.transform)}_initializeBoundingVolumes(t){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(t)}_initializeContent(t){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=Ja.UNLOADED,this.hasTilesetContent=!1,t.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}_initializeRenderingState(t){this.depth=t.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=QS.CullingVolume.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}_getRefine(t){return t||this.parent&&this.parent.refine||Ba.REPLACE}_isTileset(){return this.contentUrl.indexOf(".json")!==-1}_onContentLoaded(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0;break;default:}this._isTileset()?this.hasTilesetContent=!0:this.gpuMemoryUsageInBytes=this._getGpuMemoryUsageInBytes()}_updateBoundingVolume(t){this.boundingVolume=$S(t.boundingVolume,this.computedTransform,this.boundingVolume);let r=t.content;!r||(r.boundingVolume&&(this._contentBoundingVolume=$S(r.boundingVolume,this.computedTransform,this._contentBoundingVolume)),t.viewerRequestVolume&&(this._viewerRequestVolume=$S(t.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}_updateTransform(t=new hu.Matrix4){let r=t.clone().multiplyRight(this.transform);r.equals(this.computedTransform)||(this.computedTransform=r,this._updateBoundingVolume(this.header))}_getLoaderSpecificOptions(t){switch(t){case"i3s":return _t(ce({},this.tileset.options.i3s),{_tileOptions:{attributeUrls:this.header.attributeUrls,textureUrl:this.header.textureUrl,textureFormat:this.header.textureFormat,textureLoaderOptions:this.header.textureLoaderOptions,materialDefinition:this.header.materialDefinition,isDracoGeometry:this.header.isDracoGeometry,mbs:this.header.mbs},_tilesetOptions:{store:this.tileset.tileset.store,attributeStorageInfo:this.tileset.tileset.attributeStorageInfo,fields:this.tileset.tileset.fields},isTileHeader:!1});case"3d-tiles":case"cesium-ion":default:return Eee(this.tileset.tileset)}}};var FB=class extends bc{compareDistanceToCamera(t,r){return r._distanceToCamera===0&&t._distanceToCamera===0?r._centerZDepth-t._centerZDepth:r._distanceToCamera-t._distanceToCamera}updateTileVisibility(t,r){if(super.updateTileVisibility(t,r),!t.isVisibleAndInRequestVolume)return;let i=t.children.length>0;if(t.hasTilesetContent&&i){let o=t.children[0];this.updateTileVisibility(o,r),t._visible=o._visible;return}if(this.meetsScreenSpaceErrorEarly(t,r)){t._visible=!1;return}let n=t.refine===Ba.REPLACE,a=t._optimChildrenWithinParent===hee.USE_OPTIMIZATION;if(n&&a&&i&&!this.anyChildrenVisible(t,r)){t._visible=!1;return}}meetsScreenSpaceErrorEarly(t,r){let{parent:i}=t;return!i||i.hasTilesetContent||i.refine!==Ba.ADD?!1:!this.shouldRefine(t,r,!0)}};var jB=class{constructor(){this.frameNumberMap=new Map}register(t,r){let i=this.frameNumberMap.get(t)||new Map,n=i.get(r)||0;i.set(r,n+1),this.frameNumberMap.set(t,i)}deregister(t,r){let i=this.frameNumberMap.get(t);if(!i)return;let n=i.get(r)||1;i.set(r,n-1)}isZero(t,r){var n;return(((n=this.frameNumberMap.get(t))==null?void 0:n.get(r))||0)===0}};var LB={REQUESTED:"REQUESTED",COMPLETED:"COMPLETED",ERROR:"ERROR"},NB=class{constructor(){this.pendingTilesRegister=new jB;this._statusMap={}}add(t,r,i,n){if(!this._statusMap[r]){let{frameNumber:a,viewport:{id:o}}=n;this._statusMap[r]={request:t,callback:i,key:r,frameState:n,status:LB.REQUESTED},this.pendingTilesRegister.register(o,a),t().then(s=>{this._statusMap[r].status=LB.COMPLETED;let{frameNumber:u,viewport:{id:l}}=this._statusMap[r].frameState;this.pendingTilesRegister.deregister(l,u),this._statusMap[r].callback(s,n)}).catch(s=>{this._statusMap[r].status=LB.ERROR;let{frameNumber:u,viewport:{id:l}}=this._statusMap[r].frameState;this.pendingTilesRegister.deregister(l,u),i(s)})}}update(t,r){if(this._statusMap[t]){let{frameNumber:i,viewport:{id:n}}=this._statusMap[t].frameState;this.pendingTilesRegister.deregister(n,i);let{frameNumber:a,viewport:{id:o}}=r;this.pendingTilesRegister.register(o,a),this._statusMap[t].frameState=r}}find(t){return this._statusMap[t]}hasPendingTiles(t,r){return!this.pendingTilesRegister.isZero(t,r)}};var qB=class extends bc{constructor(t){super(t);this._tileManager=new NB}traversalFinished(t){return!this._tileManager.hasPendingTiles(t.viewport.id,this._frameNumber||0)}shouldRefine(t,r){return t._lodJudge=wee(t,r),t._lodJudge==="DIG"}updateChildTiles(t,r){let i=t.header.children||[],n=t.children,a=t.tileset;for(let o of i){let s=`${o.id}-${r.viewport.id}`,u=n&&n.find(l=>l.id===s);if(u)u&&this.updateTile(u,r);else{let l=()=>this._loadTile(o.id,a);this._tileManager.find(s)?this._tileManager.update(s,r):(a.tileset.nodePages&&(l=()=>a.tileset.nodePagesTile.formTileFromNodePages(o.id)),this._tileManager.add(l,s,f=>this._onTileLoad(f,t,s),r))}}return!1}async _loadTile(t,r){let{loader:i}=r,n=r.getTileUrl(`${r.url}/nodes/${t}`),a=_t(ce({},r.loadOptions),{i3s:_t(ce({},r.loadOptions.i3s),{isTileHeader:!0})});return await ci(n,i,a)}_onTileLoad(t,r,i){let n=new _c(r.tileset,t,r,i);r.children.push(n);let a=this._tileManager.find(n.id).frameState;this.updateTile(n,a),this._frameNumber===a.frameNumber&&(this.traversalFinished(a)||new Date().getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(n,a)}};var M5e={description:"",ellipsoid:_g.Ellipsoid.WGS84,modelMatrix:new du.Matrix4,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,maximumTilesSelected:0,debounceTime:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{},onTraversalComplete:e=>e,contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},ZS="Tiles In Tileset(s)",UB="Tiles In Memory",Aee="Tiles In View",Tee="Tiles To Render",kee="Tiles Loaded",GB="Tiles Loading",Ree="Tiles Unloaded",Cee="Failed Tile Loads",Iee="Points/Vertices",zB="Tile Memory Use",xg=class{constructor(t,r){this.root=null;this.roots={};this.asset={};this.description="";this.extras=null;this.attributions={};this.credits={};this.contentFormats={draco:!1,meshopt:!1,dds:!1,ktx2:!1};this.cartographicCenter=null;this.cartesianCenter=null;this.zoom=1;this.boundingVolume=null;this.dynamicScreenSpaceErrorComputedDensity=0;this.maximumMemoryUsage=32;this.gpuMemoryUsageInBytes=0;this._frameNumber=0;this._queryParams={};this._extensionsUsed=[];this._tiles={};this._pendingCount=0;this.selectedTiles=[];this.traverseCounter=0;this.geometricError=0;this.lastUpdatedVieports=null;this._requestedTiles=[];this._emptyTiles=[];this.frameStateData={};this._cache=new lB;this.updatePromise=null;this.options=ce(ce({},M5e),r),this.tileset=t,this.loader=t.loader,this.type=t.type,this.url=t.url,this.basePath=t.basePath||au.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=t.lodMetricType,this.lodMetricValue=t.lodMetricValue,this.refine=t.root.refine,this.loadOptions=this.options.loadOptions||{},this._traverser=this._initializeTraverser(),this._requestScheduler=new qy({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this.stats=new db({id:this.url}),this._initializeStats(),this.tilesetInitializationPromise=this._initializeTileSet(t)}destroy(){this._destroy()}isLoaded(){return this._pendingCount===0&&this._frameNumber!==0&&this._requestedTiles.length===0}get tiles(){return Object.values(this._tiles)}get frameNumber(){return this._frameNumber}get queryParams(){return new URLSearchParams(this._queryParams).toString()}setProps(t){this.options=ce(ce({},this.options),t)}setOptions(t){this.options=ce(ce({},this.options),t)}getTileUrl(t){return t.startsWith("data:")?t:`${t}${t.includes("?")?"&":"?"}${this.queryParams}`}hasExtension(t){return Boolean(this._extensionsUsed.indexOf(t)>-1)}update(t=null){this.tilesetInitializationPromise.then(()=>{!t&&this.lastUpdatedVieports?t=this.lastUpdatedVieports:this.lastUpdatedVieports=t,t&&this.doUpdate(t)})}async selectTiles(t=null){return await this.tilesetInitializationPromise,t&&(this.lastUpdatedVieports=t),this.updatePromise||(this.updatePromise=new Promise(r=>{setTimeout(()=>{this.lastUpdatedVieports&&this.doUpdate(this.lastUpdatedVieports),r(this._frameNumber),this.updatePromise=null},this.options.debounceTime)})),this.updatePromise}doUpdate(t){if("loadTiles"in this.options&&!this.options.loadTiles||this.traverseCounter>0)return;let r=t instanceof Array?t:[t];this._cache.reset(),this._frameNumber++,this.traverseCounter=r.length;let i=[];for(let n of r){let a=n.id;this._needTraverse(a)?i.push(a):this.traverseCounter--}for(let n of r){let a=n.id;if(this.roots[a]||(this.roots[a]=this._initializeTileHeaders(this.tileset,null)),!i.includes(a))continue;let o=aee(n,this._frameNumber);this._traverser.traverse(this.roots[a],o,this.options)}}_needTraverse(t){let r=t;return this.options.viewportTraversersMap&&(r=this.options.viewportTraversersMap[t]),r===t}_onTraversalEnd(t){let r=t.viewport.id;this.frameStateData[r]||(this.frameStateData[r]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});let i=this.frameStateData[r],n=Object.values(this._traverser.selectedTiles),[a,o]=oee(n,t,this.options.maximumTilesSelected);i.selectedTiles=a;for(let s of o)s.unselect();i._requestedTiles=Object.values(this._traverser.requestedTiles),i._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,!(this.traverseCounter>0)&&this._updateTiles()}_updateTiles(){this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(let t in this.frameStateData){let r=this.frameStateData[t];this.selectedTiles=this.selectedTiles.concat(r.selectedTiles),this._requestedTiles=this._requestedTiles.concat(r._requestedTiles),this._emptyTiles=this._emptyTiles.concat(r._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);for(let t of this.selectedTiles)this._tiles[t.id]=t;this._loadTiles(),this._unloadTiles(),this._updateStats()}_tilesChanged(t,r){if(t.length!==r.length)return!0;let i=new Set(t.map(o=>o.id)),n=new Set(r.map(o=>o.id)),a=t.filter(o=>!n.has(o.id)).length>0;return a=a||r.filter(o=>!i.has(o.id)).length>0,a}_loadTiles(){for(let t of this._requestedTiles)t.contentUnloaded&&this._loadTile(t)}_unloadTiles(){this._cache.unloadTiles(this,(t,r)=>t._unloadTile(r))}_updateStats(){let t=0,r=0;for(let i of this.selectedTiles)i.contentAvailable&&i.content&&(t++,i.content.pointCount?r+=i.content.pointCount:r+=i.content.vertexCount);this.stats.get(Aee).count=this.selectedTiles.length,this.stats.get(Tee).count=t,this.stats.get(Iee).count=r}async _initializeTileSet(t){this.type===aa.I3S&&(this.calculateViewPropsI3S(),t.root=await t.root),this.root=this._initializeTileHeaders(t,null),this.type===aa.TILES3D&&(this._initializeTiles3DTileset(t),this.calculateViewPropsTiles3D()),this.type===aa.I3S&&this._initializeI3STileset()}calculateViewPropsI3S(){var i;let t=this.tileset.fullExtent;if(t){let{xmin:n,xmax:a,ymin:o,ymax:s,zmin:u,zmax:l}=t;this.cartographicCenter=new du.Vector3(n+(a-n)/2,o+(s-o)/2,u+(l-u)/2),this.cartesianCenter=_g.Ellipsoid.WGS84.cartographicToCartesian(this.cartographicCenter,new du.Vector3),this.zoom=PB(t,this.cartographicCenter,this.cartesianCenter);return}let r=(i=this.tileset.store)==null?void 0:i.extent;if(r){let[n,a,o,s]=r;this.cartographicCenter=new du.Vector3(n+(o-n)/2,a+(s-a)/2,0),this.cartesianCenter=_g.Ellipsoid.WGS84.cartographicToCartesian(this.cartographicCenter,new du.Vector3),this.zoom=fee(r,this.cartographicCenter,this.cartesianCenter);return}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new du.Vector3,this.zoom=1}calculateViewPropsTiles3D(){let t=this.root,{center:r}=t.boundingVolume;if(!r){console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new du.Vector3,this.zoom=1;return}r[0]!==0||r[1]!==0||r[2]!==0?this.cartographicCenter=_g.Ellipsoid.WGS84.cartesianToCartographic(r,new du.Vector3):this.cartographicCenter=new du.Vector3(0,0,-_g.Ellipsoid.WGS84.radii[0]),this.cartesianCenter=r,this.zoom=cee(t.boundingVolume,this.cartographicCenter)}_initializeStats(){this.stats.get(ZS),this.stats.get(GB),this.stats.get(UB),this.stats.get(Aee),this.stats.get(Tee),this.stats.get(kee),this.stats.get(Ree),this.stats.get(Cee),this.stats.get(Iee),this.stats.get(zB,"memory")}_initializeTileHeaders(t,r){var n;let i=new _c(this,t.root,r);if(r&&(r.children.push(i),i.depth=r.depth+1),this.type===aa.TILES3D){let a=[];for(a.push(i);a.length>0;){let o=a.pop();this.stats.get(ZS).incrementCount();let s=o.header.children||[];for(let u of s){let l=new _c(this,u,o);if((n=l.contentUrl)==null?void 0:n.includes("?session=")){let f=new URL(l.contentUrl).searchParams.get("session");f&&(this._queryParams.session=f)}o.children.push(l),l.depth=o.depth+1,a.push(l)}}}return i}_initializeTraverser(){let t;switch(this.type){case aa.TILES3D:t=FB;break;case aa.I3S:t=qB;break;default:t=bc}return new t({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}_destroyTileHeaders(t){this._destroySubtree(t)}async _loadTile(t){let r;try{this._onStartTileLoading(),r=await t.loadContent()}catch(i){this._onTileLoadError(t,i instanceof Error?i:new Error("load failed"))}finally{this._onEndTileLoading(),this._onTileLoad(t,r)}}_onTileLoadError(t,r){this.stats.get(Cee).incrementCount();let i=r.message||r.toString(),n=t.url;console.error(`A 3D tile failed to load: ${t.url} ${i}`),this.options.onTileError(t,i,n)}_onTileLoad(t,r){var i,n;if(!!r){if(this.type===aa.I3S){let a=((n=(i=this.tileset)==null?void 0:i.nodePagesTile)==null?void 0:n.nodesInNodePages)||0;this.stats.get(ZS).reset(),this.stats.get(ZS).addCount(a)}t&&t.content&&BZ(t,t.content),this.updateContentTypes(t),this._addTileToCache(t),this.options.onTileLoad(t)}}updateContentTypes(t){var r;if(this.type===aa.I3S)switch(t.header.isDracoGeometry&&(this.contentFormats.draco=!0),t.header.textureFormat){case"dds":this.contentFormats.dds=!0;break;case"ktx2":this.contentFormats.ktx2=!0;break;default:}else if(this.type===aa.TILES3D){let{extensionsRemoved:i=[]}=((r=t.content)==null?void 0:r.gltf)||{};i.includes("KHR_draco_mesh_compression")&&(this.contentFormats.draco=!0),i.includes("EXT_meshopt_compression")&&(this.contentFormats.meshopt=!0),i.includes("KHR_texture_basisu")&&(this.contentFormats.ktx2=!0)}}_onStartTileLoading(){this._pendingCount++,this.stats.get(GB).incrementCount()}_onEndTileLoading(){this._pendingCount--,this.stats.get(GB).decrementCount()}_addTileToCache(t){this._cache.add(this,t,r=>r._updateCacheStats(t))}_updateCacheStats(t){this.stats.get(kee).incrementCount(),this.stats.get(UB).incrementCount(),this.gpuMemoryUsageInBytes+=t.gpuMemoryUsageInBytes||0,this.stats.get(zB).count=this.gpuMemoryUsageInBytes}_unloadTile(t){this.gpuMemoryUsageInBytes-=t.gpuMemoryUsageInBytes||0,this.stats.get(UB).decrementCount(),this.stats.get(Ree).incrementCount(),this.stats.get(zB).count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(t),t.unloadContent()}_destroy(){let t=[];for(this.root&&t.push(this.root);t.length>0;){let r=t.pop();for(let i of r.children)t.push(i);this._destroyTile(r)}this.root=null}_destroySubtree(t){let r=t,i=[];for(i.push(r);i.length>0;){t=i.pop();for(let n of t.children)i.push(n);t!==r&&this._destroyTile(t)}r.children=[]}_destroyTile(t){this._cache.unloadTile(this,t),this._unloadTile(t),t.destroy()}_initializeTiles3DTileset(t){if(t.queryString){let r=new URLSearchParams(t.queryString),i=Object.fromEntries(r.entries());this._queryParams=ce(ce({},this._queryParams),i)}if(this.asset=t.asset,!this.asset)throw new Error("Tileset must have an asset property.");if(this.asset.version!=="0.0"&&this.asset.version!=="1.0")throw new Error("The tileset must be 3D Tiles version 0.0 or 1.0.");"tilesetVersion"in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description||"",this.properties=t.properties,this.geometricError=t.geometricError,this._extensionsUsed=t.extensionsUsed||[],this.extras=t.extras}_initializeI3STileset(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}};var e2="3.4.2";var Ld={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},GSt=Object.keys(Ld);function HB(e,t,r){zt(e instanceof ArrayBuffer);let i=new TextDecoder("utf8"),n=new Uint8Array(e,t,r);return i.decode(n)}function Oee(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 t2="3.4.2";var D5e={draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},Pee={name:"Draco",id:Ln?"draco":"draco-nodejs",module:"draco",shapes:["mesh"],version:t2,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:D5e};function VB(e){let t=1/0,r=1/0,i=1/0,n=-1/0,a=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length;for(let l=0;l<u;l+=3){let c=s[l],f=s[l+1],h=s[l+2];t=c<t?c:t,r=f<r?f:r,i=h<i?h:i,n=c>n?c:n,a=f>a?f:a,o=h>o?h:o}return[[t,r,i],[n,a,o]]}function Bee(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var ms=class{constructor(t,r){Bee(Array.isArray(t)),F5e(t),this.fields=t,this.metadata=r||new Map}compareTo(t){if(this.metadata!==t.metadata||this.fields.length!==t.fields.length)return!1;for(let r=0;r<this.fields.length;++r)if(!this.fields[r].compareTo(t.fields[r]))return!1;return!0}select(...t){let r=Object.create(null);for(let n of t)r[n]=!0;let i=this.fields.filter(n=>r[n.name]);return new ms(i,this.metadata)}selectAt(...t){let r=t.map(i=>this.fields[i]).filter(Boolean);return new ms(r,this.metadata)}assign(t){let r,i=this.metadata;if(t instanceof ms){let o=t;r=o.fields,i=Mee(Mee(new Map,this.metadata),o.metadata)}else r=t;let n=Object.create(null);for(let o of this.fields)n[o.name]=o;for(let o of r)n[o.name]=o;let a=Object.values(n);return new ms(a,i)}};function F5e(e){let t={};for(let r of e)t[r.name]&&console.warn("Schema: duplicated field name",r.name,r),t[r.name]=!0}function Mee(e,t){return new Map([...e||new Map,...t||new Map])}var xc=class{constructor(t,r,i=!1,n=new Map){this.name=t,this.type=r,this.nullable=i,this.metadata=n}get typeId(){return this.type&&this.type.typeId}clone(){return new xc(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}};var Mr;(function(se){se[se.NONE=0]="NONE",se[se.Null=1]="Null",se[se.Int=2]="Int",se[se.Float=3]="Float",se[se.Binary=4]="Binary",se[se.Utf8=5]="Utf8",se[se.Bool=6]="Bool",se[se.Decimal=7]="Decimal",se[se.Date=8]="Date",se[se.Time=9]="Time",se[se.Timestamp=10]="Timestamp",se[se.Interval=11]="Interval",se[se.List=12]="List",se[se.Struct=13]="Struct",se[se.Union=14]="Union",se[se.FixedSizeBinary=15]="FixedSizeBinary",se[se.FixedSizeList=16]="FixedSizeList",se[se.Map=17]="Map",se[se.Dictionary=-1]="Dictionary",se[se.Int8=-2]="Int8",se[se.Int16=-3]="Int16",se[se.Int32=-4]="Int32",se[se.Int64=-5]="Int64",se[se.Uint8=-6]="Uint8",se[se.Uint16=-7]="Uint16",se[se.Uint32=-8]="Uint32",se[se.Uint64=-9]="Uint64",se[se.Float16=-10]="Float16",se[se.Float32=-11]="Float32",se[se.Float64=-12]="Float64",se[se.DateDay=-13]="DateDay",se[se.DateMillisecond=-14]="DateMillisecond",se[se.TimestampSecond=-15]="TimestampSecond",se[se.TimestampMillisecond=-16]="TimestampMillisecond",se[se.TimestampMicrosecond=-17]="TimestampMicrosecond",se[se.TimestampNanosecond=-18]="TimestampNanosecond",se[se.TimeSecond=-19]="TimeSecond",se[se.TimeMillisecond=-20]="TimeMillisecond",se[se.TimeMicrosecond=-21]="TimeMicrosecond",se[se.TimeNanosecond=-22]="TimeNanosecond",se[se.DenseUnion=-23]="DenseUnion",se[se.SparseUnion=-24]="SparseUnion",se[se.IntervalDayTime=-25]="IntervalDayTime",se[se.IntervalYearMonth=-26]="IntervalYearMonth"})(Mr||(Mr={}));var Qa=class{static isNull(t){return t&&t.typeId===Mr.Null}static isInt(t){return t&&t.typeId===Mr.Int}static isFloat(t){return t&&t.typeId===Mr.Float}static isBinary(t){return t&&t.typeId===Mr.Binary}static isUtf8(t){return t&&t.typeId===Mr.Utf8}static isBool(t){return t&&t.typeId===Mr.Bool}static isDecimal(t){return t&&t.typeId===Mr.Decimal}static isDate(t){return t&&t.typeId===Mr.Date}static isTime(t){return t&&t.typeId===Mr.Time}static isTimestamp(t){return t&&t.typeId===Mr.Timestamp}static isInterval(t){return t&&t.typeId===Mr.Interval}static isList(t){return t&&t.typeId===Mr.List}static isStruct(t){return t&&t.typeId===Mr.Struct}static isUnion(t){return t&&t.typeId===Mr.Union}static isFixedSizeBinary(t){return t&&t.typeId===Mr.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===Mr.FixedSizeList}static isMap(t){return t&&t.typeId===Mr.Map}static isDictionary(t){return t&&t.typeId===Mr.Dictionary}get typeId(){return Mr.NONE}compareTo(t){return this===t}},WB=class extends Qa{get typeId(){return Mr.Null}get[Symbol.toStringTag](){return"Null"}toString(){return"Null"}},KB=class extends Qa{get typeId(){return Mr.Bool}get[Symbol.toStringTag](){return"Bool"}toString(){return"Bool"}},wc=class extends Qa{constructor(t,r){super();this.isSigned=t,this.bitWidth=r}get typeId(){return Mr.Int}get[Symbol.toStringTag](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}},wb=class extends wc{constructor(){super(!0,8)}},Eb=class extends wc{constructor(){super(!0,16)}},Sb=class extends wc{constructor(){super(!0,32)}};var Ab=class extends wc{constructor(){super(!1,8)}},Tb=class extends wc{constructor(){super(!1,16)}},kb=class extends wc{constructor(){super(!1,32)}};var Dee={HALF:16,SINGLE:32,DOUBLE:64},Rb=class extends Qa{constructor(t){super();this.precision=t}get typeId(){return Mr.Float}get[Symbol.toStringTag](){return"Float"}toString(){return`Float${this.precision}`}};var Cb=class extends Rb{constructor(){super(Dee.SINGLE)}},Ib=class extends Rb{constructor(){super(Dee.DOUBLE)}},YB=class extends Qa{constructor(){super()}get typeId(){return Mr.Binary}toString(){return"Binary"}get[Symbol.toStringTag](){return"Binary"}},$B=class extends Qa{get typeId(){return Mr.Utf8}get[Symbol.toStringTag](){return"Utf8"}toString(){return"Utf8"}},j5e={DAY:0,MILLISECOND:1},XB=class extends Qa{constructor(t){super();this.unit=t}get typeId(){return Mr.Date}get[Symbol.toStringTag](){return"Date"}toString(){return`Date${(this.unit+1)*32}<${j5e[this.unit]}>`}};var Fee={SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9},JB=class extends Qa{constructor(t,r){super();this.unit=t,this.bitWidth=r}get typeId(){return Mr.Time}toString(){return`Time${this.bitWidth}<${Fee[this.unit]}>`}get[Symbol.toStringTag](){return"Time"}};var QB=class extends Qa{constructor(t,r=null){super();this.unit=t,this.timezone=r}get typeId(){return Mr.Timestamp}get[Symbol.toStringTag](){return"Timestamp"}toString(){return`Timestamp<${Fee[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};var L5e={DAY_TIME:0,YEAR_MONTH:1},ZB=class extends Qa{constructor(t){super();this.unit=t}get typeId(){return Mr.Interval}get[Symbol.toStringTag](){return"Interval"}toString(){return`Interval<${L5e[this.unit]}>`}};var Ob=class extends Qa{constructor(t,r){super();this.listSize=t,this.children=[r]}get typeId(){return Mr.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[Symbol.toStringTag](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}},e8=class extends Qa{constructor(t){super();this.children=t}get typeId(){return Mr.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}get[Symbol.toStringTag](){return"Struct"}};function jee(e){switch(e.constructor){case Int8Array:return new wb;case Uint8Array:return new Ab;case Int16Array:return new Eb;case Uint16Array:return new Tb;case Int32Array:return new Sb;case Uint32Array:return new kb;case Float32Array:return new Cb;case Float64Array:return new Ib;default:throw new Error("array type not supported")}}function t8(e,t,r){let i=jee(t.value),n=r||Lee(t);return new xc(e,new Ob(t.size,new xc("value",i)),!1,n)}function Lee(e){let t=new Map;return"byteOffset"in e&&t.set("byteOffset",e.byteOffset.toString(10)),"byteStride"in e&&t.set("byteStride",e.byteStride.toString(10)),"normalized"in e&&t.set("normalized",e.normalized.toString()),t}function Nee(e,t,r){let i=Uee(t.metadata),n=[],a=Q5e(t.attributes);for(let o in e){let s=e[o],u=qee(o,s,a[o]);n.push(u)}if(r){let o=qee("indices",r);n.push(o)}return new ms(n,i)}function Q5e(e){let t={};for(let r in e){let i=e[r];t[i.name||"undefined"]=i}return t}function qee(e,t,r){let i=r?Uee(r.metadata):void 0;return t8(e,t,i)}function Uee(e){let t=new Map;for(let r in e)t.set(`${r}.string`,JSON.stringify(e[r]));return t}var Gee={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Z5e={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},eNe=4,r2=class{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 i=new this.draco.DecoderBuffer;i.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(r);let n=this.decoder.GetEncodedGeometryType(i),a=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(n){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,a);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,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,n,r),u=this._getMeshData(a,s,r),l=VB(u.attributes),c=Nee(u.attributes,s,u.indices);return _t(ce({loader:"draco",loaderData:s,header:{vertexCount:a.num_points(),boundingBox:l}},u),{schema:c})}finally{this.draco.destroy(i),a&&this.draco.destroy(a)}}_getDracoLoaderData(t,r,i){let n=this._getTopLevelMetadata(t),a=this._getDracoAttributes(t,i);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:n,attributes:a}}_getDracoAttributes(t,r){let i={};for(let n=0;n<t.num_attributes();n++){let a=this.decoder.GetAttribute(t,n),o=this._getAttributeMetadata(t,n);i[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:n,metadata:o};let s=this._getQuantizationTransform(a,r);s&&(i[a.unique_id()].quantization_transform=s);let u=this._getOctahedronTransform(a,r);u&&(i[a.unique_id()].octahedron_transform=u)}return i}_getMeshData(t,r,i){let n=this._getMeshAttributes(r,t,i);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(i.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:n}}_getMeshAttributes(t,r,i){let n={};for(let a of Object.values(t.attributes)){let o=this._deduceAttributeName(a,i);a.name=o;let{value:s,size:u}=this._getAttributeValues(r,a);n[o]={value:s,size:u,byteOffset:a.byte_offset,byteStride:a.byte_stride,normalized:a.normalized}}return n}_getTriangleListIndices(t){let i=t.num_faces()*3,n=i*eNe,a=this.draco._malloc(n);try{return this.decoder.GetTrianglesUInt32Array(t,n,a),new Uint32Array(this.draco.HEAPF32.buffer,a,i).slice()}finally{this.draco._free(a)}}_getTriangleStripIndices(t){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,r),iNe(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let i=Z5e[r.data_type],n=r.num_components,o=t.num_points()*n,s=o*i.BYTES_PER_ELEMENT,u=tNe(this.draco,i),l,c=this.draco._malloc(s);try{let f=this.decoder.GetAttribute(t,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,f,u,s,c),l=new i(this.draco.HEAPF32.buffer,c,o).slice()}finally{this.draco._free(c)}return{value:l,size:n}}_deduceAttributeName(t,r){let i=t.unique_id;for(let[o,s]of Object.entries(r.extraAttributes||{}))if(s===i)return o;let n=t.attribute_type;for(let o in Gee)if(this.draco[o]===n)return Gee[o];let a=r.attributeNameEntry||"name";return t.metadata[a]?t.metadata[a].string:`CUSTOM_ATTRIBUTE_${i}`}_getTopLevelMetadata(t){let r=this.decoder.GetMetadata(t);return this._getDracoMetadata(r)}_getAttributeMetadata(t,r){let i=this.decoder.GetAttributeMetadata(t,r);return this._getDracoMetadata(i)}_getDracoMetadata(t){if(!t||!t.ptr)return{};let r={},i=this.metadataQuerier.NumEntries(t);for(let n=0;n<i;n++){let a=this.metadataQuerier.GetEntryName(t,n);r[a]=this._getDracoMetadataField(t,a)}return r}_getDracoMetadataField(t,r){let i=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,r,i);let n=rNe(i);return{int:this.metadataQuerier.GetIntEntry(t,r),string:this.metadataQuerier.GetStringEntry(t,r),double:this.metadataQuerier.GetDoubleEntry(t,r),intArray:n}}finally{this.draco.destroy(i)}}_disableAttributeTransforms(t){let{quantizedAttributes:r=[],octahedronAttributes:i=[]}=t,n=[...r,...i];for(let a of n)this.decoder.SkipAttributeTransform(this.draco[a])}_getQuantizationTransform(t,r){let{quantizedAttributes:i=[]}=r,n=t.attribute_type();if(i.map(o=>this.decoder[o]).includes(n)){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:i=[]}=r,n=t.attribute_type();if(i.map(o=>this.decoder[o]).includes(n)){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 tNe(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 rNe(e){let t=e.size(),r=new Int32Array(t);for(let i=0;i<t;i++)r[i]=e.GetValue(i);return r}function iNe(e){let t=e.size(),r=new Int32Array(t);for(let i=0;i<t;i++)r[i]=e.GetValue(i);return r}var nNe="1.5.5",aNe="1.4.1",r8=`https://www.gstatic.com/draco/versioned/decoders/${nNe}`,oNe=`${r8}/draco_decoder.js`,sNe=`${r8}/draco_wasm_wrapper.js`,uNe=`${r8}/draco_decoder.wasm`,C2t=`https://raw.githubusercontent.com/google/draco/${aNe}/javascript/draco_encoder.js`,Pb;async function zee(e){let t=e.modules||{};return t.draco3d?Pb=Pb||t.draco3d.createDecoderModule({}).then(r=>({draco:r})):Pb=Pb||lNe(e),await Pb}async function lNe(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await el(oNe,"draco",e);break;case"wasm":default:[t,r]=await Promise.all([await el(sNe,"draco",e),await el(uNe,"draco",e)])}return t=t||globalThis.DracoDecoderModule,await cNe(t,r)}function cNe(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(i=>{e(_t(ce({},r),{onModuleLoaded:n=>i({draco:n})}))})}var Bb={id:Ln?"draco-writer":"draco-writer-nodejs",name:"Draco compressed geometry writer",module:"draco",version:t2,worker:!0,options:{draco:{},source:null}};var wg=_t(ce({},Pee),{parse:fNe});async function fNe(e,t){let{draco:r}=await zee(t),i=new r2(r);try{return i.parseSync(e,t==null?void 0:t.draco)}finally{i.destroy()}}var hNe={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},dn={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},tr=ce(ce({},hNe),dn);var i8={[dn.DOUBLE]:Float64Array,[dn.FLOAT]:Float32Array,[dn.UNSIGNED_SHORT]:Uint16Array,[dn.UNSIGNED_INT]:Uint32Array,[dn.UNSIGNED_BYTE]:Uint8Array,[dn.BYTE]:Int8Array,[dn.SHORT]:Int16Array,[dn.INT]:Int32Array},dNe={DOUBLE:dn.DOUBLE,FLOAT:dn.FLOAT,UNSIGNED_SHORT:dn.UNSIGNED_SHORT,UNSIGNED_INT:dn.UNSIGNED_INT,UNSIGNED_BYTE:dn.UNSIGNED_BYTE,BYTE:dn.BYTE,SHORT:dn.SHORT,INT:dn.INT},n8="Failed to convert GL type",Za=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in i8)if(i8[r]===t)return r;throw new Error(n8)}static fromName(t){let r=dNe[t];if(!r)throw new Error(n8);return r}static getArrayType(t){switch(t){case dn.UNSIGNED_SHORT_5_6_5:case dn.UNSIGNED_SHORT_4_4_4_4:case dn.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=i8[t];if(!r)throw new Error(n8);return r}}static getByteSize(t){return Za.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(Za.getArrayType(t))}static createTypedArray(t,r,i=0,n){n===void 0&&(n=(r.byteLength-i)/Za.getByteSize(t));let a=Za.getArrayType(t);return new a(r,i,n)}};function Hee(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function a8(e,t=[0,0,0]){let r=e>>11&31,i=e>>5&63,n=e&31;return t[0]=r<<3,t[1]=i<<2,t[2]=n<<3,t}var Ec=Le(Tr());var z2t=1/256;var H2t=new Ec.Vector2,V2t=new Ec.Vector3,W2t=new Ec.Vector2,K2t=new Ec.Vector2,Y2t=new Uint8Array(1);function Vee(e,t=255){return(0,Ec.clamp)(e,0,t)/t*2-1}function Wee(e){return e<0?-1:1}function Kee(e,t,r,i){if(Hee(i),e<0||e>r||t<0||t>r)throw new Error(`x and y must be unsigned normalized integers between 0 and ${r}`);if(i.x=Vee(e,r),i.y=Vee(t,r),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let n=i.x;i.x=(1-Math.abs(i.y))*Wee(n),i.y=(1-Math.abs(n))*Wee(i.y)}return i.normalize()}function o8(e,t,r){return Kee(e,t,255,r)}var l8=Le(Tr());var $f=class{constructor(t,r){this.featuresLength=0;this._cachedTypedArrays={};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=tr.UNSIGNED_INT,i=1){let n=this.json[t];return n&&Number.isFinite(n.byteOffset)?this._getTypedArrayFromBinary(t,r,i,1,n.byteOffset):n}getPropertyArray(t,r,i){let n=this.json[t];return n&&Number.isFinite(n.byteOffset)?("componentType"in n&&(r=Za.fromName(n.componentType)),this._getTypedArrayFromBinary(t,r,i,this.featuresLength,n.byteOffset)):this._getTypedArrayFromArray(t,r,n)}getProperty(t,r,i,n,a){let o=this.json[t];if(!o)return o;let s=this.getPropertyArray(t,r,i);if(i===1)return s[n];for(let u=0;u<i;++u)a[u]=s[i*n+u];return a}_getTypedArrayFromBinary(t,r,i,n,a){let o=this._cachedTypedArrays,s=o[t];return s||(s=Za.createTypedArray(r,this.buffer.buffer,this.buffer.byteOffset+a,n*i),o[t]=s),s}_getTypedArrayFromArray(t,r,i){let n=this._cachedTypedArrays,a=n[t];return a||(a=Za.createTypedArray(r,i),n[t]=a),a}};var pNe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},mNe={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]]},gNe={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 Yee(e,t,r,i){let{componentType:n}=e;zt(e.componentType);let a=typeof n=="string"?Za.fromName(n):n,o=pNe[e.type],s=mNe[e.type],u=gNe[e.type];return r+=e.byteOffset,{values:Za.createTypedArray(a,t,r,o*i),type:a,size:o,unpacker:s,packer:u}}var hl=e=>e!==void 0;function $ee(e,t,r){if(!t)return null;let i=e.getExtension("3DTILES_batch_table_hierarchy"),n=t.HIERARCHY;return n&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=n,i=n),i?vNe(i,r):null}function vNe(e,t){let r,i,n,a=e.instancesLength,o=e.classes,s=e.classIds,u=e.parentCounts,l=e.parentIds,c=a;hl(s.byteOffset)&&(s.componentType=defaultValue(s.componentType,GL.UNSIGNED_SHORT),s.type=AttributeType.SCALAR,n=getBinaryAccessor(s),s=n.createArrayBufferView(t.buffer,t.byteOffset+s.byteOffset,a));let f;if(hl(u))for(hl(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,n=getBinaryAccessor(u),u=n.createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,a)),f=new Uint16Array(a),c=0,r=0;r<a;++r)f[r]=c,c+=u[r];hl(l)&&hl(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,GL.UNSIGNED_SHORT),l.type=AttributeType.SCALAR,n=getBinaryAccessor(l),l=n.createArrayBufferView(t.buffer,t.byteOffset+l.byteOffset,c));let h=o.length;for(r=0;r<h;++r){let g=o[r].length,b=o[r].instances,E=getBinaryProperties(g,b,t);o[r].instances=combine(E,b)}let d=new Array(h).fill(0),p=new Uint16Array(a);for(r=0;r<a;++r)i=s[r],p[r]=d[i],++d[i];let y={classes:o,classIds:s,classIndexes:p,parentCounts:u,parentIndexes:f,parentIds:l};return _Ne(y),y}function Eg(e,t,r){if(!e)return;let i=e.parentCounts;return e.parentIds?r(e,t):i>0?yNe(e,t,r):bNe(e,t,r)}function yNe(e,t,r){let i=e.classIds,n=e.parentCounts,a=e.parentIds,o=e.parentIndexes,s=i.length,u=scratchVisited;u.length=Math.max(u.length,s);let l=++marker,c=scratchStack;for(c.length=0,c.push(t);c.length>0;){if(t=c.pop(),u[t]===l)continue;u[t]=l;let f=r(e,t);if(hl(f))return f;let h=n[t],d=o[t];for(let p=0;p<h;++p){let y=a[d+p];y!==t&&c.push(y)}}return null}function bNe(e,t,r){let i=!0;for(;i;){let n=r(e,t);if(hl(n))return n;let a=e.parentIds[t];i=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}function _Ne(e){let t=[],i=e.classIds.length;for(let n=0;n<i;++n)Xee(e,n,stack)}function Xee(e,t,r){let i=e.parentCounts,n=e.parentIds,a=e.parentIndexes,s=e.classIds.length;if(!hl(n))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=hl(i)?i[t]:1,l=hl(i)?a[t]:t;for(let c=0;c<u;++c){let f=n[l+c];f!==t&&Xee(e,f,r)}r.pop(t)}function bo(e){return e!=null}var i2=(e,t)=>e,xNe={HIERARCHY:!0,extensions:!0,extras:!0},Sg=class{constructor(t,r,i,n={}){var a;zt(i>=0),this.json=t||{},this.binary=r,this.featureCount=i,this._extensions=((a=this.json)==null?void 0:a.extensions)||{},this._properties={};for(let o in this.json)xNe[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),n["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=$ee(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),zt(typeof r=="string",r),this._hierarchy){let i=Eg(this._hierarchy,t,(n,a)=>{let o=n.classIds[a];return n.classes[o].name===r});return bo(i)}return!1}isExactClass(t,r){return zt(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),zt(typeof r=="string",r),bo(this._properties[r])||this._hasPropertyInHierarchy(t,r)}getPropertyNames(t,r){this._checkBatchId(t),r=bo(r)?r:[],r.length=0;let i=Object.keys(this._properties);return r.push(...i),this._hierarchy&&this._getPropertyNamesInHierarchy(t,r),r}getProperty(t,r){if(this._checkBatchId(t),zt(typeof r=="string",r),this._binaryProperties){let n=this._binaryProperties[r];if(bo(n))return this._getBinaryProperty(n,t)}let i=this._properties[r];if(bo(i))return i2(i[t],!0);if(this._hierarchy){let n=this._getHierarchyProperty(t,r);if(bo(n))return n}}setProperty(t,r,i){let n=this.featureCount;if(this._checkBatchId(t),zt(typeof r=="string",r),this._binaryProperties){let o=this._binaryProperties[r];if(o){this._setBinaryProperty(o,t,i);return}}if(this._hierarchy&&this._setHierarchyProperty(this,t,r,i))return;let a=this._properties[r];bo(a)||(this._properties[r]=new Array(n),a=this._properties[r]),a[t]=i2(i,!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,i){t.pack(i,t.typedArray,r)}_initializeBinaryProperties(){let t=null;for(let r in this._properties){let i=this._properties[r],n=this._initializeBinaryProperty(r,i);n&&(t=t||{},t[r]=n)}return t}_initializeBinaryProperty(t,r){if("byteOffset"in r){let i=r;zt(this.binary,`Property ${t} requires a batch table binary.`),zt(i.type,`Property ${t} requires a type.`);let n=Yee(i,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:n.values,componentCount:n.size,unpack:n.unpacker,pack:n.packer}}return null}_hasPropertyInHierarchy(t,r){if(!this._hierarchy)return!1;let i=Eg(this._hierarchy,t,(n,a)=>{let o=n.classIds[a],s=n.classes[o].instances;return bo(s[r])});return bo(i)}_getPropertyNamesInHierarchy(t,r){Eg(this._hierarchy,t,(i,n)=>{let a=i.classIds[n],o=i.classes[a].instances;for(let s in o)o.hasOwnProperty(s)&&r.indexOf(s)===-1&&r.push(s)})}_getHierarchyProperty(t,r){return Eg(this._hierarchy,t,(i,n)=>{let a=i.classIds[n],o=i.classes[a],s=i.classIndexes[n],u=o.instances[r];return bo(u)?bo(u.typedArray)?this._getBinaryProperty(u,s):i2(u[s],!0):null})}_setHierarchyProperty(t,r,i,n){let a=Eg(this._hierarchy,r,(o,s)=>{let u=o.classIds[s],l=o.classes[u],c=o.classIndexes[s],f=l.instances[i];return bo(f)?(zt(s===r,`Inherited property "${i}" is read-only.`),bo(f.typedArray)?this._setBinaryProperty(f,c,n):f[c]=i2(n,!0),!0):!1});return bo(a)}};var s8=4;function Xf(e,t,r=0){let i=new DataView(t);if(e.magic=i.getUint32(r,!0),r+=s8,e.version=i.getUint32(r,!0),r+=s8,e.byteLength=i.getUint32(r,!0),r+=s8,e.version!==1)throw new Error(`3D Tile Version ${e.version} not supported`);return r}var Ag=4,Jee="b3dm tile in legacy format.";function Tg(e,t,r){let i=new DataView(t),n;e.header=e.header||{};let a=i.getUint32(r,!0);r+=Ag;let o=i.getUint32(r,!0);r+=Ag;let s=i.getUint32(r,!0);r+=Ag;let u=i.getUint32(r,!0);return r+=Ag,s>=570425344?(r-=Ag*2,n=a,s=o,u=0,a=0,o=0,console.warn(Jee)):u>=570425344&&(r-=Ag,n=s,s=a,u=o,a=0,o=0,console.warn(Jee)),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=u,e.header.batchLength=n,r}function kg(e,t,r,i){return r=wNe(e,t,r,i),r=ENe(e,t,r,i),r}function wNe(e,t,r,i){let{featureTableJsonByteLength:n,featureTableBinaryByteLength:a,batchLength:o}=e.header;if(e.featureTableJson={BATCH_LENGTH:o||0},n>0){let s=HB(t,r,n);e.featureTableJson=JSON.parse(s)}return r+=n,e.featureTableBinary=new Uint8Array(t,r,a),r+=a,r}function ENe(e,t,r,i){let{batchTableJsonByteLength:n,batchTableBinaryByteLength:a}=e.header;if(n>0){let o=HB(t,r,n);e.batchTableJson=JSON.parse(o),r+=n,a>0&&(e.batchTableBinary=new Uint8Array(t,r,a),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=a)}return r}function u8(e,t,r){if(!t&&(!e||!e.batchIds||!r))return null;let{batchIds:i,isRGB565:n,pointCount:a}=e;if(i&&r){let o=new Uint8ClampedArray(a*3);for(let s=0;s<a;s++){let u=i[s],c=r.getProperty(u,"dimensions").map(f=>f*255);o[s*3]=c[0],o[s*3+1]=c[1],o[s*3+2]=c[2]}return{type:tr.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}if(n){let o=new Uint8ClampedArray(a*3);for(let s=0;s<a;s++){let u=a8(t[s]);o[s*3]=u[0],o[s*3+1]=u[1],o[s*3+2]=u[2]}return{type:tr.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}return t&&t.length===a*3?{type:tr.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:tr.UNSIGNED_BYTE,value:t,size:4,normalized:!0}}var Qee=Le(Tr());var Zee=new Qee.Vector3;function ete(e,t){if(!t)return null;if(e.isOctEncoded16P){let r=new Float32Array(e.pointsLength*3);for(let i=0;i<e.pointsLength;i++)o8(t[i*2],t[i*2+1],Zee),Zee.toArray(r,i*3);return{type:tr.FLOAT,size:2,value:r}}return{type:tr.FLOAT,size:2,value:t}}var tte=Le(Tr());function rte(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,SNe(e,t)):{type:tr.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function SNe(e,t){let r=new tte.Vector3,i=new Float32Array(e.pointCount*3);for(let n=0;n<e.pointCount;n++)r.set(t[n*3],t[n*3+1],t[n*3+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(i,n*3);return i}async function ite(e,t,r,i,n){r=Xf(e,t,r),r=Tg(e,t,r),r=kg(e,t,r,i),ANe(e);let{featureTable:a,batchTable:o}=TNe(e);return await ONe(e,a,o,i,n),kNe(e,a,i),RNe(e,a,o),CNe(e,a),r}function ANe(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function TNe(e){let t=new $f(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",tr.FLOAT,3);let i=INe(e,t);return{featureTable:t,batchTable:i}}function kNe(e,t,r){if(!e.attributes.positions){if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",tr.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){let i=t.getPropertyArray("POSITION_QUANTIZED",tr.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=(1<<16)-1,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",tr.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",tr.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=rte(e,i,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function RNe(e,t,r){if(!e.attributes.colors){let i=null;t.hasProperty("RGBA")?(i=t.getPropertyArray("RGBA",tr.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?i=t.getPropertyArray("RGB",tr.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(i=t.getPropertyArray("RGB565",tr.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=u8(e,i,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",tr.UNSIGNED_BYTE,4))}function CNe(e,t){if(!e.attributes.normals){let r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",tr.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",tr.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=ete(e,r)}}function INe(e,t){let r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",tr.UNSIGNED_SHORT,1),e.batchIds)){let i=t.getGlobalProperty("BATCH_LENGTH");if(!i)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");let{batchTableJson:n,batchTableBinary:a}=e;r=new Sg(n,a,i)}return r}async function ONe(e,t,r,i,n){let a,o,s,u=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];u&&(s=u.properties);let l=t.getExtension("3DTILES_draco_point_compression");if(l){o=l.properties;let f=l.byteOffset,h=l.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 c={buffer:a,properties:ce(ce({},o),s),featureTableProperties:o,batchTableProperties:s,dequantizeInShader:!1};return await PNe(e,c,i,n)}async function PNe(e,t,r,i){let{parse:n}=i,a=_t(ce({},r),{draco:_t(ce({},r.draco),{extraAttributes:t.batchTableProperties||{}})});delete a["3d-tiles"];let o=await n(t.buffer,wg,a),s=o.attributes.POSITION&&o.attributes.POSITION.value,u=o.attributes.COLOR_0&&o.attributes.COLOR_0.value,l=o.attributes.NORMAL&&o.attributes.NORMAL.value,c=o.attributes.BATCH_ID&&o.attributes.BATCH_ID.value,f=s&&o.attributes.POSITION.value.quantization,h=l&&o.attributes.NORMAL.value.quantization;if(f){let p=o.POSITION.data.quantization,y=p.range;e.quantizedVolumeScale=new l8.Vector3(y,y,y),e.quantizedVolumeOffset=new l8.Vector3(p.minValues),e.quantizedRange=(1<<p.quantizationBits)-1,e.isQuantizedDraco=!0}h&&(e.octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);let d={};if(t.batchTableProperties)for(let p of Object.keys(t.batchTableProperties))o.attributes[p]&&o.attributes[p].value&&(d[p.toLowerCase()]=o.attributes[p].value);e.attributes=ce({positions:s,colors:u8(e,u,void 0),normals:l,batchIds:c},d)}var nte="3.4.2";var Rg="3.4.2";var ate="3.4.2",BNe=`https://unpkg.com/@loaders.gl/textures@${ate}/dist/libs/basis_encoder.wasm`,MNe=`https://unpkg.com/@loaders.gl/textures@${ate}/dist/libs/basis_encoder.js`,c8;async function f8(e){let t=e.modules||{};return t.basis?t.basis:(c8=c8||DNe(e),await c8)}async function DNe(e){let t=null,r=null;return[t,r]=await Promise.all([await el("basis_transcoder.js","textures",e),await el("basis_transcoder.wasm","textures",e)]),t=t||globalThis.BASIS,await FNe(t,r)}function FNe(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(i=>{e(r).then(n=>{let{BasisFile:a,initializeBasis:o}=n;o(),i({BasisFile:a})})})}var h8;async function d8(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:(h8=h8||jNe(e),await h8)}async function jNe(e){let t=null,r=null;return[t,r]=await Promise.all([await el(MNe,"textures",e),await el(BNe,"textures",e)]),t=t||globalThis.BASIS,await LNe(t,r)}function LNe(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(i=>{e(r).then(n=>{let{BasisFile:a,KTX2File:o,initializeBasis:s,BasisEncoder:u}=n;s(),i({BasisFile:a,KTX2File:o,BasisEncoder:u})})})}var Ae={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 NNe=["","WEBKIT_","MOZ_"],ote={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"},n2=null;function Mb(e){if(!n2){e=e||qNe()||void 0,n2=new Set;for(let t of NNe)for(let r in ote)if(e&&e.getExtension(`${t}${r}`)){let i=ote[r];n2.add(i)}}return n2}function qNe(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var yte=Le(gte());function Cg(e,t){let r=new Array(t.mipMapLevels),i=t.width,n=t.height,a=0;for(let o=0;o<t.mipMapLevels;++o){let s=zNe(t,i,n,e,o),u=GNe(e,o,a,s);r[o]={compressed:!0,format:t.internalFormat,data:u,width:i,height:n,levelSize:s},i=Math.max(1,i>>1),n=Math.max(1,n>>1),a+=s}return r}function GNe(e,t,r,i){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,i)}function zNe(e,t,r,i,n){return Array.isArray(i)?e.sizeFunction(i[n]):e.sizeFunction(t,r)}var HNe={131:Ae.COMPRESSED_RGB_S3TC_DXT1_EXT,132:Ae.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:Ae.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:Ae.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:Ae.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:Ae.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:Ae.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:Ae.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:Ae.COMPRESSED_RED_RGTC1_EXT,140:Ae.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:Ae.COMPRESSED_RED_GREEN_RGTC2_EXT,142:Ae.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:Ae.COMPRESSED_RGB8_ETC2,148:Ae.COMPRESSED_SRGB8_ETC2,149:Ae.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:Ae.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:Ae.COMPRESSED_RGBA8_ETC2_EAC,152:Ae.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:Ae.COMPRESSED_R11_EAC,154:Ae.COMPRESSED_SIGNED_R11_EAC,155:Ae.COMPRESSED_RG11_EAC,156:Ae.COMPRESSED_SIGNED_RG11_EAC,157:Ae.COMPRESSED_RGBA_ASTC_4x4_KHR,158:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:Ae.COMPRESSED_RGBA_ASTC_5x4_KHR,160:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:Ae.COMPRESSED_RGBA_ASTC_5x5_KHR,162:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:Ae.COMPRESSED_RGBA_ASTC_6x5_KHR,164:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:Ae.COMPRESSED_RGBA_ASTC_6x6_KHR,166:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:Ae.COMPRESSED_RGBA_ASTC_8x5_KHR,168:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:Ae.COMPRESSED_RGBA_ASTC_8x6_KHR,170:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:Ae.COMPRESSED_RGBA_ASTC_8x8_KHR,172:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:Ae.COMPRESSED_RGBA_ASTC_10x5_KHR,174:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:Ae.COMPRESSED_RGBA_ASTC_10x6_KHR,176:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:Ae.COMPRESSED_RGBA_ASTC_10x8_KHR,178:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:Ae.COMPRESSED_RGBA_ASTC_10x10_KHR,180:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:Ae.COMPRESSED_RGBA_ASTC_12x10_KHR,182:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:Ae.COMPRESSED_RGBA_ASTC_12x12_KHR,184:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:Ae.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:Ae.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:Ae.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:Ae.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:Ae.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:Ae.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:Ae.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:Ae.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:Ae.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:Ae.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:Ae.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:Ae.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:Ae.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:Ae.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:Ae.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:Ae.COMPRESSED_RGBA_ASTC_12x12_KHR};function vte(e){return HNe[e]}var Fo=[171,75,84,88,32,50,48,187,13,10,26,10];function l2(e){let t=new Uint8Array(e);return!(t.byteLength<Fo.length||t[0]!==Fo[0]||t[1]!==Fo[1]||t[2]!==Fo[2]||t[3]!==Fo[3]||t[4]!==Fo[4]||t[5]!==Fo[5]||t[6]!==Fo[6]||t[7]!==Fo[7]||t[8]!==Fo[8]||t[9]!==Fo[9]||t[10]!==Fo[10]||t[11]!==Fo[11])}function bte(e){let t=new Uint8Array(e),r=(0,yte.read)(t),i=Math.max(1,r.levels.length),n=r.pixelWidth,a=r.pixelHeight,o=vte(r.vkFormat);return Cg(r.levels,{mipMapLevels:i,width:n,height:a,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var VNe={etc1:{basisFormat:0,compressed:!0,format:Ae.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Ae.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:Ae.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:Ae.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Ae.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:Ae.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 Fb(e,t){if(t.basis.containerFormat==="auto"){if(l2(e)){let i=await d8(t);return _te(i.KTX2File,e,t)}let{BasisFile:r}=await f8(t);return y8(r,e,t)}switch(t.basis.module){case"encoder":let r=await d8(t);switch(t.basis.containerFormat){case"ktx2":return _te(r.KTX2File,e,t);case"basis":default:return y8(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:i}=await f8(t);return y8(i,e,t)}}function y8(e,t,r){let i=new e(new Uint8Array(t));try{if(!i.startTranscoding())throw new Error("Failed to start basis transcoding");let n=i.getNumImages(),a=[];for(let o=0;o<n;o++){let s=i.getNumLevels(o),u=[];for(let l=0;l<s;l++)u.push(WNe(i,o,l,r));a.push(u)}return a}finally{i.close(),i.delete()}}function WNe(e,t,r,i){let n=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),{compressed:s,format:u,basisFormat:l}=xte(i,o),c=e.getImageTranscodedSizeInBytes(t,r,l),f=new Uint8Array(c);if(!e.transcodeImage(f,t,r,l,0,0))throw new Error("failed to start Basis transcoding");return{width:n,height:a,data:f,compressed:s,format:u,hasAlpha:o}}function _te(e,t,r){let i=new e(new Uint8Array(t));try{if(!i.startTranscoding())throw new Error("failed to start KTX2 transcoding");let n=i.getLevels(),a=[];for(let o=0;o<n;o++){a.push(KNe(i,o,r));break}return[a]}finally{i.close(),i.delete()}}function KNe(e,t,r){let{alphaFlag:i,height:n,width:a}=e.getImageLevelInfo(t,0,0),{compressed:o,format:s,basisFormat:u}=xte(r,i),l=e.getImageTranscodedSizeInBytes(t,0,0,u),c=new Uint8Array(l);if(!e.transcodeImage(c,t,0,0,u,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:a,height:n,data:c,compressed:o,levelSize:l,hasAlpha:i,format:s}}function xte(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=Ig()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),VNe[r]}function Ig(){let e=Mb();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 wte={name:"Basis",id:Ln?"basis":"basis-nodejs",module:"textures",version:Rg,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"}}},Nd=_t(ce({},wte),{parse:Fb});var jo={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},YNe={DXT1:Ae.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:Ae.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:Ae.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":Ae.COMPRESSED_RGB_ATC_WEBGL,ATCA:Ae.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:Ae.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},$Ne=Ate,XNe=c2,JNe=c2,QNe={DXT1:Ate,DXT3:c2,DXT5:c2,"ATC ":$Ne,ATCA:XNe,ATCI:JNe};function Ete(e){return new Uint32Array(e,0,jo.HEADER_LENGTH)[jo.MAGIC_NUMBER_INDEX]===jo.MAGIC_NUMBER}function Ste(e){let t=new Int32Array(e,0,jo.HEADER_LENGTH),r=t[jo.HEADER_PF_FOURCC_INDEX];zt(Boolean(t[jo.HEADER_PF_FLAGS_INDEX]&jo.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let i=ZNe(r),n=YNe[i],a=QNe[i];zt(n&&a,`DDS: Unknown pixel format ${r}`);let o=1;t[jo.HEADER_FLAGS_INDEX]&jo.DDSD_MIPMAPCOUNT&&(o=Math.max(1,t[jo.MIPMAPCOUNT_INDEX]));let s=t[jo.HEADER_WIDTH_INDEX],u=t[jo.HEADER_HEIGHT_INDEX],l=t[jo.HEADER_SIZE_INDEX]+4,c=new Uint8Array(e,l);return Cg(c,{mipMapLevels:o,width:s,height:u,sizeFunction:a,internalFormat:n})}function Ate(e,t){return(e+3>>2)*(t+3>>2)*8}function c2(e,t){return(e+3>>2)*(t+3>>2)*16}function ZNe(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var gs={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},e9e={0:[Ae.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[Ae.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[Ae.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[Ae.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[Ae.COMPRESSED_RGB_ETC1_WEBGL],7:[Ae.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[Ae.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[Ae.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[Ae.COMPRESSED_RGB8_ETC2],23:[Ae.COMPRESSED_RGBA8_ETC2_EAC],24:[Ae.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[Ae.COMPRESSED_R11_EAC],26:[Ae.COMPRESSED_RG11_EAC],27:[Ae.COMPRESSED_RGBA_ASTC_4X4_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[Ae.COMPRESSED_RGBA_ASTC_5X4_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[Ae.COMPRESSED_RGBA_ASTC_5X5_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[Ae.COMPRESSED_RGBA_ASTC_6X5_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[Ae.COMPRESSED_RGBA_ASTC_6X6_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[Ae.COMPRESSED_RGBA_ASTC_8X5_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[Ae.COMPRESSED_RGBA_ASTC_8X6_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[Ae.COMPRESSED_RGBA_ASTC_8X8_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[Ae.COMPRESSED_RGBA_ASTC_10X5_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[Ae.COMPRESSED_RGBA_ASTC_10X6_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[Ae.COMPRESSED_RGBA_ASTC_10X8_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[Ae.COMPRESSED_RGBA_ASTC_10X10_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[Ae.COMPRESSED_RGBA_ASTC_12X10_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[Ae.COMPRESSED_RGBA_ASTC_12X12_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},t9e={0:Rte,1:Rte,2:Cte,3:Cte,6:jb,7:jb,9:Lb,11:Lb,22:jb,23:Lb,24:jb,25:jb,26:Lb,27:Lb,28:r9e,29:i9e,30:n9e,31:a9e,32:o9e,33:s9e,34:u9e,35:l9e,36:c9e,37:f9e,38:h9e,39:d9e,40:p9e};function Tte(e){let r=new Uint32Array(e,0,gs.HEADER_LENGTH)[gs.MAGIC_NUMBER_INDEX];return r===gs.MAGIC_NUMBER||r===gs.MAGIC_NUMBER_EXTRA}function kte(e){let t=new Uint32Array(e,0,gs.HEADER_LENGTH),r=t[gs.PIXEL_FORMAT_INDEX],i=t[gs.COLOUR_SPACE_INDEX],n=e9e[r]||[],a=n.length>1&&i?n[1]:n[0],o=t9e[r],s=t[gs.MIPMAPCOUNT_INDEX],u=t[gs.WIDTH_INDEX],l=t[gs.HEIGHT_INDEX],c=gs.HEADER_SIZE+t[gs.METADATA_SIZE_INDEX],f=new Uint8Array(e,c);return Cg(f,{mipMapLevels:s,width:u,height:l,sizeFunction:o,internalFormat:a})}function Rte(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function Cte(e,t){return e=Math.max(e,8),t=Math.max(t,8),e*t/2}function jb(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function Lb(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function r9e(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16}function i9e(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16}function n9e(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16}function a9e(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16}function o9e(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16}function s9e(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16}function u9e(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16}function l9e(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16}function c9e(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16}function f9e(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16}function h9e(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16}function d9e(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16}function p9e(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}function Ite(e){if(l2(e))return bte(e);if(Ete(e))return Ste(e);if(Tte(e))return kte(e);throw new Error("Texture container format not recognized")}var m9e={"compressed-texture":{libraryPath:"libs/",useBasis:!1}},Ote={name:"Texture Containers",id:"compressed-texture",module:"textures",version:Rg,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:m9e},f2=_t(ce({},Ote),{parse:async(e,t)=>t["compressed-texture"].useBasis?(t.basis=_t(ce({format:{alpha:"BC3",noAlpha:"BC1"}},t.basis),{containerFormat:"ktx2",module:"encoder"}),(await Fb(e,t))[0]):Ite(e)});var h2="3.4.2";var{_parseImageNode:g9e}=globalThis,b8=typeof Image!="undefined",_8=typeof ImageBitmap!="undefined",v9e=Boolean(g9e),x8=ji?!0:v9e;function Pte(e){switch(e){case"auto":return _8||b8||x8;case"imagebitmap":return _8;case"image":return b8;case"data":return x8;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function Bte(){if(_8)return"imagebitmap";if(b8)return"image";if(x8)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function y9e(e){let t=b9e(e);if(!t)throw new Error("Not an image");return t}function Mte(e){return w8(e)}function w8(e){switch(y9e(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 b9e(e){return typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap?"imagebitmap":typeof Image!="undefined"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var _9e=/^data:image\/svg\+xml/,x9e=/\.svg((\?|#).*)?$/;function d2(e){return e&&(_9e.test(e)||x9e.test(e))}function Dte(e,t){if(d2(t)){let i=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(i=unescape(encodeURIComponent(i)))}catch(a){throw new Error(a.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return E8(e,t)}function E8(e,t){if(d2(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function Nb(e,t,r){let i=Dte(e,r),n=self.URL||self.webkitURL,a=typeof i!="string"&&n.createObjectURL(i);try{return await w9e(a||i,t)}finally{a&&n.revokeObjectURL(a)}}async function w9e(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((i,n)=>{try{r.onload=()=>i(r),r.onerror=a=>n(new Error(`Could not load image ${e}: ${a}`))}catch(a){n(a)}})}var E9e={},Fte=!0;async function S8(e,t,r){let i;d2(r)?i=await Nb(e,t,r):i=E8(e,r);let n=t&&t.imagebitmap;return await S9e(i,n)}async function S9e(e,t=null){if((A9e(t)||!Fte)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),Fte=!1}return await createImageBitmap(e)}function A9e(e){for(let t in e||E9e)return!1;return!0}function jte(e){return!C9e(e,"ftyp",4)||(e[8]&96)==0?null:T9e(e)}function T9e(e){switch(k9e(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function k9e(e,t,r){return String.fromCharCode(...e.slice(t,r))}function R9e(e){return[...e].map(t=>t.charCodeAt(0))}function C9e(e,t,r=0){let i=R9e(t);for(let n=0;n<i.length;++n)if(i[n]!==e[n+r])return!1;return!0}var dl=!1,qb=!0;function qd(e){let t=Ub(e);return O9e(t)||M9e(t)||P9e(t)||B9e(t)||I9e(t)}function I9e(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=jte(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function O9e(e){let t=Ub(e);return t.byteLength>=24&&t.getUint32(0,dl)===2303741511?{mimeType:"image/png",width:t.getUint32(16,dl),height:t.getUint32(20,dl)}:null}function P9e(e){let t=Ub(e);return t.byteLength>=10&&t.getUint32(0,dl)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,qb),height:t.getUint16(8,qb)}:null}function B9e(e){let t=Ub(e);return t.byteLength>=14&&t.getUint16(0,dl)===16973&&t.getUint32(2,qb)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,qb),height:t.getUint32(22,qb)}:null}function M9e(e){let t=Ub(e);if(!(t.byteLength>=3&&t.getUint16(0,dl)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:n}=D9e(),a=2;for(;a+9<t.byteLength;){let o=t.getUint16(a,dl);if(n.has(o))return{mimeType:"image/jpeg",height:t.getUint16(a+5,dl),width:t.getUint16(a+7,dl)};if(!i.has(o))return null;a+=2,a+=t.getUint16(a,dl)}return null}function D9e(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);let t=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:t}}function Ub(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 A8(e,t){let{mimeType:r}=qd(e)||{},i=globalThis._parseImageNode;return zt(i),await i(e,r)}async function T8(e,t,r){t=t||{};let n=(t.image||{}).type||"auto",{url:a}=r||{},o=F9e(n),s;switch(o){case"imagebitmap":s=await S8(e,t,a);break;case"image":s=await Nb(e,t,a);break;case"data":s=await A8(e,t);break;default:zt(!1)}return n==="data"&&(s=w8(s)),s}function F9e(e){switch(e){case"auto":case"data":return Bte();default:return Pte(e),e}}var j9e=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],L9e=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],N9e={image:{type:"auto",decode:!0}},Og={id:"image",module:"images",name:"Images",version:h2,mimeTypes:L9e,extensions:j9e,parse:T8,tests:[e=>Boolean(qd(new DataView(e)))],options:N9e};var{_encodeImageNode:Lte}=globalThis;async function Nte(e,t){return t=t||{},t.image=t.image||{},Lte?Lte(e,{type:t.image.mimeType}):q9e(e,t)}var qte=!0;async function q9e(e,t){let{mimeType:r,jpegQuality:i}=t.image,{width:n,height:a}=Mte(e),o=document.createElement("canvas");o.width=n,o.height=a,U9e(e,o);let s=await new Promise(u=>{if(i&&qte)try{o.toBlob(u,r,i);return}catch{qte=!1}o.toBlob(u,r)});if(!s)throw new Error("image encoding failed");return await s.arrayBuffer()}function U9e(e,t,r=0,i=0){if(r===0&&i===0&&typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap){let a=t.getContext("bitmaprenderer");if(a)return a.transferFromImageBitmap(e),t}let n=t.getContext("2d");if(e.data){let a=new Uint8ClampedArray(e.data),o=new ImageData(a,e.width,e.height);return n.putImageData(o,0,0),t}return n.drawImage(e,0,0),t}var k8={name:"Images",id:"image",module:"images",version:h2,extensions:["jpeg"],options:{image:{mimeType:"image/png",jpegQuality:null}},encode:Nte};var R8={};function C8(e){if(R8[e]===void 0){let t=ji?z9e(e):G9e(e);R8[e]=t}return R8[e]}function G9e(e){let t=["image/png","image/jpeg","image/gif"],{_parseImageNode:r,_imageFormatsNode:i=t}=globalThis;return Boolean(r)&&i.includes(e)}function z9e(e){switch(e){case"image/avif":case"image/webp":return H9e(e);default:return!0}}function H9e(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}var p2={name:"Basis Universal Supercompressed GPU Texture",id:ji?"ktx2-basis-writer":"ktx2-basis-writer-nodejs",module:"textures",version:Rg,extensions:["ktx2"],worker:!0,options:{useSRGB:!1,qualityLevel:10,encodeUASTC:!1,mipmaps:!1}};function Un(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function I8(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;let i=t.baseUri||t.uri;if(!i)throw new Error(`'baseUri' must be provided to resolve relative url ${e}`);return i.substr(0,i.lastIndexOf("/")+1)+e}function Ute(e,t,r){let i=e.bufferViews[r];Un(i);let n=i.buffer,a=t[n];Un(a);let o=(i.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,o,i.byteLength)}var B8={};To(B8,{decode:()=>uqe,name:()=>sqe});var Gte=["SCALAR","VEC2","VEC3","VEC4"],V9e=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],W9e=new Map(V9e),K9e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Y9e={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},$9e={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function m2(e){return Gte[e-1]||Gte[0]}function g2(e){let t=W9e.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Pg(e,t){let r=$9e[e.componentType],i=K9e[e.type],n=Y9e[e.componentType],a=e.count*i,o=e.count*i*n;return Un(o>=0&&o<=t.byteLength),{ArrayType:r,length:a,byteLength:o}}function Gb(e){let{images:t,bufferViews:r}=e;t=t||[],r=r||[];let i=t.map(o=>o.bufferView);r=r.filter(o=>!i.includes(o));let n=r.reduce((o,s)=>o+s.byteLength,0),a=t.reduce((o,s)=>{let{width:u,height:l}=s.image;return o+u*l},0);return n+Math.ceil(4*a*1.33)}var X9e={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},wi=class{constructor(t){this.gltf=t||{json:ce({},X9e),buffers:[]},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]}getExtension(t){let r=this.getUsedExtensions().find(n=>n===t),i=this.json.extensions||{};return r?i[t]||!0:null}getRequiredExtension(t){return this.getRequiredExtensions().find(i=>i===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 i=this.json[t]&&this.json[t][r];if(!i)throw new Error(`glTF file error: Could not find ${t}[${r}]`);return i}getTypedArrayForBufferView(t){t=this.getBufferView(t);let r=t.buffer,i=this.gltf.buffers[r];Un(i);let n=(t.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,n,t.byteLength)}getTypedArrayForAccessor(t){t=this.getAccessor(t);let r=this.getBufferView(t.bufferView),n=this.getBuffer(r.buffer).data,{ArrayType:a,length:o}=Pg(t,r),s=r.byteOffset+t.byteOffset;return new a(n,s,o)}getTypedArrayForImageData(t){t=this.getAccessor(t);let r=this.getBufferView(t.bufferView),n=this.getBuffer(r.buffer).data,a=r.byteOffset||0;return new Uint8Array(n,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,i){return t.extensions=t.extensions||{},t.extensions[r]=i,this.registerUsedExtension(r),this}setObjectExtension(t,r,i){let n=t.extensions||{};n[r]=i}removeObjectExtension(t,r){let i=t.extensions||{},n=i[r];return delete i[r],n}addExtension(t,r={}){return Un(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return Un(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){if(!this.getExtension(t))return;this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t),this.json.extensions&&delete this.json.extensions[t],Array.isArray(this.json.extensionsRemoved)||(this.json.extensionsRemoved=[]);let r=this.json.extensionsRemoved;r.includes(t)||r.push(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:i}=t;this.json.nodes=this.json.nodes||[];let n={mesh:r};return i&&(n.matrix=i),this.json.nodes.push(n),this.json.nodes.length-1}addMesh(t){let{attributes:r,indices:i,material:n,mode:a=4}=t,s={primitives:[{attributes:this._addAttributes(r),mode:a}]};if(i){let u=this._addIndices(i);s.primitives[0].indices=u}return Number.isFinite(n)&&(s.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(s),this.json.meshes.length-1}addPointCloud(t){let i={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}addImage(t,r){let i=qd(t),n=r||(i==null?void 0:i.mimeType),o={bufferView:this.addBufferView(t),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(t){let r=t.byteLength;Un(Number.isFinite(r)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let i={buffer:0,byteOffset:this.byteLength,byteLength:r};return this.byteLength+=Ff(r,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(t,r){let i={bufferView:t,type:m2(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(i),this.json.accessors.length-1}addBinaryBuffer(t,r={size:3}){let i=this.addBufferView(t),n={min:r.min,max:r.max};(!n.min||!n.max)&&(n=this._getAccessorMinMax(t,r.size));let a={size:r.size,componentType:g2(t),count:Math.round(t.length/r.size),min:n.min,max:n.max};return this.addAccessor(i,Object.assign(a,r))}addTexture(t){let{imageIndex:r}=t,i={source:r};return this.json.textures=this.json.textures||[],this.json.textures.push(i),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),i=new Uint8Array(r),n=0;for(let s of this.sourceBuffers||[])n=ZO(s,i,n);((o=(a=this.json)==null?void 0:a.buffers)==null?void 0:o[0])?this.json.buffers[0].byteLength=t:this.json.buffers=[{byteLength:t}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(t,r){let i=!0;for(;i;){let n=t.indexOf(r);n>-1?t.splice(n,1):i=!1}}_addAttributes(t={}){let r={};for(let i in t){let n=t[i],a=this._getGltfAttributeName(i),o=this.addBinaryBuffer(n.value,n);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 i={min:null,max:null};if(t.length<r)return i;i.min=[],i.max=[];let n=t.subarray(0,r);for(let a of n)i.min.push(a),i.max.push(a);for(let a=r;a<t.length;a+=r)for(let o=0;o<r;o++)i.min[0+o]=Math.min(i.min[0+o],t[a+o]),i.max[0+o]=Math.max(i.max[0+o],t[a+o]);return i}};var J9e="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",Q9e="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",Z9e=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]),eqe=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]),tqe={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},rqe={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function zte(e,t,r,i,n,a="NONE"){let o=await iqe();oqe(o,o.exports[rqe[n]],e,t,r,i,o.exports[tqe[a||"NONE"]])}var O8;async function iqe(){return O8||(O8=nqe()),O8}async function nqe(){let e=J9e;WebAssembly.validate(Z9e)&&(e=Q9e,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate(aqe(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function aqe(e){let t=new Uint8Array(e.length);for(let i=0;i<e.length;++i){let n=e.charCodeAt(i);t[i]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}let r=0;for(let i=0;i<e.length;++i)t[r++]=t[i]<60?eqe[t[i]]:(t[i]-60)*64+t[++i];return t.buffer.slice(0,r)}function oqe(e,t,r,i,n,a,o){let s=e.exports.sbrk,u=i+3&~3,l=s(u*n),c=s(a.length),f=new Uint8Array(e.exports.memory.buffer);f.set(a,c);let h=t(l,i,n,c,a.length);if(h===0&&o&&o(l,u,n),r.set(f.subarray(l,l+i*n)),s(l-s(0)),h!==0)throw new Error(`Malformed buffer data: ${h}`)}var P8="EXT_meshopt_compression",sqe=P8;async function uqe(e,t){var n;let r=new wi(e);if(!((n=t==null?void 0:t.gltf)==null?void 0:n.decompressMeshes))return;let i=[];for(let a of e.json.bufferViews||[])i.push(lqe(r,a));await Promise.all(i),r.removeExtension(P8)}async function lqe(e,t){let r=e.getObjectExtension(t,P8);if(r){let{byteOffset:i=0,byteLength:n=0,byteStride:a,count:o,mode:s,filter:u="NONE",buffer:l}=r,c=e.gltf.buffers[l],f=new Uint8Array(c.arrayBuffer,c.byteOffset+i,n),h=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);return await zte(h,o,a,f,s,u),h}return null}var M8={};To(M8,{name:()=>cqe,preprocess:()=>fqe});var Bg="EXT_texture_webp",cqe=Bg;function fqe(e,t){let r=new wi(e);if(!C8("image/webp")){if(r.getRequiredExtensions().includes(Bg))throw new Error(`gltf: Required extension ${Bg} not supported by browser`);return}let{json:i}=r;for(let n of i.textures||[]){let a=r.getObjectExtension(n,Bg);a&&(n.source=a.source),r.removeObjectExtension(n,Bg)}r.removeExtension(Bg)}var D8={};To(D8,{name:()=>hqe,preprocess:()=>dqe});var v2="KHR_texture_basisu",hqe=v2;function dqe(e,t){let r=new wi(e),{json:i}=r;for(let n of i.textures||[]){let a=r.getObjectExtension(n,v2);a&&(n.source=a.source),r.removeObjectExtension(n,v2)}r.removeExtension(v2)}var j8={};To(j8,{decode:()=>yqe,encode:()=>bqe,name:()=>gqe,preprocess:()=>vqe});function Hte(e){let t={};for(let r in e){let i=e[r];if(r!=="indices"){let n=F8(i);t[r]=n}}return t}function F8(e){let{buffer:t,size:r,count:i}=pqe(e);return{value:t,size:r,byteOffset:0,count:i,type:m2(r),componentType:g2(t)}}function pqe(e){let t=e,r=1,i=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=mqe(t,Float32Array)),i=t.length/r),{buffer:t,size:r,count:i}}function mqe(e,t,r=!1){return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}var Ud="KHR_draco_mesh_compression",gqe=Ud;function vqe(e,t,r){let i=new wi(e);for(let n of Vte(i))i.getObjectExtension(n,Ud)}async function yqe(e,t,r){var a;if(!((a=t==null?void 0:t.gltf)==null?void 0:a.decompressMeshes))return;let i=new wi(e),n=[];for(let o of Vte(i))i.getObjectExtension(o,Ud)&&n.push(_qe(i,o,t,r));await Promise.all(n),i.removeExtension(Ud)}function bqe(e,t={}){let r=new wi(e);for(let i of r.json.meshes||[])xqe(i,t),r.addRequiredExtension(Ud)}async function _qe(e,t,r,i){let n=e.getObjectExtension(t,Ud);if(!n)return;let a=e.getTypedArrayForBufferView(n.bufferView),o=_d(a.buffer,a.byteOffset),{parse:s}=i,u=ce({},r);delete u["3d-tiles"];let l=await s(o,wg,u,i),c=Hte(l.attributes);for(let[f,h]of Object.entries(c))if(f in t.attributes){let d=t.attributes[f],p=e.getAccessor(d);(p==null?void 0:p.min)&&(p==null?void 0:p.max)&&(h.min=p.min,h.max=p.max)}t.attributes=c,l.indices&&(t.indices=F8(l.indices)),wqe(t)}function xqe(e,t,r=4,i,n){var c;if(!i.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");let a=i.DracoWriter.encodeSync({attributes:e}),o=(c=n==null?void 0:n.parseSync)==null?void 0:c.call(n,{attributes:e}),s=i._addFauxAttributes(o.attributes),u=i.addBufferView(a);return{primitives:[{attributes:s,mode:r,extensions:{[Ud]:{bufferView:u,attributes:s}}}]}}function wqe(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*Vte(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var N8={};To(N8,{decode:()=>Tqe,name:()=>Eqe});var Mg=Le(Tr());var Wte={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Kte={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var L8="KHR_texture_transform",Eqe=L8,y2=new Mg.Vector3,Sqe=new Mg.Matrix3,Aqe=new Mg.Matrix3;async function Tqe(e,t){if(!new wi(e).getExtension(L8))return;let n=e.json.materials||[];for(let a=0;a<n.length;a++)kqe(a,e)}function kqe(e,t){var l,c,f;let r=[],i=(l=t.json.materials)==null?void 0:l[e],n=(c=i==null?void 0:i.pbrMetallicRoughness)==null?void 0:c.baseColorTexture;n&&zb(t,e,n,r);let a=i==null?void 0:i.emissiveTexture;a&&zb(t,e,a,r);let o=i==null?void 0:i.normalTexture;o&&zb(t,e,o,r);let s=i==null?void 0:i.occlusionTexture;s&&zb(t,e,s,r);let u=(f=i==null?void 0:i.pbrMetallicRoughness)==null?void 0:f.metallicRoughnessTexture;u&&zb(t,e,u,r)}function zb(e,t,r,i){let n=Rqe(r,i);if(!n)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&&Cqe(e,s,n)}}function Rqe(e,t){var o;let r=(o=e.extensions)==null?void 0:o[L8],{texCoord:i=0}=e,{texCoord:n=i}=r;if(!(t.findIndex(([s,u])=>s===i&&u===n)!==-1)){let s=Pqe(r);return i!==n&&(e.texCoord=n),t.push([i,n]),{originalTexCoord:i,texCoord:n,matrix:s}}return null}function Cqe(e,t,r){var s,u;let{originalTexCoord:i,texCoord:n,matrix:a}=r,o=t.attributes[`TEXCOORD_${i}`];if(Number.isFinite(o)){let l=(s=e.json.accessors)==null?void 0:s[o];if(l&&l.bufferView){let c=(u=e.json.bufferViews)==null?void 0:u[l.bufferView];if(c){let{arrayBuffer:f,byteOffset:h}=e.buffers[c.buffer],d=(h||0)+(l.byteOffset||0)+(c.byteOffset||0),{ArrayType:p,length:y}=Pg(l,c),g=Kte[l.componentType],b=Wte[l.type],E=c.byteStride||g*b,S=new Float32Array(y);for(let k=0;k<l.count;k++){let R=new p(f,d+k*E,2);y2.set(R[0],R[1],1),y2.transformByMatrix3(a),S.set([y2[0],y2[1]],k*b)}i===n?Iqe(l,c,e.buffers,S):Oqe(n,l,t,e,S)}}}}function Iqe(e,t,r,i){e.componentType=5126,r.push({arrayBuffer:i.buffer,byteOffset:0,byteLength:i.buffer.byteLength}),t.buffer=r.length-1,t.byteLength=i.buffer.byteLength,t.byteOffset=0,delete t.byteStride}function Oqe(e,t,r,i,n){i.buffers.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength});let a=i.json.bufferViews;if(!a)return;a.push({buffer:i.buffers.length-1,byteLength:n.buffer.byteLength,byteOffset:0});let o=i.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 Pqe(e){let{offset:t=[0,0],rotation:r=0,scale:i=[1,1]}=e,n=new Mg.Matrix3().set(1,0,0,0,1,0,t[0],t[1],1),a=Sqe.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),o=Aqe.set(i[0],0,0,0,i[1],0,0,0,1);return n.multiplyRight(a).multiplyRight(o)}var q8={};To(q8,{decode:()=>Mqe,encode:()=>Dqe,name:()=>Bqe});var Gd="KHR_lights_punctual",Bqe=Gd;async function Mqe(e){let t=new wi(e),{json:r}=t,i=t.getExtension(Gd);i&&(t.json.lights=i.lights,t.removeExtension(Gd));for(let n of r.nodes||[]){let a=t.getObjectExtension(n,Gd);a&&(n.light=a.light),t.removeObjectExtension(n,Gd)}}async function Dqe(e){let t=new wi(e),{json:r}=t;if(r.lights){let i=t.addExtension(Gd);Un(!i.lights),i.lights=r.lights,delete r.lights}if(t.json.lights){for(let i of t.json.lights){let n=i.node;t.addObjectExtension(n,Gd,i)}delete t.json.lights}}var U8={};To(U8,{decode:()=>jqe,encode:()=>Lqe,name:()=>Fqe});var Hb="KHR_materials_unlit",Fqe=Hb;async function jqe(e){let t=new wi(e),{json:r}=t;for(let i of r.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),t.removeObjectExtension(i,Hb);t.removeExtension(Hb)}function Lqe(e){let t=new wi(e),{json:r}=t;if(t.materials)for(let i of r.materials||[])i.unlit&&(delete i.unlit,t.addObjectExtension(i,Hb,{}),t.addExtension(Hb))}var G8={};To(G8,{decode:()=>qqe,encode:()=>Uqe,name:()=>Nqe});var Vb="KHR_techniques_webgl",Nqe=Vb;async function qqe(e){let t=new wi(e),{json:r}=t,i=t.getExtension(Vb);if(i){let n=Gqe(i,t);for(let a of r.materials||[]){let o=t.getObjectExtension(a,Vb);o&&(a.technique=Object.assign({},o,n[o.technique]),a.technique.values=zqe(a.technique,t)),t.removeObjectExtension(a,Vb)}t.removeExtension(Vb)}}async function Uqe(e,t){}function Gqe(e,t){let{programs:r=[],shaders:i=[],techniques:n=[]}=e,a=new TextDecoder;return i.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=i[o.fragmentShader],o.vertexShader=i[o.vertexShader]}),n.forEach(o=>{o.program=r[o.program]}),n}function zqe(e,t){let r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(i=>{e.uniforms[i].value&&!(i in r)&&(r[i]=e.uniforms[i].value)}),Object.keys(r).forEach(i=>{typeof r[i]=="object"&&r[i].index!==void 0&&(r[i].texture=t.getTexture(r[i].index))}),r}var z8={};To(z8,{decode:()=>Vqe,name:()=>Hqe});var Yte="EXT_feature_metadata",Hqe=Yte;async function Vqe(e){let t=new wi(e);Wqe(t)}function Wqe(e){var a;let t=e.getExtension(Yte),r=(a=t==null?void 0:t.schema)==null?void 0:a.classes,i=t==null?void 0:t.featureTables;if((t==null?void 0:t.featureTextures)&&console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.'),r&&i)for(let o in r){let s=r[o],u=$qe(i,o);u&&Kqe(e,u,s)}}function Kqe(e,t,r){var i;for(let n in r.properties){let a=r.properties[n],o=(i=t==null?void 0:t.properties)==null?void 0:i[n],s=t.count;if(o){let u=Yqe(e,a,s,o);o.data=u}}}function Yqe(e,t,r,i){let n=i.bufferView,a=e.getTypedArrayForBufferView(n);switch(t.type){case"STRING":{let o=i.stringOffsetBufferView,s=e.getTypedArrayForBufferView(o);a=Xqe(a,s,r);break}default:}return a}function $qe(e,t){for(let r in e){let i=e[r];if(i.class===t)return i}return null}function Xqe(e,t,r){let i=[],n=new TextDecoder("utf8"),a=0,o=4;for(let s=0;s<r;s++){let u=t[(s+1)*o]-t[s*o],l=e.subarray(a,u+a),c=n.decode(l);i.push(c),a+=u}return i}var $te=[B8,M8,D8,j8,q8,U8,G8,N8,z8];function Xte(e,t={},r){var n;let i=$te.filter(a=>Qte(a.name,t));for(let a of i)(n=a.preprocess)==null||n.call(a,e,t,r)}async function Jte(e,t={},r){var n;let i=$te.filter(a=>Qte(a.name,t));for(let a of i)await((n=a.decode)==null?void 0:n.call(a,e,t,r))}function Qte(e,t){var n;let r=((n=t==null?void 0:t.gltf)==null?void 0:n.excludeExtensions)||{};return!(e in r&&!r[e])}var H8="KHR_binary_glTF";function Zte(e){let t=new wi(e),{json:r}=t;for(let i of r.images||[]){let n=t.getObjectExtension(i,H8);n&&Object.assign(i,n),t.removeObjectExtension(i,H8)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(H8)}var ere={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Jqe={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},tre=class{constructor(){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(t,r){this.json=t.json;let i=t.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${i.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(i),this._convertTopLevelObjectsToArrays(i),Zte(t),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}_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 ere)this._convertTopLevelObjectToArray(t,r)}_convertTopLevelObjectToArray(t,r){let i=t[r];if(!(!i||Array.isArray(i))){t[r]=[];for(let n in i){let a=i[n];a.id=a.id||n;let o=t[r].length;t[r].push(a),this.idToIndexMap[r][n]=o}}}_convertObjectIdsToArrayIndices(t){for(let r in ere)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:i,indices:n,material:a}=r;for(let o in i)i[o]=this._convertIdToIndex(i[o],"accessor");n&&(r.indices=this._convertIdToIndex(n,"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 i of t[r])for(let n in i){let a=i[n],o=this._convertIdToIndex(a,n);i[n]=o}}_convertIdToIndex(t,r){let i=Jqe[r];if(i in this.idToIndexMap){let n=this.idToIndexMap[i][t];if(!Number.isFinite(n))throw new Error(`gltf v1: failed to resolve ${r} with id ${t}`);return n}return t}_updateObjects(t){for(let r of this.json.buffers)delete r.type}_updateMaterial(t){var r,i,n;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)||((i=a.values)==null?void 0:i.texture2d_0)||((n=a.values)==null?void 0:n.diffuseTex),s=t.textures.findIndex(u=>u.id===o);s!==-1&&(a.pbrMetallicRoughness.baseColorTexture={index:s})}}};function rre(e,t={}){return new tre().normalize(e,t)}var Qqe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Zqe={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},vs={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},eUe={magFilter:vs.TEXTURE_MAG_FILTER,minFilter:vs.TEXTURE_MIN_FILTER,wrapS:vs.TEXTURE_WRAP_S,wrapT:vs.TEXTURE_WRAP_T},tUe={[vs.TEXTURE_MAG_FILTER]:vs.LINEAR,[vs.TEXTURE_MIN_FILTER]:vs.NEAREST_MIPMAP_LINEAR,[vs.TEXTURE_WRAP_S]:vs.REPEAT,[vs.TEXTURE_WRAP_T]:vs.REPEAT};function rUe(e){return Zqe[e]}function iUe(e){return Qqe[e]}var ire=class{constructor(){this.baseUri="";this.json={};this.buffers=[];this.images=[]}postProcess(t,r={}){let{json:i,buffers:n=[],images:a=[],baseUri:o=""}=t;return Un(i),this.baseUri=o,this.json=i,this.buffers=n,this.images=a,this._resolveTree(this.json,r),this.json}_resolveTree(t,r={}){t.bufferViews&&(t.bufferViews=t.bufferViews.map((i,n)=>this._resolveBufferView(i,n))),t.images&&(t.images=t.images.map((i,n)=>this._resolveImage(i,n))),t.samplers&&(t.samplers=t.samplers.map((i,n)=>this._resolveSampler(i,n))),t.textures&&(t.textures=t.textures.map((i,n)=>this._resolveTexture(i,n))),t.accessors&&(t.accessors=t.accessors.map((i,n)=>this._resolveAccessor(i,n))),t.materials&&(t.materials=t.materials.map((i,n)=>this._resolveMaterial(i,n))),t.meshes&&(t.meshes=t.meshes.map((i,n)=>this._resolveMesh(i,n))),t.nodes&&(t.nodes=t.nodes.map((i,n)=>this._resolveNode(i,n))),t.skins&&(t.skins=t.skins.map((i,n)=>this._resolveSkin(i,n))),t.scenes&&(t.scenes=t.scenes.map((i,n)=>this._resolveScene(i,n))),t.scene!==void 0&&(t.scene=t.scenes[this.json.scene])}getScene(t){return this._get("scenes",t)}getNode(t){return this._get("nodes",t)}getSkin(t){return this._get("skins",t)}getMesh(t){return this._get("meshes",t)}getMaterial(t){return this._get("materials",t)}getAccessor(t){return this._get("accessors",t)}getCamera(t){return null}getTexture(t){return this._get("textures",t)}getSampler(t){return this._get("samplers",t)}getImage(t){return this._get("images",t)}getBufferView(t){return this._get("bufferViews",t)}getBuffer(t){return this._get("buffers",t)}_get(t,r){if(typeof r=="object")return r;let i=this.json[t]&&this.json[t][r];return i||console.warn(`glTF file error: Could not find ${t}[${r}]`),i}_resolveScene(t,r){return t.id=t.id||`scene-${r}`,t.nodes=(t.nodes||[]).map(i=>this.getNode(i)),t}_resolveNode(t,r){return t.id=t.id||`node-${r}`,t.children&&(t.children=t.children.map(i=>this.getNode(i))),t.mesh!==void 0?t.mesh=this.getMesh(t.mesh):t.meshes!==void 0&&t.meshes.length&&(t.mesh=t.meshes.reduce((i,n)=>{let a=this.getMesh(n);return i.id=a.id,i.primitives=i.primitives.concat(a.primitives),i},{primitives:[]})),t.camera!==void 0&&(t.camera=this.getCamera(t.camera)),t.skin!==void 0&&(t.skin=this.getSkin(t.skin)),t}_resolveSkin(t,r){return t.id=t.id||`skin-${r}`,t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}_resolveMesh(t,r){return t.id=t.id||`mesh-${r}`,t.primitives&&(t.primitives=t.primitives.map(i=>{i=ce({},i);let n=i.attributes;i.attributes={};for(let a in n)i.attributes[a]=this.getAccessor(n[a]);return i.indices!==void 0&&(i.indices=this.getAccessor(i.indices)),i.material!==void 0&&(i.material=this.getMaterial(i.material)),i})),t}_resolveMaterial(t,r){if(t.id=t.id||`material-${r}`,t.normalTexture&&(t.normalTexture=ce({},t.normalTexture),t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture=ce({},t.occlustionTexture),t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture=ce({},t.emmisiveTexture),t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.emissiveFactor||(t.emissiveFactor=t.emmisiveTexture?[1,1,1]:[0,0,0]),t.pbrMetallicRoughness){t.pbrMetallicRoughness=ce({},t.pbrMetallicRoughness);let i=t.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=ce({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=ce({},i.metallicRoughnessTexture),i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return t}_resolveAccessor(t,r){if(t.id=t.id||`accessor-${r}`,t.bufferView!==void 0&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=rUe(t.componentType),t.components=iUe(t.type),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){let i=t.bufferView.buffer,{ArrayType:n,byteLength:a}=Pg(t,t.bufferView),o=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+i.byteOffset,s=i.arrayBuffer.slice(o,o+a);t.bufferView.byteStride&&(s=this._getValueFromInterleavedBuffer(i,o,t.bufferView.byteStride,t.bytesPerElement,t.count)),t.value=new n(s)}return t}_getValueFromInterleavedBuffer(t,r,i,n,a){let o=new Uint8Array(a*n);for(let s=0;s<a;s++){let u=r+s*i;o.set(new Uint8Array(t.arrayBuffer.slice(u,u+n)),s*n)}return o.buffer}_resolveTexture(t,r){return t.id=t.id||`texture-${r}`,t.sampler="sampler"in t?this.getSampler(t.sampler):tUe,t.source=this.getImage(t.source),t}_resolveSampler(t,r){t.id=t.id||`sampler-${r}`,t.parameters={};for(let i in t){let n=this._enumSamplerParameter(i);n!==void 0&&(t.parameters[n]=t[i])}return t}_enumSamplerParameter(t){return eUe[t]}_resolveImage(t,r){t.id=t.id||`image-${r}`,t.bufferView!==void 0&&(t.bufferView=this.getBufferView(t.bufferView));let i=this.images[r];return i&&(t.image=i),t}_resolveBufferView(t,r){let i=t.buffer,n=_t(ce({id:`bufferView-${r}`},t),{buffer:this.buffers[i]}),a=this.buffers[i].arrayBuffer,o=this.buffers[i].byteOffset||0;return"byteOffset"in t&&(o+=t.byteOffset),n.data=new Uint8Array(a,o,t.byteLength),n}_resolveCamera(t,r){return t.id=t.id||`camera-${r}`,t.perspective,t.orthographic,t}};function nre(e,t){return new ire().postProcess(e,t)}var are=1735152710,V8=12,b2=8,nUe=1313821514,aUe=5130562,oUe=0,sUe=1,uUe=0,Dg=!0;function lUe(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 ore(e,t=0,r={}){let i=new DataView(e),{magic:n=are}=r,a=i.getUint32(t,!1);return a===n||a===are}function W8(e,t,r=0,i={}){let n=new DataView(t),a=lUe(n,r+0),o=n.getUint32(r+4,Dg),s=n.getUint32(r+8,Dg);switch(Object.assign(e,{header:{byteOffset:r,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),r+=V8,e.version){case 1:return cUe(e,n,r);case 2:return fUe(e,n,r,i={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports v1 and v2.`)}}function cUe(e,t,r){zt(e.header.byteLength>V8+b2);let i=t.getUint32(r+0,Dg),n=t.getUint32(r+4,Dg);return r+=b2,zt(n===uUe),K8(e,t,r,i),r+=i,r+=Y8(e,t,r,e.header.byteLength),r}function fUe(e,t,r,i){return zt(e.header.byteLength>V8+b2),hUe(e,t,r,i),r+e.header.byteLength}function hUe(e,t,r,i){for(;r+8<=e.header.byteLength;){let n=t.getUint32(r+0,Dg),a=t.getUint32(r+4,Dg);switch(r+=b2,a){case nUe:K8(e,t,r,n);break;case aUe:Y8(e,t,r,n);break;case oUe:i.strict||K8(e,t,r,n);break;case sUe:i.strict||Y8(e,t,r,n);break;default:break}r+=Ff(n,4)}return r}function K8(e,t,r,i){let n=new Uint8Array(t.buffer,r,i),o=new TextDecoder("utf8").decode(n);return e.json=JSON.parse(o),Ff(i,4)}function Y8(e,t,r,i){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:i,arrayBuffer:t.buffer}),Ff(i,4)}async function sre(e,t,r=0,i,n){var s,u,l,c;dUe(e,t,r,i),rre(e,{normalize:(s=i==null?void 0:i.gltf)==null?void 0:s.normalize}),Xte(e,i,n);let a=[];if(((u=i==null?void 0:i.gltf)==null?void 0:u.loadBuffers)&&e.json.buffers&&await pUe(e,i,n),(l=i==null?void 0:i.gltf)==null?void 0:l.loadImages){let f=mUe(e,i,n);a.push(f)}let o=Jte(e,i,n);return a.push(o),await Promise.all(a),((c=i==null?void 0:i.gltf)==null?void 0:c.postProcess)?nre(e,i):e}function dUe(e,t,r,i){if(i.uri&&(e.baseUri=i.uri),t instanceof ArrayBuffer&&!ore(t,r,i)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=JO(t);else if(t instanceof ArrayBuffer){let o={};r=W8(o,t,r,i.glb),Un(o.type==="glTF",`Invalid GLB magic string ${o.type}`),e._glb=o,e.json=o.json}else Un(!1,"GLTF: must be ArrayBuffer or string");let n=e.json.buffers||[];if(e.buffers=new Array(n.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 pUe(e,t,r){var n,a;let i=e.json.buffers||[];for(let o=0;o<i.length;++o){let s=i[o];if(s.uri){let{fetch:u}=r;Un(u);let l=I8(s.uri,t),c=await((n=r==null?void 0:r.fetch)==null?void 0:n.call(r,l)),f=await((a=c==null?void 0:c.arrayBuffer)==null?void 0:a.call(c));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 mUe(e,t,r){let i=gUe(e),n=e.json.images||[],a=[];for(let o of i)a.push(vUe(e,n[o],o,t,r));return await Promise.all(a)}function gUe(e){let t=new Set,r=e.json.textures||[];for(let i of r)i.source!==void 0&&t.add(i.source);return Array.from(t).sort()}async function vUe(e,t,r,i,n){let{fetch:a,parse:o}=n,s;if(t.uri&&!t.hasOwnProperty("bufferView")){let l=I8(t.uri,i);s=await(await a(l)).arrayBuffer(),t.bufferView={data:s}}if(Number.isFinite(t.bufferView)){let l=Ute(e.json,e.buffers,t.bufferView);s=_d(l.buffer,l.byteOffset,l.byteLength)}Un(s,"glTF image has no data");let u=await o(s,[Og,Nd],{mimeType:t.mimeType,basis:i.basis||{format:Ig()}},n);u&&u[0]&&(u={compressed:!0,mipmaps:!1,width:u[0].width,height:u[0].height,data:u[0]}),e.images=e.images||[],e.images[r]=u}var zd={name:"glTF",id:"gltf",module:"gltf",version:nte,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:yUe,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};async function yUe(e,t={},r){t=ce(ce({},zd.options),t),t.gltf=ce(ce({},zd.options.gltf),t.gltf);let{byteOffset:i=0}=t;return await sre({},e,i,t,r)}var _2={URI:0,EMBEDDED:1};function x2(e,t,r,i){e.rotateYtoZ=!0;let n=e.byteOffset+e.byteLength-r;if(n===0)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=i["3d-tiles"]&&i["3d-tiles"].assetGltfUpAxis?i["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=_d(t,r,n),e.gltfByteOffset=0,e.gltfByteLength=n,r%4==0||console.warn(`${e.type}: embedded glb is not aligned to a 4-byte boundary.`),e.byteOffset+e.byteLength}async function w2(e,t,r,i){let n=r["3d-tiles"]||{};if(bUe(e,t,r),n.loadGLTF){let{parse:a,fetch:o}=i;e.gltfUrl&&(e.gltfArrayBuffer=await o(e.gltfUrl,r),e.gltfByteOffset=0),e.gltfArrayBuffer&&(e.gltf=await a(e.gltfArrayBuffer,zd,r,i),e.gpuMemoryUsageInBytes=Gb(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength)}}function bUe(e,t,r){switch(t){case _2.URI:let i=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),a=new TextDecoder().decode(i);e.gltfUrl=a.replace(/[\s\0]+$/,""),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case _2.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function ure(e,t,r,i,n){var o;r=_Ue(e,t,r,i,n),await w2(e,_2.EMBEDDED,i,n);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 _Ue(e,t,r,i,n){r=Xf(e,t,r),r=Tg(e,t,r),r=kg(e,t,r,i),r=x2(e,t,r,i);let a=new $f(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",tr.FLOAT,3),r}var eo=Le(Tr()),lre=Le(Ya());async function cre(e,t,r,i,n){return r=xUe(e,t,r,i,n),await w2(e,e.gltfFormat,i,n),r}function xUe(e,t,r,i,n){if(r=Xf(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=Tg(e,t,r);let a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r+=4,r=kg(e,t,r,i),r=x2(e,t,r,i),e.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let o=new $f(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",tr.FLOAT,3);let u=new Sg(e.batchTableJson,e.batchTableBinary,s);return wUe(e,o,u,s),r}function wUe(e,t,r,i){let a={instances:new Array(i),batchTable:e._batchTable,cull:!1,url:void 0,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,forwardAxis:[1,0,0]}.instances,o=new eo.Vector3,s=new eo.Vector3,u=new eo.Vector3,l=new eo.Vector3,c=new eo.Matrix3,f=new eo.Quaternion,h=new eo.Vector3,d={},p=new eo.Matrix4,y=[],g=[],b=new eo.Vector3,E=new eo.Vector3;for(let S=0;S<i;S++){let k;if(t.hasProperty("POSITION"))k=t.getProperty("POSITION",tr.FLOAT,3,S,o);else if(t.hasProperty("POSITION_QUANTIZED")){k=t.getProperty("POSITION_QUANTIZED",tr.UNSIGNED_SHORT,3,S,o);let N=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",tr.FLOAT,3,b);if(!N)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let z=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",tr.FLOAT,3,E);if(!z)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let j=65535;for(let U=0;U<3;U++)k[U]=k[U]/j*z[U]+N[U]}if(!k)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(k),d.translation=o,e.normalUp=t.getProperty("NORMAL_UP",tr.FLOAT,3,S,y),e.normalRight=t.getProperty("NORMAL_RIGHT",tr.FLOAT,3,S,g);let R=!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",tr.UNSIGNED_SHORT,2,y),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",tr.UNSIGNED_SHORT,2,g),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?(lre.Ellipsoid.WGS84.eastNorthUpToFixedFrame(o,p),p.getRotationMatrix3(c)):c.identity()}R&&(l.copy(s).cross(u).normalize(),c.setColumn(0,s),c.setColumn(1,u),c.setColumn(2,l)),f.fromMatrix3(c),d.rotation=f,h.set(1,1,1);let M=t.getProperty("SCALE",tr.FLOAT,1,S);Number.isFinite(M)&&h.multiplyByScalar(M);let I=t.getProperty("SCALE_NON_UNIFORM",tr.FLOAT,3,S,y);I&&h.scale(I),d.scale=h;let L=t.getProperty("BATCH_ID",tr.UNSIGNED_SHORT,1,S);L===void 0&&(L=S);let B=new eo.Matrix4().fromQuaternion(d.rotation);p.identity(),p.translate(d.translation),p.multiplyRight(B),p.scale(d.scale);let V=p.clone();a[S]={modelMatrix:V,batchId:L}}e.instances=a}async function fre(e,t,r,i,n,a){r=Xf(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-r>12;){let s={};e.tiles.push(s),r=await a(t,r,i,n,s)}return r}async function hre(e,t,r,i){e.rotateYtoZ=!0,e.gltfUpAxis=r["3d-tiles"]&&r["3d-tiles"].assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y";let{parse:n}=i;e.gltf=await n(t,zd,r,i),e.gpuMemoryUsageInBytes=Gb(e.gltf)}async function $8(e,t=0,r,i,n={}){switch(n.byteOffset=t,n.type=Oee(e,t),n.type){case Ld.COMPOSITE:return await fre(n,e,t,r,i,$8);case Ld.BATCHED_3D_MODEL:return await ure(n,e,t,r,i);case Ld.GLTF:return await hre(n,e,r,i);case Ld.INSTANCED_3D_MODEL:return await cre(n,e,t,r,i);case Ld.POINT_CLOUD:return await ite(n,e,t,r,i);default:throw new Error(`3DTileLoader: unknown type ${n.type}`)}}var EUe=1952609651,SUe=1;async function X8(e,t,r){if(new Uint32Array(e.slice(0,4))[0]!==EUe)throw new Error("Wrong subtree file magic number");if(new Uint32Array(e.slice(4,8))[0]!==SUe)throw new Error("Wrong subtree file verson, must be 1");let a=dre(e.slice(8,16)),o=new Uint8Array(e,24,a),u=new TextDecoder("utf8").decode(o),l=JSON.parse(u),c=dre(e.slice(16,24)),f=new ArrayBuffer(0);return c&&(f=e.slice(24+a)),"bufferView"in l.tileAvailability&&(l.tileAvailability.explicitBitstream=await J8(l,"tileAvailability",f,r)),"bufferView"in l.contentAvailability&&(l.contentAvailability.explicitBitstream=await J8(l,"contentAvailability",f,r)),"bufferView"in l.childSubtreeAvailability&&(l.childSubtreeAvailability.explicitBitstream=await J8(l,"childSubtreeAvailability",f,r)),l}function AUe(e,t){if(t.startsWith("http")){let a=new URL(e,t);return decodeURI(a.toString())}let i=`http://${t}`,n=new URL(e,i);return`/${n.host}${n.pathname}`}async function J8(e,t,r,i){let n=e[t].bufferView,a=e.bufferViews[n],o=e.buffers[a.buffer];if(!(i==null?void 0:i.url)||!i.fetch)throw new Error("Url is not provided");if(!i.fetch)throw new Error("fetch is not provided");if(o.uri){let s=AUe(o.uri,i==null?void 0:i.url),l=await(await i.fetch(s)).arrayBuffer();return new Uint8Array(l,a.byteOffset,a.byteLength)}return new Uint8Array(r,a.byteOffset,a.byteLength)}function dre(e){let t=new DataView(e),r=t.getUint32(0,!0),i=t.getUint32(4,!0);return r+2**32*i}var E2={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:e2,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:X8,options:{}};var ys=null;try{ys=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 Ei(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}Ei.prototype.__isLong__;Object.defineProperty(Ei.prototype,"__isLong__",{value:!0});function Da(e){return(e&&e.__isLong__)===!0}function pre(e){var t=Math.clz32(e&-e);return e?31-t:t}Ei.isLong=Da;var mre={},gre={};function Hd(e,t){var r,i,n;return t?(e>>>=0,(n=0<=e&&e<256)&&(i=gre[e],i)?i:(r=Wr(e,0,!0),n&&(gre[e]=r),r)):(e|=0,(n=-128<=e&&e<128)&&(i=mre[e],i)?i:(r=Wr(e,e<0?-1:0,!1),n&&(mre[e]=r),r))}Ei.fromInt=Hd;function bs(e,t){if(isNaN(e))return t?Sc:mu;if(t){if(e<0)return Sc;if(e>=yre)return Ere}else{if(e<=-bre)return _o;if(e+1>=bre)return wre}return e<0?bs(-e,t).neg():Wr(e%Fg|0,e/Fg|0,t)}Ei.fromNumber=bs;function Wr(e,t,r){return new Ei(e,t,r)}Ei.fromBits=Wr;var S2=Math.pow;function Q8(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?Sc:mu;if(r=r||10,r<2||36<r)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(i===0)return Q8(e.substring(1),t,r).neg();for(var n=bs(S2(r,8)),a=mu,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 l=bs(S2(r,s));a=a.mul(l).add(bs(u))}else a=a.mul(n),a=a.add(bs(u))}return a.unsigned=t,a}Ei.fromString=Q8;function pu(e,t){return typeof e=="number"?bs(e,t):typeof e=="string"?Q8(e,t):Wr(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}Ei.fromValue=pu;var vre=1<<16,TUe=1<<24,Fg=vre*vre,yre=Fg*Fg,bre=yre/2,_re=Hd(TUe),mu=Hd(0);Ei.ZERO=mu;var Sc=Hd(0,!0);Ei.UZERO=Sc;var jg=Hd(1);Ei.ONE=jg;var xre=Hd(1,!0);Ei.UONE=xre;var Z8=Hd(-1);Ei.NEG_ONE=Z8;var wre=Wr(4294967295|0,2147483647|0,!1);Ei.MAX_VALUE=wre;var Ere=Wr(4294967295|0,4294967295|0,!0);Ei.MAX_UNSIGNED_VALUE=Ere;var _o=Wr(0,2147483648|0,!1);Ei.MIN_VALUE=_o;var He=Ei.prototype;He.toInt=function(){return this.unsigned?this.low>>>0:this.low};He.toNumber=function(){return this.unsigned?(this.high>>>0)*Fg+(this.low>>>0):this.high*Fg+(this.low>>>0)};He.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(_o)){var r=bs(t),i=this.div(r),n=i.mul(r).sub(this);return i.toString(t)+n.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var a=bs(S2(t,6),this.unsigned),o=this,s="";;){var u=o.div(a),l=o.sub(u.mul(a)).toInt()>>>0,c=l.toString(t);if(o=u,o.isZero())return c+s;for(;c.length<6;)c="0"+c;s=""+c+s}};He.getHighBits=function(){return this.high};He.getHighBitsUnsigned=function(){return this.high>>>0};He.getLowBits=function(){return this.low};He.getLowBitsUnsigned=function(){return this.low>>>0};He.getNumBitsAbs=function(){if(this.isNegative())return this.eq(_o)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&(t&1<<r)==0;r--);return this.high!=0?r+33:r+1};He.isZero=function(){return this.high===0&&this.low===0};He.eqz=He.isZero;He.isNegative=function(){return!this.unsigned&&this.high<0};He.isPositive=function(){return this.unsigned||this.high>=0};He.isOdd=function(){return(this.low&1)==1};He.isEven=function(){return(this.low&1)==0};He.equals=function(t){return Da(t)||(t=pu(t)),this.unsigned!==t.unsigned&&this.high>>>31==1&&t.high>>>31==1?!1:this.high===t.high&&this.low===t.low};He.eq=He.equals;He.notEquals=function(t){return!this.eq(t)};He.neq=He.notEquals;He.ne=He.notEquals;He.lessThan=function(t){return this.comp(t)<0};He.lt=He.lessThan;He.lessThanOrEqual=function(t){return this.comp(t)<=0};He.lte=He.lessThanOrEqual;He.le=He.lessThanOrEqual;He.greaterThan=function(t){return this.comp(t)>0};He.gt=He.greaterThan;He.greaterThanOrEqual=function(t){return this.comp(t)>=0};He.gte=He.greaterThanOrEqual;He.ge=He.greaterThanOrEqual;He.compare=function(t){if(Da(t)||(t=pu(t)),this.eq(t))return 0;var r=this.isNegative(),i=t.isNegative();return r&&!i?-1:!r&&i?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};He.comp=He.compare;He.negate=function(){return!this.unsigned&&this.eq(_o)?_o:this.not().add(jg)};He.neg=He.negate;He.add=function(t){Da(t)||(t=pu(t));var r=this.high>>>16,i=this.high&65535,n=this.low>>>16,a=this.low&65535,o=t.high>>>16,s=t.high&65535,u=t.low>>>16,l=t.low&65535,c=0,f=0,h=0,d=0;return d+=a+l,h+=d>>>16,d&=65535,h+=n+u,f+=h>>>16,h&=65535,f+=i+s,c+=f>>>16,f&=65535,c+=r+o,c&=65535,Wr(h<<16|d,c<<16|f,this.unsigned)};He.subtract=function(t){return Da(t)||(t=pu(t)),this.add(t.neg())};He.sub=He.subtract;He.multiply=function(t){if(this.isZero())return this;if(Da(t)||(t=pu(t)),ys){var r=ys.mul(this.low,this.high,t.low,t.high);return Wr(r,ys.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?Sc:mu;if(this.eq(_o))return t.isOdd()?_o:mu;if(t.eq(_o))return this.isOdd()?_o:mu;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(_re)&&t.lt(_re))return bs(this.toNumber()*t.toNumber(),this.unsigned);var i=this.high>>>16,n=this.high&65535,a=this.low>>>16,o=this.low&65535,s=t.high>>>16,u=t.high&65535,l=t.low>>>16,c=t.low&65535,f=0,h=0,d=0,p=0;return p+=o*c,d+=p>>>16,p&=65535,d+=a*c,h+=d>>>16,d&=65535,d+=o*l,h+=d>>>16,d&=65535,h+=n*c,f+=h>>>16,h&=65535,h+=a*l,f+=h>>>16,h&=65535,h+=o*u,f+=h>>>16,h&=65535,f+=i*c+n*l+a*u+o*s,f&=65535,Wr(d<<16|p,f<<16|h,this.unsigned)};He.mul=He.multiply;He.divide=function(t){if(Da(t)||(t=pu(t)),t.isZero())throw Error("division by zero");if(ys){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?ys.div_u:ys.div_s)(this.low,this.high,t.low,t.high);return Wr(r,ys.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Sc:mu;var i,n,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Sc;if(t.gt(this.shru(1)))return xre;a=Sc}else{if(this.eq(_o)){if(t.eq(jg)||t.eq(Z8))return _o;if(t.eq(_o))return jg;var o=this.shr(1);return i=o.div(t).shl(1),i.eq(mu)?t.isNegative()?jg:Z8:(n=this.sub(t.mul(i)),a=i.add(n.div(t)),a)}else if(t.eq(_o))return this.unsigned?Sc:mu;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=mu}for(n=this;n.gte(t);){i=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(i)/Math.LN2),u=s<=48?1:S2(2,s-48),l=bs(i),c=l.mul(t);c.isNegative()||c.gt(n);)i-=u,l=bs(i,this.unsigned),c=l.mul(t);l.isZero()&&(l=jg),a=a.add(l),n=n.sub(c)}return a};He.div=He.divide;He.modulo=function(t){if(Da(t)||(t=pu(t)),ys){var r=(this.unsigned?ys.rem_u:ys.rem_s)(this.low,this.high,t.low,t.high);return Wr(r,ys.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};He.mod=He.modulo;He.rem=He.modulo;He.not=function(){return Wr(~this.low,~this.high,this.unsigned)};He.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};He.clz=He.countLeadingZeros;He.countTrailingZeros=function(){return this.low?pre(this.low):pre(this.high)+32};He.ctz=He.countTrailingZeros;He.and=function(t){return Da(t)||(t=pu(t)),Wr(this.low&t.low,this.high&t.high,this.unsigned)};He.or=function(t){return Da(t)||(t=pu(t)),Wr(this.low|t.low,this.high|t.high,this.unsigned)};He.xor=function(t){return Da(t)||(t=pu(t)),Wr(this.low^t.low,this.high^t.high,this.unsigned)};He.shiftLeft=function(t){return Da(t)&&(t=t.toInt()),(t&=63)==0?this:t<32?Wr(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):Wr(0,this.low<<t-32,this.unsigned)};He.shl=He.shiftLeft;He.shiftRight=function(t){return Da(t)&&(t=t.toInt()),(t&=63)==0?this:t<32?Wr(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):Wr(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};He.shr=He.shiftRight;He.shiftRightUnsigned=function(t){return Da(t)&&(t=t.toInt()),(t&=63)==0?this:t<32?Wr(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?Wr(this.high,0,this.unsigned):Wr(this.high>>>t-32,0,this.unsigned)};He.shru=He.shiftRightUnsigned;He.shr_u=He.shiftRightUnsigned;He.rotateLeft=function(t){var r;return Da(t)&&(t=t.toInt()),(t&=63)==0?this:t===32?Wr(this.high,this.low,this.unsigned):t<32?(r=32-t,Wr(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,Wr(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))};He.rotl=He.rotateLeft;He.rotateRight=function(t){var r;return Da(t)&&(t=t.toInt()),(t&=63)==0?this:t===32?Wr(this.high,this.low,this.unsigned):t<32?(r=32-t,Wr(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,Wr(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};He.rotr=He.rotateRight;He.toSigned=function(){return this.unsigned?Wr(this.low,this.high,!1):this};He.toUnsigned=function(){return this.unsigned?this:Wr(this.low,this.high,!0)};He.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};He.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]};He.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]};Ei.fromBytes=function(t,r,i){return i?Ei.fromBytesLE(t,r):Ei.fromBytesBE(t,r)};Ei.fromBytesLE=function(t,r){return new Ei(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};Ei.fromBytesBE=function(t,r){return new Ei(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)};var Lg=Ei;var kUe=16;function Wb(e){e==="X"&&(e="");let t=e.padEnd(kUe,"0");return Lg.fromString(t,!0,16)}function eM(e){if(e.isZero())return"X";let t=e.countTrailingZeros(),r=t%4;t=(t-r)/4;let i=t;t*=4;let a=e.shiftRightUnsigned(t).toString(16).replace(/0+$/,"");return Array(17-i-a.length).join("0")+a}function tM(e,t){let r=RUe(e).shiftRightUnsigned(2);return e.add(Lg.fromNumber(2*t+1-4).multiply(r))}function RUe(e){return e.and(e.not().add(1))}var CUe=3,IUe=30,OUe=2*IUe+1,Sre=180/Math.PI;function Are(e){if(e.length===0)throw new Error(`Invalid Hilbert quad key ${e}`);let t=e.split("/"),r=parseInt(t[0],10),i=t[1],n=i.length,a=0,o=[0,0];for(let s=n-1;s>=0;s--){a=n-s;let u=i[s],l=0,c=0;u==="1"?c=1:u==="2"?(l=1,c=1):u==="3"&&(l=1);let f=Math.pow(2,a-1);PUe(f,o,l,c),o[0]+=f*l,o[1]+=f*c}if(r%2==1){let s=o[0];o[0]=o[1],o[1]=s}return{face:r,ij:o,level:a}}function Tre(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<CUe+OUe;)t="0"+t;let r=t.lastIndexOf("1"),i=t.substring(0,3),n=t.substring(3,r),a=n.length/2,o=Lg.fromString(i,!0,2).toString(10),s="";if(a!==0)for(s=Lg.fromString(n,!0,2).toString(4);s.length<a;)s="0"+s;return`${o}/${s}`}function rM(e,t,r){let i=1<<t;return[(e[0]+r[0])/i,(e[1]+r[1])/i]}function kre(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function iM(e){return[kre(e[0]),kre(e[1])]}function nM(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 aM([e,t,r]){let i=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*Sre,i*Sre]}function PUe(e,t,r,i){if(i===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let n=t[0];t[0]=t[1],t[1]=n}}function Rre(e){let t=rM(e.ij,e.level,[.5,.5]),r=iM(t),i=nM(e.face,r);return aM(i)}var BUe=100;function oM(e){let{face:t,ij:r,level:i}=e,n=[[0,0],[0,1],[1,1],[1,0],[0,0]],a=Math.max(1,Math.ceil(BUe*Math.pow(2,-i))),o=new Float64Array(4*a*2+2),s=0,u=0;for(let l=0;l<4;l++){let c=n[l].slice(0),f=n[l+1],h=(f[0]-c[0])/a,d=(f[1]-c[1])/a;for(let p=0;p<a;p++){c[0]+=h,c[1]+=d;let y=rM(r,i,c),g=iM(y),b=nM(t,g),E=aM(b);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 Ng(e){let t=MUe(e);return Are(t)}function MUe(e){if(e.indexOf("/")>0)return e;let t=Wb(e);return Tre(t)}function sM(e){let t=Ng(e);return Rre(t)}function Cre(e){let t;if(e.face===2||e.face===5){let r=null,i=0;for(let n=0;n<4;n++){let a=`${e.face}/${n}`,o=Ng(a),s=oM(o);(typeof r=="undefined"||r===null)&&(r=new Float64Array(4*s.length)),r.set(s,i),i+=s.length}t=Ire(r)}else{let r=oM(e);t=Ire(r)}return t}function Ire(e){if(e.length%2!=0)throw new Error("Invalid corners");let t=[],r=[];for(let i=0;i<e.length;i+=2)t.push(e[i]),r.push(e[i+1]);return t.sort((i,n)=>i-n),r.sort((i,n)=>i-n),{west:t[0],east:t[t.length-1],north:r[r.length-1],south:r[0]}}var Ac=Le(Tr());function uM(e,t){let r=(t==null?void 0:t.minimumHeight)||0,i=(t==null?void 0:t.maximumHeight)||0,n=Ng(e),a=Cre(n),o=a.west,s=a.south,u=a.east,l=a.north,c=[];return c.push(new Ac.Vector3(o,l,r)),c.push(new Ac.Vector3(u,l,r)),c.push(new Ac.Vector3(u,s,r)),c.push(new Ac.Vector3(o,s,r)),c.push(new Ac.Vector3(o,l,i)),c.push(new Ac.Vector3(u,l,i)),c.push(new Ac.Vector3(u,s,i)),c.push(new Ac.Vector3(o,s,i)),c}var Ore=Le(Tr()),Pre=Le(cl());var Bre=Le(Ya());function A2(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},i=uM(t,r),n=sM(t),a=n[0],o=n[1],s=Bre.Ellipsoid.WGS84.cartographicToCartesian([a,o,r.maximumHeight]),u=new Ore.Vector3(s[0],s[1],s[2]);i.push(u);let l=(0,Pre.makeOrientedBoundingBoxFromPoints)(i);return[...l.center,...l.halfAxes]}var DUe=4,FUe=8,jUe={QUADTREE:DUe,OCTREE:FUe};function LUe(e,t,r){if(e==null?void 0:e.box){let i=Wb(e.s2VolumeInfo.token),n=tM(i,t),a=eM(n),o=ce({},e.s2VolumeInfo);switch(o.token=a,r){case"OCTREE":let l=e.s2VolumeInfo,c=l.maximumHeight-l.minimumHeight,f=c/2,h=l.minimumHeight+c/2;l.minimumHeight=h-f,l.maximumHeight=h+f;break;default:break}return{box:A2(o),s2VolumeInfo:o}}}async function lM(e){let{options:t,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:i=0,globalData:n={level:0,mortonIndex:0,x:0,y:0,z:0},s2VolumeBox:a}=e,{subtree:o,level:s=0}=e,{subdivisionScheme:u,subtreeLevels:l,maximumLevel:c,contentUrlTemplate:f,subtreesUriTemplate:h,basePath:d}=t,p={children:[],lodMetricValue:0,contentUrl:""},y=jUe[u],g=i&1,b=i>>1&1,E=i>>2&1,S=(y**s-1)/(y-1),k=Vd(r.mortonIndex,i),R=S+k,M=Vd(r.x,g),I=Vd(r.y,b),L=Vd(r.z,E),B=!1;s+1>l&&(B=cM(o.childSubtreeAvailability,k));let V=Vd(n.x,M),N=Vd(n.y,I),z=Vd(n.z,L),j=s+n.level;if(B){let ne=`${d}/${h}`,ue=T2(ne,j,V,N,z);o=await ci(ue,E2),n.mortonIndex=k,n.x=M,n.y=I,n.z=L,n.level=s,k=0,R=0,M=0,I=0,L=0,s=0}if(!cM(o.tileAvailability,R)||s>c)return p;cM(o.contentAvailability,R)&&(p.contentUrl=T2(f,j,V,N,z));let Z=s+1,te={mortonIndex:k,x:M,y:I,z:L};for(let ne=0;ne<y;ne++){let ue=LUe(a,ne,u),me=await lM({subtree:o,options:t,parentData:te,childIndex:ne,level:Z,globalData:n,s2VolumeBox:ue});if(me.contentUrl||me.children.length){let Ne=j+1,Ue=NUe(me,Ne,{childTileX:M,childTileY:I,childTileZ:L},t,a);p.children.push(Ue)}}return p}function cM(e,t){return"constant"in e?Boolean(e.constant):e.explicitBitstream?GUe(t,e.explicitBitstream):!1}function NUe(e,t,r,i,n){let{basePath:a,refine:o,getRefine:s,lodMetricType:u,getTileType:l,rootLodMetricValue:c,rootBoundingVolume:f}=i,h=e.contentUrl&&e.contentUrl.replace(`${a}/`,""),d=c/2**t,p=(n==null?void 0:n.box)?{box:n.box}:f,y=qUe(t,p,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:h},id:e.contentUrl,refine:s(o),type:l(e),lodMetricType:u,lodMetricValue:d,geometricError:d,transform:e.transform,boundingVolume:y}}function qUe(e,t,r){if(t.region){let{childTileX:i,childTileY:n,childTileZ:a}=r,[o,s,u,l,c,f]=t.region,h=2**e,d=(u-o)/h,p=(l-s)/h,y=(f-c)/h,[g,b]=[o+d*i,o+d*(i+1)],[E,S]=[s+p*n,s+p*(n+1)],[k,R]=[c+y*a,c+y*(a+1)];return{region:[g,E,b,S,k,R]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${t}`)}function Vd(e,t){return parseInt(e.toString(2)+t.toString(2),2)}function T2(e,t,r,i,n){let a=UUe({level:t,x:r,y:i,z:n});return e.replace(/{level}|{x}|{y}|{z}/gi,o=>a[o])}function UUe(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function GUe(e,t){let r=Math.floor(e/8),i=e%8;return(t[r]>>i&1)===1}function fM(e){if(!e.contentUrl)return Fd.EMPTY;let r=e.contentUrl.split("?")[0].split(".").pop();switch(r){case"pnts":return Fd.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return Fd.SCENEGRAPH;default:return r}}function hM(e){switch(e){case"REPLACE":case"replace":return Ba.REPLACE;case"ADD":case"add":return Ba.ADD;default:return e}}function dM(e,t){if(/^[a-z][0-9a-z+.-]*:/i.test(t)){let i=new URL(e,`${t}/`);return decodeURI(i.toString())}else if(e.startsWith("/"))return e;return`${t}/${e}`}function Mre(e,t){if(!e)return null;if(e.content){let r=e.content.uri||e.content.url;e.contentUrl=dM(r,t.basePath)}return e.id=e.contentUrl,e.lodMetricType=jd.GEOMETRIC_ERROR,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,e.type=fM(e),e.refine=hM(e.refine),e}async function Dre(e,t){let r=e.basePath,i,n=jre(e==null?void 0:e.root);n&&e.root?i=await Fre(e.root,e,n,t):i=Mre(e.root,e);let a=[];for(a.push(i);a.length>0;){let s=(a.pop()||{}).children||[];for(let u of s){let l=jre(u);l?u=await Fre(u,e,l,t):Mre(u,{basePath:r}),a.push(u)}}return i}async function Fre(e,t,r,i){var E,S;let n=t.basePath,{subdivisionScheme:a,maximumLevel:o,subtreeLevels:s,subtrees:{uri:u}}=r,l=T2(u,0,0,0,0),c=dM(l,n),f=await ci(c,E2,i),h=dM(e.content.uri,n),d=(E=t==null?void 0:t.root)==null?void 0:E.refine,p=e.geometricError,y=(S=e.boundingVolume.extensions)==null?void 0:S["3DTILES_bounding_volume_S2"];if(y){let R={box:A2(y),s2VolumeInfo:y};e.boundingVolume=R}let g=e.boundingVolume,b={contentUrlTemplate:h,subtreesUriTemplate:u,subdivisionScheme:a,subtreeLevels:s,maximumLevel:o,refine:d,basePath:n,lodMetricType:jd.GEOMETRIC_ERROR,rootLodMetricValue:p,rootBoundingVolume:g,getTileType:fM,getRefine:hM};return await zUe(e,f,b)}async function zUe(e,t,r){if(!e)return null;e.lodMetricType=jd.GEOMETRIC_ERROR,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform;let{children:i,contentUrl:n}=await lM({subtree:t,options:r,s2VolumeBox:e});return n&&(e.contentUrl=n,e.content={uri:n.replace(`${r.basePath}/`,"")}),e.refine=hM(e.refine),e.type=fM(e),e.children=i,e.id=e.contentUrl,e}function jre(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 Tc={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:e2,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:KUe,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};function HUe(e){return au.dirname(e.url)}async function VUe(e,t,r){let i={content:{featureIds:null}};return await $8(e,0,t,r,i.content),i.content}async function WUe(e,t,r){var n;let i=JSON.parse(new TextDecoder().decode(e));return i.loader=t.loader||Tc,i.url=r.url,i.queryString=r.queryString,i.basePath=HUe(i),i.root=await Dre(i,t),i.type=aa.TILES3D,i.lodMetricType=jd.GEOMETRIC_ERROR,i.lodMetricValue=((n=i.root)==null?void 0:n.lodMetricValue)||0,i}async function KUe(e,t,r){let i=t["3d-tiles"]||{},n;return i.isTileset==="auto"?n=r.url&&r.url.indexOf(".json")!==-1:n=i.isTileset,n?e=await WUe(e,t,r):e=await VUe(e,t,r),e}var Lre="https://api.cesium.com/v1/assets";async function Nre(e,t){if(!t){let a=await YUe(e);for(let o of a.items)o.type==="3DTILES"&&(t=o.id)}let r=await $Ue(e,t),{type:i,url:n}=r;return zt(i==="3DTILES"&&n),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function YUe(e){zt(e);let t=Lre,r={Authorization:`Bearer ${e}`},i=await na(t,{fetch:{headers:r}});if(!i.ok)throw new Error(i.statusText);return await i.json()}async function $Ue(e,t){zt(e,t);let r={Authorization:`Bearer ${e}`},i=`${Lre}/${t}`,n=await na(`${i}`,{fetch:{headers:r}});if(!n.ok)throw new Error(n.statusText);let a=await n.json();if(n=await na(`${i}/endpoint`,{fetch:{headers:r}}),!n.ok)throw new Error(n.statusText);let o=await n.json();return a=ce(ce({},a),o),a}async function XUe(e,t={}){t=t["cesium-ion"]||{};let{accessToken:r}=t,i=t.assetId;if(!Number.isFinite(i)){let n=e.match(/\/([0-9]+)\/tileset.json/);i=n&&n[1]}return Nre(r,i)}var k2=_t(ce({},Tc),{id:"cesium-ion",name:"Cesium Ion",preload:XUe,parse:async(e,t,r)=>(t=ce({},t),t["3d-tiles"]=t["cesium-ion"],t.loader=k2,Tc.parse(e,t,r)),options:{"cesium-ion":_t(ce({},Tc.options["3d-tiles"]),{accessToken:null})}});var Na=Le(require("path"));var pl=Le(iie()),yCt=pl.default.v1,bCt=pl.default.v3,Rc=pl.default.v4,_Ct=pl.default.v5,xCt=pl.default.NIL,wCt=pl.default.version,ECt=pl.default.validate,SCt=pl.default.stringify,ACt=pl.default.parse;var jp=Le(require("process")),qk=Le(vu()),RL=Le(SM());var Y0=Le(require("path")),vge=Le(vu());var pie=()=>({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 W0=Le(require("fs")),K0=Le(require("path"));var dge=Le(require("zlib")),pge=Le(require("path")),q_=Le(require("fs")),Zut=Le(Vhe());var elt=Le(uL());var tlt=Le(xM());function Ck(e){let t=`${e}.gz`,r=(0,dge.createGzip)(),i=(0,q_.createReadStream)(e),n=(0,q_.createWriteStream)(t);return new Promise((a,o)=>{i.on("end",()=>{console.log(`${t} compressed and saved.`),a(t)}),i.on("error",s=>{console.log(`${t}: compression error!`),o(s)}),i.pipe(r).pipe(n)})}async function mge(e,t,r,i,n){process.platform==="win32"?await ilt(e,t,r,i,n):await rlt(e,t,r,i)}async function rlt(e,t,r=0,i="."){let n=U_(t),a=[`-${r}`,"-r",n,i];await new Df().start({command:"zip",arguments:a,spawn:{cwd:e},wait:0})}async function ilt(e,t,r=0,i=(0,pge.join)(".","*"),n){i[0]==="@"&&(i=`*${i.substr(1)}`);let a=U_(t),o=["a","-tzip",`-mx=${r}`,a,i];await new Df().start({command:n,arguments:o,spawn:{cwd:`${e}`},wait:0})}async function Hn(e,t,r="index.json"){let i;t instanceof Promise?i=new Uint8Array(await t):t instanceof ArrayBuffer?i=new Uint8Array(t):i=t,await W0.promises.mkdir(e,{recursive:!0});let n=(0,K0.join)(e,r);try{await W0.promises.writeFile(n,i)}catch(a){throw a}return console.log(`${n} saved.`),n}async function Cl(e,t,r="index.json",i=!0,n){let a=await Hn(e,t,r);if(i){if(n)return n.includes(a)?null:(n.push(a),`${a}.gz`);{let o=await Ck(a);return await lL(a),o}}return a}async function Ik(e,t){return new Promise((r,i)=>{let n=0;console.log(`load ${e}/${t}.`);let a=setInterval(()=>{let o=(0,K0.join)(e,t);ci(o,iP).then(s=>{clearInterval(a),r(s)}).catch(()=>{n++,n>100&&(clearInterval(a),i(new Error(`Cannon load ${e}/${t}.`)))})},200)})}async function gge(e){try{return await W0.promises.stat(e),!0}catch{return!1}}function G_(e){return W0.promises.rmdir(e,{recursive:!0})}function lL(e){return W0.promises.unlink(e)}function U_(e){return(0,K0.isAbsolute)(e)?e:(0,K0.join)(process.cwd(),e)}var wo=class{constructor(t,r,i){this.length=0;this.nodesPerPage=r,this.nodesCounter=0,this.nodePages=[{}],this.nodePages[0].nodes=[],this.writeFile=t,this.converter=i,this.length=0}useWriteFunction(t){this.writeFile=t}getNodePageFileName(t){let r,i;return this.converter.options.slpk?(r=(0,Y0.join)(this.converter.layers0Path,"nodepages"),i=`${t.toString()}.json`):(r=(0,Y0.join)(this.converter.layers0Path,"nodepages",t.toString()),i="index.json"),{filePath:r,fileName:i}}async loadNodePage(t){let{filePath:r,fileName:i}=this.getNodePageFileName(t),n=(0,Y0.join)(r,i);return await gge(n)?(console.log(`load ${n}.`),await Ik(r,i)):{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 i=t%this.nodesPerPage;return r=r||await this.getPageByNodeId(t),r.nodes[i]}async addChildRelation(t,r){var n;if(t==null)return;let i=await this.getNodeById(t);(n=i.children)==null||n.push(r),await this.saveNode(i)}async push(t,r){if(t.index=this.nodesCounter++,!this.converter.options.instantNodeWriting){let i=this.nodePages[this.nodePages.length-1];i.nodes.length===this.nodesPerPage&&(i={nodes:[]},this.nodePages.push(i)),i.nodes.push(t)}return await this.addChildRelation(r,t.index),wo.updateResourceInMesh(t),await this.saveNode(t),t}async saveNode(t){if(this.converter.options.instantNodeWriting){let r=this.getPageIndexByNodeId(t.index),i=await this.getPageByNodeId(t.index),{filePath:n,fileName:a}=this.getNodePageFileName(r),o=await this.getNodeById(t.index,i);o?wo.updateAll(o,t):i.nodes.push(t);let s=JSON.stringify(i);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodePages/${r.toString()}.json.gz`,writePromise:()=>this.writeFile(n,s,a,!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>this.writeFile(n,s)},!0)}else return}async saveMetadata(){let t=(0,vge.default)({nodeCount:this.nodesCounter},pie()),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 i=JSON.stringify(r),n=(0,Y0.join)(this.converter.layers0Path,"nodepages");await this.converter.writeQueue.enqueue({archiveKey:`nodePages/${t.toString()}.json.gz`,writePromise:()=>this.writeFile(n,i,`${t.toString()}.json`)})}await this.saveMetadata()}else for(let[t,r]of this.nodePages.entries()){let i=JSON.stringify(r),n=(0,Y0.join)(this.converter.layers0Path,"nodepages",t.toString());await this.converter.writeQueue.enqueue({writePromise:()=>this.writeFile(n,i)})}}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}),wo.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 z_=Le(require("path")),Ok=Le(require("fs"));function Pk(e){let t=1e6,r=e[0],i=Math.floor(r/3600);r=r-i*3600;let n=Math.floor(r/60);r=r-n*60;let a=Math.floor(r),o=e[1]/t,s="";return i&&(s+=`${i}h `),n&&(s+=`${n}m `),a&&(s+=`${a}s`),s||(s+=`${o}ms`),s}async function Bk(e){let{slpk:t,outputPath:r,tilesetName:i}=e,n=U_(r);try{if(t){let s=(0,z_.join)(n,`${i}.slpk`);return(await Ok.promises.stat(s)).size}let a=(0,z_.join)(n,i);return await yge(a)}catch(a){return console.log("Calculate file sizes error: ",a),null}}async function yge(e){let t=0,r=await Ok.promises.readdir(e);for(let i of r){let n=await Ok.promises.stat((0,z_.join)(e,i));n.isDirectory()?t+=await yge((0,z_.join)(e,i)):t+=n.size}return t}var Ds=Le(Tr()),pL=Le(Ya());var Dge=Le(SM());var Fp=3,$0=9;function bge(e){let{positions:t,normals:r,texCoords:i,colors:n,uvRegions:a,featureIndices:o}=e,s=t.length/$0;if(!o.length)return{faceRange:new Uint32Array([0,s-1]),featureIds:[0],featureCount:1,positions:t,normals:r,texCoords:i,colors:n,uvRegions:a};let u=nlt(o),l=alt(ce(ce({},u),e)),c=olt(l);return slt(c,u.featureCount)}function nlt(e){let t=1,r=1,i=_ge(e.slice(0,Fp)),n=[],a=[],o=[i];n[0]=0,a[0]=i;for(let l=Fp;l<e.length;l+=Fp){let c=_ge(e.slice(l,l+Fp));i!==c&&(n[t]=l/Fp-1,n[t+1]=l/Fp,a[r]=c,o.includes(c)||o.push(c),t+=2,r+=1),i=c}n[t]=e.length/Fp-1;let s=new Uint32Array(n),u=o.length;return{faceRange:s,featureCount:u,featureIds:a}}function _ge(e){let t={},r=e[0],i=1;for(let n of e)t[n]=(t[n]||0)+1,i=i>t[n]?i:t[n],r=i>t[n]?r:n;return r}function alt(e){let{featureIds:t,positions:r,normals:i,colors:n,uvRegions:a,texCoords:o,faceRange:s=new Uint32Array(0)}=e,u=[],l=new Float32Array(r),c=new Float32Array(i),f=new Uint8Array(n),h=new Float32Array(o),d=new Uint16Array(a);for(let p=0;p<t.length;p++){let y=s[p*2],g=s[p*2+1],b=H_("positions",y,g),E=H_("normals",y,g),S=H_("colors",y,g),k=H_("uvRegions",y,g),R=H_("texCoords",y,g);u.push({featureId:t[p],positions:l.slice(0,b),normals:c.slice(0,E),colors:f.slice(0,S),uvRegions:d.slice(0,k),texCoords:h.slice(0,R)}),l=l.slice(b),c=c.slice(E),f=f.slice(S),d=d.slice(k),h=h.slice(R)}return u.sort((p,y)=>p.featureId-y.featureId)}function H_(e,t,r){let i=4,n=2,a=r-t+1,o=a*3;switch(e){case"positions":case"normals":return a*$0;case"colors":case"uvRegions":return o*i;case"texCoords":return o*n;default:return 0}}function olt(e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],n=t.find(a=>a.featureId===i.featureId);n?(n.positions=ha(n.positions,i.positions),n.normals=ha(n.normals,i.normals),n.colors=ha(n.colors,i.colors),n.texCoords=ha(n.texCoords,i.texCoords)):t.push(i)}return t}function slt(e,t){let r=e[0],i=[r.featureId||0],n=new Float32Array(r.positions),a=new Float32Array(r.normals),o=new Uint8Array(r.colors),s=new Uint16Array(r.uvRegions),u=new Float32Array(r.texCoords),l=[0],c=0,f=0;for(let d=1;d<e.length;d++){let p=e[d];i.push(p.featureId||0),n=ha(n,p.positions),a=ha(a,p.normals),o=ha(o,p.colors),s=ha(s,p.uvRegions),u=ha(u,p.texCoords);let y=e[c];l.push(y.positions.length/$0-1+f),l.push(y.positions.length/$0+f),f+=y.positions.length/$0,c+=1}return l.push(n.length/$0-1),{faceRange:new Uint32Array(l),featureIds:i,positions:n,normals:a,colors:o,uvRegions:s,texCoords:u,featureCount:t}}var La=Le(Tr()),X0=Le(Ya()),Kc=Le(cl());function cL(e,t){let r,i,n,a=e.boundingVolume,o=X0.Ellipsoid.WGS84.cartesianToCartographic(a.center,new La.Vector3);return o[2]=o[2]-t.getHeight(o[1],o[0]),a instanceof Kc.OrientedBoundingBox?(i=a.halfSize,r=new La.Vector3(i[0],i[1],i[2]).len(),n=a.quaternion):(r=e.boundingVolume.radius,i=[r,r,r],n=new La.Quaternion().fromMatrix3(new La.Matrix3([i[0],0,0,0,i[1],0,0,0,i[2]])).normalize()),{mbs:[o[0],o[1],o[2],r],obb:{center:[o[0],o[1],o[2]],halfSize:i,quaternion:n}}}function xge(e,t){let r=ult(e),i=(0,Kc.makeOrientedBoundingBoxFromPoints)(r),n=(0,Kc.makeBoundingSphereFromPoints)(r),a=X0.Ellipsoid.WGS84.cartesianToCartographic(n.center,new La.Vector3),o=X0.Ellipsoid.WGS84.cartesianToCartographic(i.center,new La.Vector3);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],n.radius],obb:{center:o,halfSize:i.halfSize,quaternion:i.quaternion}}}function ult(e){let t=[];for(let r=0;r<e.length;r+=3){let i=new La.Vector3([e[r],e[r+1],e[r+2]]);t.push(i)}return t}function wge(e){let t;e instanceof Kc.BoundingSphere?t=e:t=e.getBoundingSphere();let r=t.center,i=t.radius,n=X0.Ellipsoid.WGS84.cartesianToCartographic(new La.Vector3(r[0]+i,r[1]+i,r[2]+i),new La.Vector3),a=X0.Ellipsoid.WGS84.cartesianToCartographic(new La.Vector3(r[0]-i,r[1]-i,r[2]-i),new La.Vector3);return{xmin:Math.min(a[0],n[0]),xmax:Math.max(a[0],n[0]),ymin:Math.min(a[1],n[1]),ymax:Math.max(a[1],n[1]),zmin:Math.min(a[2],n[2]),zmax:Math.max(a[2],n[2])}}function fL(e){let t=e[3],r=new La.Vector3(e[0],e[1],e[2]),i=new La.Matrix3([t,0,0,0,t,0,0,0,t]);return new Kc.OrientedBoundingBox(r,i)}function llt(e){let t={};for(let r in e)t[r]={value:e[r].value};return t}function Ege(e){var a,o,s,u,l,c,f,h;let t=((o=(a=e.gltf)==null?void 0:a.scene)==null?void 0:o.nodes)||((l=(u=(s=e.gltf)==null?void 0:s.scenes)==null?void 0:u[0])==null?void 0:l.nodes)||((c=e.gltf)==null?void 0:c.nodes)||[],r=((h=(f=e.gltf)==null?void 0:f.images)==null?void 0:h.map(d=>{var p,y;if((p=d==null?void 0:d.image)==null?void 0:p.compressed)return{data:null,compressed:!0};{let g=(y=d==null?void 0:d.image)==null?void 0:y.data,b=new Uint8Array(g.length);return b.set(g),{data:b,compressed:!1,height:d.image.height,width:d.image.width,components:d.image.components,mimeType:d.mimeType}}}))||[];Sge(t);let i=e.cartographicOrigin,n=e.cartesianModelMatrix;return{nodes:t,images:r,cartographicOrigin:i,cartesianModelMatrix:n}}function Sge(e){var t;for(let r=0;r<e.length;r++){let i=e[r];i.mesh&&(e[r]=_t(ce({},i),{mesh:_t(ce({},i.mesh),{primitives:(t=i.mesh)==null?void 0:t.primitives.map(n=>{var a,o,s;return _t(ce({},n),{indices:{value:(a=n==null?void 0:n.indices)==null?void 0:a.value},attributes:llt(n.attributes),material:{id:(o=n==null?void 0:n.material)==null?void 0:o.id,uniqueId:(s=n==null?void 0:n.material)==null?void 0:s.uniqueId}})})})})),i.children&&Sge(i.children)}}var clt="EXT_mesh_features",flt="EXT_feature_metadata";function Age(e,t,r){let i=t==null?void 0:t.extensions;if(!i)return[];for(let[n,a]of Object.entries(i||{}))switch(n){case flt:return hlt(e,a,r);case clt:return console.warn("EXT_mesh_features extension is not supported yet"),[];default:return[]}return[]}function hlt(e,t,r){var o,s,u,l,c,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?void 0:s.attribute)return e[i.featureIds.attribute].value;if(((u=i==null?void 0:i.featureIds)==null?void 0:u.hasOwnProperty("constant"))&&((l=i==null?void 0:i.featureIds)==null?void 0:l.hasOwnProperty("divisor"))){let d=((c=e==null?void 0:e.POSITIONS)==null?void 0:c.value.length)/3||0;return dlt(d,i.featureIds.constant,i.featureIds.divisor)}let n=(t==null?void 0:t.featureIdTextures)&&(t==null?void 0:t.featureIdTextures[0]);if(n){let p=`TEXCOORD_${((h=(f=n==null?void 0:n.featureIds)==null?void 0:f.texture)==null?void 0:h.texCoord)||0}`,y=e[p].value;return plt(n,y,r)}return(t==null?void 0:t.featureTextures)&&(t==null?void 0:t.featureTextures[0])?(console.warn("EXT_feature_metadata doesn't yet support featureTextures in primitive"),[]):[]}function dlt(e,t=0,r=0){let i=[];if(r>0){let n=t,a=r;for(let o=0;o<e;o++)i.push(n),a-=1,a===0&&(n++,a=r)}else i=Array(e).fill(t,0,e);return i}function plt(e,t,r){var l,c,f;if(!(r==null?void 0:r.length))return[];let i={r:0,g:1,b:2,a:3},n=(c=(l=e==null?void 0:e.featureIds)==null?void 0:l.texture)==null?void 0:c.index,a=(f=e==null?void 0:e.featureIds)==null?void 0:f.channels;if(!a||n===void 0)return[];let o=r[n],s=[],u=i[a];if(o.compressed)console.warn(`Can't get batch Ids from ${o.mimeType} compressed texture`);else for(let h=0;h<t.length;h+=2){let d=t[h],p=t[h+1],y=Math.min(Tge(d)*o.width|0,o.width-1),b=(Math.min(Tge(p)*o.height|0,o.height-1)*o.width+y)*o.components+u,E=new Uint8Array(o.data)[b];s.push(E)}return s}function Tge(e){return(e%1+1)%1}function kge(e,t){let r={};for(let i in t){let n=t[i];r[i]=mlt(n,e)}return r}function mlt(e,t){let r=[];for(let i of t){let n=e[i]||null;r.push(n)}return r}function Rge(e,t){let r=!1;for(let i of Object.values(t))e.length!==i.length&&(r=!0);return r}var V_="string",hL="Int32",dL="double",Mk="OBJECTID";function Cge(e,t){return e===Mk?Mk:typeof t===V_?V_:typeof t=="number"?Number.isInteger(t)?hL:dL:V_}function Ige(e,t,r){let i={key:`f_${e}`,name:t,ordering:["attributeValues"],header:[{property:"count",valueType:"UInt32"}],attributeValues:{valueType:"Int32",valuesPerElement:1}};switch(r){case Mk:glt(i);break;case V_:Mge(i);break;case dL:vlt(i);break;case hL:break;default:Mge(i)}return i}function Oge(e){switch(e){case Mk:return"esriFieldTypeOID";case V_:return"esriFieldTypeString";case hL:return"esriFieldTypeInteger";case dL:return"esriFieldTypeDouble";default:return"esriFieldTypeString"}}function Pge(e,t){return{name:e,type:t,alias:e}}function Bge(e){let t="{OBJECTID}",r=[],i=[],n=[],a=[];for(let o in e)i.push({fieldName:o,visible:!0,isEditable:!1,label:o});return n.push({fieldInfos:i,type:"fields"}),{title:t,mediaInfos:r,popupElements:n,fieldInfos:i,expressionInfos:a}}function Mge(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 glt(e){e.attributeValues={valueType:"Oid32",valuesPerElement:1}}function vlt(e){e.attributeValues={valueType:"Float64",valuesPerElement:1}}var ylt=1,blt=1,Il=3,W_=2,_lt=4,xlt="string",wlt="Int32",Elt="Float64",Slt="Oid32",Fge=["CUSTOM_ATTRIBUTE_2","_BATCHID","BATCHID"],jge="EXT_feature_metadata",Lge="EXT_mesh_features",Wh=new Ds.Vector3;async function mL(e,t,r,i,n,a,o,s,u,l){var y;let c=o,f=await Nlt((y=e.gltf)==null?void 0:y.materials,s),h=Ege(e),d=await klt(h,f,c);o&&Alt(d,u);let p=[];for(let g of f){let b=g.mergedMaterials[0].originalMaterialId;if(!d.has(b))continue;let E=d.get(b);if(!E)continue;let{material:S,texture:k}=g,R=await t();p.push(await Tlt({convertedAttributes:E,material:S,texture:k,tileContent:e,nodeId:R,featuresHashArray:i,propertyTable:r,attributeStorageInfo:n,draco:a,workerSource:l}))}return p.length?p:null}function Alt(e,t){for(let r of e.values()){let i=xge(r.positions,t);r.boundingVolumes=i;let n=i.obb.center;for(let a=0;a<r.positions.length;a+=Il){let o=r.positions.subarray(a,a+Il);pL.Ellipsoid.WGS84.cartesianToCartographic(Array.from(o),Wh),Wh[2]=Wh[2]-t.getHeight(Wh[1],Wh[0]),Wh=Wh.subtract(n),r.positions.set(Wh,a)}}}async function Tlt({convertedAttributes:e,material:t,texture:r,tileContent:i,nodeId:n,featuresHashArray:a,propertyTable:o,attributeStorageInfo:s,draco:u,workerSource:l}){var B;let c=e.boundingVolumes,f=e.positions.length/Il,{faceRange:h,featureIds:d,positions:p,normals:y,colors:g,uvRegions:b,texCoords:E,featureCount:S}=bge(e);i.batchTableJson&&Xlt(d,e.featureIndices,a,i.batchTableJson);let k=new Uint32Array(2),R=act(d);k.set([f,S],0);let M=new Uint8Array(tl(k.buffer,p.buffer,y.buffer,r?E.buffer:new ArrayBuffer(0),g.buffer,b,R.buffer,h.buffer)),I=u?oct(f,e,{positions:p,normals:y,texCoords:r?E:new Float32Array(0),colors:g,uvRegions:b,featureIds:d,faceRange:h},l.draco):null,L=[];return s&&o&&(L=ect(d,o,s)),{nodeId:n,geometry:M,compressedGeometry:I,texture:r,hasUvRegions:Boolean(b.length),sharedResources:Vlt(((B=i.gltf)==null?void 0:B.materials)||[],n),meshMaterial:t,vertexCount:f,attributes:L,featureCount:S,boundingVolumes:c}}async function klt(e,t,r){let{nodes:i,images:n,cartographicOrigin:a,cartesianModelMatrix:o}=e,s=new Map;for(let u 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:u.mergedMaterials};for(let c of u.mergedMaterials)s.set(c.originalMaterialId,l)}Nge(i,n,a,o,s,r);for(let u of s.keys()){let l=s.get(u);if(!!l){if(l.positions.length===0){s.delete(u);continue}l.featureIndicesGroups&&(l.featureIndices=l.featureIndicesGroups.reduce((c,f)=>c.concat(f)),delete l.featureIndicesGroups)}}return s}function Nge(e,t,r,i,n,a,o=new Ds.Matrix4([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])){if(e)for(let s of e)Clt(s,t,r,i,n,a,o)}function Rlt(e,t){let r=t,{matrix:i,rotation:n,scale:a,translation:o}=e;return i&&(r=t.multiplyRight(i)),o&&(r=r.translate(o)),n&&(r=r.rotateXYZ(n)),a&&(r=r.scale(a)),r}function Clt(e,t,r,i,n,a,o=new Ds.Matrix4([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])){let s=Rlt(e,o),u=e.mesh;u&&Ilt(u,t,r,i,n,a,s),Nge(e.children||[],t,r,i,n,a,s)}function Ilt(e,t,r,i,n,a=!1,o=new Ds.Matrix4([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])){var s;for(let u of e.primitives){let l=null,c;u.material?(l=n.get(u.material.uniqueId),c=(s=l==null?void 0:l.mergedMaterials.find(({originalMaterialId:d})=>{var p;return d===((p=u.material)==null?void 0:p.uniqueId)}))==null?void 0:s.uvRegion):n.has("default")&&(l=n.get("default")),zt(l!==null,"Primitive - material mapping failed");let f=u.attributes;if(!l)continue;let h=Olt(u);l.positions=ha(l.positions,qge({vertices:f.POSITION.value,cartographicOrigin:r,cartesianModelMatrix:i,nodeMatrix:o,indices:h,attributeSpecificTransformation:Plt,useCartesianPositions:a})),l.normals=ha(l.normals,qge({vertices:f.NORMAL&&f.NORMAL.value,cartographicOrigin:r,cartesianModelMatrix:i,nodeMatrix:o,indices:h,attributeSpecificTransformation:Blt,useCartesianPositions:!1})),l.texCoords=ha(l.texCoords,Mlt(f.TEXCOORD_0&&f.TEXCOORD_0.value,h)),l.colors=ha(l.colors,Dlt(f.COLOR_0,h)),c&&(l.uvRegions=ha(l.uvRegions,Flt(c,h))),l.featureIndicesGroups=l.featureIndicesGroups||[],l.featureIndicesGroups.push(jlt(Llt(f,u,t),h))}}function Olt(e){var r;let t=(r=e.indices)==null?void 0:r.value;if(t&&e.mode===tr.TRIANGLE_STRIP){let i=t.constructor,n=new i((t.length-2)*3),a=0,o=t.slice(0,3);n.set(o,0);for(let s=1;s+2<t.length;s++)a+=3,o=t.slice(s,s+3),s%2==0?n.set(o,a):n.set(o.reverse(),a);t=n}return t}function qge(e){let{vertices:t,indices:r,attributeSpecificTransformation:i}=e,n=new Float32Array(r.length*Il);if(!t)return n;for(let a=0;a<r.length;a++){let o=r[a]*Il,s=t.subarray(o,o+Il),u=new Ds.Vector3(Array.from(s));u=i(u,e),n[a*Il]=u.x,n[a*Il+1]=u.y,n[a*Il+2]=u.z}return n}function Plt(e,t){let{cartesianModelMatrix:r,cartographicOrigin:i,nodeMatrix:n,useCartesianPositions:a}=t;return n&&(e=e.transform(n)),e=e.transform(r),a||(pL.Ellipsoid.WGS84.cartesianToCartographic([e[0],e[1],e[2]],e),e=e.subtract(i)),e}function Blt(e,t){let{cartesianModelMatrix:r,nodeMatrix:i}=t;return i&&(e=e.transformAsVector(i)),e=e.transformAsVector(r),e}function Mlt(e,t){let r=new Float32Array(t.length*W_);if(!e)return r.fill(1),r;for(let i=0;i<t.length;i++){let n=t[i]*W_,a=e.subarray(n,n+W_);r[i*W_]=a[0],r[i*W_+1]=a[1]}return r}function Dlt(e,t){let r=(e==null?void 0:e.components)||_lt,i=new Uint8Array(t.length*r);if(!e)return i.fill(255),i;let n=e.value;for(let a=0;a<t.length;a++){let o=t[a]*r,s=n.subarray(o,o+r),u=new Uint8Array(r);for(let l=0;l<s.length;l++)u[l]=s[l]*255;i.set(u,a*r)}return i}function Flt(e,t){let r=new Uint16Array(t.length*4);for(let i=0;i<r.length;i+=4)r.set(e,i);return r}function jlt(e,t){if(!e.length||!t.length)return[];let r=[];for(let i=0;i<t.length;i++){let n=t[i];r.push(e[n])}return r}function Llt(e,t,r){let i=Age(e,t,r);if(i.length)return i;for(let n=0;n<Fge.length;n++){let a=Fge[n];if(e[a]&&e[a].value)return e[a].value}return[]}async function Nlt(e=[],t){let r=[];for(let i of e)r.push(Glt(i));return t&&(r=await qlt(r)),r}async function qlt(e){var r,i;let t=[];for(;e.length>0;){let n=e.splice(0,1)[0],a=[];for(let o=0;o<e.length;o++){let s=e[o];(n.texture&&s.texture||!n.texture&&!s.texture)&&(n=await Ult(n,s),a.push(o))}if(n.texture&&a.length){let o=(r=n.mergedMaterials)==null?void 0:r.reduce((l,{textureSize:c})=>l+((c==null?void 0:c.width)||0),0),s=(i=n.mergedMaterials)==null?void 0:i.reduce((l,{textureSize:c})=>Math.max(l,(c==null?void 0:c.height)||0),0),u=-1;for(let l of n.mergedMaterials)if(l.textureSize){let c=u+1+l.textureSize.width/o*2**(Uint16Array.BYTES_PER_ELEMENT*8)-1;l.uvRegion=new Uint16Array([u+1,0,c,l.textureSize.height/s*2**(Uint16Array.BYTES_PER_ELEMENT*8)-1]),u=c}n.texture.image.width=o,n.texture.image.height=s}for(let o of a.reverse())e.splice(o,1);t.push(n)}return t.length||t.push({material:Hlt(),mergedMaterials:[{originalMaterialId:"default"}]}),t}async function Ult(e,t){var r,i;if(((r=e.texture)==null?void 0:r.bufferView)&&((i=t.texture)==null?void 0:i.bufferView)&&e.mergedMaterials&&t.mergedMaterials){let n=Buffer.from(e.texture.bufferView.data),a=Buffer.from(t.texture.bufferView.data);try{let{joinImages:o}=await import("join-images"),s=await o([n,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 Glt(e){var a,o,s,u,l;let t={doubleSided:e.doubleSided,emissiveFactor:(a=e.emissiveFactor)==null?void 0:a.map(c=>Math.round(c*255)),alphaMode:zlt(e.alphaMode),pbrMetallicRoughness:{roughnessFactor:((o=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:o.roughnessFactor)||ylt,metallicFactor:((s=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:s.metallicFactor)||blt}},r;((u=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:u.baseColorTexture)?(r=e.pbrMetallicRoughness.baseColorTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}):e.emissiveTexture&&(r=e.emissiveTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0});let i=Rc();e.uniqueId=i;let n=[{originalMaterialId:i}];if(r)n[0].textureSize={width:r.image.width,height:r.image.height};else{let c=(l=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:l.baseColorFactor;t.pbrMetallicRoughness.baseColorFactor=c&&c.map(f=>Math.round(f*255))||void 0}return{material:t,texture:r,mergedMaterials:n}}function zlt(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend";default:return"opaque"}}function Hlt(){return{alphaMode:"opaque",pbrMetallicRoughness:{metallicFactor:1,roughnessFactor:1}}}function Vlt(e,t){let r={};if(!e||!e.length)return r;r.materialDefinitionInfos=[];for(let i of e){let{materialDefinitionInfo:n,textureDefinitionInfo:a}=Wlt(i,t);r.materialDefinitionInfos.push(n),a&&(r.textureDefinitionInfos=r.textureDefinitionInfos||[],r.textureDefinitionInfos.push(a))}return r}function Wlt(e,t){var s;let r=((s=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:s.baseColorTexture)||e.emissiveTexture,i=null;r&&(i=Ylt(r.texture,t));let{baseColorFactor:n,metallicFactor:a}=(e==null?void 0:e.pbrMetallicRoughness)||{},o=n;return(!n||n[3]===0)&&e.emissiveFactor&&(o=e.emissiveFactor,o[3]=o[3]||1),{materialDefinitionInfo:Klt(o||[1,1,1,1],a),textureDefinitionInfo:i}}function Klt(e,t=1){let r=.04/255,i=new Ds.Vector4(0,0,0,1),n=new Ds.Vector4(1,1,1,1),a=new Ds.Vector4(r,r,r,0),o=new Ds.Vector4(e),s=n.subtract(a).multiply(o),u=s.lerp(s,i,t);a[3]=1;let l=a.lerp(a,o,t);return{params:{diffuse:u.toArray(),specular:l.toArray(),renderMode:"solid"}}}function Ylt(e,t){var r,i,n;return{encoding:((r=e==null?void 0:e.source)==null?void 0:r.mimeType)?[e.source.mimeType]:void 0,images:[{id:$lt(e,t),size:(i=e.source)==null?void 0:i.image.width,length:[(n=e.source)==null?void 0:n.image.data.length]}]}}function $lt(e,t){var y;let{width:r,height:i}=(y=e.source)==null?void 0:y.image,n=1,a=0,o=t+1,s=32-o.toString(2).length,u="0".repeat(s).concat(o.toString(2)),l=n<<28,c=a<<24,f=r-1<<12,h=i-1<<0,d=l+c+f+h;return BigInt(`0b${d.toString(2)}${u}`).toString()}function Xlt(e,t,r,i){let n=Jlt(e,i,r);Uge(t,n),Uge(e,n)}function Jlt(e,t,r){let i={};for(let n=0;n<e.length;n++){let a=e[n],o=Zlt(n,t,r);i[a.toString()]=o}return i}function Qlt(e,t){let r="";for(let i in e)r+=e[i][t];return r}function Zlt(e,t,r){let i=Qlt(t,e),n=(0,Dge.default)(i);return r.includes(n)?r.indexOf(n):r.push(n)-1}function Uge(e,t){for(let r=0;r<e.length;r++)e[r]=t[e[r]]}function ect(e,t,r){let i=[],a=Rge(e,t)?kge(e,t):t,o=ce({OBJECTID:e},a);for(let s in o){let u=rct(s,r),l=o[s],c=tct(u,l);i.push(c)}return i}function tct(e,t){let r;switch(e){case Slt:case wlt:r=ict(t);break;case Elt:r=nct(t);break;case xlt:r=Gge(t);break;default:r=Gge(t)}return r}function rct(e,t){return t.find(i=>i.name===e).attributeValues.valueType}function ict(e){let t=new Uint32Array([e.length]),r=new Uint32Array(e);return tl(t.buffer,r.buffer)}function nct(e){let t=new Uint32Array([e.length]),r=new Uint8Array(4),i=new Float64Array(e);return tl(t.buffer,r.buffer,i.buffer)}function Gge(e){let t=new Uint32Array([e.length]),r=0,i=new Uint32Array(e.length),n=[];for(let o=0;o<e.length;o++){let s=`${String(e[o])}\0`,u=Buffer.from(s),l=u.length;r+=l,i[o]=l,n.push(u)}let a=new Uint32Array([r]);return tl(t.buffer,a.buffer,i.buffer,...n)}function act(e){let t=new BigUint64Array(e.length);for(let r=0;r<e.length;r++)t[r]=BigInt(e[r]);return t}async function oct(e,t,r,i){let{positions:n,normals:a,texCoords:o,colors:s,uvRegions:u,featureIds:l,faceRange:c}=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),d=sct(h,c),p={positions:n,normals:a,colors:s,"feature-index":d};o.length&&(p.texCoords=o);let y={"feature-index":{"i3s-attribute-type":"feature-index","i3s-feature-ids":new Int32Array(l)}};return u.length&&(p["uv-region"]=u,y["uv-region"]={"i3s-attribute-type":"uv-region"}),Qm({attributes:p,indices:f},Bb,_t(ce({},Bb.options),{source:i,reuseWorkers:!0,_nodeWorkers:!0,draco:{method:"MESH_SEQUENTIAL_ENCODING",attributesMetadata:y}}))}function sct(e,t){let r=new Uint32Array(e.length),i=0,n=0;for(let a=1;a<t.length;a+=2){let o=(t[a]+1)*Il;r.fill(i,n,o),i++,n=o+1}return r}function zge(e){let t=e==null?void 0:e.batchTableJson;if(t)return t;let{extensionName:r,extension:i}=uct(e);switch(r){case Lge:return console.warn("The I3S converter does not yet support the EXT_mesh_features extension"),null;case jge:return lct(i);default:return null}}function uct(e){var a,o,s,u;let t=[jge,Lge];if(!((a=e==null?void 0:e.gltf)==null?void 0:a.extensionsUsed))return{extensionName:null,extension:null};let i="";for(let l of((o=e==null?void 0:e.gltf)==null?void 0:o.extensionsUsed)||[])if(t.includes(l)){i=l;break}let n=(u=(s=e==null?void 0:e.gltf)==null?void 0:s.extensions)==null?void 0:u[i];return{extensionName:i,extension:n}}function lct(e){var t;if(e==null?void 0:e.featureTextures)return console.warn("The I3S converter does not yet support the EXT_feature_metadata feature textures"),null;if(e==null?void 0:e.featureTables){let r=(t=Object.keys(e.featureTables))==null?void 0:t[0];if(r){let i=e==null?void 0:e.featureTables[r],n={};for(let a in i.properties)n[a]=i.properties[a].data;return n}}return console.warn("The I3S converter couldn't handle EXT_feature_metadata extension"),null}var Vge=Le(vu()),Wge=Le(require("path"));var Hge=()=>({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 Kge(e,t,r){let i={serviceItemId:Rc().replace(/-/gi,""),layerName:e,layers0:t},n=(0,Vge.default)(i,Hge()),a=(0,Wge.join)(r,"SceneServer");await Hn(a,JSON.stringify(n))}var gL=16;function Yge(e,t){let r=[],i=e.boundingVolume,n=e.lodMetricValue||.1,a={metricType:"maxScreenThreshold",maxError:t.mbs[3]*2*gL/n},o={metricType:"maxScreenThresholdSQ",maxError:Math.PI*.25*a.maxError*a.maxError};return i.constructor.name==="OrientedBoundingBox"?(r.push(o),r.push(a)):(r.push(a),r.push(o)),r}function vL(e){let r=(e.header.lodSelection.maxScreenThreshold||{}).maxError;if(!r){let i=e.header.lodSelection.maxScreenThresholdSQ;i&&(r=Math.sqrt(i.maxError/(Math.PI*.25)))}return r||(r=gL),e.header.mbs[3]*2*gL/r}var s0e=Le(o0e()),Bct="3.4.2",Lk={name:"PGM - Netpbm grayscale image format",id:"pgm",module:"tile-converter",version:Bct,mimeTypes:["image/x-portable-graymap"],parse:async(e,t)=>(0,s0e.parsePGM)(new Uint8Array(e),t),extensions:["pgm"],options:{cubic:!1}};var J0=Le(vu());var u0e={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 Mct=()=>({wkid:{path:"wkid",default:4326},latestWkid:{path:"latestWkid",default:4326},vcsWkid:{path:"vcsWkid",default:5773},latestVcsWkid:{path:"latestVcsWkid",default:5773}}),Dct=()=>({heightModel:{path:"heightModel",default:"gravity_related_height"},vertCRS:{path:"vertCRS",default:"EGM96_Geoid"},heightUnit:{path:"heightUnit",default:"meter"}}),Fct=()=>({nodesPerPage:{path:"nodesPerPage"},lodSelectionMetricType:{path:"lodSelectionMetricType",default:"maxScreenThresholdSQ"}}),jct=()=>({xmin:{path:"xmin"},ymin:{path:"ymin"},xmax:{path:"xmax"},ymax:{path:"ymax"},zmin:{path:"zmin"},zmax:{path:"zmax"}}),l0e=()=>({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,J0.default)(e,Mct())},capabilities:{path:"capabilities",default:["View","Query"]},store:{path:"store",transform:e=>(0,J0.default)(e,u0e)},fullExtent:{path:"fullExtent",transform:e=>(0,J0.default)(e,jct())},heightModelInfo:{path:"heightModelInfo",transform:e=>(0,J0.default)(e,Dct())},nodePages:{path:"nodePages",transform:e=>(0,J0.default)(e,Fct())},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 wL=Le(vu()),Lct=()=>({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}}}),Nct=()=>({"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}}}),c0e=()=>({geometryBuffers:{path:"geometryConfig",transform:e=>{let t=[(0,wL.default)(e,Lct())];return e.draco&&t.push((0,wL.default)({geometryConfig:e},Nct())),t}}});var K_=Le(vu()),qct=()=>({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}}),Uct=()=>({name:{path:"name",default:"standard"},type:{path:"type",default:"standard"},params:{path:"params",transform:(e,t,r)=>(0,K_.default)(r,qct())}}),Gct=()=>({id:{path:"id"},size:{path:"size"},href:{path:"href",default:["../textures/0"]},length:{path:"length"}}),zct=()=>({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(i=>(0,K_.default)(i,Gct()))}}),f0e=()=>({materialDefinitions:{path:"materialDefinitionInfos",transform:Hct},textureDefinitions:{path:"textureDefinitionInfos",transform:Vct}});function Hct(e,t,r){let i={};for(let[n,a]of e.entries())i[`Mat${r.nodePath}${n}`]=(0,K_.default)(a,Uct());return i}function Vct(e,t,r){if(!e)return null;let i={};for(let[n,a]of e.entries()){let o=`${r.nodePath}${n}`;a.imageIndex=o,i[o]=(0,K_.default)(a,zct())}return i}var Nk=Le(cl()),h0e=Le(Tr()),EL=Le(Ya()),Wct=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 d0e(e){var r,i;if(!((r=e==null?void 0:e.parentNode)==null?void 0:r.obb)||!((i=e==null?void 0:e.parentNode)==null?void 0:i.mbs))return[];let t=[];return Kct(t,e),Yct(t,e),t}function Kct(e,t){var o;let r=$ct(t.parentNode.obb),i=Xct(t);if(Jct(r,i))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 Yct(e,t){var a;let r=p0e(t.mbs),i=p0e(t.parentNode.mbs);if(r.center.distanceTo(i.center)+r.radius>i.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 p0e(e){return new Nk.BoundingSphere([e[0],e[1],e[2]],e[3])}function $ct(e){let{center:t,halfSize:r,quaternion:i}=e;return new Nk.OrientedBoundingBox().fromCenterHalfSizeQuaternion(t,r,i)}function Xct(e){let t=e.obb.halfSize,r=Wct,i=EL.Ellipsoid.WGS84.cartographicToCartesian(e.obb.center),n=[];for(let a=0;a<r.length;a+=3){let s=new h0e.Vector3(r[a]*=t[0],r[a+1]*=t[1],r[a+2]*=t[2]).transformByQuaternion(e.obb.quaternion).add(i);n=n.concat(s)}return n}function Jct(e,t){let r=!0;for(let i=0;i<t.length/3;i+=3){let n=[t[i],t[i+1],t[i+2]],a=EL.Ellipsoid.WGS84.cartesianToCartographic(n);if(e.distanceTo(a)>0){r=!1;break}}return r}var SL=class extends Array{enqueue(t){this.push(t)}dequeue(){return this.shift()}peek(){return this[0]}isEmpty(){return this.length===0}};var m0e=Le(require("process")),Qct=4*1024*1024*1024,Y_=class extends SL{constructor(t=2e3,r=400){super();this.writePromise=null;this.fileMap={};this.listeningInterval=t,this.writeConcurrency=r}async enqueue(t,r=!1){if(r){let{archiveKey:i,writePromise:n}=t,a=await n();i&&a&&(this.fileMap[i]=a)}else super.enqueue(t),m0e.default.memoryUsage().rss>Qct&&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 n=0;n<this.writeConcurrency;n++){let a=this.dequeue();if(!a)break;let{archiveKey:o,writePromise:s}=a;r.push(o);let u=s();t.push(u)}let i=await Promise.allSettled(t);this.updateFileMap(r,i)}}updateFileMap(t,r){for(let i=0;i<t.length;i++){let n=t[i];n&&"value"in r[i]&&(this.fileMap[n]=r[i].value)}}};var Zct="3.4.2",g0e={id:"i3s-attributes",name:"I3S Attributes Worker",module:"tile-converter",version:Zct,options:{useCartesianPositions:!1}};var Q0="Tile converter does not work in browser, only in node js environment";var TL=Le(require("path")),kL=Le(vu());var v0e=Le(vu()),y0e=()=>({mbs:{path:"mbs"},obb:{path:"obb"}}),eft=()=>({href:{path:"href"}}),tft=()=>ce(ce({id:{path:"id"}},eft()),y0e()),AL=()=>_t(ce({version:{path:"version"},id:{path:"id"},path:{path:"path"},level:{path:"level"}},y0e()),{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,v0e.default)(e,tft()),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 Ol=class{constructor(t,r){this.data=null;this.children=[];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 n of t){let a=await n.load();r.push({id:n.id,href:`../${n.id}`,obb:a.obb,mbs:a.mbs})}this.children=this.children.concat(t);let i=this.data;this.converter.options.instantNodeWriting&&(i=await this.load()),i&&(i.children=i.children??[],i.children=i.children.concat(r)),this.converter.options.instantNodeWriting&&i&&await this.write(i)}async addNeighbors(){var r;let t=await this.load();for(let i of this.children){let n=await i.load();if(n.neighbors=n.neighbors??[],Number((r=t==null?void 0:t.children)==null?void 0:r.length)<1e3)for(let a of t.children||[])i.id!==a.id&&n.neighbors.push(ce({},a));else console.warn(`Node ${i.id}: neighbors attribute is omited because of large number of neigbors`),delete n.neighbors;this.converter.options.instantNodeWriting&&n&&await i.write(n),await i.save(),i.flush()}}async save(){this.data&&await this.write(this.data)}async write(t){let r=(0,TL.join)(this.converter.layers0Path,"nodes",this.id);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodes/${this.id}/3dNodeIndexDocument.json.gz`,writePromise:()=>Cl(r,JSON.stringify(t),"3dNodeIndexDocument.json",!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>Hn(r,JSON.stringify(t))},!0)}async load(){if(this.data)return this.data;let t=this.id,r=(0,TL.join)(this.converter.layers0Path,"nodes",t),i="index.json";return this.converter.options.slpk&&(i="3dNodeIndexDocument.json"),await Ik(r,i)}flush(){this.data=null}static async createRootNode(t,r){let i=Ol.createRootNodeIndexDocument(t);return await new Ol(0,r).addData(i)}static async createNode(t,r,i,n,a,o){let s=await Ol.createNodeIndexDocument(t,r,i,n,a);return await new Ol(n.index,o).addData(s)}static createRootNodeIndexDocument(t){let r=_t(ce({version:`{${Rc().toUpperCase()}}`,id:"root",level:0,lodSelection:[{metricType:"maxScreenThresholdSQ",maxError:0},{metricType:"maxScreenThreshold",maxError:0}]},t),{children:[]});return(0,kL.default)(r,AL())}static async createNodeIndexDocument(t,r,i,n,a){var h,d;let{texture:o,attributes:s}=a,u=n.index,l=await t.load(),c=_t(ce({version:l.version,id:u.toString(),level:l.level+1},r),{lodSelection:i,parentNode:{id:t.id,href:`../${t.id}`,mbs:l.mbs,obb:l.obb},children:[],neighbors:[]}),f=(0,kL.default)(c,AL());if(n.mesh&&(f.geometryData=[{href:"./geometries/0"}],f.sharedResource={href:"./shared"},o&&(f.textureData=[{href:"./textures/0"},{href:"./textures/1"}]),s&&s.length&&((d=(h=t.converter.layers0)==null?void 0:h.attributeStorageInfo)==null?void 0:d.length))){f.attributeData=[];for(let p=0;p<s.length;p++){let y=t.converter.layers0.attributeStorageInfo[p].key;f.attributeData.push({href:`./attributes/${y}/0`})}}return f}};var _0e,rft=((_0e=jp.default.env)==null?void 0:_0e.IonToken)||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlYWMxMzcyYy0zZjJkLTQwODctODNlNi01MDRkZmMzMjIxOWIiLCJpZCI6OTYyMCwic2NvcGVzIjpbImFzbCIsImFzciIsImdjIl0sImlhdCI6MTU2Mjg2NjI3M30.1FNiClUyk00YH_nWfSGpiQAjR5V2OvREDq1PJ5QMjWQ",b0e=64,ift="3DTILES",nft="3DObject",aft=1800,oft="https://",$_=class{constructor(){this.boundingVolumeWarnings=[];this.conversionStartTime=[0,0];this.refreshTokenTime=[0,0];this.sourceTileset=null;this.geoidHeightModel=null;this.Loader=Tc;this.workerSource={};this.writeQueue=new Y_;this.compressList=null;this.nodePages=new wo(Hn,b0e,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){var g,b;if(ji)return console.log(Q0),Q0;this.conversionStartTime=jp.default.hrtime();let{tilesetName:r,slpk:i,egmFilePath:n,inputUrl:a,validate:o,outputPath:s,draco:u=!0,sevenZipExe:l,maxDepth:c,token:f,generateTextures:h,generateBoundingVolumes:d,instantNodeWriting:p=!1,mergeMaterials:y=!0}=t;this.options={maxDepth:c,slpk:i,sevenZipExe:l,egmFilePath:n,draco:u,token:f,inputUrl:a,instantNodeWriting:p,mergeMaterials:y},this.compressList=this.options.instantNodeWriting&&[]||null,this.validate=Boolean(o),this.Loader=a.indexOf(oft)!==-1?k2:Tc,this.generateTextures=Boolean(h),this.generateBoundingVolumes=Boolean(d),this.writeQueue=new Y_,this.writeQueue.startListening(),console.log("Loading egm file..."),this.geoidHeightModel=await ci(n,Lk),console.log("Loading egm file completed!"),i&&this.nodePages.useWriteFunction(Cl),await this.loadWorkers();try{let E=await this._fetchPreloadOptions(),S={loadOptions:{_nodeWorkers:!0,reuseWorkers:!0,basis:{format:"rgba32"},"basis-nodejs":{format:"rgba32",workerUrl:"./modules/textures/dist/basis-nodejs-worker.js"},"draco-nodejs":{workerUrl:"./modules/draco/dist/draco-nodejs-worker.js"}}};E.headers&&(S.loadOptions.fetch={headers:E.headers}),Object.assign(S,E);let k=await ci(a,this.Loader,S.loadOptions);return this.sourceTileset=new xg(k,S),await this._createAndSaveTileset(s,r,(b=(g=k==null?void 0:k.root)==null?void 0:g.boundingVolume)==null?void 0:b.region),await this._finishConversion({slpk:Boolean(i),outputPath:s,tilesetName:r}),k}catch(E){throw E}finally{En.getWorkerFarm({}).destroy()}}async _createAndSaveTileset(t,r,i){let n=(0,Na.join)(`${t}`,`${r}`);try{await G_(n)}catch{}this.layers0Path=(0,Na.join)(n,"SceneServer","layers","0"),this._formLayers0(r,i),this.materialDefinitions=[],this.materialMap=new Map;let a=this.sourceTileset.root,o=cL(a,this.geoidHeightModel);await this.nodePages.push({index:0,lodThreshold:0,obb:o.obb,children:[]});let s=await Ol.createRootNode(o,this);await this._convertNodesTree(s,a),this.layers0.materialDefinitions=this.materialDefinitions,this.layers0.geometryDefinitions=(0,qk.default)(this.geometryConfigs.map(u=>({geometryConfig:_t(ce({},u),{draco:this.options.draco})})),c0e()),this.layersHasTexture===!1&&(this.layers0.store.defaultGeometrySchema.ordering=this.layers0.store.defaultGeometrySchema.ordering.filter(u=>u!=="uv0")),await this._writeLayers0(),Kge(r,this.layers0,n);for(let u of this.compressList||[])await Ck(u),await lL(u);await this.nodePages.save(),await this.writeQueue.finalize(),await this._createSlpk(n)}_formLayers0(t,r){var o,s,u;let i=wge(((o=this.sourceTileset)==null?void 0:o.boundingVolume)||((u=(s=this.sourceTileset)==null?void 0:s.root)==null?void 0:u.boundingVolume));r&&(i.zmin=r[4],i.zmax=r[5]);let n=[i.xmin,i.ymin,i.xmax,i.ymax],a={version:`{${Rc().toUpperCase()}}`,id:0,name:t,href:"./layers/0",store:{id:`{${Rc().toUpperCase()}}`,extent:n},nodePages:{nodesPerPage:b0e},compressGeometry:this.options.draco,fullExtent:i};this.layers0=(0,qk.default)(a,l0e())}async _convertNodesTree(t,r){if(await this.sourceTileset._loadTile(r),this.isContentSupported(r)){let i=await this._createNode(t,r,0);for(let n of i)await n.save();await t.addChildren(i)}else await this._addChildrenWithNeighborsAndWriteFile({parentNode:t,sourceTiles:r.children,level:1});await r.unloadContent(),await t.save()}async _writeLayers0(){this.options.slpk?await this.writeQueue.enqueue({archiveKey:"3dSceneLayer.json.gz",writePromise:()=>Cl(this.layers0Path,JSON.stringify(this.layers0),"3dSceneLayer.json")}):await this.writeQueue.enqueue({writePromise:()=>Hn(this.layers0Path,JSON.stringify(this.layers0))})}async _createSlpk(t){if(this.options.slpk){let r=(0,Na.join)(t,"SceneServer","layers","0"),i=`${t}.slpk`;await mge(r,i,0,".",this.options.sevenZipExe);try{await G_(t)}catch{}}}async _addChildrenWithNeighborsAndWriteFile(t){await this._addChildren(t),await t.parentNode.addNeighbors()}async convertNestedTileset({parentNode:t,sourceTile:r,level:i}){await this.sourceTileset._loadTile(r),await this._addChildren({parentNode:t,sourceTiles:r.children,level:i+1}),await r.unloadContent()}async convertNode({parentNode:t,sourceTile:r,level:i}){let n=await this._createNode(t,r,i);await t.addChildren(n)}async _addChildren(t){let{sourceTiles:r,parentNode:i,level:n}=t;if(!(this.options.maxDepth&&n>this.options.maxDepth))for(let a of r)a.type==="json"?await this.convertNestedTileset({parentNode:i,sourceTile:a,level:n}):await this.convertNode({parentNode:i,sourceTile:a,level:n}),a.id&&console.log(a.id)}async _createNode(t,r,i){var f,h;this._checkAddRefinementTypeForTile(r),await this._updateTilesetOptions(),await this.sourceTileset._loadTile(r);let n=cL(r,this.geoidHeightModel),a=zge(r.content);a&&!((h=(f=this.layers0)==null?void 0:f.attributeStorageInfo)==null?void 0:h.length)&&this._convertPropertyTableToNodeAttributes(a);let o=await this._convertResources(r,t.inPageId,a),s=[],u=[],l=[],c={geometry:null,compressedGeometry:null,texture:null,hasUvRegions:!1,sharedResources:null,meshMaterial:null,vertexCount:null,attributes:null,featureCount:null,boundingVolumes:null};for(let d of o||[c]){this.layersHasTexture=this.layersHasTexture||Boolean(d.texture),this.generateBoundingVolumes&&d.boundingVolumes&&(n=d.boundingVolumes);let p=Yge(r,n),y=p.find(S=>S.metricType==="maxScreenThresholdSQ")||{maxError:0},g=await this._updateNodeInNodePages(y,n,r,t.inPageId,d),b=await Ol.createNodeIndexDocument(t,n,p,g,d),E=await new Ol(g.index,this).addData(b);s.push(E),g.mesh&&await this._writeResources(d,E.id),this.validate&&(this.boundingVolumeWarnings=d0e(b),this.boundingVolumeWarnings&&this.boundingVolumeWarnings.length&&console.warn("Bounding Volume Warnings: ",...this.boundingVolumeWarnings)),u.push(g.index),l.push(g)}return r.unloadContent(),await this._addChildrenWithNeighborsAndWriteFile({parentNode:s[0],sourceTiles:r.children,level:i+1}),s}async _convertResources(t,r,i){var o;if(!this.isContentSupported(t))return null;let n={center:[],halfSize:[],quaternion:[]};return await mL(t.content,async()=>(await this.nodePages.push({index:0,obb:n},r)).index,i,this.featuresHashArray,(o=this.layers0)==null?void 0:o.attributeStorageInfo,this.options.draco,this.generateBoundingVolumes,this.options.mergeMaterials,this.geoidHeightModel,this.workerSource)}async _updateNodeInNodePages(t,r,i,n,a){let{meshMaterial:o,texture:s,vertexCount:u,featureCount:l,geometry:c,hasUvRegions:f}=a,h={index:0,lodThreshold:t.maxError,obb:r.obb,children:[]};c&&this.isContentSupported(i)&&(h.mesh={geometry:{definition:this.findOrCreateGeometryDefinition(Boolean(s),f),resource:0},attribute:{resource:0},material:{definition:0}});let d=a.nodeId,p;if(d?p=await this.nodePages.getNodeById(d):p=await this.nodePages.push(h,n),wo.updateAll(p,h),o&&wo.updateMaterialByNodeId(p,this._findOrCreateMaterial(o)),s){let y=s.image.height*s.image.width;wo.updateTexelCountHintByNodeId(p,y)}return u&&(this.vertexCounter+=u,wo.updateVertexCountByNodeId(p,u)),wo.updateNodeAttributeByNodeId(p),l&&wo.updateFeatureCountByNodeId(p,l),this.nodePages.saveNode(p),p}async _writeResources(t,r){let{geometry:i,compressedGeometry:n,texture:a,sharedResources:o,attributes:s}=t,u=(0,Na.join)(this.layers0Path,"nodes",r),l=(0,Na.join)("nodes",r);await this._writeGeometries(i,n,u,l),await this._writeShared(o,u,l,r),await this._writeTexture(a,u,l),await this._writeAttributes(s,u,l)}async _writeGeometries(t,r,i,n){if(this.options.slpk){let a=(0,Na.join)(i,"geometries");await this.writeQueue.enqueue({archiveKey:`${n}/geometries/0.bin.gz`,writePromise:()=>Cl(a,t,"0.bin")})}else{let a=(0,Na.join)(i,"geometries/0/");await this.writeQueue.enqueue({writePromise:()=>Hn(a,t,"index.bin")})}if(this.options.draco)if(this.options.slpk){let a=(0,Na.join)(i,"geometries");await this.writeQueue.enqueue({archiveKey:`${n}/geometries/1.bin.gz`,writePromise:()=>Cl(a,r,"1.bin")})}else{let a=(0,Na.join)(i,"geometries/1/");await this.writeQueue.enqueue({writePromise:()=>Hn(a,r,"index.bin")})}}async _writeShared(t,r,i,n){if(!t)return;t.nodePath=n;let a=(0,qk.default)(t,f0e()),o=JSON.stringify(a);if(this.options.slpk){let s=(0,Na.join)(r,"shared");await this.writeQueue.enqueue({archiveKey:`${i}/shared/sharedResource.json.gz`,writePromise:()=>Cl(s,o,"sharedResource.json")})}else{let s=(0,Na.join)(r,"shared/");await this.writeQueue.enqueue({writePromise:()=>Hn(s,o)})}}async _writeTexture(t,r,i){if(t){let n=this._getFormatByMimeType(t==null?void 0:t.mimeType),a=[],o=t.bufferView.data;switch(n){case"jpg":case"png":{if(a.push({name:"0",format:n}),await this.writeTextureFile(o,"0",n,r,i),this.generateTextures){a.push({name:"1",format:"ktx2"});let s=t.image.data.subarray(),u=new Uint8Array(s),l=Qm(_t(ce({},t.image),{data:u}),p2,_t(ce({},p2.options),{source:this.workerSource.ktx2,reuseWorkers:!0,_nodeWorkers:!0}));await this.writeTextureFile(l,"1","ktx2",r,i)}break}case"ktx2":if(a.push({name:"1",format:n}),await this.writeTextureFile(o,"1",n,r,i),this.generateTextures){a.push({name:"0",format:"jpg"});let s=Qm(t.image.data[0],k8);await this.writeTextureFile(s,"0","jpg",r,i)}}this.layers0.textureSetDefinitions.length||(this.layers0.textureSetDefinitions.push({formats:a}),this.layers0.textureSetDefinitions.push({formats:a,atlas:!0}))}}async writeTextureFile(t,r,i,n,a){if(this.options.slpk){let o=(0,Na.join)(n,"textures"),s=!1;await this.writeQueue.enqueue({archiveKey:`${a}/textures/${r}.${i}`,writePromise:()=>Cl(o,t,`${r}.${i}`,s)})}else{let o=(0,Na.join)(n,`textures/${r}/`);await this.writeQueue.enqueue({writePromise:()=>Hn(o,t,`index.${i}`)})}}async _writeAttributes(t=[],r,i){var n,a;if((t==null?void 0:t.length)&&((a=(n=this.layers0)==null?void 0:n.attributeStorageInfo)==null?void 0:a.length))for(let o=0;o<t.length;o++){let s=this.layers0.attributeStorageInfo[o].key,u=new Uint8Array(t[o]);if(this.options.slpk){let l=(0,Na.join)(r,"attributes",s);await this.writeQueue.enqueue({archiveKey:`${i}/attributes/${s}.bin.gz`,writePromise:()=>Cl(l,u,"0.bin")})}else{let l=(0,Na.join)(r,`attributes/${s}/0`);await this.writeQueue.enqueue({writePromise:()=>Hn(l,u,"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,RL.default)(JSON.stringify(t));if(this.materialMap.has(r))return this.materialMap.get(r)||0;let i=this.materialDefinitions.push(t)-1;return this.materialMap.set(r,i),i}findOrCreateGeometryDefinition(t,r){let i={hasTexture:t,hasUvRegions:r},n=(0,RL.default)(JSON.stringify(i));if(this.geometryMap.has(n))return this.geometryMap.get(n)||0;let a=this.geometryConfigs.push(i)-1;return this.geometryMap.set(n,a),a}_convertPropertyTableToNodeAttributes(t){let r=0,i=ce({OBJECTID:[0]},t);for(let n in i){let a=i[n][0],o=Cge(n,a),s=Ige(r,n,o),u=Oge(o),l=Pge(n,u),c=Bge(i);this.layers0.attributeStorageInfo.push(s),this.layers0.fields.push(l),this.layers0.popupInfo=c,this.layers0.layerType=nft,r+=1}}async _finishConversion(t){let{tilesCount:r,tilesWithAddRefineCount:i}=this.refinementCounter,n=i?i/r*100:0,a=await Bk(t),o=jp.default.hrtime(this.conversionStartTime),s=Pk(o);console.log("------------------------------------------------"),console.log(`Finishing conversion of ${ift}`),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:',n,"%"),console.log("------------------------------------------------")}async _fetchPreloadOptions(){if(!this.Loader.preload)return{};let t={"cesium-ion":{accessToken:this.options.token||rft}},r=await this.Loader.preload(this.options.inputUrl,t);return this.refreshTokenTime=jp.default.hrtime(),ce(ce({},t),r)}async _updateTilesetOptions(){if(jp.default.hrtime(this.refreshTokenTime)[0]<aft)return;this.refreshTokenTime=jp.default.hrtime();let r=await this._fetchPreloadOptions();this.sourceTileset.options=ce(ce({},this.sourceTileset.options),r),r.headers&&(this.sourceTileset.loadOptions.fetch=_t(ce({},this.sourceTileset.loadOptions.fetch),{headers:r.headers}),console.log("Authorization Bearer token has been updated"))}_checkAddRefinementTypeForTile(t){let r=1;t.refine===r&&(this.refinementCounter.tilesWithAddRefineCount+=1,console.warn('This tile uses "ADD" type of refinement')),this.refinementCounter.tilesCount+=1}isContentSupported(t){var r;return["b3dm","glTF"].includes((r=t==null?void 0:t.content)==null?void 0:r.type)}async loadWorkers(){if(console.log("Loading workers source..."),this.options.draco){let n=nu(Bb,ce({},Po())),o=await(await na(n)).text();this.workerSource.draco=o}if(this.generateTextures){let n=nu(p2,ce({},Po())),o=await(await na(n)).text();this.workerSource.ktx2=o}let t=nu(g0e,ce({},Po())),i=await(await na(t)).text();this.workerSource.I3SAttributes=i,console.log("Loading workers source completed!")}};var $0e=Le(require("path")),ML=Le(require("process")),X0e=Le(vu());var $h=Le(Tr()),Gk=Le(Ya());var _a;(function(l){l.UInt8="UInt8",l.UInt16="UInt16",l.UInt32="UInt32",l.UInt64="UInt64",l.Int16="Int16",l.Int32="Int32",l.Int64="Int64",l.Float32="Float32",l.Float64="Float64"})(_a||(_a={}));var X_;(function(r){r.vertexCount="vertexCount",r.featureCount="featureCount"})(X_||(X_={}));function Yh(e,t=null){return t?`${e}?token=${t}`:e}function x0e(e,t){let{attributeData:r=[]}=t,i=[];for(let n=0;n<r.length;n++){let a=r[n].href.replace("./","");i.push(`${e}/${a}`)}return i}function w0e(e,t){let r=[],{attributeStorageInfo:i,url:n}=e;for(let a=0;a<i.length;a++){let o=i[a].key;r.push(`${n}/nodes/${t}/attributes/${o}/0`)}return r}var Z0=Le(E0e());function CL(e){switch(e){case _a.UInt8:return Uint8Array;case _a.UInt16:return Uint16Array;case _a.UInt32:return Uint32Array;case _a.Float32:return Float32Array;case _a.UInt64:return Float64Array;default:throw new Error(`parse i3s tile content: unknown type of data: ${e}`)}}var S0e={UInt8:Z0.default.UNSIGNED_BYTE,UInt16:Z0.default.UNSIGNED_SHORT,Float32:Z0.default.FLOAT,UInt32:Z0.default.UNSIGNED_INT,UInt64:Z0.default.DOUBLE};function ev(e){switch(e){case _a.UInt8:return 1;case _a.UInt16:case _a.Int16:return 2;case _a.UInt32:case _a.Int32:case _a.Float32:return 4;case _a.UInt64:case _a.Int64:case _a.Float64:return 8;default:throw new Error(`parse i3s tile content: unknown size of data: ${e}`)}}var A0e="String",T0e="Oid32",k0e="Float64",R0e="Int16",Au;(function(a){a[a.DEFAULT=-1]="DEFAULT",a[a.LNGLAT=1]="LNGLAT",a[a.METER_OFFSETS=2]="METER_OFFSETS",a[a.LNGLAT_OFFSETS=3]="LNGLAT_OFFSETS",a[a.CARTESIAN=0]="CARTESIAN"})(Au||(Au={}));async function C0e(e,t){let{attributeName:r,attributeType:i}=t;return r?{[r]:i?uft(i,e):null}:{}}function uft(e,t){switch(e){case A0e:return fft(t);case T0e:return I0e(t);case k0e:return cft(t);case R0e:return lft(t);default:return I0e(t)}}function I0e(e){let t=4;return new Uint32Array(e,t)}function lft(e){let t=4;return new Int16Array(e,t)}function cft(e){let t=8;return new Float64Array(e,t)}function fft(e){let t=0,r=8,i=4,n=[];try{let a=new DataView(e,t,i).getUint32(t,!0),o=new Uint32Array(e,r,a),s=r+a*i;for(let u of o){let l=new TextDecoder("utf-8"),c=new Uint8Array(e,s,u);n.push(l.decode(c)),s+=u}}catch(a){console.error("Parse string attribute error: ",a.message)}return n}var hft="3.4.2";var J_={name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:hft,mimeTypes:["application/binary"],parse:dft,extensions:["bin"],options:{},binary:!0};async function dft(e,t){return e=C0e(e,t),e}function O0e(e){return e.hasOwnProperty("objectIds")?"Oid32":e.hasOwnProperty("attributeValues")?e.attributeValues.valueType:""}async function P0e(e,t,r,i,n){var c;if(!((c=n==null?void 0:n.i3s)==null?void 0:c.colorsByAttribute))return e;let a=i.fields.find(({name:f})=>{var h,d;return f===((d=(h=n==null?void 0:n.i3s)==null?void 0:h.colorsByAttribute)==null?void 0:d.attributeName)});if(!a||!["esriFieldTypeDouble","esriFieldTypeInteger","esriFieldTypeSmallInteger"].includes(a.type))return e;let o=await B0e(a.name,r,i,n);if(!o)return e;let s=i.fields.find(({type:f})=>f==="esriFieldTypeOID");if(!s)return e;let u=await B0e(s.name,r,i,n);if(!u)return e;let l={};for(let f=0;f<u[s.name].length;f++)l[u[s.name][f]]=pft(o[a.name][f],n);for(let f=0;f<t.value.length;f++){let h=l[t.value[f]];!h||e.value.set(h,f*4)}return e}function pft(e,t){var u;if(!((u=t==null?void 0:t.i3s)==null?void 0:u.colorsByAttribute))return[255,255,255,255];let{minValue:r,maxValue:i,minColor:n,maxColor:a}=t.i3s.colorsByAttribute,o=(e-r)/(i-r),s=[255,255,255,255];for(let l=0;l<n.length;l++)s[l]=Math.round((a[l]-n[l])*o+n[l]);return s}async function B0e(e,{attributeUrls:t},{attributeStorageInfo:r},i){var u;let n=r.findIndex(({name:l})=>e===l);if(n===-1)return null;let a=Yh(t[n],(u=i==null?void 0:i.i3s)==null?void 0:u.token),o=O0e(r[n]);return await ci(a,J_,{attributeName:e,attributeType:o})}var zk=new $h.Vector3([0,0,0]);function mft(e){switch(e){case"ktx-etc2":case"dds":return f2;case"ktx2":return Nd;case"jpg":case"png":default:return Og}}var gft="i3s-attribute-type";async function M0e(e,t,r,i,n){var o;let a={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new $h.Matrix4,coordinateSystem:0,byteLength:0,texture:null};if(t.textureUrl){let s=Yh(t.textureUrl,(o=i==null?void 0:i.i3s)==null?void 0:o.token),u=mft(t.textureFormat),c=await(await fetch(s,i==null?void 0:i.fetch)).arrayBuffer();if(i==null?void 0:i.i3s.decodeTextures){if(u===Og){let f=_t(ce({},t.textureLoaderOptions),{image:{type:"data"}});try{a.texture=await n.parse(c,f)}catch{a.texture=await rl(c,u,f)}}else if(u===f2||u===Nd){let f=await ci(c,u,t.textureLoaderOptions);u===Nd&&(f=f[0]),a.texture={compressed:!0,mipmaps:!1,width:f[0].width,height:f[0].height,data:f}}}else a.texture=c}return a.material=Aft(t.materialDefinition,a.texture),a.material&&(a.texture=null),await vft(e,a,t,r,i)}async function vft(e,t,r,i,n){var f,h;let a=e.byteLength,o,s,u=0,l=0,c;if(r.isDracoGeometry){let d=await rl(e,wg,{draco:{attributeNameEntry:gft}});s=d.header.vertexCount,c=(f=d.indices)==null?void 0:f.value;let{POSITION:p,NORMAL:y,COLOR_0:g,TEXCOORD_0:b,["feature-index"]:E,["uv-region"]:S}=d.attributes;o={position:p,normal:y,color:g,uv0:b,uvRegion:S,id:E},yft(o,d);let k=Cft(E);k&&Rft(o,k)}else{let{vertexAttributes:d,ordering:p,featureAttributes:y,featureAttributeOrder:g}=i.store.defaultGeometrySchema,b=_ft(e,i);u=b.byteOffset,s=b.vertexCount,l=b.featureCount;let{attributes:E,byteOffset:S}=F0e(e,u,d,s,p),{attributes:k}=F0e(e,S,y,l,g);kft(k),o=bft(E,k)}if(!((h=n==null?void 0:n.i3s)==null?void 0:h.coordinateSystem)||n.i3s.coordinateSystem===Au.METER_OFFSETS){let d=wft(o.position,r);t.modelMatrix=d.invert(),t.coordinateSystem=Au.METER_OFFSETS}else t.modelMatrix=Sft(o.position),t.coordinateSystem=Au.LNGLAT_OFFSETS;o.color=await P0e(o.color,o.id,r,i,n),t.attributes={positions:o.position,normals:o.normal,colors:D0e(o.color),texCoords:o.uv0,uvRegions:D0e(o.uvRegion||o.region)},t.indices=c||null,o.id&&o.id.value&&(t.featureIds=o.id.value);for(let d in t.attributes)t.attributes[d]||delete t.attributes[d];return t.vertexCount=s,t.byteLength=a,t}function yft(e,t){for(let r in t.loaderData.attributes){let i=t.loaderData.attributes[r];switch(i.name){case"POSITION":e.position.metadata=i.metadata;break;case"feature-index":e.id.metadata=i.metadata;break;default:break}}}function bft(e,t){return ce(ce({},e),t)}function D0e(e){return e&&(e.normalized=!0,e)}function _ft(e,t){let r=0,i=0,n=0;for(let{property:a,type:o}of t.store.defaultGeometrySchema.header){let s=CL(o);switch(a){case X_.vertexCount:i=new s(e,0,4)[0],r+=ev(o);break;case X_.featureCount:n=new s(e,4,4)[0],r+=ev(o);break;default:break}}return{vertexCount:i,featureCount:n,byteOffset:r}}function F0e(e,t,r,i,n){let a={};for(let o of n)if(r[o]){let{valueType:s,valuesPerElement:u}=r[o];if(t+i*u*ev(s)<=e.byteLength){let l=e.slice(t),c;if(s==="UInt64")c=xft(l,i*u,ev(s));else{let f=CL(s);c=new f(l,0,i*u)}switch(a[o]={value:c,type:S0e[s],size:u},o){case"color":a.color.normalized=!0;break;case"position":case"region":case"normal":default:}t=t+i*u*ev(s)}else if(o!=="uv0")break}return{attributes:a,byteOffset:t}}function xft(e,t,r){let i=[],n=new DataView(e),a=0;for(let o=0;o<t;o++){let s=n.getUint32(a,!0),u=n.getUint32(a+4,!0),l=s+2**32*u;i.push(l),a+=r}return new Uint32Array(i)}function wft(e,t){let r=t.mbs,i=e.value,n=e.metadata,a=new $h.Matrix4,o=new $h.Vector3(r[0],r[1],r[2]),s=new $h.Vector3;return Gk.Ellipsoid.WGS84.cartographicToCartesian(o,s),Gk.Ellipsoid.WGS84.eastNorthUpToFixedFrame(s,a),e.value=Eft(i,n,o),a}function Eft(e,t={},r){let i=new Float64Array(e.length),n=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<i.length;o+=3)i[o]=e[o]*n+r.x,i[o+1]=e[o+1]*a+r.y,i[o+2]=e[o+2]+r.z;for(let o=0;o<i.length;o+=3)Gk.Ellipsoid.WGS84.cartographicToCartesian(i.subarray(o,o+3),zk),i[o]=zk.x,i[o+1]=zk.y,i[o+2]=zk.z;return i}function Sft(e){var a,o;let t=e.metadata,r=((a=t==null?void 0:t["i3s-scale_x"])==null?void 0:a.double)||1,i=((o=t==null?void 0:t["i3s-scale_y"])==null?void 0:o.double)||1,n=new $h.Matrix4;return n[0]=r,n[5]=i,n}function Aft(e,t){let r;return e?r=_t(ce({},e),{pbrMetallicRoughness:e.pbrMetallicRoughness?ce({},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=j0e(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=j0e(r.pbrMetallicRoughness.baseColorFactor)),t&&Tft(r,t),r}function j0e(e){let t=[...e];for(let r=0;r<e.length;r++)t[r]=e[r]/255;return t}function Tft(e,t){let r={source:{image:t}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture=_t(ce({},e.pbrMetallicRoughness.baseColorTexture),{texture:r}):e.emissiveTexture?e.emissiveTexture=_t(ce({},e.emissiveTexture),{texture:r}):e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture=_t(ce({},e.pbrMetallicRoughness.metallicRoughnessTexture),{texture:r}):e.normalTexture?e.normalTexture=_t(ce({},e.normalTexture),{texture:r}):e.occlusionTexture&&(e.occlusionTexture=_t(ce({},e.occlusionTexture),{texture:r}))}function kft(e){let{id:t,faceRange:r}=e;if(!t||!r)return;let i=t.value,n=r.value,a=n[n.length-1]+1,o=new Uint32Array(a*3),s=0,u=0;for(let l=1;l<n.length;l+=2){let c=Number(i[s]),f=n[l],h=n[l-1],d=f-h+1,p=u+d*3;o.fill(c,u,p),s++,u=p}e.id.value=o}function Rft(e,t){let r=e.id.value,i=new Float32Array(r.length);for(let n=0;n<r.length;n++)i[n]=t[r[n]];e.id.value=i}function Cft(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 Ift="3.4.2",L0e={name:"I3S Content (Indexed Scene Layers)",id:Ln?"i3s-content":"i3s-content-nodejs",module:"i3s",worker:!0,version:Ift,mimeTypes:["application/octet-stream"],parse:Oft,extensions:["bin"],options:{"i3s-content":{}}};async function Oft(e,t,r){let{tile:i,_tileOptions:n,tileset:a,_tilesetOptions:o}=(t==null?void 0:t.i3s)||{},s=n||i,u=o||a;return!s||!u?null:await M0e(e,s,u,t,r)}var q0e=Le(cl()),OL=Le(Ya());var Pft="3.4.2";async function Bft(e){return JSON.parse(new TextDecoder().decode(e))}var N0e={name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:Pft,mimeTypes:["application/json"],parse:Mft,extensions:["json"],options:{}};async function Mft(e){return e=Bft(e),e}var Hk=class{constructor(t,r){this.nodePages=[];this.pendingNodePages=[];this.textureDefinitionsSelectedFormats=[];this.textureLoaderOptions={};var i,n;this.tileset=ce({},t),this.nodesPerPage=((i=t.nodePages)==null?void 0:i.nodesPerPage)||64,this.lodSelectionMetricType=(n=t.nodePages)==null?void 0:n.lodSelectionMetricType,this.options=r,this.nodesInNodePages=0,this.initSelectedFormatsForTextureDefinitions(t)}async getNodeById(t){var n;let r=Math.floor(t/this.nodesPerPage);if(!this.nodePages[r]&&!this.pendingNodePages[r]){let a=Yh(`${this.tileset.url}/nodepages/${r}`,(n=this.options.i3s)==null?void 0:n.token);this.pendingNodePages[r]={status:"Pending",promise:ci(a,N0e,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 i=t%this.nodesPerPage;return this.nodePages[r].nodes[i]}async formTileFromNodePages(t){let r=await this.getNodeById(t),i=[],n=[];for(let d of r.children||[])n.push(this.getNodeById(d));let a=await Promise.all(n);for(let d of a)i.push({id:d.index.toString(),obb:d.obb});let o,s,u,l="jpg",c=[],f=!1;if(r&&r.mesh){let{url:d,isDracoGeometry:p}=r.mesh.geometry&&this.getContentUrl(r.mesh.geometry)||{isDracoGeometry:!1};o=d,f=p;let{textureData:y,materialDefinition:g}=this.getInformationFromMaterial(r.mesh.material);u=g,l=y.format||l,y.name&&(s=`${this.tileset.url}/nodes/${r.mesh.material.resource}/textures/${y.name}`),this.tileset.attributeStorageInfo&&(c=w0e(this.tileset,r.mesh.attribute.resource))}let h=this.getLodSelection(r);return IL({id:t.toString(),lodSelection:h,obb:r.obb,contentUrl:o,textureUrl:s,attributeUrls:c,materialDefinition:u,textureFormat:l,textureLoaderOptions:this.textureLoaderOptions,children:i,isDracoGeometry:f})}getContentUrl(t){let r=null,i=this.tileset.geometryDefinitions[t.definition],n=-1;if(this.options.i3s&&this.options.i3s.useDracoGeometry&&(n=i.geometryBuffers.findIndex(a=>a.compressedAttributes&&a.compressedAttributes.encoding==="draco")),n===-1&&(n=i.geometryBuffers.findIndex(a=>!a.compressedAttributes)),n!==-1){let a=Boolean(i.geometryBuffers[n].compressedAttributes);r={url:`${this.tileset.url}/nodes/${t.resource}/geometries/${n}`,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 i,n,a;let r={textureData:{name:null}};if(t){let o=(i=this.tileset.materialDefinitions)==null?void 0:i[t.definition];if(o){r.materialDefinition=o;let s=(a=(n=o==null?void 0:o.pbrMetallicRoughness)==null?void 0:n.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(),i=t.textureSetDefinitions||[];for(let n of i){let a=n&&n.formats||[],o=null;for(let s of r){let u=a.find(l=>l.format===s);if(u){o=u;break}}o&&o.format==="ktx2"&&(this.textureLoaderOptions.basis={format:Ig(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(o)}}getSupportedTextureFormats(){let t=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){let r=Mb();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 U0e(e,t){let r=t.url||"",i;e.geometryData&&(i=`${r}/${e.geometryData[0].href}`);let n;e.textureData&&(n=`${r}/${e.textureData[0].href}`);let a;return e.attributeData&&(a=x0e(r,e)),IL(_t(ce({},e),{url:r,contentUrl:i,textureUrl:n,attributeUrls:a,isDracoGeometry:!1}))}function IL(e){var u,l;let t={},r=[0,0,0,1];if(e.mbs)r=e.mbs,t.sphere=[...OL.Ellipsoid.WGS84.cartographicToCartesian(e.mbs.slice(0,3)),e.mbs[3]];else if(e.obb){t.box=[...OL.Ellipsoid.WGS84.cartographicToCartesian(e.obb.center),...e.obb.halfSize,...e.obb.quaternion];let f=new q0e.OrientedBoundingBox().fromCenterHalfSizeQuaternion(t.box.slice(0,3),e.obb.halfSize,e.obb.quaternion).getBoundingSphere();t.sphere=[...f.center,f.radius],r=[...e.obb.center,f.radius]}let i=(u=e.lodSelection)==null?void 0:u[0].metricType,n=(l=e.lodSelection)==null?void 0:l[0].maxError,a=e.transform,o=Fd.MESH,s=Ba.REPLACE;return _t(ce({},e),{mbs:r,boundingVolume:t,lodMetricType:i,lodMetricValue:n,transformMatrix:a,type:o,refine:s})}async function G0e(e,t,r){var i;if(e.url=r.url,e.nodePages)e.nodePagesTile=new Hk(e,t),e.root=e.nodePagesTile.formTileFromNodePages(0);else{let n=Yh(`${e.url}/nodes/root`,(i=t.i3s)==null?void 0:i.token);e.root=await ci(n,e.loader,_t(ce({},t),{i3s:_t(ce({},t.i3s),{loadContent:!1,isTileHeader:!0,isTileset:!1})}))}e.basePath=e.url,e.type=aa.I3S,e.lodMetricType=e.root.lodMetricType,e.lodMetricValue=e.root.lodMetricValue}var Dft="3.4.2",Fft=/layers\/[0-9]+$/,jft=/nodes\/([0-9-]+|root)$/,Lft="504b0304",Nft="PointCloud",Vk={name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:Dft,mimeTypes:["application/octet-stream"],parse:qft,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:Au.METER_OFFSETS,colorsByAttribute:null}}};async function qft(e,t={},r){let i=r.url;if(t.i3s=t.i3s||{},Hft(e)===Lft)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let a;t.i3s.isTileset==="auto"?a=Fft.test(i):a=t.i3s.isTileset;let o;return t.isTileHeader==="auto"?o=jft.test(i):o=t.i3s.isTileHeader,a?e=await Gft(e,t,r):o?e=await zft(e,r):e=await Uft(e,t),e}async function Uft(e,t){return await rl(e,L0e,t)}async function Gft(e,t,r){let i=JSON.parse(new TextDecoder().decode(e));if((i==null?void 0:i.layerType)===Nft)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return i.loader=Vk,await G0e(i,t,r),i}async function zft(e,t){return e=JSON.parse(new TextDecoder().decode(e)),U0e(e,t)}function Hft(e){return e instanceof ArrayBuffer?[...new Uint8Array(e,0,4)].map(t=>t.toString(16).padStart(2,"0")).join(""):null}var z0e=Le(Tr()),H0e=Le(Ya()),V0e=Le(cl());function PL(e,t){let r=[e.center[0],e.center[1],e.center[2]+t.getHeight(e.center[1],e.center[0])],i=H0e.Ellipsoid.WGS84.cartographicToCartesian(r,new z0e.Vector3),n=new V0e.OrientedBoundingBox().fromCenterHalfSizeQuaternion(i,e.halfSize,e.quaternion);return[...n.center,...n.halfAxes.toArray()]}var Wk=Le(vu()),Vft=()=>({version:{path:"version",default:"1.0"}}),W0e=()=>({boundingVolume:{path:"boundingVolume"},geometricError:{path:"geometricError"},content:{path:"content"},children:{path:"children",transform:e=>e.map(t=>(0,Wk.default)(t,W0e()))}}),K0e=()=>({asset:{path:"asset",transform:e=>(0,Wk.default)(e,Vft())},geometricError:{path:"root",transform:e=>e.geometricError},root:{path:"root",transform:e=>(0,Wk.default)(e,W0e())}});var Wft="3.4.2",BL={id:"3d-tiles-attributes",name:"3DTiles Attributes Worker",module:"tile-converter",version:Wft,options:{featureAttributes:null}};function Y0e(e,t){return jy(BL,e,t)}var Kft="I3S",Q_=class{constructor(){this.workerSource={};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){if(ji)return console.log(Q0),Q0;let{inputUrl:r,outputPath:i,tilesetName:n,maxDepth:a,egmFilePath:o}=t;this.conversionStartTime=ML.default.hrtime(),this.options={maxDepth:a},console.log("Loading egm file..."),this.geoidHeightModel=await ci(o,Lk),console.log("Loading egm file completed!"),await this.loadWorkers();let s=await ci(r,Vk,{});this.sourceTileset=new xg(s,{loadOptions:{_nodeWorkers:!0,reuseWorkers:!0,"i3s-content-nodejs":{workerUrl:"./modules/i3s/dist/i3s-content-nodejs-worker.js"},i3s:{coordinateSystem:Au.LNGLAT_OFFSETS,decodeTextures:!1}}}),await this.sourceTileset.tilesetInitializationPromise;let u=this.sourceTileset.root;u.header.obb||(u.header.obb=fL(u.header.mbs)),this.tilesetPath=(0,$0e.join)(`${i}`,`${n}`),this.attributeStorageInfo=s.attributeStorageInfo;try{await G_(this.tilesetPath)}catch{}let l={boundingVolume:{box:PL(u.header.obb,this.geoidHeightModel)},geometricError:vL(u),children:[]};await this._addChildren(u,l,1);let c=(0,X0e.default)({root:l},K0e());await Hn(this.tilesetPath,JSON.stringify(c),"tileset.json"),this._finishConversion({slpk:!1,outputPath:i,tilesetName:n}),En.getWorkerFarm({}).destroy()}async convertChildNode(t,r,i,n){var o;let a=await this._loadChildNode(t,n);if(t.children.push(a),a.contentUrl){await this.sourceTileset._loadTile(a),this.vertexCounter+=a.content.vertexCount;let s=null;this.attributeStorageInfo&&(s=await this._loadChildAttributes(a,this.attributeStorageInfo)),a.header.obb||(a.header.obb=fL(a.header.mbs));let u={box:PL(a.header.obb,this.geoidHeightModel)},l={boundingVolume:u,geometricError:vL(a),children:[]},c={tileContent:a.content,textureFormat:(o=a==null?void 0:a.header)==null?void 0:o.textureFormat},f=await Y0e(c,{source:this.workerSource.tile3dWorkerSource,featureAttributes:s});l.content={uri:`${a.id}.b3dm`,boundingVolume:u},await Hn(this.tilesetPath,new Uint8Array(f),`${a.id}.b3dm`),r.children.push(l),a.unloadContent(),await this._addChildren(a,l,i+1)}else await this._addChildren(a,r,i+1)}async _addChildren(t,r,i){if(this.options.maxDepth&&i>this.options.maxDepth)return;let n=[];for(let a of t.header.children||[])n.push(this.convertChildNode(t,r,i,a));await Promise.all(n)}async _loadChildNode(t,r){let i;if(this.sourceTileset.tileset.nodePages)console.log(`Node conversion: ${r.id}`),i=await this.sourceTileset.tileset.nodePagesTile.formTileFromNodePages(r.id);else{let{loader:n}=this.sourceTileset,a=this._relativeUrlToFullUrl(t.url,r.href),o={i3s:_t(ce({},this.sourceTileset.loadOptions),{isTileHeader:!0,loadContent:!1})};console.log(`Node conversion: ${a}`),i=await ci(a,n,o)}return new _c(this.sourceTileset,i,t)}_relativeUrlToFullUrl(t,r){let i=t.split("/"),n=r.split("/");for(let a of n)switch(a){case".":continue;case"..":i=i.slice(0,-1);break;default:i.push(a)}return i.join("/")}async _loadChildAttributes(t,r){let i=[],{attributeUrls:n}=t.header;for(let o=0;o<n.length;o++){let s=n[o],u=r[o],l={attributeName:u.name,attributeType:this._getAttributeType(u)};i.push(ci(s,J_,l))}let a=await Promise.all(i);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 i=t[r];for(let n in i)i[n]=Array.from(i[n])}}async _finishConversion(t){let r=await Bk(t),i=ML.default.hrtime(this.conversionStartTime),n=Pk(i);console.log("------------------------------------------------"),console.log(`Finish conversion of ${Kft}`),console.log(`Total conversion time: ${n}`),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",r," bytes"),console.log("------------------------------------------------")}async loadWorkers(){console.log("Loading workers source...");let t=nu(BL,ce({},Po())),i=await(await na(t)).text();this.workerSource.tile3dWorkerSource=i,console.log("Loading workers source completed!")}};var J0e=Le(uL()),Yft="3.4.2",DL={id:"zip",module:"zip",name:"Zip Archive",version:Yft,extensions:["zip"],mimeTypes:["application/zip"],category:"archive",tests:["PK"],options:{},parse:$ft};async function $ft(e,t={}){let r=[],i={};try{let n=new J0e.default;return(await n.loadAsync(e,t)).forEach((o,s)=>{let u=s.name,l=Xft(n,u,t).then(c=>{i[o]=c});r.push(l)}),await Promise.all(r),i}catch(n){throw t.log.error(`Unable to read zip archive: ${n}`),n}}async function Xft(e,t,r={}){try{return await e.file(t).async(r.dataType||"arraybuffer")}catch(i){return r.log.error(`Unable to read ${t} from zip archive: ${i}`),i}}var FL=Le(require("path"));var Jft="3.4.2",Qft="https://raw.githubusercontent.com/visgl/deck.gl-data/master/egm/egm2008-5.zip",jL=class{async install(t="",r=""){console.log('Installing "EGM2008-5" model...');let i=await ci(Qft,DL,{}),n=process.cwd();t&&(n=(0,FL.join)(n,t)),await Hn(n,new Uint8Array(i["geoids/egm2008-5.pgm"]),"egm2008-5.pgm"),console.log('Installing "I3S Content Loader worker"'),await this.installWorker("i3s","i3s-content-nodejs-worker.js",r),console.log('Installing "Draco Loader worker"'),await this.installWorker("draco","draco-nodejs-worker.js",r),console.log('Installing "Basis Loader worker"'),await this.installWorker("textures","basis-nodejs-worker.js",r),console.log('Installing "join-images" npm package'),await new Df().start({command:"npm",arguments:["install","sharp@^0.30.4","join-images@^1.1.3"],wait:0}),console.log("All dependencies were installed succesfully.")}async installWorker(t,r,i){let a=await(await na(`https://unpkg.com/@loaders.gl/${t}@${Jft}/dist/${r}`)).arrayBuffer();if(!a)return;let o=(0,FL.join)(process.cwd(),i,"modules",t,"dist");await Hn(o,a,r)}};var LL={I3S:"I3S",_3DTILES:"3DTILES"};async function Zft(){let[,,...e]=process.argv;e.length===0&&NL();let t=rht(e),r=iht(t);if(r.installDependencies){new jL().install("deps");return}let i=tht(r);await eht(i)}Zft().catch(e=>{console.log(e),process.exit(1)});function NL(){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 [Will generate obb and mbs bounding volumes from geometry]"),console.log("--validate [Enable validation]"),process.exit(0)}async function eht(e){switch(console.log("------------------------------------------------"),console.log(`Starting conversion of ${e.inputType}`),console.log("------------------------------------------------"),e.inputType.toUpperCase()){case LL.I3S:new Q_().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,egmFilePath:e.egm});break;case LL._3DTILES:await new $_().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});break;default:NL()}}function tht(e){let t={name:()=>console.log("Missed: --name [Tileset name]"),output:()=>console.log("Missed: --output [Output path name]"),sevenZipExe:()=>console.log("Missed: --7zExe [7z archiver executable path]"),egm:()=>console.log("Missed: --egm [*.pgm earth gravity model file path]"),tileset:()=>console.log("Missed: --tileset [tileset.json file]"),inputType:()=>console.log("Missed/Incorrect: --input-type [tileset input type: I3S or 3DTILES]")},r=[];for(let i in t){let n=e[i],a=Boolean(n)&&i==="inputType"&&!Object.values(LL).includes(n.toUpperCase());(!n||a)&&r.push(t[i])}return r.length&&(r.forEach(i=>i()),process.exit(1)),e}function rht(e){return e.reduce((t,r)=>{let i=r.indexOf("="),n=r.slice(0,i),a=r.slice(i+1,r.length);return r.includes("=")&&r.startsWith("--")&&a?t.concat(n,a):t.concat(r)},[])}function iht(e){let t={output:"data",instantNodeWriting:!1,mergeMaterials:!0,sevenZipExe:"C:\\Program Files\\7-Zip\\7z.exe",egm:(0,Q0e.join)(process.cwd(),"deps","egm2008-5.pgm"),draco:!0,installDependencies:!1,generateTextures:!1,generateBoundingVolumes:!1,validate:!1,slpk:!1};return e.forEach((r,i)=>{if(r.indexOf("--")===0)switch(r){case"--input-type":t.inputType=$c(i,e);break;case"--tileset":t.tileset=nht(i,e);break;case"--name":t.name=$c(i,e);break;case"--output":t.output=$c(i,e);break;case"--instant-node-writing":t.instantNodeWriting=Xh(i,e);break;case"--split-nodes":t.mergeMaterials=Xh(i,e);break;case"--max-depth":t.maxDepth=aht(i,e);break;case"--slpk":t.slpk=Xh(i,e);break;case"--7zExe":t.sevenZipExe=$c(i,e);break;case"--egm":t.egm=$c(i,e);break;case"--token":t.token=$c(i,e);break;case"--no-draco":t.draco=Xh(i,e);break;case"--validate":t.validate=Xh(i,e);break;case"--install-dependencies":t.installDependencies=Xh(i,e);break;case"--generate-textures":t.generateTextures=Xh(i,e);break;case"--generate-bounding-volumes":t.generateBoundingVolumes=Xh(i,e);break;case"--help":NL();break;default:console.warn(`Unknown option ${r}`),process.exit(0)}}),t}function $c(e,t){if(e+1>=t.length)return"";let r=t[e+1];return r.indexOf("--")===0?"":r}function nht(e,t){let r=$c(e,t);return console.log(`Input tileset value: ${r}`),console.log(`Modified tileset value: ${r.replace(/\\/g,"/")}`),r.replace(/\\/g,"/")}function aht(e,t){let r=$c(e,t),i=Number.parseInt(r);return isFinite(i)?i:NaN}function Xh(e,t){let r=$c(e,t).toLowerCase().trim();return["--no-draco","--split-nodes"].includes(t[e])&&!r?!1:!r||r==="true"}
124
+ `).forEach(s=>{let u=a.exec(s);u&&n.push(Number(u[1]))});let o=e;for(;n.includes(o);)o++;t(o)})})}var yX={command:"",arguments:[],port:5e3,autoPort:!0,wait:2e3,onSuccess:e=>{console.log(`Started ${e.props.command}`)}},Df=class{constructor({id:t="browser-driver"}={}){this.props=ce({},yX);this.childProcess=null;this.port=0;this.id=t}async start(t){t=ce(ce({},yX),t),this.props=t;let r=[...t.arguments];return this.port=Number(t.port),t.portArg&&(t.autoPort&&(this.port=await gX(t.port)),r.push(t.portArg,String(this.port))),await new Promise((i,n)=>{try{this._setTimeout(()=>{t.onSuccess&&t.onSuccess(this),i({})}),console.log(`Spawning ${t.command} ${t.arguments.join(" ")}`);let a=vX.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}".`),this._clearTimeout(),n(new Error(o))}),a.on("error",o=>{console.log(`Child process errored with ${o}`),this._clearTimeout(),n(o)}),a.on("close",o=>{console.log(`Child process exited with ${o}`),this.childProcess=null,this._clearTimeout(),i({})})}catch(a){n(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 YO(e,t){return!En.isSupported()||!Ln&&!(t==null?void 0:t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}async function $O(e,t,r,i,n){let a=e.id,o=nu(e,r),u=En.getWorkerFarm(r).getWorkerPool({name:a,url:o});r=JSON.parse(JSON.stringify(r)),i=JSON.parse(JSON.stringify(i||{}));let l=await u.startJob("process-on-worker",BOe.bind(null,n));return l.postMessage("process",{input:t,options:r,context:i}),await(await l.result).result}async function BOe(e,t,r,i){switch(r){case"done":t.done(i);break;case"error":t.error(new Error(i.error));break;case"process":let{id:n,input:a,options:o}=i;try{let s=await e(a,o);t.postMessage("done",{id:n,result:s})}catch(s){let u=s instanceof Error?s.message:"unknown error";t.postMessage("error",{id:n,error:u})}break;default:console.warn(`parse-with-worker unknown message ${r}`)}}function XO(e,t){return!En.isSupported()||!ji&&!(t==null?void 0:t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}function bX(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?_X(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?_X(e,0,t):""}function _X(e,t,r){if(e.byteLength<=t+r)return"";let i=new DataView(e),n="";for(let a=0;a<r;a++)n+=String.fromCharCode(i.getUint8(t+a));return n}function JO(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${bX(e)}"`)}}function QO(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let i=new Uint8Array(e),n=new Uint8Array(t);for(let a=0;a<i.length;++a)if(i[a]!==n[a])return!1;return!0}function tl(...e){let t=e.map(a=>a instanceof ArrayBuffer?new Uint8Array(a):a),r=t.reduce((a,o)=>a+o.byteLength,0),i=new Uint8Array(r),n=0;for(let a of t)i.set(a,n),n+=a.byteLength;return i.buffer}function ha(...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 i=t.reduce((o,s)=>o+s.length,0),n=new r(i),a=0;for(let o of t)n.set(o,a),a+=o.length;return n}function _d(e,t,r){let i=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(i).buffer}function Ff(e,t){return zt(e>=0),zt(t>0),e+(t-1)&~(t-1)}function ZO(e,t,r){let i;if(e instanceof ArrayBuffer)i=new Uint8Array(e);else{let n=e.byteOffset,a=e.byteLength;i=new Uint8Array(e.buffer||e.arrayBuffer,n,a)}return t.set(i,r),r+Ff(i.byteLength,4)}async function eP(e){let t=[];for await(let r of e)t.push(r);return tl(...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 tP(e,t){if(jf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(jf(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rP(e){var t=tP(e,"string");return jf(t)==="symbol"?t:String(t)}function Vt(e,t,r){return t=rP(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ly(){let e;if(typeof window!="undefined"&&window.performance)e=window.performance.now();else if(typeof process!="undefined"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var Km=class{constructor(t,r){Vt(this,"name",void 0),Vt(this,"type",void 0),Vt(this,"sampleSize",1),Vt(this,"time",0),Vt(this,"count",0),Vt(this,"samples",0),Vt(this,"lastTiming",0),Vt(this,"lastSampleTime",0),Vt(this,"lastSampleCount",0),Vt(this,"_count",0),Vt(this,"_time",0),Vt(this,"_samples",0),Vt(this,"_startTime",0),Vt(this,"_timerPending",!1),this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Ly(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Ly()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var Ny=class{constructor(t){Vt(this,"id",void 0),Vt(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:i}=t,n=this.stats[r];return n||(t instanceof Km?n=t:n=new Km(r,i),this.stats[r]=n),n}};var MOe="Queued Requests",DOe="Active Requests",FOe="Cancelled Requests",jOe="Queued Requests Ever",LOe="Active Requests Ever",NOe={id:"request-scheduler",throttleRequests:!0,maxRequests:6},qy=class{constructor(t={}){this.activeRequestCount=0;this.requestQueue=[];this.requestMap=new Map;this.deferredUpdate=null;this.props=ce(ce({},NOe),t),this.stats=new Ny({id:this.props.id}),this.stats.get(MOe),this.stats.get(DOe),this.stats.get(FOe),this.stats.get(jOe),this.stats.get(LOe)}scheduleRequest(t,r=()=>0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);let i={handle:t,priority:0,getPriority:r},n=new Promise(a=>(i.resolve=a,i));return this.requestQueue.push(i),this.requestMap.set(t,n),this._issueNewRequests(),n}_issueRequest(t){let{handle:r,resolve:i}=t,n=!1,a=()=>{n||(n=!0,this.requestMap.delete(r),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,i?i({done:a}):Promise.resolve({done:a})}_issueNewRequests(){this.deferredUpdate||(this.deferredUpdate=setTimeout(()=>this._issueNewRequestsAsync(),0))}_issueNewRequestsAsync(){this.deferredUpdate=null;let t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(t!==0){this._updateAllRequests();for(let r=0;r<t;++r){let i=this.requestQueue.shift();i&&this._issueRequest(i)}}}_updateAllRequests(){let t=this.requestQueue;for(let r=0;r<t.length;++r){let i=t[r];this._updateRequest(i)||(t.splice(r,1),this.requestMap.delete(i.handle),r--)}t.sort((r,i)=>r.priority-i.priority)}_updateRequest(t){return t.priority=t.getPriority(t.handle),t.priority<0?(t.resolve(null),!1):!0}};var qOe="",xX={};function Lf(e){for(let t in xX)if(e.startsWith(t)){let r=xX[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${qOe}${e}`),e}var UOe="3.4.3",iP={name:"JSON",id:"json",module:"json",version:UOe,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:wX,parse:async e=>wX(new TextDecoder().decode(e)),options:{}};function wX(e){return JSON.parse(e)}function SE(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function nP(e){if(Buffer.isBuffer(e))return e;if(ArrayBuffer.isView(e)&&(e=e.buffer),typeof Buffer!="undefined"&&e instanceof ArrayBuffer)return Buffer.from(e);throw new Error("toBuffer")}function EX(e){return e&&typeof e=="object"&&e.isBuffer}function aP(e){return nP?nP(e):e}function AE(e){if(EX(e))return SE(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 oP(e){return(t,r)=>new Promise((i,n)=>e(t,r,(a,o)=>a?n(a):i(o)))}function SX(e){return(t,r,i)=>new Promise((n,a)=>e(t,r,i,(o,s)=>o?a(o):n(s)))}var au={};To(au,{dirname:()=>zOe,filename:()=>GOe,join:()=>HOe,resolve:()=>VOe});function AX(){var t;if(typeof process!="undefined"&&typeof process.cwd!="undefined")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 GOe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function zOe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function HOe(...e){let t="/";return e=e.map((r,i)=>(i&&(r=r.replace(new RegExp(`^${t}`),"")),i!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function VOe(...e){let t=[];for(let a=0;a<e.length;a++)t[a]=e[a];let r="",i=!1,n;for(let a=t.length-1;a>=-1&&!i;a--){let o;a>=0?o=t[a]:(n===void 0&&(n=AX()),o=n),o.length!==0&&(r=`${o}/${r}`,i=o.charCodeAt(0)===Uy)}return r=WOe(r,!i),i?`/${r}`:r.length>0?r:"."}var Uy=47,sP=46;function WOe(e,t){let r="",i=-1,n=0,a,o=!1;for(let s=0;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else{if(a===Uy)break;a=Uy}if(a===Uy){if(!(i===s-1||n===1))if(i!==s-1&&n===2){if(r.length<2||!o||r.charCodeAt(r.length-1)!==sP||r.charCodeAt(r.length-2)!==sP){if(r.length>2){let u=r.length-1,l=u;for(;l>=0&&r.charCodeAt(l)!==Uy;--l);if(l!==u){r=l===-1?"":r.slice(0,l),i=s,n=0,o=!1;continue}}else if(r.length===2||r.length===1){r="",i=s,n=0,o=!1;continue}}t&&(r.length>0?r+="/..":r="..",o=!0)}else{let u=e.slice(i+1,s);r.length>0?r+=`/${u}`:r=u,o=!1}i=s,n=0}else a===sP&&n!==-1?++n:n=-1}return r}var TE={};To(TE,{_readToArrayBuffer:()=>KOe,close:()=>BX,createWriteStream:()=>DX,fstat:()=>MX,isSupported:()=>FX,open:()=>PX,read:()=>uP,readFile:()=>RX,readFileSync:()=>CX,readdir:()=>TX,stat:()=>kX,writeFile:()=>IX,writeFileSync:()=>OX});var go=Le(require("fs"));var TX,kX,RX,CX,IX,OX,PX,BX,uP,MX,DX,FX=Boolean(go.default);try{TX=oP(go.default.readdir),kX=oP(go.default.stat),RX=go.default.readFile,CX=go.default.readFileSync,IX=SX(go.default.writeFile),OX=go.default.writeFileSync,PX=go.default.open,BX=e=>new Promise((t,r)=>go.default.close(e,i=>i?r(i):t())),uP=go.default.read,MX=go.default.fstat,DX=go.default.createWriteStream,FX=Boolean(go.default)}catch{}async function KOe(e,t,r){let i=Buffer.alloc(r),{bytesRead:n}=await uP(e,i,0,r,t);if(n!==r)throw new Error("fs.read failed");return SE(i)}var $Oe=e=>typeof e=="boolean",Gy=e=>typeof e=="function",xd=e=>e!==null&&typeof e=="object",lP=e=>xd(e)&&e.constructor==={}.constructor;var jX=e=>e&&typeof e[Symbol.iterator]=="function",LX=e=>e&&typeof e[Symbol.asyncIterator]=="function";var os=e=>typeof Response!="undefined"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var ss=e=>typeof Blob!="undefined"&&e instanceof Blob,NX=e=>e&&typeof e=="object"&&e.isBuffer;var XOe=e=>typeof ReadableStream!="undefined"&&e instanceof ReadableStream||xd(e)&&Gy(e.tee)&&Gy(e.cancel)&&Gy(e.getReader);var JOe=e=>xd(e)&&Gy(e.read)&&Gy(e.pipe)&&$Oe(e.readable),kE=e=>XOe(e)||JOe(e);var QOe=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,ZOe=/^([-\w.]+\/[-\w.+]+)/;function qX(e){let t=ZOe.exec(e);return t?t[1]:e}function cP(e){let t=QOe.exec(e);return t?t[1]:""}var UX=/\?.*/;function GX(e){let t=e.match(UX);return t&&t[0]}function Ym(e){return e.replace(UX,"")}function wd(e){return os(e)?e.url:ss(e)?e.name||"":typeof e=="string"?e:""}function zy(e){if(os(e)){let t=e,r=t.headers.get("content-type")||"",i=Ym(t.url);return qX(r)||cP(i)}return ss(e)?e.type||"":typeof e=="string"?cP(e):""}function zX(e){return os(e)?e.headers["content-length"]||-1:ss(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function RE(e){if(os(e))return e;let t={},r=zX(e);r>=0&&(t["content-length"]=String(r));let i=wd(e),n=zy(e);n&&(t["content-type"]=n);let a=await tPe(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:i}),o}async function HX(e){if(!e.ok){let t=await ePe(e);throw new Error(t)}}async function ePe(e){let t=`Failed to fetch resource ${e.url} (${e.status}): `;try{let r=e.headers.get("Content-Type"),i=e.statusText;r.includes("application/json")&&(i+=` ${await e.text()}`),t+=i,t=t.length>60?`${t.slice(0,60)}...`:t}catch{}return t}async function tPe(e){let t=5;if(typeof e=="string")return`data:,${e.slice(0,t)}`;if(e instanceof Blob){let r=e.slice(0,5);return await new Promise(i=>{let n=new FileReader;n.onload=a=>{var o;return i((o=a==null?void 0:a.target)==null?void 0:o.result)},n.readAsDataURL(r)})}if(e instanceof ArrayBuffer){let r=e.slice(0,t);return`data:base64,${rPe(r)}`}return null}function rPe(e){let t="",r=new Uint8Array(e);for(let i=0;i<r.byteLength;i++)t+=String.fromCharCode(r[i]);return btoa(t)}async function na(e,t){if(typeof e=="string"){e=Lf(e);let r=t;return(t==null?void 0:t.fetch)&&typeof(t==null?void 0:t.fetch)!="function"&&(r=t.fetch),await fetch(e,r)}return await RE(e)}async function VX(e,t,r){e=Lf(e),ji||await TE.writeFile(e,aP(t),{flag:"w"}),zt(!1)}function fP(e){if(typeof window!="undefined"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process!="undefined"&&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 ou(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||fP()}var iPe=globalThis.self||globalThis.window||globalThis.global,$m=globalThis.window||globalThis.self||globalThis.global,nPe=globalThis.document||{},Ed=globalThis.process||{},aPe=globalThis.console,Y1t=globalThis.navigator||{};var CE="3.4.3",J1t=ou();function oPe(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var hP=class{constructor(t,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";Vt(this,"storage",void 0),Vt(this,"id",void 0),Vt(this,"config",void 0),this.storage=oPe(i),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 WX(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 KX(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 IE(e,t,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,n=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(r=Math.min(r,i/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(n,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var OE;(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"})(OE||(OE={}));var sPe=10;function YX(e){return typeof e!="string"?e:(e=e.toUpperCase(),OE[e]||OE.WHITE)}function $X(e,t,r){if(!ou&&typeof e=="string"){if(t){let i=YX(t);e="[".concat(i,"m").concat(e,"")}if(r){let i=YX(r);e="[".concat(i+sPe,"m").concat(e,"")}}return e}function XX(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(r),n=e;for(let a of i){let o=n[a];typeof o=="function"&&(t.find(s=>a===s)||(n[a]=o.bind(e)))}}function Xm(e,t){if(!e)throw new Error(t||"Assertion failed")}function Sd(){let e;if(ou()&&$m.performance){var t,r;e=$m===null||$m===void 0||(t=$m.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Ed){var i;let n=Ed===null||Ed===void 0||(i=Ed.hrtime)===null||i===void 0?void 0:i.call(Ed);e=n[0]*1e3+n[1]/1e6}else e=Date.now();return e}var Jm={debug:ou()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},uPe={enabled:!0,level:0};function us(){}var JX={},QX={once:!0},nc=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};Vt(this,"id",void 0),Vt(this,"VERSION",CE),Vt(this,"_startTs",Sd()),Vt(this,"_deltaTs",Sd()),Vt(this,"_storage",void 0),Vt(this,"userData",{}),Vt(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new hP("__probe-".concat(this.id,"__"),uPe),this.timeStamp("".concat(this.id," started")),XX(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){Xm(t,r)}warn(t){return this._getLogFunction(0,t,Jm.warn,arguments,QX)}error(t){return this._getLogFunction(0,t,Jm.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,Jm.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,Jm.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,Jm.debug||Jm.info,arguments,QX)}table(t,r,i){return r?this._getLogFunction(t,r,console.table||us,i&&[i],{tag:hPe(r)}):us}image(t){let{logLevel:r,priority:i,image:n,message:a="",scale:o=1}=t;return this._shouldLog(r||i)?ou()?fPe({image:n,message:a,scale:o}):cPe({image:n,message:a,scale:o}):us}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||us)}group(t,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},n=eJ({logLevel:t,message:r,opts:i}),{collapsed:a}=i;return n.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(t,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},i,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||us)}withGroup(t,r,i){this.group(t,r)();try{i()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=ZX(t)}_getLogFunction(t,r,i,n,a){if(this._shouldLog(t)){a=eJ({logLevel:t,message:r,args:n,opts:a}),i=i||a.method,Xm(i),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Sd();let o=a.tag||a.message;if(a.once&&o)if(!JX[o])JX[o]=Sd();else return us;return r=lPe(this.id,a.message,a),i.bind(console,r,...a.args)}return us}};Vt(nc,"VERSION",CE);function ZX(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 Xm(Number.isFinite(t)&&t>=0),t}function eJ(e){let{logLevel:t,message:r}=e;e.logLevel=ZX(t);let i=e.args?Array.from(e.args):[];for(;i.length&&i.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&i.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let n=typeof e.message;return Xm(n==="string"||n==="object"),Object.assign(e,{args:i},e.opts)}function lPe(e,t,r){if(typeof t=="string"){let i=r.time?KX(WX(r.total)):"";t=r.time?"".concat(e,": ").concat(i," ").concat(t):"".concat(e,": ").concat(t),t=$X(t,r.color,r.background)}return t}function cPe(e){let{image:t,message:r="",scale:i=1}=e;return console.warn("removed"),us}function fPe(e){let{image:t,message:r="",scale:i=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=IE(a,r,i);console.log(...o)},a.src=t,us}let n=t.nodeName||"";if(n.toLowerCase()==="img")return console.log(...IE(t,r,i)),us;if(n.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...IE(a,r,i)),a.src=t.toDataURL(),us}return us}function hPe(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var S_t=new nc({id:"@probe.gl/log"});var dP=new nc({id:"loaders.gl"}),pP=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},mP=class{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 gP={fetch:null,mimeType:void 0,nothrow:!1,log:new mP,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:ji,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},tJ={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 vP(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state=e._state||{},e._state}var Po=()=>{let e=vP();return e.globalOptions=e.globalOptions||ce({},gP),e.globalOptions};function rJ(e,t,r,i){return r=r||[],r=Array.isArray(r)?r:[r],dPe(e,r),mPe(t,e,i)}function dPe(e,t){iJ(e,null,gP,tJ,t);for(let r of t){let i=e&&e[r.id]||{},n=r.options&&r.options[r.id]||{},a=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};iJ(i,r.id,n,a,t)}}function iJ(e,t,r,i,n){let a=t||"Top level",o=t?`${t}.`:"";for(let s in e){let u=!t&&xd(e[s]),l=s==="baseUri"&&!t,c=s==="workerUrl"&&t;if(!(s in r)&&!l&&!c){if(s in i)dP.warn(`${a} loader option '${o}${s}' no longer supported, use '${i[s]}'`)();else if(!u){let f=pPe(s,n);dP.warn(`${a} loader option '${o}${s}' not recognized. ${f}`)()}}}}function pPe(e,t){let r=e.toLowerCase(),i="";for(let n of t)for(let a in n.options){if(e===a)return`Did you mean '${n.id}.${a}'?`;let o=a.toLowerCase();(r.startsWith(o)||o.startsWith(r))&&(i=i||`Did you mean '${n.id}.${a}'?`)}return i}function mPe(e,t,r){let i=e.options||{},n=ce({},i);return gPe(n,r),n.log===null&&(n.log=new pP),nJ(n,Po()),nJ(n,t),n}function nJ(e,t){for(let r in t)if(r in t){let i=t[r];lP(i)&&lP(e[r])?e[r]=ce(ce({},e[r]),t[r]):e[r]=t[r]}}function gPe(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function Hy(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function yP(e){zt(e,"null loader"),zt(Hy(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e=_t(ce({},e),{options:ce(ce({},e.options),t)})),((e==null?void 0:e.parseTextSync)||(e==null?void 0:e.parseText))&&(e.text=!0),e.text||(e.binary=!0),e}var vPe=()=>{let e=vP();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function aJ(){return vPe()}var oJ=new nc({id:"loaders.gl"});var yPe=/\.([^.]+)$/;async function sJ(e,t=[],r,i){if(!lJ(e))return null;let n=uJ(e,t,_t(ce({},r),{nothrow:!0}),i);if(n)return n;if(ss(e)&&(e=await e.slice(0,10).arrayBuffer(),n=uJ(e,t,r,i)),!n&&!(r==null?void 0:r.nothrow))throw new Error(cJ(e));return n}function uJ(e,t=[],r,i){if(!lJ(e))return null;if(t&&!Array.isArray(t))return yP(t);let n=[];t&&(n=n.concat(t)),(r==null?void 0:r.ignoreRegisteredLoaders)||n.push(...aJ()),_Pe(n);let a=bPe(e,n,r,i);if(!a&&!(r==null?void 0:r.nothrow))throw new Error(cJ(e));return a}function bPe(e,t,r,i){let n=wd(e),a=zy(e),o=Ym(n)||(i==null?void 0:i.url),s=null,u="";return(r==null?void 0:r.mimeType)&&(s=bP(t,r==null?void 0:r.mimeType),u=`match forced by supplied MIME type ${r==null?void 0:r.mimeType}`),s=s||xPe(t,o),u=u||(s?`matched url ${o}`:""),s=s||bP(t,a),u=u||(s?`matched MIME type ${a}`:""),s=s||EPe(t,e),u=u||(s?`matched initial data ${hJ(e)}`:""),s=s||bP(t,r==null?void 0:r.fallbackMimeType),u=u||(s?`matched fallback MIME type ${a}`:""),u&&oJ.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${u}.`),s}function lJ(e){return!(e instanceof Response&&e.status===204)}function cJ(e){let t=wd(e),r=zy(e),i="No valid loader found (";i+=t?`${au.filename(t)}, `:"no url provided, ",i+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let n=e?hJ(e):"";return i+=n?` first bytes: "${n}"`:"first bytes: not available",i+=")",i}function _Pe(e){for(let t of e)yP(t)}function xPe(e,t){let r=t&&yPe.exec(t),i=r&&r[1];return i?wPe(e,i):null}function wPe(e,t){t=t.toLowerCase();for(let r of e)for(let i of r.extensions)if(i.toLowerCase()===t)return r;return null}function bP(e,t){for(let r of e)if(r.mimeTypes&&r.mimeTypes.includes(t)||t===`application/x.${r.id}`)return r;return null}function EPe(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(SPe(t,r))return r}else if(ArrayBuffer.isView(t)){if(fJ(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&fJ(t,0,r))return r;return null}function SPe(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(i=>e.startsWith(i))}function fJ(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(n=>APe(e,t,r,n))}function APe(e,t,r,i){if(i instanceof ArrayBuffer)return QO(i,e,i.byteLength);switch(typeof i){case"function":return i(e,r);case"string":let n=_P(e,t,i.length);return i===n;default:return!1}}function hJ(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?_P(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?_P(e,0,t):""}function _P(e,t,r){if(e.byteLength<t+r)return"";let i=new DataView(e),n="";for(let a=0;a<r;a++)n+=String.fromCharCode(i.getUint8(t+a));return n}var TPe=256*1024;function*dJ(e,t){let r=(t==null?void 0:t.chunkSize)||TPe,i=0,n=new TextEncoder;for(;i<e.length;){let a=Math.min(e.length-i,r),o=e.slice(i,i+a);i+=a,yield n.encode(o)}}var kPe=256*1024;function*pJ(e,t={}){let{chunkSize:r=kPe}=t,i=0;for(;i<e.byteLength;){let n=Math.min(e.byteLength-i,r),a=new ArrayBuffer(n),o=new Uint8Array(e,i,n);new Uint8Array(a).set(o),i+=n,yield a}}var RPe=1024*1024;async function*mJ(e,t){let r=(t==null?void 0:t.chunkSize)||RPe,i=0;for(;i<e.size;){let n=i+r,a=await e.slice(i,n).arrayBuffer();i=n,yield a}}function xP(e,t){return ji?CPe(e,t):IPe(e,t)}async function*CPe(e,t){let r=e.getReader(),i;try{for(;;){let n=i||r.read();(t==null?void 0:t._streamReadAhead)&&(i=r.read());let{done:a,value:o}=await n;if(a)return;yield AE(o)}}catch{r.releaseLock()}}async function*IPe(e,t){for await(let r of e)yield AE(r)}function gJ(e,t){if(typeof e=="string")return dJ(e,t);if(e instanceof ArrayBuffer)return pJ(e,t);if(ss(e))return mJ(e,t);if(kE(e))return xP(e,t);if(os(e))return xP(e.body,t);throw new Error("makeIterator")}var vJ="Cannot convert supplied data type";function OPe(e,t,r){if(t.text&&typeof e=="string")return e;if(NX(e)&&(e=e.buffer),e instanceof ArrayBuffer){let i=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);let i=e.buffer,n=e.byteLength||e.length;return(e.byteOffset!==0||n!==i.byteLength)&&(i=i.slice(e.byteOffset,e.byteOffset+n)),i}throw new Error(vJ)}async function yJ(e,t,r){let i=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||i)return OPe(e,t,r);if(ss(e)&&(e=await RE(e)),os(e)){let n=e;return await HX(n),t.binary?await n.arrayBuffer():await n.text()}if(kE(e)&&(e=gJ(e,r)),jX(e)||LX(e))return eP(e);throw new Error(vJ)}function PE(e,t){let r=Po(),i=e||r;return typeof i.fetch=="function"?i.fetch:xd(i.fetch)?n=>na(n,i):(t==null?void 0:t.fetch)?t==null?void 0:t.fetch:na}function bJ(e,t,r){if(r)return r;let i=ce({fetch:PE(t,e)},e);if(i.url){let n=Ym(i.url);i.baseUrl=n,i.queryString=GX(i.url),i.filename=au.filename(n),i.baseUrl=au.dirname(n)}return Array.isArray(i.loaders)||(i.loaders=null),i}function _J(e,t){if(!t&&e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){let i=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...i]:i}return r&&r.length?r:null}async function rl(e,t,r,i){ia(!i||typeof i=="object"),t&&!Array.isArray(t)&&!Hy(t)&&(i=void 0,r=t,t=void 0),e=await e,r=r||{};let n=wd(e),o=_J(t,i),s=await sJ(e,o,r);return s?(r=rJ(r,s,o,n),i=bJ({url:n,parse:rl,loaders:o},r,i||null),await PPe(s,e,r,i)):null}async function PPe(e,t,r,i){if(zO(e),os(t)){let n=t,{ok:a,redirected:o,status:s,statusText:u,type:l,url:c}=n,f=Object.fromEntries(n.headers.entries());i.response={headers:f,ok:a,redirected:o,status:s,statusText:u,type:l,url:c}}if(t=await yJ(t,e,r),e.parseTextSync&&typeof t=="string")return r.dataType="text",e.parseTextSync(t,r,i,e);if(YO(e,r))return await $O(e,t,r,i,rl);if(e.parseText&&typeof t=="string")return await e.parseText(t,r,i,e);if(e.parse)return await e.parse(t,r,i,e);throw ia(!e.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}async function ci(e,t,r,i){!Array.isArray(t)&&!Hy(t)&&(i=void 0,r=t,t=void 0);let n=PE(r),a=e;return typeof e=="string"&&(a=await n(e)),ss(e)&&(a=await n(e)),await rl(a,t,r)}async function Qm(e,t,r){let i=Po();if(r=ce(ce({},i),r),XO(t,r))return await jy(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 n=xJ(e,t,r),a=[];for await(let o of n)a.push(o);return tl(...a)}if(!ji&&t.encodeURLtoURL){let n=EJ("input");await VX(n,e);let a=EJ("output"),o=await wJ(n,a,t,r);return(await na(o)).arrayBuffer()}throw new Error("Writer could not encode data")}function xJ(e,t,r){if(t.encodeInBatches){let i=BPe(e);return t.encodeInBatches(i,r)}throw new Error("Writer could not encode data in batches")}async function wJ(e,t,r,i){if(e=Lf(e),t=Lf(t),ji||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,i)}function BPe(e){return[{table:e,start:0,end:e.length}]}function EJ(e){return`/tmp/${e}`}var du=Le(Tr()),_g=Le(Ya());function hb(){let e;if(typeof window!="undefined"&&window.performance)e=window.performance.now();else if(typeof process!="undefined"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var dg=class{constructor(t,r){Vt(this,"name",void 0),Vt(this,"type",void 0),Vt(this,"sampleSize",1),Vt(this,"time",0),Vt(this,"count",0),Vt(this,"samples",0),Vt(this,"lastTiming",0),Vt(this,"lastSampleTime",0),Vt(this,"lastSampleCount",0),Vt(this,"_count",0),Vt(this,"_time",0),Vt(this,"_samples",0),Vt(this,"_startTime",0),Vt(this,"_timerPending",!1),this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=hb(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(hb()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var db=class{constructor(t){Vt(this,"id",void 0),Vt(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:i}=t,n=this.stats[r];return n||(t instanceof dg?n=t:n=new dg(r,i),this.stats[r]=n),n}};var sB=class{constructor(t,r,i){this.item=t,this.previous=r,this.next=i}};var uB=class{constructor(){this.head=null;this.tail=null;this._length=0}get length(){return this._length}add(t){let r=new sB(t,this.tail,null);return this.tail?(this.tail.next=r,this.tail=r):(this.head=r,this.tail=r),++this._length,r}remove(t){!t||(t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=null,this.tail=t.previous):t.next?(t.next.previous=null,this.head=t.next):(this.head=null,this.tail=null),t.next=null,t.previous=null,--this._length)}splice(t,r){t!==r&&(this.remove(r),this._insert(t,r))}_insert(t,r){let i=t.next;t.next=r,this.tail===t?this.tail=r:i.previous=r,r.next=i,r.previous=t,++this._length}};var lB=class{constructor(){this._list=new uB,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}reset(){this._list.splice(this._list.tail,this._sentinel)}touch(t){let r=t._cacheNode;r&&this._list.splice(this._sentinel,r)}add(t,r,i){r._cacheNode||(r._cacheNode=this._list.add(r),i&&i(t,r))}unloadTile(t,r,i){let n=r._cacheNode;!n||(this._list.remove(n),r._cacheNode=null,i&&i(t,r))}unloadTiles(t,r){let i=this._trimTiles;this._trimTiles=!1;let n=this._list,a=t.maximumMemoryUsage*1024*1024,o=this._sentinel,s=n.head;for(;s!==o&&(t.gpuMemoryUsageInBytes>a||i);){let u=s.item;s=s.next,this.unloadTile(t,u,r)}}trim(){this._trimTiles=!0}};var cB=Le(Ya()),Bd=Le(Tr());function BZ(e,t){zt(e),zt(t);let{rtcCenter:r,gltfUpAxis:i}=t,{computedTransform:n,boundingVolume:{center:a}}=e,o=new Bd.Matrix4(n);switch(r&&o.translate(r),i){case"Z":break;case"Y":let f=new Bd.Matrix4().rotateX(Math.PI/2);o=o.multiplyRight(f);break;case"X":let h=new Bd.Matrix4().rotateY(-Math.PI/2);o=o.multiplyRight(h);break;default:break}t.isQuantized&&o.translate(t.quantizedVolumeOffset).scale(t.quantizedVolumeScale);let s=new Bd.Vector3(a);t.cartesianModelMatrix=o,t.cartesianOrigin=s;let u=cB.Ellipsoid.WGS84.cartesianToCartographic(s,new Bd.Vector3),c=cB.Ellipsoid.WGS84.eastNorthUpToFixedFrame(s).invert();t.cartographicModelMatrix=c.multiplyRight(o),t.cartographicOrigin=u,t.coordinateSystem||(t.modelMatrix=t.cartographicModelMatrix)}var fl=Le(Tr()),gc=Le(cl()),HS=Le(Ya()),nee=new fl.Vector3,RB=new fl.Vector3,CB=new gc.CullingVolume([new gc.Plane,new gc.Plane,new gc.Plane,new gc.Plane,new gc.Plane,new gc.Plane]);function aee(e,t){let{cameraDirection:r,cameraUp:i,height:n}=e,{metersPerUnit:a}=e.distanceScales,o=VS(e,e.center),s=HS.Ellipsoid.WGS84.eastNorthUpToFixedFrame(o),u=e.unprojectPosition(e.cameraPosition),l=HS.Ellipsoid.WGS84.cartographicToCartesian(u,new fl.Vector3),c=new fl.Vector3(s.transformAsVector(new fl.Vector3(r).scale(a))).normalize(),f=new fl.Vector3(s.transformAsVector(new fl.Vector3(i).scale(a))).normalize();_5e(e);let h=e.constructor,{longitude:d,latitude:p,width:y,bearing:g,zoom:b}=e,E=new h({longitude:d,latitude:p,height:n,width:y,bearing:g,zoom:b,pitch:0});return{camera:{position:l,direction:c,up:f},viewport:e,topDownViewport:E,height:n,cullingVolume:CB,frameNumber:t,sseDenominator:1.15}}function oee(e,t,r){if(r===0||e.length<=r)return[e,[]];let i=[],{longitude:n,latitude:a}=t.viewport;for(let[l,c]of e.entries()){let[f,h]=c.header.mbs,d=Math.abs(n-f),p=Math.abs(a-h),y=Math.sqrt(p*p+d*d);i.push([l,y])}let o=i.sort((l,c)=>l[1]-c[1]),s=[];for(let l=0;l<r;l++)s.push(e[o[l][0]]);let u=[];for(let l=r;l<o.length;l++)u.push(e[o[l][0]]);return[s,u]}function _5e(e){let t=e.getFrustumPlanes(),r=see(t.near,e.cameraPosition),i=VS(e,r),n=VS(e,e.cameraPosition,RB),a=0;CB.planes[a++].fromPointNormal(i,nee.copy(i).subtract(n));for(let o in t){if(o==="near")continue;let s=t[o],u=see(s,r,RB),l=VS(e,u,RB);CB.planes[a++].fromPointNormal(l,nee.copy(i).subtract(l))}}function see(e,t,r=new fl.Vector3){let i=e.normal.dot(t);return r.copy(e.normal).scale(e.distance-i).add(t),r}function VS(e,t,r=new fl.Vector3){let i=e.unprojectPosition(t);return HS.Ellipsoid.WGS84.cartographicToCartesian(i,r)}var IB=Le(Tr()),WS=Le(cl()),uee=Le(Ya()),x5e=6378137,w5e=6378137,OB=6356752314245179e-9,lee=new IB.Vector3;function cee(e,t){if(e instanceof WS.OrientedBoundingBox){let{halfAxes:r}=e,i=E5e(r);return Math.log2(OB/(i+t[2]))}else if(e instanceof WS.BoundingSphere){let{radius:r}=e;return Math.log2(OB/(r+t[2]))}else if(e.width&&e.height){let{width:r,height:i}=e,n=Math.log2(x5e/r),a=Math.log2(w5e/i);return(n+a)/2}return 1}function PB(e,t,r){let i=uee.Ellipsoid.WGS84.cartographicToCartesian([e.xmax,e.ymax,e.zmax],new IB.Vector3),n=Math.sqrt(Math.pow(i[0]-r[0],2)+Math.pow(i[1]-r[1],2)+Math.pow(i[2]-r[2],2));return Math.log2(OB/(n+t[2]))}function fee(e,t,r){let[i,n,a,o]=e;return PB({xmin:i,xmax:a,ymin:n,ymax:o,zmin:0,zmax:0},t,r)}function E5e(e){e.getColumn(0,lee);let t=e.getColumn(1),r=e.getColumn(2);return lee.add(t).add(r).len()}var hu=Le(Tr()),QS=Le(cl());var Ja={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Ba={ADD:1,REPLACE:2},Fd={EMPTY:"empty",SCENEGRAPH:"scenegraph",POINTCLOUD:"pointcloud",MESH:"mesh"},aa={I3S:"I3S",TILES3D:"TILES3D"},jd={GEOMETRIC_ERROR:"geometricError",MAX_SCREEN_THRESHOLD:"maxScreenThreshold"},hee={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};var Lr=Le(Tr()),KS=Le(cl()),bg=Le(Ya());function dee(e){return e!=null}var Ma=new Lr.Vector3,YS=new Lr.Vector3,S5e=new Lr.Vector3,A5e=new Lr.Vector3;function $S(e,t,r){if(zt(e,"3D Tile: boundingVolume must be defined"),e.box)return T5e(e.box,t,r);if(e.region){let[i,n,a,o,s,u]=e.region,l=bg.Ellipsoid.WGS84.cartographicToCartesian([(0,Lr.degrees)(i),(0,Lr.degrees)(o),s],S5e),c=bg.Ellipsoid.WGS84.cartographicToCartesian([(0,Lr.degrees)(a),(0,Lr.degrees)(n),u],A5e),f=new Lr.Vector3().addVectors(l,c).multiplyScalar(.5),h=new Lr.Vector3().subVectors(l,c).len()/2;return mee([f[0],f[1],f[2],h],new Lr.Matrix4)}if(e.sphere)return mee(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function pee(e,t){if(e.box)return k5e(t);if(e.region){let[r,i,n,a,o,s]=e.region;return[[(0,Lr.degrees)(r),(0,Lr.degrees)(i),o],[(0,Lr.degrees)(n),(0,Lr.degrees)(a),s]]}if(e.sphere)return R5e(t);throw new Error("Unkown boundingVolume type")}function T5e(e,t,r){let i=new Lr.Vector3(e[0],e[1],e[2]);t.transform(i,i);let n=[];if(e.length===10){let l=e.slice(3,6),c=new Lr.Quaternion;c.fromArray(e,6);let f=new Lr.Vector3([1,0,0]),h=new Lr.Vector3([0,1,0]),d=new Lr.Vector3([0,0,1]);f.transformByQuaternion(c),f.scale(l[0]),h.transformByQuaternion(c),h.scale(l[1]),d.transformByQuaternion(c),d.scale(l[2]),n=[...f.toArray(),...h.toArray(),...d.toArray()]}else n=[...e.slice(3,6),...e.slice(6,9),...e.slice(9,12)];let a=t.transformAsVector(n.slice(0,3)),o=t.transformAsVector(n.slice(3,6)),s=t.transformAsVector(n.slice(6,9)),u=new Lr.Matrix3([a[0],a[1],a[2],o[0],o[1],o[2],s[0],s[1],s[2]]);return dee(r)?(r.center=i,r.halfAxes=u,r):new KS.OrientedBoundingBox(i,u)}function mee(e,t,r){let i=new Lr.Vector3(e[0],e[1],e[2]);t.transform(i,i);let n=t.getScale(YS),a=Math.max(Math.max(n[0],n[1]),n[2]),o=e[3]*a;return dee(r)?(r.center=i,r.radius=o,r):new KS.BoundingSphere(i,o)}function k5e(e){let t=gee(),{halfAxes:r}=e,i=new Lr.Vector3(r.getColumn(0)),n=new Lr.Vector3(r.getColumn(1)),a=new Lr.Vector3(r.getColumn(2));for(let o=0;o<2;o++){for(let s=0;s<2;s++){for(let u=0;u<2;u++)Ma.copy(e.center),Ma.add(i),Ma.add(n),Ma.add(a),vee(t,Ma),a.negate();n.negate()}i.negate()}return t}function R5e(e){let t=gee(),{center:r,radius:i}=e,n=bg.Ellipsoid.WGS84.scaleToGeodeticSurface(r,Ma),a;n?a=bg.Ellipsoid.WGS84.geodeticSurfaceNormal(n):a=new Lr.Vector3(0,0,1);let o=new Lr.Vector3(a[2],-a[1],0);o.len()>0?o.normalize():o=new Lr.Vector3(0,1,0);let s=o.clone().cross(a);for(let u of[o,s,a]){YS.copy(u).scale(i);for(let l=0;l<2;l++)Ma.copy(r),Ma.add(YS),vee(t,Ma),YS.negate()}return t}function gee(){return[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]]}function vee(e,t){bg.Ellipsoid.WGS84.cartesianToCartographic(t,Ma),e[0][0]=Math.min(e[0][0],Ma[0]),e[0][1]=Math.min(e[0][1],Ma[1]),e[0][2]=Math.min(e[0][2],Ma[2]),e[1][0]=Math.max(e[1][0],Ma[0]),e[1][1]=Math.max(e[1][1],Ma[1]),e[1][2]=Math.max(e[1][2],Ma[2])}var vc=Le(Tr()),UEt=new vc.Vector3,GEt=new vc.Vector3,zEt=new vc.Matrix4,HEt=new vc.Vector3,VEt=new vc.Vector3,WEt=new vc.Vector3;function C5e(e,t){let r=e*t;return 1-Math.exp(-(r*r))}function I5e(e,t){if(e.dynamicScreenSpaceError&&e.dynamicScreenSpaceErrorComputedDensity){let r=e.dynamicScreenSpaceErrorComputedDensity,i=e.dynamicScreenSpaceErrorFactor;return C5e(t,r)*i}return 0}function yee(e,t,r){let i=e.tileset,n=e.parent&&e.parent.lodMetricValue||e.lodMetricValue,a=r?n:e.lodMetricValue;if(a===0)return 0;let o=Math.max(e._distanceToCamera,1e-7),{height:s,sseDenominator:u}=t,{viewDistanceScale:l}=i.options,c=a*s*(l||1)/(o*u);return c-=I5e(i,o),c}var yc=Le(Tr()),XS=Le(Ya()),BB=new yc.Vector3,bee=new yc.Vector3,Yf=new yc.Vector3,_ee=new yc.Vector3,O5e=new yc.Vector3,MB=new yc.Matrix4,xee=new yc.Matrix4;function wee(e,t){if(e.lodMetricValue===0||isNaN(e.lodMetricValue))return"DIG";let r=2*DB(e,t);return r<2?"OUT":!e.header.children||r<=e.lodMetricValue?"DRAW":e.header.children?"DIG":"OUT"}function DB(e,t){let{topDownViewport:r}=t,i=e.header.mbs[1],n=e.header.mbs[0],a=e.header.mbs[2],o=e.header.mbs[3],s=[...e.boundingVolume.center],u=r.unprojectPosition(r.cameraPosition);XS.Ellipsoid.WGS84.cartographicToCartesian(u,BB),bee.copy(BB).subtract(s).normalize(),XS.Ellipsoid.WGS84.eastNorthUpToFixedFrame(s,MB),xee.copy(MB).invert(),Yf.copy(BB).transform(xee);let l=Math.sqrt(Yf[0]*Yf[0]+Yf[1]*Yf[1]),c=l*l/Yf[2];_ee.copy([Yf[0],Yf[1],c]);let h=_ee.transform(MB).subtract(s).normalize(),p=bee.cross(h).normalize().scale(o).add(s),y=XS.Ellipsoid.WGS84.cartesianToCartographic(p),g=r.project([n,i,a]),b=r.project(y);return O5e.copy(g).subtract(b).magnitude()}function Eee(e){return{assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}}var JS=class{constructor(t=0){this._map=new Map;this._array=new Array(t),this._length=t}get length(){return this._length}set length(t){this._length=t,t>this._array.length&&(this._array.length=t)}get values(){return this._array}get(t){return zt(t<this._array.length),this._array[t]}set(t,r){zt(t>=0),t>=this.length&&(this.length=t+1),this._map.has(this._array[t])&&this._map.delete(this._array[t]),this._array[t]=r,this._map.set(r,t)}delete(t){let r=this._map.get(t);r>=0&&(this._array.splice(r,1),this._map.delete(t),this.length--)}peek(){return this._array[this._length-1]}push(t){if(!this._map.has(t)){let r=this.length++;this._array[r]=t,this._map.set(t,r)}}pop(){let t=this._array[--this.length];return this._map.delete(t),t}reserve(t){zt(t>=0),t>this._array.length&&(this._array.length=t)}resize(t){zt(t>=0),this.length=t}trim(t){t==null&&(t=this.length),this._array.length=t}reset(){this._array=[],this._map=new Map,this._length=0}find(t){return this._map.has(t)}};var P5e={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:""},bc=class{constructor(t){this.root=null;this.selectedTiles={};this.requestedTiles={};this.emptyTiles={};this.lastUpdate=new Date().getTime();this.updateDebounceTime=1e3;this._traversalStack=new JS;this._emptyTraversalStack=new JS;this._frameNumber=null;this.options=ce(ce({},P5e),t)}traversalFinished(t){return!0}traverse(t,r,i){this.root=t,this.options=ce(ce({},this.options),i),this.reset(),this.updateTile(t,r),this._frameNumber=r.frameNumber,this.executeTraversal(t,r)}reset(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}executeTraversal(t,r){let i=this._traversalStack;for(t._selectionDepth=1,i.push(t);i.length>0;){let a=i.pop(),o=!1;this.canTraverse(a,r)&&(this.updateChildTiles(a,r),o=this.updateAndPushChildren(a,r,i,a.hasRenderContent?a._selectionDepth+1:a._selectionDepth));let s=a.parent,u=Boolean(!s||s._shouldRefine),l=!o;a.hasRenderContent?a.refine===Ba.ADD?(this.loadTile(a,r),this.selectTile(a,r)):a.refine===Ba.REPLACE&&(this.loadTile(a,r),l&&this.selectTile(a,r)):(this.emptyTiles[a.id]=a,this.loadTile(a,r),l&&this.selectTile(a,r)),this.touchTile(a,r),a._shouldRefine=o&&u}let n=new Date().getTime();(this.traversalFinished(r)||n-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=n,this.options.onTraversalEnd(r))}updateChildTiles(t,r){let i=t.children;for(let n of i)this.updateTile(n,r)}updateAndPushChildren(t,r,i,n){let{loadSiblings:a,skipLevelOfDetail:o}=this.options,s=t.children;s.sort(this.compareDistanceToCamera.bind(this));let u=t.refine===Ba.REPLACE&&t.hasRenderContent&&!o,l=!1,c=!0;for(let f of s)if(f._selectionDepth=n,f.isVisibleAndInRequestVolume?(i.find(f)&&i.delete(f),i.push(f),l=!0):(u||a)&&(this.loadTile(f,r),this.touchTile(f,r)),u){let h;if(f._inRequestVolume?f.hasRenderContent?h=f.contentAvailable:h=this.executeEmptyTraversal(f,r):h=!1,c=c&&h,!c)return!1}return l||(c=!1),c}updateTile(t,r){this.updateTileVisibility(t,r)}selectTile(t,r){this.shouldSelectTile(t)&&(t._selectedFrame=r.frameNumber,this.selectedTiles[t.id]=t)}loadTile(t,r){this.shouldLoadTile(t)&&(t._requestedFrame=r.frameNumber,t._priority=t._getPriority(),this.requestedTiles[t.id]=t)}touchTile(t,r){t.tileset._cache.touch(t),t._touchedFrame=r.frameNumber}canTraverse(t,r,i=!1,n=!1){return t.hasChildren?t.hasTilesetContent?!t.contentExpired:!n&&!t.isVisibleAndInRequestVolume?!1:this.shouldRefine(t,r,i):!1}shouldLoadTile(t){return t.hasUnloadedContent||t.contentExpired}shouldSelectTile(t){return t.contentAvailable&&!this.options.skipLevelOfDetail}shouldRefine(t,r,i=!1){let n=t._screenSpaceError;return i&&(n=t.getScreenSpaceError(r,!0)),n>this.options.maximumScreenSpaceError}updateTileVisibility(t,r){let i=[];if(this.options.viewportTraversersMap)for(let n in this.options.viewportTraversersMap)this.options.viewportTraversersMap[n]===r.viewport.id&&i.push(n);else i.push(r.viewport.id);t.updateVisibility(r,i)}compareDistanceToCamera(t,r){return t._distanceToCamera-r._distanceToCamera}anyChildrenVisible(t,r){let i=!1;for(let n of t.children)n.updateVisibility(r),i=i||n.isVisibleAndInRequestVolume;return i}executeEmptyTraversal(t,r){let i=!0,n=this._emptyTraversalStack;for(n.push(t);n.length>0&&i;){let a=n.pop();if(this.updateTile(a,r),a.isVisibleAndInRequestVolume||this.loadTile(a,r),this.touchTile(a,r),!a.hasRenderContent&&this.canTraverse(a,r,!1,!0)){let s=a.children;for(let u of s)n.find(u)&&n.delete(u),n.push(u)}else a.contentAvailable||(i=!1)}return i}};var See=new hu.Vector3;function B5e(e){return e!=null}var _c=class{constructor(t,r,i,n=""){this.lodMetricType="geometricError";this.lodMetricValue=0;this.boundingVolume=null;this.content=null;this.contentState=Ja.UNLOADED;this.gpuMemoryUsageInBytes=0;this.children=[];this.depth=0;this.viewportIds=[];this.transform=new hu.Matrix4;this.extensions=null;this.implicitTiling=null;this.userData={};this.hasEmptyContent=!1;this.hasTilesetContent=!1;this.traverser=new bc({});this._cacheNode=null;this._frameNumber=null;this._expireDate=null;this._expiredContent=null;this._distanceToCamera=0;this._screenSpaceError=0;this._visible=void 0;this._initialTransform=new hu.Matrix4;this._priority=0;this._selectedFrame=0;this._requestedFrame=0;this._selectionDepth=0;this._touchedFrame=0;this._centerZDepth=0;this._shouldRefine=!1;this._stackLength=0;this._visitedFrame=0;this._inRequestVolume=!1;this._lodJudge=null;this.header=r,this.tileset=t,this.id=n||r.id,this.url=r.url,this.parent=i,this.refine=this._getRefine(r.refine),this.type=r.type,this.contentUrl=r.contentUrl,this._initializeLodMetric(r),this._initializeTransforms(r),this._initializeBoundingVolumes(r),this._initializeContent(r),this._initializeRenderingState(r),Object.seal(this)}destroy(){this.header=null}isDestroyed(){return this.header===null}get selected(){return this._selectedFrame===this.tileset._frameNumber}get isVisible(){return this._visible}get isVisibleAndInRequestVolume(){return this._visible&&this._inRequestVolume}get hasRenderContent(){return!this.hasEmptyContent&&!this.hasTilesetContent}get hasChildren(){return this.children.length>0||this.header.children&&this.header.children.length>0}get contentReady(){return this.contentState===Ja.READY||this.hasEmptyContent}get contentAvailable(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}get hasUnloadedContent(){return this.hasRenderContent&&this.contentUnloaded}get contentUnloaded(){return this.contentState===Ja.UNLOADED}get contentExpired(){return this.contentState===Ja.EXPIRED}get contentFailed(){return this.contentState===Ja.FAILED}get distanceToCamera(){return this._distanceToCamera}get screenSpaceError(){return this._screenSpaceError}get boundingBox(){return this._boundingBox||(this._boundingBox=pee(this.header.boundingVolume,this.boundingVolume)),this._boundingBox}getScreenSpaceError(t,r){switch(this.tileset.type){case aa.I3S:return DB(this,t);case aa.TILES3D:return yee(this,t,r);default:throw new Error("Unsupported tileset type")}}unselect(){this._selectedFrame=0}_getGpuMemoryUsageInBytes(){return this.content.gpuMemoryUsageInBytes||this.content.byteLength||0}_getPriority(){let t=this.tileset._traverser,{skipLevelOfDetail:r}=t.options,i=this.refine===Ba.ADD||r;if(i&&!this.isVisible&&this._visible!==void 0||this.tileset._frameNumber-this._touchedFrame>=1||this.contentState===Ja.UNLOADED)return-1;let n=this.parent,o=n&&(!i||this._screenSpaceError===0||n.hasTilesetContent)?n._screenSpaceError:this._screenSpaceError,s=t.root?t.root._screenSpaceError:0;return Math.max(s-o,0)}async loadContent(){if(this.hasEmptyContent)return!1;if(this.content)return!0;this.contentExpired&&(this._expireDate=null),this.contentState=Ja.LOADING;let r=await this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));if(!r)return this.contentState=Ja.UNLOADED,!1;try{let i=this.tileset.getTileUrl(this.contentUrl),n=this.tileset.loader,a=_t(ce({},this.tileset.loadOptions),{[n.id]:ce(_t(ce({},this.tileset.loadOptions[n.id]),{isTileset:this.type==="json"}),this._getLoaderSpecificOptions(n.id))});return this.content=await ci(i,n,a),this.tileset.options.contentLoader&&await this.tileset.options.contentLoader(this),this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=Ja.READY,this._onContentLoaded(),!0}catch(i){throw this.contentState=Ja.FAILED,i}finally{r.done()}}unloadContent(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=Ja.UNLOADED,!0}updateVisibility(t,r){if(this._frameNumber===t.frameNumber)return;let i=this.parent,n=i?i._visibilityPlaneMask:QS.CullingVolume.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){let a=i?i.computedTransform:this.tileset.modelMatrix;this._updateTransform(a)}this._distanceToCamera=this.distanceToTile(t),this._screenSpaceError=this.getScreenSpaceError(t,!1),this._visibilityPlaneMask=this.visibility(t,n),this._visible=this._visibilityPlaneMask!==QS.CullingVolume.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(t),this._frameNumber=t.frameNumber,this.viewportIds=r}visibility(t,r){let{cullingVolume:i}=t,{boundingVolume:n}=this;return i.computeVisibilityWithPlaneMask(n,r)}contentVisibility(){return!0}distanceToTile(t){let r=this.boundingVolume;return Math.sqrt(Math.max(r.distanceSquaredTo(t.camera.position),0))}cameraSpaceZDepth({camera:t}){let r=this.boundingVolume;return See.subVectors(r.center,t.position),t.direction.dot(See)}insideViewerRequestVolume(t){let r=this._viewerRequestVolume;return!r||r.distanceSquaredTo(t.camera.position)<=0}updateExpiration(){if(B5e(this._expireDate)&&this.contentReady&&!this.hasEmptyContent){let t=Date.now();Date.lessThan(this._expireDate,t)&&(this.contentState=Ja.EXPIRED,this._expiredContent=this.content)}}get extras(){return this.header.extras}_initializeLodMetric(t){"lodMetricType"in t?this.lodMetricType=t.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in t?this.lodMetricValue=t.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}_initializeTransforms(t){this.transform=t.transform?new hu.Matrix4(t.transform):new hu.Matrix4;let r=this.parent,i=this.tileset,n=r&&r.computedTransform?r.computedTransform.clone():i.modelMatrix.clone();this.computedTransform=new hu.Matrix4(n).multiplyRight(this.transform);let a=r&&r._initialTransform?r._initialTransform.clone():new hu.Matrix4;this._initialTransform=new hu.Matrix4(a).multiplyRight(this.transform)}_initializeBoundingVolumes(t){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(t)}_initializeContent(t){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=Ja.UNLOADED,this.hasTilesetContent=!1,t.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}_initializeRenderingState(t){this.depth=t.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=QS.CullingVolume.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}_getRefine(t){return t||this.parent&&this.parent.refine||Ba.REPLACE}_isTileset(){return this.contentUrl.indexOf(".json")!==-1}_onContentLoaded(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0;break;default:}this._isTileset()?this.hasTilesetContent=!0:this.gpuMemoryUsageInBytes=this._getGpuMemoryUsageInBytes()}_updateBoundingVolume(t){this.boundingVolume=$S(t.boundingVolume,this.computedTransform,this.boundingVolume);let r=t.content;!r||(r.boundingVolume&&(this._contentBoundingVolume=$S(r.boundingVolume,this.computedTransform,this._contentBoundingVolume)),t.viewerRequestVolume&&(this._viewerRequestVolume=$S(t.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}_updateTransform(t=new hu.Matrix4){let r=t.clone().multiplyRight(this.transform);r.equals(this.computedTransform)||(this.computedTransform=r,this._updateBoundingVolume(this.header))}_getLoaderSpecificOptions(t){switch(t){case"i3s":return _t(ce({},this.tileset.options.i3s),{_tileOptions:{attributeUrls:this.header.attributeUrls,textureUrl:this.header.textureUrl,textureFormat:this.header.textureFormat,textureLoaderOptions:this.header.textureLoaderOptions,materialDefinition:this.header.materialDefinition,isDracoGeometry:this.header.isDracoGeometry,mbs:this.header.mbs},_tilesetOptions:{store:this.tileset.tileset.store,attributeStorageInfo:this.tileset.tileset.attributeStorageInfo,fields:this.tileset.tileset.fields},isTileHeader:!1});case"3d-tiles":case"cesium-ion":default:return Eee(this.tileset.tileset)}}};var FB=class extends bc{compareDistanceToCamera(t,r){return r._distanceToCamera===0&&t._distanceToCamera===0?r._centerZDepth-t._centerZDepth:r._distanceToCamera-t._distanceToCamera}updateTileVisibility(t,r){if(super.updateTileVisibility(t,r),!t.isVisibleAndInRequestVolume)return;let i=t.children.length>0;if(t.hasTilesetContent&&i){let o=t.children[0];this.updateTileVisibility(o,r),t._visible=o._visible;return}if(this.meetsScreenSpaceErrorEarly(t,r)){t._visible=!1;return}let n=t.refine===Ba.REPLACE,a=t._optimChildrenWithinParent===hee.USE_OPTIMIZATION;if(n&&a&&i&&!this.anyChildrenVisible(t,r)){t._visible=!1;return}}meetsScreenSpaceErrorEarly(t,r){let{parent:i}=t;return!i||i.hasTilesetContent||i.refine!==Ba.ADD?!1:!this.shouldRefine(t,r,!0)}};var jB=class{constructor(){this.frameNumberMap=new Map}register(t,r){let i=this.frameNumberMap.get(t)||new Map,n=i.get(r)||0;i.set(r,n+1),this.frameNumberMap.set(t,i)}deregister(t,r){let i=this.frameNumberMap.get(t);if(!i)return;let n=i.get(r)||1;i.set(r,n-1)}isZero(t,r){var n;return(((n=this.frameNumberMap.get(t))==null?void 0:n.get(r))||0)===0}};var LB={REQUESTED:"REQUESTED",COMPLETED:"COMPLETED",ERROR:"ERROR"},NB=class{constructor(){this.pendingTilesRegister=new jB;this._statusMap={}}add(t,r,i,n){if(!this._statusMap[r]){let{frameNumber:a,viewport:{id:o}}=n;this._statusMap[r]={request:t,callback:i,key:r,frameState:n,status:LB.REQUESTED},this.pendingTilesRegister.register(o,a),t().then(s=>{this._statusMap[r].status=LB.COMPLETED;let{frameNumber:u,viewport:{id:l}}=this._statusMap[r].frameState;this.pendingTilesRegister.deregister(l,u),this._statusMap[r].callback(s,n)}).catch(s=>{this._statusMap[r].status=LB.ERROR;let{frameNumber:u,viewport:{id:l}}=this._statusMap[r].frameState;this.pendingTilesRegister.deregister(l,u),i(s)})}}update(t,r){if(this._statusMap[t]){let{frameNumber:i,viewport:{id:n}}=this._statusMap[t].frameState;this.pendingTilesRegister.deregister(n,i);let{frameNumber:a,viewport:{id:o}}=r;this.pendingTilesRegister.register(o,a),this._statusMap[t].frameState=r}}find(t){return this._statusMap[t]}hasPendingTiles(t,r){return!this.pendingTilesRegister.isZero(t,r)}};var qB=class extends bc{constructor(t){super(t);this._tileManager=new NB}traversalFinished(t){return!this._tileManager.hasPendingTiles(t.viewport.id,this._frameNumber||0)}shouldRefine(t,r){return t._lodJudge=wee(t,r),t._lodJudge==="DIG"}updateChildTiles(t,r){let i=t.header.children||[],n=t.children,a=t.tileset;for(let o of i){let s=`${o.id}-${r.viewport.id}`,u=n&&n.find(l=>l.id===s);if(u)u&&this.updateTile(u,r);else{let l=()=>this._loadTile(o.id,a);this._tileManager.find(s)?this._tileManager.update(s,r):(a.tileset.nodePages&&(l=()=>a.tileset.nodePagesTile.formTileFromNodePages(o.id)),this._tileManager.add(l,s,f=>this._onTileLoad(f,t,s),r))}}return!1}async _loadTile(t,r){let{loader:i}=r,n=r.getTileUrl(`${r.url}/nodes/${t}`),a=_t(ce({},r.loadOptions),{i3s:_t(ce({},r.loadOptions.i3s),{isTileHeader:!0})});return await ci(n,i,a)}_onTileLoad(t,r,i){let n=new _c(r.tileset,t,r,i);r.children.push(n);let a=this._tileManager.find(n.id).frameState;this.updateTile(n,a),this._frameNumber===a.frameNumber&&(this.traversalFinished(a)||new Date().getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(n,a)}};var M5e={description:"",ellipsoid:_g.Ellipsoid.WGS84,modelMatrix:new du.Matrix4,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,maximumTilesSelected:0,debounceTime:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{},onTraversalComplete:e=>e,contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},ZS="Tiles In Tileset(s)",UB="Tiles In Memory",Aee="Tiles In View",Tee="Tiles To Render",kee="Tiles Loaded",GB="Tiles Loading",Ree="Tiles Unloaded",Cee="Failed Tile Loads",Iee="Points/Vertices",zB="Tile Memory Use",xg=class{constructor(t,r){this.root=null;this.roots={};this.asset={};this.description="";this.extras=null;this.attributions={};this.credits={};this.contentFormats={draco:!1,meshopt:!1,dds:!1,ktx2:!1};this.cartographicCenter=null;this.cartesianCenter=null;this.zoom=1;this.boundingVolume=null;this.dynamicScreenSpaceErrorComputedDensity=0;this.maximumMemoryUsage=32;this.gpuMemoryUsageInBytes=0;this._frameNumber=0;this._queryParams={};this._extensionsUsed=[];this._tiles={};this._pendingCount=0;this.selectedTiles=[];this.traverseCounter=0;this.geometricError=0;this.lastUpdatedVieports=null;this._requestedTiles=[];this._emptyTiles=[];this.frameStateData={};this._cache=new lB;this.updatePromise=null;this.options=ce(ce({},M5e),r),this.tileset=t,this.loader=t.loader,this.type=t.type,this.url=t.url,this.basePath=t.basePath||au.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=t.lodMetricType,this.lodMetricValue=t.lodMetricValue,this.refine=t.root.refine,this.loadOptions=this.options.loadOptions||{},this._traverser=this._initializeTraverser(),this._requestScheduler=new qy({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this.stats=new db({id:this.url}),this._initializeStats(),this.tilesetInitializationPromise=this._initializeTileSet(t)}destroy(){this._destroy()}isLoaded(){return this._pendingCount===0&&this._frameNumber!==0&&this._requestedTiles.length===0}get tiles(){return Object.values(this._tiles)}get frameNumber(){return this._frameNumber}get queryParams(){return new URLSearchParams(this._queryParams).toString()}setProps(t){this.options=ce(ce({},this.options),t)}setOptions(t){this.options=ce(ce({},this.options),t)}getTileUrl(t){return t.startsWith("data:")?t:`${t}${t.includes("?")?"&":"?"}${this.queryParams}`}hasExtension(t){return Boolean(this._extensionsUsed.indexOf(t)>-1)}update(t=null){this.tilesetInitializationPromise.then(()=>{!t&&this.lastUpdatedVieports?t=this.lastUpdatedVieports:this.lastUpdatedVieports=t,t&&this.doUpdate(t)})}async selectTiles(t=null){return await this.tilesetInitializationPromise,t&&(this.lastUpdatedVieports=t),this.updatePromise||(this.updatePromise=new Promise(r=>{setTimeout(()=>{this.lastUpdatedVieports&&this.doUpdate(this.lastUpdatedVieports),r(this._frameNumber),this.updatePromise=null},this.options.debounceTime)})),this.updatePromise}doUpdate(t){if("loadTiles"in this.options&&!this.options.loadTiles||this.traverseCounter>0)return;let r=t instanceof Array?t:[t];this._cache.reset(),this._frameNumber++,this.traverseCounter=r.length;let i=[];for(let n of r){let a=n.id;this._needTraverse(a)?i.push(a):this.traverseCounter--}for(let n of r){let a=n.id;if(this.roots[a]||(this.roots[a]=this._initializeTileHeaders(this.tileset,null)),!i.includes(a))continue;let o=aee(n,this._frameNumber);this._traverser.traverse(this.roots[a],o,this.options)}}_needTraverse(t){let r=t;return this.options.viewportTraversersMap&&(r=this.options.viewportTraversersMap[t]),r===t}_onTraversalEnd(t){let r=t.viewport.id;this.frameStateData[r]||(this.frameStateData[r]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});let i=this.frameStateData[r],n=Object.values(this._traverser.selectedTiles),[a,o]=oee(n,t,this.options.maximumTilesSelected);i.selectedTiles=a;for(let s of o)s.unselect();i._requestedTiles=Object.values(this._traverser.requestedTiles),i._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,!(this.traverseCounter>0)&&this._updateTiles()}_updateTiles(){this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(let t in this.frameStateData){let r=this.frameStateData[t];this.selectedTiles=this.selectedTiles.concat(r.selectedTiles),this._requestedTiles=this._requestedTiles.concat(r._requestedTiles),this._emptyTiles=this._emptyTiles.concat(r._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);for(let t of this.selectedTiles)this._tiles[t.id]=t;this._loadTiles(),this._unloadTiles(),this._updateStats()}_tilesChanged(t,r){if(t.length!==r.length)return!0;let i=new Set(t.map(o=>o.id)),n=new Set(r.map(o=>o.id)),a=t.filter(o=>!n.has(o.id)).length>0;return a=a||r.filter(o=>!i.has(o.id)).length>0,a}_loadTiles(){for(let t of this._requestedTiles)t.contentUnloaded&&this._loadTile(t)}_unloadTiles(){this._cache.unloadTiles(this,(t,r)=>t._unloadTile(r))}_updateStats(){let t=0,r=0;for(let i of this.selectedTiles)i.contentAvailable&&i.content&&(t++,i.content.pointCount?r+=i.content.pointCount:r+=i.content.vertexCount);this.stats.get(Aee).count=this.selectedTiles.length,this.stats.get(Tee).count=t,this.stats.get(Iee).count=r}async _initializeTileSet(t){this.type===aa.I3S&&(this.calculateViewPropsI3S(),t.root=await t.root),this.root=this._initializeTileHeaders(t,null),this.type===aa.TILES3D&&(this._initializeTiles3DTileset(t),this.calculateViewPropsTiles3D()),this.type===aa.I3S&&this._initializeI3STileset()}calculateViewPropsI3S(){var i;let t=this.tileset.fullExtent;if(t){let{xmin:n,xmax:a,ymin:o,ymax:s,zmin:u,zmax:l}=t;this.cartographicCenter=new du.Vector3(n+(a-n)/2,o+(s-o)/2,u+(l-u)/2),this.cartesianCenter=_g.Ellipsoid.WGS84.cartographicToCartesian(this.cartographicCenter,new du.Vector3),this.zoom=PB(t,this.cartographicCenter,this.cartesianCenter);return}let r=(i=this.tileset.store)==null?void 0:i.extent;if(r){let[n,a,o,s]=r;this.cartographicCenter=new du.Vector3(n+(o-n)/2,a+(s-a)/2,0),this.cartesianCenter=_g.Ellipsoid.WGS84.cartographicToCartesian(this.cartographicCenter,new du.Vector3),this.zoom=fee(r,this.cartographicCenter,this.cartesianCenter);return}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new du.Vector3,this.zoom=1}calculateViewPropsTiles3D(){let t=this.root,{center:r}=t.boundingVolume;if(!r){console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new du.Vector3,this.zoom=1;return}r[0]!==0||r[1]!==0||r[2]!==0?this.cartographicCenter=_g.Ellipsoid.WGS84.cartesianToCartographic(r,new du.Vector3):this.cartographicCenter=new du.Vector3(0,0,-_g.Ellipsoid.WGS84.radii[0]),this.cartesianCenter=r,this.zoom=cee(t.boundingVolume,this.cartographicCenter)}_initializeStats(){this.stats.get(ZS),this.stats.get(GB),this.stats.get(UB),this.stats.get(Aee),this.stats.get(Tee),this.stats.get(kee),this.stats.get(Ree),this.stats.get(Cee),this.stats.get(Iee),this.stats.get(zB,"memory")}_initializeTileHeaders(t,r){var n;let i=new _c(this,t.root,r);if(r&&(r.children.push(i),i.depth=r.depth+1),this.type===aa.TILES3D){let a=[];for(a.push(i);a.length>0;){let o=a.pop();this.stats.get(ZS).incrementCount();let s=o.header.children||[];for(let u of s){let l=new _c(this,u,o);if((n=l.contentUrl)==null?void 0:n.includes("?session=")){let f=new URL(l.contentUrl).searchParams.get("session");f&&(this._queryParams.session=f)}o.children.push(l),l.depth=o.depth+1,a.push(l)}}}return i}_initializeTraverser(){let t;switch(this.type){case aa.TILES3D:t=FB;break;case aa.I3S:t=qB;break;default:t=bc}return new t({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}_destroyTileHeaders(t){this._destroySubtree(t)}async _loadTile(t){let r;try{this._onStartTileLoading(),r=await t.loadContent()}catch(i){this._onTileLoadError(t,i instanceof Error?i:new Error("load failed"))}finally{this._onEndTileLoading(),this._onTileLoad(t,r)}}_onTileLoadError(t,r){this.stats.get(Cee).incrementCount();let i=r.message||r.toString(),n=t.url;console.error(`A 3D tile failed to load: ${t.url} ${i}`),this.options.onTileError(t,i,n)}_onTileLoad(t,r){var i,n;if(!!r){if(this.type===aa.I3S){let a=((n=(i=this.tileset)==null?void 0:i.nodePagesTile)==null?void 0:n.nodesInNodePages)||0;this.stats.get(ZS).reset(),this.stats.get(ZS).addCount(a)}t&&t.content&&BZ(t,t.content),this.updateContentTypes(t),this._addTileToCache(t),this.options.onTileLoad(t)}}updateContentTypes(t){var r;if(this.type===aa.I3S)switch(t.header.isDracoGeometry&&(this.contentFormats.draco=!0),t.header.textureFormat){case"dds":this.contentFormats.dds=!0;break;case"ktx2":this.contentFormats.ktx2=!0;break;default:}else if(this.type===aa.TILES3D){let{extensionsRemoved:i=[]}=((r=t.content)==null?void 0:r.gltf)||{};i.includes("KHR_draco_mesh_compression")&&(this.contentFormats.draco=!0),i.includes("EXT_meshopt_compression")&&(this.contentFormats.meshopt=!0),i.includes("KHR_texture_basisu")&&(this.contentFormats.ktx2=!0)}}_onStartTileLoading(){this._pendingCount++,this.stats.get(GB).incrementCount()}_onEndTileLoading(){this._pendingCount--,this.stats.get(GB).decrementCount()}_addTileToCache(t){this._cache.add(this,t,r=>r._updateCacheStats(t))}_updateCacheStats(t){this.stats.get(kee).incrementCount(),this.stats.get(UB).incrementCount(),this.gpuMemoryUsageInBytes+=t.gpuMemoryUsageInBytes||0,this.stats.get(zB).count=this.gpuMemoryUsageInBytes}_unloadTile(t){this.gpuMemoryUsageInBytes-=t.gpuMemoryUsageInBytes||0,this.stats.get(UB).decrementCount(),this.stats.get(Ree).incrementCount(),this.stats.get(zB).count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(t),t.unloadContent()}_destroy(){let t=[];for(this.root&&t.push(this.root);t.length>0;){let r=t.pop();for(let i of r.children)t.push(i);this._destroyTile(r)}this.root=null}_destroySubtree(t){let r=t,i=[];for(i.push(r);i.length>0;){t=i.pop();for(let n of t.children)i.push(n);t!==r&&this._destroyTile(t)}r.children=[]}_destroyTile(t){this._cache.unloadTile(this,t),this._unloadTile(t),t.destroy()}_initializeTiles3DTileset(t){if(t.queryString){let r=new URLSearchParams(t.queryString),i=Object.fromEntries(r.entries());this._queryParams=ce(ce({},this._queryParams),i)}if(this.asset=t.asset,!this.asset)throw new Error("Tileset must have an asset property.");if(this.asset.version!=="0.0"&&this.asset.version!=="1.0")throw new Error("The tileset must be 3D Tiles version 0.0 or 1.0.");"tilesetVersion"in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description||"",this.properties=t.properties,this.geometricError=t.geometricError,this._extensionsUsed=t.extensionsUsed||[],this.extras=t.extras}_initializeI3STileset(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}};var e2="3.4.3";var Ld={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},GSt=Object.keys(Ld);function HB(e,t,r){zt(e instanceof ArrayBuffer);let i=new TextDecoder("utf8"),n=new Uint8Array(e,t,r);return i.decode(n)}function Oee(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 t2="3.4.3";var D5e={draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},Pee={name:"Draco",id:Ln?"draco":"draco-nodejs",module:"draco",shapes:["mesh"],version:t2,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:D5e};function VB(e){let t=1/0,r=1/0,i=1/0,n=-1/0,a=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length;for(let l=0;l<u;l+=3){let c=s[l],f=s[l+1],h=s[l+2];t=c<t?c:t,r=f<r?f:r,i=h<i?h:i,n=c>n?c:n,a=f>a?f:a,o=h>o?h:o}return[[t,r,i],[n,a,o]]}function Bee(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var ms=class{constructor(t,r){Bee(Array.isArray(t)),F5e(t),this.fields=t,this.metadata=r||new Map}compareTo(t){if(this.metadata!==t.metadata||this.fields.length!==t.fields.length)return!1;for(let r=0;r<this.fields.length;++r)if(!this.fields[r].compareTo(t.fields[r]))return!1;return!0}select(...t){let r=Object.create(null);for(let n of t)r[n]=!0;let i=this.fields.filter(n=>r[n.name]);return new ms(i,this.metadata)}selectAt(...t){let r=t.map(i=>this.fields[i]).filter(Boolean);return new ms(r,this.metadata)}assign(t){let r,i=this.metadata;if(t instanceof ms){let o=t;r=o.fields,i=Mee(Mee(new Map,this.metadata),o.metadata)}else r=t;let n=Object.create(null);for(let o of this.fields)n[o.name]=o;for(let o of r)n[o.name]=o;let a=Object.values(n);return new ms(a,i)}};function F5e(e){let t={};for(let r of e)t[r.name]&&console.warn("Schema: duplicated field name",r.name,r),t[r.name]=!0}function Mee(e,t){return new Map([...e||new Map,...t||new Map])}var xc=class{constructor(t,r,i=!1,n=new Map){this.name=t,this.type=r,this.nullable=i,this.metadata=n}get typeId(){return this.type&&this.type.typeId}clone(){return new xc(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}};var Mr;(function(se){se[se.NONE=0]="NONE",se[se.Null=1]="Null",se[se.Int=2]="Int",se[se.Float=3]="Float",se[se.Binary=4]="Binary",se[se.Utf8=5]="Utf8",se[se.Bool=6]="Bool",se[se.Decimal=7]="Decimal",se[se.Date=8]="Date",se[se.Time=9]="Time",se[se.Timestamp=10]="Timestamp",se[se.Interval=11]="Interval",se[se.List=12]="List",se[se.Struct=13]="Struct",se[se.Union=14]="Union",se[se.FixedSizeBinary=15]="FixedSizeBinary",se[se.FixedSizeList=16]="FixedSizeList",se[se.Map=17]="Map",se[se.Dictionary=-1]="Dictionary",se[se.Int8=-2]="Int8",se[se.Int16=-3]="Int16",se[se.Int32=-4]="Int32",se[se.Int64=-5]="Int64",se[se.Uint8=-6]="Uint8",se[se.Uint16=-7]="Uint16",se[se.Uint32=-8]="Uint32",se[se.Uint64=-9]="Uint64",se[se.Float16=-10]="Float16",se[se.Float32=-11]="Float32",se[se.Float64=-12]="Float64",se[se.DateDay=-13]="DateDay",se[se.DateMillisecond=-14]="DateMillisecond",se[se.TimestampSecond=-15]="TimestampSecond",se[se.TimestampMillisecond=-16]="TimestampMillisecond",se[se.TimestampMicrosecond=-17]="TimestampMicrosecond",se[se.TimestampNanosecond=-18]="TimestampNanosecond",se[se.TimeSecond=-19]="TimeSecond",se[se.TimeMillisecond=-20]="TimeMillisecond",se[se.TimeMicrosecond=-21]="TimeMicrosecond",se[se.TimeNanosecond=-22]="TimeNanosecond",se[se.DenseUnion=-23]="DenseUnion",se[se.SparseUnion=-24]="SparseUnion",se[se.IntervalDayTime=-25]="IntervalDayTime",se[se.IntervalYearMonth=-26]="IntervalYearMonth"})(Mr||(Mr={}));var Qa=class{static isNull(t){return t&&t.typeId===Mr.Null}static isInt(t){return t&&t.typeId===Mr.Int}static isFloat(t){return t&&t.typeId===Mr.Float}static isBinary(t){return t&&t.typeId===Mr.Binary}static isUtf8(t){return t&&t.typeId===Mr.Utf8}static isBool(t){return t&&t.typeId===Mr.Bool}static isDecimal(t){return t&&t.typeId===Mr.Decimal}static isDate(t){return t&&t.typeId===Mr.Date}static isTime(t){return t&&t.typeId===Mr.Time}static isTimestamp(t){return t&&t.typeId===Mr.Timestamp}static isInterval(t){return t&&t.typeId===Mr.Interval}static isList(t){return t&&t.typeId===Mr.List}static isStruct(t){return t&&t.typeId===Mr.Struct}static isUnion(t){return t&&t.typeId===Mr.Union}static isFixedSizeBinary(t){return t&&t.typeId===Mr.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===Mr.FixedSizeList}static isMap(t){return t&&t.typeId===Mr.Map}static isDictionary(t){return t&&t.typeId===Mr.Dictionary}get typeId(){return Mr.NONE}compareTo(t){return this===t}},WB=class extends Qa{get typeId(){return Mr.Null}get[Symbol.toStringTag](){return"Null"}toString(){return"Null"}},KB=class extends Qa{get typeId(){return Mr.Bool}get[Symbol.toStringTag](){return"Bool"}toString(){return"Bool"}},wc=class extends Qa{constructor(t,r){super();this.isSigned=t,this.bitWidth=r}get typeId(){return Mr.Int}get[Symbol.toStringTag](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}},wb=class extends wc{constructor(){super(!0,8)}},Eb=class extends wc{constructor(){super(!0,16)}},Sb=class extends wc{constructor(){super(!0,32)}};var Ab=class extends wc{constructor(){super(!1,8)}},Tb=class extends wc{constructor(){super(!1,16)}},kb=class extends wc{constructor(){super(!1,32)}};var Dee={HALF:16,SINGLE:32,DOUBLE:64},Rb=class extends Qa{constructor(t){super();this.precision=t}get typeId(){return Mr.Float}get[Symbol.toStringTag](){return"Float"}toString(){return`Float${this.precision}`}};var Cb=class extends Rb{constructor(){super(Dee.SINGLE)}},Ib=class extends Rb{constructor(){super(Dee.DOUBLE)}},YB=class extends Qa{constructor(){super()}get typeId(){return Mr.Binary}toString(){return"Binary"}get[Symbol.toStringTag](){return"Binary"}},$B=class extends Qa{get typeId(){return Mr.Utf8}get[Symbol.toStringTag](){return"Utf8"}toString(){return"Utf8"}},j5e={DAY:0,MILLISECOND:1},XB=class extends Qa{constructor(t){super();this.unit=t}get typeId(){return Mr.Date}get[Symbol.toStringTag](){return"Date"}toString(){return`Date${(this.unit+1)*32}<${j5e[this.unit]}>`}};var Fee={SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9},JB=class extends Qa{constructor(t,r){super();this.unit=t,this.bitWidth=r}get typeId(){return Mr.Time}toString(){return`Time${this.bitWidth}<${Fee[this.unit]}>`}get[Symbol.toStringTag](){return"Time"}};var QB=class extends Qa{constructor(t,r=null){super();this.unit=t,this.timezone=r}get typeId(){return Mr.Timestamp}get[Symbol.toStringTag](){return"Timestamp"}toString(){return`Timestamp<${Fee[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};var L5e={DAY_TIME:0,YEAR_MONTH:1},ZB=class extends Qa{constructor(t){super();this.unit=t}get typeId(){return Mr.Interval}get[Symbol.toStringTag](){return"Interval"}toString(){return`Interval<${L5e[this.unit]}>`}};var Ob=class extends Qa{constructor(t,r){super();this.listSize=t,this.children=[r]}get typeId(){return Mr.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[Symbol.toStringTag](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}},e8=class extends Qa{constructor(t){super();this.children=t}get typeId(){return Mr.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}get[Symbol.toStringTag](){return"Struct"}};function jee(e){switch(e.constructor){case Int8Array:return new wb;case Uint8Array:return new Ab;case Int16Array:return new Eb;case Uint16Array:return new Tb;case Int32Array:return new Sb;case Uint32Array:return new kb;case Float32Array:return new Cb;case Float64Array:return new Ib;default:throw new Error("array type not supported")}}function t8(e,t,r){let i=jee(t.value),n=r||Lee(t);return new xc(e,new Ob(t.size,new xc("value",i)),!1,n)}function Lee(e){let t=new Map;return"byteOffset"in e&&t.set("byteOffset",e.byteOffset.toString(10)),"byteStride"in e&&t.set("byteStride",e.byteStride.toString(10)),"normalized"in e&&t.set("normalized",e.normalized.toString()),t}function Nee(e,t,r){let i=Uee(t.metadata),n=[],a=Q5e(t.attributes);for(let o in e){let s=e[o],u=qee(o,s,a[o]);n.push(u)}if(r){let o=qee("indices",r);n.push(o)}return new ms(n,i)}function Q5e(e){let t={};for(let r in e){let i=e[r];t[i.name||"undefined"]=i}return t}function qee(e,t,r){let i=r?Uee(r.metadata):void 0;return t8(e,t,i)}function Uee(e){let t=new Map;for(let r in e)t.set(`${r}.string`,JSON.stringify(e[r]));return t}var Gee={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Z5e={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},eNe=4,r2=class{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 i=new this.draco.DecoderBuffer;i.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(r);let n=this.decoder.GetEncodedGeometryType(i),a=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(n){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,a);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,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,n,r),u=this._getMeshData(a,s,r),l=VB(u.attributes),c=Nee(u.attributes,s,u.indices);return _t(ce({loader:"draco",loaderData:s,header:{vertexCount:a.num_points(),boundingBox:l}},u),{schema:c})}finally{this.draco.destroy(i),a&&this.draco.destroy(a)}}_getDracoLoaderData(t,r,i){let n=this._getTopLevelMetadata(t),a=this._getDracoAttributes(t,i);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:n,attributes:a}}_getDracoAttributes(t,r){let i={};for(let n=0;n<t.num_attributes();n++){let a=this.decoder.GetAttribute(t,n),o=this._getAttributeMetadata(t,n);i[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:n,metadata:o};let s=this._getQuantizationTransform(a,r);s&&(i[a.unique_id()].quantization_transform=s);let u=this._getOctahedronTransform(a,r);u&&(i[a.unique_id()].octahedron_transform=u)}return i}_getMeshData(t,r,i){let n=this._getMeshAttributes(r,t,i);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(i.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:n}}_getMeshAttributes(t,r,i){let n={};for(let a of Object.values(t.attributes)){let o=this._deduceAttributeName(a,i);a.name=o;let{value:s,size:u}=this._getAttributeValues(r,a);n[o]={value:s,size:u,byteOffset:a.byte_offset,byteStride:a.byte_stride,normalized:a.normalized}}return n}_getTriangleListIndices(t){let i=t.num_faces()*3,n=i*eNe,a=this.draco._malloc(n);try{return this.decoder.GetTrianglesUInt32Array(t,n,a),new Uint32Array(this.draco.HEAPF32.buffer,a,i).slice()}finally{this.draco._free(a)}}_getTriangleStripIndices(t){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,r),iNe(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let i=Z5e[r.data_type],n=r.num_components,o=t.num_points()*n,s=o*i.BYTES_PER_ELEMENT,u=tNe(this.draco,i),l,c=this.draco._malloc(s);try{let f=this.decoder.GetAttribute(t,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,f,u,s,c),l=new i(this.draco.HEAPF32.buffer,c,o).slice()}finally{this.draco._free(c)}return{value:l,size:n}}_deduceAttributeName(t,r){let i=t.unique_id;for(let[o,s]of Object.entries(r.extraAttributes||{}))if(s===i)return o;let n=t.attribute_type;for(let o in Gee)if(this.draco[o]===n)return Gee[o];let a=r.attributeNameEntry||"name";return t.metadata[a]?t.metadata[a].string:`CUSTOM_ATTRIBUTE_${i}`}_getTopLevelMetadata(t){let r=this.decoder.GetMetadata(t);return this._getDracoMetadata(r)}_getAttributeMetadata(t,r){let i=this.decoder.GetAttributeMetadata(t,r);return this._getDracoMetadata(i)}_getDracoMetadata(t){if(!t||!t.ptr)return{};let r={},i=this.metadataQuerier.NumEntries(t);for(let n=0;n<i;n++){let a=this.metadataQuerier.GetEntryName(t,n);r[a]=this._getDracoMetadataField(t,a)}return r}_getDracoMetadataField(t,r){let i=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,r,i);let n=rNe(i);return{int:this.metadataQuerier.GetIntEntry(t,r),string:this.metadataQuerier.GetStringEntry(t,r),double:this.metadataQuerier.GetDoubleEntry(t,r),intArray:n}}finally{this.draco.destroy(i)}}_disableAttributeTransforms(t){let{quantizedAttributes:r=[],octahedronAttributes:i=[]}=t,n=[...r,...i];for(let a of n)this.decoder.SkipAttributeTransform(this.draco[a])}_getQuantizationTransform(t,r){let{quantizedAttributes:i=[]}=r,n=t.attribute_type();if(i.map(o=>this.decoder[o]).includes(n)){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:i=[]}=r,n=t.attribute_type();if(i.map(o=>this.decoder[o]).includes(n)){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 tNe(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 rNe(e){let t=e.size(),r=new Int32Array(t);for(let i=0;i<t;i++)r[i]=e.GetValue(i);return r}function iNe(e){let t=e.size(),r=new Int32Array(t);for(let i=0;i<t;i++)r[i]=e.GetValue(i);return r}var nNe="1.5.5",aNe="1.4.1",r8=`https://www.gstatic.com/draco/versioned/decoders/${nNe}`,oNe=`${r8}/draco_decoder.js`,sNe=`${r8}/draco_wasm_wrapper.js`,uNe=`${r8}/draco_decoder.wasm`,C2t=`https://raw.githubusercontent.com/google/draco/${aNe}/javascript/draco_encoder.js`,Pb;async function zee(e){let t=e.modules||{};return t.draco3d?Pb=Pb||t.draco3d.createDecoderModule({}).then(r=>({draco:r})):Pb=Pb||lNe(e),await Pb}async function lNe(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await el(oNe,"draco",e);break;case"wasm":default:[t,r]=await Promise.all([await el(sNe,"draco",e),await el(uNe,"draco",e)])}return t=t||globalThis.DracoDecoderModule,await cNe(t,r)}function cNe(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(i=>{e(_t(ce({},r),{onModuleLoaded:n=>i({draco:n})}))})}var Bb={id:Ln?"draco-writer":"draco-writer-nodejs",name:"Draco compressed geometry writer",module:"draco",version:t2,worker:!0,options:{draco:{},source:null}};var wg=_t(ce({},Pee),{parse:fNe});async function fNe(e,t){let{draco:r}=await zee(t),i=new r2(r);try{return i.parseSync(e,t==null?void 0:t.draco)}finally{i.destroy()}}var hNe={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},dn={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},tr=ce(ce({},hNe),dn);var i8={[dn.DOUBLE]:Float64Array,[dn.FLOAT]:Float32Array,[dn.UNSIGNED_SHORT]:Uint16Array,[dn.UNSIGNED_INT]:Uint32Array,[dn.UNSIGNED_BYTE]:Uint8Array,[dn.BYTE]:Int8Array,[dn.SHORT]:Int16Array,[dn.INT]:Int32Array},dNe={DOUBLE:dn.DOUBLE,FLOAT:dn.FLOAT,UNSIGNED_SHORT:dn.UNSIGNED_SHORT,UNSIGNED_INT:dn.UNSIGNED_INT,UNSIGNED_BYTE:dn.UNSIGNED_BYTE,BYTE:dn.BYTE,SHORT:dn.SHORT,INT:dn.INT},n8="Failed to convert GL type",Za=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in i8)if(i8[r]===t)return r;throw new Error(n8)}static fromName(t){let r=dNe[t];if(!r)throw new Error(n8);return r}static getArrayType(t){switch(t){case dn.UNSIGNED_SHORT_5_6_5:case dn.UNSIGNED_SHORT_4_4_4_4:case dn.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=i8[t];if(!r)throw new Error(n8);return r}}static getByteSize(t){return Za.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(Za.getArrayType(t))}static createTypedArray(t,r,i=0,n){n===void 0&&(n=(r.byteLength-i)/Za.getByteSize(t));let a=Za.getArrayType(t);return new a(r,i,n)}};function Hee(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function a8(e,t=[0,0,0]){let r=e>>11&31,i=e>>5&63,n=e&31;return t[0]=r<<3,t[1]=i<<2,t[2]=n<<3,t}var Ec=Le(Tr());var z2t=1/256;var H2t=new Ec.Vector2,V2t=new Ec.Vector3,W2t=new Ec.Vector2,K2t=new Ec.Vector2,Y2t=new Uint8Array(1);function Vee(e,t=255){return(0,Ec.clamp)(e,0,t)/t*2-1}function Wee(e){return e<0?-1:1}function Kee(e,t,r,i){if(Hee(i),e<0||e>r||t<0||t>r)throw new Error(`x and y must be unsigned normalized integers between 0 and ${r}`);if(i.x=Vee(e,r),i.y=Vee(t,r),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let n=i.x;i.x=(1-Math.abs(i.y))*Wee(n),i.y=(1-Math.abs(n))*Wee(i.y)}return i.normalize()}function o8(e,t,r){return Kee(e,t,255,r)}var l8=Le(Tr());var $f=class{constructor(t,r){this.featuresLength=0;this._cachedTypedArrays={};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=tr.UNSIGNED_INT,i=1){let n=this.json[t];return n&&Number.isFinite(n.byteOffset)?this._getTypedArrayFromBinary(t,r,i,1,n.byteOffset):n}getPropertyArray(t,r,i){let n=this.json[t];return n&&Number.isFinite(n.byteOffset)?("componentType"in n&&(r=Za.fromName(n.componentType)),this._getTypedArrayFromBinary(t,r,i,this.featuresLength,n.byteOffset)):this._getTypedArrayFromArray(t,r,n)}getProperty(t,r,i,n,a){let o=this.json[t];if(!o)return o;let s=this.getPropertyArray(t,r,i);if(i===1)return s[n];for(let u=0;u<i;++u)a[u]=s[i*n+u];return a}_getTypedArrayFromBinary(t,r,i,n,a){let o=this._cachedTypedArrays,s=o[t];return s||(s=Za.createTypedArray(r,this.buffer.buffer,this.buffer.byteOffset+a,n*i),o[t]=s),s}_getTypedArrayFromArray(t,r,i){let n=this._cachedTypedArrays,a=n[t];return a||(a=Za.createTypedArray(r,i),n[t]=a),a}};var pNe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},mNe={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]]},gNe={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 Yee(e,t,r,i){let{componentType:n}=e;zt(e.componentType);let a=typeof n=="string"?Za.fromName(n):n,o=pNe[e.type],s=mNe[e.type],u=gNe[e.type];return r+=e.byteOffset,{values:Za.createTypedArray(a,t,r,o*i),type:a,size:o,unpacker:s,packer:u}}var hl=e=>e!==void 0;function $ee(e,t,r){if(!t)return null;let i=e.getExtension("3DTILES_batch_table_hierarchy"),n=t.HIERARCHY;return n&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=n,i=n),i?vNe(i,r):null}function vNe(e,t){let r,i,n,a=e.instancesLength,o=e.classes,s=e.classIds,u=e.parentCounts,l=e.parentIds,c=a;hl(s.byteOffset)&&(s.componentType=defaultValue(s.componentType,GL.UNSIGNED_SHORT),s.type=AttributeType.SCALAR,n=getBinaryAccessor(s),s=n.createArrayBufferView(t.buffer,t.byteOffset+s.byteOffset,a));let f;if(hl(u))for(hl(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,n=getBinaryAccessor(u),u=n.createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,a)),f=new Uint16Array(a),c=0,r=0;r<a;++r)f[r]=c,c+=u[r];hl(l)&&hl(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,GL.UNSIGNED_SHORT),l.type=AttributeType.SCALAR,n=getBinaryAccessor(l),l=n.createArrayBufferView(t.buffer,t.byteOffset+l.byteOffset,c));let h=o.length;for(r=0;r<h;++r){let g=o[r].length,b=o[r].instances,E=getBinaryProperties(g,b,t);o[r].instances=combine(E,b)}let d=new Array(h).fill(0),p=new Uint16Array(a);for(r=0;r<a;++r)i=s[r],p[r]=d[i],++d[i];let y={classes:o,classIds:s,classIndexes:p,parentCounts:u,parentIndexes:f,parentIds:l};return _Ne(y),y}function Eg(e,t,r){if(!e)return;let i=e.parentCounts;return e.parentIds?r(e,t):i>0?yNe(e,t,r):bNe(e,t,r)}function yNe(e,t,r){let i=e.classIds,n=e.parentCounts,a=e.parentIds,o=e.parentIndexes,s=i.length,u=scratchVisited;u.length=Math.max(u.length,s);let l=++marker,c=scratchStack;for(c.length=0,c.push(t);c.length>0;){if(t=c.pop(),u[t]===l)continue;u[t]=l;let f=r(e,t);if(hl(f))return f;let h=n[t],d=o[t];for(let p=0;p<h;++p){let y=a[d+p];y!==t&&c.push(y)}}return null}function bNe(e,t,r){let i=!0;for(;i;){let n=r(e,t);if(hl(n))return n;let a=e.parentIds[t];i=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}function _Ne(e){let t=[],i=e.classIds.length;for(let n=0;n<i;++n)Xee(e,n,stack)}function Xee(e,t,r){let i=e.parentCounts,n=e.parentIds,a=e.parentIndexes,s=e.classIds.length;if(!hl(n))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=hl(i)?i[t]:1,l=hl(i)?a[t]:t;for(let c=0;c<u;++c){let f=n[l+c];f!==t&&Xee(e,f,r)}r.pop(t)}function bo(e){return e!=null}var i2=(e,t)=>e,xNe={HIERARCHY:!0,extensions:!0,extras:!0},Sg=class{constructor(t,r,i,n={}){var a;zt(i>=0),this.json=t||{},this.binary=r,this.featureCount=i,this._extensions=((a=this.json)==null?void 0:a.extensions)||{},this._properties={};for(let o in this.json)xNe[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),n["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=$ee(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),zt(typeof r=="string",r),this._hierarchy){let i=Eg(this._hierarchy,t,(n,a)=>{let o=n.classIds[a];return n.classes[o].name===r});return bo(i)}return!1}isExactClass(t,r){return zt(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),zt(typeof r=="string",r),bo(this._properties[r])||this._hasPropertyInHierarchy(t,r)}getPropertyNames(t,r){this._checkBatchId(t),r=bo(r)?r:[],r.length=0;let i=Object.keys(this._properties);return r.push(...i),this._hierarchy&&this._getPropertyNamesInHierarchy(t,r),r}getProperty(t,r){if(this._checkBatchId(t),zt(typeof r=="string",r),this._binaryProperties){let n=this._binaryProperties[r];if(bo(n))return this._getBinaryProperty(n,t)}let i=this._properties[r];if(bo(i))return i2(i[t],!0);if(this._hierarchy){let n=this._getHierarchyProperty(t,r);if(bo(n))return n}}setProperty(t,r,i){let n=this.featureCount;if(this._checkBatchId(t),zt(typeof r=="string",r),this._binaryProperties){let o=this._binaryProperties[r];if(o){this._setBinaryProperty(o,t,i);return}}if(this._hierarchy&&this._setHierarchyProperty(this,t,r,i))return;let a=this._properties[r];bo(a)||(this._properties[r]=new Array(n),a=this._properties[r]),a[t]=i2(i,!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,i){t.pack(i,t.typedArray,r)}_initializeBinaryProperties(){let t=null;for(let r in this._properties){let i=this._properties[r],n=this._initializeBinaryProperty(r,i);n&&(t=t||{},t[r]=n)}return t}_initializeBinaryProperty(t,r){if("byteOffset"in r){let i=r;zt(this.binary,`Property ${t} requires a batch table binary.`),zt(i.type,`Property ${t} requires a type.`);let n=Yee(i,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:n.values,componentCount:n.size,unpack:n.unpacker,pack:n.packer}}return null}_hasPropertyInHierarchy(t,r){if(!this._hierarchy)return!1;let i=Eg(this._hierarchy,t,(n,a)=>{let o=n.classIds[a],s=n.classes[o].instances;return bo(s[r])});return bo(i)}_getPropertyNamesInHierarchy(t,r){Eg(this._hierarchy,t,(i,n)=>{let a=i.classIds[n],o=i.classes[a].instances;for(let s in o)o.hasOwnProperty(s)&&r.indexOf(s)===-1&&r.push(s)})}_getHierarchyProperty(t,r){return Eg(this._hierarchy,t,(i,n)=>{let a=i.classIds[n],o=i.classes[a],s=i.classIndexes[n],u=o.instances[r];return bo(u)?bo(u.typedArray)?this._getBinaryProperty(u,s):i2(u[s],!0):null})}_setHierarchyProperty(t,r,i,n){let a=Eg(this._hierarchy,r,(o,s)=>{let u=o.classIds[s],l=o.classes[u],c=o.classIndexes[s],f=l.instances[i];return bo(f)?(zt(s===r,`Inherited property "${i}" is read-only.`),bo(f.typedArray)?this._setBinaryProperty(f,c,n):f[c]=i2(n,!0),!0):!1});return bo(a)}};var s8=4;function Xf(e,t,r=0){let i=new DataView(t);if(e.magic=i.getUint32(r,!0),r+=s8,e.version=i.getUint32(r,!0),r+=s8,e.byteLength=i.getUint32(r,!0),r+=s8,e.version!==1)throw new Error(`3D Tile Version ${e.version} not supported`);return r}var Ag=4,Jee="b3dm tile in legacy format.";function Tg(e,t,r){let i=new DataView(t),n;e.header=e.header||{};let a=i.getUint32(r,!0);r+=Ag;let o=i.getUint32(r,!0);r+=Ag;let s=i.getUint32(r,!0);r+=Ag;let u=i.getUint32(r,!0);return r+=Ag,s>=570425344?(r-=Ag*2,n=a,s=o,u=0,a=0,o=0,console.warn(Jee)):u>=570425344&&(r-=Ag,n=s,s=a,u=o,a=0,o=0,console.warn(Jee)),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=u,e.header.batchLength=n,r}function kg(e,t,r,i){return r=wNe(e,t,r,i),r=ENe(e,t,r,i),r}function wNe(e,t,r,i){let{featureTableJsonByteLength:n,featureTableBinaryByteLength:a,batchLength:o}=e.header;if(e.featureTableJson={BATCH_LENGTH:o||0},n>0){let s=HB(t,r,n);e.featureTableJson=JSON.parse(s)}return r+=n,e.featureTableBinary=new Uint8Array(t,r,a),r+=a,r}function ENe(e,t,r,i){let{batchTableJsonByteLength:n,batchTableBinaryByteLength:a}=e.header;if(n>0){let o=HB(t,r,n);e.batchTableJson=JSON.parse(o),r+=n,a>0&&(e.batchTableBinary=new Uint8Array(t,r,a),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=a)}return r}function u8(e,t,r){if(!t&&(!e||!e.batchIds||!r))return null;let{batchIds:i,isRGB565:n,pointCount:a}=e;if(i&&r){let o=new Uint8ClampedArray(a*3);for(let s=0;s<a;s++){let u=i[s],c=r.getProperty(u,"dimensions").map(f=>f*255);o[s*3]=c[0],o[s*3+1]=c[1],o[s*3+2]=c[2]}return{type:tr.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}if(n){let o=new Uint8ClampedArray(a*3);for(let s=0;s<a;s++){let u=a8(t[s]);o[s*3]=u[0],o[s*3+1]=u[1],o[s*3+2]=u[2]}return{type:tr.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}return t&&t.length===a*3?{type:tr.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:tr.UNSIGNED_BYTE,value:t,size:4,normalized:!0}}var Qee=Le(Tr());var Zee=new Qee.Vector3;function ete(e,t){if(!t)return null;if(e.isOctEncoded16P){let r=new Float32Array(e.pointsLength*3);for(let i=0;i<e.pointsLength;i++)o8(t[i*2],t[i*2+1],Zee),Zee.toArray(r,i*3);return{type:tr.FLOAT,size:2,value:r}}return{type:tr.FLOAT,size:2,value:t}}var tte=Le(Tr());function rte(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,SNe(e,t)):{type:tr.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function SNe(e,t){let r=new tte.Vector3,i=new Float32Array(e.pointCount*3);for(let n=0;n<e.pointCount;n++)r.set(t[n*3],t[n*3+1],t[n*3+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(i,n*3);return i}async function ite(e,t,r,i,n){r=Xf(e,t,r),r=Tg(e,t,r),r=kg(e,t,r,i),ANe(e);let{featureTable:a,batchTable:o}=TNe(e);return await ONe(e,a,o,i,n),kNe(e,a,i),RNe(e,a,o),CNe(e,a),r}function ANe(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function TNe(e){let t=new $f(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",tr.FLOAT,3);let i=INe(e,t);return{featureTable:t,batchTable:i}}function kNe(e,t,r){if(!e.attributes.positions){if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",tr.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){let i=t.getPropertyArray("POSITION_QUANTIZED",tr.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=(1<<16)-1,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",tr.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",tr.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=rte(e,i,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function RNe(e,t,r){if(!e.attributes.colors){let i=null;t.hasProperty("RGBA")?(i=t.getPropertyArray("RGBA",tr.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?i=t.getPropertyArray("RGB",tr.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(i=t.getPropertyArray("RGB565",tr.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=u8(e,i,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",tr.UNSIGNED_BYTE,4))}function CNe(e,t){if(!e.attributes.normals){let r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",tr.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",tr.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=ete(e,r)}}function INe(e,t){let r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",tr.UNSIGNED_SHORT,1),e.batchIds)){let i=t.getGlobalProperty("BATCH_LENGTH");if(!i)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");let{batchTableJson:n,batchTableBinary:a}=e;r=new Sg(n,a,i)}return r}async function ONe(e,t,r,i,n){let a,o,s,u=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];u&&(s=u.properties);let l=t.getExtension("3DTILES_draco_point_compression");if(l){o=l.properties;let f=l.byteOffset,h=l.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 c={buffer:a,properties:ce(ce({},o),s),featureTableProperties:o,batchTableProperties:s,dequantizeInShader:!1};return await PNe(e,c,i,n)}async function PNe(e,t,r,i){let{parse:n}=i,a=_t(ce({},r),{draco:_t(ce({},r.draco),{extraAttributes:t.batchTableProperties||{}})});delete a["3d-tiles"];let o=await n(t.buffer,wg,a),s=o.attributes.POSITION&&o.attributes.POSITION.value,u=o.attributes.COLOR_0&&o.attributes.COLOR_0.value,l=o.attributes.NORMAL&&o.attributes.NORMAL.value,c=o.attributes.BATCH_ID&&o.attributes.BATCH_ID.value,f=s&&o.attributes.POSITION.value.quantization,h=l&&o.attributes.NORMAL.value.quantization;if(f){let p=o.POSITION.data.quantization,y=p.range;e.quantizedVolumeScale=new l8.Vector3(y,y,y),e.quantizedVolumeOffset=new l8.Vector3(p.minValues),e.quantizedRange=(1<<p.quantizationBits)-1,e.isQuantizedDraco=!0}h&&(e.octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);let d={};if(t.batchTableProperties)for(let p of Object.keys(t.batchTableProperties))o.attributes[p]&&o.attributes[p].value&&(d[p.toLowerCase()]=o.attributes[p].value);e.attributes=ce({positions:s,colors:u8(e,u,void 0),normals:l,batchIds:c},d)}var nte="3.4.3";var Rg="3.4.3";var ate="3.4.3",BNe=`https://unpkg.com/@loaders.gl/textures@${ate}/dist/libs/basis_encoder.wasm`,MNe=`https://unpkg.com/@loaders.gl/textures@${ate}/dist/libs/basis_encoder.js`,c8;async function f8(e){let t=e.modules||{};return t.basis?t.basis:(c8=c8||DNe(e),await c8)}async function DNe(e){let t=null,r=null;return[t,r]=await Promise.all([await el("basis_transcoder.js","textures",e),await el("basis_transcoder.wasm","textures",e)]),t=t||globalThis.BASIS,await FNe(t,r)}function FNe(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(i=>{e(r).then(n=>{let{BasisFile:a,initializeBasis:o}=n;o(),i({BasisFile:a})})})}var h8;async function d8(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:(h8=h8||jNe(e),await h8)}async function jNe(e){let t=null,r=null;return[t,r]=await Promise.all([await el(MNe,"textures",e),await el(BNe,"textures",e)]),t=t||globalThis.BASIS,await LNe(t,r)}function LNe(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(i=>{e(r).then(n=>{let{BasisFile:a,KTX2File:o,initializeBasis:s,BasisEncoder:u}=n;s(),i({BasisFile:a,KTX2File:o,BasisEncoder:u})})})}var Ae={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 NNe=["","WEBKIT_","MOZ_"],ote={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"},n2=null;function Mb(e){if(!n2){e=e||qNe()||void 0,n2=new Set;for(let t of NNe)for(let r in ote)if(e&&e.getExtension(`${t}${r}`)){let i=ote[r];n2.add(i)}}return n2}function qNe(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var yte=Le(gte());function Cg(e,t){let r=new Array(t.mipMapLevels),i=t.width,n=t.height,a=0;for(let o=0;o<t.mipMapLevels;++o){let s=zNe(t,i,n,e,o),u=GNe(e,o,a,s);r[o]={compressed:!0,format:t.internalFormat,data:u,width:i,height:n,levelSize:s},i=Math.max(1,i>>1),n=Math.max(1,n>>1),a+=s}return r}function GNe(e,t,r,i){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,i)}function zNe(e,t,r,i,n){return Array.isArray(i)?e.sizeFunction(i[n]):e.sizeFunction(t,r)}var HNe={131:Ae.COMPRESSED_RGB_S3TC_DXT1_EXT,132:Ae.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:Ae.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:Ae.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:Ae.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:Ae.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:Ae.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:Ae.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:Ae.COMPRESSED_RED_RGTC1_EXT,140:Ae.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:Ae.COMPRESSED_RED_GREEN_RGTC2_EXT,142:Ae.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:Ae.COMPRESSED_RGB8_ETC2,148:Ae.COMPRESSED_SRGB8_ETC2,149:Ae.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:Ae.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:Ae.COMPRESSED_RGBA8_ETC2_EAC,152:Ae.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:Ae.COMPRESSED_R11_EAC,154:Ae.COMPRESSED_SIGNED_R11_EAC,155:Ae.COMPRESSED_RG11_EAC,156:Ae.COMPRESSED_SIGNED_RG11_EAC,157:Ae.COMPRESSED_RGBA_ASTC_4x4_KHR,158:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:Ae.COMPRESSED_RGBA_ASTC_5x4_KHR,160:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:Ae.COMPRESSED_RGBA_ASTC_5x5_KHR,162:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:Ae.COMPRESSED_RGBA_ASTC_6x5_KHR,164:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:Ae.COMPRESSED_RGBA_ASTC_6x6_KHR,166:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:Ae.COMPRESSED_RGBA_ASTC_8x5_KHR,168:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:Ae.COMPRESSED_RGBA_ASTC_8x6_KHR,170:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:Ae.COMPRESSED_RGBA_ASTC_8x8_KHR,172:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:Ae.COMPRESSED_RGBA_ASTC_10x5_KHR,174:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:Ae.COMPRESSED_RGBA_ASTC_10x6_KHR,176:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:Ae.COMPRESSED_RGBA_ASTC_10x8_KHR,178:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:Ae.COMPRESSED_RGBA_ASTC_10x10_KHR,180:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:Ae.COMPRESSED_RGBA_ASTC_12x10_KHR,182:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:Ae.COMPRESSED_RGBA_ASTC_12x12_KHR,184:Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:Ae.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:Ae.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:Ae.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:Ae.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:Ae.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:Ae.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:Ae.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:Ae.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:Ae.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:Ae.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:Ae.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:Ae.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:Ae.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:Ae.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:Ae.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:Ae.COMPRESSED_RGBA_ASTC_12x12_KHR};function vte(e){return HNe[e]}var Fo=[171,75,84,88,32,50,48,187,13,10,26,10];function l2(e){let t=new Uint8Array(e);return!(t.byteLength<Fo.length||t[0]!==Fo[0]||t[1]!==Fo[1]||t[2]!==Fo[2]||t[3]!==Fo[3]||t[4]!==Fo[4]||t[5]!==Fo[5]||t[6]!==Fo[6]||t[7]!==Fo[7]||t[8]!==Fo[8]||t[9]!==Fo[9]||t[10]!==Fo[10]||t[11]!==Fo[11])}function bte(e){let t=new Uint8Array(e),r=(0,yte.read)(t),i=Math.max(1,r.levels.length),n=r.pixelWidth,a=r.pixelHeight,o=vte(r.vkFormat);return Cg(r.levels,{mipMapLevels:i,width:n,height:a,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var VNe={etc1:{basisFormat:0,compressed:!0,format:Ae.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Ae.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:Ae.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:Ae.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Ae.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:Ae.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 Fb(e,t){if(t.basis.containerFormat==="auto"){if(l2(e)){let i=await d8(t);return _te(i.KTX2File,e,t)}let{BasisFile:r}=await f8(t);return y8(r,e,t)}switch(t.basis.module){case"encoder":let r=await d8(t);switch(t.basis.containerFormat){case"ktx2":return _te(r.KTX2File,e,t);case"basis":default:return y8(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:i}=await f8(t);return y8(i,e,t)}}function y8(e,t,r){let i=new e(new Uint8Array(t));try{if(!i.startTranscoding())throw new Error("Failed to start basis transcoding");let n=i.getNumImages(),a=[];for(let o=0;o<n;o++){let s=i.getNumLevels(o),u=[];for(let l=0;l<s;l++)u.push(WNe(i,o,l,r));a.push(u)}return a}finally{i.close(),i.delete()}}function WNe(e,t,r,i){let n=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),{compressed:s,format:u,basisFormat:l}=xte(i,o),c=e.getImageTranscodedSizeInBytes(t,r,l),f=new Uint8Array(c);if(!e.transcodeImage(f,t,r,l,0,0))throw new Error("failed to start Basis transcoding");return{width:n,height:a,data:f,compressed:s,format:u,hasAlpha:o}}function _te(e,t,r){let i=new e(new Uint8Array(t));try{if(!i.startTranscoding())throw new Error("failed to start KTX2 transcoding");let n=i.getLevels(),a=[];for(let o=0;o<n;o++){a.push(KNe(i,o,r));break}return[a]}finally{i.close(),i.delete()}}function KNe(e,t,r){let{alphaFlag:i,height:n,width:a}=e.getImageLevelInfo(t,0,0),{compressed:o,format:s,basisFormat:u}=xte(r,i),l=e.getImageTranscodedSizeInBytes(t,0,0,u),c=new Uint8Array(l);if(!e.transcodeImage(c,t,0,0,u,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:a,height:n,data:c,compressed:o,levelSize:l,hasAlpha:i,format:s}}function xte(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=Ig()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),VNe[r]}function Ig(){let e=Mb();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 wte={name:"Basis",id:Ln?"basis":"basis-nodejs",module:"textures",version:Rg,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"}}},Nd=_t(ce({},wte),{parse:Fb});var jo={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},YNe={DXT1:Ae.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:Ae.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:Ae.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":Ae.COMPRESSED_RGB_ATC_WEBGL,ATCA:Ae.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:Ae.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},$Ne=Ate,XNe=c2,JNe=c2,QNe={DXT1:Ate,DXT3:c2,DXT5:c2,"ATC ":$Ne,ATCA:XNe,ATCI:JNe};function Ete(e){return new Uint32Array(e,0,jo.HEADER_LENGTH)[jo.MAGIC_NUMBER_INDEX]===jo.MAGIC_NUMBER}function Ste(e){let t=new Int32Array(e,0,jo.HEADER_LENGTH),r=t[jo.HEADER_PF_FOURCC_INDEX];zt(Boolean(t[jo.HEADER_PF_FLAGS_INDEX]&jo.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let i=ZNe(r),n=YNe[i],a=QNe[i];zt(n&&a,`DDS: Unknown pixel format ${r}`);let o=1;t[jo.HEADER_FLAGS_INDEX]&jo.DDSD_MIPMAPCOUNT&&(o=Math.max(1,t[jo.MIPMAPCOUNT_INDEX]));let s=t[jo.HEADER_WIDTH_INDEX],u=t[jo.HEADER_HEIGHT_INDEX],l=t[jo.HEADER_SIZE_INDEX]+4,c=new Uint8Array(e,l);return Cg(c,{mipMapLevels:o,width:s,height:u,sizeFunction:a,internalFormat:n})}function Ate(e,t){return(e+3>>2)*(t+3>>2)*8}function c2(e,t){return(e+3>>2)*(t+3>>2)*16}function ZNe(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var gs={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},e9e={0:[Ae.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[Ae.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[Ae.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[Ae.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[Ae.COMPRESSED_RGB_ETC1_WEBGL],7:[Ae.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[Ae.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[Ae.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[Ae.COMPRESSED_RGB8_ETC2],23:[Ae.COMPRESSED_RGBA8_ETC2_EAC],24:[Ae.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[Ae.COMPRESSED_R11_EAC],26:[Ae.COMPRESSED_RG11_EAC],27:[Ae.COMPRESSED_RGBA_ASTC_4X4_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[Ae.COMPRESSED_RGBA_ASTC_5X4_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[Ae.COMPRESSED_RGBA_ASTC_5X5_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[Ae.COMPRESSED_RGBA_ASTC_6X5_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[Ae.COMPRESSED_RGBA_ASTC_6X6_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[Ae.COMPRESSED_RGBA_ASTC_8X5_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[Ae.COMPRESSED_RGBA_ASTC_8X6_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[Ae.COMPRESSED_RGBA_ASTC_8X8_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[Ae.COMPRESSED_RGBA_ASTC_10X5_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[Ae.COMPRESSED_RGBA_ASTC_10X6_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[Ae.COMPRESSED_RGBA_ASTC_10X8_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[Ae.COMPRESSED_RGBA_ASTC_10X10_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[Ae.COMPRESSED_RGBA_ASTC_12X10_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[Ae.COMPRESSED_RGBA_ASTC_12X12_KHR,Ae.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},t9e={0:Rte,1:Rte,2:Cte,3:Cte,6:jb,7:jb,9:Lb,11:Lb,22:jb,23:Lb,24:jb,25:jb,26:Lb,27:Lb,28:r9e,29:i9e,30:n9e,31:a9e,32:o9e,33:s9e,34:u9e,35:l9e,36:c9e,37:f9e,38:h9e,39:d9e,40:p9e};function Tte(e){let r=new Uint32Array(e,0,gs.HEADER_LENGTH)[gs.MAGIC_NUMBER_INDEX];return r===gs.MAGIC_NUMBER||r===gs.MAGIC_NUMBER_EXTRA}function kte(e){let t=new Uint32Array(e,0,gs.HEADER_LENGTH),r=t[gs.PIXEL_FORMAT_INDEX],i=t[gs.COLOUR_SPACE_INDEX],n=e9e[r]||[],a=n.length>1&&i?n[1]:n[0],o=t9e[r],s=t[gs.MIPMAPCOUNT_INDEX],u=t[gs.WIDTH_INDEX],l=t[gs.HEIGHT_INDEX],c=gs.HEADER_SIZE+t[gs.METADATA_SIZE_INDEX],f=new Uint8Array(e,c);return Cg(f,{mipMapLevels:s,width:u,height:l,sizeFunction:o,internalFormat:a})}function Rte(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function Cte(e,t){return e=Math.max(e,8),t=Math.max(t,8),e*t/2}function jb(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function Lb(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function r9e(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16}function i9e(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16}function n9e(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16}function a9e(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16}function o9e(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16}function s9e(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16}function u9e(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16}function l9e(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16}function c9e(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16}function f9e(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16}function h9e(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16}function d9e(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16}function p9e(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}function Ite(e){if(l2(e))return bte(e);if(Ete(e))return Ste(e);if(Tte(e))return kte(e);throw new Error("Texture container format not recognized")}var m9e={"compressed-texture":{libraryPath:"libs/",useBasis:!1}},Ote={name:"Texture Containers",id:"compressed-texture",module:"textures",version:Rg,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:m9e},f2=_t(ce({},Ote),{parse:async(e,t)=>t["compressed-texture"].useBasis?(t.basis=_t(ce({format:{alpha:"BC3",noAlpha:"BC1"}},t.basis),{containerFormat:"ktx2",module:"encoder"}),(await Fb(e,t))[0]):Ite(e)});var h2="3.4.3";var{_parseImageNode:g9e}=globalThis,b8=typeof Image!="undefined",_8=typeof ImageBitmap!="undefined",v9e=Boolean(g9e),x8=ji?!0:v9e;function Pte(e){switch(e){case"auto":return _8||b8||x8;case"imagebitmap":return _8;case"image":return b8;case"data":return x8;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function Bte(){if(_8)return"imagebitmap";if(b8)return"image";if(x8)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function y9e(e){let t=b9e(e);if(!t)throw new Error("Not an image");return t}function Mte(e){return w8(e)}function w8(e){switch(y9e(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 b9e(e){return typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap?"imagebitmap":typeof Image!="undefined"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var _9e=/^data:image\/svg\+xml/,x9e=/\.svg((\?|#).*)?$/;function d2(e){return e&&(_9e.test(e)||x9e.test(e))}function Dte(e,t){if(d2(t)){let i=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(i=unescape(encodeURIComponent(i)))}catch(a){throw new Error(a.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return E8(e,t)}function E8(e,t){if(d2(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function Nb(e,t,r){let i=Dte(e,r),n=self.URL||self.webkitURL,a=typeof i!="string"&&n.createObjectURL(i);try{return await w9e(a||i,t)}finally{a&&n.revokeObjectURL(a)}}async function w9e(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((i,n)=>{try{r.onload=()=>i(r),r.onerror=a=>n(new Error(`Could not load image ${e}: ${a}`))}catch(a){n(a)}})}var E9e={},Fte=!0;async function S8(e,t,r){let i;d2(r)?i=await Nb(e,t,r):i=E8(e,r);let n=t&&t.imagebitmap;return await S9e(i,n)}async function S9e(e,t=null){if((A9e(t)||!Fte)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),Fte=!1}return await createImageBitmap(e)}function A9e(e){for(let t in e||E9e)return!1;return!0}function jte(e){return!C9e(e,"ftyp",4)||(e[8]&96)==0?null:T9e(e)}function T9e(e){switch(k9e(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function k9e(e,t,r){return String.fromCharCode(...e.slice(t,r))}function R9e(e){return[...e].map(t=>t.charCodeAt(0))}function C9e(e,t,r=0){let i=R9e(t);for(let n=0;n<i.length;++n)if(i[n]!==e[n+r])return!1;return!0}var dl=!1,qb=!0;function qd(e){let t=Ub(e);return O9e(t)||M9e(t)||P9e(t)||B9e(t)||I9e(t)}function I9e(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=jte(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function O9e(e){let t=Ub(e);return t.byteLength>=24&&t.getUint32(0,dl)===2303741511?{mimeType:"image/png",width:t.getUint32(16,dl),height:t.getUint32(20,dl)}:null}function P9e(e){let t=Ub(e);return t.byteLength>=10&&t.getUint32(0,dl)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,qb),height:t.getUint16(8,qb)}:null}function B9e(e){let t=Ub(e);return t.byteLength>=14&&t.getUint16(0,dl)===16973&&t.getUint32(2,qb)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,qb),height:t.getUint32(22,qb)}:null}function M9e(e){let t=Ub(e);if(!(t.byteLength>=3&&t.getUint16(0,dl)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:n}=D9e(),a=2;for(;a+9<t.byteLength;){let o=t.getUint16(a,dl);if(n.has(o))return{mimeType:"image/jpeg",height:t.getUint16(a+5,dl),width:t.getUint16(a+7,dl)};if(!i.has(o))return null;a+=2,a+=t.getUint16(a,dl)}return null}function D9e(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);let t=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:t}}function Ub(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 A8(e,t){let{mimeType:r}=qd(e)||{},i=globalThis._parseImageNode;return zt(i),await i(e,r)}async function T8(e,t,r){t=t||{};let n=(t.image||{}).type||"auto",{url:a}=r||{},o=F9e(n),s;switch(o){case"imagebitmap":s=await S8(e,t,a);break;case"image":s=await Nb(e,t,a);break;case"data":s=await A8(e,t);break;default:zt(!1)}return n==="data"&&(s=w8(s)),s}function F9e(e){switch(e){case"auto":case"data":return Bte();default:return Pte(e),e}}var j9e=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],L9e=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],N9e={image:{type:"auto",decode:!0}},Og={id:"image",module:"images",name:"Images",version:h2,mimeTypes:L9e,extensions:j9e,parse:T8,tests:[e=>Boolean(qd(new DataView(e)))],options:N9e};var{_encodeImageNode:Lte}=globalThis;async function Nte(e,t){return t=t||{},t.image=t.image||{},Lte?Lte(e,{type:t.image.mimeType}):q9e(e,t)}var qte=!0;async function q9e(e,t){let{mimeType:r,jpegQuality:i}=t.image,{width:n,height:a}=Mte(e),o=document.createElement("canvas");o.width=n,o.height=a,U9e(e,o);let s=await new Promise(u=>{if(i&&qte)try{o.toBlob(u,r,i);return}catch{qte=!1}o.toBlob(u,r)});if(!s)throw new Error("image encoding failed");return await s.arrayBuffer()}function U9e(e,t,r=0,i=0){if(r===0&&i===0&&typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap){let a=t.getContext("bitmaprenderer");if(a)return a.transferFromImageBitmap(e),t}let n=t.getContext("2d");if(e.data){let a=new Uint8ClampedArray(e.data),o=new ImageData(a,e.width,e.height);return n.putImageData(o,0,0),t}return n.drawImage(e,0,0),t}var k8={name:"Images",id:"image",module:"images",version:h2,extensions:["jpeg"],options:{image:{mimeType:"image/png",jpegQuality:null}},encode:Nte};var R8={};function C8(e){if(R8[e]===void 0){let t=ji?z9e(e):G9e(e);R8[e]=t}return R8[e]}function G9e(e){let t=["image/png","image/jpeg","image/gif"],{_parseImageNode:r,_imageFormatsNode:i=t}=globalThis;return Boolean(r)&&i.includes(e)}function z9e(e){switch(e){case"image/avif":case"image/webp":return H9e(e);default:return!0}}function H9e(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}var p2={name:"Basis Universal Supercompressed GPU Texture",id:ji?"ktx2-basis-writer":"ktx2-basis-writer-nodejs",module:"textures",version:Rg,extensions:["ktx2"],worker:!0,options:{useSRGB:!1,qualityLevel:10,encodeUASTC:!1,mipmaps:!1}};function Un(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function I8(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;let i=t.baseUri||t.uri;if(!i)throw new Error(`'baseUri' must be provided to resolve relative url ${e}`);return i.substr(0,i.lastIndexOf("/")+1)+e}function Ute(e,t,r){let i=e.bufferViews[r];Un(i);let n=i.buffer,a=t[n];Un(a);let o=(i.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,o,i.byteLength)}var B8={};To(B8,{decode:()=>uqe,name:()=>sqe});var Gte=["SCALAR","VEC2","VEC3","VEC4"],V9e=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],W9e=new Map(V9e),K9e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Y9e={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},$9e={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function m2(e){return Gte[e-1]||Gte[0]}function g2(e){let t=W9e.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Pg(e,t){let r=$9e[e.componentType],i=K9e[e.type],n=Y9e[e.componentType],a=e.count*i,o=e.count*i*n;return Un(o>=0&&o<=t.byteLength),{ArrayType:r,length:a,byteLength:o}}function Gb(e){let{images:t,bufferViews:r}=e;t=t||[],r=r||[];let i=t.map(o=>o.bufferView);r=r.filter(o=>!i.includes(o));let n=r.reduce((o,s)=>o+s.byteLength,0),a=t.reduce((o,s)=>{let{width:u,height:l}=s.image;return o+u*l},0);return n+Math.ceil(4*a*1.33)}var X9e={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},wi=class{constructor(t){this.gltf=t||{json:ce({},X9e),buffers:[]},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]}getExtension(t){let r=this.getUsedExtensions().find(n=>n===t),i=this.json.extensions||{};return r?i[t]||!0:null}getRequiredExtension(t){return this.getRequiredExtensions().find(i=>i===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 i=this.json[t]&&this.json[t][r];if(!i)throw new Error(`glTF file error: Could not find ${t}[${r}]`);return i}getTypedArrayForBufferView(t){t=this.getBufferView(t);let r=t.buffer,i=this.gltf.buffers[r];Un(i);let n=(t.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,n,t.byteLength)}getTypedArrayForAccessor(t){t=this.getAccessor(t);let r=this.getBufferView(t.bufferView),n=this.getBuffer(r.buffer).data,{ArrayType:a,length:o}=Pg(t,r),s=r.byteOffset+t.byteOffset;return new a(n,s,o)}getTypedArrayForImageData(t){t=this.getAccessor(t);let r=this.getBufferView(t.bufferView),n=this.getBuffer(r.buffer).data,a=r.byteOffset||0;return new Uint8Array(n,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,i){return t.extensions=t.extensions||{},t.extensions[r]=i,this.registerUsedExtension(r),this}setObjectExtension(t,r,i){let n=t.extensions||{};n[r]=i}removeObjectExtension(t,r){let i=t.extensions||{},n=i[r];return delete i[r],n}addExtension(t,r={}){return Un(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return Un(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){if(!this.getExtension(t))return;this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t),this.json.extensions&&delete this.json.extensions[t],Array.isArray(this.json.extensionsRemoved)||(this.json.extensionsRemoved=[]);let r=this.json.extensionsRemoved;r.includes(t)||r.push(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:i}=t;this.json.nodes=this.json.nodes||[];let n={mesh:r};return i&&(n.matrix=i),this.json.nodes.push(n),this.json.nodes.length-1}addMesh(t){let{attributes:r,indices:i,material:n,mode:a=4}=t,s={primitives:[{attributes:this._addAttributes(r),mode:a}]};if(i){let u=this._addIndices(i);s.primitives[0].indices=u}return Number.isFinite(n)&&(s.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(s),this.json.meshes.length-1}addPointCloud(t){let i={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}addImage(t,r){let i=qd(t),n=r||(i==null?void 0:i.mimeType),o={bufferView:this.addBufferView(t),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(t){let r=t.byteLength;Un(Number.isFinite(r)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let i={buffer:0,byteOffset:this.byteLength,byteLength:r};return this.byteLength+=Ff(r,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(t,r){let i={bufferView:t,type:m2(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(i),this.json.accessors.length-1}addBinaryBuffer(t,r={size:3}){let i=this.addBufferView(t),n={min:r.min,max:r.max};(!n.min||!n.max)&&(n=this._getAccessorMinMax(t,r.size));let a={size:r.size,componentType:g2(t),count:Math.round(t.length/r.size),min:n.min,max:n.max};return this.addAccessor(i,Object.assign(a,r))}addTexture(t){let{imageIndex:r}=t,i={source:r};return this.json.textures=this.json.textures||[],this.json.textures.push(i),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),i=new Uint8Array(r),n=0;for(let s of this.sourceBuffers||[])n=ZO(s,i,n);((o=(a=this.json)==null?void 0:a.buffers)==null?void 0:o[0])?this.json.buffers[0].byteLength=t:this.json.buffers=[{byteLength:t}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(t,r){let i=!0;for(;i;){let n=t.indexOf(r);n>-1?t.splice(n,1):i=!1}}_addAttributes(t={}){let r={};for(let i in t){let n=t[i],a=this._getGltfAttributeName(i),o=this.addBinaryBuffer(n.value,n);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 i={min:null,max:null};if(t.length<r)return i;i.min=[],i.max=[];let n=t.subarray(0,r);for(let a of n)i.min.push(a),i.max.push(a);for(let a=r;a<t.length;a+=r)for(let o=0;o<r;o++)i.min[0+o]=Math.min(i.min[0+o],t[a+o]),i.max[0+o]=Math.max(i.max[0+o],t[a+o]);return i}};var J9e="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",Q9e="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",Z9e=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]),eqe=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]),tqe={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},rqe={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function zte(e,t,r,i,n,a="NONE"){let o=await iqe();oqe(o,o.exports[rqe[n]],e,t,r,i,o.exports[tqe[a||"NONE"]])}var O8;async function iqe(){return O8||(O8=nqe()),O8}async function nqe(){let e=J9e;WebAssembly.validate(Z9e)&&(e=Q9e,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate(aqe(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function aqe(e){let t=new Uint8Array(e.length);for(let i=0;i<e.length;++i){let n=e.charCodeAt(i);t[i]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}let r=0;for(let i=0;i<e.length;++i)t[r++]=t[i]<60?eqe[t[i]]:(t[i]-60)*64+t[++i];return t.buffer.slice(0,r)}function oqe(e,t,r,i,n,a,o){let s=e.exports.sbrk,u=i+3&~3,l=s(u*n),c=s(a.length),f=new Uint8Array(e.exports.memory.buffer);f.set(a,c);let h=t(l,i,n,c,a.length);if(h===0&&o&&o(l,u,n),r.set(f.subarray(l,l+i*n)),s(l-s(0)),h!==0)throw new Error(`Malformed buffer data: ${h}`)}var P8="EXT_meshopt_compression",sqe=P8;async function uqe(e,t){var n;let r=new wi(e);if(!((n=t==null?void 0:t.gltf)==null?void 0:n.decompressMeshes))return;let i=[];for(let a of e.json.bufferViews||[])i.push(lqe(r,a));await Promise.all(i),r.removeExtension(P8)}async function lqe(e,t){let r=e.getObjectExtension(t,P8);if(r){let{byteOffset:i=0,byteLength:n=0,byteStride:a,count:o,mode:s,filter:u="NONE",buffer:l}=r,c=e.gltf.buffers[l],f=new Uint8Array(c.arrayBuffer,c.byteOffset+i,n),h=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);return await zte(h,o,a,f,s,u),h}return null}var M8={};To(M8,{name:()=>cqe,preprocess:()=>fqe});var Bg="EXT_texture_webp",cqe=Bg;function fqe(e,t){let r=new wi(e);if(!C8("image/webp")){if(r.getRequiredExtensions().includes(Bg))throw new Error(`gltf: Required extension ${Bg} not supported by browser`);return}let{json:i}=r;for(let n of i.textures||[]){let a=r.getObjectExtension(n,Bg);a&&(n.source=a.source),r.removeObjectExtension(n,Bg)}r.removeExtension(Bg)}var D8={};To(D8,{name:()=>hqe,preprocess:()=>dqe});var v2="KHR_texture_basisu",hqe=v2;function dqe(e,t){let r=new wi(e),{json:i}=r;for(let n of i.textures||[]){let a=r.getObjectExtension(n,v2);a&&(n.source=a.source),r.removeObjectExtension(n,v2)}r.removeExtension(v2)}var j8={};To(j8,{decode:()=>yqe,encode:()=>bqe,name:()=>gqe,preprocess:()=>vqe});function Hte(e){let t={};for(let r in e){let i=e[r];if(r!=="indices"){let n=F8(i);t[r]=n}}return t}function F8(e){let{buffer:t,size:r,count:i}=pqe(e);return{value:t,size:r,byteOffset:0,count:i,type:m2(r),componentType:g2(t)}}function pqe(e){let t=e,r=1,i=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=mqe(t,Float32Array)),i=t.length/r),{buffer:t,size:r,count:i}}function mqe(e,t,r=!1){return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}var Ud="KHR_draco_mesh_compression",gqe=Ud;function vqe(e,t,r){let i=new wi(e);for(let n of Vte(i))i.getObjectExtension(n,Ud)}async function yqe(e,t,r){var a;if(!((a=t==null?void 0:t.gltf)==null?void 0:a.decompressMeshes))return;let i=new wi(e),n=[];for(let o of Vte(i))i.getObjectExtension(o,Ud)&&n.push(_qe(i,o,t,r));await Promise.all(n),i.removeExtension(Ud)}function bqe(e,t={}){let r=new wi(e);for(let i of r.json.meshes||[])xqe(i,t),r.addRequiredExtension(Ud)}async function _qe(e,t,r,i){let n=e.getObjectExtension(t,Ud);if(!n)return;let a=e.getTypedArrayForBufferView(n.bufferView),o=_d(a.buffer,a.byteOffset),{parse:s}=i,u=ce({},r);delete u["3d-tiles"];let l=await s(o,wg,u,i),c=Hte(l.attributes);for(let[f,h]of Object.entries(c))if(f in t.attributes){let d=t.attributes[f],p=e.getAccessor(d);(p==null?void 0:p.min)&&(p==null?void 0:p.max)&&(h.min=p.min,h.max=p.max)}t.attributes=c,l.indices&&(t.indices=F8(l.indices)),wqe(t)}function xqe(e,t,r=4,i,n){var c;if(!i.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");let a=i.DracoWriter.encodeSync({attributes:e}),o=(c=n==null?void 0:n.parseSync)==null?void 0:c.call(n,{attributes:e}),s=i._addFauxAttributes(o.attributes),u=i.addBufferView(a);return{primitives:[{attributes:s,mode:r,extensions:{[Ud]:{bufferView:u,attributes:s}}}]}}function wqe(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*Vte(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var N8={};To(N8,{decode:()=>Tqe,name:()=>Eqe});var Mg=Le(Tr());var Wte={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Kte={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var L8="KHR_texture_transform",Eqe=L8,y2=new Mg.Vector3,Sqe=new Mg.Matrix3,Aqe=new Mg.Matrix3;async function Tqe(e,t){if(!new wi(e).getExtension(L8))return;let n=e.json.materials||[];for(let a=0;a<n.length;a++)kqe(a,e)}function kqe(e,t){var l,c,f;let r=[],i=(l=t.json.materials)==null?void 0:l[e],n=(c=i==null?void 0:i.pbrMetallicRoughness)==null?void 0:c.baseColorTexture;n&&zb(t,e,n,r);let a=i==null?void 0:i.emissiveTexture;a&&zb(t,e,a,r);let o=i==null?void 0:i.normalTexture;o&&zb(t,e,o,r);let s=i==null?void 0:i.occlusionTexture;s&&zb(t,e,s,r);let u=(f=i==null?void 0:i.pbrMetallicRoughness)==null?void 0:f.metallicRoughnessTexture;u&&zb(t,e,u,r)}function zb(e,t,r,i){let n=Rqe(r,i);if(!n)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&&Cqe(e,s,n)}}function Rqe(e,t){var o;let r=(o=e.extensions)==null?void 0:o[L8],{texCoord:i=0}=e,{texCoord:n=i}=r;if(!(t.findIndex(([s,u])=>s===i&&u===n)!==-1)){let s=Pqe(r);return i!==n&&(e.texCoord=n),t.push([i,n]),{originalTexCoord:i,texCoord:n,matrix:s}}return null}function Cqe(e,t,r){var s,u;let{originalTexCoord:i,texCoord:n,matrix:a}=r,o=t.attributes[`TEXCOORD_${i}`];if(Number.isFinite(o)){let l=(s=e.json.accessors)==null?void 0:s[o];if(l&&l.bufferView){let c=(u=e.json.bufferViews)==null?void 0:u[l.bufferView];if(c){let{arrayBuffer:f,byteOffset:h}=e.buffers[c.buffer],d=(h||0)+(l.byteOffset||0)+(c.byteOffset||0),{ArrayType:p,length:y}=Pg(l,c),g=Kte[l.componentType],b=Wte[l.type],E=c.byteStride||g*b,S=new Float32Array(y);for(let k=0;k<l.count;k++){let R=new p(f,d+k*E,2);y2.set(R[0],R[1],1),y2.transformByMatrix3(a),S.set([y2[0],y2[1]],k*b)}i===n?Iqe(l,c,e.buffers,S):Oqe(n,l,t,e,S)}}}}function Iqe(e,t,r,i){e.componentType=5126,r.push({arrayBuffer:i.buffer,byteOffset:0,byteLength:i.buffer.byteLength}),t.buffer=r.length-1,t.byteLength=i.buffer.byteLength,t.byteOffset=0,delete t.byteStride}function Oqe(e,t,r,i,n){i.buffers.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength});let a=i.json.bufferViews;if(!a)return;a.push({buffer:i.buffers.length-1,byteLength:n.buffer.byteLength,byteOffset:0});let o=i.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 Pqe(e){let{offset:t=[0,0],rotation:r=0,scale:i=[1,1]}=e,n=new Mg.Matrix3().set(1,0,0,0,1,0,t[0],t[1],1),a=Sqe.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),o=Aqe.set(i[0],0,0,0,i[1],0,0,0,1);return n.multiplyRight(a).multiplyRight(o)}var q8={};To(q8,{decode:()=>Mqe,encode:()=>Dqe,name:()=>Bqe});var Gd="KHR_lights_punctual",Bqe=Gd;async function Mqe(e){let t=new wi(e),{json:r}=t,i=t.getExtension(Gd);i&&(t.json.lights=i.lights,t.removeExtension(Gd));for(let n of r.nodes||[]){let a=t.getObjectExtension(n,Gd);a&&(n.light=a.light),t.removeObjectExtension(n,Gd)}}async function Dqe(e){let t=new wi(e),{json:r}=t;if(r.lights){let i=t.addExtension(Gd);Un(!i.lights),i.lights=r.lights,delete r.lights}if(t.json.lights){for(let i of t.json.lights){let n=i.node;t.addObjectExtension(n,Gd,i)}delete t.json.lights}}var U8={};To(U8,{decode:()=>jqe,encode:()=>Lqe,name:()=>Fqe});var Hb="KHR_materials_unlit",Fqe=Hb;async function jqe(e){let t=new wi(e),{json:r}=t;for(let i of r.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),t.removeObjectExtension(i,Hb);t.removeExtension(Hb)}function Lqe(e){let t=new wi(e),{json:r}=t;if(t.materials)for(let i of r.materials||[])i.unlit&&(delete i.unlit,t.addObjectExtension(i,Hb,{}),t.addExtension(Hb))}var G8={};To(G8,{decode:()=>qqe,encode:()=>Uqe,name:()=>Nqe});var Vb="KHR_techniques_webgl",Nqe=Vb;async function qqe(e){let t=new wi(e),{json:r}=t,i=t.getExtension(Vb);if(i){let n=Gqe(i,t);for(let a of r.materials||[]){let o=t.getObjectExtension(a,Vb);o&&(a.technique=Object.assign({},o,n[o.technique]),a.technique.values=zqe(a.technique,t)),t.removeObjectExtension(a,Vb)}t.removeExtension(Vb)}}async function Uqe(e,t){}function Gqe(e,t){let{programs:r=[],shaders:i=[],techniques:n=[]}=e,a=new TextDecoder;return i.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=i[o.fragmentShader],o.vertexShader=i[o.vertexShader]}),n.forEach(o=>{o.program=r[o.program]}),n}function zqe(e,t){let r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(i=>{e.uniforms[i].value&&!(i in r)&&(r[i]=e.uniforms[i].value)}),Object.keys(r).forEach(i=>{typeof r[i]=="object"&&r[i].index!==void 0&&(r[i].texture=t.getTexture(r[i].index))}),r}var z8={};To(z8,{decode:()=>Vqe,name:()=>Hqe});var Yte="EXT_feature_metadata",Hqe=Yte;async function Vqe(e){let t=new wi(e);Wqe(t)}function Wqe(e){var a;let t=e.getExtension(Yte),r=(a=t==null?void 0:t.schema)==null?void 0:a.classes,i=t==null?void 0:t.featureTables;if((t==null?void 0:t.featureTextures)&&console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.'),r&&i)for(let o in r){let s=r[o],u=$qe(i,o);u&&Kqe(e,u,s)}}function Kqe(e,t,r){var i;for(let n in r.properties){let a=r.properties[n],o=(i=t==null?void 0:t.properties)==null?void 0:i[n],s=t.count;if(o){let u=Yqe(e,a,s,o);o.data=u}}}function Yqe(e,t,r,i){let n=i.bufferView,a=e.getTypedArrayForBufferView(n);switch(t.type){case"STRING":{let o=i.stringOffsetBufferView,s=e.getTypedArrayForBufferView(o);a=Xqe(a,s,r);break}default:}return a}function $qe(e,t){for(let r in e){let i=e[r];if(i.class===t)return i}return null}function Xqe(e,t,r){let i=[],n=new TextDecoder("utf8"),a=0,o=4;for(let s=0;s<r;s++){let u=t[(s+1)*o]-t[s*o],l=e.subarray(a,u+a),c=n.decode(l);i.push(c),a+=u}return i}var $te=[B8,M8,D8,j8,q8,U8,G8,N8,z8];function Xte(e,t={},r){var n;let i=$te.filter(a=>Qte(a.name,t));for(let a of i)(n=a.preprocess)==null||n.call(a,e,t,r)}async function Jte(e,t={},r){var n;let i=$te.filter(a=>Qte(a.name,t));for(let a of i)await((n=a.decode)==null?void 0:n.call(a,e,t,r))}function Qte(e,t){var n;let r=((n=t==null?void 0:t.gltf)==null?void 0:n.excludeExtensions)||{};return!(e in r&&!r[e])}var H8="KHR_binary_glTF";function Zte(e){let t=new wi(e),{json:r}=t;for(let i of r.images||[]){let n=t.getObjectExtension(i,H8);n&&Object.assign(i,n),t.removeObjectExtension(i,H8)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(H8)}var ere={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Jqe={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},tre=class{constructor(){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(t,r){this.json=t.json;let i=t.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${i.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(i),this._convertTopLevelObjectsToArrays(i),Zte(t),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}_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 ere)this._convertTopLevelObjectToArray(t,r)}_convertTopLevelObjectToArray(t,r){let i=t[r];if(!(!i||Array.isArray(i))){t[r]=[];for(let n in i){let a=i[n];a.id=a.id||n;let o=t[r].length;t[r].push(a),this.idToIndexMap[r][n]=o}}}_convertObjectIdsToArrayIndices(t){for(let r in ere)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:i,indices:n,material:a}=r;for(let o in i)i[o]=this._convertIdToIndex(i[o],"accessor");n&&(r.indices=this._convertIdToIndex(n,"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 i of t[r])for(let n in i){let a=i[n],o=this._convertIdToIndex(a,n);i[n]=o}}_convertIdToIndex(t,r){let i=Jqe[r];if(i in this.idToIndexMap){let n=this.idToIndexMap[i][t];if(!Number.isFinite(n))throw new Error(`gltf v1: failed to resolve ${r} with id ${t}`);return n}return t}_updateObjects(t){for(let r of this.json.buffers)delete r.type}_updateMaterial(t){var r,i,n;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)||((i=a.values)==null?void 0:i.texture2d_0)||((n=a.values)==null?void 0:n.diffuseTex),s=t.textures.findIndex(u=>u.id===o);s!==-1&&(a.pbrMetallicRoughness.baseColorTexture={index:s})}}};function rre(e,t={}){return new tre().normalize(e,t)}var Qqe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Zqe={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},vs={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},eUe={magFilter:vs.TEXTURE_MAG_FILTER,minFilter:vs.TEXTURE_MIN_FILTER,wrapS:vs.TEXTURE_WRAP_S,wrapT:vs.TEXTURE_WRAP_T},tUe={[vs.TEXTURE_MAG_FILTER]:vs.LINEAR,[vs.TEXTURE_MIN_FILTER]:vs.NEAREST_MIPMAP_LINEAR,[vs.TEXTURE_WRAP_S]:vs.REPEAT,[vs.TEXTURE_WRAP_T]:vs.REPEAT};function rUe(e){return Zqe[e]}function iUe(e){return Qqe[e]}var ire=class{constructor(){this.baseUri="";this.json={};this.buffers=[];this.images=[]}postProcess(t,r={}){let{json:i,buffers:n=[],images:a=[],baseUri:o=""}=t;return Un(i),this.baseUri=o,this.json=i,this.buffers=n,this.images=a,this._resolveTree(this.json,r),this.json}_resolveTree(t,r={}){t.bufferViews&&(t.bufferViews=t.bufferViews.map((i,n)=>this._resolveBufferView(i,n))),t.images&&(t.images=t.images.map((i,n)=>this._resolveImage(i,n))),t.samplers&&(t.samplers=t.samplers.map((i,n)=>this._resolveSampler(i,n))),t.textures&&(t.textures=t.textures.map((i,n)=>this._resolveTexture(i,n))),t.accessors&&(t.accessors=t.accessors.map((i,n)=>this._resolveAccessor(i,n))),t.materials&&(t.materials=t.materials.map((i,n)=>this._resolveMaterial(i,n))),t.meshes&&(t.meshes=t.meshes.map((i,n)=>this._resolveMesh(i,n))),t.nodes&&(t.nodes=t.nodes.map((i,n)=>this._resolveNode(i,n))),t.skins&&(t.skins=t.skins.map((i,n)=>this._resolveSkin(i,n))),t.scenes&&(t.scenes=t.scenes.map((i,n)=>this._resolveScene(i,n))),t.scene!==void 0&&(t.scene=t.scenes[this.json.scene])}getScene(t){return this._get("scenes",t)}getNode(t){return this._get("nodes",t)}getSkin(t){return this._get("skins",t)}getMesh(t){return this._get("meshes",t)}getMaterial(t){return this._get("materials",t)}getAccessor(t){return this._get("accessors",t)}getCamera(t){return null}getTexture(t){return this._get("textures",t)}getSampler(t){return this._get("samplers",t)}getImage(t){return this._get("images",t)}getBufferView(t){return this._get("bufferViews",t)}getBuffer(t){return this._get("buffers",t)}_get(t,r){if(typeof r=="object")return r;let i=this.json[t]&&this.json[t][r];return i||console.warn(`glTF file error: Could not find ${t}[${r}]`),i}_resolveScene(t,r){return t.id=t.id||`scene-${r}`,t.nodes=(t.nodes||[]).map(i=>this.getNode(i)),t}_resolveNode(t,r){return t.id=t.id||`node-${r}`,t.children&&(t.children=t.children.map(i=>this.getNode(i))),t.mesh!==void 0?t.mesh=this.getMesh(t.mesh):t.meshes!==void 0&&t.meshes.length&&(t.mesh=t.meshes.reduce((i,n)=>{let a=this.getMesh(n);return i.id=a.id,i.primitives=i.primitives.concat(a.primitives),i},{primitives:[]})),t.camera!==void 0&&(t.camera=this.getCamera(t.camera)),t.skin!==void 0&&(t.skin=this.getSkin(t.skin)),t}_resolveSkin(t,r){return t.id=t.id||`skin-${r}`,t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}_resolveMesh(t,r){return t.id=t.id||`mesh-${r}`,t.primitives&&(t.primitives=t.primitives.map(i=>{i=ce({},i);let n=i.attributes;i.attributes={};for(let a in n)i.attributes[a]=this.getAccessor(n[a]);return i.indices!==void 0&&(i.indices=this.getAccessor(i.indices)),i.material!==void 0&&(i.material=this.getMaterial(i.material)),i})),t}_resolveMaterial(t,r){if(t.id=t.id||`material-${r}`,t.normalTexture&&(t.normalTexture=ce({},t.normalTexture),t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture=ce({},t.occlustionTexture),t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture=ce({},t.emmisiveTexture),t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.emissiveFactor||(t.emissiveFactor=t.emmisiveTexture?[1,1,1]:[0,0,0]),t.pbrMetallicRoughness){t.pbrMetallicRoughness=ce({},t.pbrMetallicRoughness);let i=t.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=ce({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=ce({},i.metallicRoughnessTexture),i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return t}_resolveAccessor(t,r){if(t.id=t.id||`accessor-${r}`,t.bufferView!==void 0&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=rUe(t.componentType),t.components=iUe(t.type),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){let i=t.bufferView.buffer,{ArrayType:n,byteLength:a}=Pg(t,t.bufferView),o=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+i.byteOffset,s=i.arrayBuffer.slice(o,o+a);t.bufferView.byteStride&&(s=this._getValueFromInterleavedBuffer(i,o,t.bufferView.byteStride,t.bytesPerElement,t.count)),t.value=new n(s)}return t}_getValueFromInterleavedBuffer(t,r,i,n,a){let o=new Uint8Array(a*n);for(let s=0;s<a;s++){let u=r+s*i;o.set(new Uint8Array(t.arrayBuffer.slice(u,u+n)),s*n)}return o.buffer}_resolveTexture(t,r){return t.id=t.id||`texture-${r}`,t.sampler="sampler"in t?this.getSampler(t.sampler):tUe,t.source=this.getImage(t.source),t}_resolveSampler(t,r){t.id=t.id||`sampler-${r}`,t.parameters={};for(let i in t){let n=this._enumSamplerParameter(i);n!==void 0&&(t.parameters[n]=t[i])}return t}_enumSamplerParameter(t){return eUe[t]}_resolveImage(t,r){t.id=t.id||`image-${r}`,t.bufferView!==void 0&&(t.bufferView=this.getBufferView(t.bufferView));let i=this.images[r];return i&&(t.image=i),t}_resolveBufferView(t,r){let i=t.buffer,n=_t(ce({id:`bufferView-${r}`},t),{buffer:this.buffers[i]}),a=this.buffers[i].arrayBuffer,o=this.buffers[i].byteOffset||0;return"byteOffset"in t&&(o+=t.byteOffset),n.data=new Uint8Array(a,o,t.byteLength),n}_resolveCamera(t,r){return t.id=t.id||`camera-${r}`,t.perspective,t.orthographic,t}};function nre(e,t){return new ire().postProcess(e,t)}var are=1735152710,V8=12,b2=8,nUe=1313821514,aUe=5130562,oUe=0,sUe=1,uUe=0,Dg=!0;function lUe(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 ore(e,t=0,r={}){let i=new DataView(e),{magic:n=are}=r,a=i.getUint32(t,!1);return a===n||a===are}function W8(e,t,r=0,i={}){let n=new DataView(t),a=lUe(n,r+0),o=n.getUint32(r+4,Dg),s=n.getUint32(r+8,Dg);switch(Object.assign(e,{header:{byteOffset:r,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),r+=V8,e.version){case 1:return cUe(e,n,r);case 2:return fUe(e,n,r,i={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports v1 and v2.`)}}function cUe(e,t,r){zt(e.header.byteLength>V8+b2);let i=t.getUint32(r+0,Dg),n=t.getUint32(r+4,Dg);return r+=b2,zt(n===uUe),K8(e,t,r,i),r+=i,r+=Y8(e,t,r,e.header.byteLength),r}function fUe(e,t,r,i){return zt(e.header.byteLength>V8+b2),hUe(e,t,r,i),r+e.header.byteLength}function hUe(e,t,r,i){for(;r+8<=e.header.byteLength;){let n=t.getUint32(r+0,Dg),a=t.getUint32(r+4,Dg);switch(r+=b2,a){case nUe:K8(e,t,r,n);break;case aUe:Y8(e,t,r,n);break;case oUe:i.strict||K8(e,t,r,n);break;case sUe:i.strict||Y8(e,t,r,n);break;default:break}r+=Ff(n,4)}return r}function K8(e,t,r,i){let n=new Uint8Array(t.buffer,r,i),o=new TextDecoder("utf8").decode(n);return e.json=JSON.parse(o),Ff(i,4)}function Y8(e,t,r,i){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:i,arrayBuffer:t.buffer}),Ff(i,4)}async function sre(e,t,r=0,i,n){var s,u,l,c;dUe(e,t,r,i),rre(e,{normalize:(s=i==null?void 0:i.gltf)==null?void 0:s.normalize}),Xte(e,i,n);let a=[];if(((u=i==null?void 0:i.gltf)==null?void 0:u.loadBuffers)&&e.json.buffers&&await pUe(e,i,n),(l=i==null?void 0:i.gltf)==null?void 0:l.loadImages){let f=mUe(e,i,n);a.push(f)}let o=Jte(e,i,n);return a.push(o),await Promise.all(a),((c=i==null?void 0:i.gltf)==null?void 0:c.postProcess)?nre(e,i):e}function dUe(e,t,r,i){if(i.uri&&(e.baseUri=i.uri),t instanceof ArrayBuffer&&!ore(t,r,i)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=JO(t);else if(t instanceof ArrayBuffer){let o={};r=W8(o,t,r,i.glb),Un(o.type==="glTF",`Invalid GLB magic string ${o.type}`),e._glb=o,e.json=o.json}else Un(!1,"GLTF: must be ArrayBuffer or string");let n=e.json.buffers||[];if(e.buffers=new Array(n.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 pUe(e,t,r){var n,a;let i=e.json.buffers||[];for(let o=0;o<i.length;++o){let s=i[o];if(s.uri){let{fetch:u}=r;Un(u);let l=I8(s.uri,t),c=await((n=r==null?void 0:r.fetch)==null?void 0:n.call(r,l)),f=await((a=c==null?void 0:c.arrayBuffer)==null?void 0:a.call(c));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 mUe(e,t,r){let i=gUe(e),n=e.json.images||[],a=[];for(let o of i)a.push(vUe(e,n[o],o,t,r));return await Promise.all(a)}function gUe(e){let t=new Set,r=e.json.textures||[];for(let i of r)i.source!==void 0&&t.add(i.source);return Array.from(t).sort()}async function vUe(e,t,r,i,n){let{fetch:a,parse:o}=n,s;if(t.uri&&!t.hasOwnProperty("bufferView")){let l=I8(t.uri,i);s=await(await a(l)).arrayBuffer(),t.bufferView={data:s}}if(Number.isFinite(t.bufferView)){let l=Ute(e.json,e.buffers,t.bufferView);s=_d(l.buffer,l.byteOffset,l.byteLength)}Un(s,"glTF image has no data");let u=await o(s,[Og,Nd],{mimeType:t.mimeType,basis:i.basis||{format:Ig()}},n);u&&u[0]&&(u={compressed:!0,mipmaps:!1,width:u[0].width,height:u[0].height,data:u[0]}),e.images=e.images||[],e.images[r]=u}var zd={name:"glTF",id:"gltf",module:"gltf",version:nte,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:yUe,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};async function yUe(e,t={},r){t=ce(ce({},zd.options),t),t.gltf=ce(ce({},zd.options.gltf),t.gltf);let{byteOffset:i=0}=t;return await sre({},e,i,t,r)}var _2={URI:0,EMBEDDED:1};function x2(e,t,r,i){e.rotateYtoZ=!0;let n=e.byteOffset+e.byteLength-r;if(n===0)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=i["3d-tiles"]&&i["3d-tiles"].assetGltfUpAxis?i["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=_d(t,r,n),e.gltfByteOffset=0,e.gltfByteLength=n,r%4==0||console.warn(`${e.type}: embedded glb is not aligned to a 4-byte boundary.`),e.byteOffset+e.byteLength}async function w2(e,t,r,i){let n=r["3d-tiles"]||{};if(bUe(e,t,r),n.loadGLTF){let{parse:a,fetch:o}=i;e.gltfUrl&&(e.gltfArrayBuffer=await o(e.gltfUrl,r),e.gltfByteOffset=0),e.gltfArrayBuffer&&(e.gltf=await a(e.gltfArrayBuffer,zd,r,i),e.gpuMemoryUsageInBytes=Gb(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength)}}function bUe(e,t,r){switch(t){case _2.URI:let i=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),a=new TextDecoder().decode(i);e.gltfUrl=a.replace(/[\s\0]+$/,""),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case _2.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function ure(e,t,r,i,n){var o;r=_Ue(e,t,r,i,n),await w2(e,_2.EMBEDDED,i,n);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 _Ue(e,t,r,i,n){r=Xf(e,t,r),r=Tg(e,t,r),r=kg(e,t,r,i),r=x2(e,t,r,i);let a=new $f(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",tr.FLOAT,3),r}var eo=Le(Tr()),lre=Le(Ya());async function cre(e,t,r,i,n){return r=xUe(e,t,r,i,n),await w2(e,e.gltfFormat,i,n),r}function xUe(e,t,r,i,n){if(r=Xf(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=Tg(e,t,r);let a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r+=4,r=kg(e,t,r,i),r=x2(e,t,r,i),e.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let o=new $f(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",tr.FLOAT,3);let u=new Sg(e.batchTableJson,e.batchTableBinary,s);return wUe(e,o,u,s),r}function wUe(e,t,r,i){let a={instances:new Array(i),batchTable:e._batchTable,cull:!1,url:void 0,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,forwardAxis:[1,0,0]}.instances,o=new eo.Vector3,s=new eo.Vector3,u=new eo.Vector3,l=new eo.Vector3,c=new eo.Matrix3,f=new eo.Quaternion,h=new eo.Vector3,d={},p=new eo.Matrix4,y=[],g=[],b=new eo.Vector3,E=new eo.Vector3;for(let S=0;S<i;S++){let k;if(t.hasProperty("POSITION"))k=t.getProperty("POSITION",tr.FLOAT,3,S,o);else if(t.hasProperty("POSITION_QUANTIZED")){k=t.getProperty("POSITION_QUANTIZED",tr.UNSIGNED_SHORT,3,S,o);let N=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",tr.FLOAT,3,b);if(!N)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let z=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",tr.FLOAT,3,E);if(!z)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let j=65535;for(let U=0;U<3;U++)k[U]=k[U]/j*z[U]+N[U]}if(!k)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(k),d.translation=o,e.normalUp=t.getProperty("NORMAL_UP",tr.FLOAT,3,S,y),e.normalRight=t.getProperty("NORMAL_RIGHT",tr.FLOAT,3,S,g);let R=!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",tr.UNSIGNED_SHORT,2,y),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",tr.UNSIGNED_SHORT,2,g),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?(lre.Ellipsoid.WGS84.eastNorthUpToFixedFrame(o,p),p.getRotationMatrix3(c)):c.identity()}R&&(l.copy(s).cross(u).normalize(),c.setColumn(0,s),c.setColumn(1,u),c.setColumn(2,l)),f.fromMatrix3(c),d.rotation=f,h.set(1,1,1);let M=t.getProperty("SCALE",tr.FLOAT,1,S);Number.isFinite(M)&&h.multiplyByScalar(M);let I=t.getProperty("SCALE_NON_UNIFORM",tr.FLOAT,3,S,y);I&&h.scale(I),d.scale=h;let L=t.getProperty("BATCH_ID",tr.UNSIGNED_SHORT,1,S);L===void 0&&(L=S);let B=new eo.Matrix4().fromQuaternion(d.rotation);p.identity(),p.translate(d.translation),p.multiplyRight(B),p.scale(d.scale);let V=p.clone();a[S]={modelMatrix:V,batchId:L}}e.instances=a}async function fre(e,t,r,i,n,a){r=Xf(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-r>12;){let s={};e.tiles.push(s),r=await a(t,r,i,n,s)}return r}async function hre(e,t,r,i){e.rotateYtoZ=!0,e.gltfUpAxis=r["3d-tiles"]&&r["3d-tiles"].assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y";let{parse:n}=i;e.gltf=await n(t,zd,r,i),e.gpuMemoryUsageInBytes=Gb(e.gltf)}async function $8(e,t=0,r,i,n={}){switch(n.byteOffset=t,n.type=Oee(e,t),n.type){case Ld.COMPOSITE:return await fre(n,e,t,r,i,$8);case Ld.BATCHED_3D_MODEL:return await ure(n,e,t,r,i);case Ld.GLTF:return await hre(n,e,r,i);case Ld.INSTANCED_3D_MODEL:return await cre(n,e,t,r,i);case Ld.POINT_CLOUD:return await ite(n,e,t,r,i);default:throw new Error(`3DTileLoader: unknown type ${n.type}`)}}var EUe=1952609651,SUe=1;async function X8(e,t,r){if(new Uint32Array(e.slice(0,4))[0]!==EUe)throw new Error("Wrong subtree file magic number");if(new Uint32Array(e.slice(4,8))[0]!==SUe)throw new Error("Wrong subtree file verson, must be 1");let a=dre(e.slice(8,16)),o=new Uint8Array(e,24,a),u=new TextDecoder("utf8").decode(o),l=JSON.parse(u),c=dre(e.slice(16,24)),f=new ArrayBuffer(0);return c&&(f=e.slice(24+a)),"bufferView"in l.tileAvailability&&(l.tileAvailability.explicitBitstream=await J8(l,"tileAvailability",f,r)),"bufferView"in l.contentAvailability&&(l.contentAvailability.explicitBitstream=await J8(l,"contentAvailability",f,r)),"bufferView"in l.childSubtreeAvailability&&(l.childSubtreeAvailability.explicitBitstream=await J8(l,"childSubtreeAvailability",f,r)),l}function AUe(e,t){if(t.startsWith("http")){let a=new URL(e,t);return decodeURI(a.toString())}let i=`http://${t}`,n=new URL(e,i);return`/${n.host}${n.pathname}`}async function J8(e,t,r,i){let n=e[t].bufferView,a=e.bufferViews[n],o=e.buffers[a.buffer];if(!(i==null?void 0:i.url)||!i.fetch)throw new Error("Url is not provided");if(!i.fetch)throw new Error("fetch is not provided");if(o.uri){let s=AUe(o.uri,i==null?void 0:i.url),l=await(await i.fetch(s)).arrayBuffer();return new Uint8Array(l,a.byteOffset,a.byteLength)}return new Uint8Array(r,a.byteOffset,a.byteLength)}function dre(e){let t=new DataView(e),r=t.getUint32(0,!0),i=t.getUint32(4,!0);return r+2**32*i}var E2={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:e2,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:X8,options:{}};var ys=null;try{ys=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 Ei(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}Ei.prototype.__isLong__;Object.defineProperty(Ei.prototype,"__isLong__",{value:!0});function Da(e){return(e&&e.__isLong__)===!0}function pre(e){var t=Math.clz32(e&-e);return e?31-t:t}Ei.isLong=Da;var mre={},gre={};function Hd(e,t){var r,i,n;return t?(e>>>=0,(n=0<=e&&e<256)&&(i=gre[e],i)?i:(r=Wr(e,0,!0),n&&(gre[e]=r),r)):(e|=0,(n=-128<=e&&e<128)&&(i=mre[e],i)?i:(r=Wr(e,e<0?-1:0,!1),n&&(mre[e]=r),r))}Ei.fromInt=Hd;function bs(e,t){if(isNaN(e))return t?Sc:mu;if(t){if(e<0)return Sc;if(e>=yre)return Ere}else{if(e<=-bre)return _o;if(e+1>=bre)return wre}return e<0?bs(-e,t).neg():Wr(e%Fg|0,e/Fg|0,t)}Ei.fromNumber=bs;function Wr(e,t,r){return new Ei(e,t,r)}Ei.fromBits=Wr;var S2=Math.pow;function Q8(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?Sc:mu;if(r=r||10,r<2||36<r)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(i===0)return Q8(e.substring(1),t,r).neg();for(var n=bs(S2(r,8)),a=mu,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 l=bs(S2(r,s));a=a.mul(l).add(bs(u))}else a=a.mul(n),a=a.add(bs(u))}return a.unsigned=t,a}Ei.fromString=Q8;function pu(e,t){return typeof e=="number"?bs(e,t):typeof e=="string"?Q8(e,t):Wr(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}Ei.fromValue=pu;var vre=1<<16,TUe=1<<24,Fg=vre*vre,yre=Fg*Fg,bre=yre/2,_re=Hd(TUe),mu=Hd(0);Ei.ZERO=mu;var Sc=Hd(0,!0);Ei.UZERO=Sc;var jg=Hd(1);Ei.ONE=jg;var xre=Hd(1,!0);Ei.UONE=xre;var Z8=Hd(-1);Ei.NEG_ONE=Z8;var wre=Wr(4294967295|0,2147483647|0,!1);Ei.MAX_VALUE=wre;var Ere=Wr(4294967295|0,4294967295|0,!0);Ei.MAX_UNSIGNED_VALUE=Ere;var _o=Wr(0,2147483648|0,!1);Ei.MIN_VALUE=_o;var He=Ei.prototype;He.toInt=function(){return this.unsigned?this.low>>>0:this.low};He.toNumber=function(){return this.unsigned?(this.high>>>0)*Fg+(this.low>>>0):this.high*Fg+(this.low>>>0)};He.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(_o)){var r=bs(t),i=this.div(r),n=i.mul(r).sub(this);return i.toString(t)+n.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var a=bs(S2(t,6),this.unsigned),o=this,s="";;){var u=o.div(a),l=o.sub(u.mul(a)).toInt()>>>0,c=l.toString(t);if(o=u,o.isZero())return c+s;for(;c.length<6;)c="0"+c;s=""+c+s}};He.getHighBits=function(){return this.high};He.getHighBitsUnsigned=function(){return this.high>>>0};He.getLowBits=function(){return this.low};He.getLowBitsUnsigned=function(){return this.low>>>0};He.getNumBitsAbs=function(){if(this.isNegative())return this.eq(_o)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&(t&1<<r)==0;r--);return this.high!=0?r+33:r+1};He.isZero=function(){return this.high===0&&this.low===0};He.eqz=He.isZero;He.isNegative=function(){return!this.unsigned&&this.high<0};He.isPositive=function(){return this.unsigned||this.high>=0};He.isOdd=function(){return(this.low&1)==1};He.isEven=function(){return(this.low&1)==0};He.equals=function(t){return Da(t)||(t=pu(t)),this.unsigned!==t.unsigned&&this.high>>>31==1&&t.high>>>31==1?!1:this.high===t.high&&this.low===t.low};He.eq=He.equals;He.notEquals=function(t){return!this.eq(t)};He.neq=He.notEquals;He.ne=He.notEquals;He.lessThan=function(t){return this.comp(t)<0};He.lt=He.lessThan;He.lessThanOrEqual=function(t){return this.comp(t)<=0};He.lte=He.lessThanOrEqual;He.le=He.lessThanOrEqual;He.greaterThan=function(t){return this.comp(t)>0};He.gt=He.greaterThan;He.greaterThanOrEqual=function(t){return this.comp(t)>=0};He.gte=He.greaterThanOrEqual;He.ge=He.greaterThanOrEqual;He.compare=function(t){if(Da(t)||(t=pu(t)),this.eq(t))return 0;var r=this.isNegative(),i=t.isNegative();return r&&!i?-1:!r&&i?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};He.comp=He.compare;He.negate=function(){return!this.unsigned&&this.eq(_o)?_o:this.not().add(jg)};He.neg=He.negate;He.add=function(t){Da(t)||(t=pu(t));var r=this.high>>>16,i=this.high&65535,n=this.low>>>16,a=this.low&65535,o=t.high>>>16,s=t.high&65535,u=t.low>>>16,l=t.low&65535,c=0,f=0,h=0,d=0;return d+=a+l,h+=d>>>16,d&=65535,h+=n+u,f+=h>>>16,h&=65535,f+=i+s,c+=f>>>16,f&=65535,c+=r+o,c&=65535,Wr(h<<16|d,c<<16|f,this.unsigned)};He.subtract=function(t){return Da(t)||(t=pu(t)),this.add(t.neg())};He.sub=He.subtract;He.multiply=function(t){if(this.isZero())return this;if(Da(t)||(t=pu(t)),ys){var r=ys.mul(this.low,this.high,t.low,t.high);return Wr(r,ys.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?Sc:mu;if(this.eq(_o))return t.isOdd()?_o:mu;if(t.eq(_o))return this.isOdd()?_o:mu;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(_re)&&t.lt(_re))return bs(this.toNumber()*t.toNumber(),this.unsigned);var i=this.high>>>16,n=this.high&65535,a=this.low>>>16,o=this.low&65535,s=t.high>>>16,u=t.high&65535,l=t.low>>>16,c=t.low&65535,f=0,h=0,d=0,p=0;return p+=o*c,d+=p>>>16,p&=65535,d+=a*c,h+=d>>>16,d&=65535,d+=o*l,h+=d>>>16,d&=65535,h+=n*c,f+=h>>>16,h&=65535,h+=a*l,f+=h>>>16,h&=65535,h+=o*u,f+=h>>>16,h&=65535,f+=i*c+n*l+a*u+o*s,f&=65535,Wr(d<<16|p,f<<16|h,this.unsigned)};He.mul=He.multiply;He.divide=function(t){if(Da(t)||(t=pu(t)),t.isZero())throw Error("division by zero");if(ys){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?ys.div_u:ys.div_s)(this.low,this.high,t.low,t.high);return Wr(r,ys.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Sc:mu;var i,n,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Sc;if(t.gt(this.shru(1)))return xre;a=Sc}else{if(this.eq(_o)){if(t.eq(jg)||t.eq(Z8))return _o;if(t.eq(_o))return jg;var o=this.shr(1);return i=o.div(t).shl(1),i.eq(mu)?t.isNegative()?jg:Z8:(n=this.sub(t.mul(i)),a=i.add(n.div(t)),a)}else if(t.eq(_o))return this.unsigned?Sc:mu;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=mu}for(n=this;n.gte(t);){i=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(i)/Math.LN2),u=s<=48?1:S2(2,s-48),l=bs(i),c=l.mul(t);c.isNegative()||c.gt(n);)i-=u,l=bs(i,this.unsigned),c=l.mul(t);l.isZero()&&(l=jg),a=a.add(l),n=n.sub(c)}return a};He.div=He.divide;He.modulo=function(t){if(Da(t)||(t=pu(t)),ys){var r=(this.unsigned?ys.rem_u:ys.rem_s)(this.low,this.high,t.low,t.high);return Wr(r,ys.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};He.mod=He.modulo;He.rem=He.modulo;He.not=function(){return Wr(~this.low,~this.high,this.unsigned)};He.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};He.clz=He.countLeadingZeros;He.countTrailingZeros=function(){return this.low?pre(this.low):pre(this.high)+32};He.ctz=He.countTrailingZeros;He.and=function(t){return Da(t)||(t=pu(t)),Wr(this.low&t.low,this.high&t.high,this.unsigned)};He.or=function(t){return Da(t)||(t=pu(t)),Wr(this.low|t.low,this.high|t.high,this.unsigned)};He.xor=function(t){return Da(t)||(t=pu(t)),Wr(this.low^t.low,this.high^t.high,this.unsigned)};He.shiftLeft=function(t){return Da(t)&&(t=t.toInt()),(t&=63)==0?this:t<32?Wr(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):Wr(0,this.low<<t-32,this.unsigned)};He.shl=He.shiftLeft;He.shiftRight=function(t){return Da(t)&&(t=t.toInt()),(t&=63)==0?this:t<32?Wr(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):Wr(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};He.shr=He.shiftRight;He.shiftRightUnsigned=function(t){return Da(t)&&(t=t.toInt()),(t&=63)==0?this:t<32?Wr(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?Wr(this.high,0,this.unsigned):Wr(this.high>>>t-32,0,this.unsigned)};He.shru=He.shiftRightUnsigned;He.shr_u=He.shiftRightUnsigned;He.rotateLeft=function(t){var r;return Da(t)&&(t=t.toInt()),(t&=63)==0?this:t===32?Wr(this.high,this.low,this.unsigned):t<32?(r=32-t,Wr(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,Wr(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))};He.rotl=He.rotateLeft;He.rotateRight=function(t){var r;return Da(t)&&(t=t.toInt()),(t&=63)==0?this:t===32?Wr(this.high,this.low,this.unsigned):t<32?(r=32-t,Wr(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,Wr(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};He.rotr=He.rotateRight;He.toSigned=function(){return this.unsigned?Wr(this.low,this.high,!1):this};He.toUnsigned=function(){return this.unsigned?this:Wr(this.low,this.high,!0)};He.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};He.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]};He.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]};Ei.fromBytes=function(t,r,i){return i?Ei.fromBytesLE(t,r):Ei.fromBytesBE(t,r)};Ei.fromBytesLE=function(t,r){return new Ei(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};Ei.fromBytesBE=function(t,r){return new Ei(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)};var Lg=Ei;var kUe=16;function Wb(e){e==="X"&&(e="");let t=e.padEnd(kUe,"0");return Lg.fromString(t,!0,16)}function eM(e){if(e.isZero())return"X";let t=e.countTrailingZeros(),r=t%4;t=(t-r)/4;let i=t;t*=4;let a=e.shiftRightUnsigned(t).toString(16).replace(/0+$/,"");return Array(17-i-a.length).join("0")+a}function tM(e,t){let r=RUe(e).shiftRightUnsigned(2);return e.add(Lg.fromNumber(2*t+1-4).multiply(r))}function RUe(e){return e.and(e.not().add(1))}var CUe=3,IUe=30,OUe=2*IUe+1,Sre=180/Math.PI;function Are(e){if(e.length===0)throw new Error(`Invalid Hilbert quad key ${e}`);let t=e.split("/"),r=parseInt(t[0],10),i=t[1],n=i.length,a=0,o=[0,0];for(let s=n-1;s>=0;s--){a=n-s;let u=i[s],l=0,c=0;u==="1"?c=1:u==="2"?(l=1,c=1):u==="3"&&(l=1);let f=Math.pow(2,a-1);PUe(f,o,l,c),o[0]+=f*l,o[1]+=f*c}if(r%2==1){let s=o[0];o[0]=o[1],o[1]=s}return{face:r,ij:o,level:a}}function Tre(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<CUe+OUe;)t="0"+t;let r=t.lastIndexOf("1"),i=t.substring(0,3),n=t.substring(3,r),a=n.length/2,o=Lg.fromString(i,!0,2).toString(10),s="";if(a!==0)for(s=Lg.fromString(n,!0,2).toString(4);s.length<a;)s="0"+s;return`${o}/${s}`}function rM(e,t,r){let i=1<<t;return[(e[0]+r[0])/i,(e[1]+r[1])/i]}function kre(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function iM(e){return[kre(e[0]),kre(e[1])]}function nM(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 aM([e,t,r]){let i=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*Sre,i*Sre]}function PUe(e,t,r,i){if(i===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let n=t[0];t[0]=t[1],t[1]=n}}function Rre(e){let t=rM(e.ij,e.level,[.5,.5]),r=iM(t),i=nM(e.face,r);return aM(i)}var BUe=100;function oM(e){let{face:t,ij:r,level:i}=e,n=[[0,0],[0,1],[1,1],[1,0],[0,0]],a=Math.max(1,Math.ceil(BUe*Math.pow(2,-i))),o=new Float64Array(4*a*2+2),s=0,u=0;for(let l=0;l<4;l++){let c=n[l].slice(0),f=n[l+1],h=(f[0]-c[0])/a,d=(f[1]-c[1])/a;for(let p=0;p<a;p++){c[0]+=h,c[1]+=d;let y=rM(r,i,c),g=iM(y),b=nM(t,g),E=aM(b);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 Ng(e){let t=MUe(e);return Are(t)}function MUe(e){if(e.indexOf("/")>0)return e;let t=Wb(e);return Tre(t)}function sM(e){let t=Ng(e);return Rre(t)}function Cre(e){let t;if(e.face===2||e.face===5){let r=null,i=0;for(let n=0;n<4;n++){let a=`${e.face}/${n}`,o=Ng(a),s=oM(o);(typeof r=="undefined"||r===null)&&(r=new Float64Array(4*s.length)),r.set(s,i),i+=s.length}t=Ire(r)}else{let r=oM(e);t=Ire(r)}return t}function Ire(e){if(e.length%2!=0)throw new Error("Invalid corners");let t=[],r=[];for(let i=0;i<e.length;i+=2)t.push(e[i]),r.push(e[i+1]);return t.sort((i,n)=>i-n),r.sort((i,n)=>i-n),{west:t[0],east:t[t.length-1],north:r[r.length-1],south:r[0]}}var Ac=Le(Tr());function uM(e,t){let r=(t==null?void 0:t.minimumHeight)||0,i=(t==null?void 0:t.maximumHeight)||0,n=Ng(e),a=Cre(n),o=a.west,s=a.south,u=a.east,l=a.north,c=[];return c.push(new Ac.Vector3(o,l,r)),c.push(new Ac.Vector3(u,l,r)),c.push(new Ac.Vector3(u,s,r)),c.push(new Ac.Vector3(o,s,r)),c.push(new Ac.Vector3(o,l,i)),c.push(new Ac.Vector3(u,l,i)),c.push(new Ac.Vector3(u,s,i)),c.push(new Ac.Vector3(o,s,i)),c}var Ore=Le(Tr()),Pre=Le(cl());var Bre=Le(Ya());function A2(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},i=uM(t,r),n=sM(t),a=n[0],o=n[1],s=Bre.Ellipsoid.WGS84.cartographicToCartesian([a,o,r.maximumHeight]),u=new Ore.Vector3(s[0],s[1],s[2]);i.push(u);let l=(0,Pre.makeOrientedBoundingBoxFromPoints)(i);return[...l.center,...l.halfAxes]}var DUe=4,FUe=8,jUe={QUADTREE:DUe,OCTREE:FUe};function LUe(e,t,r){if(e==null?void 0:e.box){let i=Wb(e.s2VolumeInfo.token),n=tM(i,t),a=eM(n),o=ce({},e.s2VolumeInfo);switch(o.token=a,r){case"OCTREE":let l=e.s2VolumeInfo,c=l.maximumHeight-l.minimumHeight,f=c/2,h=l.minimumHeight+c/2;l.minimumHeight=h-f,l.maximumHeight=h+f;break;default:break}return{box:A2(o),s2VolumeInfo:o}}}async function lM(e){let{options:t,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:i=0,globalData:n={level:0,mortonIndex:0,x:0,y:0,z:0},s2VolumeBox:a}=e,{subtree:o,level:s=0}=e,{subdivisionScheme:u,subtreeLevels:l,maximumLevel:c,contentUrlTemplate:f,subtreesUriTemplate:h,basePath:d}=t,p={children:[],lodMetricValue:0,contentUrl:""},y=jUe[u],g=i&1,b=i>>1&1,E=i>>2&1,S=(y**s-1)/(y-1),k=Vd(r.mortonIndex,i),R=S+k,M=Vd(r.x,g),I=Vd(r.y,b),L=Vd(r.z,E),B=!1;s+1>l&&(B=cM(o.childSubtreeAvailability,k));let V=Vd(n.x,M),N=Vd(n.y,I),z=Vd(n.z,L),j=s+n.level;if(B){let ne=`${d}/${h}`,ue=T2(ne,j,V,N,z);o=await ci(ue,E2),n.mortonIndex=k,n.x=M,n.y=I,n.z=L,n.level=s,k=0,R=0,M=0,I=0,L=0,s=0}if(!cM(o.tileAvailability,R)||s>c)return p;cM(o.contentAvailability,R)&&(p.contentUrl=T2(f,j,V,N,z));let Z=s+1,te={mortonIndex:k,x:M,y:I,z:L};for(let ne=0;ne<y;ne++){let ue=LUe(a,ne,u),me=await lM({subtree:o,options:t,parentData:te,childIndex:ne,level:Z,globalData:n,s2VolumeBox:ue});if(me.contentUrl||me.children.length){let Ne=j+1,Ue=NUe(me,Ne,{childTileX:M,childTileY:I,childTileZ:L},t,a);p.children.push(Ue)}}return p}function cM(e,t){return"constant"in e?Boolean(e.constant):e.explicitBitstream?GUe(t,e.explicitBitstream):!1}function NUe(e,t,r,i,n){let{basePath:a,refine:o,getRefine:s,lodMetricType:u,getTileType:l,rootLodMetricValue:c,rootBoundingVolume:f}=i,h=e.contentUrl&&e.contentUrl.replace(`${a}/`,""),d=c/2**t,p=(n==null?void 0:n.box)?{box:n.box}:f,y=qUe(t,p,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:h},id:e.contentUrl,refine:s(o),type:l(e),lodMetricType:u,lodMetricValue:d,geometricError:d,transform:e.transform,boundingVolume:y}}function qUe(e,t,r){if(t.region){let{childTileX:i,childTileY:n,childTileZ:a}=r,[o,s,u,l,c,f]=t.region,h=2**e,d=(u-o)/h,p=(l-s)/h,y=(f-c)/h,[g,b]=[o+d*i,o+d*(i+1)],[E,S]=[s+p*n,s+p*(n+1)],[k,R]=[c+y*a,c+y*(a+1)];return{region:[g,E,b,S,k,R]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${t}`)}function Vd(e,t){return parseInt(e.toString(2)+t.toString(2),2)}function T2(e,t,r,i,n){let a=UUe({level:t,x:r,y:i,z:n});return e.replace(/{level}|{x}|{y}|{z}/gi,o=>a[o])}function UUe(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function GUe(e,t){let r=Math.floor(e/8),i=e%8;return(t[r]>>i&1)===1}function fM(e){if(!e.contentUrl)return Fd.EMPTY;let r=e.contentUrl.split("?")[0].split(".").pop();switch(r){case"pnts":return Fd.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return Fd.SCENEGRAPH;default:return r}}function hM(e){switch(e){case"REPLACE":case"replace":return Ba.REPLACE;case"ADD":case"add":return Ba.ADD;default:return e}}function dM(e,t){if(/^[a-z][0-9a-z+.-]*:/i.test(t)){let i=new URL(e,`${t}/`);return decodeURI(i.toString())}else if(e.startsWith("/"))return e;return`${t}/${e}`}function Mre(e,t){if(!e)return null;if(e.content){let r=e.content.uri||e.content.url;e.contentUrl=dM(r,t.basePath)}return e.id=e.contentUrl,e.lodMetricType=jd.GEOMETRIC_ERROR,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,e.type=fM(e),e.refine=hM(e.refine),e}async function Dre(e,t){let r=e.basePath,i,n=jre(e==null?void 0:e.root);n&&e.root?i=await Fre(e.root,e,n,t):i=Mre(e.root,e);let a=[];for(a.push(i);a.length>0;){let s=(a.pop()||{}).children||[];for(let u of s){let l=jre(u);l?u=await Fre(u,e,l,t):Mre(u,{basePath:r}),a.push(u)}}return i}async function Fre(e,t,r,i){var E,S;let n=t.basePath,{subdivisionScheme:a,maximumLevel:o,subtreeLevels:s,subtrees:{uri:u}}=r,l=T2(u,0,0,0,0),c=dM(l,n),f=await ci(c,E2,i),h=dM(e.content.uri,n),d=(E=t==null?void 0:t.root)==null?void 0:E.refine,p=e.geometricError,y=(S=e.boundingVolume.extensions)==null?void 0:S["3DTILES_bounding_volume_S2"];if(y){let R={box:A2(y),s2VolumeInfo:y};e.boundingVolume=R}let g=e.boundingVolume,b={contentUrlTemplate:h,subtreesUriTemplate:u,subdivisionScheme:a,subtreeLevels:s,maximumLevel:o,refine:d,basePath:n,lodMetricType:jd.GEOMETRIC_ERROR,rootLodMetricValue:p,rootBoundingVolume:g,getTileType:fM,getRefine:hM};return await zUe(e,f,b)}async function zUe(e,t,r){if(!e)return null;e.lodMetricType=jd.GEOMETRIC_ERROR,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform;let{children:i,contentUrl:n}=await lM({subtree:t,options:r,s2VolumeBox:e});return n&&(e.contentUrl=n,e.content={uri:n.replace(`${r.basePath}/`,"")}),e.refine=hM(e.refine),e.type=fM(e),e.children=i,e.id=e.contentUrl,e}function jre(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 Tc={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:e2,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:KUe,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};function HUe(e){return au.dirname(e.url)}async function VUe(e,t,r){let i={content:{featureIds:null}};return await $8(e,0,t,r,i.content),i.content}async function WUe(e,t,r){var n;let i=JSON.parse(new TextDecoder().decode(e));return i.loader=t.loader||Tc,i.url=r.url,i.queryString=r.queryString,i.basePath=HUe(i),i.root=await Dre(i,t),i.type=aa.TILES3D,i.lodMetricType=jd.GEOMETRIC_ERROR,i.lodMetricValue=((n=i.root)==null?void 0:n.lodMetricValue)||0,i}async function KUe(e,t,r){let i=t["3d-tiles"]||{},n;return i.isTileset==="auto"?n=r.url&&r.url.indexOf(".json")!==-1:n=i.isTileset,n?e=await WUe(e,t,r):e=await VUe(e,t,r),e}var Lre="https://api.cesium.com/v1/assets";async function Nre(e,t){if(!t){let a=await YUe(e);for(let o of a.items)o.type==="3DTILES"&&(t=o.id)}let r=await $Ue(e,t),{type:i,url:n}=r;return zt(i==="3DTILES"&&n),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function YUe(e){zt(e);let t=Lre,r={Authorization:`Bearer ${e}`},i=await na(t,{fetch:{headers:r}});if(!i.ok)throw new Error(i.statusText);return await i.json()}async function $Ue(e,t){zt(e,t);let r={Authorization:`Bearer ${e}`},i=`${Lre}/${t}`,n=await na(`${i}`,{fetch:{headers:r}});if(!n.ok)throw new Error(n.statusText);let a=await n.json();if(n=await na(`${i}/endpoint`,{fetch:{headers:r}}),!n.ok)throw new Error(n.statusText);let o=await n.json();return a=ce(ce({},a),o),a}async function XUe(e,t={}){t=t["cesium-ion"]||{};let{accessToken:r}=t,i=t.assetId;if(!Number.isFinite(i)){let n=e.match(/\/([0-9]+)\/tileset.json/);i=n&&n[1]}return Nre(r,i)}var k2=_t(ce({},Tc),{id:"cesium-ion",name:"Cesium Ion",preload:XUe,parse:async(e,t,r)=>(t=ce({},t),t["3d-tiles"]=t["cesium-ion"],t.loader=k2,Tc.parse(e,t,r)),options:{"cesium-ion":_t(ce({},Tc.options["3d-tiles"]),{accessToken:null})}});var Na=Le(require("path"));var pl=Le(iie()),yCt=pl.default.v1,bCt=pl.default.v3,Rc=pl.default.v4,_Ct=pl.default.v5,xCt=pl.default.NIL,wCt=pl.default.version,ECt=pl.default.validate,SCt=pl.default.stringify,ACt=pl.default.parse;var jp=Le(require("process")),qk=Le(vu()),RL=Le(SM());var Y0=Le(require("path")),vge=Le(vu());var pie=()=>({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 W0=Le(require("fs")),K0=Le(require("path"));var dge=Le(require("zlib")),pge=Le(require("path")),q_=Le(require("fs")),Zut=Le(Vhe());var elt=Le(uL());var tlt=Le(xM());function Ck(e){let t=`${e}.gz`,r=(0,dge.createGzip)(),i=(0,q_.createReadStream)(e),n=(0,q_.createWriteStream)(t);return new Promise((a,o)=>{i.on("end",()=>{console.log(`${t} compressed and saved.`),a(t)}),i.on("error",s=>{console.log(`${t}: compression error!`),o(s)}),i.pipe(r).pipe(n)})}async function mge(e,t,r,i,n){process.platform==="win32"?await ilt(e,t,r,i,n):await rlt(e,t,r,i)}async function rlt(e,t,r=0,i="."){let n=U_(t),a=[`-${r}`,"-r",n,i];await new Df().start({command:"zip",arguments:a,spawn:{cwd:e},wait:0})}async function ilt(e,t,r=0,i=(0,pge.join)(".","*"),n){i[0]==="@"&&(i=`*${i.substr(1)}`);let a=U_(t),o=["a","-tzip",`-mx=${r}`,a,i];await new Df().start({command:n,arguments:o,spawn:{cwd:`${e}`},wait:0})}async function Hn(e,t,r="index.json"){let i;t instanceof Promise?i=new Uint8Array(await t):t instanceof ArrayBuffer?i=new Uint8Array(t):i=t,await W0.promises.mkdir(e,{recursive:!0});let n=(0,K0.join)(e,r);try{await W0.promises.writeFile(n,i)}catch(a){throw a}return console.log(`${n} saved.`),n}async function Cl(e,t,r="index.json",i=!0,n){let a=await Hn(e,t,r);if(i){if(n)return n.includes(a)?null:(n.push(a),`${a}.gz`);{let o=await Ck(a);return await lL(a),o}}return a}async function Ik(e,t){return new Promise((r,i)=>{let n=0;console.log(`load ${e}/${t}.`);let a=setInterval(()=>{let o=(0,K0.join)(e,t);ci(o,iP).then(s=>{clearInterval(a),r(s)}).catch(()=>{n++,n>100&&(clearInterval(a),i(new Error(`Cannon load ${e}/${t}.`)))})},200)})}async function gge(e){try{return await W0.promises.stat(e),!0}catch{return!1}}function G_(e){return W0.promises.rmdir(e,{recursive:!0})}function lL(e){return W0.promises.unlink(e)}function U_(e){return(0,K0.isAbsolute)(e)?e:(0,K0.join)(process.cwd(),e)}var wo=class{constructor(t,r,i){this.length=0;this.nodesPerPage=r,this.nodesCounter=0,this.nodePages=[{}],this.nodePages[0].nodes=[],this.writeFile=t,this.converter=i,this.length=0}useWriteFunction(t){this.writeFile=t}getNodePageFileName(t){let r,i;return this.converter.options.slpk?(r=(0,Y0.join)(this.converter.layers0Path,"nodepages"),i=`${t.toString()}.json`):(r=(0,Y0.join)(this.converter.layers0Path,"nodepages",t.toString()),i="index.json"),{filePath:r,fileName:i}}async loadNodePage(t){let{filePath:r,fileName:i}=this.getNodePageFileName(t),n=(0,Y0.join)(r,i);return await gge(n)?(console.log(`load ${n}.`),await Ik(r,i)):{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 i=t%this.nodesPerPage;return r=r||await this.getPageByNodeId(t),r.nodes[i]}async addChildRelation(t,r){var n;if(t==null)return;let i=await this.getNodeById(t);(n=i.children)==null||n.push(r),await this.saveNode(i)}async push(t,r){if(t.index=this.nodesCounter++,!this.converter.options.instantNodeWriting){let i=this.nodePages[this.nodePages.length-1];i.nodes.length===this.nodesPerPage&&(i={nodes:[]},this.nodePages.push(i)),i.nodes.push(t)}return await this.addChildRelation(r,t.index),wo.updateResourceInMesh(t),await this.saveNode(t),t}async saveNode(t){if(this.converter.options.instantNodeWriting){let r=this.getPageIndexByNodeId(t.index),i=await this.getPageByNodeId(t.index),{filePath:n,fileName:a}=this.getNodePageFileName(r),o=await this.getNodeById(t.index,i);o?wo.updateAll(o,t):i.nodes.push(t);let s=JSON.stringify(i);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodePages/${r.toString()}.json.gz`,writePromise:()=>this.writeFile(n,s,a,!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>this.writeFile(n,s)},!0)}else return}async saveMetadata(){let t=(0,vge.default)({nodeCount:this.nodesCounter},pie()),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 i=JSON.stringify(r),n=(0,Y0.join)(this.converter.layers0Path,"nodepages");await this.converter.writeQueue.enqueue({archiveKey:`nodePages/${t.toString()}.json.gz`,writePromise:()=>this.writeFile(n,i,`${t.toString()}.json`)})}await this.saveMetadata()}else for(let[t,r]of this.nodePages.entries()){let i=JSON.stringify(r),n=(0,Y0.join)(this.converter.layers0Path,"nodepages",t.toString());await this.converter.writeQueue.enqueue({writePromise:()=>this.writeFile(n,i)})}}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}),wo.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 z_=Le(require("path")),Ok=Le(require("fs"));function Pk(e){let t=1e6,r=e[0],i=Math.floor(r/3600);r=r-i*3600;let n=Math.floor(r/60);r=r-n*60;let a=Math.floor(r),o=e[1]/t,s="";return i&&(s+=`${i}h `),n&&(s+=`${n}m `),a&&(s+=`${a}s`),s||(s+=`${o}ms`),s}async function Bk(e){let{slpk:t,outputPath:r,tilesetName:i}=e,n=U_(r);try{if(t){let s=(0,z_.join)(n,`${i}.slpk`);return(await Ok.promises.stat(s)).size}let a=(0,z_.join)(n,i);return await yge(a)}catch(a){return console.log("Calculate file sizes error: ",a),null}}async function yge(e){let t=0,r=await Ok.promises.readdir(e);for(let i of r){let n=await Ok.promises.stat((0,z_.join)(e,i));n.isDirectory()?t+=await yge((0,z_.join)(e,i)):t+=n.size}return t}var Ds=Le(Tr()),pL=Le(Ya());var Dge=Le(SM());var Fp=3,$0=9;function bge(e){let{positions:t,normals:r,texCoords:i,colors:n,uvRegions:a,featureIndices:o}=e,s=t.length/$0;if(!o.length)return{faceRange:new Uint32Array([0,s-1]),featureIds:[0],featureCount:1,positions:t,normals:r,texCoords:i,colors:n,uvRegions:a};let u=nlt(o),l=alt(ce(ce({},u),e)),c=olt(l);return slt(c,u.featureCount)}function nlt(e){let t=1,r=1,i=_ge(e.slice(0,Fp)),n=[],a=[],o=[i];n[0]=0,a[0]=i;for(let l=Fp;l<e.length;l+=Fp){let c=_ge(e.slice(l,l+Fp));i!==c&&(n[t]=l/Fp-1,n[t+1]=l/Fp,a[r]=c,o.includes(c)||o.push(c),t+=2,r+=1),i=c}n[t]=e.length/Fp-1;let s=new Uint32Array(n),u=o.length;return{faceRange:s,featureCount:u,featureIds:a}}function _ge(e){let t={},r=e[0],i=1;for(let n of e)t[n]=(t[n]||0)+1,i=i>t[n]?i:t[n],r=i>t[n]?r:n;return r}function alt(e){let{featureIds:t,positions:r,normals:i,colors:n,uvRegions:a,texCoords:o,faceRange:s=new Uint32Array(0)}=e,u=[],l=new Float32Array(r),c=new Float32Array(i),f=new Uint8Array(n),h=new Float32Array(o),d=new Uint16Array(a);for(let p=0;p<t.length;p++){let y=s[p*2],g=s[p*2+1],b=H_("positions",y,g),E=H_("normals",y,g),S=H_("colors",y,g),k=H_("uvRegions",y,g),R=H_("texCoords",y,g);u.push({featureId:t[p],positions:l.slice(0,b),normals:c.slice(0,E),colors:f.slice(0,S),uvRegions:d.slice(0,k),texCoords:h.slice(0,R)}),l=l.slice(b),c=c.slice(E),f=f.slice(S),d=d.slice(k),h=h.slice(R)}return u.sort((p,y)=>p.featureId-y.featureId)}function H_(e,t,r){let i=4,n=2,a=r-t+1,o=a*3;switch(e){case"positions":case"normals":return a*$0;case"colors":case"uvRegions":return o*i;case"texCoords":return o*n;default:return 0}}function olt(e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],n=t.find(a=>a.featureId===i.featureId);n?(n.positions=ha(n.positions,i.positions),n.normals=ha(n.normals,i.normals),n.colors=ha(n.colors,i.colors),n.texCoords=ha(n.texCoords,i.texCoords)):t.push(i)}return t}function slt(e,t){let r=e[0],i=[r.featureId||0],n=new Float32Array(r.positions),a=new Float32Array(r.normals),o=new Uint8Array(r.colors),s=new Uint16Array(r.uvRegions),u=new Float32Array(r.texCoords),l=[0],c=0,f=0;for(let d=1;d<e.length;d++){let p=e[d];i.push(p.featureId||0),n=ha(n,p.positions),a=ha(a,p.normals),o=ha(o,p.colors),s=ha(s,p.uvRegions),u=ha(u,p.texCoords);let y=e[c];l.push(y.positions.length/$0-1+f),l.push(y.positions.length/$0+f),f+=y.positions.length/$0,c+=1}return l.push(n.length/$0-1),{faceRange:new Uint32Array(l),featureIds:i,positions:n,normals:a,colors:o,uvRegions:s,texCoords:u,featureCount:t}}var La=Le(Tr()),X0=Le(Ya()),Kc=Le(cl());function cL(e,t){let r,i,n,a=e.boundingVolume,o=X0.Ellipsoid.WGS84.cartesianToCartographic(a.center,new La.Vector3);return o[2]=o[2]-t.getHeight(o[1],o[0]),a instanceof Kc.OrientedBoundingBox?(i=a.halfSize,r=new La.Vector3(i[0],i[1],i[2]).len(),n=a.quaternion):(r=e.boundingVolume.radius,i=[r,r,r],n=new La.Quaternion().fromMatrix3(new La.Matrix3([i[0],0,0,0,i[1],0,0,0,i[2]])).normalize()),{mbs:[o[0],o[1],o[2],r],obb:{center:[o[0],o[1],o[2]],halfSize:i,quaternion:n}}}function xge(e,t){let r=ult(e),i=(0,Kc.makeOrientedBoundingBoxFromPoints)(r),n=(0,Kc.makeBoundingSphereFromPoints)(r),a=X0.Ellipsoid.WGS84.cartesianToCartographic(n.center,new La.Vector3),o=X0.Ellipsoid.WGS84.cartesianToCartographic(i.center,new La.Vector3);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],n.radius],obb:{center:o,halfSize:i.halfSize,quaternion:i.quaternion}}}function ult(e){let t=[];for(let r=0;r<e.length;r+=3){let i=new La.Vector3([e[r],e[r+1],e[r+2]]);t.push(i)}return t}function wge(e){let t;e instanceof Kc.BoundingSphere?t=e:t=e.getBoundingSphere();let r=t.center,i=t.radius,n=X0.Ellipsoid.WGS84.cartesianToCartographic(new La.Vector3(r[0]+i,r[1]+i,r[2]+i),new La.Vector3),a=X0.Ellipsoid.WGS84.cartesianToCartographic(new La.Vector3(r[0]-i,r[1]-i,r[2]-i),new La.Vector3);return{xmin:Math.min(a[0],n[0]),xmax:Math.max(a[0],n[0]),ymin:Math.min(a[1],n[1]),ymax:Math.max(a[1],n[1]),zmin:Math.min(a[2],n[2]),zmax:Math.max(a[2],n[2])}}function fL(e){let t=e[3],r=new La.Vector3(e[0],e[1],e[2]),i=new La.Matrix3([t,0,0,0,t,0,0,0,t]);return new Kc.OrientedBoundingBox(r,i)}function llt(e){let t={};for(let r in e)t[r]={value:e[r].value};return t}function Ege(e){var a,o,s,u,l,c,f,h;let t=((o=(a=e.gltf)==null?void 0:a.scene)==null?void 0:o.nodes)||((l=(u=(s=e.gltf)==null?void 0:s.scenes)==null?void 0:u[0])==null?void 0:l.nodes)||((c=e.gltf)==null?void 0:c.nodes)||[],r=((h=(f=e.gltf)==null?void 0:f.images)==null?void 0:h.map(d=>{var p,y;if((p=d==null?void 0:d.image)==null?void 0:p.compressed)return{data:null,compressed:!0};{let g=(y=d==null?void 0:d.image)==null?void 0:y.data,b=new Uint8Array(g.length);return b.set(g),{data:b,compressed:!1,height:d.image.height,width:d.image.width,components:d.image.components,mimeType:d.mimeType}}}))||[];Sge(t);let i=e.cartographicOrigin,n=e.cartesianModelMatrix;return{nodes:t,images:r,cartographicOrigin:i,cartesianModelMatrix:n}}function Sge(e){var t;for(let r=0;r<e.length;r++){let i=e[r];i.mesh&&(e[r]=_t(ce({},i),{mesh:_t(ce({},i.mesh),{primitives:(t=i.mesh)==null?void 0:t.primitives.map(n=>{var a,o,s;return _t(ce({},n),{indices:{value:(a=n==null?void 0:n.indices)==null?void 0:a.value},attributes:llt(n.attributes),material:{id:(o=n==null?void 0:n.material)==null?void 0:o.id,uniqueId:(s=n==null?void 0:n.material)==null?void 0:s.uniqueId}})})})})),i.children&&Sge(i.children)}}var clt="EXT_mesh_features",flt="EXT_feature_metadata";function Age(e,t,r){let i=t==null?void 0:t.extensions;if(!i)return[];for(let[n,a]of Object.entries(i||{}))switch(n){case flt:return hlt(e,a,r);case clt:return console.warn("EXT_mesh_features extension is not supported yet"),[];default:return[]}return[]}function hlt(e,t,r){var o,s,u,l,c,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?void 0:s.attribute)return e[i.featureIds.attribute].value;if(((u=i==null?void 0:i.featureIds)==null?void 0:u.hasOwnProperty("constant"))&&((l=i==null?void 0:i.featureIds)==null?void 0:l.hasOwnProperty("divisor"))){let d=((c=e==null?void 0:e.POSITIONS)==null?void 0:c.value.length)/3||0;return dlt(d,i.featureIds.constant,i.featureIds.divisor)}let n=(t==null?void 0:t.featureIdTextures)&&(t==null?void 0:t.featureIdTextures[0]);if(n){let p=`TEXCOORD_${((h=(f=n==null?void 0:n.featureIds)==null?void 0:f.texture)==null?void 0:h.texCoord)||0}`,y=e[p].value;return plt(n,y,r)}return(t==null?void 0:t.featureTextures)&&(t==null?void 0:t.featureTextures[0])?(console.warn("EXT_feature_metadata doesn't yet support featureTextures in primitive"),[]):[]}function dlt(e,t=0,r=0){let i=[];if(r>0){let n=t,a=r;for(let o=0;o<e;o++)i.push(n),a-=1,a===0&&(n++,a=r)}else i=Array(e).fill(t,0,e);return i}function plt(e,t,r){var l,c,f;if(!(r==null?void 0:r.length))return[];let i={r:0,g:1,b:2,a:3},n=(c=(l=e==null?void 0:e.featureIds)==null?void 0:l.texture)==null?void 0:c.index,a=(f=e==null?void 0:e.featureIds)==null?void 0:f.channels;if(!a||n===void 0)return[];let o=r[n],s=[],u=i[a];if(o.compressed)console.warn(`Can't get batch Ids from ${o.mimeType} compressed texture`);else for(let h=0;h<t.length;h+=2){let d=t[h],p=t[h+1],y=Math.min(Tge(d)*o.width|0,o.width-1),b=(Math.min(Tge(p)*o.height|0,o.height-1)*o.width+y)*o.components+u,E=new Uint8Array(o.data)[b];s.push(E)}return s}function Tge(e){return(e%1+1)%1}function kge(e,t){let r={};for(let i in t){let n=t[i];r[i]=mlt(n,e)}return r}function mlt(e,t){let r=[];for(let i of t){let n=e[i]||null;r.push(n)}return r}function Rge(e,t){let r=!1;for(let i of Object.values(t))e.length!==i.length&&(r=!0);return r}var V_="string",hL="Int32",dL="double",Mk="OBJECTID";function Cge(e,t){return e===Mk?Mk:typeof t===V_?V_:typeof t=="number"?Number.isInteger(t)?hL:dL:V_}function Ige(e,t,r){let i={key:`f_${e}`,name:t,ordering:["attributeValues"],header:[{property:"count",valueType:"UInt32"}],attributeValues:{valueType:"Int32",valuesPerElement:1}};switch(r){case Mk:glt(i);break;case V_:Mge(i);break;case dL:vlt(i);break;case hL:break;default:Mge(i)}return i}function Oge(e){switch(e){case Mk:return"esriFieldTypeOID";case V_:return"esriFieldTypeString";case hL:return"esriFieldTypeInteger";case dL:return"esriFieldTypeDouble";default:return"esriFieldTypeString"}}function Pge(e,t){return{name:e,type:t,alias:e}}function Bge(e){let t="{OBJECTID}",r=[],i=[],n=[],a=[];for(let o in e)i.push({fieldName:o,visible:!0,isEditable:!1,label:o});return n.push({fieldInfos:i,type:"fields"}),{title:t,mediaInfos:r,popupElements:n,fieldInfos:i,expressionInfos:a}}function Mge(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 glt(e){e.attributeValues={valueType:"Oid32",valuesPerElement:1}}function vlt(e){e.attributeValues={valueType:"Float64",valuesPerElement:1}}var ylt=1,blt=1,Il=3,W_=2,_lt=4,xlt="string",wlt="Int32",Elt="Float64",Slt="Oid32",Fge=["CUSTOM_ATTRIBUTE_2","_BATCHID","BATCHID"],jge="EXT_feature_metadata",Lge="EXT_mesh_features",Wh=new Ds.Vector3;async function mL(e,t,r,i,n,a,o,s,u,l){var y;let c=o,f=await Nlt((y=e.gltf)==null?void 0:y.materials,s),h=Ege(e),d=await klt(h,f,c);o&&Alt(d,u);let p=[];for(let g of f){let b=g.mergedMaterials[0].originalMaterialId;if(!d.has(b))continue;let E=d.get(b);if(!E)continue;let{material:S,texture:k}=g,R=await t();p.push(await Tlt({convertedAttributes:E,material:S,texture:k,tileContent:e,nodeId:R,featuresHashArray:i,propertyTable:r,attributeStorageInfo:n,draco:a,workerSource:l}))}return p.length?p:null}function Alt(e,t){for(let r of e.values()){let i=xge(r.positions,t);r.boundingVolumes=i;let n=i.obb.center;for(let a=0;a<r.positions.length;a+=Il){let o=r.positions.subarray(a,a+Il);pL.Ellipsoid.WGS84.cartesianToCartographic(Array.from(o),Wh),Wh[2]=Wh[2]-t.getHeight(Wh[1],Wh[0]),Wh=Wh.subtract(n),r.positions.set(Wh,a)}}}async function Tlt({convertedAttributes:e,material:t,texture:r,tileContent:i,nodeId:n,featuresHashArray:a,propertyTable:o,attributeStorageInfo:s,draco:u,workerSource:l}){var B;let c=e.boundingVolumes,f=e.positions.length/Il,{faceRange:h,featureIds:d,positions:p,normals:y,colors:g,uvRegions:b,texCoords:E,featureCount:S}=bge(e);i.batchTableJson&&Xlt(d,e.featureIndices,a,i.batchTableJson);let k=new Uint32Array(2),R=act(d);k.set([f,S],0);let M=new Uint8Array(tl(k.buffer,p.buffer,y.buffer,r?E.buffer:new ArrayBuffer(0),g.buffer,b,R.buffer,h.buffer)),I=u?oct(f,e,{positions:p,normals:y,texCoords:r?E:new Float32Array(0),colors:g,uvRegions:b,featureIds:d,faceRange:h},l.draco):null,L=[];return s&&o&&(L=ect(d,o,s)),{nodeId:n,geometry:M,compressedGeometry:I,texture:r,hasUvRegions:Boolean(b.length),sharedResources:Vlt(((B=i.gltf)==null?void 0:B.materials)||[],n),meshMaterial:t,vertexCount:f,attributes:L,featureCount:S,boundingVolumes:c}}async function klt(e,t,r){let{nodes:i,images:n,cartographicOrigin:a,cartesianModelMatrix:o}=e,s=new Map;for(let u 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:u.mergedMaterials};for(let c of u.mergedMaterials)s.set(c.originalMaterialId,l)}Nge(i,n,a,o,s,r);for(let u of s.keys()){let l=s.get(u);if(!!l){if(l.positions.length===0){s.delete(u);continue}l.featureIndicesGroups&&(l.featureIndices=l.featureIndicesGroups.reduce((c,f)=>c.concat(f)),delete l.featureIndicesGroups)}}return s}function Nge(e,t,r,i,n,a,o=new Ds.Matrix4([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])){if(e)for(let s of e)Clt(s,t,r,i,n,a,o)}function Rlt(e,t){let r=t,{matrix:i,rotation:n,scale:a,translation:o}=e;return i&&(r=t.multiplyRight(i)),o&&(r=r.translate(o)),n&&(r=r.rotateXYZ(n)),a&&(r=r.scale(a)),r}function Clt(e,t,r,i,n,a,o=new Ds.Matrix4([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])){let s=Rlt(e,o),u=e.mesh;u&&Ilt(u,t,r,i,n,a,s),Nge(e.children||[],t,r,i,n,a,s)}function Ilt(e,t,r,i,n,a=!1,o=new Ds.Matrix4([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])){var s;for(let u of e.primitives){let l=null,c;u.material?(l=n.get(u.material.uniqueId),c=(s=l==null?void 0:l.mergedMaterials.find(({originalMaterialId:d})=>{var p;return d===((p=u.material)==null?void 0:p.uniqueId)}))==null?void 0:s.uvRegion):n.has("default")&&(l=n.get("default")),zt(l!==null,"Primitive - material mapping failed");let f=u.attributes;if(!l)continue;let h=Olt(u);l.positions=ha(l.positions,qge({vertices:f.POSITION.value,cartographicOrigin:r,cartesianModelMatrix:i,nodeMatrix:o,indices:h,attributeSpecificTransformation:Plt,useCartesianPositions:a})),l.normals=ha(l.normals,qge({vertices:f.NORMAL&&f.NORMAL.value,cartographicOrigin:r,cartesianModelMatrix:i,nodeMatrix:o,indices:h,attributeSpecificTransformation:Blt,useCartesianPositions:!1})),l.texCoords=ha(l.texCoords,Mlt(f.TEXCOORD_0&&f.TEXCOORD_0.value,h)),l.colors=ha(l.colors,Dlt(f.COLOR_0,h)),c&&(l.uvRegions=ha(l.uvRegions,Flt(c,h))),l.featureIndicesGroups=l.featureIndicesGroups||[],l.featureIndicesGroups.push(jlt(Llt(f,u,t),h))}}function Olt(e){var r;let t=(r=e.indices)==null?void 0:r.value;if(t&&e.mode===tr.TRIANGLE_STRIP){let i=t.constructor,n=new i((t.length-2)*3),a=0,o=t.slice(0,3);n.set(o,0);for(let s=1;s+2<t.length;s++)a+=3,o=t.slice(s,s+3),s%2==0?n.set(o,a):n.set(o.reverse(),a);t=n}return t}function qge(e){let{vertices:t,indices:r,attributeSpecificTransformation:i}=e,n=new Float32Array(r.length*Il);if(!t)return n;for(let a=0;a<r.length;a++){let o=r[a]*Il,s=t.subarray(o,o+Il),u=new Ds.Vector3(Array.from(s));u=i(u,e),n[a*Il]=u.x,n[a*Il+1]=u.y,n[a*Il+2]=u.z}return n}function Plt(e,t){let{cartesianModelMatrix:r,cartographicOrigin:i,nodeMatrix:n,useCartesianPositions:a}=t;return n&&(e=e.transform(n)),e=e.transform(r),a||(pL.Ellipsoid.WGS84.cartesianToCartographic([e[0],e[1],e[2]],e),e=e.subtract(i)),e}function Blt(e,t){let{cartesianModelMatrix:r,nodeMatrix:i}=t;return i&&(e=e.transformAsVector(i)),e=e.transformAsVector(r),e}function Mlt(e,t){let r=new Float32Array(t.length*W_);if(!e)return r.fill(1),r;for(let i=0;i<t.length;i++){let n=t[i]*W_,a=e.subarray(n,n+W_);r[i*W_]=a[0],r[i*W_+1]=a[1]}return r}function Dlt(e,t){let r=(e==null?void 0:e.components)||_lt,i=new Uint8Array(t.length*r);if(!e)return i.fill(255),i;let n=e.value;for(let a=0;a<t.length;a++){let o=t[a]*r,s=n.subarray(o,o+r),u=new Uint8Array(r);for(let l=0;l<s.length;l++)u[l]=s[l]*255;i.set(u,a*r)}return i}function Flt(e,t){let r=new Uint16Array(t.length*4);for(let i=0;i<r.length;i+=4)r.set(e,i);return r}function jlt(e,t){if(!e.length||!t.length)return[];let r=[];for(let i=0;i<t.length;i++){let n=t[i];r.push(e[n])}return r}function Llt(e,t,r){let i=Age(e,t,r);if(i.length)return i;for(let n=0;n<Fge.length;n++){let a=Fge[n];if(e[a]&&e[a].value)return e[a].value}return[]}async function Nlt(e=[],t){let r=[];for(let i of e)r.push(Glt(i));return t&&(r=await qlt(r)),r}async function qlt(e){var r,i;let t=[];for(;e.length>0;){let n=e.splice(0,1)[0],a=[];for(let o=0;o<e.length;o++){let s=e[o];(n.texture&&s.texture||!n.texture&&!s.texture)&&(n=await Ult(n,s),a.push(o))}if(n.texture&&a.length){let o=(r=n.mergedMaterials)==null?void 0:r.reduce((l,{textureSize:c})=>l+((c==null?void 0:c.width)||0),0),s=(i=n.mergedMaterials)==null?void 0:i.reduce((l,{textureSize:c})=>Math.max(l,(c==null?void 0:c.height)||0),0),u=-1;for(let l of n.mergedMaterials)if(l.textureSize){let c=u+1+l.textureSize.width/o*2**(Uint16Array.BYTES_PER_ELEMENT*8)-1;l.uvRegion=new Uint16Array([u+1,0,c,l.textureSize.height/s*2**(Uint16Array.BYTES_PER_ELEMENT*8)-1]),u=c}n.texture.image.width=o,n.texture.image.height=s}for(let o of a.reverse())e.splice(o,1);t.push(n)}return t.length||t.push({material:Hlt(),mergedMaterials:[{originalMaterialId:"default"}]}),t}async function Ult(e,t){var r,i;if(((r=e.texture)==null?void 0:r.bufferView)&&((i=t.texture)==null?void 0:i.bufferView)&&e.mergedMaterials&&t.mergedMaterials){let n=Buffer.from(e.texture.bufferView.data),a=Buffer.from(t.texture.bufferView.data);try{let{joinImages:o}=await import("join-images"),s=await o([n,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 Glt(e){var a,o,s,u,l;let t={doubleSided:e.doubleSided,emissiveFactor:(a=e.emissiveFactor)==null?void 0:a.map(c=>Math.round(c*255)),alphaMode:zlt(e.alphaMode),pbrMetallicRoughness:{roughnessFactor:((o=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:o.roughnessFactor)||ylt,metallicFactor:((s=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:s.metallicFactor)||blt}},r;((u=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:u.baseColorTexture)?(r=e.pbrMetallicRoughness.baseColorTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}):e.emissiveTexture&&(r=e.emissiveTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0});let i=Rc();e.uniqueId=i;let n=[{originalMaterialId:i}];if(r)n[0].textureSize={width:r.image.width,height:r.image.height};else{let c=(l=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:l.baseColorFactor;t.pbrMetallicRoughness.baseColorFactor=c&&c.map(f=>Math.round(f*255))||void 0}return{material:t,texture:r,mergedMaterials:n}}function zlt(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend";default:return"opaque"}}function Hlt(){return{alphaMode:"opaque",pbrMetallicRoughness:{metallicFactor:1,roughnessFactor:1}}}function Vlt(e,t){let r={};if(!e||!e.length)return r;r.materialDefinitionInfos=[];for(let i of e){let{materialDefinitionInfo:n,textureDefinitionInfo:a}=Wlt(i,t);r.materialDefinitionInfos.push(n),a&&(r.textureDefinitionInfos=r.textureDefinitionInfos||[],r.textureDefinitionInfos.push(a))}return r}function Wlt(e,t){var s;let r=((s=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:s.baseColorTexture)||e.emissiveTexture,i=null;r&&(i=Ylt(r.texture,t));let{baseColorFactor:n,metallicFactor:a}=(e==null?void 0:e.pbrMetallicRoughness)||{},o=n;return(!n||n[3]===0)&&e.emissiveFactor&&(o=e.emissiveFactor,o[3]=o[3]||1),{materialDefinitionInfo:Klt(o||[1,1,1,1],a),textureDefinitionInfo:i}}function Klt(e,t=1){let r=.04/255,i=new Ds.Vector4(0,0,0,1),n=new Ds.Vector4(1,1,1,1),a=new Ds.Vector4(r,r,r,0),o=new Ds.Vector4(e),s=n.subtract(a).multiply(o),u=s.lerp(s,i,t);a[3]=1;let l=a.lerp(a,o,t);return{params:{diffuse:u.toArray(),specular:l.toArray(),renderMode:"solid"}}}function Ylt(e,t){var r,i,n;return{encoding:((r=e==null?void 0:e.source)==null?void 0:r.mimeType)?[e.source.mimeType]:void 0,images:[{id:$lt(e,t),size:(i=e.source)==null?void 0:i.image.width,length:[(n=e.source)==null?void 0:n.image.data.length]}]}}function $lt(e,t){var y;let{width:r,height:i}=(y=e.source)==null?void 0:y.image,n=1,a=0,o=t+1,s=32-o.toString(2).length,u="0".repeat(s).concat(o.toString(2)),l=n<<28,c=a<<24,f=r-1<<12,h=i-1<<0,d=l+c+f+h;return BigInt(`0b${d.toString(2)}${u}`).toString()}function Xlt(e,t,r,i){let n=Jlt(e,i,r);Uge(t,n),Uge(e,n)}function Jlt(e,t,r){let i={};for(let n=0;n<e.length;n++){let a=e[n],o=Zlt(n,t,r);i[a.toString()]=o}return i}function Qlt(e,t){let r="";for(let i in e)r+=e[i][t];return r}function Zlt(e,t,r){let i=Qlt(t,e),n=(0,Dge.default)(i);return r.includes(n)?r.indexOf(n):r.push(n)-1}function Uge(e,t){for(let r=0;r<e.length;r++)e[r]=t[e[r]]}function ect(e,t,r){let i=[],a=Rge(e,t)?kge(e,t):t,o=ce({OBJECTID:e},a);for(let s in o){let u=rct(s,r),l=o[s],c=tct(u,l);i.push(c)}return i}function tct(e,t){let r;switch(e){case Slt:case wlt:r=ict(t);break;case Elt:r=nct(t);break;case xlt:r=Gge(t);break;default:r=Gge(t)}return r}function rct(e,t){return t.find(i=>i.name===e).attributeValues.valueType}function ict(e){let t=new Uint32Array([e.length]),r=new Uint32Array(e);return tl(t.buffer,r.buffer)}function nct(e){let t=new Uint32Array([e.length]),r=new Uint8Array(4),i=new Float64Array(e);return tl(t.buffer,r.buffer,i.buffer)}function Gge(e){let t=new Uint32Array([e.length]),r=0,i=new Uint32Array(e.length),n=[];for(let o=0;o<e.length;o++){let s=`${String(e[o])}\0`,u=Buffer.from(s),l=u.length;r+=l,i[o]=l,n.push(u)}let a=new Uint32Array([r]);return tl(t.buffer,a.buffer,i.buffer,...n)}function act(e){let t=new BigUint64Array(e.length);for(let r=0;r<e.length;r++)t[r]=BigInt(e[r]);return t}async function oct(e,t,r,i){let{positions:n,normals:a,texCoords:o,colors:s,uvRegions:u,featureIds:l,faceRange:c}=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),d=sct(h,c),p={positions:n,normals:a,colors:s,"feature-index":d};o.length&&(p.texCoords=o);let y={"feature-index":{"i3s-attribute-type":"feature-index","i3s-feature-ids":new Int32Array(l)}};return u.length&&(p["uv-region"]=u,y["uv-region"]={"i3s-attribute-type":"uv-region"}),Qm({attributes:p,indices:f},Bb,_t(ce({},Bb.options),{source:i,reuseWorkers:!0,_nodeWorkers:!0,draco:{method:"MESH_SEQUENTIAL_ENCODING",attributesMetadata:y}}))}function sct(e,t){let r=new Uint32Array(e.length),i=0,n=0;for(let a=1;a<t.length;a+=2){let o=(t[a]+1)*Il;r.fill(i,n,o),i++,n=o+1}return r}function zge(e){let t=e==null?void 0:e.batchTableJson;if(t)return t;let{extensionName:r,extension:i}=uct(e);switch(r){case Lge:return console.warn("The I3S converter does not yet support the EXT_mesh_features extension"),null;case jge:return lct(i);default:return null}}function uct(e){var a,o,s,u;let t=[jge,Lge];if(!((a=e==null?void 0:e.gltf)==null?void 0:a.extensionsUsed))return{extensionName:null,extension:null};let i="";for(let l of((o=e==null?void 0:e.gltf)==null?void 0:o.extensionsUsed)||[])if(t.includes(l)){i=l;break}let n=(u=(s=e==null?void 0:e.gltf)==null?void 0:s.extensions)==null?void 0:u[i];return{extensionName:i,extension:n}}function lct(e){var t;if(e==null?void 0:e.featureTextures)return console.warn("The I3S converter does not yet support the EXT_feature_metadata feature textures"),null;if(e==null?void 0:e.featureTables){let r=(t=Object.keys(e.featureTables))==null?void 0:t[0];if(r){let i=e==null?void 0:e.featureTables[r],n={};for(let a in i.properties)n[a]=i.properties[a].data;return n}}return console.warn("The I3S converter couldn't handle EXT_feature_metadata extension"),null}var Vge=Le(vu()),Wge=Le(require("path"));var Hge=()=>({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 Kge(e,t,r){let i={serviceItemId:Rc().replace(/-/gi,""),layerName:e,layers0:t},n=(0,Vge.default)(i,Hge()),a=(0,Wge.join)(r,"SceneServer");await Hn(a,JSON.stringify(n))}var gL=16;function Yge(e,t){let r=[],i=e.boundingVolume,n=e.lodMetricValue||.1,a={metricType:"maxScreenThreshold",maxError:t.mbs[3]*2*gL/n},o={metricType:"maxScreenThresholdSQ",maxError:Math.PI*.25*a.maxError*a.maxError};return i.constructor.name==="OrientedBoundingBox"?(r.push(o),r.push(a)):(r.push(a),r.push(o)),r}function vL(e){let r=(e.header.lodSelection.maxScreenThreshold||{}).maxError;if(!r){let i=e.header.lodSelection.maxScreenThresholdSQ;i&&(r=Math.sqrt(i.maxError/(Math.PI*.25)))}return r||(r=gL),e.header.mbs[3]*2*gL/r}var s0e=Le(o0e()),Bct="3.4.3",Lk={name:"PGM - Netpbm grayscale image format",id:"pgm",module:"tile-converter",version:Bct,mimeTypes:["image/x-portable-graymap"],parse:async(e,t)=>(0,s0e.parsePGM)(new Uint8Array(e),t),extensions:["pgm"],options:{cubic:!1}};var J0=Le(vu());var u0e={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 Mct=()=>({wkid:{path:"wkid",default:4326},latestWkid:{path:"latestWkid",default:4326},vcsWkid:{path:"vcsWkid",default:5773},latestVcsWkid:{path:"latestVcsWkid",default:5773}}),Dct=()=>({heightModel:{path:"heightModel",default:"gravity_related_height"},vertCRS:{path:"vertCRS",default:"EGM96_Geoid"},heightUnit:{path:"heightUnit",default:"meter"}}),Fct=()=>({nodesPerPage:{path:"nodesPerPage"},lodSelectionMetricType:{path:"lodSelectionMetricType",default:"maxScreenThresholdSQ"}}),jct=()=>({xmin:{path:"xmin"},ymin:{path:"ymin"},xmax:{path:"xmax"},ymax:{path:"ymax"},zmin:{path:"zmin"},zmax:{path:"zmax"}}),l0e=()=>({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,J0.default)(e,Mct())},capabilities:{path:"capabilities",default:["View","Query"]},store:{path:"store",transform:e=>(0,J0.default)(e,u0e)},fullExtent:{path:"fullExtent",transform:e=>(0,J0.default)(e,jct())},heightModelInfo:{path:"heightModelInfo",transform:e=>(0,J0.default)(e,Dct())},nodePages:{path:"nodePages",transform:e=>(0,J0.default)(e,Fct())},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 wL=Le(vu()),Lct=()=>({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}}}),Nct=()=>({"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}}}),c0e=()=>({geometryBuffers:{path:"geometryConfig",transform:e=>{let t=[(0,wL.default)(e,Lct())];return e.draco&&t.push((0,wL.default)({geometryConfig:e},Nct())),t}}});var K_=Le(vu()),qct=()=>({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}}),Uct=()=>({name:{path:"name",default:"standard"},type:{path:"type",default:"standard"},params:{path:"params",transform:(e,t,r)=>(0,K_.default)(r,qct())}}),Gct=()=>({id:{path:"id"},size:{path:"size"},href:{path:"href",default:["../textures/0"]},length:{path:"length"}}),zct=()=>({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(i=>(0,K_.default)(i,Gct()))}}),f0e=()=>({materialDefinitions:{path:"materialDefinitionInfos",transform:Hct},textureDefinitions:{path:"textureDefinitionInfos",transform:Vct}});function Hct(e,t,r){let i={};for(let[n,a]of e.entries())i[`Mat${r.nodePath}${n}`]=(0,K_.default)(a,Uct());return i}function Vct(e,t,r){if(!e)return null;let i={};for(let[n,a]of e.entries()){let o=`${r.nodePath}${n}`;a.imageIndex=o,i[o]=(0,K_.default)(a,zct())}return i}var Nk=Le(cl()),h0e=Le(Tr()),EL=Le(Ya()),Wct=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 d0e(e){var r,i;if(!((r=e==null?void 0:e.parentNode)==null?void 0:r.obb)||!((i=e==null?void 0:e.parentNode)==null?void 0:i.mbs))return[];let t=[];return Kct(t,e),Yct(t,e),t}function Kct(e,t){var o;let r=$ct(t.parentNode.obb),i=Xct(t);if(Jct(r,i))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 Yct(e,t){var a;let r=p0e(t.mbs),i=p0e(t.parentNode.mbs);if(r.center.distanceTo(i.center)+r.radius>i.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 p0e(e){return new Nk.BoundingSphere([e[0],e[1],e[2]],e[3])}function $ct(e){let{center:t,halfSize:r,quaternion:i}=e;return new Nk.OrientedBoundingBox().fromCenterHalfSizeQuaternion(t,r,i)}function Xct(e){let t=e.obb.halfSize,r=Wct,i=EL.Ellipsoid.WGS84.cartographicToCartesian(e.obb.center),n=[];for(let a=0;a<r.length;a+=3){let s=new h0e.Vector3(r[a]*=t[0],r[a+1]*=t[1],r[a+2]*=t[2]).transformByQuaternion(e.obb.quaternion).add(i);n=n.concat(s)}return n}function Jct(e,t){let r=!0;for(let i=0;i<t.length/3;i+=3){let n=[t[i],t[i+1],t[i+2]],a=EL.Ellipsoid.WGS84.cartesianToCartographic(n);if(e.distanceTo(a)>0){r=!1;break}}return r}var SL=class extends Array{enqueue(t){this.push(t)}dequeue(){return this.shift()}peek(){return this[0]}isEmpty(){return this.length===0}};var m0e=Le(require("process")),Qct=4*1024*1024*1024,Y_=class extends SL{constructor(t=2e3,r=400){super();this.writePromise=null;this.fileMap={};this.listeningInterval=t,this.writeConcurrency=r}async enqueue(t,r=!1){if(r){let{archiveKey:i,writePromise:n}=t,a=await n();i&&a&&(this.fileMap[i]=a)}else super.enqueue(t),m0e.default.memoryUsage().rss>Qct&&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 n=0;n<this.writeConcurrency;n++){let a=this.dequeue();if(!a)break;let{archiveKey:o,writePromise:s}=a;r.push(o);let u=s();t.push(u)}let i=await Promise.allSettled(t);this.updateFileMap(r,i)}}updateFileMap(t,r){for(let i=0;i<t.length;i++){let n=t[i];n&&"value"in r[i]&&(this.fileMap[n]=r[i].value)}}};var Zct="3.4.3",g0e={id:"i3s-attributes",name:"I3S Attributes Worker",module:"tile-converter",version:Zct,options:{useCartesianPositions:!1}};var Q0="Tile converter does not work in browser, only in node js environment";var TL=Le(require("path")),kL=Le(vu());var v0e=Le(vu()),y0e=()=>({mbs:{path:"mbs"},obb:{path:"obb"}}),eft=()=>({href:{path:"href"}}),tft=()=>ce(ce({id:{path:"id"}},eft()),y0e()),AL=()=>_t(ce({version:{path:"version"},id:{path:"id"},path:{path:"path"},level:{path:"level"}},y0e()),{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,v0e.default)(e,tft()),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 Ol=class{constructor(t,r){this.data=null;this.children=[];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 n of t){let a=await n.load();r.push({id:n.id,href:`../${n.id}`,obb:a.obb,mbs:a.mbs})}this.children=this.children.concat(t);let i=this.data;this.converter.options.instantNodeWriting&&(i=await this.load()),i&&(i.children=i.children??[],i.children=i.children.concat(r)),this.converter.options.instantNodeWriting&&i&&await this.write(i)}async addNeighbors(){var r;let t=await this.load();for(let i of this.children){let n=await i.load();if(n.neighbors=n.neighbors??[],Number((r=t==null?void 0:t.children)==null?void 0:r.length)<1e3)for(let a of t.children||[])i.id!==a.id&&n.neighbors.push(ce({},a));else console.warn(`Node ${i.id}: neighbors attribute is omited because of large number of neigbors`),delete n.neighbors;this.converter.options.instantNodeWriting&&n&&await i.write(n),await i.save(),i.flush()}}async save(){this.data&&await this.write(this.data)}async write(t){let r=(0,TL.join)(this.converter.layers0Path,"nodes",this.id);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodes/${this.id}/3dNodeIndexDocument.json.gz`,writePromise:()=>Cl(r,JSON.stringify(t),"3dNodeIndexDocument.json",!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>Hn(r,JSON.stringify(t))},!0)}async load(){if(this.data)return this.data;let t=this.id,r=(0,TL.join)(this.converter.layers0Path,"nodes",t),i="index.json";return this.converter.options.slpk&&(i="3dNodeIndexDocument.json"),await Ik(r,i)}flush(){this.data=null}static async createRootNode(t,r){let i=Ol.createRootNodeIndexDocument(t);return await new Ol(0,r).addData(i)}static async createNode(t,r,i,n,a,o){let s=await Ol.createNodeIndexDocument(t,r,i,n,a);return await new Ol(n.index,o).addData(s)}static createRootNodeIndexDocument(t){let r=_t(ce({version:`{${Rc().toUpperCase()}}`,id:"root",level:0,lodSelection:[{metricType:"maxScreenThresholdSQ",maxError:0},{metricType:"maxScreenThreshold",maxError:0}]},t),{children:[]});return(0,kL.default)(r,AL())}static async createNodeIndexDocument(t,r,i,n,a){var h,d;let{texture:o,attributes:s}=a,u=n.index,l=await t.load(),c=_t(ce({version:l.version,id:u.toString(),level:l.level+1},r),{lodSelection:i,parentNode:{id:t.id,href:`../${t.id}`,mbs:l.mbs,obb:l.obb},children:[],neighbors:[]}),f=(0,kL.default)(c,AL());if(n.mesh&&(f.geometryData=[{href:"./geometries/0"}],f.sharedResource={href:"./shared"},o&&(f.textureData=[{href:"./textures/0"},{href:"./textures/1"}]),s&&s.length&&((d=(h=t.converter.layers0)==null?void 0:h.attributeStorageInfo)==null?void 0:d.length))){f.attributeData=[];for(let p=0;p<s.length;p++){let y=t.converter.layers0.attributeStorageInfo[p].key;f.attributeData.push({href:`./attributes/${y}/0`})}}return f}};var _0e,rft=((_0e=jp.default.env)==null?void 0:_0e.IonToken)||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlYWMxMzcyYy0zZjJkLTQwODctODNlNi01MDRkZmMzMjIxOWIiLCJpZCI6OTYyMCwic2NvcGVzIjpbImFzbCIsImFzciIsImdjIl0sImlhdCI6MTU2Mjg2NjI3M30.1FNiClUyk00YH_nWfSGpiQAjR5V2OvREDq1PJ5QMjWQ",b0e=64,ift="3DTILES",nft="3DObject",aft=1800,oft="https://",$_=class{constructor(){this.boundingVolumeWarnings=[];this.conversionStartTime=[0,0];this.refreshTokenTime=[0,0];this.sourceTileset=null;this.geoidHeightModel=null;this.Loader=Tc;this.workerSource={};this.writeQueue=new Y_;this.compressList=null;this.nodePages=new wo(Hn,b0e,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){var g,b;if(ji)return console.log(Q0),Q0;this.conversionStartTime=jp.default.hrtime();let{tilesetName:r,slpk:i,egmFilePath:n,inputUrl:a,validate:o,outputPath:s,draco:u=!0,sevenZipExe:l,maxDepth:c,token:f,generateTextures:h,generateBoundingVolumes:d,instantNodeWriting:p=!1,mergeMaterials:y=!0}=t;this.options={maxDepth:c,slpk:i,sevenZipExe:l,egmFilePath:n,draco:u,token:f,inputUrl:a,instantNodeWriting:p,mergeMaterials:y},this.compressList=this.options.instantNodeWriting&&[]||null,this.validate=Boolean(o),this.Loader=a.indexOf(oft)!==-1?k2:Tc,this.generateTextures=Boolean(h),this.generateBoundingVolumes=Boolean(d),this.writeQueue=new Y_,this.writeQueue.startListening(),console.log("Loading egm file..."),this.geoidHeightModel=await ci(n,Lk),console.log("Loading egm file completed!"),i&&this.nodePages.useWriteFunction(Cl),await this.loadWorkers();try{let E=await this._fetchPreloadOptions(),S={loadOptions:{_nodeWorkers:!0,reuseWorkers:!0,basis:{format:"rgba32"},"basis-nodejs":{format:"rgba32",workerUrl:"./modules/textures/dist/basis-nodejs-worker.js"},"draco-nodejs":{workerUrl:"./modules/draco/dist/draco-nodejs-worker.js"}}};E.headers&&(S.loadOptions.fetch={headers:E.headers}),Object.assign(S,E);let k=await ci(a,this.Loader,S.loadOptions);return this.sourceTileset=new xg(k,S),await this._createAndSaveTileset(s,r,(b=(g=k==null?void 0:k.root)==null?void 0:g.boundingVolume)==null?void 0:b.region),await this._finishConversion({slpk:Boolean(i),outputPath:s,tilesetName:r}),k}catch(E){throw E}finally{En.getWorkerFarm({}).destroy()}}async _createAndSaveTileset(t,r,i){let n=(0,Na.join)(`${t}`,`${r}`);try{await G_(n)}catch{}this.layers0Path=(0,Na.join)(n,"SceneServer","layers","0"),this._formLayers0(r,i),this.materialDefinitions=[],this.materialMap=new Map;let a=this.sourceTileset.root,o=cL(a,this.geoidHeightModel);await this.nodePages.push({index:0,lodThreshold:0,obb:o.obb,children:[]});let s=await Ol.createRootNode(o,this);await this._convertNodesTree(s,a),this.layers0.materialDefinitions=this.materialDefinitions,this.layers0.geometryDefinitions=(0,qk.default)(this.geometryConfigs.map(u=>({geometryConfig:_t(ce({},u),{draco:this.options.draco})})),c0e()),this.layersHasTexture===!1&&(this.layers0.store.defaultGeometrySchema.ordering=this.layers0.store.defaultGeometrySchema.ordering.filter(u=>u!=="uv0")),await this._writeLayers0(),Kge(r,this.layers0,n);for(let u of this.compressList||[])await Ck(u),await lL(u);await this.nodePages.save(),await this.writeQueue.finalize(),await this._createSlpk(n)}_formLayers0(t,r){var o,s,u;let i=wge(((o=this.sourceTileset)==null?void 0:o.boundingVolume)||((u=(s=this.sourceTileset)==null?void 0:s.root)==null?void 0:u.boundingVolume));r&&(i.zmin=r[4],i.zmax=r[5]);let n=[i.xmin,i.ymin,i.xmax,i.ymax],a={version:`{${Rc().toUpperCase()}}`,id:0,name:t,href:"./layers/0",store:{id:`{${Rc().toUpperCase()}}`,extent:n},nodePages:{nodesPerPage:b0e},compressGeometry:this.options.draco,fullExtent:i};this.layers0=(0,qk.default)(a,l0e())}async _convertNodesTree(t,r){if(await this.sourceTileset._loadTile(r),this.isContentSupported(r)){let i=await this._createNode(t,r,0);for(let n of i)await n.save();await t.addChildren(i)}else await this._addChildrenWithNeighborsAndWriteFile({parentNode:t,sourceTiles:r.children,level:1});await r.unloadContent(),await t.save()}async _writeLayers0(){this.options.slpk?await this.writeQueue.enqueue({archiveKey:"3dSceneLayer.json.gz",writePromise:()=>Cl(this.layers0Path,JSON.stringify(this.layers0),"3dSceneLayer.json")}):await this.writeQueue.enqueue({writePromise:()=>Hn(this.layers0Path,JSON.stringify(this.layers0))})}async _createSlpk(t){if(this.options.slpk){let r=(0,Na.join)(t,"SceneServer","layers","0"),i=`${t}.slpk`;await mge(r,i,0,".",this.options.sevenZipExe);try{await G_(t)}catch{}}}async _addChildrenWithNeighborsAndWriteFile(t){await this._addChildren(t),await t.parentNode.addNeighbors()}async convertNestedTileset({parentNode:t,sourceTile:r,level:i}){await this.sourceTileset._loadTile(r),await this._addChildren({parentNode:t,sourceTiles:r.children,level:i+1}),await r.unloadContent()}async convertNode({parentNode:t,sourceTile:r,level:i}){let n=await this._createNode(t,r,i);await t.addChildren(n)}async _addChildren(t){let{sourceTiles:r,parentNode:i,level:n}=t;if(!(this.options.maxDepth&&n>this.options.maxDepth))for(let a of r)a.type==="json"?await this.convertNestedTileset({parentNode:i,sourceTile:a,level:n}):await this.convertNode({parentNode:i,sourceTile:a,level:n}),a.id&&console.log(a.id)}async _createNode(t,r,i){var f,h;this._checkAddRefinementTypeForTile(r),await this._updateTilesetOptions(),await this.sourceTileset._loadTile(r);let n=cL(r,this.geoidHeightModel),a=zge(r.content);a&&!((h=(f=this.layers0)==null?void 0:f.attributeStorageInfo)==null?void 0:h.length)&&this._convertPropertyTableToNodeAttributes(a);let o=await this._convertResources(r,t.inPageId,a),s=[],u=[],l=[],c={geometry:null,compressedGeometry:null,texture:null,hasUvRegions:!1,sharedResources:null,meshMaterial:null,vertexCount:null,attributes:null,featureCount:null,boundingVolumes:null};for(let d of o||[c]){this.layersHasTexture=this.layersHasTexture||Boolean(d.texture),this.generateBoundingVolumes&&d.boundingVolumes&&(n=d.boundingVolumes);let p=Yge(r,n),y=p.find(S=>S.metricType==="maxScreenThresholdSQ")||{maxError:0},g=await this._updateNodeInNodePages(y,n,r,t.inPageId,d),b=await Ol.createNodeIndexDocument(t,n,p,g,d),E=await new Ol(g.index,this).addData(b);s.push(E),g.mesh&&await this._writeResources(d,E.id),this.validate&&(this.boundingVolumeWarnings=d0e(b),this.boundingVolumeWarnings&&this.boundingVolumeWarnings.length&&console.warn("Bounding Volume Warnings: ",...this.boundingVolumeWarnings)),u.push(g.index),l.push(g)}return r.unloadContent(),await this._addChildrenWithNeighborsAndWriteFile({parentNode:s[0],sourceTiles:r.children,level:i+1}),s}async _convertResources(t,r,i){var o;if(!this.isContentSupported(t))return null;let n={center:[],halfSize:[],quaternion:[]};return await mL(t.content,async()=>(await this.nodePages.push({index:0,obb:n},r)).index,i,this.featuresHashArray,(o=this.layers0)==null?void 0:o.attributeStorageInfo,this.options.draco,this.generateBoundingVolumes,this.options.mergeMaterials,this.geoidHeightModel,this.workerSource)}async _updateNodeInNodePages(t,r,i,n,a){let{meshMaterial:o,texture:s,vertexCount:u,featureCount:l,geometry:c,hasUvRegions:f}=a,h={index:0,lodThreshold:t.maxError,obb:r.obb,children:[]};c&&this.isContentSupported(i)&&(h.mesh={geometry:{definition:this.findOrCreateGeometryDefinition(Boolean(s),f),resource:0},attribute:{resource:0},material:{definition:0}});let d=a.nodeId,p;if(d?p=await this.nodePages.getNodeById(d):p=await this.nodePages.push(h,n),wo.updateAll(p,h),o&&wo.updateMaterialByNodeId(p,this._findOrCreateMaterial(o)),s){let y=s.image.height*s.image.width;wo.updateTexelCountHintByNodeId(p,y)}return u&&(this.vertexCounter+=u,wo.updateVertexCountByNodeId(p,u)),wo.updateNodeAttributeByNodeId(p),l&&wo.updateFeatureCountByNodeId(p,l),this.nodePages.saveNode(p),p}async _writeResources(t,r){let{geometry:i,compressedGeometry:n,texture:a,sharedResources:o,attributes:s}=t,u=(0,Na.join)(this.layers0Path,"nodes",r),l=(0,Na.join)("nodes",r);await this._writeGeometries(i,n,u,l),await this._writeShared(o,u,l,r),await this._writeTexture(a,u,l),await this._writeAttributes(s,u,l)}async _writeGeometries(t,r,i,n){if(this.options.slpk){let a=(0,Na.join)(i,"geometries");await this.writeQueue.enqueue({archiveKey:`${n}/geometries/0.bin.gz`,writePromise:()=>Cl(a,t,"0.bin")})}else{let a=(0,Na.join)(i,"geometries/0/");await this.writeQueue.enqueue({writePromise:()=>Hn(a,t,"index.bin")})}if(this.options.draco)if(this.options.slpk){let a=(0,Na.join)(i,"geometries");await this.writeQueue.enqueue({archiveKey:`${n}/geometries/1.bin.gz`,writePromise:()=>Cl(a,r,"1.bin")})}else{let a=(0,Na.join)(i,"geometries/1/");await this.writeQueue.enqueue({writePromise:()=>Hn(a,r,"index.bin")})}}async _writeShared(t,r,i,n){if(!t)return;t.nodePath=n;let a=(0,qk.default)(t,f0e()),o=JSON.stringify(a);if(this.options.slpk){let s=(0,Na.join)(r,"shared");await this.writeQueue.enqueue({archiveKey:`${i}/shared/sharedResource.json.gz`,writePromise:()=>Cl(s,o,"sharedResource.json")})}else{let s=(0,Na.join)(r,"shared/");await this.writeQueue.enqueue({writePromise:()=>Hn(s,o)})}}async _writeTexture(t,r,i){if(t){let n=this._getFormatByMimeType(t==null?void 0:t.mimeType),a=[],o=t.bufferView.data;switch(n){case"jpg":case"png":{if(a.push({name:"0",format:n}),await this.writeTextureFile(o,"0",n,r,i),this.generateTextures){a.push({name:"1",format:"ktx2"});let s=t.image.data.subarray(),u=new Uint8Array(s),l=Qm(_t(ce({},t.image),{data:u}),p2,_t(ce({},p2.options),{source:this.workerSource.ktx2,reuseWorkers:!0,_nodeWorkers:!0}));await this.writeTextureFile(l,"1","ktx2",r,i)}break}case"ktx2":if(a.push({name:"1",format:n}),await this.writeTextureFile(o,"1",n,r,i),this.generateTextures){a.push({name:"0",format:"jpg"});let s=Qm(t.image.data[0],k8);await this.writeTextureFile(s,"0","jpg",r,i)}}this.layers0.textureSetDefinitions.length||(this.layers0.textureSetDefinitions.push({formats:a}),this.layers0.textureSetDefinitions.push({formats:a,atlas:!0}))}}async writeTextureFile(t,r,i,n,a){if(this.options.slpk){let o=(0,Na.join)(n,"textures"),s=!1;await this.writeQueue.enqueue({archiveKey:`${a}/textures/${r}.${i}`,writePromise:()=>Cl(o,t,`${r}.${i}`,s)})}else{let o=(0,Na.join)(n,`textures/${r}/`);await this.writeQueue.enqueue({writePromise:()=>Hn(o,t,`index.${i}`)})}}async _writeAttributes(t=[],r,i){var n,a;if((t==null?void 0:t.length)&&((a=(n=this.layers0)==null?void 0:n.attributeStorageInfo)==null?void 0:a.length))for(let o=0;o<t.length;o++){let s=this.layers0.attributeStorageInfo[o].key,u=new Uint8Array(t[o]);if(this.options.slpk){let l=(0,Na.join)(r,"attributes",s);await this.writeQueue.enqueue({archiveKey:`${i}/attributes/${s}.bin.gz`,writePromise:()=>Cl(l,u,"0.bin")})}else{let l=(0,Na.join)(r,`attributes/${s}/0`);await this.writeQueue.enqueue({writePromise:()=>Hn(l,u,"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,RL.default)(JSON.stringify(t));if(this.materialMap.has(r))return this.materialMap.get(r)||0;let i=this.materialDefinitions.push(t)-1;return this.materialMap.set(r,i),i}findOrCreateGeometryDefinition(t,r){let i={hasTexture:t,hasUvRegions:r},n=(0,RL.default)(JSON.stringify(i));if(this.geometryMap.has(n))return this.geometryMap.get(n)||0;let a=this.geometryConfigs.push(i)-1;return this.geometryMap.set(n,a),a}_convertPropertyTableToNodeAttributes(t){let r=0,i=ce({OBJECTID:[0]},t);for(let n in i){let a=i[n][0],o=Cge(n,a),s=Ige(r,n,o),u=Oge(o),l=Pge(n,u),c=Bge(i);this.layers0.attributeStorageInfo.push(s),this.layers0.fields.push(l),this.layers0.popupInfo=c,this.layers0.layerType=nft,r+=1}}async _finishConversion(t){let{tilesCount:r,tilesWithAddRefineCount:i}=this.refinementCounter,n=i?i/r*100:0,a=await Bk(t),o=jp.default.hrtime(this.conversionStartTime),s=Pk(o);console.log("------------------------------------------------"),console.log(`Finishing conversion of ${ift}`),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:',n,"%"),console.log("------------------------------------------------")}async _fetchPreloadOptions(){if(!this.Loader.preload)return{};let t={"cesium-ion":{accessToken:this.options.token||rft}},r=await this.Loader.preload(this.options.inputUrl,t);return this.refreshTokenTime=jp.default.hrtime(),ce(ce({},t),r)}async _updateTilesetOptions(){if(jp.default.hrtime(this.refreshTokenTime)[0]<aft)return;this.refreshTokenTime=jp.default.hrtime();let r=await this._fetchPreloadOptions();this.sourceTileset.options=ce(ce({},this.sourceTileset.options),r),r.headers&&(this.sourceTileset.loadOptions.fetch=_t(ce({},this.sourceTileset.loadOptions.fetch),{headers:r.headers}),console.log("Authorization Bearer token has been updated"))}_checkAddRefinementTypeForTile(t){let r=1;t.refine===r&&(this.refinementCounter.tilesWithAddRefineCount+=1,console.warn('This tile uses "ADD" type of refinement')),this.refinementCounter.tilesCount+=1}isContentSupported(t){var r;return["b3dm","glTF"].includes((r=t==null?void 0:t.content)==null?void 0:r.type)}async loadWorkers(){if(console.log("Loading workers source..."),this.options.draco){let n=nu(Bb,ce({},Po())),o=await(await na(n)).text();this.workerSource.draco=o}if(this.generateTextures){let n=nu(p2,ce({},Po())),o=await(await na(n)).text();this.workerSource.ktx2=o}let t=nu(g0e,ce({},Po())),i=await(await na(t)).text();this.workerSource.I3SAttributes=i,console.log("Loading workers source completed!")}};var $0e=Le(require("path")),ML=Le(require("process")),X0e=Le(vu());var $h=Le(Tr()),Gk=Le(Ya());var _a;(function(l){l.UInt8="UInt8",l.UInt16="UInt16",l.UInt32="UInt32",l.UInt64="UInt64",l.Int16="Int16",l.Int32="Int32",l.Int64="Int64",l.Float32="Float32",l.Float64="Float64"})(_a||(_a={}));var X_;(function(r){r.vertexCount="vertexCount",r.featureCount="featureCount"})(X_||(X_={}));function Yh(e,t=null){return t?`${e}?token=${t}`:e}function x0e(e,t){let{attributeData:r=[]}=t,i=[];for(let n=0;n<r.length;n++){let a=r[n].href.replace("./","");i.push(`${e}/${a}`)}return i}function w0e(e,t){let r=[],{attributeStorageInfo:i,url:n}=e;for(let a=0;a<i.length;a++){let o=i[a].key;r.push(`${n}/nodes/${t}/attributes/${o}/0`)}return r}var Z0=Le(E0e());function CL(e){switch(e){case _a.UInt8:return Uint8Array;case _a.UInt16:return Uint16Array;case _a.UInt32:return Uint32Array;case _a.Float32:return Float32Array;case _a.UInt64:return Float64Array;default:throw new Error(`parse i3s tile content: unknown type of data: ${e}`)}}var S0e={UInt8:Z0.default.UNSIGNED_BYTE,UInt16:Z0.default.UNSIGNED_SHORT,Float32:Z0.default.FLOAT,UInt32:Z0.default.UNSIGNED_INT,UInt64:Z0.default.DOUBLE};function ev(e){switch(e){case _a.UInt8:return 1;case _a.UInt16:case _a.Int16:return 2;case _a.UInt32:case _a.Int32:case _a.Float32:return 4;case _a.UInt64:case _a.Int64:case _a.Float64:return 8;default:throw new Error(`parse i3s tile content: unknown size of data: ${e}`)}}var A0e="String",T0e="Oid32",k0e="Float64",R0e="Int16",Au;(function(a){a[a.DEFAULT=-1]="DEFAULT",a[a.LNGLAT=1]="LNGLAT",a[a.METER_OFFSETS=2]="METER_OFFSETS",a[a.LNGLAT_OFFSETS=3]="LNGLAT_OFFSETS",a[a.CARTESIAN=0]="CARTESIAN"})(Au||(Au={}));async function C0e(e,t){let{attributeName:r,attributeType:i}=t;return r?{[r]:i?uft(i,e):null}:{}}function uft(e,t){switch(e){case A0e:return fft(t);case T0e:return I0e(t);case k0e:return cft(t);case R0e:return lft(t);default:return I0e(t)}}function I0e(e){let t=4;return new Uint32Array(e,t)}function lft(e){let t=4;return new Int16Array(e,t)}function cft(e){let t=8;return new Float64Array(e,t)}function fft(e){let t=0,r=8,i=4,n=[];try{let a=new DataView(e,t,i).getUint32(t,!0),o=new Uint32Array(e,r,a),s=r+a*i;for(let u of o){let l=new TextDecoder("utf-8"),c=new Uint8Array(e,s,u);n.push(l.decode(c)),s+=u}}catch(a){console.error("Parse string attribute error: ",a.message)}return n}var hft="3.4.3";var J_={name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:hft,mimeTypes:["application/binary"],parse:dft,extensions:["bin"],options:{},binary:!0};async function dft(e,t){return e=C0e(e,t),e}function O0e(e){return e.hasOwnProperty("objectIds")?"Oid32":e.hasOwnProperty("attributeValues")?e.attributeValues.valueType:""}async function P0e(e,t,r,i,n){var c;if(!((c=n==null?void 0:n.i3s)==null?void 0:c.colorsByAttribute))return e;let a=i.fields.find(({name:f})=>{var h,d;return f===((d=(h=n==null?void 0:n.i3s)==null?void 0:h.colorsByAttribute)==null?void 0:d.attributeName)});if(!a||!["esriFieldTypeDouble","esriFieldTypeInteger","esriFieldTypeSmallInteger"].includes(a.type))return e;let o=await B0e(a.name,r,i,n);if(!o)return e;let s=i.fields.find(({type:f})=>f==="esriFieldTypeOID");if(!s)return e;let u=await B0e(s.name,r,i,n);if(!u)return e;let l={};for(let f=0;f<u[s.name].length;f++)l[u[s.name][f]]=pft(o[a.name][f],n);for(let f=0;f<t.value.length;f++){let h=l[t.value[f]];!h||e.value.set(h,f*4)}return e}function pft(e,t){var u;if(!((u=t==null?void 0:t.i3s)==null?void 0:u.colorsByAttribute))return[255,255,255,255];let{minValue:r,maxValue:i,minColor:n,maxColor:a}=t.i3s.colorsByAttribute,o=(e-r)/(i-r),s=[255,255,255,255];for(let l=0;l<n.length;l++)s[l]=Math.round((a[l]-n[l])*o+n[l]);return s}async function B0e(e,{attributeUrls:t},{attributeStorageInfo:r},i){var u;let n=r.findIndex(({name:l})=>e===l);if(n===-1)return null;let a=Yh(t[n],(u=i==null?void 0:i.i3s)==null?void 0:u.token),o=O0e(r[n]);return await ci(a,J_,{attributeName:e,attributeType:o})}var zk=new $h.Vector3([0,0,0]);function mft(e){switch(e){case"ktx-etc2":case"dds":return f2;case"ktx2":return Nd;case"jpg":case"png":default:return Og}}var gft="i3s-attribute-type";async function M0e(e,t,r,i,n){var o;let a={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new $h.Matrix4,coordinateSystem:0,byteLength:0,texture:null};if(t.textureUrl){let s=Yh(t.textureUrl,(o=i==null?void 0:i.i3s)==null?void 0:o.token),u=mft(t.textureFormat),c=await(await fetch(s,i==null?void 0:i.fetch)).arrayBuffer();if(i==null?void 0:i.i3s.decodeTextures){if(u===Og){let f=_t(ce({},t.textureLoaderOptions),{image:{type:"data"}});try{a.texture=await n.parse(c,f)}catch{a.texture=await rl(c,u,f)}}else if(u===f2||u===Nd){let f=await ci(c,u,t.textureLoaderOptions);u===Nd&&(f=f[0]),a.texture={compressed:!0,mipmaps:!1,width:f[0].width,height:f[0].height,data:f}}}else a.texture=c}return a.material=Aft(t.materialDefinition,a.texture),a.material&&(a.texture=null),await vft(e,a,t,r,i)}async function vft(e,t,r,i,n){var f,h;let a=e.byteLength,o,s,u=0,l=0,c;if(r.isDracoGeometry){let d=await rl(e,wg,{draco:{attributeNameEntry:gft}});s=d.header.vertexCount,c=(f=d.indices)==null?void 0:f.value;let{POSITION:p,NORMAL:y,COLOR_0:g,TEXCOORD_0:b,["feature-index"]:E,["uv-region"]:S}=d.attributes;o={position:p,normal:y,color:g,uv0:b,uvRegion:S,id:E},yft(o,d);let k=Cft(E);k&&Rft(o,k)}else{let{vertexAttributes:d,ordering:p,featureAttributes:y,featureAttributeOrder:g}=i.store.defaultGeometrySchema,b=_ft(e,i);u=b.byteOffset,s=b.vertexCount,l=b.featureCount;let{attributes:E,byteOffset:S}=F0e(e,u,d,s,p),{attributes:k}=F0e(e,S,y,l,g);kft(k),o=bft(E,k)}if(!((h=n==null?void 0:n.i3s)==null?void 0:h.coordinateSystem)||n.i3s.coordinateSystem===Au.METER_OFFSETS){let d=wft(o.position,r);t.modelMatrix=d.invert(),t.coordinateSystem=Au.METER_OFFSETS}else t.modelMatrix=Sft(o.position),t.coordinateSystem=Au.LNGLAT_OFFSETS;o.color=await P0e(o.color,o.id,r,i,n),t.attributes={positions:o.position,normals:o.normal,colors:D0e(o.color),texCoords:o.uv0,uvRegions:D0e(o.uvRegion||o.region)},t.indices=c||null,o.id&&o.id.value&&(t.featureIds=o.id.value);for(let d in t.attributes)t.attributes[d]||delete t.attributes[d];return t.vertexCount=s,t.byteLength=a,t}function yft(e,t){for(let r in t.loaderData.attributes){let i=t.loaderData.attributes[r];switch(i.name){case"POSITION":e.position.metadata=i.metadata;break;case"feature-index":e.id.metadata=i.metadata;break;default:break}}}function bft(e,t){return ce(ce({},e),t)}function D0e(e){return e&&(e.normalized=!0,e)}function _ft(e,t){let r=0,i=0,n=0;for(let{property:a,type:o}of t.store.defaultGeometrySchema.header){let s=CL(o);switch(a){case X_.vertexCount:i=new s(e,0,4)[0],r+=ev(o);break;case X_.featureCount:n=new s(e,4,4)[0],r+=ev(o);break;default:break}}return{vertexCount:i,featureCount:n,byteOffset:r}}function F0e(e,t,r,i,n){let a={};for(let o of n)if(r[o]){let{valueType:s,valuesPerElement:u}=r[o];if(t+i*u*ev(s)<=e.byteLength){let l=e.slice(t),c;if(s==="UInt64")c=xft(l,i*u,ev(s));else{let f=CL(s);c=new f(l,0,i*u)}switch(a[o]={value:c,type:S0e[s],size:u},o){case"color":a.color.normalized=!0;break;case"position":case"region":case"normal":default:}t=t+i*u*ev(s)}else if(o!=="uv0")break}return{attributes:a,byteOffset:t}}function xft(e,t,r){let i=[],n=new DataView(e),a=0;for(let o=0;o<t;o++){let s=n.getUint32(a,!0),u=n.getUint32(a+4,!0),l=s+2**32*u;i.push(l),a+=r}return new Uint32Array(i)}function wft(e,t){let r=t.mbs,i=e.value,n=e.metadata,a=new $h.Matrix4,o=new $h.Vector3(r[0],r[1],r[2]),s=new $h.Vector3;return Gk.Ellipsoid.WGS84.cartographicToCartesian(o,s),Gk.Ellipsoid.WGS84.eastNorthUpToFixedFrame(s,a),e.value=Eft(i,n,o),a}function Eft(e,t={},r){let i=new Float64Array(e.length),n=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<i.length;o+=3)i[o]=e[o]*n+r.x,i[o+1]=e[o+1]*a+r.y,i[o+2]=e[o+2]+r.z;for(let o=0;o<i.length;o+=3)Gk.Ellipsoid.WGS84.cartographicToCartesian(i.subarray(o,o+3),zk),i[o]=zk.x,i[o+1]=zk.y,i[o+2]=zk.z;return i}function Sft(e){var a,o;let t=e.metadata,r=((a=t==null?void 0:t["i3s-scale_x"])==null?void 0:a.double)||1,i=((o=t==null?void 0:t["i3s-scale_y"])==null?void 0:o.double)||1,n=new $h.Matrix4;return n[0]=r,n[5]=i,n}function Aft(e,t){let r;return e?r=_t(ce({},e),{pbrMetallicRoughness:e.pbrMetallicRoughness?ce({},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=j0e(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=j0e(r.pbrMetallicRoughness.baseColorFactor)),t&&Tft(r,t),r}function j0e(e){let t=[...e];for(let r=0;r<e.length;r++)t[r]=e[r]/255;return t}function Tft(e,t){let r={source:{image:t}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture=_t(ce({},e.pbrMetallicRoughness.baseColorTexture),{texture:r}):e.emissiveTexture?e.emissiveTexture=_t(ce({},e.emissiveTexture),{texture:r}):e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture=_t(ce({},e.pbrMetallicRoughness.metallicRoughnessTexture),{texture:r}):e.normalTexture?e.normalTexture=_t(ce({},e.normalTexture),{texture:r}):e.occlusionTexture&&(e.occlusionTexture=_t(ce({},e.occlusionTexture),{texture:r}))}function kft(e){let{id:t,faceRange:r}=e;if(!t||!r)return;let i=t.value,n=r.value,a=n[n.length-1]+1,o=new Uint32Array(a*3),s=0,u=0;for(let l=1;l<n.length;l+=2){let c=Number(i[s]),f=n[l],h=n[l-1],d=f-h+1,p=u+d*3;o.fill(c,u,p),s++,u=p}e.id.value=o}function Rft(e,t){let r=e.id.value,i=new Float32Array(r.length);for(let n=0;n<r.length;n++)i[n]=t[r[n]];e.id.value=i}function Cft(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 Ift="3.4.3",L0e={name:"I3S Content (Indexed Scene Layers)",id:Ln?"i3s-content":"i3s-content-nodejs",module:"i3s",worker:!0,version:Ift,mimeTypes:["application/octet-stream"],parse:Oft,extensions:["bin"],options:{"i3s-content":{}}};async function Oft(e,t,r){let{tile:i,_tileOptions:n,tileset:a,_tilesetOptions:o}=(t==null?void 0:t.i3s)||{},s=n||i,u=o||a;return!s||!u?null:await M0e(e,s,u,t,r)}var q0e=Le(cl()),OL=Le(Ya());var Pft="3.4.3";async function Bft(e){return JSON.parse(new TextDecoder().decode(e))}var N0e={name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:Pft,mimeTypes:["application/json"],parse:Mft,extensions:["json"],options:{}};async function Mft(e){return e=Bft(e),e}var Hk=class{constructor(t,r){this.nodePages=[];this.pendingNodePages=[];this.textureDefinitionsSelectedFormats=[];this.textureLoaderOptions={};var i,n;this.tileset=ce({},t),this.nodesPerPage=((i=t.nodePages)==null?void 0:i.nodesPerPage)||64,this.lodSelectionMetricType=(n=t.nodePages)==null?void 0:n.lodSelectionMetricType,this.options=r,this.nodesInNodePages=0,this.initSelectedFormatsForTextureDefinitions(t)}async getNodeById(t){var n;let r=Math.floor(t/this.nodesPerPage);if(!this.nodePages[r]&&!this.pendingNodePages[r]){let a=Yh(`${this.tileset.url}/nodepages/${r}`,(n=this.options.i3s)==null?void 0:n.token);this.pendingNodePages[r]={status:"Pending",promise:ci(a,N0e,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 i=t%this.nodesPerPage;return this.nodePages[r].nodes[i]}async formTileFromNodePages(t){let r=await this.getNodeById(t),i=[],n=[];for(let d of r.children||[])n.push(this.getNodeById(d));let a=await Promise.all(n);for(let d of a)i.push({id:d.index.toString(),obb:d.obb});let o,s,u,l="jpg",c=[],f=!1;if(r&&r.mesh){let{url:d,isDracoGeometry:p}=r.mesh.geometry&&this.getContentUrl(r.mesh.geometry)||{isDracoGeometry:!1};o=d,f=p;let{textureData:y,materialDefinition:g}=this.getInformationFromMaterial(r.mesh.material);u=g,l=y.format||l,y.name&&(s=`${this.tileset.url}/nodes/${r.mesh.material.resource}/textures/${y.name}`),this.tileset.attributeStorageInfo&&(c=w0e(this.tileset,r.mesh.attribute.resource))}let h=this.getLodSelection(r);return IL({id:t.toString(),lodSelection:h,obb:r.obb,contentUrl:o,textureUrl:s,attributeUrls:c,materialDefinition:u,textureFormat:l,textureLoaderOptions:this.textureLoaderOptions,children:i,isDracoGeometry:f})}getContentUrl(t){let r=null,i=this.tileset.geometryDefinitions[t.definition],n=-1;if(this.options.i3s&&this.options.i3s.useDracoGeometry&&(n=i.geometryBuffers.findIndex(a=>a.compressedAttributes&&a.compressedAttributes.encoding==="draco")),n===-1&&(n=i.geometryBuffers.findIndex(a=>!a.compressedAttributes)),n!==-1){let a=Boolean(i.geometryBuffers[n].compressedAttributes);r={url:`${this.tileset.url}/nodes/${t.resource}/geometries/${n}`,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 i,n,a;let r={textureData:{name:null}};if(t){let o=(i=this.tileset.materialDefinitions)==null?void 0:i[t.definition];if(o){r.materialDefinition=o;let s=(a=(n=o==null?void 0:o.pbrMetallicRoughness)==null?void 0:n.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(),i=t.textureSetDefinitions||[];for(let n of i){let a=n&&n.formats||[],o=null;for(let s of r){let u=a.find(l=>l.format===s);if(u){o=u;break}}o&&o.format==="ktx2"&&(this.textureLoaderOptions.basis={format:Ig(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(o)}}getSupportedTextureFormats(){let t=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){let r=Mb();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 U0e(e,t){let r=t.url||"",i;e.geometryData&&(i=`${r}/${e.geometryData[0].href}`);let n;e.textureData&&(n=`${r}/${e.textureData[0].href}`);let a;return e.attributeData&&(a=x0e(r,e)),IL(_t(ce({},e),{url:r,contentUrl:i,textureUrl:n,attributeUrls:a,isDracoGeometry:!1}))}function IL(e){var u,l;let t={},r=[0,0,0,1];if(e.mbs)r=e.mbs,t.sphere=[...OL.Ellipsoid.WGS84.cartographicToCartesian(e.mbs.slice(0,3)),e.mbs[3]];else if(e.obb){t.box=[...OL.Ellipsoid.WGS84.cartographicToCartesian(e.obb.center),...e.obb.halfSize,...e.obb.quaternion];let f=new q0e.OrientedBoundingBox().fromCenterHalfSizeQuaternion(t.box.slice(0,3),e.obb.halfSize,e.obb.quaternion).getBoundingSphere();t.sphere=[...f.center,f.radius],r=[...e.obb.center,f.radius]}let i=(u=e.lodSelection)==null?void 0:u[0].metricType,n=(l=e.lodSelection)==null?void 0:l[0].maxError,a=e.transform,o=Fd.MESH,s=Ba.REPLACE;return _t(ce({},e),{mbs:r,boundingVolume:t,lodMetricType:i,lodMetricValue:n,transformMatrix:a,type:o,refine:s})}async function G0e(e,t,r){var i;if(e.url=r.url,e.nodePages)e.nodePagesTile=new Hk(e,t),e.root=e.nodePagesTile.formTileFromNodePages(0);else{let n=Yh(`${e.url}/nodes/root`,(i=t.i3s)==null?void 0:i.token);e.root=await ci(n,e.loader,_t(ce({},t),{i3s:_t(ce({},t.i3s),{loadContent:!1,isTileHeader:!0,isTileset:!1})}))}e.basePath=e.url,e.type=aa.I3S,e.lodMetricType=e.root.lodMetricType,e.lodMetricValue=e.root.lodMetricValue}var Dft="3.4.3",Fft=/layers\/[0-9]+$/,jft=/nodes\/([0-9-]+|root)$/,Lft="504b0304",Nft="PointCloud",Vk={name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:Dft,mimeTypes:["application/octet-stream"],parse:qft,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:Au.METER_OFFSETS,colorsByAttribute:null}}};async function qft(e,t={},r){let i=r.url;if(t.i3s=t.i3s||{},Hft(e)===Lft)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let a;t.i3s.isTileset==="auto"?a=Fft.test(i):a=t.i3s.isTileset;let o;return t.isTileHeader==="auto"?o=jft.test(i):o=t.i3s.isTileHeader,a?e=await Gft(e,t,r):o?e=await zft(e,r):e=await Uft(e,t),e}async function Uft(e,t){return await rl(e,L0e,t)}async function Gft(e,t,r){let i=JSON.parse(new TextDecoder().decode(e));if((i==null?void 0:i.layerType)===Nft)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return i.loader=Vk,await G0e(i,t,r),i}async function zft(e,t){return e=JSON.parse(new TextDecoder().decode(e)),U0e(e,t)}function Hft(e){return e instanceof ArrayBuffer?[...new Uint8Array(e,0,4)].map(t=>t.toString(16).padStart(2,"0")).join(""):null}var z0e=Le(Tr()),H0e=Le(Ya()),V0e=Le(cl());function PL(e,t){let r=[e.center[0],e.center[1],e.center[2]+t.getHeight(e.center[1],e.center[0])],i=H0e.Ellipsoid.WGS84.cartographicToCartesian(r,new z0e.Vector3),n=new V0e.OrientedBoundingBox().fromCenterHalfSizeQuaternion(i,e.halfSize,e.quaternion);return[...n.center,...n.halfAxes.toArray()]}var Wk=Le(vu()),Vft=()=>({version:{path:"version",default:"1.0"}}),W0e=()=>({boundingVolume:{path:"boundingVolume"},geometricError:{path:"geometricError"},content:{path:"content"},children:{path:"children",transform:e=>e.map(t=>(0,Wk.default)(t,W0e()))}}),K0e=()=>({asset:{path:"asset",transform:e=>(0,Wk.default)(e,Vft())},geometricError:{path:"root",transform:e=>e.geometricError},root:{path:"root",transform:e=>(0,Wk.default)(e,W0e())}});var Wft="3.4.3",BL={id:"3d-tiles-attributes",name:"3DTiles Attributes Worker",module:"tile-converter",version:Wft,options:{featureAttributes:null}};function Y0e(e,t){return jy(BL,e,t)}var Kft="I3S",Q_=class{constructor(){this.workerSource={};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){if(ji)return console.log(Q0),Q0;let{inputUrl:r,outputPath:i,tilesetName:n,maxDepth:a,egmFilePath:o}=t;this.conversionStartTime=ML.default.hrtime(),this.options={maxDepth:a},console.log("Loading egm file..."),this.geoidHeightModel=await ci(o,Lk),console.log("Loading egm file completed!"),await this.loadWorkers();let s=await ci(r,Vk,{});this.sourceTileset=new xg(s,{loadOptions:{_nodeWorkers:!0,reuseWorkers:!0,"i3s-content-nodejs":{workerUrl:"./modules/i3s/dist/i3s-content-nodejs-worker.js"},i3s:{coordinateSystem:Au.LNGLAT_OFFSETS,decodeTextures:!1}}}),await this.sourceTileset.tilesetInitializationPromise;let u=this.sourceTileset.root;u.header.obb||(u.header.obb=fL(u.header.mbs)),this.tilesetPath=(0,$0e.join)(`${i}`,`${n}`),this.attributeStorageInfo=s.attributeStorageInfo;try{await G_(this.tilesetPath)}catch{}let l={boundingVolume:{box:PL(u.header.obb,this.geoidHeightModel)},geometricError:vL(u),children:[]};await this._addChildren(u,l,1);let c=(0,X0e.default)({root:l},K0e());await Hn(this.tilesetPath,JSON.stringify(c),"tileset.json"),this._finishConversion({slpk:!1,outputPath:i,tilesetName:n}),En.getWorkerFarm({}).destroy()}async convertChildNode(t,r,i,n){var o;let a=await this._loadChildNode(t,n);if(t.children.push(a),a.contentUrl){await this.sourceTileset._loadTile(a),this.vertexCounter+=a.content.vertexCount;let s=null;this.attributeStorageInfo&&(s=await this._loadChildAttributes(a,this.attributeStorageInfo)),a.header.obb||(a.header.obb=fL(a.header.mbs));let u={box:PL(a.header.obb,this.geoidHeightModel)},l={boundingVolume:u,geometricError:vL(a),children:[]},c={tileContent:a.content,textureFormat:(o=a==null?void 0:a.header)==null?void 0:o.textureFormat},f=await Y0e(c,{source:this.workerSource.tile3dWorkerSource,featureAttributes:s});l.content={uri:`${a.id}.b3dm`,boundingVolume:u},await Hn(this.tilesetPath,new Uint8Array(f),`${a.id}.b3dm`),r.children.push(l),a.unloadContent(),await this._addChildren(a,l,i+1)}else await this._addChildren(a,r,i+1)}async _addChildren(t,r,i){if(this.options.maxDepth&&i>this.options.maxDepth)return;let n=[];for(let a of t.header.children||[])n.push(this.convertChildNode(t,r,i,a));await Promise.all(n)}async _loadChildNode(t,r){let i;if(this.sourceTileset.tileset.nodePages)console.log(`Node conversion: ${r.id}`),i=await this.sourceTileset.tileset.nodePagesTile.formTileFromNodePages(r.id);else{let{loader:n}=this.sourceTileset,a=this._relativeUrlToFullUrl(t.url,r.href),o={i3s:_t(ce({},this.sourceTileset.loadOptions),{isTileHeader:!0,loadContent:!1})};console.log(`Node conversion: ${a}`),i=await ci(a,n,o)}return new _c(this.sourceTileset,i,t)}_relativeUrlToFullUrl(t,r){let i=t.split("/"),n=r.split("/");for(let a of n)switch(a){case".":continue;case"..":i=i.slice(0,-1);break;default:i.push(a)}return i.join("/")}async _loadChildAttributes(t,r){let i=[],{attributeUrls:n}=t.header;for(let o=0;o<n.length;o++){let s=n[o],u=r[o],l={attributeName:u.name,attributeType:this._getAttributeType(u)};i.push(ci(s,J_,l))}let a=await Promise.all(i);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 i=t[r];for(let n in i)i[n]=Array.from(i[n])}}async _finishConversion(t){let r=await Bk(t),i=ML.default.hrtime(this.conversionStartTime),n=Pk(i);console.log("------------------------------------------------"),console.log(`Finish conversion of ${Kft}`),console.log(`Total conversion time: ${n}`),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",r," bytes"),console.log("------------------------------------------------")}async loadWorkers(){console.log("Loading workers source...");let t=nu(BL,ce({},Po())),i=await(await na(t)).text();this.workerSource.tile3dWorkerSource=i,console.log("Loading workers source completed!")}};var J0e=Le(uL()),Yft="3.4.3",DL={id:"zip",module:"zip",name:"Zip Archive",version:Yft,extensions:["zip"],mimeTypes:["application/zip"],category:"archive",tests:["PK"],options:{},parse:$ft};async function $ft(e,t={}){let r=[],i={};try{let n=new J0e.default;return(await n.loadAsync(e,t)).forEach((o,s)=>{let u=s.name,l=Xft(n,u,t).then(c=>{i[o]=c});r.push(l)}),await Promise.all(r),i}catch(n){throw t.log.error(`Unable to read zip archive: ${n}`),n}}async function Xft(e,t,r={}){try{return await e.file(t).async(r.dataType||"arraybuffer")}catch(i){return r.log.error(`Unable to read ${t} from zip archive: ${i}`),i}}var FL=Le(require("path"));var Jft="3.4.3",Qft="https://raw.githubusercontent.com/visgl/deck.gl-data/master/egm/egm2008-5.zip",jL=class{async install(t="",r=""){console.log('Installing "EGM2008-5" model...');let i=await ci(Qft,DL,{}),n=process.cwd();t&&(n=(0,FL.join)(n,t)),await Hn(n,new Uint8Array(i["geoids/egm2008-5.pgm"]),"egm2008-5.pgm"),console.log('Installing "I3S Content Loader worker"'),await this.installWorker("i3s","i3s-content-nodejs-worker.js",r),console.log('Installing "Draco Loader worker"'),await this.installWorker("draco","draco-nodejs-worker.js",r),console.log('Installing "Basis Loader worker"'),await this.installWorker("textures","basis-nodejs-worker.js",r),console.log('Installing "join-images" npm package'),await new Df().start({command:"npm",arguments:["install","sharp@^0.30.4","join-images@^1.1.3"],wait:0}),console.log("All dependencies were installed succesfully.")}async installWorker(t,r,i){let a=await(await na(`https://unpkg.com/@loaders.gl/${t}@${Jft}/dist/${r}`)).arrayBuffer();if(!a)return;let o=(0,FL.join)(process.cwd(),i,"modules",t,"dist");await Hn(o,a,r)}};var LL={I3S:"I3S",_3DTILES:"3DTILES"};async function Zft(){let[,,...e]=process.argv;e.length===0&&NL();let t=rht(e),r=iht(t);if(r.installDependencies){new jL().install("deps");return}let i=tht(r);await eht(i)}Zft().catch(e=>{console.log(e),process.exit(1)});function NL(){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 [Will generate obb and mbs bounding volumes from geometry]"),console.log("--validate [Enable validation]"),process.exit(0)}async function eht(e){switch(console.log("------------------------------------------------"),console.log(`Starting conversion of ${e.inputType}`),console.log("------------------------------------------------"),e.inputType.toUpperCase()){case LL.I3S:new Q_().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,egmFilePath:e.egm});break;case LL._3DTILES:await new $_().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});break;default:NL()}}function tht(e){let t={name:()=>console.log("Missed: --name [Tileset name]"),output:()=>console.log("Missed: --output [Output path name]"),sevenZipExe:()=>console.log("Missed: --7zExe [7z archiver executable path]"),egm:()=>console.log("Missed: --egm [*.pgm earth gravity model file path]"),tileset:()=>console.log("Missed: --tileset [tileset.json file]"),inputType:()=>console.log("Missed/Incorrect: --input-type [tileset input type: I3S or 3DTILES]")},r=[];for(let i in t){let n=e[i],a=Boolean(n)&&i==="inputType"&&!Object.values(LL).includes(n.toUpperCase());(!n||a)&&r.push(t[i])}return r.length&&(r.forEach(i=>i()),process.exit(1)),e}function rht(e){return e.reduce((t,r)=>{let i=r.indexOf("="),n=r.slice(0,i),a=r.slice(i+1,r.length);return r.includes("=")&&r.startsWith("--")&&a?t.concat(n,a):t.concat(r)},[])}function iht(e){let t={output:"data",instantNodeWriting:!1,mergeMaterials:!0,sevenZipExe:"C:\\Program Files\\7-Zip\\7z.exe",egm:(0,Q0e.join)(process.cwd(),"deps","egm2008-5.pgm"),draco:!0,installDependencies:!1,generateTextures:!1,generateBoundingVolumes:!1,validate:!1,slpk:!1};return e.forEach((r,i)=>{if(r.indexOf("--")===0)switch(r){case"--input-type":t.inputType=$c(i,e);break;case"--tileset":t.tileset=nht(i,e);break;case"--name":t.name=$c(i,e);break;case"--output":t.output=$c(i,e);break;case"--instant-node-writing":t.instantNodeWriting=Xh(i,e);break;case"--split-nodes":t.mergeMaterials=Xh(i,e);break;case"--max-depth":t.maxDepth=aht(i,e);break;case"--slpk":t.slpk=Xh(i,e);break;case"--7zExe":t.sevenZipExe=$c(i,e);break;case"--egm":t.egm=$c(i,e);break;case"--token":t.token=$c(i,e);break;case"--no-draco":t.draco=Xh(i,e);break;case"--validate":t.validate=Xh(i,e);break;case"--install-dependencies":t.installDependencies=Xh(i,e);break;case"--generate-textures":t.generateTextures=Xh(i,e);break;case"--generate-bounding-volumes":t.generateBoundingVolumes=Xh(i,e);break;case"--help":NL();break;default:console.warn(`Unknown option ${r}`),process.exit(0)}}),t}function $c(e,t){if(e+1>=t.length)return"";let r=t[e+1];return r.indexOf("--")===0?"":r}function nht(e,t){let r=$c(e,t);return console.log(`Input tileset value: ${r}`),console.log(`Modified tileset value: ${r.replace(/\\/g,"/")}`),r.replace(/\\/g,"/")}function aht(e,t){let r=$c(e,t),i=Number.parseInt(r);return isFinite(i)?i:NaN}function Xh(e,t){let r=$c(e,t).toLowerCase().trim();return["--no-draco","--split-nodes"].includes(t[e])&&!r?!1:!r||r==="true"}
125
125
  /*!
126
126
  * Copyright 2010 LearnBoost <dev@learnboost.com>
127
127
  *